| allowed-tools | ["Read","Write","Grep","Glob","Bash"] |
| description | Use when debugging bugs to find root causes, or after 3 failed fix attempts to stop and document state. |
| name | debugger |
| trigger | ๋ฒ๊ทธ ๋๋ฒ๊น
, ์ค๋ฅ ์์ธ ์ฐพ๊ธฐ, ์๋ฌ ์ถ์ , root cause, unexpected behavior, bug investigation, 3 strike rule, ๊ฐ์ค ๊ฒ์ฆ, hypothesis testing, meta debugging, self code review, debug memory search, ๊ณผ๊ฑฐ ๋๋ฒ๊ทธ ๊ธฐ๋ก, systematic investigation, ๋ณ์ ๋ณ๊ฒฝ ํ
์คํธ, ํธํฅ ํผํ๊ธฐ, 3 ํ ์คํจ ํ ์ค๋จ, fresh session, ์ํ ๊ธฐ๋ก, root cause ๋ถ์, ์ฆ๋น ๊ธฐ๋ฐ ๋๋ฒ๊น
|
Quick Reference
- 3-Strike Rule: 3ํ ์คํจ ์ ์ฆ์ ์ค๋จ โ STATE.md ๊ธฐ๋ก โ fresh session ๊ถ์ฅ
- Memory First: ์กฐ์ฌ ์
.hxsk/memories/ ๊ฒ์์ผ๋ก ๊ณผ๊ฑฐ ์ ์ฌ ์ฌ๋ก ํ์ธ
- Valid Hypothesis: ๋ฐ์ฆ ๊ฐ๋ฅํด์ผ ํจ (๊ตฌ์ฒด์ ์์ธ ๋ช
์, ์ถ์ธก ๊ธ์ง)
- One Variable: ํ ๋ฒ์ ํ๋์ ๋ณ์๋ง ๋ณ๊ฒฝํ์ฌ ํ
์คํธ ๋ฐ ๋ฌธ์ํ
- Persist Findings: ์์ธ ๋ฐ๊ฒฌ ์
root-cause, ๋ฐฐ์ ์ debug-eliminated ์ ์ฅ
Core Philosophy
User = Reporter, AI = Investigator
User knows: what they expected, what happened, error messages, when it started.
User does NOT know (don't ask): what's causing it, which file, what the fix is.
Ask about experience. Investigate the cause yourself.
Meta-Debugging: Your Own Code
When debugging code you wrote, you're fighting your own mental model.
- Treat your code as foreign โ Read it as if someone else wrote it
- Question your design decisions โ Your implementations are hypotheses
- Admit your mental model might be wrong โ Code behavior is truth
- Prioritize code you touched โ Modified lines are prime suspects
Foundation Principles
- What do you know for certain? Observable facts, not assumptions
- What are you assuming? "This library should work this way" โ verified?
- Strip away everything you think you know. Build understanding from facts.
Cognitive Biases to Avoid
| Bias | Trap | Antidote |
|---|
| Confirmation | Only look for supporting evidence | Actively seek disconfirming evidence |
| Anchoring | First explanation becomes anchor | Generate 3+ hypotheses before investigating |
| Availability | Recent bugs โ assume similar cause | Treat each bug as novel |
| Sunk Cost | Spent 2 hours, keep going | Every 30 min: "Would I still take this path?" |
Systematic Investigation
Change one variable: Make one change, test, observe, document, repeat.
Complete reading: Read entire functions, not just "relevant" lines.
Embrace not knowing: "I don't know" = good (now you can investigate). "It must be X" = dangerous.
Debugging Techniques + Hypothesis Testing + When to Restart โ references/debugging-techniques.md
3-Strike Rule
After 3 failed fix attempts:
- STOP the current approach
- Document what was tried in DEBUG.md
- Summarize to STATE.md
- Recommend fresh session with new context
A fresh context often immediately sees what polluted context cannot.
Debug Memory
Before any investigation, search past context:
Grep(pattern: "{symptom}", path: ".hxsk/memories/", output_mode: "files_with_matches")
Persist findings after each session (elimination, root cause, blocked state).
Debug Memory ์ ์ฒด ํ๋กํ ์ฝ โ references/debug-memory.md
๊ด๋ จ ์คํฌ
- REQUIRED:
empirical-validation โ ์์ ํ ๊ฒฝํ์ ์ฆ๊ฑฐ๋ก ๊ฒ์ฆ
- REQUIRED:
memory-protocol โ ๊ทผ๋ณธ ์์ธ, ๋ฐฐ์ ๋ ๊ฐ์ค์ ๋ฉ๋ชจ๋ฆฌ์ ์ ์ฅ
- RECOMMENDED:
impact-analysis โ ์์ ์ ์ํฅ ๋ฒ์ ๋ถ์
Scripts
(์์ โ Bash, Read, Grep ๋ฑ ์์ด์ ํธ ๋ค์ดํฐ๋ธ ๋๊ตฌ๋ก ์ง์ ์ํ)
Iron Laws
NO CONTINUE_AFTER_3_FAILURES WITHOUT STATE_RECORDING_AND_FRESH_SESSION FIRST
NO HYPOTHESIS_FORMULATION WITHOUT FALSIFIABILITY FIRST
NO CHANGE_WITHOUT_ISOLATING_SINGLE_VARIABLE FIRST
NO DIAGNOSIS_WITHOUT_COMPLETE_FUNCTION_READING FIRST
NO INVESTIGATION_WITHOUT_PAST_MEMORY_SEARCH FIRST
NO ASKING_USER_FOR_ROOT_CAUSE FIRST
NO INVESTIGATION_WITHOUT_3_PLUS_HYPOTHESES FIRST
NO DEBUGGING_WITHOUT_TREATING_CODE_AS_FOREIGN FIRST
NO SESSION_END_WITHOUT_MEMORY_PERSISTENCE FIRST