Nyquist — Test-to-Requirement Coverage Mapping
Maps plan acceptance criteria to test files. Identifies coverage gaps where requirements exist but no corresponding test validates them.
When to Use
- Phase 2 (Test): After tester writes initial tests, verify all acceptance criteria are covered
- Phase 4 (Review): As part of test coverage dimension, verify no gaps
- User says "check test coverage", "are all requirements tested", "coverage gaps"
- Before Gate 2: verify implementation matches plan
Workflow
- Load plan — Read
tasks/plans/YYMMDD-name/plan.md, extract acceptance criteria - Scan tests — Glob for test files (
**/*.test.*,**/*.spec.*,**/test_*.*) - Map criteria → tests — For each acceptance criterion, search test descriptions/names for matching keywords
- Identify gaps — Criteria with no matching test = coverage gap
- Produce report — Structured output with mapping table and gap list
Output Format
## Nyquist Coverage Report: [Plan Name]
### Requirement-to-Test Mapping
| # | Acceptance Criterion | Test File | Test Name | Status |
|---|---------------------|-----------|-----------|--------|
| 1 | [criterion text] | src/auth.test.ts | "should authenticate user" | COVERED |
| 2 | [criterion text] | — | — | GAP |
| 3 | [criterion text] | src/api.test.ts | "returns 404 for missing" | COVERED |
### Coverage Summary
- **Total criteria:** N
- **Covered:** N (N%)
- **Gaps:** N
### Gap Details
1. **[criterion text]** — No test found. Suggested test: [brief description]
2. **[criterion text]** — No test found. Suggested test: [brief description]
### Recommendation
[PASS — all criteria covered | WARN — N gaps found, suggest adding tests]
Matching Strategy
- Keyword matching: Extract key nouns/verbs from acceptance criteria, search in test
describe/it/teststrings - File path matching: If criterion mentions "auth", search in
**/auth*test* - Fuzzy matching: If exact match fails, check for semantic equivalents (e.g., "login" ≈ "authenticate")
- Manual override: If no match found, ask user to confirm the gap is real (not a naming mismatch)
Gotchas
<!-- Populate from real failures. Do not predict. -->What This Skill Does NOT Do
- Does NOT write tests — that's the tester agent's job
- Does NOT modify plan files — read-only analysis
- Does NOT replace manual review of test quality — only checks existence, not correctness
- Does NOT run tests — only reads test file contents