一键导入
nw-mutation-test
Runs feature-scoped mutation testing to validate test suite quality. Use after implementation to verify tests catch real bugs (kill rate >= 80%).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Runs feature-scoped mutation testing to validate test suite quality. Use after implementation to verify tests catch real bugs (kill rate >= 80%).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Cross-agent collaboration protocols, workflow handoff patterns, and commit message formats for TDD/Mikado/refactoring workflows
Orchestrates the full DELIVER wave end-to-end (roadmap > execute-all > finalize). Use when all prior waves are complete and the feature is ready for implementation.
Acceptance test creation methodology for the DISTILL wave. Domain knowledge for the acceptance designer agent: port-to-port principle, prior wave reading, wave-decision reconciliation, graceful degradation, and document back-propagation.
Creates a phased roadmap.json for a feature goal with acceptance criteria and TDD steps. Use when planning implementation steps before execution.
Dispatches one unit of DELIVER work to a specialized agent for TDD execution. Runs a single roadmap.json step through the TDD cycle.
Deep knowledge for Outside-In TDD - double-loop architecture, ATDD integration, port-to-port testing, walking skeletons, and test doubles policy
| name | nw-mutation-test |
| description | Runs feature-scoped mutation testing to validate test suite quality. Use after implementation to verify tests catch real bugs (kill rate >= 80%). |
| user-invocable | true |
| argument-hint | [feature-id] - Optional: --threshold=[75|80|85] --language=[auto|python|java|javascript] |
Wave: QUALITY_GATE Agent: Crafter (nw-software-crafter)
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#).
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.
Implementation files are selected from the execution-log.json (completed_steps[].files_modified.implementation).
docs/feature/{feature-id}/deliver/execution-log.json - Implementation file extractionscripts/mutation/generate_scoped_configs.py - Automated config generation (if available)Orchestrator performs before delegating:
execution-log.json and extract implementation files from completed_steps[].files_modified.implementation. Gate: file list non-empty.pytest -x {test_scope} (or equivalent). Gate: exit code 0, no failures..venv-mutation/ exists with cosmic-ray installed. Gate: cosmic-ray --version succeeds.@nw-software-crafter
Execute mutation testing for project {feature-id}.
Context to pass inline (agent has no Skill access):
tests/des/)Configuration:
scripts/mutation/generate_scoped_configs.py (preferred over manual)Output file: docs/feature/{feature-id}/deliver/mutation/mutation-report.md
/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.
/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.
/nw-mutation-test payment-gateway tests/payment/
Detects package.json, selects Stryker, delegates with Stryker-specific instructions.
After EVERY mutation run (success, failure, or interruption):
git checkout -- src/ tests/. Gate: working tree clean (no mutations remain).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.
Kill rate thresholds:
Skip conditions (each requires documented justification in mutation-report.md):
.mutation-config.yaml has skip: true with justification.Note: Python projects require mutation testing. All skips need documented justification.
Handoff To: Phase 8 - Finalize (orchestrator continues develop.md workflow)
Deliverables: docs/feature/{feature-id}/deliver/mutation/mutation-report.md
docs/feature/{feature-id}/deliver/mutation/
mutation-report.md
cosmic-ray-*.toml (ephemeral)