get-shit-done-cc 1.4.21 → 1.4.22
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/commands/gsd/debug.md
CHANGED
|
@@ -9,19 +9,22 @@ allowed-tools:
|
|
|
9
9
|
- Bash
|
|
10
10
|
- Grep
|
|
11
11
|
- Glob
|
|
12
|
+
- Task
|
|
12
13
|
- AskUserQuestion
|
|
13
14
|
---
|
|
14
15
|
|
|
15
16
|
<objective>
|
|
16
|
-
Debug issues using scientific method with
|
|
17
|
+
Debug issues using scientific method with subagent isolation for investigation.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
**Orchestrator role:** Gather symptoms interactively, spawn investigation subagent, handle checkpoints, spawn continuation agents as needed.
|
|
20
|
+
|
|
21
|
+
**Why subagent:** Investigation burns context fast (reading files, forming hypotheses, testing). Fresh 200k context per investigation attempt. Main context stays lean for user interaction.
|
|
20
22
|
</objective>
|
|
21
23
|
|
|
22
24
|
<execution_context>
|
|
23
25
|
@~/.claude/get-shit-done/workflows/debug.md
|
|
24
26
|
@~/.claude/get-shit-done/templates/DEBUG.md
|
|
27
|
+
@~/.claude/get-shit-done/templates/debug-subagent-prompt.md
|
|
25
28
|
</execution_context>
|
|
26
29
|
|
|
27
30
|
<context>
|
|
@@ -29,30 +32,170 @@ User's issue: $ARGUMENTS
|
|
|
29
32
|
|
|
30
33
|
Check for active debug sessions:
|
|
31
34
|
```bash
|
|
32
|
-
ls .planning/debug/*.md 2>/dev/null | head -5
|
|
35
|
+
ls .planning/debug/*.md 2>/dev/null | grep -v resolved | head -5
|
|
33
36
|
```
|
|
34
37
|
</context>
|
|
35
38
|
|
|
36
39
|
<process>
|
|
37
|
-
Follow the workflow in @~/.claude/get-shit-done/workflows/debug.md
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
## 1. Check Active Sessions
|
|
42
|
+
|
|
43
|
+
If active sessions exist AND no $ARGUMENTS:
|
|
44
|
+
- List sessions with status, hypothesis, next action
|
|
45
|
+
- User picks number to resume OR describes new issue
|
|
46
|
+
|
|
47
|
+
If $ARGUMENTS provided OR user describes new issue:
|
|
48
|
+
- Continue to symptom gathering
|
|
49
|
+
|
|
50
|
+
## 2. Gather Symptoms (Main Context)
|
|
51
|
+
|
|
52
|
+
Use AskUserQuestion for each:
|
|
53
|
+
|
|
54
|
+
1. **Expected behavior** - What should happen?
|
|
55
|
+
2. **Actual behavior** - What happens instead?
|
|
56
|
+
3. **Error messages** - Any errors? (paste or describe)
|
|
57
|
+
4. **Timeline** - When did this start? Ever worked?
|
|
58
|
+
5. **Reproduction** - How do you trigger it?
|
|
59
|
+
|
|
60
|
+
After each answer, note it. After all gathered, confirm ready to investigate.
|
|
61
|
+
|
|
62
|
+
## 3. Create Debug File
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
mkdir -p .planning/debug
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Create `.planning/debug/{slug}.md` with:
|
|
69
|
+
- status: investigating
|
|
70
|
+
- trigger: user's original description
|
|
71
|
+
- Symptoms section filled from gathering
|
|
72
|
+
- Empty Evidence, Eliminated, Resolution sections
|
|
73
|
+
|
|
74
|
+
## 4. Spawn Investigation Subagent
|
|
40
75
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
76
|
+
Fill debug-subagent-prompt template with:
|
|
77
|
+
- `{slug}`: Generated slug
|
|
78
|
+
- `{trigger}`: Original issue description
|
|
79
|
+
- `{expected}`: From symptom gathering
|
|
80
|
+
- `{actual}`: From symptom gathering
|
|
81
|
+
- `{errors}`: From symptom gathering
|
|
82
|
+
- `{reproduction}`: From symptom gathering
|
|
83
|
+
- `{timeline}`: From symptom gathering
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
Task(
|
|
87
|
+
prompt=filled_debug_subagent_prompt,
|
|
88
|
+
subagent_type="general-purpose",
|
|
89
|
+
description="Debug {slug}"
|
|
90
|
+
)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## 5. Handle Subagent Return
|
|
94
|
+
|
|
95
|
+
**If `## ROOT CAUSE FOUND`:**
|
|
96
|
+
- Display root cause and evidence summary
|
|
97
|
+
- Offer options:
|
|
98
|
+
- "Fix now" → spawn fix subagent
|
|
99
|
+
- "Plan fix" → suggest /gsd:plan-fix
|
|
100
|
+
- "Manual fix" → done
|
|
101
|
+
|
|
102
|
+
**If `## CHECKPOINT REACHED`:**
|
|
103
|
+
- Present checkpoint details to user
|
|
104
|
+
- Get user response
|
|
105
|
+
- Spawn continuation agent (see step 6)
|
|
106
|
+
|
|
107
|
+
**If `## INVESTIGATION INCONCLUSIVE`:**
|
|
108
|
+
- Show what was checked and eliminated
|
|
109
|
+
- Offer options:
|
|
110
|
+
- "Continue investigating" → spawn new agent with additional context
|
|
111
|
+
- "Manual investigation" → done
|
|
112
|
+
- "Add more context" → gather more symptoms, spawn again
|
|
113
|
+
|
|
114
|
+
## 6. Spawn Continuation Agent (After Checkpoint)
|
|
115
|
+
|
|
116
|
+
When user responds to checkpoint, spawn fresh agent:
|
|
117
|
+
|
|
118
|
+
```markdown
|
|
119
|
+
<objective>
|
|
120
|
+
Continue debugging {slug}.
|
|
121
|
+
|
|
122
|
+
**DO NOT REDO** previous investigation. Evidence is in the debug file.
|
|
123
|
+
</objective>
|
|
124
|
+
|
|
125
|
+
<prior_state>
|
|
126
|
+
Debug file: @.planning/debug/{slug}.md
|
|
127
|
+
|
|
128
|
+
Read this file - it contains all evidence gathered so far.
|
|
129
|
+
</prior_state>
|
|
130
|
+
|
|
131
|
+
<checkpoint_response>
|
|
132
|
+
**Checkpoint was:** {checkpoint_type}
|
|
133
|
+
**User response:** {user_response}
|
|
134
|
+
|
|
135
|
+
{interpretation based on checkpoint type}
|
|
136
|
+
</checkpoint_response>
|
|
137
|
+
|
|
138
|
+
<execution_context>
|
|
139
|
+
@~/.claude/get-shit-done/workflows/debug.md
|
|
140
|
+
@~/.claude/get-shit-done/templates/DEBUG.md
|
|
141
|
+
</execution_context>
|
|
142
|
+
|
|
143
|
+
<instructions>
|
|
144
|
+
1. Read the debug file to understand current state
|
|
145
|
+
2. Incorporate user's checkpoint response
|
|
146
|
+
3. Continue investigation from Current Focus
|
|
147
|
+
4. Update debug file continuously
|
|
148
|
+
5. Return with ROOT CAUSE FOUND, CHECKPOINT REACHED, or INVESTIGATION INCONCLUSIVE
|
|
149
|
+
</instructions>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 7. Fix (Optional)
|
|
153
|
+
|
|
154
|
+
If user chooses "Fix now" after root cause found:
|
|
155
|
+
|
|
156
|
+
```markdown
|
|
157
|
+
<objective>
|
|
158
|
+
Fix the root cause identified in {slug} debug session.
|
|
159
|
+
</objective>
|
|
160
|
+
|
|
161
|
+
<context>
|
|
162
|
+
Debug file: @.planning/debug/{slug}.md
|
|
163
|
+
Root cause: {root_cause}
|
|
164
|
+
Files involved: {files}
|
|
165
|
+
</context>
|
|
166
|
+
|
|
167
|
+
<instructions>
|
|
168
|
+
1. Implement minimal fix addressing root cause
|
|
169
|
+
2. Verify fix against original symptoms
|
|
170
|
+
3. Update debug file Resolution section
|
|
171
|
+
4. Commit with message referencing debug session
|
|
172
|
+
5. Archive to .planning/debug/resolved/
|
|
173
|
+
</instructions>
|
|
174
|
+
```
|
|
47
175
|
|
|
48
|
-
**Key principle:** The DEBUG.md is your memory. Update it constantly. It survives `/clear`.
|
|
49
176
|
</process>
|
|
50
177
|
|
|
178
|
+
<checkpoint_types>
|
|
179
|
+
Subagent may return checkpoints for:
|
|
180
|
+
|
|
181
|
+
**human-verify:** "Can you confirm you see X when you do Y?"
|
|
182
|
+
- Present verification request
|
|
183
|
+
- User responds with confirmation or what they see instead
|
|
184
|
+
|
|
185
|
+
**human-action:** "I need you to run this command / check this thing"
|
|
186
|
+
- Present action request
|
|
187
|
+
- User responds "done" or with results
|
|
188
|
+
|
|
189
|
+
**decision:** "Should I investigate path A or path B?"
|
|
190
|
+
- Present options with context
|
|
191
|
+
- User picks direction
|
|
192
|
+
</checkpoint_types>
|
|
193
|
+
|
|
51
194
|
<success_criteria>
|
|
52
|
-
- [ ]
|
|
53
|
-
- [ ]
|
|
54
|
-
- [ ]
|
|
55
|
-
- [ ]
|
|
195
|
+
- [ ] Symptoms gathered interactively in main context
|
|
196
|
+
- [ ] Investigation runs in subagent (fresh context)
|
|
197
|
+
- [ ] Debug file tracks all state across agent boundaries
|
|
198
|
+
- [ ] Checkpoints handled via continuation agents
|
|
56
199
|
- [ ] Root cause confirmed with evidence before fixing
|
|
57
200
|
- [ ] Fix verified and session archived
|
|
58
201
|
</success_criteria>
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# Debug Subagent Prompt Template
|
|
2
2
|
|
|
3
|
-
Template for spawning debug agents
|
|
3
|
+
Template for spawning debug investigation agents. Used by:
|
|
4
|
+
- `/gsd:debug` — Interactive debugging (find and offer to fix)
|
|
5
|
+
- `diagnose-issues` — UAT parallel diagnosis (find root cause only)
|
|
6
|
+
|
|
7
|
+
The `goal` flag determines behavior after root cause is found.
|
|
4
8
|
|
|
5
9
|
---
|
|
6
10
|
|
|
@@ -8,13 +12,12 @@ Template for spawning debug agents from diagnose-issues workflow. Each agent inv
|
|
|
8
12
|
|
|
9
13
|
```markdown
|
|
10
14
|
<objective>
|
|
11
|
-
Investigate
|
|
15
|
+
Investigate issue and find root cause.
|
|
12
16
|
|
|
13
17
|
**Issue:** {issue_id}
|
|
14
18
|
**Summary:** {issue_summary}
|
|
15
|
-
**Severity:** {severity}
|
|
16
19
|
|
|
17
|
-
Symptoms are pre-filled
|
|
20
|
+
Symptoms are pre-filled. Skip symptom gathering, start investigating immediately.
|
|
18
21
|
</objective>
|
|
19
22
|
|
|
20
23
|
<execution_context>
|
|
@@ -25,16 +28,15 @@ Symptoms are pre-filled from UAT testing. Skip symptom gathering, start investig
|
|
|
25
28
|
@~/.claude/get-shit-done/references/debugging/investigation-techniques.md
|
|
26
29
|
</execution_context>
|
|
27
30
|
|
|
28
|
-
<
|
|
29
|
-
**
|
|
30
|
-
- expected: {expected}
|
|
31
|
-
- actual: {reported}
|
|
32
|
-
- severity: {severity}
|
|
33
|
-
- reproduction: Test {test_num} in UAT
|
|
31
|
+
<symptoms>
|
|
32
|
+
**Pre-filled from orchestrator:**
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
- expected: {expected}
|
|
35
|
+
- actual: {actual}
|
|
36
|
+
- errors: {errors}
|
|
37
|
+
- reproduction: {reproduction}
|
|
38
|
+
- timeline: {timeline}
|
|
39
|
+
</symptoms>
|
|
38
40
|
|
|
39
41
|
<mode>
|
|
40
42
|
**symptoms_prefilled: true**
|
|
@@ -42,86 +44,228 @@ Symptoms are pre-filled from UAT testing. Skip symptom gathering, start investig
|
|
|
42
44
|
Skip the symptom_gathering step entirely. Symptoms section is already filled.
|
|
43
45
|
Start directly at investigation_loop.
|
|
44
46
|
|
|
45
|
-
**goal:
|
|
46
|
-
|
|
47
|
-
Do NOT apply fixes. Your job is to:
|
|
48
|
-
1. Investigate the issue
|
|
49
|
-
2. Form and test hypotheses
|
|
50
|
-
3. Find the root cause with evidence
|
|
51
|
-
4. Return the diagnosis
|
|
47
|
+
**goal: {goal}**
|
|
52
48
|
|
|
53
|
-
|
|
49
|
+
- `find_root_cause_only` — Diagnose but do NOT fix. Return root cause to orchestrator. Used by UAT diagnosis flow where plan-fix handles the fix.
|
|
50
|
+
- `find_and_fix` — Find root cause, then fix and verify. Used by interactive /gsd:debug where user wants immediate resolution.
|
|
54
51
|
</mode>
|
|
55
52
|
|
|
56
53
|
<debug_file>
|
|
57
|
-
|
|
54
|
+
**Path:** .planning/debug/{slug}.md
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
Example: `comment-not-refreshing.md`
|
|
56
|
+
Create debug file immediately with symptoms pre-filled:
|
|
61
57
|
|
|
62
|
-
Pre-fill Symptoms section:
|
|
63
58
|
```markdown
|
|
59
|
+
---
|
|
60
|
+
status: investigating
|
|
61
|
+
trigger: "{issue_summary}"
|
|
62
|
+
created: [ISO timestamp]
|
|
63
|
+
updated: [ISO timestamp]
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Current Focus
|
|
67
|
+
|
|
68
|
+
hypothesis: gathering initial evidence
|
|
69
|
+
test: examining error context and relevant code
|
|
70
|
+
expecting: clues about failure point
|
|
71
|
+
next_action: search for error text in codebase
|
|
72
|
+
|
|
64
73
|
## Symptoms
|
|
65
74
|
|
|
66
75
|
expected: {expected}
|
|
67
|
-
actual: {
|
|
68
|
-
errors:
|
|
69
|
-
reproduction:
|
|
70
|
-
started:
|
|
71
|
-
|
|
76
|
+
actual: {actual}
|
|
77
|
+
errors: {errors}
|
|
78
|
+
reproduction: {reproduction}
|
|
79
|
+
started: {timeline}
|
|
80
|
+
|
|
81
|
+
## Eliminated
|
|
82
|
+
|
|
83
|
+
[none yet]
|
|
84
|
+
|
|
85
|
+
## Evidence
|
|
72
86
|
|
|
73
|
-
|
|
87
|
+
[none yet]
|
|
74
88
|
|
|
75
|
-
|
|
89
|
+
## Resolution
|
|
90
|
+
|
|
91
|
+
root_cause:
|
|
92
|
+
fix:
|
|
93
|
+
verification:
|
|
94
|
+
files_changed: []
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Update continuously.** The debug file is your memory. Before every action, update Current Focus. After every finding, append to Evidence.
|
|
76
98
|
</debug_file>
|
|
77
99
|
|
|
78
|
-
<
|
|
79
|
-
When
|
|
100
|
+
<checkpoint_behavior>
|
|
101
|
+
**When you need user input during investigation:**
|
|
102
|
+
|
|
103
|
+
If you cannot proceed without user action or verification:
|
|
104
|
+
|
|
105
|
+
1. Update debug file with current state
|
|
106
|
+
2. Return structured checkpoint instead of completing
|
|
107
|
+
|
|
108
|
+
**Checkpoint format:**
|
|
109
|
+
|
|
110
|
+
```markdown
|
|
111
|
+
## CHECKPOINT REACHED
|
|
112
|
+
|
|
113
|
+
**Type:** [human-verify | human-action | decision]
|
|
114
|
+
**Debug Session:** .planning/debug/{slug}.md
|
|
115
|
+
**Progress:** {evidence_count} evidence entries, {eliminated_count} hypotheses eliminated
|
|
116
|
+
|
|
117
|
+
### Investigation State
|
|
118
|
+
|
|
119
|
+
**Current Hypothesis:** {from Current Focus}
|
|
120
|
+
**Evidence So Far:**
|
|
121
|
+
- {key finding 1}
|
|
122
|
+
- {key finding 2}
|
|
80
123
|
|
|
124
|
+
### Checkpoint Details
|
|
125
|
+
|
|
126
|
+
[Type-specific content]
|
|
127
|
+
|
|
128
|
+
### Awaiting
|
|
129
|
+
|
|
130
|
+
[What you need from user]
|
|
81
131
|
```
|
|
82
|
-
|
|
132
|
+
|
|
133
|
+
**Checkpoint types:**
|
|
134
|
+
|
|
135
|
+
**human-verify** — Need user to confirm something you can't observe:
|
|
136
|
+
- What to check, how to check it, what to report back
|
|
137
|
+
|
|
138
|
+
**human-action** — Need user to do something (auth, physical action):
|
|
139
|
+
- What action, why you can't do it, steps to complete
|
|
140
|
+
|
|
141
|
+
**decision** — Need user to choose investigation direction:
|
|
142
|
+
- What's being decided, options with implications
|
|
143
|
+
|
|
144
|
+
**After checkpoint:** Orchestrator gets user response, spawns fresh continuation agent. You will NOT be resumed.
|
|
145
|
+
</checkpoint_behavior>
|
|
146
|
+
|
|
147
|
+
<return_formats>
|
|
148
|
+
**Return ONE of these when done:**
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
**Root cause found (goal: find_root_cause_only):**
|
|
153
|
+
|
|
154
|
+
```markdown
|
|
155
|
+
## ROOT CAUSE FOUND
|
|
156
|
+
|
|
157
|
+
**Debug Session:** .planning/debug/{slug}.md
|
|
83
158
|
|
|
84
159
|
**Root Cause:** [specific cause with evidence]
|
|
85
160
|
|
|
86
|
-
**Evidence:**
|
|
161
|
+
**Evidence Summary:**
|
|
87
162
|
- [key finding 1]
|
|
88
163
|
- [key finding 2]
|
|
89
164
|
- [key finding 3]
|
|
90
165
|
|
|
91
166
|
**Files Involved:**
|
|
92
|
-
- [file1
|
|
93
|
-
- [file2
|
|
94
|
-
|
|
95
|
-
**Debug Session:** .planning/debug/{slug}.md
|
|
167
|
+
- [file1]: [what's wrong]
|
|
168
|
+
- [file2]: [related issue]
|
|
96
169
|
|
|
97
170
|
**Suggested Fix Direction:** [brief hint for plan-fix, not implementation]
|
|
98
171
|
```
|
|
99
172
|
|
|
100
|
-
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
**Root cause found (goal: find_and_fix):**
|
|
176
|
+
|
|
177
|
+
After finding root cause, proceed to fix_and_verify step per workflow.
|
|
178
|
+
|
|
179
|
+
When complete:
|
|
180
|
+
|
|
181
|
+
```markdown
|
|
182
|
+
## DEBUG COMPLETE
|
|
101
183
|
|
|
184
|
+
**Debug Session:** .planning/debug/resolved/{slug}.md
|
|
185
|
+
|
|
186
|
+
**Root Cause:** [what was wrong]
|
|
187
|
+
**Fix Applied:** [what was changed]
|
|
188
|
+
**Verification:** [how verified]
|
|
189
|
+
|
|
190
|
+
**Files Changed:**
|
|
191
|
+
- [file1]: [change]
|
|
192
|
+
- [file2]: [change]
|
|
193
|
+
|
|
194
|
+
**Commit:** [hash]
|
|
102
195
|
```
|
|
103
|
-
## DEBUG INCONCLUSIVE: {issue_id}
|
|
104
196
|
|
|
105
|
-
|
|
106
|
-
- [what was checked]
|
|
107
|
-
- [what was eliminated]
|
|
197
|
+
---
|
|
108
198
|
|
|
109
|
-
**
|
|
110
|
-
- [possible cause 1]
|
|
111
|
-
- [possible cause 2]
|
|
199
|
+
**Investigation inconclusive:**
|
|
112
200
|
|
|
113
|
-
|
|
201
|
+
```markdown
|
|
202
|
+
## INVESTIGATION INCONCLUSIVE
|
|
114
203
|
|
|
115
204
|
**Debug Session:** .planning/debug/{slug}.md
|
|
205
|
+
|
|
206
|
+
**What Was Checked:**
|
|
207
|
+
- [area 1]: [finding]
|
|
208
|
+
- [area 2]: [finding]
|
|
209
|
+
|
|
210
|
+
**Hypotheses Eliminated:**
|
|
211
|
+
- [hypothesis 1]: [why eliminated]
|
|
212
|
+
- [hypothesis 2]: [why eliminated]
|
|
213
|
+
|
|
214
|
+
**Remaining Possibilities:**
|
|
215
|
+
- [possibility 1]
|
|
216
|
+
- [possibility 2]
|
|
217
|
+
|
|
218
|
+
**Recommendation:** [next steps or manual review needed]
|
|
116
219
|
```
|
|
117
|
-
</
|
|
220
|
+
</return_formats>
|
|
221
|
+
|
|
222
|
+
<investigation_protocol>
|
|
223
|
+
**Phase 1: Gather initial evidence**
|
|
224
|
+
|
|
225
|
+
1. If errors in symptoms → search codebase for error text
|
|
226
|
+
2. Identify relevant code area from symptoms
|
|
227
|
+
3. Read relevant files COMPLETELY (don't skim)
|
|
228
|
+
4. Run app/tests to observe behavior firsthand
|
|
229
|
+
|
|
230
|
+
After EACH finding → append to Evidence with timestamp, what was checked, what was found, implication.
|
|
231
|
+
|
|
232
|
+
**Phase 2: Form hypothesis**
|
|
233
|
+
|
|
234
|
+
Based on evidence, form SPECIFIC, FALSIFIABLE hypothesis.
|
|
235
|
+
|
|
236
|
+
Update Current Focus:
|
|
237
|
+
- hypothesis: [specific theory]
|
|
238
|
+
- test: [how you'll test it]
|
|
239
|
+
- expecting: [what proves/disproves it]
|
|
240
|
+
- next_action: [immediate next step]
|
|
241
|
+
|
|
242
|
+
**Phase 3: Test hypothesis**
|
|
243
|
+
|
|
244
|
+
Execute ONE test at a time. Append result to Evidence.
|
|
245
|
+
|
|
246
|
+
**Phase 4: Evaluate**
|
|
247
|
+
|
|
248
|
+
If CONFIRMED:
|
|
249
|
+
- Update Resolution.root_cause with evidence
|
|
250
|
+
- If goal is find_root_cause_only → return ROOT CAUSE FOUND
|
|
251
|
+
- If goal is find_and_fix → proceed to fix_and_verify
|
|
252
|
+
|
|
253
|
+
If ELIMINATED:
|
|
254
|
+
- Append to Eliminated section with evidence
|
|
255
|
+
- Form new hypothesis based on evidence
|
|
256
|
+
- Return to Phase 2
|
|
257
|
+
|
|
258
|
+
**If stuck:** Consider checkpoint to ask user for more context or verification.
|
|
259
|
+
</investigation_protocol>
|
|
118
260
|
|
|
119
261
|
<success_criteria>
|
|
120
262
|
- [ ] Debug file created with symptoms pre-filled
|
|
121
|
-
- [ ]
|
|
122
|
-
- [ ]
|
|
123
|
-
- [ ]
|
|
124
|
-
- [ ]
|
|
263
|
+
- [ ] Current Focus updated before every action
|
|
264
|
+
- [ ] Evidence appended after every finding
|
|
265
|
+
- [ ] Hypotheses tested one at a time
|
|
266
|
+
- [ ] Root cause confirmed with evidence
|
|
267
|
+
- [ ] Appropriate return format based on goal
|
|
268
|
+
- [ ] Debug file reflects final state
|
|
125
269
|
</success_criteria>
|
|
126
270
|
```
|
|
127
271
|
|
|
@@ -131,28 +275,80 @@ If unable to determine root cause after thorough investigation:
|
|
|
131
275
|
|
|
132
276
|
| Placeholder | Source | Example |
|
|
133
277
|
|-------------|--------|---------|
|
|
134
|
-
| `{issue_id}` |
|
|
135
|
-
| `{issue_summary}` |
|
|
136
|
-
| `{expected}` | From
|
|
137
|
-
| `{
|
|
138
|
-
| `{
|
|
139
|
-
| `{
|
|
140
|
-
| `{
|
|
141
|
-
| `{
|
|
142
|
-
| `{
|
|
143
|
-
| `{slug}` | Generated from summary | `comment-not-refreshing` |
|
|
278
|
+
| `{issue_id}` | Orchestrator-assigned | `auth-screen-dark` or `UAT-001` |
|
|
279
|
+
| `{issue_summary}` | User description or UAT | `Auth screen is too dark` |
|
|
280
|
+
| `{expected}` | From symptoms | `See logo and form clearly` |
|
|
281
|
+
| `{actual}` | From symptoms | `Screen is dark, logo not visible` |
|
|
282
|
+
| `{errors}` | From symptoms | `None in console` |
|
|
283
|
+
| `{reproduction}` | From symptoms | `Open /auth page` |
|
|
284
|
+
| `{timeline}` | From symptoms | `After recent deploy` |
|
|
285
|
+
| `{goal}` | Orchestrator sets | `find_and_fix` or `find_root_cause_only` |
|
|
286
|
+
| `{slug}` | Generated from summary | `auth-screen-dark` |
|
|
144
287
|
|
|
145
288
|
---
|
|
146
289
|
|
|
147
|
-
## Usage
|
|
290
|
+
## Usage by Orchestrator
|
|
291
|
+
|
|
292
|
+
**From /gsd:debug (interactive):**
|
|
293
|
+
|
|
294
|
+
```python
|
|
295
|
+
Task(
|
|
296
|
+
prompt=filled_template, # goal: find_and_fix
|
|
297
|
+
subagent_type="general-purpose",
|
|
298
|
+
description="Debug {slug}"
|
|
299
|
+
)
|
|
300
|
+
```
|
|
148
301
|
|
|
149
|
-
|
|
302
|
+
**From diagnose-issues (UAT parallel):**
|
|
150
303
|
|
|
151
304
|
```python
|
|
152
|
-
# Spawn all
|
|
153
|
-
Task(prompt=
|
|
154
|
-
Task(prompt=
|
|
155
|
-
Task(prompt=
|
|
305
|
+
# Spawn all in parallel
|
|
306
|
+
Task(prompt=template_001, subagent_type="general-purpose", description="Debug UAT-001") # goal: find_root_cause_only
|
|
307
|
+
Task(prompt=template_002, subagent_type="general-purpose", description="Debug UAT-002")
|
|
308
|
+
Task(prompt=template_003, subagent_type="general-purpose", description="Debug UAT-003")
|
|
156
309
|
```
|
|
157
310
|
|
|
158
|
-
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Continuation Agent
|
|
314
|
+
|
|
315
|
+
When orchestrator spawns fresh agent after checkpoint:
|
|
316
|
+
|
|
317
|
+
```markdown
|
|
318
|
+
<objective>
|
|
319
|
+
Continue debugging {slug}.
|
|
320
|
+
|
|
321
|
+
**DO NOT REDO** previous investigation. Evidence is in the debug file.
|
|
322
|
+
</objective>
|
|
323
|
+
|
|
324
|
+
<prior_state>
|
|
325
|
+
Debug file: @.planning/debug/{slug}.md
|
|
326
|
+
|
|
327
|
+
Read this file first - it contains all evidence gathered so far.
|
|
328
|
+
</prior_state>
|
|
329
|
+
|
|
330
|
+
<checkpoint_response>
|
|
331
|
+
**Checkpoint was:** {checkpoint_type}
|
|
332
|
+
**User response:** {user_response}
|
|
333
|
+
|
|
334
|
+
{interpretation based on checkpoint type}
|
|
335
|
+
</checkpoint_response>
|
|
336
|
+
|
|
337
|
+
<mode>
|
|
338
|
+
**goal: {goal}**
|
|
339
|
+
</mode>
|
|
340
|
+
|
|
341
|
+
<execution_context>
|
|
342
|
+
@~/.claude/get-shit-done/workflows/debug.md
|
|
343
|
+
@~/.claude/get-shit-done/templates/DEBUG.md
|
|
344
|
+
@~/.claude/get-shit-done/references/debugging/debugging-mindset.md
|
|
345
|
+
</execution_context>
|
|
346
|
+
|
|
347
|
+
<instructions>
|
|
348
|
+
1. Read debug file to understand current state
|
|
349
|
+
2. Incorporate user's checkpoint response into investigation
|
|
350
|
+
3. Continue from Current Focus
|
|
351
|
+
4. Update debug file continuously
|
|
352
|
+
5. Return with ROOT CAUSE FOUND, DEBUG COMPLETE, CHECKPOINT REACHED, or INVESTIGATION INCONCLUSIVE
|
|
353
|
+
</instructions>
|
|
354
|
+
```
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
<purpose>
|
|
2
2
|
Systematic debugging with persistent state that survives context resets. The debug file IS the debugging brain - create it immediately and update it continuously.
|
|
3
3
|
|
|
4
|
-
You are the debugger. The user knows what's wrong (behavior), not why (root cause).
|
|
4
|
+
You are the debugger. The user knows what's wrong (behavior), not why (root cause). Investigate autonomously.
|
|
5
|
+
|
|
6
|
+
**Execution context:**
|
|
7
|
+
- **Subagent (typical):** Orchestrator gathered symptoms, you investigate with fresh 200k context
|
|
8
|
+
- **Main context (legacy):** Full interactive flow when not spawned as subagent
|
|
5
9
|
|
|
6
10
|
**Modes:**
|
|
7
|
-
- **
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
11
|
+
- **symptoms_prefilled: true** — Symptoms provided, start investigating immediately
|
|
12
|
+
- **goal: find_root_cause_only** — Diagnose but don't fix, return to caller
|
|
13
|
+
- **goal: find_and_fix** — Find root cause, fix it, verify (default)
|
|
10
14
|
</purpose>
|
|
11
15
|
|
|
16
|
+
<paths>
|
|
17
|
+
DEBUG_DIR=.planning/debug
|
|
18
|
+
DEBUG_RESOLVED_DIR=.planning/debug/resolved
|
|
19
|
+
|
|
20
|
+
All debug files use the `.planning/debug/` path (hidden directory with leading dot).
|
|
21
|
+
</paths>
|
|
22
|
+
|
|
12
23
|
<philosophy>
|
|
13
24
|
**User = reporter. Claude = investigator.**
|
|
14
25
|
|
|
@@ -38,6 +49,157 @@ Ask about experience. Investigate the cause yourself.
|
|
|
38
49
|
@~/.claude/get-shit-done/templates/DEBUG.md
|
|
39
50
|
</template>
|
|
40
51
|
|
|
52
|
+
<checkpoint_behavior>
|
|
53
|
+
**When running as subagent and you need user input:**
|
|
54
|
+
|
|
55
|
+
If investigation requires user action or verification that you cannot perform:
|
|
56
|
+
|
|
57
|
+
1. **Update debug file** with current state (Current Focus, Evidence so far)
|
|
58
|
+
2. **Return structured checkpoint** instead of completing
|
|
59
|
+
|
|
60
|
+
**Checkpoint return format:**
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
## CHECKPOINT REACHED
|
|
64
|
+
|
|
65
|
+
**Type:** [human-verify | human-action | decision]
|
|
66
|
+
**Debug Session:** .planning/debug/{slug}.md
|
|
67
|
+
**Progress:** {evidence_count} evidence entries, {eliminated_count} hypotheses eliminated
|
|
68
|
+
|
|
69
|
+
### Investigation State
|
|
70
|
+
|
|
71
|
+
**Current Hypothesis:** {from Current Focus}
|
|
72
|
+
**Evidence So Far:**
|
|
73
|
+
- {key finding 1}
|
|
74
|
+
- {key finding 2}
|
|
75
|
+
|
|
76
|
+
### Checkpoint Details
|
|
77
|
+
|
|
78
|
+
[Type-specific content - see below]
|
|
79
|
+
|
|
80
|
+
### Awaiting
|
|
81
|
+
|
|
82
|
+
[What you need from user]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Checkpoint types:**
|
|
86
|
+
|
|
87
|
+
**human-verify:** Need user to confirm something you can't observe
|
|
88
|
+
```markdown
|
|
89
|
+
### Checkpoint Details
|
|
90
|
+
|
|
91
|
+
**Need verification:** {what you need confirmed}
|
|
92
|
+
|
|
93
|
+
**How to check:**
|
|
94
|
+
1. {step 1}
|
|
95
|
+
2. {step 2}
|
|
96
|
+
|
|
97
|
+
**Tell me:** {what to report back}
|
|
98
|
+
|
|
99
|
+
### Awaiting
|
|
100
|
+
|
|
101
|
+
Describe what you see, or "confirmed" / "not seeing it"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**human-action:** Need user to do something (auth, physical action, etc.)
|
|
105
|
+
```markdown
|
|
106
|
+
### Checkpoint Details
|
|
107
|
+
|
|
108
|
+
**Action needed:** {what user must do}
|
|
109
|
+
|
|
110
|
+
**Why:** {why you can't do it}
|
|
111
|
+
|
|
112
|
+
**Steps:**
|
|
113
|
+
1. {step 1}
|
|
114
|
+
2. {step 2}
|
|
115
|
+
|
|
116
|
+
### Awaiting
|
|
117
|
+
|
|
118
|
+
Type "done" when complete
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**decision:** Need user to choose investigation direction
|
|
122
|
+
```markdown
|
|
123
|
+
### Checkpoint Details
|
|
124
|
+
|
|
125
|
+
**Decision needed:** {what's being decided}
|
|
126
|
+
|
|
127
|
+
**Context:** {why this matters for investigation}
|
|
128
|
+
|
|
129
|
+
**Options:**
|
|
130
|
+
- **A:** {option and implications}
|
|
131
|
+
- **B:** {option and implications}
|
|
132
|
+
|
|
133
|
+
### Awaiting
|
|
134
|
+
|
|
135
|
+
Reply with A or B (or describe alternative)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**After checkpoint:** Orchestrator presents to user, gets response, spawns fresh continuation agent with your debug file + user response. You will NOT be resumed.
|
|
139
|
+
</checkpoint_behavior>
|
|
140
|
+
|
|
141
|
+
<structured_returns>
|
|
142
|
+
**When investigation completes, return one of these:**
|
|
143
|
+
|
|
144
|
+
**Root cause found:**
|
|
145
|
+
```markdown
|
|
146
|
+
## ROOT CAUSE FOUND
|
|
147
|
+
|
|
148
|
+
**Debug Session:** .planning/debug/{slug}.md
|
|
149
|
+
|
|
150
|
+
**Root Cause:** {specific cause with evidence}
|
|
151
|
+
|
|
152
|
+
**Evidence Summary:**
|
|
153
|
+
- {key finding 1}
|
|
154
|
+
- {key finding 2}
|
|
155
|
+
- {key finding 3}
|
|
156
|
+
|
|
157
|
+
**Files Involved:**
|
|
158
|
+
- {file1}: {what's wrong}
|
|
159
|
+
- {file2}: {related issue}
|
|
160
|
+
|
|
161
|
+
**Suggested Fix:** {brief direction, not implementation}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Investigation inconclusive:**
|
|
165
|
+
```markdown
|
|
166
|
+
## INVESTIGATION INCONCLUSIVE
|
|
167
|
+
|
|
168
|
+
**Debug Session:** .planning/debug/{slug}.md
|
|
169
|
+
|
|
170
|
+
**What Was Checked:**
|
|
171
|
+
- {area 1}: {finding}
|
|
172
|
+
- {area 2}: {finding}
|
|
173
|
+
|
|
174
|
+
**Hypotheses Eliminated:**
|
|
175
|
+
- {hypothesis 1}: {why eliminated}
|
|
176
|
+
- {hypothesis 2}: {why eliminated}
|
|
177
|
+
|
|
178
|
+
**Remaining Possibilities:**
|
|
179
|
+
- {possibility 1}
|
|
180
|
+
- {possibility 2}
|
|
181
|
+
|
|
182
|
+
**Recommendation:** {next steps or manual review needed}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**Fix complete (when goal is find_and_fix):**
|
|
186
|
+
```markdown
|
|
187
|
+
## DEBUG COMPLETE
|
|
188
|
+
|
|
189
|
+
**Debug Session:** .planning/debug/resolved/{slug}.md
|
|
190
|
+
|
|
191
|
+
**Root Cause:** {what was wrong}
|
|
192
|
+
**Fix Applied:** {what was changed}
|
|
193
|
+
**Verification:** {how verified}
|
|
194
|
+
|
|
195
|
+
**Files Changed:**
|
|
196
|
+
- {file1}: {change}
|
|
197
|
+
- {file2}: {change}
|
|
198
|
+
|
|
199
|
+
**Commit:** {hash}
|
|
200
|
+
```
|
|
201
|
+
</structured_returns>
|
|
202
|
+
|
|
41
203
|
<modes>
|
|
42
204
|
**Check for mode flags in prompt context:**
|
|
43
205
|
|
|
@@ -65,7 +227,7 @@ Ask about experience. Investigate the cause yourself.
|
|
|
65
227
|
**First: Check for active debug sessions**
|
|
66
228
|
|
|
67
229
|
```bash
|
|
68
|
-
ls
|
|
230
|
+
ls ${DEBUG_DIR}/*.md 2>/dev/null | grep -v resolved
|
|
69
231
|
```
|
|
70
232
|
|
|
71
233
|
**If active sessions exist AND no $ARGUMENTS provided:**
|
|
@@ -116,7 +278,7 @@ Continue to `create_debug_file` with $ARGUMENTS as trigger.
|
|
|
116
278
|
Generate slug from user input (lowercase, hyphens, max 30 chars).
|
|
117
279
|
|
|
118
280
|
```bash
|
|
119
|
-
mkdir -p
|
|
281
|
+
mkdir -p ${DEBUG_DIR}
|
|
120
282
|
```
|
|
121
283
|
|
|
122
284
|
Create file with initial state:
|
|
@@ -160,7 +322,7 @@ verification:
|
|
|
160
322
|
files_changed: []
|
|
161
323
|
```
|
|
162
324
|
|
|
163
|
-
Write to
|
|
325
|
+
Write to `${DEBUG_DIR}/[slug].md`
|
|
164
326
|
|
|
165
327
|
Now proceed to `symptom_gathering`.
|
|
166
328
|
</step>
|
|
@@ -439,8 +601,8 @@ If verification PASSES:
|
|
|
439
601
|
Update status to "resolved".
|
|
440
602
|
|
|
441
603
|
```bash
|
|
442
|
-
mkdir -p
|
|
443
|
-
mv
|
|
604
|
+
mkdir -p ${DEBUG_RESOLVED_DIR}
|
|
605
|
+
mv ${DEBUG_DIR}/[slug].md ${DEBUG_RESOLVED_DIR}/
|
|
444
606
|
```
|
|
445
607
|
|
|
446
608
|
Commit:
|
|
@@ -449,7 +611,7 @@ git add -A
|
|
|
449
611
|
git commit -m "fix: [brief description from Resolution.fix]
|
|
450
612
|
|
|
451
613
|
Root cause: [from Resolution.root_cause]
|
|
452
|
-
Debug session:
|
|
614
|
+
Debug session: ${DEBUG_RESOLVED_DIR}/[slug].md"
|
|
453
615
|
```
|
|
454
616
|
|
|
455
617
|
Report:
|
|
@@ -460,7 +622,7 @@ Root cause: [root_cause]
|
|
|
460
622
|
Fix: [fix]
|
|
461
623
|
Files: [files_changed]
|
|
462
624
|
|
|
463
|
-
Session archived:
|
|
625
|
+
Session archived: ${DEBUG_RESOLVED_DIR}/[slug].md
|
|
464
626
|
```
|
|
465
627
|
|
|
466
628
|
Use AskUserQuestion:
|
|
@@ -6,6 +6,12 @@ After UAT finds issues, spawn one debug agent per issue. Each agent investigates
|
|
|
6
6
|
Orchestrator stays lean: parse issues, spawn agents, collect results, update UAT.
|
|
7
7
|
</purpose>
|
|
8
8
|
|
|
9
|
+
<paths>
|
|
10
|
+
DEBUG_DIR=.planning/debug
|
|
11
|
+
|
|
12
|
+
Debug files use the `.planning/debug/` path (hidden directory with leading dot).
|
|
13
|
+
</paths>
|
|
14
|
+
|
|
9
15
|
<core_principle>
|
|
10
16
|
**Diagnose before planning fixes.**
|
|
11
17
|
|
|
@@ -84,10 +90,12 @@ Template placeholders:
|
|
|
84
90
|
- `{issue_id}`: UAT-001, UAT-002, etc.
|
|
85
91
|
- `{issue_summary}`: Brief description
|
|
86
92
|
- `{expected}`: From UAT test
|
|
87
|
-
- `{
|
|
88
|
-
- `{
|
|
89
|
-
- `{
|
|
90
|
-
- `{
|
|
93
|
+
- `{actual}`: Verbatim user description (what actually happened)
|
|
94
|
+
- `{errors}`: Any error messages from UAT (or "None reported")
|
|
95
|
+
- `{reproduction}`: "Test {test_num} in UAT"
|
|
96
|
+
- `{timeline}`: "Discovered during UAT"
|
|
97
|
+
- `{goal}`: `find_root_cause_only` (UAT flow - plan-fix handles fixes)
|
|
98
|
+
- `{slug}`: Generated from issue_summary
|
|
91
99
|
</step>
|
|
92
100
|
|
|
93
101
|
<step name="collect_results">
|
|
@@ -95,25 +103,34 @@ Template placeholders:
|
|
|
95
103
|
|
|
96
104
|
Each agent returns with:
|
|
97
105
|
```
|
|
98
|
-
##
|
|
106
|
+
## ROOT CAUSE FOUND
|
|
107
|
+
|
|
108
|
+
**Debug Session:** ${DEBUG_DIR}/{slug}.md
|
|
99
109
|
|
|
100
110
|
**Root Cause:** {specific cause with evidence}
|
|
101
|
-
**Files Involved:** {list of files}
|
|
102
|
-
**Debug Session:** .planning/debug/{slug}.md
|
|
103
111
|
|
|
104
112
|
**Evidence Summary:**
|
|
105
113
|
- {key finding 1}
|
|
106
114
|
- {key finding 2}
|
|
115
|
+
- {key finding 3}
|
|
116
|
+
|
|
117
|
+
**Files Involved:**
|
|
118
|
+
- {file1}: {what's wrong}
|
|
119
|
+
- {file2}: {related issue}
|
|
120
|
+
|
|
121
|
+
**Suggested Fix Direction:** {brief hint for plan-fix}
|
|
107
122
|
```
|
|
108
123
|
|
|
109
124
|
Parse each return to extract:
|
|
110
125
|
- root_cause: The diagnosed cause
|
|
111
126
|
- files: Files involved
|
|
112
|
-
- debug_path: Path to debug session file
|
|
127
|
+
- debug_path: Path to debug session file
|
|
128
|
+
- suggested_fix: Hint for plan-fix
|
|
113
129
|
|
|
114
|
-
If agent
|
|
130
|
+
If agent returns `## INVESTIGATION INCONCLUSIVE`:
|
|
115
131
|
- root_cause: "Investigation inconclusive - manual review needed"
|
|
116
132
|
- Note which issue needs manual attention
|
|
133
|
+
- Include remaining possibilities from agent return
|
|
117
134
|
</step>
|
|
118
135
|
|
|
119
136
|
<step name="update_uat">
|
|
@@ -128,7 +145,7 @@ result: issue
|
|
|
128
145
|
reported: "works but doesn't show until I refresh the page"
|
|
129
146
|
severity: major
|
|
130
147
|
root_cause: "useEffect in CommentList.tsx missing commentCount dependency - doesn't re-render when new comment added"
|
|
131
|
-
debug_session:
|
|
148
|
+
debug_session: ${DEBUG_DIR}/comment-not-refreshing.md
|
|
132
149
|
```
|
|
133
150
|
|
|
134
151
|
Update the "Issues for /gsd:plan-fix" section with root causes:
|
|
@@ -165,7 +182,7 @@ git commit -m "docs({phase}): add root causes from diagnosis"
|
|
|
165
182
|
| UAT-002 | CSS flex order incorrect | ReplyButton.tsx |
|
|
166
183
|
| UAT-003 | API missing auth header | api/comments.ts |
|
|
167
184
|
|
|
168
|
-
Debug sessions saved to
|
|
185
|
+
Debug sessions saved to ${DEBUG_DIR}/
|
|
169
186
|
|
|
170
187
|
---
|
|
171
188
|
|
|
@@ -228,6 +245,6 @@ The fix plan will use diagnosed root causes for targeted fixes.
|
|
|
228
245
|
- [ ] Debug agents spawned in parallel
|
|
229
246
|
- [ ] Root causes collected from all agents
|
|
230
247
|
- [ ] UAT.md updated with root causes
|
|
231
|
-
- [ ] Debug sessions saved to
|
|
248
|
+
- [ ] Debug sessions saved to ${DEBUG_DIR}/
|
|
232
249
|
- [ ] User knows next steps (plan-fix)
|
|
233
250
|
</success_criteria>
|
package/package.json
CHANGED