get-shit-done-cc 1.4.2 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -344,6 +344,7 @@ You're never locked in. The system adapts.
344
344
  | `/gsd:consider-issues` | Review deferred issues, close resolved, identify urgent |
345
345
  | `/gsd:add-todo [desc]` | Capture idea or task from conversation for later |
346
346
  | `/gsd:check-todos [area]` | List pending todos, select one to work on |
347
+ | `/gsd:debug [desc]` | Systematic debugging with persistent state across `/clear` |
347
348
  | `/gsd:help` | Show all commands and usage guide |
348
349
 
349
350
  <sup>¹ Contributed by reddit user OracleGreyBeard</sup>
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: gsd:debug
3
+ description: Systematic debugging with persistent state across context resets
4
+ argument-hint: [issue description]
5
+ allowed-tools:
6
+ - Read
7
+ - Write
8
+ - Edit
9
+ - Bash
10
+ - Grep
11
+ - Glob
12
+ - AskUserQuestion
13
+ ---
14
+
15
+ <objective>
16
+ Debug issues using scientific method with a persistent debug document that survives `/clear`.
17
+
18
+ If resuming (no arguments and active session exists): pick up where you left off.
19
+ If starting new: gather symptoms, then investigate autonomously.
20
+ </objective>
21
+
22
+ <execution_context>
23
+ @~/.claude/get-shit-done/workflows/debug.md
24
+ @~/.claude/get-shit-done/templates/DEBUG.md
25
+ </execution_context>
26
+
27
+ <context>
28
+ User's issue: $ARGUMENTS
29
+
30
+ Check for active debug sessions:
31
+ ```bash
32
+ ls .planning/debug/*.md 2>/dev/null | head -5
33
+ ```
34
+ </context>
35
+
36
+ <process>
37
+ Follow the workflow in @~/.claude/get-shit-done/workflows/debug.md
38
+
39
+ **Quick reference:**
40
+
41
+ 1. **Check for active sessions** - Offer to resume or start new
42
+ 2. **Gather symptoms** - What happened? What should happen? Errors? When?
43
+ 3. **Create DEBUG.md** - Document symptoms in `.planning/debug/[slug].md`
44
+ 4. **Investigate** - Evidence → Hypothesis → Test → Eliminate or Confirm
45
+ 5. **Fix and verify** - Minimal fix, verify against original symptoms
46
+ 6. **Archive** - Move to `.planning/debug/resolved/`
47
+
48
+ **Key principle:** The DEBUG.md is your memory. Update it constantly. It survives `/clear`.
49
+ </process>
50
+
51
+ <success_criteria>
52
+ - [ ] Active sessions checked before starting new
53
+ - [ ] Symptoms gathered through AskUserQuestion (not inline questions)
54
+ - [ ] DEBUG.md tracks all investigation state
55
+ - [ ] Scientific method followed (not random fixes)
56
+ - [ ] Root cause confirmed with evidence before fixing
57
+ - [ ] Fix verified and session archived
58
+ </success_criteria>
@@ -248,6 +248,20 @@ Review deferred issues with codebase context.
248
248
 
249
249
  Usage: `/gsd:consider-issues`
250
250
 
251
+ ### Debugging
252
+
253
+ **`/gsd:debug [issue description]`**
254
+ Systematic debugging with persistent state across context resets.
255
+
256
+ - Gathers symptoms through adaptive questioning
257
+ - Creates `.planning/debug/[slug].md` to track investigation
258
+ - Investigates using scientific method (evidence → hypothesis → test)
259
+ - Survives `/clear` — run `/gsd:debug` with no args to resume
260
+ - Archives resolved issues to `.planning/debug/resolved/`
261
+
262
+ Usage: `/gsd:debug "login button doesn't work"`
263
+ Usage: `/gsd:debug` (resume active session)
264
+
251
265
  ### Todo Management
252
266
 
253
267
  **`/gsd:add-todo [description]`**
@@ -291,6 +305,8 @@ Show this command reference.
291
305
  ├── todos/ # Captured ideas and tasks
292
306
  │ ├── pending/ # Todos waiting to be worked on
293
307
  │ └── done/ # Completed todos
308
+ ├── debug/ # Active debug sessions
309
+ │ └── resolved/ # Archived resolved issues
294
310
  ├── codebase/ # Codebase map (brownfield projects)
295
311
  │ ├── STACK.md # Languages, frameworks, dependencies
296
312
  │ ├── ARCHITECTURE.md # Patterns, layers, data flow
@@ -367,6 +383,15 @@ Change anytime by editing `.planning/config.json`
367
383
  /gsd:check-todos api # Filter by area
368
384
  ```
369
385
 
386
+ **Debugging an issue:**
387
+
388
+ ```
389
+ /gsd:debug "form submission fails silently" # Start debug session
390
+ # ... investigation happens, context fills up ...
391
+ /clear
392
+ /gsd:debug # Resume from where you left off
393
+ ```
394
+
370
395
  ## Getting Help
371
396
 
372
397
  - Read `.planning/PROJECT.md` for project vision
@@ -58,6 +58,7 @@ If missing STATE.md or ROADMAP.md: inform what's missing, suggest running `/gsd:
58
58
  - Note any blockers, concerns, or deferred issues
59
59
  - Check for CONTEXT.md: For phases without PLAN.md files, check if `{phase}-CONTEXT.md` exists in phase directory
60
60
  - Count pending todos: `ls .planning/todos/pending/*.md 2>/dev/null | wc -l`
61
+ - Check for active debug sessions: `ls .planning/debug/*.md 2>/dev/null | grep -v resolved | wc -l`
61
62
  </step>
62
63
 
63
64
  <step name="report">
@@ -87,6 +88,10 @@ CONTEXT: [✓ if CONTEXT.md exists | - if not]
87
88
  ## Pending Todos
88
89
  - [count] pending — /gsd:check-todos to review
89
90
 
91
+ ## Active Debug Sessions
92
+ - [count] active — /gsd:debug to continue
93
+ (Only show this section if count > 0)
94
+
90
95
  ## What's Next
91
96
  [Next phase/plan objective from ROADMAP]
92
97
  ```
@@ -0,0 +1,253 @@
1
+ <philosophy>
2
+ Debugging is applied epistemology. You're investigating a system to discover truth about its behavior. The difference between junior and senior debugging is not knowledge of frameworks - it's the discipline of systematic investigation.
3
+ </philosophy>
4
+
5
+ <meta_debugging>
6
+ **Special challenge**: When you're debugging code you wrote or modified, you're fighting your own mental model.
7
+
8
+ **Why this is harder**:
9
+ - You made the design decisions - they feel obviously correct
10
+ - You remember your intent, not what you actually implemented
11
+ - You see what you meant to write, not what's there
12
+ - Familiarity breeds blindness to bugs
13
+
14
+ **The trap**:
15
+ - "I know this works because I implemented it correctly"
16
+ - "The bug must be elsewhere - I designed this part"
17
+ - "I tested this approach"
18
+ - These thoughts are red flags. Code you wrote is guilty until proven innocent.
19
+
20
+ **The discipline**:
21
+
22
+ **1. Treat your own code as foreign**
23
+ - Read it as if someone else wrote it
24
+ - Don't assume it does what you intended
25
+ - Verify what it actually does, not what you think it does
26
+ - Fresh eyes see bugs; familiar eyes see intent
27
+
28
+ **2. Question your own design decisions**
29
+ - "I chose approach X because..." - Was that reasoning sound?
30
+ - "I assumed Y would..." - Have you verified Y actually does that?
31
+ - Your implementation decisions are hypotheses, not facts
32
+
33
+ **3. Admit your mental model might be wrong**
34
+ - You built a mental model of how this works
35
+ - That model might be incomplete or incorrect
36
+ - The code's behavior is truth; your model is just a guess
37
+ - Be willing to discover you misunderstood the problem
38
+
39
+ **4. Prioritize code you touched**
40
+ - If you modified 100 lines and something breaks
41
+ - Those 100 lines are the prime suspects
42
+ - Don't assume the bug is in the framework or existing code
43
+ - Start investigating where you made changes
44
+
45
+ <example>
46
+ ❌ "I implemented the auth flow correctly, the bug must be in the existing user service"
47
+
48
+ ✅ "I implemented the auth flow. Let me verify each part:
49
+ - Does login actually set the token? [test it]
50
+ - Does the middleware actually validate it? [test it]
51
+ - Does logout actually clear it? [test it]
52
+ - One of these is probably wrong"
53
+
54
+ The second approach found that logout wasn't clearing the token from localStorage, only from memory.
55
+ </example>
56
+
57
+ **The hardest admission**: "I implemented this wrong."
58
+
59
+ Not "the requirements were unclear" or "the library is confusing" - YOU made an error. Whether it was 5 minutes ago or 5 days ago doesn't matter. Your code, your responsibility, your bug to find.
60
+
61
+ This intellectual honesty is the difference between debugging for hours and finding bugs quickly.
62
+ </meta_debugging>
63
+
64
+ <foundation>
65
+ When debugging, return to foundational truths:
66
+
67
+ **What do you know for certain?**
68
+ - What have you directly observed (not assumed)?
69
+ - What can you prove with a test right now?
70
+ - What is speculation vs evidence?
71
+
72
+ **What are you assuming?**
73
+ - "This library should work this way" - Have you verified?
74
+ - "The docs say X" - Have you tested that X actually happens?
75
+ - "This worked before" - Can you prove when it worked and what changed?
76
+
77
+ Strip away everything you think you know. Build understanding from observable facts.
78
+ </foundation>
79
+
80
+ <example>
81
+ ❌ "React state updates should be synchronous here"
82
+ ✅ "Let me add a console.log to observe when state actually updates"
83
+
84
+ ❌ "The API must be returning bad data"
85
+ ✅ "Let me log the exact response payload to see what's actually being returned"
86
+
87
+ ❌ "This database query should be fast"
88
+ ✅ "Let me run EXPLAIN to see the actual execution plan"
89
+ </example>
90
+
91
+ <cognitive_biases>
92
+
93
+ <bias name="confirmation_bias">
94
+ **The problem**: You form a hypothesis and only look for evidence that confirms it.
95
+
96
+ **The trap**: "I think it's a race condition" → You only look for async code, missing the actual typo in a variable name.
97
+
98
+ **The antidote**: Actively seek evidence that disproves your hypothesis. Ask "What would prove me wrong?"
99
+ </bias>
100
+
101
+ <bias name="anchoring">
102
+ **The problem**: The first explanation you encounter becomes your anchor, and you adjust from there instead of considering alternatives.
103
+
104
+ **The trap**: Error message mentions "timeout" → You assume it's a network issue, when it's actually a deadlock.
105
+
106
+ **The antidote**: Generate multiple independent hypotheses before investigating any single one. Force yourself to list 3+ possible causes.
107
+ </bias>
108
+
109
+ <bias name="availability_heuristic">
110
+ **The problem**: You remember recent bugs and assume similar symptoms mean the same cause.
111
+
112
+ **The trap**: "We had a caching issue last week, this must be caching too."
113
+
114
+ **The antidote**: Treat each bug as novel until evidence suggests otherwise. Recent memory is not evidence.
115
+ </bias>
116
+
117
+ <bias name="sunk_cost_fallacy">
118
+ **The problem**: You've spent 2 hours debugging down one path, so you keep going even when evidence suggests it's wrong.
119
+
120
+ **The trap**: "I've almost figured out this state management issue" - when the actual bug is in the API layer.
121
+
122
+ **The antidote**: Set checkpoints. Every 30 minutes, ask: "If I started fresh right now, is this still the path I'd take?"
123
+ </bias>
124
+
125
+ </cognitive_biases>
126
+
127
+ <systematic_investigation>
128
+
129
+ <discipline name="change_one_variable">
130
+ **Why it matters**: If you change multiple things at once, you don't know which one fixed (or broke) it.
131
+
132
+ **In practice**:
133
+ 1. Make one change
134
+ 2. Test
135
+ 3. Observe result
136
+ 4. Document
137
+ 5. Repeat
138
+
139
+ **The temptation**: "Let me also update this dependency and refactor this function and change this config..."
140
+
141
+ **The reality**: Now you have no idea what actually mattered.
142
+ </discipline>
143
+
144
+ <discipline name="complete_reading">
145
+ **Why it matters**: Skimming code causes you to miss crucial details. You see what you expect to see, not what's there.
146
+
147
+ **In practice**:
148
+ - Read entire functions, not just the "relevant" lines
149
+ - Read imports and dependencies
150
+ - Read configuration files completely
151
+ - Read test files to understand intended behavior
152
+
153
+ **The shortcut**: "This function is long, I'll just read the part where the error happens"
154
+
155
+ **The miss**: The bug is actually in how the function is called 50 lines up.
156
+ </discipline>
157
+
158
+ <discipline name="embrace_not_knowing">
159
+ **Why it matters**: Premature certainty stops investigation. "I don't know" is a position of strength.
160
+
161
+ **In practice**:
162
+ - "I don't know why this fails" - Good. Now you can investigate.
163
+ - "It must be X" - Dangerous. You've stopped thinking.
164
+
165
+ **The pressure**: Users want answers. Managers want ETAs. Your ego wants to look smart.
166
+
167
+ **The truth**: "I need to investigate further" is more professional than a wrong fix.
168
+ </discipline>
169
+
170
+ </systematic_investigation>
171
+
172
+ <when_to_restart>
173
+
174
+ <restart_signals>
175
+ You should consider starting over when:
176
+
177
+ 1. **You've been investigating for 2+ hours with no progress**
178
+ - You're likely tunnel-visioned
179
+ - Take a break, then restart from evidence gathering
180
+
181
+ 2. **You've made 3+ "fixes" that didn't work**
182
+ - Your mental model is wrong
183
+ - Go back to first principles
184
+
185
+ 3. **You can't explain the current behavior**
186
+ - Don't add more changes on top of confusion
187
+ - First understand what's happening, then fix it
188
+
189
+ 4. **You're debugging the debugger**
190
+ - "Is my logging broken? Is the debugger lying?"
191
+ - Step back. Something fundamental is wrong.
192
+
193
+ 5. **The fix works but you don't know why**
194
+ - This isn't fixed. This is luck.
195
+ - Investigate until you understand, or revert the change
196
+ </restart_signals>
197
+
198
+ <restart_protocol>
199
+ When restarting:
200
+
201
+ 1. **Close all files and terminals**
202
+ 2. **Write down what you know for certain** (not what you think)
203
+ 3. **Write down what you've ruled out**
204
+ 4. **List new hypotheses** (different from before)
205
+ 5. **Begin again from Phase 1: Evidence Gathering**
206
+
207
+ This isn't failure. This is professionalism.
208
+ </restart_protocol>
209
+
210
+ </when_to_restart>
211
+
212
+ <humility>
213
+ The best debuggers have deep humility about their mental models:
214
+
215
+ **They know**:
216
+ - Their understanding of the system is incomplete
217
+ - Documentation can be wrong or outdated
218
+ - Their memory of "how this works" may be faulty
219
+ - The system's behavior is the only truth
220
+
221
+ **They don't**:
222
+ - Trust their first instinct
223
+ - Assume anything works as designed
224
+ - Skip verification steps
225
+ - Declare victory without proof
226
+
227
+ **They ask**:
228
+ - "What am I missing?"
229
+ - "What am I wrong about?"
230
+ - "What haven't I tested?"
231
+ - "What does the evidence actually say?"
232
+ </humility>
233
+
234
+ <craft>
235
+ Debugging is a craft that improves with practice:
236
+
237
+ **Novice debuggers**:
238
+ - Try random things hoping something works
239
+ - Skip reading code carefully
240
+ - Don't test their hypotheses
241
+ - Declare success too early
242
+
243
+ **Expert debuggers**:
244
+ - Form hypotheses explicitly
245
+ - Test hypotheses systematically
246
+ - Read code like literature
247
+ - Verify fixes rigorously
248
+ - Learn from each investigation
249
+
250
+ **The difference**: Not intelligence. Not knowledge. Discipline.
251
+
252
+ Practice the discipline of systematic investigation, and debugging becomes a strength.
253
+ </craft>