nwiizo

mutants

@nwiizo/mutants
nwiizo
58
2 forks
Updated 1/6/2026
View on GitHub

Mutation Testing - ミューテーションテスト (project): Run mutation testing using cargo-mutants to analyze test quality.

Installation

$skills install @nwiizo/mutants
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Path.claude/skills/mutants/SKILL.md
Branchmain
Scoped Name@nwiizo/mutants

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

skills list

Skill Instructions

Mutation Testing - ミューテーションテスト (project)

Run mutation testing using cargo-mutants to analyze test quality.

Basic Commands

# Run all mutations
cargo mutants --timeout 60

# Run on specific file
cargo mutants --file src/analyzer.rs --timeout 60

# Run on specific function
cargo mutants --file src/analyzer.rs -F "function_name" --timeout 60

Analysis Commands

# Quick check (specific functions)
cargo mutants -F "file_path_to_module_path" --timeout 60

# Full analysis (takes longer)
cargo mutants --timeout 120

# Exclude expensive tests
cargo mutants --timeout 60 -E "integration"

Options Reference

OptionDescription
--file <FILE>Limit to specific file
-F <PATTERN>Filter by function name
-E <PATTERN>Exclude by function name
--timeout <SEC>Timeout per mutant
--jobs <N>Parallel jobs

Interpreting Results

ResultMeaning
caughtTests detected the mutation (good!)
missedTests didn't detect the mutation (needs more tests)
unviableMutation caused compile error (ignore)
timeoutTest took too long (may need optimization)

Workflow

# 1. Run mutation testing
cargo mutants --timeout 60

# 2. Check missed mutants
cat mutants.out/missed.txt

# 3. Add tests for missed mutants
# Edit tests...

# 4. Verify improvement
cargo mutants -F "specific_function" --timeout 60

CI Integration

# Fail if too many missed mutants
cargo mutants --timeout 60 2>&1 | grep -E "^[0-9]+ mutants tested"

Notes

  • Higher caught ratio = better test quality
  • Focus on business-critical functions first
  • mutants.out/ is gitignored