Agent skill

Smart Mutation Operator Generator

by ArabelaTso in ArabelaTso/Skills-4-SE

Analyzes a repository and its test suite to generate customized mutation operators tailored to the project.

Apache-2.0Auto-check passedTesting & QA

Install Smart Mutation Operator Generator

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill smart-mutation-operator-generator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE smart-mutation-operator-generator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/smart-mutation-operator-generator .claude/skills/smart-mutation-operator-generator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
smart-mutation-operator-generator
GitHub stars
253
Token cost
~1.7k tokens
SKILL.md length
335 words
Files
3 (incl. scripts, references)
Skills in repo
150
Repo updated
First seen
Licence
Apache-2.0

At a glance

Analyzes a repository and its test suite to generate customized mutation operators tailored to the project.

  • Works in 7 steps: Analyze Codebase → Review Generated Operators → Customize for Project → …
  • Setting up mutation testing
  • SKILL.md covers Workflow, Quick Reference, Best Practices and Helper Script
  • Runs Python scripts from its folder; calls python

What it does

Smart Mutation Operator Generator is an agent skill from ArabelaTso/Skills-4-SE. 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…

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts and reference files (for example `references/standard_operators.md` and `scripts/generate_operators.py`).

It sits in Testing & QA, covering Test coverage and Test generation. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • Setting up mutation testing
  • Improving test quality
  • Generating project-specific mutants
  • Users ask to generate mutation operators

Example prompts

  • “Use the smart-mutation-operator-generator skill to analyz a repository and its test suite to generate customized mutation operators tailored to the…”
  • “/smart-mutation-operator-generator”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Analyze Codebase
  2. Review Generated Operators
  3. Customize for Project
  4. Define Custom Operators
  5. Avoid Trivial Mutations
  6. Generate Mutation Test Plan
  7. Implement with Mutation Tool

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Smart Mutation Operator Generator loads about 1.7k tokens when it runs, and up to ~3.4k if it reads all its reference files. Until then it costs about 179 tokens; SKILL.md has 335 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~179
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 335 words, ~1,652 tokens.

Download SKILL.mdSave it as .claude/skills/smart-mutation-operator-generator/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
smart-mutation-operator-generator
description
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.

Smart Mutation Operator Generator

Generate customized mutation operators tailored to a specific codebase to maximize mutation testing effectiveness.

Workflow

1. Analyze Codebase

Run analysis script:

bash
# 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:

  • Arithmetic operations (AOR candidates)
  • Comparison operations (ROR candidates)
  • Logical operations (LCR candidates)
  • Constants and literals (CRP candidates)
  • Function calls (FCR candidates)
  • API interactions
  • Database operations
  • Control flow structures
  • Exception handling
2. Review Generated Operators

Operator priorities:

  • 🔴 High Priority: Most effective at finding bugs

    • ROR (Relational Operator Replacement)
    • LCR (Logical Connector Replacement)
    • CRP (Constant Replacement)
    • COR (Conditional Operator Replacement)
  • 🟡 Medium Priority: Useful but may generate equivalent mutants

    • AOR (Arithmetic Operator Replacement)
    • FCR (Function Call Replacement)
    • RVR (Return Value Replacement)
    • API/DB operation mutations
  • 🔵 Low Priority: Often trivial or equivalent

    • UOI/UOD (Unary Operator Insertion/Deletion)
    • STR (String Replacement)
    • IHI/IHD (Hiding Variable Insertion/Deletion)
3. Customize for Project

Consider project characteristics:

Financial/calculation-heavy code:

  • Prioritize AOR (arithmetic operators)
  • Focus on CRP (numeric constants)
  • Test boundary conditions

API-heavy code:

  • Custom API call mutations
  • Timeout/retry logic mutations
  • Error response mutations

Business logic code:

  • ROR (comparisons in business rules)
  • LCR (logical conditions)
  • COR (conditional branches)

Data processing code:

  • Collection mutations
  • Null/empty value mutations
  • Type conversion mutations
4. Define Custom Operators

Example custom operators:

API Timeout Mutation:

python
# Original
response = api.call(timeout=30)

# Mutant
response = api.call(timeout=1)  # Test timeout handling

Retry Logic Mutation:

python
# 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:

python
# 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)
5. Avoid Trivial Mutations

Skip equivalent mutants:

python
# 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:

python
# Trivial (low value)
message = "Hello"  # → message = "" (obvious failure)

# Valuable (high value)
if count > 0:      # → if count >= 0 (subtle boundary)
6. Generate Mutation Test Plan

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
7. Implement with Mutation Tool

Python (mutmut):

bash
mutmut run --paths-to-mutate=src/
mutmut results

JavaScript (Stryker):

javascript
// stryker.conf.js
module.exports = {
  mutator: {
    excludedMutations: ['StringLiteral', 'UnaryOperator']
  }
};

Quick Reference

Standard Operators

See standard_operators.md for complete list.

Most effective:

  • ROR: > → >=, <, ==
  • LCR: and → or
  • CRP: 0 → 1, true → false
  • COR: if x: → if not x:
Mutation Score
Mutation Score = (Killed Mutants / Total Mutants) × 100%

Targets:

  • Excellent: >80%
  • Good: 60-80%
  • Needs improvement: <60%

Best Practices

Start small:

  • Begin with high-priority operators
  • Test on small modules first
  • Gradually expand coverage

Focus on critical code:

  • Business logic
  • Security-sensitive code
  • Complex algorithms
  • Error handling

Avoid over-mutation:

  • Skip trivial mutations
  • Exclude equivalent mutants
  • Focus on meaningful changes

Review results:

  • Killed: Tests are effective
  • Survived: Add tests or improve existing ones
  • Equivalent: Mark and exclude

Helper Script

bash
# 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:

  • Detected code patterns
  • Recommended operators by priority
  • Estimated mutant count
  • Customization suggestions

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts, references) in skills/smart-mutation-operator-generator of ArabelaTso/Skills-4-SE.

  • SKILL.md
  • references/standard_operators.md
  • scripts/generate_operators.py

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Smart Mutation Operator Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Smart Mutation Operator Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Smart Mutation Operator Generator this skillArabelaTso/Skills-4-SE253—~1.7kAutomated safety check: PassApache-2.0
E2E Test ThinkerUniClipboard/UniClipboard1.9k—~1.7kAutomated safety check: PassAGPL-3.0
Ralph Coveragejvm-skills/jvm-skills140—~683Automated safety check: PassApache-2.0
Designing TestsCloudAI-X/opencode-workflow275—~2.9kAutomated safety check: PassMIT
Mutation Testingproffesor-for-testing/agentic-qe494—~1.7kAutomated safety check: PassMIT
Write Testsgnomeria/usbtree690—~622Automated safety check: PassMIT

Similar skills

  • E2E Test Thinker

    UniClipboard/UniClipboard

    Analyze the current branch's diff against main and determine which changes are testable via CLI-based end-to-end tests.

    1.9k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Ralph Coverage

    jvm-skills/jvm-skills

    Run Ralph in coverage mode — iteratively write tests for untested classes until coverage targets are met.

    140 GitHub stars~683 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Designing Tests

    CloudAI-X/opencode-workflow

    Guides test strategy, TDD/BDD approaches, test coverage planning, and testing best practices.

    275 GitHub stars~2.9k tokensUpdated 9 mo ago
    Testing & QAAuto-check passed
  • Mutation Testing

    proffesor-for-testing/agentic-qe

    Test quality validation through mutation testing, assessing test suite effectiveness by introducing code mutations and measuring kill rate.

    494 GitHub stars~1.7k tokensUpdated 4 days ago
    Testing & QAAuto-check passed
  • Write Tests

    gnomeria/usbtree

    Author tests that match the repo's stack and existing test style, at the cheapest level that catches the regression.

    690 GitHub stars~622 tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Mutation Test

    jmagly/aiwg

    Run mutation testing to validate test quality beyond code coverage.

    220 GitHub stars~3.2k tokensUpdated 2 days ago
    Testing & QAAuto-check passed

More from ArabelaTso/Skills-4-SE

All 150 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Smart Mutation Operator Generator

What does Smart Mutation Operator Generator do?

Analyzes a repository and its test suite to generate customized mutation operators tailored to the project. Smart Mutation Operator Generator is an agent skill from ArabelaTso/Skills-4-SE. Analyzes a repository and its test suite to generate customized mutation operators tailored to the project.

When should I use Smart Mutation Operator Generator?

Smart Mutation Operator Generator fits situations like: setting up mutation testing; improving test quality; generating project-specific mutants; users ask to generate mutation operators.

How do I install Smart Mutation Operator Generator in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill smart-mutation-operator-generator -a claude-code`. Or copy the skill folder (skills/smart-mutation-operator-generator in ArabelaTso/Skills-4-SE) into .claude/skills/smart-mutation-operator-generator in your project. Claude Code loads it when a task matches its description.

How do I install Smart Mutation Operator Generator in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill smart-mutation-operator-generator -a codex`. Or copy the skill folder (skills/smart-mutation-operator-generator in ArabelaTso/Skills-4-SE) into .agents/skills/smart-mutation-operator-generator in your project. Codex loads it when a task matches its description.

Can I use Smart Mutation Operator Generator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill smart-mutation-operator-generator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/smart-mutation-operator-generator, .gemini/skills/smart-mutation-operator-generator, .github/skills/smart-mutation-operator-generator and .opencode/skills/smart-mutation-operator-generator in your project.

What does Smart Mutation Operator Generator need to run?

Going by SKILL.md and its folder, Smart Mutation Operator Generator needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Smart Mutation Operator Generator access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Smart Mutation Operator Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Smart Mutation Operator Generator use?

Smart Mutation Operator Generator is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Smart Mutation Operator Generator use?

About 1.7k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.8k tokens, read only when the agent opens those files.

What are the alternatives to Smart Mutation Operator Generator?

Skills that share tags, products or a category with Smart Mutation Operator Generator: E2E Test Thinker (UniClipboard/UniClipboard, 1.9k stars), Ralph Coverage (jvm-skills/jvm-skills, 140 stars), Designing Tests (CloudAI-X/opencode-workflow, 275 stars) and Mutation Testing (proffesor-for-testing/agentic-qe, 494 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Smart Mutation Operator Generator?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.