New to Claude Skills? Learn how to install them →

openai on GitHub

Test Coverage Improver

OfficialFree

Enhance your test coverage effectively and collaboratively.

Get this skill

Free · Opens the source repo

What Test Coverage Improver does

The Test Coverage Improver skill is designed for developers who want to assess and enhance test coverage in their projects, particularly within the OpenAI Agents Python repository. This skill automates the process of running coverage tests, analyzing the results, and identifying areas that require additional testing. By utilizing this skill, developers can ensure that their code is thoroughly tested, which is crucial for maintaining software quality and reliability.

To begin using the skill, developers execute the command make coverage from the repository root. This generates the necessary coverage data files, including .coverage and coverage.xml. The skill then summarizes the coverage results, highlighting the files with the lowest coverage and providing insights into uncovered lines and paths. This allows developers to focus their testing efforts where they are most needed, ensuring that critical parts of the codebase are adequately tested.

The skill goes beyond mere analysis; it proposes specific test scenarios based on the identified gaps in coverage. Developers receive a concise list of suggested tests, including the expected outcomes and potential coverage gains. Before implementing any changes, the skill prompts the user for approval, fostering a collaborative approach to test development. Once approved, the skill writes the tests and reruns the coverage suite to verify improvements, ensuring that the code remains robust against future changes.

This skill is particularly beneficial for teams aiming to maintain high code quality standards and for individual developers seeking to improve their testing practices. By streamlining the process of identifying and addressing coverage gaps, the Test Coverage Improver skill helps users create more reliable software with less manual effort.

When to use it

Use this skill when you need to assess or improve test coverage, especially after code changes or when coverage thresholds are not met.

When not to use it

This skill may not be suitable for projects that do not require extensive testing or where coverage is already deemed sufficient.

What you can build with it

Improving Coverage After Code Changes

After making significant changes to your codebase, use this skill to assess the impact on test coverage and identify areas needing additional tests.

Meeting Coverage Thresholds

When your project fails to meet established coverage thresholds, this skill helps pinpoint gaps and suggests targeted tests to improve compliance.

Collaborative Test Development

In team environments, use this skill to facilitate discussions around test proposals, ensuring all team members agree on the testing strategy before implementation.

How to install Test Coverage Improver

View source

1. Install with the skills CLI

npx skills add openai/openai-agents-python/test-coverage-improver --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by openai

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

  1. From the repo root run make coverage to regenerate .coverage data and coverage.xml.
  2. Collect artifacts: .coverage and coverage.xml, plus the console output from coverage report -m for drill-downs.
  3. Summarize coverage: total percentages, lowest files, and uncovered lines/paths.
  4. Draft test ideas per file: scenario, behavior under test, expected outcome, and likely coverage gain.
  5. Ask the user for approval to implement the proposed tests; pause until they agree.
  6. After approval, write the tests in tests/, rerun make coverage, and then run $code-change-verification before marking work complete.

Workflow Details

  • Run coverage: Execute make coverage at repo root. Avoid watch flags and keep prior coverage artifacts only if comparing trends.
  • Parse summaries efficiently:
    • Prefer the console output from coverage report -m for file-level totals; fallback to coverage.xml for tooling or spreadsheets.
    • Use uv run coverage html to generate htmlcov/index.html if you need an interactive drill-down.
  • Prioritize targets:
    • Public APIs or shared utilities in src/agents/ before examples or docs.
    • Files with low statement coverage or newly added code at 0%.
    • Recent bug fixes or risky code paths (error handling, retries, timeouts, concurrency).
  • Design impactful tests:
    • Hit uncovered paths: error cases, boundary inputs, optional flags, and cancellation/timeouts.
    • Cover combinational logic rather than trivial happy paths.
    • Place tests under tests/ 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.

Frequently asked questions about Test Coverage Improver

Similar skills