Analyzes a repository and its test suite to generate customized mutation operators tailored to the project. Use this skill when setting up mutation testing, improving test quality, or generating project-specific mutants. Considers language constructs, business logic patterns, API calls, data types, and code complexity to produce effective mutation operators that maximize test sensitivity while avoiding trivial or equivalent mutations. Generates prioritized operator sets (high/medium/low value) with impact summaries. Triggers when users ask to generate mutation operators, customize mutation testing, analyze code for mutation opportunities, or create project-specific mutants.
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill smart-mutation-operator-generator
Generate customized mutation operators tailored to a specific codebase to maximize mutation testing effectiveness.
Run analysis script:
# Analyze entire repository
python scripts/generate_operators.py /path/to/repo
# Analyze single file
python scripts/generate_operators.py /path/to/file.py
# Save detailed report
python scripts/generate_operators.py /path/to/repo --output operators.json
Script analyzes:
Operator priorities:
Consider project characteristics:
Financial/calculation-heavy code:
API-heavy code:
Business logic code:
Data processing code:
Example custom operators:
API Timeout Mutation:
# Original
response = api.call(timeout=30)
# Mutant
response = api.call(timeout=1) # Test timeout handling
Retry Logic Mutation:
# Original
@retry(max_attempts=3)
def fetch_data():
pass
# Mutant
@retry(max_attempts=1) # Test with fewer retries
def fetch_data():
pass
Business Rule Mutation:
# Original
if age >= 18 and has_license:
allow_driving()
# Mutants
if age > 18 and has_license: # ROR
if age >= 18 or has_license: # LCR
if age >= 21 and has_license: # CRP (domain-specific)
Skip equivalent mutants:
# Equivalent (don't mutate)
x = a + 0 # → x = a - 0 (still equals a)
x = a * 1 # → x = a / 1 (still equals a)
# Non-equivalent (do mutate)
x = a + 1 # → x = a - 1 (different result)
x = a * 2 # → x = a / 2 (different result)
Skip trivial mutations:
# Trivial (low value)
message = "Hello" # → message = "" (obvious failure)
# Valuable (high value)
if count > 0: # → if count >= 0 (subtle boundary)
Document operator selection:
MUTATION TESTING PLAN
=====================
Project: MyApp
Language: Python
Files Analyzed: 45
SELECTED OPERATORS
------------------
High Priority (Apply to all code):
1. ROR - Relational Operator Replacement
- Target: Comparison operations in business logic
- Expected: 150 mutants
- Rationale: Critical for boundary condition testing
2. LCR - Logical Connector Replacement
- Target: Boolean expressions in validation
- Expected: 80 mutants
- Rationale: Tests logical condition coverage
3. CRP - Constant Replacement
- Target: Numeric thresholds and limits
- Expected: 120 mutants
- Rationale: Tests boundary values
Medium Priority (Apply selectively):
4. AOR - Arithmetic Operator Replacement
- Target: Calculation functions only
- Expected: 60 mutants
- Rationale: Financial calculations need thorough testing
Custom Operators:
5. RETRY - Retry Logic Mutation
- Target: @retry decorators
- Expected: 15 mutants
- Rationale: Test resilience mechanisms
ESTIMATED RESULTS
-----------------
Total Mutants: ~425
Mutation Score Target: >80%
Execution Time: ~25 minutes
Python (mutmut):
mutmut run --paths-to-mutate=src/
mutmut results
JavaScript (Stryker):
// stryker.conf.js
module.exports = {
mutator: {
excludedMutations: ['StringLiteral', 'UnaryOperator']
}
};
See standard_operators.md for complete list.
Most effective:
> → >=, <, ==and → or0 → 1, true → falseif x: → if not x:Mutation Score = (Killed Mutants / Total Mutants) × 100%
Targets:
Start small:
Focus on critical code:
Avoid over-mutation:
Review results:
# Analyze repository
python scripts/generate_operators.py /path/to/repo
# Save detailed report
python scripts/generate_operators.py /path/to/repo --output report.json
Output includes:
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Comprehensive GitHub release orchestration with AI swarm coordination for automated versioning, testing, deployment, and rollback management
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Modern JavaScript/TypeScript development with Bun runtime. Covers package management, bundling, testing, and migration from Node.js. Use when working with Bun, optimizing JS/TS development speed, or migrating from Node.js to Bun.
You are a dependency management expert specializing in safe, incremental upgrades of project dependencies. Plan and execute dependency updates with minimal risk, proper testing, and clear migration pa
Master systematic debugging techniques, profiling tools, and root cause analysis to efficiently track down bugs across any codebase or technology stack. Use when investigating bugs, performance issues, or unexpected behavior.
Opinionated backend development standards for Node.js + Express + TypeScript microservices. Covers layered architecture, BaseController pattern, dependency injection, Prisma repositories, Zod validation, unifiedConfig, Sentry error tracking, async safety, and testing discipline.
Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.
Take arabelatso/smart-mutation-operator-generator from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.