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

test-coverage-improver

GitHub

用于评估和提升测试覆盖率,执行覆盖度分析,识别低覆盖代码并提议高影响力测试方案,在用户批准前不修改代码。

.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 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 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

  • 7450f54 Current 2026-08-28 16:31

    移除 Windows 兼容性相关的 CI=1 环境变量设置,以修复 Windows 上的测试脚本问题。

  • 13f68fa 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-final-review/SKILL.md
.agents/skills/implementation-strategy/SKILL.md
.agents/skills/integration-tests/SKILL.md
.agents/skills/maintainer-review/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-kickoff/SKILL.md
.agents/skills/sensitive-logging-audit/SKILL.md

Metadata

Files
0
Version
7450f54
Hash
af2db832
Indexed
2026-07-25 11:31

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-02 04:50
浙ICP备14020137号-1 $bản đồ khách truy cập$