| name | deep-mutation-test |
| description | Use when the user wants mutation testing on changed files to verify AI-generated test quality, with optional auto-fix loop for surviving mutants. Triggers on `/deep-mutation-test`, "mutation test", "test quality", "mutation score", "๋ฎคํ
์ด์
ํ
์คํธ", "ํ
์คํธ ํ์ง ๊ฒ์ฆ". Primary callsite is Phase 4 (Test) but supports standalone manual use. Computes `killed / (killed + survived)` score (excludes NoCoverage), auto-fix loop (max 3 rounds) transitions back to Implement phase to add tests for survived mutants then re-runs. |
| user-invocable | true |
Invocation
์ด ์คํฌ์ ๋ ๊ฐ์ง ๊ฒฝ๋ก๋ก ํธ์ถ๋ฉ๋๋ค โ ์ด๋ ์ชฝ์ด๋ ๋ณธ SKILL ๋ณธ๋ฌธ์ ์ ์ฐจ๋ฅผ ๊ทธ๋๋ก ์คํํฉ๋๋ค:
- Claude Code ์ฌ๋์ โ ์ฌ์ฉ์๊ฐ
/deep-mutation-test [args...] ์
๋ ฅ (skill ์ user-invocable: true ๊ฐ ์ฌ๋์ ์ง์
์ ํ์ฉ).
- ํ ์์ด์ ํธ / Codex / Copilot CLI / Gemini CLI / SDK โ
Skill({ skill: "deep-work:deep-mutation-test", args: "..." }) ํํ๋ก ๋ช
์ invoke (cross-platform ํ์ค ๊ฒฝ๋ก).
๋ ๊ฒฝ๋ก ๋ชจ๋ args ๋ ๋์ผํ ํ ํฐ ๋ฌธ์์ด๋ก ์ ๋ฌ๋๋ฉฐ, ๋ณธ๋ฌธ ($ARGUMENTS ์๋ฆฌ) ์ ํ์๊ฐ ๋์ผํ๊ฒ ์ฒ๋ฆฌํฉ๋๋ค.
Inputs (skill args)
| ์ธ์ | ์๋ฏธ |
|---|
| (์์) | git diff ๊ธฐ๋ฐ changed files (์ธ์
baseline ๋๋ HEAD~5..HEAD fallback) |
--full | ์ ์ฒด ํ๋ก์ ํธ (expensive) |
--files <path> | ํน์ ํ์ผ/๋๋ ํฐ๋ฆฌ ๋ช
์ |
๋น args / ๋งค์นญ๋์ง ์๋ ํ ํฐ โ ๋ณธ๋ฌธ์ default ๋ถ๊ธฐ๋ก ์ง์
.
Prerequisites
์ด entry skill ์ deep-work-orchestrator (Phase dispatch) ๋ฐ deep-work-workflow (reference skill โ Phase ๊ท์ฝ/Exit Gate/M3 envelope) ์ ํจ๊ป ๋์ํฉ๋๋ค. ํ์ฑ deep-work ์ธ์
์ด ์์ ๋๋ ์ธ์
state file (.claude/deep-work.<SESSION_ID>.md) ์ ๋ณ์ (work_dir, current_phase, active_slice ๋ฑ) ๋ฅผ ์ฝ์ด ๋์ํ๋ฉฐ, ์ธ์
์ธ๋ถ์์๋ standalone ์คํ์ด ๊ฐ๋ฅํ ๊ฒฝ์ฐ ๋ณธ๋ฌธ์ ๋ถ๊ธฐ๋ฅผ ๋ฐ๋ฆ
๋๋ค.
Cross-platform self-containment: Claude Code ์์๋ sibling skill ์ด description ๋งค์นญ์ผ๋ก ์๋ ๋ก๋๋ฉ๋๋ค. Codex / Copilot CLI / Gemini CLI / Agent SDK ์์ Skill() ๋ก ํธ์ถ ์ sibling auto-load ๋ณด์ฅ์ด ์ฝํ ์ ์์ผ๋ฏ๋ก, ๋ณธ๋ฌธ์ self-contained ์ผ๋ก ๋ณด์กด๋์ด ์์ต๋๋ค โ state file ํด์, $ARGUMENTS ํ์ฑ, AskUserQuestion ๋ถ๊ธฐ, ์ถ๋ ฅ ํฌ๋งท์ด ์ธ๋ผ์ธ.
/deep-mutation-test
Mutation testing for AI-generated test quality verification. Primarily used in Phase 4 (Test) but can be run manually.
Usage
/deep-mutation-test # Test changed files (git diff based)
/deep-mutation-test --full # Test entire project (expensive)
/deep-mutation-test --files src/auth # Test specific files/directories
How It Works
Step 1: Determine Scope
Primary source: git diff --name-only <baseline>..HEAD where baseline is the session's starting commit.
Fallback: If no session, use git diff --name-only HEAD~5..HEAD (last 5 commits).
Override: --files flag specifies exact scope.
Filter files by detected ecosystem's file_extensions.
Step 2: Check Mutation Tool
Read sensor detection cache. If mutation tool is not_installed:
- Display warning: "Mutation testing tool not installed for [ecosystem]. Install [tool] to enable."
- Exit gracefully (not an error).
Step 3: Execute Mutation Testing
Run mutation tool with budget constraints from registry.json:
timeout: max seconds per round (default 300)
max_mutants: cap mutant count (default 200)
node "$PLUGIN_DIR/sensors/run-sensors.js" "<mutation_cmd>" "<parser>" "mutation" "advisory" <timeout>
Step 4: Analyze Results
Parse mutation report:
- Mutation Score = killed / (killed + survived) ร 100
- Exclude NoCoverage from denominator
- Tag possibly_equivalent mutants (NoCoverage + logging-related StringLiteral)
Step 5: Auto-Fix Loop (if survived mutants found)
IMPORTANT: Follow existing deep-test pattern โ Test phase does NOT allow code modifications.
For each round (max 3):
- Transition to Implement phase: Set
current_phase: implement in session state
- Present survived mutant feedback in agent-readable format:
[MUTATION_SURVIVED] N mutants survived (Score: X%)
Transitioning to Implement phase for test improvement.
MUTANT 1: file:line
Mutation: MutatorName โ changed `original` to `replacement`
Impact: What this means for behavior
ACTION: Specific test to add
- Agent writes tests following TDD (RED โ GREEN)
- Transition back: Set
current_phase: test
- Re-run mutation testing
- Compare: If score improved, continue. If no improvement after round, stop.
After 3 rounds or all killable mutants eliminated:
- Record final results in session receipt
- Display summary: score, rounds, fixed/remaining mutants
Step 6: Record Results
Add to session receipt:
{
"mutation_testing": {
"tool": "<tool>",
"status": "completed",
"total_mutants": 45,
"killed": 39,
"survived": 4,
"equivalent": 2,
"score": 90.7,
"auto_fix_rounds": 2,
"auto_fixed_mutants": 3,
"remaining_survived": []
}
}
Not Applicable Handling
If mutation tool is not installed, record in receipt:
{ "mutation_testing": { "status": "not_applicable", "reason": "tool not installed" } }
Quality Score treats this as excluded from denominator (no penalty).