coverage-gap
Review a diff for missing test coverage; pairs every changed behavior with an existing test or a flagged gap plus a recommended layer; finds gaps, not authoring (unit-tests).
- License 许可
- MIT
- 最近更新
- 2026-10-29
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- coverage-gap
- description
- Review a diff for missing test coverage; pairs every changed behavior with an existing test or a flagged gap plus a recommended layer; finds gaps, not authoring (unit-tests).
02 资源文件 1
- 参考文档routing.yaml351 B
03 SKILL.md 正文
coverage-gap
Read a code diff plus the existing test files and report which changed behaviors are unprotected. Pair-mode for
code-reviewin workflows.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
When to use
- Workflow step before merging a PR (
reviewPRinvokes this as a fanout sibling). - The user asks "what tests am I missing?".
- After
feature-devto verify the TDD loop actually covered everything.
Inputs
- The diff (current
git diffor PR diff). - Test directories conventional for the repo.
Procedure
- For each changed function / method / endpoint in the diff: a. Search the test directories for any test that imports or calls the symbol. b. Search for tests whose name matches the changed behavior.
- For each "behavior" — defined as a new branch, condition, error path, or boundary case introduced by the diff — record whether a test would fail if that branch were broken.
- Classify gaps:
- MISSING (unit): pure logic uncovered.
- MISSING (integration): boundary crossing uncovered.
- WEAK: test exists but only asserts a return type, not the behavior.
- Surface coverage % only if the repo already runs a coverage tool; do not invent numbers.
Output
Coverage gaps for <branch>:
Covered:
- <file>:<line> <symbol> → tests/<path>:<line>
MISSING (unit):
- <file>:<line> rate_limit_burst_threshold has no test for the boundary case (6th request within 60s).
MISSING (integration):
- <file>:<line> /healthz response shape is asserted nowhere.
WEAK:
- <file>:<line> refund_amount: only return type asserted; behavior un-checked.
Test scaffolding (suggested):
- tests/test_rate_limit.py::test_blocks_sixth_request_in_window
- tests/test_healthz.py::test_returns_status_ok_with_version
Quality bar
- Every "MISSING" item nominates a concrete test name.
- Never claim full coverage just because some test exists touching the changed file.
- Don't propose tests for code paths the diff doesn't introduce.
04 同仓库更多 Skills
runbook
Write or refresh an operational runbook for an alert/symptom; structured as TL;DR + Pre-checks + Steps + Verification + Rollback + Escalation.
rfc
Draft a lightweight design RFC to docs/rfcs/<slug>.md; Summary, Motivation, Detailed design, Drawbacks, Alternatives, Unresolved questions. A proposal to debate, not a recorded decision (adr).
editorial-pass
Review and tighten prose in a Markdown artifact for a target tone (terse, formal, friendly) without dropping information; preserve quotations and load-bearing constraints.
architecture-review-facilitation
Run an architecture review as a process — entry criteria, reviewer checklist, decision log, and follow-up actions — pairing the design artifact with a red-team pass.
architecture-doc
Write a C4-style architecture document; System Context + Containers (+ Components when interesting) with mermaid diagrams. Describes structure, not a decision (adr) or proposal (rfc).
adr
Write an Architecture Decision Record (Michael Nygard format) to docs/adrs/NNNN-<slug>.md; frontmatter validated by the ADR artifact schema. Records a made decision, not a proposal to debate (rfc).