Coverage Loop
Iteratively write tests until a target coverage percentage is reached.
Philosophy: Meaningful coverage over hitting numbers. Test business logic first.
The Job
- Receive target coverage percentage from user
- Run coverage command to check current state
- Identify most critical uncovered code paths
- Write tests for ONE uncovered area per iteration
- Verify coverage improved
- Repeat until target reached
Iteration Flow
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā 1. Run coverage command ā
ā 2. Check current percentage vs target ā
ā 3. If target reached ā COMPLETE ā
ā 4. Identify highest-value uncovered code ā
ā 5. Write test for ONE uncovered area ā
ā 6. Run coverage again to verify ā
ā 7. Append progress to progress.txt ā
ā 8. Loop back to step 1 ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Priority Order for Coverage
Focus on coverage in this order:
- Business logic - Core application functionality
- Error handling - Catch blocks, validation
- Edge cases - Boundary conditions
- Utilities - Helper functions
- UI logic - Component behavior (not rendering)
Skip:
- Generated code
- Type definitions
- Configuration files
- Simple getters/setters
Progress Format
Append to progress.txt after each iteration:
## Coverage Loop - [Date/Time]
- Before: 65%
- After: 68%
- Added: Test for `validateEmail()` in `src/utils/validation.ts`
- Focus: Business logic validation
---
Stop Condition
When coverage reaches target percentage:
- Output:
<promise>COMPLETE</promise>
If stuck after multiple iterations:
- Note why in progress.txt
- Output:
<promise>BLOCKED</promise> with explanation
Example Usage
User: "Run coverage loop to 80%"
The skill will:
- Check current coverage (e.g., 65%)
- Write tests until 80% is reached
- Report progress after each iteration
Checklist Per Iteration