$npx -y skills add girijashankarj/cursor-handbook --skill coverage-improvementSystematic workflow for identifying coverage gaps and writing missing tests. Use when coverage is below target or the user asks to improve coverage.
| 1 | # Skill: Improve Test Coverage |
| 2 | |
| 3 | ## Trigger |
| 4 | When coverage is below {{CONFIG.testing.coverageMinimum}}% or user asks to improve coverage. |
| 5 | |
| 6 | ## Steps |
| 7 | |
| 8 | ### Step 1: Analyze Current Coverage |
| 9 | - [ ] Run coverage report: `{{CONFIG.testing.coverageCommand}}` |
| 10 | - [ ] Identify files below {{CONFIG.testing.coverageMinimum}}% coverage |
| 11 | - [ ] Rank by: business criticality × uncovered percentage |
| 12 | |
| 13 | ### Step 2: Identify Gaps |
| 14 | For each uncovered file: |
| 15 | - [ ] List uncovered functions/methods |
| 16 | - [ ] List uncovered branches (if/else, switch) |
| 17 | - [ ] List uncovered error paths |
| 18 | - [ ] Determine which gaps are most important |
| 19 | |
| 20 | ### Step 3: Write Missing Tests |
| 21 | Priority order: |
| 22 | 1. Error handling paths |
| 23 | 2. Business logic branches |
| 24 | 3. Edge cases (null, empty, boundary) |
| 25 | 4. Success paths (usually already covered) |
| 26 | |
| 27 | For each test: |
| 28 | - [ ] Follow AAA pattern (Arrange-Act-Assert) |
| 29 | - [ ] Use descriptive test names |
| 30 | - [ ] Mock external dependencies |
| 31 | - [ ] Assert specific behaviors, not implementation |
| 32 | |
| 33 | ### Step 4: Verify Coverage |
| 34 | - [ ] Run coverage again: `{{CONFIG.testing.coverageCommand}}` |
| 35 | - [ ] Confirm target met: ≥{{CONFIG.testing.coverageMinimum}}% |
| 36 | - [ ] All new tests pass |
| 37 | |
| 38 | ## Completion |
| 39 | Coverage meets or exceeds {{CONFIG.testing.coverageMinimum}}% with meaningful tests. |