测试覆盖率提升
test-coverage-improver
测量 JS SDK 覆盖率,或解决已测出的覆盖率缺口。用于覆盖率审计和指标回退,而非日常性的测试补充。
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 4.0k
- Forks
- 1.0k
01 前言 Front Matter
- name
- test-coverage-improver
- description
- Measure JS SDK coverage or address measured coverage gaps. Use for coverage audits and metric regressions, not routine test additions.
02 资源文件 5
- 参考文档agents/openai.yaml264 B
- 资产文件assets/Chart.yaml.template801 B
- 资产文件assets/values.yaml.template3.1 KB
- 参考文档references/chart-structure.md11.5 KB
- 脚本scripts/validate-chart.sh6.4 KB
03 SKILL.md 正文
Test Coverage Improver
Use current coverage evidence to identify missing caller-visible behavior tests. Select this workflow for coverage measurement, coverage-metric regressions, or finding gaps from coverage artifacts. When the user already specifies the behaviors to test, use the ordinary implementation/review workflow without coverage measurement unless measurement is also requested. Adding tests alone does not trigger this skill or its final pnpm test:coverage step.
Scope and authorization
For assessment or proposal-only requests, report gaps and suggested tests without editing. When the user requests test improvements or has approved a plan, implement the scoped tests and complete review and verification without asking again. Ask only when a new contract decision, expanded scope, or additional authority is needed. Coverage work never authorizes live API calls or broader sandbox access.
Workflow
- Inspect current
coverage/coverage-summary.jsonorcoverage/coverage-final.json,coverage/lcov.info, and any recorded command/environment evidence. Reuse them only when they represent the relevant source and test state. If missing or stale, runpnpm test:coverageunder the repository's verification sandbox and credential policy; this initial measurement precedes implementation review. Respect host-capacity guidance before broad measurement. - Identify uncovered behavior within the requested scope. Prioritize public behavior and meaningful error, cancellation, and lifecycle paths over percentage-only targets. Use the JSON report,
coverage/lcov.info, orcoverage/lcov-report/index.htmlto locate gaps. Place tests under the relevantpackages/<pkg>/test/directory. - For an assessment, report evidence and proposed scenarios. For authorized implementation, choose tests with independent expected results at the highest controllable caller boundary. Do not add tests that merely reproduce helper logic or enumerate unsupported permutations.
- Implement tests, run affected checks, and complete
$implementation-final-review. Keep iterative verification focused; do not repeatedly run full coverage while review is incomplete. - After clean review, run
pnpm test:coveragefor the final measurement and$code-change-verificationfor the required SDK gates. These have different purposes; reuse an already valid final measurement rather than repeating it. Report coverage changes, verified behaviors, and material gaps that remain.
Reporting
State the scope and age of coverage evidence, the behavior each new test protects, validation results, and unresolved gaps. Keep comments and code in English. Do not treat coverage percentages alone as proof of correctness.
04 同仓库更多 Skills
CSV 文件分析
csv-workbench
分析 /mnt/data 中的 CSV 文件并返回简明的数值摘要。
贷项通知单格式修复
credit-note-fixer
修复贷项通知单(credit note)细小的格式错误,并重新运行指定的精确目标测试命令。
发票总额计算修复
invoice-total-fixer
用于修复沙箱快速入门(quickstart)仓库中的发票总额计算问题。
敏感日志审计与修复
sensitive-logging-audit
审计或修复 JS SDK 诊断信息、异常、日志记录和遥测中的敏感数据暴露问题。
运行时行为探测
runtime-behavior-probe
为本地或线上集成规划运行时行为探测,并在获得明确批准后执行。仅在被明确调用时使用,用于验证代码审查和常规测试无法确定结论的行为;需定义受控的验证矩阵,将一次性(可丢弃)的 JS 探测脚本保存在受跟踪路径之外,并报告观察到的证据。
PR 标题描述与分支建议生成
pr-draft-summary
在收到请求时或完成符合条件的实现工作后,准备本地 PR 的标题、描述和分支建议。