opencodekit 0.12.1 → 0.12.3
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/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +40 -417
- package/dist/template/.opencode/agent/build.md +53 -0
- package/dist/template/.opencode/agent/explore.md +6 -6
- package/dist/template/.opencode/agent/planner.md +0 -1
- package/dist/template/.opencode/agent/rush.md +38 -0
- package/dist/template/.opencode/command/accessibility-check.md +1 -1
- package/dist/template/.opencode/command/brainstorm.md +1 -1
- package/dist/template/.opencode/command/commit.md +1 -1
- package/dist/template/.opencode/command/create.md +68 -441
- package/dist/template/.opencode/command/finish.md +82 -252
- package/dist/template/.opencode/command/fix-ci.md +52 -247
- package/dist/template/.opencode/command/fix-types.md +33 -293
- package/dist/template/.opencode/command/fix-ui.md +49 -234
- package/dist/template/.opencode/command/fix.md +57 -194
- package/dist/template/.opencode/command/handoff.md +66 -243
- package/dist/template/.opencode/command/implement.md +67 -231
- package/dist/template/.opencode/command/issue.md +42 -190
- package/dist/template/.opencode/command/new-feature.md +1 -1
- package/dist/template/.opencode/command/plan.md +86 -442
- package/dist/template/.opencode/command/pr.md +3 -1
- package/dist/template/.opencode/command/research-and-implement.md +69 -370
- package/dist/template/.opencode/command/research-ui.md +1 -1
- package/dist/template/.opencode/command/research.md +72 -197
- package/dist/template/.opencode/command/resume.md +70 -438
- package/dist/template/.opencode/command/review-codebase.md +1 -1
- package/dist/template/.opencode/command/status.md +11 -11
- package/dist/template/.opencode/command/triage.md +23 -18
- package/dist/template/.opencode/dcp.jsonc +16 -33
- package/dist/template/.opencode/memory/project/commands.md +176 -5
- package/dist/template/.opencode/memory/project/conventions.md +104 -5
- package/dist/template/.opencode/memory/project/gotchas.md +128 -9
- package/dist/template/.opencode/opencode.json +511 -523
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plugin/beads.ts +181 -16
- package/dist/template/.opencode/skill/beads/SKILL.md +15 -0
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +94 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +107 -0
- package/dist/template/.opencode/skill/session-management/SKILL.md +111 -0
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +115 -0
- package/package.json +1 -1
- package/dist/template/.opencode/tool/lsp.ts +0 -786
|
@@ -1,51 +1,25 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: Fix UI issues with visual verification
|
|
3
3
|
argument-hint: "<issue or bead-id> [--a11y]"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Fix UI: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Fix visual issues. Capture before/after, verify responsiveness.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
skill({ name: "beads" });
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Options
|
|
16
|
-
|
|
17
|
-
- `--a11y`: Include full accessibility audit
|
|
18
|
-
|
|
19
|
-
## Phase 1: Load Context
|
|
20
|
-
|
|
21
|
-
**Check for bead context:**
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
bd_show({ id: "$ARGUMENTS" });
|
|
25
|
-
```
|
|
11
|
+
## Load Context
|
|
26
12
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
skill({ name: "frontend-aesthetics" });
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
**Reserve UI files:**
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
bd_reserve({
|
|
37
|
-
paths: ["src/components/**", "src/styles/**"],
|
|
38
|
-
reason: "Fixing UI: $ARGUMENTS",
|
|
39
|
-
ttl: 600,
|
|
40
|
-
});
|
|
13
|
+
```bash
|
|
14
|
+
bd show $ARGUMENTS
|
|
15
|
+
cat .beads/artifacts/$ARGUMENTS/spec.md 2>/dev/null
|
|
41
16
|
```
|
|
42
17
|
|
|
43
|
-
##
|
|
18
|
+
## Capture Before State
|
|
44
19
|
|
|
45
|
-
Take screenshot before
|
|
20
|
+
Take screenshot before changes. Save to `.beads/artifacts/$ARGUMENTS/before.png`.
|
|
46
21
|
|
|
47
22
|
```typescript
|
|
48
|
-
// Using Playwright skill
|
|
49
23
|
skill({ name: "playwright" });
|
|
50
24
|
skill_mcp({
|
|
51
25
|
skill_name: "playwright",
|
|
@@ -54,255 +28,96 @@ skill_mcp({
|
|
|
54
28
|
});
|
|
55
29
|
```
|
|
56
30
|
|
|
57
|
-
|
|
31
|
+
## Analyze
|
|
58
32
|
|
|
59
|
-
|
|
60
|
-
skill({ name: "chrome-devtools" });
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Save screenshot to `.beads/artifacts/<bead-id>/before.png`
|
|
64
|
-
|
|
65
|
-
## Phase 3: Analyze with Vision
|
|
66
|
-
|
|
67
|
-
Delegate to @vision for initial assessment:
|
|
33
|
+
Delegate to @vision:
|
|
68
34
|
|
|
69
35
|
```typescript
|
|
70
36
|
task({
|
|
71
37
|
subagent_type: "vision",
|
|
72
38
|
description: "Analyze UI issue",
|
|
73
|
-
prompt:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
EXPECTED OUTCOME:
|
|
77
|
-
- Describe the visual problem in detail
|
|
78
|
-
- Identify affected components
|
|
79
|
-
- Suggest fix approach
|
|
80
|
-
- Check against frontend-aesthetics anti-patterns
|
|
81
|
-
|
|
82
|
-
MUST DO:
|
|
83
|
-
- Load the before screenshot
|
|
84
|
-
- Identify specific CSS/component issues
|
|
85
|
-
- Check for AI slop patterns (Inter font, purple gradients, flat backgrounds)
|
|
86
|
-
- Assess color contrast and typography
|
|
87
|
-
|
|
88
|
-
MUST NOT DO:
|
|
89
|
-
- Don't make changes, just analyze
|
|
90
|
-
- Don't suggest generic solutions
|
|
91
|
-
|
|
92
|
-
CONTEXT:
|
|
93
|
-
- Screenshot: .beads/artifacts/<bead-id>/before.png
|
|
94
|
-
- Issue: $ARGUMENTS
|
|
95
|
-
`,
|
|
39
|
+
prompt:
|
|
40
|
+
"Analyze UI issue: $ARGUMENTS\n\nIdentify:\n- The visual problem\n- Affected components\n- Suggested fix approach",
|
|
96
41
|
});
|
|
97
42
|
```
|
|
98
43
|
|
|
99
|
-
##
|
|
100
|
-
|
|
101
|
-
| Signals | Estimate | Approach |
|
|
102
|
-
| ---------------------------------------- | -------- | --------------- |
|
|
103
|
-
| Single component, CSS tweak | S (~10) | Quick fix |
|
|
104
|
-
| Multiple components, layout issue | M (~30) | Systematic fix |
|
|
105
|
-
| Cross-cutting, design system change | L (~100) | Design review |
|
|
106
|
-
| Responsive + a11y + multiple breakpoints | XL | Decompose first |
|
|
107
|
-
|
|
108
|
-
## Phase 5: Design System Check
|
|
109
|
-
|
|
110
|
-
Before fixing, verify design tokens:
|
|
44
|
+
## Check Design System
|
|
111
45
|
|
|
112
46
|
```bash
|
|
113
|
-
|
|
114
|
-
grep -r "
|
|
115
|
-
grep -r "theme\." src/components/ | head -20
|
|
47
|
+
grep -r "var(--" src/styles/ | head -10
|
|
48
|
+
grep -r "theme\." src/components/ | head -10
|
|
116
49
|
```
|
|
117
50
|
|
|
118
|
-
|
|
51
|
+
Use existing tokens, not hardcoded values:
|
|
119
52
|
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
-
|
|
53
|
+
- ✅ Existing color tokens
|
|
54
|
+
- ✅ Existing spacing scale
|
|
55
|
+
- ✅ Existing typography scale
|
|
56
|
+
- ❌ Hardcoded colors/px values
|
|
124
57
|
|
|
125
|
-
##
|
|
58
|
+
## Avoid AI Slop
|
|
126
59
|
|
|
127
|
-
|
|
60
|
+
| Avoid | Use Instead |
|
|
61
|
+
| -------------------------- | ----------------------- |
|
|
62
|
+
| Inter/system-ui everywhere | Distinctive fonts |
|
|
63
|
+
| Purple/blue gradients | Project color palette |
|
|
64
|
+
| Flat backgrounds | Subtle depth/texture |
|
|
65
|
+
| Generic rounded corners | Consistent radius scale |
|
|
128
66
|
|
|
129
|
-
|
|
130
|
-
| ---------------------------- | ------------------------------ |
|
|
131
|
-
| Inter/system-ui everywhere | Distinctive, intentional fonts |
|
|
132
|
-
| Purple/blue gradients | Cohesive project color palette |
|
|
133
|
-
| Flat, shadowless backgrounds | Subtle depth and texture |
|
|
134
|
-
| Generic rounded corners | Consistent border-radius scale |
|
|
135
|
-
| No motion | Meaningful, subtle animations |
|
|
136
|
-
|
|
137
|
-
**Make changes:**
|
|
67
|
+
## Implement Fix
|
|
138
68
|
|
|
139
69
|
1. Identify affected files
|
|
140
|
-
2. Make minimal
|
|
141
|
-
3. Use
|
|
142
|
-
4. Test in browser
|
|
143
|
-
|
|
144
|
-
## Phase 7: Capture After State
|
|
145
|
-
|
|
146
|
-
Take screenshot after changes:
|
|
147
|
-
|
|
148
|
-
```typescript
|
|
149
|
-
skill_mcp({
|
|
150
|
-
skill_name: "playwright",
|
|
151
|
-
tool_name: "browser_screenshot",
|
|
152
|
-
arguments: '{"name": "after-fix"}',
|
|
153
|
-
});
|
|
154
|
-
```
|
|
70
|
+
2. Make minimal CSS/component changes
|
|
71
|
+
3. Use design tokens
|
|
72
|
+
4. Test in browser
|
|
155
73
|
|
|
156
|
-
|
|
74
|
+
## Capture After State
|
|
157
75
|
|
|
158
|
-
|
|
76
|
+
Save to `.beads/artifacts/$ARGUMENTS/after.png`.
|
|
159
77
|
|
|
160
|
-
|
|
78
|
+
## Verify
|
|
161
79
|
|
|
162
|
-
|
|
163
|
-
task({
|
|
164
|
-
subagent_type: "vision",
|
|
165
|
-
description: "Compare before/after",
|
|
166
|
-
prompt: `
|
|
167
|
-
Compare these screenshots:
|
|
168
|
-
- Before: .beads/artifacts/<bead-id>/before.png
|
|
169
|
-
- After: .beads/artifacts/<bead-id>/after.png
|
|
170
|
-
|
|
171
|
-
Verify:
|
|
172
|
-
1. Issue is fixed
|
|
173
|
-
2. No visual regressions
|
|
174
|
-
3. Follows frontend-aesthetics principles
|
|
175
|
-
4. No AI slop patterns introduced
|
|
176
|
-
`,
|
|
177
|
-
});
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Responsive Verification
|
|
181
|
-
|
|
182
|
-
Test at multiple breakpoints:
|
|
183
|
-
|
|
184
|
-
| Breakpoint | Width | Check |
|
|
185
|
-
| ---------- | ------ | -------------------- |
|
|
186
|
-
| Mobile | 375px | Layout doesn't break |
|
|
187
|
-
| Tablet | 768px | Spacing appropriate |
|
|
188
|
-
| Desktop | 1280px | Full layout correct |
|
|
189
|
-
|
|
190
|
-
```typescript
|
|
191
|
-
skill_mcp({
|
|
192
|
-
skill_name: "playwright",
|
|
193
|
-
tool_name: "browser_resize",
|
|
194
|
-
arguments: '{"width": 375, "height": 812}',
|
|
195
|
-
});
|
|
196
|
-
// Screenshot and verify
|
|
197
|
-
```
|
|
80
|
+
**Visual:** Compare before/after screenshots
|
|
198
81
|
|
|
199
|
-
|
|
82
|
+
**Responsive:** Test at 375px, 768px, 1280px
|
|
200
83
|
|
|
201
|
-
|
|
202
|
-
skill({ name: "accessibility-audit" });
|
|
203
|
-
```
|
|
84
|
+
**A11y (if --a11y):**
|
|
204
85
|
|
|
205
|
-
|
|
86
|
+
- Color contrast (4.5:1 for text)
|
|
87
|
+
- Keyboard navigation
|
|
88
|
+
- Focus states visible
|
|
206
89
|
|
|
207
|
-
|
|
208
|
-
- [ ] Keyboard navigation works
|
|
209
|
-
- [ ] Focus states visible
|
|
210
|
-
- [ ] Screen reader text present for icons
|
|
211
|
-
- [ ] No motion for prefers-reduced-motion users
|
|
212
|
-
|
|
213
|
-
### Automated Tests
|
|
90
|
+
**Tests:**
|
|
214
91
|
|
|
215
92
|
```bash
|
|
216
93
|
npm test -- --grep "component-name"
|
|
217
|
-
npm run test:visual # If visual regression tests exist
|
|
218
94
|
```
|
|
219
95
|
|
|
220
|
-
|
|
221
|
-
Verification:
|
|
222
|
-
━━━━━━━━━━━━━
|
|
223
|
-
|
|
224
|
-
Visual: Issue fixed ✓
|
|
225
|
-
Responsive:
|
|
226
|
-
- Mobile (375px): ✓
|
|
227
|
-
- Tablet (768px): ✓
|
|
228
|
-
- Desktop (1280px): ✓
|
|
229
|
-
Accessibility: [✓/⚠️ needs review]
|
|
230
|
-
Tests: [✓/✗]
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
## Phase 9: Document & Observe
|
|
234
|
-
|
|
235
|
-
If this revealed a UI pattern worth remembering:
|
|
236
|
-
|
|
237
|
-
```typescript
|
|
238
|
-
observation({
|
|
239
|
-
type: "pattern",
|
|
240
|
-
title: "[UI pattern name]",
|
|
241
|
-
content: `
|
|
242
|
-
## Pattern
|
|
243
|
-
[What we learned about UI implementation]
|
|
244
|
-
|
|
245
|
-
## Example
|
|
246
|
-
\`\`\`css
|
|
247
|
-
[Code snippet]
|
|
248
|
-
\`\`\`
|
|
249
|
-
|
|
250
|
-
## When to Use
|
|
251
|
-
[When this pattern applies]
|
|
252
|
-
`,
|
|
253
|
-
concepts: "ui, css, [component-type]",
|
|
254
|
-
files: "[affected files]",
|
|
255
|
-
bead_id: "<bead-id>",
|
|
256
|
-
});
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
## Phase 10: Commit & Sync
|
|
96
|
+
## Commit
|
|
260
97
|
|
|
261
98
|
```bash
|
|
262
99
|
git add <files>
|
|
263
|
-
git commit -m "fix(ui):
|
|
264
|
-
|
|
265
|
-
- [what changed]
|
|
266
|
-
- [visual improvement]
|
|
267
|
-
[bead-id if applicable]"
|
|
100
|
+
git commit -m "fix(ui): [description]"
|
|
268
101
|
```
|
|
269
102
|
|
|
270
103
|
```typescript
|
|
271
|
-
|
|
272
|
-
bd_sync({ reason: "Fixed UI: $ARGUMENTS" });
|
|
104
|
+
bd_sync({ reason: "Sync UI fix" });
|
|
273
105
|
```
|
|
274
106
|
|
|
275
107
|
## Output
|
|
276
108
|
|
|
277
109
|
```
|
|
278
110
|
UI Fixed: $ARGUMENTS
|
|
279
|
-
━━━━━━━━━━━━━━━━━━━━
|
|
280
|
-
|
|
281
|
-
Estimate: [S/M/L]
|
|
282
|
-
Components: [list]
|
|
283
111
|
|
|
284
|
-
Before: .beads/artifacts
|
|
285
|
-
After: .beads/artifacts
|
|
112
|
+
Before: .beads/artifacts/$ARGUMENTS/before.png
|
|
113
|
+
After: .beads/artifacts/$ARGUMENTS/after.png
|
|
286
114
|
|
|
287
115
|
Verification:
|
|
288
116
|
- Visual: ✓
|
|
289
117
|
- Responsive: ✓
|
|
290
|
-
-
|
|
118
|
+
- A11y: [✓/⚠️]
|
|
291
119
|
- Tests: ✓
|
|
292
120
|
|
|
293
|
-
Design
|
|
294
|
-
AI slop
|
|
295
|
-
|
|
296
|
-
Commit: [hash]
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
**Next steps:**
|
|
300
|
-
|
|
301
|
-
```
|
|
302
|
-
If part of larger task:
|
|
303
|
-
/implement <bead-id>
|
|
304
|
-
|
|
305
|
-
If standalone fix:
|
|
306
|
-
/finish <bead-id>
|
|
307
|
-
/pr <bead-id>
|
|
121
|
+
Design tokens: Used ✓
|
|
122
|
+
AI slop: None ✓
|
|
308
123
|
```
|
|
@@ -1,275 +1,138 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Debug and fix
|
|
2
|
+
description: Debug and fix an issue
|
|
3
3
|
argument-hint: "<issue or bead-id> [--quick]"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Fix: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
You're debugging and fixing an issue. Understand before you fix.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
skill({ name: "beads" });
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Options
|
|
16
|
-
|
|
17
|
-
- `--quick`: Skip deep analysis, fix directly (for obvious bugs)
|
|
18
|
-
|
|
19
|
-
## Phase 1: Load Context
|
|
20
|
-
|
|
21
|
-
**Check for bead context:**
|
|
22
|
-
|
|
23
|
-
If `$ARGUMENTS` looks like a bead ID (e.g., `bd-abc123`):
|
|
24
|
-
|
|
25
|
-
```typescript
|
|
26
|
-
bd_show({ id: "$ARGUMENTS" });
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Load constraints from `.beads/artifacts/<bead-id>/spec.md` if it exists.
|
|
30
|
-
|
|
31
|
-
**Check for messages about this issue:**
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
bd_inbox({ n: 5, unread: true, global: false });
|
|
35
|
-
```
|
|
11
|
+
## Load Context
|
|
36
12
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Extract from the issue:
|
|
40
|
-
|
|
41
|
-
| Field | Extract |
|
|
42
|
-
| ----------------- | ------------------------------------ |
|
|
43
|
-
| **Error message** | Exact error text |
|
|
44
|
-
| **Stack trace** | Call stack with file:line references |
|
|
45
|
-
| **Reproduction** | Steps to trigger the bug |
|
|
46
|
-
| **Expected** | What should happen |
|
|
47
|
-
| **Actual** | What happens instead |
|
|
48
|
-
|
|
49
|
-
**For stack traces:**
|
|
13
|
+
If `$ARGUMENTS` is a bead ID:
|
|
50
14
|
|
|
51
15
|
```bash
|
|
52
|
-
|
|
53
|
-
|
|
16
|
+
bd show $ARGUMENTS
|
|
17
|
+
cat .beads/artifacts/$ARGUMENTS/spec.md 2>/dev/null
|
|
54
18
|
```
|
|
55
19
|
|
|
56
|
-
##
|
|
20
|
+
## Parse The Error
|
|
57
21
|
|
|
58
|
-
|
|
59
|
-
| ------------------------------------------- | -------- | ------------------ |
|
|
60
|
-
| Error points to exact line, obvious fix | S (~10) | Quick fix |
|
|
61
|
-
| Error in known area, clear reproduction | M (~30) | Systematic debug |
|
|
62
|
-
| Intermittent, unclear cause, multiple files | L (~100) | Deep investigation |
|
|
63
|
-
| No reproduction, architectural issue | XL | Research first |
|
|
22
|
+
Extract from the issue:
|
|
64
23
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
24
|
+
- **Error message** - exact text
|
|
25
|
+
- **Stack trace** - file:line references
|
|
26
|
+
- **Reproduction** - steps to trigger
|
|
27
|
+
- **Expected vs Actual** - what should happen vs what happens
|
|
68
28
|
|
|
69
|
-
Complexity
|
|
70
|
-
Approach: [quick fix / systematic / deep investigation]
|
|
71
|
-
```
|
|
29
|
+
## Estimate Complexity
|
|
72
30
|
|
|
73
|
-
|
|
31
|
+
- **S** (~10 calls): Error points to exact line, obvious fix
|
|
32
|
+
- **M** (~30 calls): Clear reproduction, known area
|
|
33
|
+
- **L** (~100 calls): Intermittent, multiple files, needs investigation
|
|
34
|
+
- **XL**: Should be decomposed or researched first
|
|
74
35
|
|
|
75
|
-
|
|
76
|
-
bd_reservations({ reason: "Checking for conflicts before fix" });
|
|
77
|
-
bd_reserve({
|
|
78
|
-
paths: ["<files-to-investigate>"],
|
|
79
|
-
reason: "Fixing $ARGUMENTS",
|
|
80
|
-
ttl: 600,
|
|
81
|
-
});
|
|
82
|
-
```
|
|
36
|
+
If `--quick` flag: Skip deep analysis, fix directly.
|
|
83
37
|
|
|
84
|
-
##
|
|
38
|
+
## Quick Fix (S or --quick)
|
|
85
39
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
1. Go directly to error location
|
|
40
|
+
1. Go to error location
|
|
89
41
|
2. Identify obvious cause
|
|
90
42
|
3. Make minimal fix
|
|
91
43
|
4. Run targeted test
|
|
92
44
|
5. Commit
|
|
93
45
|
|
|
94
|
-
|
|
46
|
+
## Systematic Debug (M/L)
|
|
95
47
|
|
|
96
|
-
|
|
48
|
+
Load the debugging skill:
|
|
97
49
|
|
|
98
50
|
```typescript
|
|
99
51
|
skill({ name: "systematic-debugging" });
|
|
100
52
|
```
|
|
101
53
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
**1. Root Cause Investigation (NO fixes yet)**
|
|
54
|
+
**Phase 1: Root Cause (NO fixes yet)**
|
|
105
55
|
|
|
106
|
-
|
|
107
|
-
- Trace data flow backward
|
|
108
|
-
- Check recent changes: `git log -p --since="1 week ago" -- <file>`
|
|
109
|
-
- Add logging/instrumentation if needed
|
|
56
|
+
Read error location. Trace data flow backward. Check recent changes:
|
|
110
57
|
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
━━━━━━━━━━━━━━━━━━━━━
|
|
114
|
-
|
|
115
|
-
Cause: [what's actually wrong]
|
|
116
|
-
Evidence: [how we know]
|
|
117
|
-
Confidence: [High/Medium/Low]
|
|
58
|
+
```bash
|
|
59
|
+
git log -p --since="1 week ago" -- <file>
|
|
118
60
|
```
|
|
119
61
|
|
|
120
|
-
|
|
62
|
+
Form a hypothesis. Write it down before fixing anything.
|
|
121
63
|
|
|
122
|
-
|
|
123
|
-
- Similar bugs in history? `git log --grep="fix" --oneline`
|
|
124
|
-
- Related code with same issue?
|
|
64
|
+
**Phase 2: Reproduce**
|
|
125
65
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
- Write a failing test that reproduces the bug
|
|
129
|
-
- Verify hypothesis by checking test fails for right reason
|
|
66
|
+
Write a failing test that reproduces the bug:
|
|
130
67
|
|
|
131
68
|
```bash
|
|
132
|
-
npm test -- --grep "<bug-related
|
|
69
|
+
npm test -- --grep "<bug-related>"
|
|
133
70
|
```
|
|
134
71
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
- Fix the code
|
|
138
|
-
- Verify test now passes
|
|
139
|
-
- Run full test suite for regression
|
|
140
|
-
|
|
141
|
-
### Rollback Strategy
|
|
142
|
-
|
|
143
|
-
Before making changes, note rollback point:
|
|
72
|
+
Verify it fails for the right reason.
|
|
144
73
|
|
|
145
|
-
|
|
146
|
-
git stash # or
|
|
147
|
-
git rev-parse HEAD # Save current commit
|
|
148
|
-
```
|
|
74
|
+
**Phase 3: Fix**
|
|
149
75
|
|
|
150
|
-
|
|
76
|
+
Make the fix. Verify test passes. Run full suite:
|
|
151
77
|
|
|
152
78
|
```bash
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
git reset --hard <hash> # Nuclear option
|
|
79
|
+
npm test
|
|
80
|
+
npm run type-check
|
|
156
81
|
```
|
|
157
82
|
|
|
158
|
-
##
|
|
83
|
+
## Rollback Strategy
|
|
159
84
|
|
|
160
|
-
|
|
85
|
+
Before making changes:
|
|
161
86
|
|
|
162
87
|
```bash
|
|
163
|
-
|
|
88
|
+
git stash # or note current commit
|
|
164
89
|
```
|
|
165
90
|
|
|
166
|
-
|
|
91
|
+
If fix makes things worse:
|
|
167
92
|
|
|
168
93
|
```bash
|
|
169
|
-
|
|
170
|
-
npm run lint
|
|
171
|
-
npm run type-check
|
|
94
|
+
git checkout -- <file>
|
|
172
95
|
```
|
|
173
96
|
|
|
174
|
-
|
|
175
|
-
Verification:
|
|
176
|
-
━━━━━━━━━━━━━
|
|
177
|
-
|
|
178
|
-
Bug test: [✓ now passes]
|
|
179
|
-
Full tests: [✓/✗]
|
|
180
|
-
Lint: [✓/✗]
|
|
181
|
-
Types: [✓/✗]
|
|
182
|
-
```
|
|
97
|
+
## Document Root Cause
|
|
183
98
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
## Phase 7: Document Root Cause
|
|
187
|
-
|
|
188
|
-
Create observation for future reference:
|
|
99
|
+
Create observation:
|
|
189
100
|
|
|
190
101
|
```typescript
|
|
191
102
|
observation({
|
|
192
103
|
type: "bugfix",
|
|
193
|
-
title: "[
|
|
194
|
-
content:
|
|
195
|
-
|
|
196
|
-
[What was actually wrong]
|
|
197
|
-
|
|
198
|
-
## Fix
|
|
199
|
-
[What we changed and why]
|
|
200
|
-
|
|
201
|
-
## Prevention
|
|
202
|
-
[How to avoid this in future]
|
|
203
|
-
`,
|
|
204
|
-
concepts: "[relevant keywords]",
|
|
205
|
-
files: "[affected files]",
|
|
206
|
-
bead_id: "<bead-id>",
|
|
104
|
+
title: "[brief description]",
|
|
105
|
+
content: "Root cause: [what]\nFix: [how]\nPrevention: [future]",
|
|
106
|
+
bead_id: "$ARGUMENTS",
|
|
207
107
|
});
|
|
208
108
|
```
|
|
209
109
|
|
|
210
|
-
|
|
110
|
+
If it's a gotcha worth remembering, update `project/gotchas.md`.
|
|
211
111
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
```typescript
|
|
215
|
-
memory -
|
|
216
|
-
update({
|
|
217
|
-
file: "project/gotchas",
|
|
218
|
-
content: `
|
|
219
|
-
## [Bug Title]
|
|
220
|
-
|
|
221
|
-
**Symptom:** [What you see]
|
|
222
|
-
**Cause:** [What's actually wrong]
|
|
223
|
-
**Fix:** [How to resolve]
|
|
224
|
-
**Prevention:** [How to avoid]
|
|
225
|
-
`,
|
|
226
|
-
mode: "append",
|
|
227
|
-
});
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
## Phase 9: Commit & Sync
|
|
112
|
+
## Commit & Sync
|
|
231
113
|
|
|
232
114
|
```bash
|
|
233
115
|
git add <files>
|
|
234
|
-
git commit -m "fix
|
|
116
|
+
git commit -m "fix: [description]
|
|
235
117
|
|
|
236
|
-
Root cause: [brief
|
|
237
|
-
|
|
118
|
+
Root cause: [brief]
|
|
119
|
+
$ARGUMENTS"
|
|
238
120
|
```
|
|
239
121
|
|
|
240
|
-
Release locks and sync:
|
|
241
|
-
|
|
242
122
|
```typescript
|
|
243
|
-
|
|
244
|
-
bd_sync({ reason: "Fixed $ARGUMENTS" });
|
|
123
|
+
bd_sync({ reason: "Sync fix completion" });
|
|
245
124
|
```
|
|
246
125
|
|
|
247
126
|
## Output
|
|
248
127
|
|
|
249
128
|
```
|
|
250
129
|
Fixed: $ARGUMENTS
|
|
251
|
-
━━━━━━━━━━━━━━━━━
|
|
252
130
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
Changes:
|
|
257
|
-
- [file:line] - [what changed]
|
|
258
|
-
|
|
259
|
-
Verification: All tests pass ✓
|
|
260
|
-
Observation: Created ✓
|
|
261
|
-
Gotcha: [Added to memory / Not needed]
|
|
262
|
-
|
|
263
|
-
Commit: [hash]
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
**Next steps:**
|
|
267
|
-
|
|
268
|
-
```
|
|
269
|
-
If part of larger task:
|
|
270
|
-
/implement <bead-id> # Continue implementation
|
|
131
|
+
Root cause: [brief]
|
|
132
|
+
Changes: [files]
|
|
133
|
+
Tests: Pass
|
|
271
134
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
135
|
+
Next:
|
|
136
|
+
- /finish $ARGUMENTS # Close the bead
|
|
137
|
+
- /pr $ARGUMENTS # Create PR
|
|
275
138
|
```
|