mcpbeat Sign in

Nw Mutation Test Skill for Claude

Runs feature-scoped mutation testing to validate test suite quality. Use after implementation to verify tests catch real bugs (kill rate >= 80%).

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
588
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/nWave-ai/nWave --skill nw-mutation-test

The instruction itself

16 sections, as written by the author

NW-MUTATION-TEST: Feature-Scoped Mutation Testing

Wave: QUALITY_GATE

Agent: Crafter (nw-software-crafter)

Overview

Run mutation testing against implementation files from the current feature. Extracts targets from the execution-log.json (see Target extraction)|generates feature-scoped configs|delegates to software-crafter. Uses cosmic-ray (Python)|PIT (Java)|Stryker (JS/TS/C#).

Mutation Testing Strategy

Projects declare a strategy via ## Mutation Testing Strategy in CLAUDE.md: per-feature | nightly-delta | pre-release | disabled.

Default (when unspecified): nightly-delta — the recommended mode. CI runs mutmut nightly against modules changed since the last run (the delta), keeping per-feature delivery gates fast. /nw-mutation-test performs an explicit, on-demand feature-scoped run regardless of strategy; under nightly-delta the in-wave Phase 5 gate is skipped and the work is handled by the CI nightly pipeline.

Target extraction

Implementation files are selected from the execution-log.json (completed_steps[].files_modified.implementation).

Context Files Required

  • docs/feature/{feature-id}/deliver/execution-log.json - Implementation file extraction
  • scripts/mutation/generate_scoped_configs.py - Automated config generation (if available)

Pre-Invocation

Orchestrator performs before delegating:

  • Extract files — Read execution-log.json and extract implementation files from completed_steps[].files_modified.implementation. Gate: file list non-empty.
  • Verify on disk — Check all extracted files exist on disk. Gate: zero missing files.
  • Detect language — Scan config files (pyproject.toml, pom.xml, package.json, etc.) to select tool. Gate: language identified.
  • Confirm tests pass — Run pytest -x {test_scope} (or equivalent). Gate: exit code 0, no failures.
  • Ensure mutation venv — For Python, verify .venv-mutation/ exists with cosmic-ray installed. Gate: cosmic-ray --version succeeds.

Agent Invocation

@nw-software-crafter

Execute mutation testing for project {feature-id}.

Context to pass inline (agent has no Skill access):

  • Project ID
  • Implementation file list (from execution-log.json)
  • Test scope path (e.g., tests/des/)
  • Kill rate threshold (default: 80%)
  • Language and tool selection

Configuration:

  • threshold: 80 (percentage, minimum kill rate)
  • approach: feature-scoped (one config per component, scoped test commands)
  • config_generator: scripts/mutation/generate_scoped_configs.py (preferred over manual)

Output file: docs/feature/{feature-id}/deliver/mutation/mutation-report.md

Examples

Example 1: Python project with config generator

/nw-mutation-test des-hook-enforcement tests/des/

Reads the execution-log.json, runs generate_scoped_configs.py des-hook-enforcement, delegates to software-crafter with per-component configs. Agent runs cosmic-ray, produces mutation-report.md.

Example 2: Python project without config generator

/nw-mutation-test auth-upgrade tests/auth/

Extracts files manually from the execution-log.json, creates single cosmic-ray config with module-path = [file1, file2, ...] and test-command = "pytest -x tests/auth/", delegates to agent.

Example 3: Non-Python project

/nw-mutation-test payment-gateway tests/payment/

Detects package.json, selects Stryker, delegates with Stryker-specific instructions.

Success Criteria

  • [ ] Implementation files extracted from execution-log.json
  • [ ] All implementation files verified on disk
  • [ ] Mutation testing executed without errors
  • [ ] Per-file breakdown in mutation-report.md
  • [ ] Kill rate meets threshold (>= 80% PASS, 70-80% WARN, < 70% FAIL)
  • [ ] Source files restored to HEAD after mutation run (git checkout -- src/ tests/)

Post-Mutation Safety (mandatory)

After EVERY mutation run (success, failure, or interruption):

  • Restore source files — Run git checkout -- src/ tests/. Gate: working tree clean (no mutations remain).
  • Verify no corruption — Confirm test suite still passes after restore. Gate: pytest -x {test_scope} exits 0.

Mutation tools apply mutations directly to source files. An interrupted run can leave corrupted code (e.g. is not None -> is None). Agent MUST execute these steps even if the run errors out.

Quality Gate

Kill rate thresholds:

  • >= 80% PASS — Proceed to next wave.
  • 70-80% WARN — Review surviving mutants, document findings, proceed with caution.
  • < 70% FAIL — Add tests targeting surviving mutants before proceeding.

Skip conditions (each requires documented justification in mutation-report.md):

  • No tool for language — No mutation framework available for detected language.
  • Project opt-out.mutation-config.yaml has skip: true with justification.
  • Broken test suite — Pre-invocation step 4 fails; fix tests before mutation testing.

Note: Python projects require mutation testing. All skips need documented justification.

Next Wave

Handoff To: Phase 8 - Finalize (orchestrator continues develop.md workflow)

Deliverables: docs/feature/{feature-id}/deliver/mutation/mutation-report.md

Expected Outputs

docs/feature/{feature-id}/deliver/mutation/
  mutation-report.md
  cosmic-ray-*.toml                (ephemeral)

Other skills for the same job

different authors, same section of the catalogue
Webapp Testing
by anthropics
vendor ×12

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

6k tokens scripts
Finishing A Development Branch
by ZhanlinCui
×7

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

1k tokens
Test Driven Development
by w95
×7

Use when implementing any feature or bugfix, before writing implementation code

2k tokens
Systematic Debugging
by ratacat
×7

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

10k tokens scripts
Verification Before Completion
by ZhanlinCui
×6

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

1k tokens
Backtest Expert
by BaggaT236
×3

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

15k tokens scripts
Adaptyv
by christophacham
×3

Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.

16k tokens
Aeon
by christophacham
×3

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

19k tokens

How to use it

Copy the folder

Take nwave-ai/nw-mutation-test from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

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.