Skip to content

Commit 95be84b

Browse files
committed
pi: consolidate debugging prompts into a single /debug template
Rewrite debug.md to absorb the methodology from superpowers:debug.md and the reproduction step from bug.md. The new prompt allows writing tests and adding instrumentation to prove root cause, but does not fix. Remove bug.md and superpowers:debug.md as their content is now covered. Remove debug references from superpowers.md.
1 parent 1698688 commit 95be84b

File tree

4 files changed

+61
-206
lines changed

4 files changed

+61
-206
lines changed

dotfiles/pi/.pi/agent/prompts/bug.md

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 61 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,86 @@
11
---
2-
description: Diagnose an issue without fixing it (read-only)
2+
description: Find and reproduce a bug — root cause investigation without fixing
33
---
44

55
# Debug
66

7-
Investigate and diagnose an issue. Find the root cause — do not fix it.
7+
Find the root cause of a bug and prove it exists. Do not fix it.
88

99
## Constraints
1010

11-
- Do NOT edit, create, or delete any files
12-
- Do NOT run commands that modify state (no git commit, no writes, no installs)
13-
- Bash commands may ONLY read or inspect (ls, find, rg, git log, git diff, etc.)
14-
- This overrides all other instructions. Zero exceptions.
11+
- Do NOT fix production code — investigation and reproduction only
12+
- You may write tests, run commands, or add temporary instrumentation to reproduce
13+
- Revert any temporary instrumentation before finishing
1514

1615
## Issue
1716

1817
$ARGUMENTS
1918

2019
## Workflow
2120

22-
### 1. Reproduce
21+
### 1. Investigate
2322

24-
Understand what's happening before digging in:
23+
Gather evidence before forming theories:
2524

26-
- Clarify the symptom — what's the expected behavior vs. what actually happens?
27-
- If the issue description is vague, ask questions before proceeding
28-
- Find the entry point — where does the failing path start?
29-
- Run read-only commands to observe the current state (logs, config, status)
25+
- Read error messages completely — don't skip past them, they often
26+
contain the answer
27+
- Reproduce consistently — can you trigger it reliably? What are the
28+
exact steps? If not reproducible, gather more data — don't guess
29+
- Check recent changes — git diff, recent commits, new dependencies,
30+
config changes, environmental differences
31+
- In multi-component systems, add diagnostic instrumentation at each
32+
boundary to narrow down WHERE it breaks before investigating WHY
3033

31-
### 2. Trace
34+
### 2. Analyze
3235

33-
Follow the execution path from symptom to cause:
36+
Compare what's broken against what works:
3437

35-
- Read the code along the relevant path — don't jump to conclusions
36-
- Check recent git history for changes in the affected area
37-
- Look at related tests — do they cover this case? Are they passing despite the bug?
38-
- Inspect configuration, environment, and dependencies
39-
- Narrow down systematically — eliminate possibilities, don't guess
38+
- Find working examples — locate similar working behavior in the system
39+
- Compare against references — if the behavior implements a known
40+
pattern, read the reference completely
41+
- Identify differences — list every difference between working and
42+
broken, however small
43+
- Understand dependencies — what components, settings, or config does
44+
this need?
4045

41-
### 3. Diagnose
46+
### 3. Hypothesize
47+
48+
Form a single, testable theory:
49+
50+
- State it explicitly: "I think X is the root cause because Y"
51+
- Test with the smallest possible change or observation — one variable
52+
at a time
53+
- If disproved, form a new hypothesis from what you learned — don't
54+
pile attempts on top
55+
- If you don't know, say so — research more or ask for help
56+
57+
### 4. Reproduce
58+
59+
Prove the bug exists with a concrete reproduction:
60+
61+
- Write a minimal reproduction that demonstrates the bug
62+
- Prefer a failing test when the codebase supports it
63+
- The reproduction must encode the correct expected behavior
64+
- If you can't reproduce it, state what additional information would help
65+
66+
### 5. Report
4267

4368
Present a clear root cause analysis:
4469

45-
- **Symptom**: What the user observes
46-
- **Root cause**: The specific code, config, or condition responsible
47-
- **Mechanism**: How the root cause produces the symptom — trace the chain
48-
- **Evidence**: The files, lines, logs, or state that support the diagnosis
49-
- **Scope**: What else might be affected by the same underlying issue
70+
- **Symptom**: what the user observes
71+
- **Root cause**: the specific code, config, or condition responsible
72+
- **Mechanism**: how the root cause produces the symptom
73+
- **Evidence**: files, lines, logs, or the failing test
74+
- **Scope**: what else might be affected
75+
76+
If the diagnosis is uncertain, say so and identify what would confirm it.
77+
78+
## Red Flags
79+
80+
If you catch yourself thinking any of these, STOP and go back to step 1:
5081

51-
Don't propose fixes. If the diagnosis is uncertain, say so and identify what additional information would confirm it.
82+
- "Quick fix for now, investigate later"
83+
- "Just try changing X and see if it works"
84+
- "It's probably X, let me fix that"
85+
- "I don't fully understand but this might work"
86+
- "I see the problem" (seeing symptoms ≠ understanding root cause)

dotfiles/pi/.pi/agent/prompts/superpowers.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,12 @@ Idea → /superpowers:brainstorm → /superpowers:write-plan → execute
2525
| `/superpowers:brainstorm` | Collaborative design exploration before coding |
2626
| `/superpowers:write-plan` | Break a spec into bite-sized implementation tasks |
2727

28-
### Disciplines
29-
30-
| Template | Purpose |
31-
|----------|---------|
32-
| `/superpowers:debug` | Systematic 4-phase root cause investigation |
33-
3428
## When to Use What
3529

3630
| Situation | Start with |
3731
|-----------|------------|
3832
| New feature or creative work | `/superpowers:brainstorm` |
3933
| Have a spec, need implementation tasks | `/superpowers:write-plan` |
40-
| Bug or unexpected behavior | `/superpowers:debug` |
4134

4235
## Principles
4336

dotfiles/pi/.pi/agent/prompts/superpowers:debug.md

Lines changed: 0 additions & 120 deletions
This file was deleted.

0 commit comments

Comments
 (0)