test-coverage-improver

A workflow for measuring and improving automated test coverage in the OpenAI Agents Python repository. Test coverage shows which parts of the code are exercised by tests.

In plain words
What is it for?
Use it to run coverage, inspect reports, propose high-impact tests, ask for approval, then add approved tests and verify the results.
Why use it?
It identifies files and code paths with the largest testing gaps before any tests are changed, reducing guesswork about where new tests would help most.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/openai/openai-agents-python/test-coverage-improver
Any agent
npx skills add openai/openai-agents-python --skill test-coverage-improver
Clone the repo
git clone --depth 1 https://github.com/openai/openai-agents-python

Made for: Claude Code, Codex.

Per session 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 578 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.00578
Opus 5 $0.00023 $0.00289
Sonnet 5 $0.00009 $0.00116
Haiku 4.5 $0.00005 $0.00058

Measured 2d ago against content hash 202367c31db3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-coverage-improver scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/test-coverage-improver/SKILL.md · 43 lines

How it starts

The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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.

Read the full file on GitHub · 43 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 43 lines · 47 tokens per session scan A 202367c31db3

Subscribe to this mod's changes

test-coverage-improver is a skill published in the GitHub repository openai/openai-agents-python (29,075 stars, last pushed 4d ago), licensed MIT. It adds 47 tokens to every session and 578 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.