All skills
Skillintermediate
/mutate - Run Mutation Testing
Run mutation testing to evaluate test suite effectiveness.
Claude Code Knowledge Pack7/10/2026
Overview
/mutate - Run Mutation Testing
Run mutation testing to evaluate test suite effectiveness.
Steps
- Detect the project language and testing framework from configuration files
- Check if a mutation testing tool is installed (Stryker for JS/TS, mutmut for Python, PITest for Java)
- If not installed, provide installation instructions for the appropriate tool
- Identify the source files and their corresponding test files
- Configure mutation operators: arithmetic, conditional, string, return value mutations
- Run the mutation testing tool on the target source files
- Monitor progress: total mutants generated, killed, survived, timed out
- Calculate the mutation score (killed / total * 100)
- List survived mutants with file location, line number, and mutation description
- For each survived mutant, identify which test should have caught it
- Suggest specific test cases to write for the top 10 survived mutants
- Save the mutation report to the reports directory
Rules
- Start with a single file or module to keep execution time reasonable
- Set a timeout per mutant of 10x the normal test execution time
- Exclude test files, configuration files, and generated code from mutation
- A mutation score below 80% indicates weak test coverage
- Focus on survived mutants in critical business logic first
- Do not count equivalent mutants (mutations that produce identical behavior)
- Report execution time and mutant count for performance tracking