Skip to main content
command

add-mutation-testing — Claude Code command: what it does

A slash command that sets up mutation testing in your project: picks a framework, wires quality thresholds and hooks the run into CI.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command testing/add-mutation-testing
Open on GitHub

What add-mutation-testing does

Run it with a language flag — --javascript, --java, --python, --rust, --go or --csharp — or let it detect the language from your files. It then picks a framework: Stryker, PIT, mutmut or cargo-mutants.

Six steps follow. Dependencies get installed and basic settings configured, then mutation operators are set up: arithmetic, relational, logical, conditional boundaries. Performance work comes next — parallel execution, incremental runs, file filtering, caching. After that it calculates the mutation score, analyses surviving mutants and enforces thresholds that fail the build.

The command reads and writes files and runs shell commands: Read, Write, Edit and Bash are allowed. Make sure your tests exist and pass before running it, because mutation testing leans on the suite you already have and shows nothing on an empty one. For CI it looks for .github, .gitlab-ci.yml or Jenkinsfile and adds the run there.

What it helps with

  • pick a mutation testing framework for the project's language
  • configure mutation operators and a mutation score threshold
  • speed up runs with parallel execution and caching
  • add mutation testing to the CI pipeline
  • work through surviving mutants to find missing tests

Example prompts for the agent

  • /add-mutation-testing --python
  • /add-mutation-testing --javascript
  • set up mutation testing for this project and wire it into CI

How to install add-mutation-testing

1claude-code-templates

npx claude-code-templates@latest --command testing/add-mutation-testing

2Manually: put the files in place

.claude/commands/add-mutation-testing.md

Call it with /add-mutation-testing. For all projects use ~/.claude/commands/

From the same set205

The whole set →

Similar

Nearby in Testing and QA

Everything for Testing and QA →

Questions about add-mutation-testing

How do I install add-mutation-testing in Claude?

Run npx claude-code-templates@latest --command testing/add-mutation-testing. The command file lands at .claude/commands/add-mutation-testing.md.

What does add-mutation-testing do?

It selects a mutation testing framework for your language, configures operators and mutation score thresholds, optimises the run and integrates it with CI.

Which languages does the command support?

JavaScript, Java, Python, Rust, Go and C#, passed as --javascript, --java, --python, --rust, --go or --csharp. Without a flag it detects the language from project files.

Source text

add-mutation-testing.md · MIT
---
allowed-tools: Read, Write, Edit, Bash
argument-hint: "[language] | --javascript | --java | --python | --rust | --go | --csharp"
description: Setup comprehensive mutation testing with framework selection and CI integration
---

# Add Mutation Testing

Setup mutation testing framework with quality metrics and CI integration: **$ARGUMENTS**

## Current Testing Context

- Language: !`find . -name "*.js" -o -name "*.ts" | head -1 >/dev/null && echo "JavaScript/TypeScript" || find . -name "*.py" | head -1 >/dev/null && echo "Python" || find . -name "*.java" | head -1 >/dev/null && echo "Java" || echo "Multi-language"`
- Test coverage: !`find . -name "coverage" -o -name ".nyc_output" | head -1 || echo "No coverage data"`
- Test framework: !`grep -l "jest\\|mocha\\|pytest\\|junit" package.json pom.xml setup.py 2>/dev/null | head -1 || echo "Detect from tests"`
- CI system: !`find . -name ".github" -o -name ".gitlab-ci.yml" -o -name "Jenkinsfile" | head -1 || echo "No CI detected"`

## Task

Implement comprehensive mutation testing with framework optimization and quality gates:

**Language Focus**: Use $ARGUMENTS to specify JavaScript, Java, Python, Rust, Go, C#, or auto-detect from codebase

**Mutation Testing Framework**:

1. **Tool Selection & Setup** - Choose framework (Stryker, PIT, mutmut, cargo-mutants), install dependencies, configure basic settings, validate installation
2. **Mutation Operator Configuration** - Configure arithmetic operators, relational operators, logical operators, conditional boundaries, statement mutations
3. **Performance Optimization** - Setup parallel execution, configure incremental testing, optimize file filtering, implement caching strategies
4. **Quality Metrics** - Configure mutation score calculation, setup survival analysis, implement threshold enforcement, track effectiveness trends
5. **CI/CD Integration** - Automate execution triggers, configure performance monitoring, setup result reporting, implement deployment gates
6. **Result Analysis** - Setup visualization dashboards, configure surviving mutant analysis, implement remediation workflows, track regression patterns

**Advanced Features**: Selective mutation testing, performance profiling, automated test improvement suggestions, mutation trend analysis, quality gate integration.

**Framework Support**: Language-specific optimizations, tool ecosystem integration, performance tuning, reporting customization.

**Output**: Complete mutation testing setup with configured framework, CI integration, quality thresholds, and analysis workflows.

© davila7 · MIT · davila7/claude-code-templates

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor