
test-coverage-improver
✓ Official★ 3,300by openai · part of openai/openai-agents-js
Improve test coverage in the OpenAI Agents JS monorepo: run `pnpm test:coverage`, inspect coverage artifacts, identify low-coverage files and branches, propose…
This is the playbook your agent receives when the skill activates — you don't need to read it to use the skill, but it's here to audit before installing.
name: test-coverage-improver
description: '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.'
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.
Workflow Details
- Run coverage: Execute
CI=1 pnpm test:coverageat repo root. Avoid watch flags and keep prior coverage artifacts only if comparing trends. - Parse summaries efficiently:
- Prefer
coverage/coverage-summary.jsonfor file-level totals; fallback tocoverage/coverage-final.jsonif the summary file is absent. - Use
coverage/lcov.infoorcoverage/lcov-report/index.htmlto spot branch- and line-level holes.
- Prefer
- Prioritize targets:
- Public APIs or shared utilities in
packages/*/srcbefore 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).
- Public APIs or shared utilities in
- 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/, orassets/unless needed later. - If coverage artifacts are missing or stale, rerun
pnpm test:coverageinstead of guessing.
npx skills add https://github.com/openai/openai-agents-js --skill test-coverage-improverRun this in your project — your agent picks the skill up automatically.
Quick Start
- From the repo root run
pnpm test:coverage(setCI=1if needed) to regeneratecoverage/. - Collect artifacts:
coverage/coverage-summary.json(preferred) orcoverage/coverage-final.json, pluscoverage/lcov.infoandcoverage/lcov-report/index.htmlfor 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-verificationbefore marking work complete.
No common issues documented yet. If you hit a problem, the repository's GitHub Issues page is the best place to look.