A Claude Code slash command skill that automates mutation testing analysis and test quality improvement.
This skill helps you improve test quality by:
stryker.config.mjs)/improve-test-quality server/routes/projects.js
This will:
server/routes/projects.js/improve-test-quality server/routes/projects.js --auto
Automatically implements improvements without asking for approval at each step.
/improve-test-quality server/routes/projects.js --target 90
Set a custom target mutation score (default is 85%).
/improve-test-quality server/routes/projects.js --max-iterations 5
Set maximum number of improvement cycles (default is 3).
/improve-test-quality server/routes/projects.js --dry-run
Show recommendations without making any changes.
/improve-test-quality server/routes/projects.js --auto --target 90 --max-iterations 5
/improve-test-quality <file-path>--auto)The skill targets common mutation testing issues:
$ /improve-test-quality server/routes/projects.js
🔍 Analyzing test quality for server/routes/projects.js...
Current status:
- Test file: server/__tests__/routes/projects.test.js
- Target mutation score: 85%
- Max iterations: 3
Running mutation testing... (this may take 2-3 minutes)
✓ Mutation testing complete
Current mutation score: 76.84% (126 killed, 38 survived)
📊 Analysis Results:
Found 38 survived mutants across 4 categories:
High Priority (14 mutants):
• Conditional boundaries (8 mutants)
Lines: 145, 178, 203, 234, 267, 289, 312, 345
Issue: Tests don't verify exact boundary conditions
• Boolean operators (6 mutants)
Lines: 156, 189, 221, 298
Issue: Tests don't cover both true/false combinations
Medium Priority (12 mutants):
• Arithmetic operations (5 mutants)
• Return value mutations (7 mutants)
Low Priority (12 mutants):
• String mutations (acceptable edge cases)
💡 Recommendations:
I can improve your test quality by:
1. Adding 8 boundary condition test cases
2. Adding 6 boolean combination tests
3. Strengthening 7 response assertions
4. Adding 5 arithmetic verification tests
Expected improvement: 76.84% → ~89% mutation score
Would you like me to:
1. Automatically implement all improvements
2. Implement only high-priority improvements
3. Let me review each category separately
4. Show me the specific changes first
Your choice (1-4): 1
Implementing improvements...
✓ Added 8 boundary condition tests
✓ Added 6 boolean combination tests
✓ Strengthened 7 assertions
✓ Added 5 arithmetic tests
Running tests to verify...
✓ All tests pass (40 tests, 0 failures)
Re-running mutation testing...
✓ Mutation testing complete
✅ Target reached! Final score: 89.47%
📈 Summary:
- Killed 22 additional mutants (76.84% → 89.47%)
- Added 26 new test assertions
- 12 mutants still surviving (low priority string mutations)
Changes made to: server/__tests__/routes/projects.test.js
Run `npm test` to verify all tests still pass.
The skill will offer to add the file to stryker.config.mjs for you.
Make sure your test file follows conventions:
server/routes/file.js → server/__tests__/routes/file.test.jsEnsure all tests pass first: npm test
The skill configuration should have already added the JSON reporter to stryker.config.mjs.
The skill uses these defaults (overridable with flags):
This skill may modify:
stryker.config.mjs (if file not in mutate array)It will NOT:
Potential future features: