Agent Skillsopenai/openai-agents-js › test-coverage-improver

test-coverage-improver

GitHub

用于评估和提升OpenAI Agents JS仓库的测试覆盖率。自动运行覆盖工具,分析低覆盖率文件与分支,提出高影响测试方案,并在用户确认后编写测试代码以增强质量。

.agents/skills/test-coverage-improver/SKILL.md openai/openai-agents-js

Trigger Scenarios

需要评估或改进测试覆盖率时 出现覆盖率回归或阈值失败时 用户请求增强测试时

Install

npx skills add openai/openai-agents-js --skill test-coverage-improver -g -y
More Options

Non-standard path

npx skills add https://github.com/openai/openai-agents-js/tree/main/.agents/skills/test-coverage-improver -g -y

Use without installing

npx skills use openai/openai-agents-js@test-coverage-improver

指定 Agent (Claude Code)

npx skills add openai/openai-agents-js --skill test-coverage-improver -a claude-code -g -y

安装 repo 全部 skill

npx skills add openai/openai-agents-js --all -g -y

预览 repo 内 skill

npx skills add openai/openai-agents-js --list

SKILL.md

Frontmatter
{
    "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.

Quick Start

  1. From the repo root run pnpm test:coverage (set CI=1 if needed) to regenerate coverage/.
  2. 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.
  3. Summarize coverage: total percentages, lowest files, branches under 80%, 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 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.

Version History

  • 13f68fa Current 2026-07-25 11:31

Same Skill Collection

.agents/skills/changeset-validation/SKILL.md
.agents/skills/code-change-verification/SKILL.md
.agents/skills/docs-sync/SKILL.md
.agents/skills/examples-auto-run/SKILL.md
.agents/skills/examples-run-analysis/SKILL.md
.agents/skills/final-release-review/SKILL.md
.agents/skills/implementation-strategy/SKILL.md
.agents/skills/integration-tests/SKILL.md
.agents/skills/openai-knowledge/SKILL.md
.agents/skills/pnpm-upgrade/SKILL.md
.agents/skills/pr-draft-summary/SKILL.md
.agents/skills/runtime-behavior-probe/SKILL.md
examples/docs/sandbox-agents/skills/invoice-total-fixer/SKILL.md
examples/tools/skills/csv-workbench/SKILL.md
.agents/skills/implementation-final-review/SKILL.md
.agents/skills/implementation-kickoff/SKILL.md
.agents/skills/maintainer-review/SKILL.md
.agents/skills/sensitive-logging-audit/SKILL.md

Metadata

Files
0
Version
443c33e
Hash
e9a2f6ab
Indexed
2026-07-25 11:31

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 12:29
浙ICP备14020137号-1 $Гость$