| name | deep-debug |
| description | Use when the user enters debug sub-mode during deep-work Phase 3 (Implement) to investigate root causes before applying fixes. Triggers on `/deep-debug`, "systematic debug", "root cause investigation", "๋๋ฒ๊ทธ ๋ชจ๋", "๊ทผ๋ณธ ์์ธ ๋ถ์", `verification_cmd` ์คํจ ์ ์๋ ์ง์
, or "fix this" once iron-rule blocks guessing. Four phases: Investigate โ Analyze โ Hypothesize โ Implement. Iron rule: NO fixes without root cause investigation first. Escalates to user after 3 invalidated hypotheses. |
| user-invocable | true |
Invocation
์ด ์คํฌ์ ๋ ๊ฐ์ง ๊ฒฝ๋ก๋ก ํธ์ถ๋ฉ๋๋ค โ ์ด๋ ์ชฝ์ด๋ ๋ณธ SKILL ๋ณธ๋ฌธ์ ์ ์ฐจ๋ฅผ ๊ทธ๋๋ก ์คํํฉ๋๋ค:
- Claude Code ์ฌ๋์ โ ์ฌ์ฉ์๊ฐ
/deep-debug [args...] ์
๋ ฅ (skill ์ user-invocable: true ๊ฐ ์ฌ๋์ ์ง์
์ ํ์ฉ).
- ํ ์์ด์ ํธ / Codex / Copilot CLI / Gemini CLI / SDK โ
Skill({ skill: "deep-work:deep-debug", args: "..." }) ํํ๋ก ๋ช
์ invoke (cross-platform ํ์ค ๊ฒฝ๋ก).
๋ ๊ฒฝ๋ก ๋ชจ๋ args ๋ ๋์ผํ ํ ํฐ ๋ฌธ์์ด๋ก ์ ๋ฌ๋๋ฉฐ, ๋ณธ๋ฌธ ($ARGUMENTS ์๋ฆฌ) ์ ํ์๊ฐ ๋์ผํ๊ฒ ์ฒ๋ฆฌํฉ๋๋ค.
Inputs (skill args)
| ์ธ์ | ์๋ฏธ |
|---|
| (์์) | Debug sub-mode ์ง์
โ ํ์ฌ ์คํจ ์ปจํ
์คํธ๋ก๋ถํฐ root cause ๋ถ์ |
๋น 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 ๋ถ๊ธฐ, ์ถ๋ ฅ ํฌ๋งท์ด ์ธ๋ผ์ธ.
Systematic Debugging (v4.0)
You are entering Debug Sub-Mode within a Deep Work implementation session.
Language
Detect the user's language from their messages or the Claude Code language setting. Output ALL user-facing messages in the detected language.
Iron Rule
๐ซ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
Do NOT:
- Guess at fixes based on the error message alone
- Try random changes to see if they work
- Apply a fix without understanding WHY the bug exists
- Move on after a fix without verifying the root cause theory
Trigger Conditions
This command activates automatically when:
verification_cmd fails after the GREEN phase (unexpected regression)
- A previously passing test starts failing
- The user explicitly calls
/deep-debug
Phase 1: Investigate
-
Read the error carefully:
์๋ฌ ๋ถ์:
ํ
์คํธ: [failing test name]
์๋ฌ ๋ฉ์์ง: [exact error]
์คํ ํธ๋ ์ด์ค: [relevant lines]
-
Reproduce consistently: Run the failing command 2 more times to confirm it's not flaky
-
Check recent changes: What was the last edit before the failure?
git diff HEAD
git log --oneline -5
-
Gather evidence: Read related files, check imports, trace data flow
Phase 2: Analyze
-
Find a working reference: Is there similar code that works? Compare patterns.
-
Identify the difference: What's different between the working and broken state?
-
Trace data flow: Follow the data from input to the failure point:
๋ฐ์ดํฐ ํ๋ฆ:
์
๋ ฅ: [source] โ [transform1] โ [transform2] โ โ [failure point]
์์: [expected value at failure point]
์ค์ : [actual value at failure point]
Phase 3: Hypothesize
-
Form ONE hypothesis: Based on evidence, not guessing
๊ฐ์ค:
์์ธ: [specific root cause]
๊ทผ๊ฑฐ: [evidence supporting this hypothesis]
๊ฒ์ฆ ๋ฐฉ๋ฒ: [how to test this hypothesis]
-
Test the hypothesis minimally: Verify with the smallest possible change or check
-
If hypothesis is wrong: Return to Phase 2 with new data. Do NOT try another random fix.
Phase 4: Implement Fix
- Apply the minimal fix based on verified root cause
- Run the failing test โ it should now pass
- Run the full test suite โ no regressions
- Record the root cause:
Write to $WORK_DIR/debug-log/RC-NNN.md:
# Root Cause: [Title]
## ์ฆ์
- ์คํจํ ํ
์คํธ: [test name]
- ์๋ฌ ๋ฉ์์ง: [message]
## ๊ทผ๋ณธ ์์ธ
[Explanation of why the bug existed]
## ์์ ๋ด์ฉ
[What was changed and why]
## ๊ตํ
[What to watch for in the future]
## ๊ด๋ จ Slice
- SLICE-NNN: [goal]
- Update receipt: Set
debug.root_cause_note to the RC file path
Escalation
If 3 fix attempts fail (3 different hypotheses tested and invalidated):
โ ๏ธ ๋๋ฒ๊น
์์ค์ปฌ๋ ์ด์
3๋ฒ์ ์์ ์๋๊ฐ ์คํจํ์ต๋๋ค. ์ด๊ฒ์ ์ํคํ
์ฒ ์์ค์ ๋ฌธ์ ์ผ ์ ์์ต๋๋ค.
์๋ํ ๊ฐ์ค:
1. [hypothesis 1] โ [why it failed]
2. [hypothesis 2] โ [why it failed]
3. [hypothesis 3] โ [why it failed]
์ฌ์ฉ์์ ํ๋จ์ด ํ์ํฉ๋๋ค.
STOP and wait for user guidance. Do NOT continue guessing.
State Management
On entry:
- Set
debug_mode: true in state file
On exit (fix verified):
- Set
debug_mode: false
- Resume the TDD cycle where it was interrupted