bug-fix
Bug-fixing workflow that coordinates diagnosis, test-driven reproduction, root-cause analysis, and targeted fixes. Use when the user wants to fix a bug with…
Mutation testing workflow. Systematically mutates source code to verify tests actually catch bugs. Multi-session with progress tracking.
$ npx -y skills add chrisallenlane/claude-swe-workflows --skill test-mutation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/test-mutationContext preview
The summary Claude sees to decide when to auto-load this skill.
Mutation testing workflow. Systematically mutates source code to verify tests actually catch bugs. Multi-session with progress tracking.
name: test-mutation description: Mutation testing workflow. Systematically mutates source code to verify tests actually catch bugs. Multi-session with progress tracking. model: opus
Systematically introduces small changes (mutations) to source code, runs the test suite after each, and reports which mutations survive (tests don't catch them). Surviving mutations reveal genuine test coverage gaps that line coverage misses.
**Mutation score > line coverage.** A test that executes code but doesn't assert on results gives 100% line coverage and 0% mutation score. Mutation testing answers the real question: if a bug were introduced here, would the tests catch it?
**Multi-session by design.** Mutation testing is slow — each mutation requires a full test run. Progress is tracked in `.test-mutations.json` so you can work through a codebase incrementally across sessions.
**Autopilot by default.** After initial setup, the workflow runs unattended through all in-scope modules. It addresses all surviving mutations, commits after each module, and moves on. Human intervention is only needed during setup (scope selection, test command verification) and if an unrecoverable error occurs.
┌─────────────────────────────────────────────────────┐ │ TEST MUTATE │ ├─────────────────────────────────────────────────────┤ │ SETUP (interactive) │ │ 1. Initialize (load or create tracking file) │ │ 2. Detect test command (first run only) │ │ 3. Determine scope (user selects, default: all) │ │ │ │ EXECUTION (autopilot — no user interaction) │ │ For each module in scope: │ │ 4. Spawn qa-test-mutator agent │ │ 5. Update tracking file with results │ │ 6. Spawn SME to write tests for ALL survivors │ │ 7. Verify (new tests pass + re-mutate confirms) │ │ 8. Commit changes │ │ 9. Final summary │ └─────────────────────────────────────────────────────┘
Check for `.test-mutations.json` in the project root.
**If the file exists:**
**If the file doesn't exist:**
**Try in order:**
1. `Makefile` with a `test` target → `make test` 2. `package.json` with a `test` script → `npm test` 3. `go.mod` present → `go test ./...` 4. `pyproject.toml` or `pytest.ini` or `setup.cfg` with pytest config → `pytest` 5. `Cargo.toml` → `cargo test` 6. `build.gradle` or `build.gradle.kts` → `gradle test`
**If none detected:** Ask the user: "What command runs your test suite?"
**Verify the command works** by running it once. If it fails, report the error and ask the user for the correct command.
Store the test command in the tracking file.
Use Glob to find source files in the project. Exclude:
For each source file, attempt to identify covering test files using naming conventions:
Store discovered modules in the tracking file with status `pending`.
Present the current state to the user:
## Mutation Testing Progress Overall: 3/10 modules tested (mutation score: 87%) ### Completed - src/auth.go — score: 100% (45 mutations) - src/config.go — score: 92% (24 mutations, 2 survivors) ### In Progress - src/payment.go — score: 80% (20/50 mutations tested) ### Pending - src/api/handler.go - src/models/user.go - src/utils/parser.go - ... Scope? Enter file names/numbers, or press Enter to test all pending modules.
**User can:**
**Default:** All pending modules, processed in alphabetical order. If a module is in-progress, it is processed first.
**After scope is confirmed, the workflow enters autopilot mode. No further user interaction occurs until the run completes or an unrecoverable error is encountered.**
---
Spawn a `qa-test-mutator` agent with the selected source file and test command:
Apply mutation testing to the following source file: - Source file: [path] - Test command: [command] Systematically mutate the source code, run tests after each mutation, and report which mutations are killed vs survived.
Wait for the agent to complete and collect its results.
Parse the mutator agent's results and update `.test-mutations.json`:
A system of composable software engineering workflows for Claude Code. Plan projects, implement tickets, and run quality passes — from a single ticket to a multi-batch project, using the same layered architecture.
Repo: chrisallenlane/claude-swe-workflows
Bug-fixing workflow that coordinates diagnosis, test-driven reproduction, root-cause analysis, and targeted fixes. Use when the user wants to fix a bug with…
Proactive bug-hunting workflow. Assesses codebase risk through complexity, coverage, and structural analysis, then spawns focused investigators that write…
Multi-ticket batch workflow. Takes a batch of tickets, plans execution order, implements each via /implement in autonomous mode, runs cross-cutting quality…
Full-lifecycle project workflow. Takes batched tickets, implements via /implement-batch, runs smoke tests, then executes a comprehensive quality pipeline…
Iterative development workflow that coordinates implementation, refactoring, QA, and documentation agents to complete features systematically. Use when the…
Autonomous bug-elimination loop. Iteratively invokes /bug-hunt and /implement-batch until findings converge below an operator-specified severity floor. At…