/claude-mods:test-engineering <design|write|audit|prune|speed|gate|triage> [target] [--posture tdd|test-after|characterise] [--visual]from claude-mods
Optimizes test suites by measuring what tests catch vs. what they cost. Supports writing, auditing, pruning, speeding up tests, and triaging flaky or failing tests.
Ships in claude-mods. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A test's value is what it catches, divided by what it costs. Agents write code at many times the human rate and tests to match, and the suites they leave behind optimise for count: hundreds of tests that restate the code, rarely fail, overlap each other, and all run on every change. This skill optimises the ratio instead:
Every mode works one side of that ratio or both. One skill, seven modes, one read-only reviewer agent, a zero-dependency mutation harness, and stdlib scripts for the cost side.
refuses a reset link that was already used,
not test_reset_2. If you cannot name the bug, do not write the test.oracle-scan.py finds candidates.From a 13-repo survey (Go, Python, TypeScript: CLIs, MCP servers, Workers APIs, a web app, data and media pipelines), every number measured, not estimated:
| Finding | Consequence here |
|---|---|
| Lead-authored mutants: 45 of 61 killed (74%) by suites that were all green | audit measures with mutants, never with coverage |
| Mutants a blind reviewer predicted were untested: 20 of 20 survived | the reviewer agent is the cheapest source of real gaps |
| Behaviour a site comment warned about: protected 87%; unflagged behaviour: 66% | design walks a gap-class list to supply what nobody anticipated |
| Static slop heuristics: 13% precise | they never block; only exact checks and measured time do |
| New slop families: tests of copied production code, lost duplicate-named tests | catalogued as S15 and S17 |
Pick from the request; say which mode you chose. Each mode loads only its own reference.
| Mode | Side | When | Read | Output |
|---|---|---|---|---|
| design | catch | "how should I test X", "test plan", "what could break" | design.md | failure list: one named test per bug, with level, oracle, doubles |
| write | catch | "write / add tests", TDD, a bug fix | write.md | tests, each proved with mutate.mjs --prove, or marked unverified |
| audit | both | "what do our tests catch", "why is CI slow", "what does a PR cost" | audit.md | cost profile, mutation results, and the ledger: catch beside cost, per file |
| prune | both | "too many tests", "tests that copy the code", "delete low-value tests" | prune.md | one PR per module: deletions and merges, an evidence row each |
| speed | cost | "slow tests", "slow CI", "parallelise", "offload", "only run tests for what changed" | speed.md, ci.md | where it runs, workers, tiers, fixture and harness fixes; before/after |
| gate | both | "test gate in CI", "block bad tests", "test budget" | gate.md | exact CI checks, the time-budget ratchet, the AGENTS.md Testing section |
| triage | catch | a red test, a survivor, a flake, a reviewer's test comment | triage.md | one ruling per item, with the evidence that decided it |
The flow: design feeds write; audit produces the ledger that prune (worst catch per second first) and speed (slowest unique catches first) act on; gate holds the line so the suite cannot drift back; triage rules on what audit, CI and reviewers raise. "Make our tests better" with no more detail means audit first.
.test-profile.yml at the repo root tunes how much evidence is demanded, never the doctrine.
Missing: defaults apply (standard, test-after) and design mode proposes one, asking first.
version: 1
shape: [http-service, cli] # drives default kinds of test
strictness: standard # standard | strict | critical
posture: test-after # tdd | test-after (a developer preference; gates ignore it)
kinds: {} # exceptions to shape defaults, e.g. { e2e: full, visual: review }
zones: # money, auth, pii, irreversible -> strict; mission-critical -> critical
- { paths: ["src/billing/**"], tags: [money] }
| standard | strict | critical | |
|---|---|---|---|
| New tests that must be proved | bug-fix tests | all | all, evidence in the PR |
| Audit mutants per zone file | 2 | 4 | 6 |
| Prune evidence | mutants, or overlap + reading | mutants | mutants |
.test-budget.json is separate and generated: measured suite time and grandfathered slow
tests, written by budget-gate.py baseline and checked in CI. Full schema, zone tags,
shapes, and the visual/e2e/browser policy: profile.md.
All paths are relative to this skill's folder; run them from the repo under test.
Catch: scripts/mutate.mjs. Zero dependencies (Node 18+). Runners: vitest, jest,
pytest, go, phpunit, pest (Laravel included), and command for anything else.
# write mode: does this one test catch this one mutant? exit 0 proved, 10 not proved
node "<skill-dir>/scripts/mutate.mjs" --runner vitest --catalogue m.json --prove "<test name>" -- <test file>
# audit mode: a batch, bracketed by automatic null controls
node "<skill-dir>/scripts/mutate.mjs" --runner pytest --catalogue audit.json --out results.jsonl
It restores files from memory (never git checkout, so uncommitted work is safe), refuses
a red or incomplete baseline, retries runs that silently dropped tests, classifies honestly
(only killed is a catch), and strips secret-looking env vars from every test run. It does
not deny network: unattended batches belong in a network-less container. Mutant rows:
assets/mutant.example.json; statuses: audit.md.
Cost: stdlib Python 3.8+, --json everywhere, exit 10 = "found something".
| Script | Answers | Worked call |
|---|---|---|
affected.py | which test commands this diff needs, from a committed path map (for stacks with no native selector); unmappable -> full | python "<skill-dir>/scripts/affected.py" --base origin/main |
oracle-scan.py | tests that re-type the source's formula, re-declare its functions, or call it on both sides of an assertion (advisory) | python "<skill-dir>/scripts/oracle-scan.py" --repo . |
run-plan.py | where can this run, how many local workers fit now, which runner commands | python "<skill-dir>/scripts/run-plan.py" targets --repo . --probe |
suite-profile.py | total time, slowest tests and files, flakes, before/after (JUnit from any runner) | python "<skill-dir>/scripts/suite-profile.py" profile reports/ --json > full.json |
ci-audit.py | billed CI minutes per change, by OS and workflow; workflow waste CI1-CI4 | python "<skill-dir>/scripts/ci-audit.py" cost --limit 50 |
coverage-overlap.py | tests whose lines another test covers: prune candidates, ranked by seconds | python "<skill-dir>/scripts/coverage-overlap.py" cov.json --profile full.json |
budget-gate.py | did the suite get slower, or gain a slow test? (the CI ratchet) | python "<skill-dir>/scripts/budget-gate.py" check full.json --baseline .test-budget.json |
coverage-check.sh | pytest coverage, report-only by default; --threshold restores a gate | bash "<skill-dir>/scripts/coverage-check.sh" |
The order that saves most, per speed.md: offload (run-plan.py targets: own machines first, CI next, metered sandboxes last, cost stated once) → run
only what changed (the ecosystem's selector, else affected.py; full run on merge) →
run wide (run-plan.py local sizes workers to free CPU and memory) → run faster
(fixtures, clocks, network) → a faster runner, or a harness rewritten in Go or Rust
when process spawns dominate.
test-review-agent (Read, Grep, Glob only) reviews a suite blind to any mutation results:
adjudicates heuristic flags, finds slop, and predicts behaviours no test would catch, with
plantable anchors. Spawn it from audit, prune and triage; persist its JSON reply unchanged.
assets/greptile-rules.md.A blocking seen-failing replay, nightly red-proof replay, per-PR generated mutants, and the
machinery that keeps a blocking heuristic gate honest (waivers, rebaselines, flake ledgers)
wait for evidence they are needed. So does a home-made test selector or mutation engine:
the ecosystem's own (testmon, --changed, nx/turbo affected, StrykerJS, Infection,
cargo-mutants) come first. Each deferral and its trigger: gate.md.
Framework mechanics live elsewhere; this skill decides what to test, whether it earns its
place, and where and when it runs. python-pytest-ops (pytest fixtures, plugins, config),
playwright-ops and cypress-ops (browser drivers), ci-cd-ops (workflow syntax in
general), evals-ops (LLM output quality), loop-ops (scheduling an audit as a
report-only loop), security-ops (finding holes).
| File | Contents |
|---|---|
| slop-patterns.md | S1-S18: tests that look like protection and are not, one question each |
| gap-classes.md | G1-G13: where realistic bugs went through green suites |
| speed.md | offload first, resource-capped parallelism, tiers and selection, where seconds go, faster runners |
| ci.md | how CI bills, CI1-CI4, tiered pipelines, shards, runner sizing, reports, flakes |
| prune.md | candidates, deletion evidence (revert-and-run), the one-module PR |
| mocking-strategies.md | what to fake, where, and why real lightweight dependencies win |
| tdd-workflow.md | the red-green-refactor cycle and the right-reason red |
| frameworks.md | test idioms per language and framework |
| visual-testing.md | visual checks through browser tooling |
| test-data-patterns.md | fixtures, factories, builders |
assets/agents-testing-section.md | the ## Testing section a repo adopts in its AGENTS.md |
assets/test-gate.yml, assets/ci-tiers.yml | the exact-check gate; the tiered pipeline with the budget step |
assets/test-profile.example.yml, assets/test-budget.example.json, assets/test-map.example.json | annotated profile; example budget baseline; example path map for affected.py |
assets/agents-testing-section.md (opens in a new tab)assets/ci-tiers.yml (opens in a new tab)assets/greptile-rules.md (opens in a new tab)assets/mutant.example.json (opens in a new tab)assets/test-budget.example.json (opens in a new tab)assets/test-gate.yml (opens in a new tab)assets/test-map.example.json (opens in a new tab)assets/test-profile.example.yml (opens in a new tab)references/ai-reviewers.md (opens in a new tab)references/audit.md (opens in a new tab)references/ci.md (opens in a new tab)references/design.md (opens in a new tab)references/frameworks.md (opens in a new tab)references/gap-classes.md (opens in a new tab)references/gate.md (opens in a new tab)references/mocking-strategies.md (opens in a new tab)references/profile.md (opens in a new tab)references/prune.md (opens in a new tab)references/slop-patterns.md (opens in a new tab)references/speed.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Use for any testing work: planning or writing tests, auditing what a suite catches and costs, pruning tests that catch nothing, making a suite or CI faster and cheaper, wiring a CI gate or time budget, or triaging a red test, flake, survivor or reviewer comment about tests.
Three short reads, in order
test-optimization, mutation-testing, ci-cost, flaky-tests, test-audit
npx claudepluginhub 0xdarkmatter/claude-mods --plugin claude-mods116 skills in this plugin
/a11y-opsWeb accessibility end to end: WCAG 2.2 AA, EAA and ADA Title II obligations, audits (axe, pa11y, keyboard, screen reader), the common failures, accessibility statements, and server-rendered Craft CMS/Twig sites (Formie, CKEditor, multi-site lang). Use when asked about a11y, WCAG, EAA, EN 301 549, Section 508, VPAT, NVDA/VoiceOver, focus, skip links, ARIA, landmarks, alt text, form labels or errors, contrast, target size, or 'is my site accessible'./adr-opsAuthor, index, and lint Architecture Decision Records — append-only memory that recovers the WHY behind a system's shape. Triggers on: adr, architecture decision record, decision log, record this decision, supersede an adr, why was this decided, adr template, next adr number./api-design-opsAPI design patterns for REST, gRPC, and GraphQL. Use for: api design, REST, gRPC, GraphQL, protobuf, schema design, api versioning, pagination, rate limiting, error format, OpenAPI, API authentication, JWT, OAuth2, API gateway, webhook, idempotency./astro-opsAstro framework patterns, rendering strategies, and deployment. Use for: astro, islands architecture, content collections, astro cloudflare, view transitions, partial hydration, astrojs, SSG, SSR, hybrid rendering, astro adapter./asus-router-opsASUS router config and hardening: Asuswrt-Merlin, security hardening, encrypted DNS (DoT/DoH), VPN (WireGuard/OpenVPN), guest networks, VLAN/IoT isolation, AiMesh, AiProtection. Triggers on: asus router, asuswrt, merlin, wireguard router, AiProtection, AiMesh, nvram, jffs, IoT isolation./atomiseAtom of Thoughts (AoT) reasoning - decompose complex problems into atomic units with confidence tracking and backtracking. For genuinely complex reasoning, not everyday questions. Triggers on: atomise, complex reasoning, decompose problem, structured thinking, verify hypothesis.Other plugins' skills for the same job