mcpbeat

Test Coverage Improver

openai/test-coverage-improver

Improve test coverage in the OpenAI Agents JS monorepo: run `pnpm test:coverage`, inspect coverage artifacts, identify low-coverage files and branches, propose high-impact tests, and confirm with the user before writing tests.

790 tokens
context cost
the whole folder, loaded on every use
2
files
instructions only
0
copies elsewhere
how many repositories repackaged it
3526
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/openai/openai-agents-python --skill test-coverage-improver

What comes with it

264 bytes besides the instruction
agents/openai.yaml

The instruction itself

5 sections, as written by the author

Test Coverage Improver

Overview

Use this skill whenever coverage needs assessment or improvement (coverage regressions, failing thresholds, or user requests for stronger tests). It runs the coverage suite, analyzes results, highlights the biggest gaps, and prepares test additions while confirming with the user before changing code.

Quick Start

  • From the repo root run pnpm test:coverage (set CI=1 if needed) to regenerate coverage/.
  • Collect artifacts: coverage/coverage-summary.json (preferred) or coverage/coverage-final.json, plus coverage/lcov.info and coverage/lcov-report/index.html for drill-downs.
  • Summarize coverage: total percentages, lowest files, branches under 80%, and uncovered lines/paths.
  • Draft test ideas per file: scenario, behavior under test, expected outcome, and likely coverage gain.
  • Ask the user for approval to implement the proposed tests; pause until they agree.
  • After approval, write the tests in the relevant package, rerun pnpm test:coverage, and then run $code-change-verification before marking work complete.

Workflow Details

  • Run coverage: Execute CI=1 pnpm test:coverage at repo root. Avoid watch flags and keep prior coverage artifacts only if comparing trends.
  • Parse summaries efficiently:
  • Prefer coverage/coverage-summary.json for file-level totals; fallback to coverage/coverage-final.json if the summary file is absent.
  • Use coverage/lcov.info or coverage/lcov-report/index.html to spot branch- and line-level holes.
  • Prioritize targets:
  • Public APIs or shared utilities in packages/*/src before examples or docs.
  • Files with statements/branches below 80% or newly added code at 0%.
  • Recent bug fixes or risky code paths (error handling, retries, timeouts, concurrency).
  • Design impactful tests:
  • Hit uncovered branches: error cases, boundary inputs, optional flags, and cancellation/timeouts.
  • Cover combinational logic rather than trivial happy paths.
  • Place unit tests near the package (packages/<pkg>/test/*.test.ts) and avoid flaky async timing.
  • Coordinate with the user: Present a numbered, concise list of proposed test additions and expected coverage gains. Ask explicitly before editing code or fixtures.
  • After implementation: Rerun coverage, report the updated summary, and note any remaining low-coverage areas.

Notes

  • Keep any added comments or code in English.
  • Do not create scripts/, references/, or assets/ unless needed later.
  • If coverage artifacts are missing or stale, rerun pnpm test:coverage instead of guessing.

How to use it

Copy the folder

Take openai/test-coverage-improver from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.