mx-generate

A mutation-testing step that creates realistic patches representing bugs a developer might introduce. Mutation testing checks whether tests detect deliberately changed code.

In plain words
What is it for?
Use it to generate changes such as off-by-one errors, wrong operators, missing null checks, or swapped arguments for later testing.
Why use it?
It helps reveal gaps in a test suite that ordinary test runs may not show.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/claritune/mutantx/mx-generate
Any agent
npx skills add Claritune/mutantx --skill mx-generate
Clone the repo
git clone --depth 1 https://github.com/Claritune/mutantx

Made for: Claude Code, Codex.

Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,749 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.01749
Opus 5 $0.00010 $0.00874
Sonnet 5 $0.00004 $0.00350
Haiku 4.5 $0.00002 $0.00175

Measured 2d ago against content hash a451d4b47871, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mx-generate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/mx-generate/SKILL.md · 170 lines

How it starts

The opening of the file, as written. The whole thing — 170 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MutantX — Phase 2: Mutant Generation

You are the mutant generation phase of a mutation testing engine. Your job is to read source files and generate realistic code mutations as unified diff patches.

Key principle: You are NOT an AST-based tool applying blind syntactic transformations. You understand the code semantically. Generate mutations that represent realistic bugs a developer might actually introduce — off-by-one errors, wrong operator choices, forgotten edge cases, swapped arguments, missing null checks. Avoid trivial or equivalent mutations.


Input

Read .mutants/detect.json for project configuration (language, test command, source files). If the file doesn't exist and files is not provided, tell the user to run /mx-detect first.

Check for Cached Mutants

Look for .mutants/manifest.json in the project root.

If .mutants/manifest.json does not exist or regen is "true", proceed with full generation.

If the manifest exists AND regen is not "true", do a per-file staleness check:

  1. Read the manifest. It contains a file_hashes map of { "path": "<sha256>" } for every source file that was mutated.
  2. For each source file in scope, compute its current content hash: sha256sum <file> | cut -d' ' -f1.
  3. Compare against the stored hash:
    • Hash matches → the file hasn't changed. Keep its existing mutants and skip regeneration for this file.
    • Hash differs → the file has changed. Delete its old patches, remove its mutants from the manifest, and regenerate mutants for this file.
    • File is new (not in file_hashes) → generate mutants for it.
    • File was deleted (in file_hashes but no longer exists) → remove its mutants and patches.
  4. Also run git apply --check on each kept patch to verify it still applies cleanly. If a patch no longer applies, discard that mutant and regenerate.

Report the cache status to the user:

Cached: 8 mutants for 3 unchanged files
Regenerating: 2 files changed (src/billing.ts, src/auth.ts)
New: 1 file added (src/payments.ts)
Removed: 1 file deleted (src/legacy.ts)

Read the full file on GitHub · 170 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 170 lines · 20 tokens per session scan A a451d4b47871

Subscribe to this mod's changes

mx-generate is a skill published in the GitHub repository Claritune/mutantx (2 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 1,749 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.