opencodekit 0.10.0 → 0.11.1
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/agent/planner.md +3 -2
- package/dist/template/.opencode/command/accessibility-check.md +297 -30
- package/dist/template/.opencode/command/analyze-mockup.md +412 -20
- package/dist/template/.opencode/command/analyze-project.md +445 -30
- package/dist/template/.opencode/command/brainstorm.md +294 -5
- package/dist/template/.opencode/command/commit.md +231 -17
- package/dist/template/.opencode/command/create.md +415 -77
- package/dist/template/.opencode/command/design-audit.md +483 -29
- package/dist/template/.opencode/command/design.md +615 -6
- package/dist/template/.opencode/command/edit-image.md +223 -20
- package/dist/template/.opencode/command/finish.md +163 -71
- package/dist/template/.opencode/command/fix-ci.md +297 -24
- package/dist/template/.opencode/command/fix-types.md +351 -13
- package/dist/template/.opencode/command/fix-ui.md +299 -13
- package/dist/template/.opencode/command/fix.md +262 -9
- package/dist/template/.opencode/command/generate-diagram.md +327 -26
- package/dist/template/.opencode/command/generate-icon.md +266 -22
- package/dist/template/.opencode/command/generate-image.md +232 -12
- package/dist/template/.opencode/command/generate-pattern.md +234 -20
- package/dist/template/.opencode/command/generate-storyboard.md +231 -21
- package/dist/template/.opencode/command/handoff.md +208 -31
- package/dist/template/.opencode/command/implement.md +163 -50
- package/dist/template/.opencode/command/import-plan.md +253 -52
- package/dist/template/.opencode/command/init.md +154 -35
- package/dist/template/.opencode/command/integration-test.md +410 -24
- package/dist/template/.opencode/command/issue.md +177 -21
- package/dist/template/.opencode/command/new-feature.md +390 -54
- package/dist/template/.opencode/command/plan.md +394 -107
- package/dist/template/.opencode/command/pr.md +235 -29
- package/dist/template/.opencode/command/quick-build.md +234 -5
- package/dist/template/.opencode/command/research-and-implement.md +442 -12
- package/dist/template/.opencode/command/research-ui.md +444 -34
- package/dist/template/.opencode/command/research.md +179 -45
- package/dist/template/.opencode/command/restore-image.md +416 -22
- package/dist/template/.opencode/command/resume.md +447 -63
- package/dist/template/.opencode/command/revert-feature.md +347 -65
- package/dist/template/.opencode/command/review-codebase.md +199 -4
- package/dist/template/.opencode/command/skill-create.md +506 -14
- package/dist/template/.opencode/command/skill-optimize.md +487 -16
- package/dist/template/.opencode/command/status.md +326 -60
- package/dist/template/.opencode/command/summarize.md +374 -33
- package/dist/template/.opencode/command/triage.md +361 -0
- package/dist/template/.opencode/command/ui-review.md +296 -25
- package/dist/template/.opencode/skill/beads/SKILL.md +108 -3
- package/dist/template/.opencode/skill/playwriter/SKILL.md +148 -0
- package/package.json +1 -1
|
@@ -6,12 +6,32 @@ agent: build
|
|
|
6
6
|
|
|
7
7
|
# Handoff
|
|
8
8
|
|
|
9
|
-
**Load
|
|
9
|
+
**Load skills:**
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
```typescript
|
|
12
|
+
skill({ name: "beads" }); // Session protocol
|
|
13
|
+
skill({ name: "verification-before-completion" });
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Phase 1: Check Messages
|
|
17
|
+
|
|
18
|
+
Check for any messages that might affect handoff:
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
bd_inbox({ n: 5, unread: true, global: true });
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Phase 2: Release Locks
|
|
25
|
+
|
|
26
|
+
Release any file reservations you hold:
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
bd_release({ _: true });
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Phase 3: Gather State
|
|
12
33
|
|
|
13
34
|
```typescript
|
|
14
|
-
// Bead info
|
|
15
35
|
bd_show({ id: "$ARGUMENTS" });
|
|
16
36
|
```
|
|
17
37
|
|
|
@@ -26,7 +46,33 @@ git status --porcelain
|
|
|
26
46
|
git diff --stat
|
|
27
47
|
```
|
|
28
48
|
|
|
29
|
-
## Phase
|
|
49
|
+
## Phase 4: Verify Artifacts
|
|
50
|
+
|
|
51
|
+
Check what artifacts exist and are valid:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
ls -la .beads/artifacts/<bead-id>/ 2>/dev/null
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
For each artifact, verify it's not empty:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
wc -l .beads/artifacts/<bead-id>/spec.md 2>/dev/null
|
|
61
|
+
wc -l .beads/artifacts/<bead-id>/research.md 2>/dev/null
|
|
62
|
+
wc -l .beads/artifacts/<bead-id>/plan.md 2>/dev/null
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Artifact Check:
|
|
67
|
+
━━━━━━━━━━━━━━
|
|
68
|
+
|
|
69
|
+
- spec.md: [exists/missing] ([N] lines)
|
|
70
|
+
- research.md: [exists/missing] ([N] lines)
|
|
71
|
+
- plan.md: [exists/missing] ([N] lines)
|
|
72
|
+
- review.md: [exists/missing] ([N] lines)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Phase 5: Commit WIP (if needed)
|
|
30
76
|
|
|
31
77
|
If uncommitted changes exist:
|
|
32
78
|
|
|
@@ -35,7 +81,23 @@ git add -A
|
|
|
35
81
|
git commit -m "WIP: <bead-id> - [current step]"
|
|
36
82
|
```
|
|
37
83
|
|
|
38
|
-
## Phase
|
|
84
|
+
## Phase 6: Calculate Session Stats
|
|
85
|
+
|
|
86
|
+
Track estimation accuracy:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
Session Stats:
|
|
90
|
+
━━━━━━━━━━━━━━
|
|
91
|
+
|
|
92
|
+
Estimate: [S/M/L] (~[N] tool calls)
|
|
93
|
+
Actual: [N] tool calls
|
|
94
|
+
Variance: [+/-N%]
|
|
95
|
+
|
|
96
|
+
Progress: [N]% complete
|
|
97
|
+
Time in session: [estimated duration]
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Phase 7: Create Handoff
|
|
39
101
|
|
|
40
102
|
Write `.beads/artifacts/<bead-id>/handoffs/<timestamp>.md`:
|
|
41
103
|
|
|
@@ -47,15 +109,26 @@ Write `.beads/artifacts/<bead-id>/handoffs/<timestamp>.md`:
|
|
|
47
109
|
|
|
48
110
|
## Provenance
|
|
49
111
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
112
|
+
| Field | Value |
|
|
113
|
+
| ------ | ---------------- |
|
|
114
|
+
| Repo | [git remote URL] |
|
|
115
|
+
| Branch | [branch name] |
|
|
116
|
+
| Commit | [commit hash] |
|
|
117
|
+
| Clean | [yes/no] |
|
|
118
|
+
|
|
119
|
+
## Session Stats
|
|
120
|
+
|
|
121
|
+
| Metric | Value |
|
|
122
|
+
| -------- | ------------- |
|
|
123
|
+
| Estimate | [S/M/L] |
|
|
124
|
+
| Budget | ~[N] calls |
|
|
125
|
+
| Actual | [N] calls |
|
|
126
|
+
| Variance | [+/-N%] |
|
|
127
|
+
| Progress | [N]% complete |
|
|
54
128
|
|
|
55
129
|
## Session Context
|
|
56
130
|
|
|
57
|
-
**Current Session:** [session ID
|
|
58
|
-
**Token Usage:** [if available]
|
|
131
|
+
**Current Session:** [session ID]
|
|
59
132
|
|
|
60
133
|
Next session can load context with:
|
|
61
134
|
```
|
|
@@ -66,10 +139,12 @@ read_session("last", project="current")
|
|
|
66
139
|
|
|
67
140
|
## Bead State
|
|
68
141
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
142
|
+
| Field | Value |
|
|
143
|
+
| -------- | ---------- |
|
|
144
|
+
| ID | <bead-id> |
|
|
145
|
+
| Title | [title] |
|
|
146
|
+
| Status | [status] |
|
|
147
|
+
| Priority | [priority] |
|
|
73
148
|
|
|
74
149
|
## Progress
|
|
75
150
|
|
|
@@ -80,7 +155,7 @@ read_session("last", project="current")
|
|
|
80
155
|
|
|
81
156
|
### In Progress
|
|
82
157
|
|
|
83
|
-
- [ ] [Current step] - [where stopped]
|
|
158
|
+
- [ ] [Current step] - [where stopped, what's next]
|
|
84
159
|
|
|
85
160
|
### Remaining
|
|
86
161
|
|
|
@@ -91,8 +166,10 @@ read_session("last", project="current")
|
|
|
91
166
|
|
|
92
167
|
### Key Files
|
|
93
168
|
|
|
94
|
-
|
|
95
|
-
|
|
169
|
+
| File | Relevance |
|
|
170
|
+
| ----------------- | ---------------- |
|
|
171
|
+
| `src/foo.ts:42` | [why relevant] |
|
|
172
|
+
| `src/bar.ts` | [why relevant] |
|
|
96
173
|
|
|
97
174
|
### Decisions Made
|
|
98
175
|
|
|
@@ -101,7 +178,22 @@ read_session("last", project="current")
|
|
|
101
178
|
|
|
102
179
|
### Blockers/Issues
|
|
103
180
|
|
|
104
|
-
- [Issue 1] - [status]
|
|
181
|
+
- [Issue 1] - [status: resolved/pending/blocked]
|
|
182
|
+
|
|
183
|
+
## Lessons Learned
|
|
184
|
+
|
|
185
|
+
### What Went Well
|
|
186
|
+
|
|
187
|
+
- [Thing that worked smoothly]
|
|
188
|
+
|
|
189
|
+
### What Was Harder Than Expected
|
|
190
|
+
|
|
191
|
+
- [Challenge encountered]
|
|
192
|
+
- [Why it was harder]
|
|
193
|
+
|
|
194
|
+
### Patterns Discovered
|
|
195
|
+
|
|
196
|
+
- [Pattern worth remembering]
|
|
105
197
|
|
|
106
198
|
## Resume Instructions
|
|
107
199
|
|
|
@@ -109,36 +201,121 @@ read_session("last", project="current")
|
|
|
109
201
|
|
|
110
202
|
1. [First thing to do]
|
|
111
203
|
2. [Second thing to do]
|
|
204
|
+
3. [Third thing to do]
|
|
112
205
|
|
|
113
|
-
**Recommended:** Start next session with `/resume <bead-id>`
|
|
206
|
+
**Recommended:** Start next session with `/resume <bead-id>`
|
|
114
207
|
|
|
115
208
|
## Artifacts
|
|
116
209
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
210
|
+
| Artifact | Status | Lines |
|
|
211
|
+
| ------------ | ------- | ----- |
|
|
212
|
+
| spec.md | [✓/✗] | [N] |
|
|
213
|
+
| research.md | [✓/✗] | [N] |
|
|
214
|
+
| plan.md | [✓/✗] | [N] |
|
|
215
|
+
| review.md | [✓/✗] | [N] |
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Phase 8: Create Observation (if notable learnings)
|
|
219
|
+
|
|
220
|
+
If session revealed patterns or gotchas:
|
|
221
|
+
|
|
222
|
+
```typescript
|
|
223
|
+
observation({
|
|
224
|
+
type: "learning",
|
|
225
|
+
title: "Session learning: [topic]",
|
|
226
|
+
content: `
|
|
227
|
+
## What Happened
|
|
228
|
+
[Brief description]
|
|
229
|
+
|
|
230
|
+
## Lesson
|
|
231
|
+
[What we learned]
|
|
232
|
+
|
|
233
|
+
## Application
|
|
234
|
+
[When to apply this learning]
|
|
235
|
+
`,
|
|
236
|
+
concepts: "[keywords]",
|
|
237
|
+
bead_id: "<bead-id>",
|
|
238
|
+
});
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Phase 9: Update Memory (if gotchas found)
|
|
242
|
+
|
|
243
|
+
If you discovered issues worth remembering:
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
memory -
|
|
247
|
+
update({
|
|
248
|
+
file: "project/gotchas",
|
|
249
|
+
content: `
|
|
250
|
+
## [Gotcha Title]
|
|
251
|
+
|
|
252
|
+
**Symptom:** [What you see]
|
|
253
|
+
**Cause:** [Root cause]
|
|
254
|
+
**Fix:** [How to resolve]
|
|
255
|
+
`,
|
|
256
|
+
mode: "append",
|
|
257
|
+
});
|
|
120
258
|
```
|
|
121
259
|
|
|
122
|
-
## Phase
|
|
260
|
+
## Phase 10: Notify Blockers (if any)
|
|
123
261
|
|
|
124
|
-
|
|
262
|
+
If there are blockers for next session:
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
bd_msg({
|
|
266
|
+
subj: "Handoff: <bead-id> - Blocked",
|
|
267
|
+
body: `
|
|
268
|
+
Blockers:
|
|
269
|
+
- [Blocker 1]
|
|
270
|
+
- [Blocker 2]
|
|
271
|
+
|
|
272
|
+
Needs: [what's required to unblock]
|
|
273
|
+
`,
|
|
274
|
+
to: "all",
|
|
275
|
+
importance: "high",
|
|
276
|
+
global: true,
|
|
277
|
+
});
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Phase 11: Update Bead & Sync
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
bd_msg({
|
|
284
|
+
subj: "Handoff created",
|
|
285
|
+
body: "Progress: [N]%\nNext: [what needs to happen]",
|
|
286
|
+
to: "all",
|
|
287
|
+
importance: "normal",
|
|
288
|
+
global: false,
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
bd_sync({ reason: "Handoff created for $ARGUMENTS" });
|
|
292
|
+
```
|
|
125
293
|
|
|
126
294
|
## Output
|
|
127
295
|
|
|
128
296
|
```
|
|
129
297
|
Handoff Created: <bead-id>
|
|
130
|
-
|
|
298
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
131
299
|
|
|
132
300
|
Commit: [hash]
|
|
133
301
|
Branch: [branch]
|
|
302
|
+
Progress: [N]% complete
|
|
303
|
+
|
|
304
|
+
Session Stats:
|
|
305
|
+
- Estimate: [S/M/L] (~[N] calls)
|
|
306
|
+
- Actual: [N] calls
|
|
307
|
+
- Variance: [+/-N%]
|
|
134
308
|
|
|
309
|
+
Artifacts verified: [N]/[N]
|
|
135
310
|
Saved: .beads/artifacts/<bead-id>/handoffs/<timestamp>.md
|
|
136
311
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
312
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
313
|
+
To continue: /resume <bead-id>
|
|
314
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
140
315
|
|
|
141
|
-
The handoff
|
|
316
|
+
The handoff is saved. Start a fresh session for best performance.
|
|
142
317
|
|
|
143
|
-
|
|
318
|
+
Next session will auto-load:
|
|
319
|
+
- This handoff document
|
|
320
|
+
- Previous session context via read_session("last")
|
|
144
321
|
```
|
|
@@ -6,16 +6,31 @@ agent: build
|
|
|
6
6
|
|
|
7
7
|
# Implement
|
|
8
8
|
|
|
9
|
-
**Load
|
|
9
|
+
**Load skills:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
skill({ name: "beads" }); // Session protocol and hierarchy
|
|
13
|
+
skill({ name: "test-driven-development" });
|
|
14
|
+
skill({ name: "verification-before-completion" });
|
|
15
|
+
```
|
|
10
16
|
|
|
11
17
|
For large tasks with 3+ phases, also load: `skill({ name: "subagent-driven-development" })`
|
|
12
18
|
|
|
13
19
|
## Phase 1: Setup Workspace
|
|
14
20
|
|
|
15
21
|
```typescript
|
|
22
|
+
bd_init({ team: "project", role: "<your-role>" });
|
|
16
23
|
bd_show({ id: "$ARGUMENTS" });
|
|
17
24
|
```
|
|
18
25
|
|
|
26
|
+
**Check for messages from other agents:**
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
bd_inbox({ n: 5, unread: true, global: true });
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Review any coordination messages before starting.
|
|
33
|
+
|
|
19
34
|
Check git state:
|
|
20
35
|
|
|
21
36
|
```bash
|
|
@@ -31,45 +46,62 @@ Create branch if not on bead branch:
|
|
|
31
46
|
git checkout -b <bead-id>
|
|
32
47
|
```
|
|
33
48
|
|
|
34
|
-
**
|
|
35
|
-
|
|
36
|
-
Initialize your agent session and claim the task:
|
|
49
|
+
**Claim the task:**
|
|
37
50
|
|
|
38
51
|
```typescript
|
|
39
|
-
|
|
52
|
+
bd_claim({ reason: "Starting implementation of <bead-id>" });
|
|
40
53
|
```
|
|
41
54
|
|
|
42
55
|
This registers you in the workspace. If another agent is working on the same task, you'll be notified.
|
|
43
56
|
|
|
44
|
-
## Phase 2: Load Context
|
|
57
|
+
## Phase 2: Load Context & Estimation
|
|
45
58
|
|
|
46
59
|
**Check for previous session work:**
|
|
47
60
|
|
|
48
|
-
```
|
|
49
|
-
list_sessions(project
|
|
61
|
+
```typescript
|
|
62
|
+
list_sessions({ project: "current", limit: 3 });
|
|
50
63
|
```
|
|
51
64
|
|
|
52
65
|
If recent session exists:
|
|
53
66
|
|
|
54
|
-
```
|
|
55
|
-
read_session("last", project
|
|
67
|
+
```typescript
|
|
68
|
+
read_session({ session_reference: "last", project: "current" });
|
|
56
69
|
```
|
|
57
70
|
|
|
58
71
|
Review what was already attempted/completed.
|
|
59
72
|
|
|
60
|
-
|
|
73
|
+
**Load artifacts:**
|
|
61
74
|
|
|
62
75
|
```bash
|
|
63
76
|
ls .beads/artifacts/<bead-id>/ 2>/dev/null || echo "No artifacts yet"
|
|
64
77
|
```
|
|
65
78
|
|
|
66
|
-
**
|
|
79
|
+
**Extract estimation from spec/plan:**
|
|
80
|
+
|
|
81
|
+
Look for estimate tag (S/M/L/XL) and set budget:
|
|
67
82
|
|
|
68
|
-
|
|
83
|
+
| Estimate | Tool Call Budget | Checkpoint Frequency |
|
|
84
|
+
| -------- | ---------------- | -------------------- |
|
|
85
|
+
| S | ~10 | End only |
|
|
86
|
+
| M | ~30 | Every 10 calls |
|
|
87
|
+
| L | ~100 | Every 20 calls |
|
|
88
|
+
| XL | Decomposed | Every step |
|
|
69
89
|
|
|
70
|
-
|
|
90
|
+
```
|
|
91
|
+
Implementation Budget:
|
|
92
|
+
━━━━━━━━━━━━━━━━━━━━━
|
|
93
|
+
|
|
94
|
+
Estimate: [S/M/L] (~[N] tool calls)
|
|
95
|
+
Budget: [N] tool calls
|
|
96
|
+
Checkpoint: Every [N] calls
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Determine mode:**
|
|
71
100
|
|
|
72
|
-
**If
|
|
101
|
+
- **If `plan.md` exists:** Follow the plan step-by-step (Planned Mode)
|
|
102
|
+
- **If `research.md` exists but no plan:** Ask user "Create plan first? Or implement directly?"
|
|
103
|
+
- **If only `spec.md` exists:** Read spec and implement directly (Quick Mode)
|
|
104
|
+
- **If no artifacts:** Read bead description and implement based on that
|
|
73
105
|
|
|
74
106
|
Check for handoffs:
|
|
75
107
|
|
|
@@ -87,71 +119,104 @@ Check which project files exist:
|
|
|
87
119
|
ls package.json Cargo.toml pyproject.toml setup.py Makefile go.mod 2>/dev/null || true
|
|
88
120
|
```
|
|
89
121
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
**Make-based** (`Makefile`): `make test`, `make lint`
|
|
99
|
-
|
|
100
|
-
**No recognized files:** Skip automated verification.
|
|
122
|
+
| Project Type | Test Command | Lint Command |
|
|
123
|
+
| ------------------ | --------------- | ------------------------------------ |
|
|
124
|
+
| Node.js/TypeScript | `npm test` | `npm run lint && npm run type-check` |
|
|
125
|
+
| Rust | `cargo test` | `cargo clippy -- -D warnings` |
|
|
126
|
+
| Python | `pytest` | `ruff check . && mypy .` |
|
|
127
|
+
| Go | `go test ./...` | `golangci-lint run` |
|
|
128
|
+
| Make-based | `make test` | `make lint` |
|
|
101
129
|
|
|
102
130
|
Report:
|
|
103
131
|
|
|
104
132
|
```
|
|
105
133
|
Implementing: <bead-id>
|
|
106
134
|
━━━━━━━━━━━━━━━━━━━━━━
|
|
135
|
+
|
|
107
136
|
Project: [detected type]
|
|
108
137
|
Mode: [Quick/Planned]
|
|
138
|
+
Estimate: [S/M/L] (~[N] tool calls)
|
|
109
139
|
```
|
|
110
140
|
|
|
111
141
|
## Phase 4: Implementation
|
|
112
142
|
|
|
113
|
-
|
|
143
|
+
### Check Locks & Reserve Files
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
bd_reservations({ reason: "Checking for conflicts before implementation" });
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
If files you need are locked:
|
|
114
150
|
|
|
115
|
-
|
|
151
|
+
- Wait for lock to expire, or
|
|
152
|
+
- Coordinate via `bd_msg`, or
|
|
153
|
+
- Work on different files
|
|
154
|
+
|
|
155
|
+
Reserve files before editing:
|
|
116
156
|
|
|
117
157
|
```typescript
|
|
118
|
-
bd_reserve({
|
|
158
|
+
bd_reserve({
|
|
159
|
+
paths: ["src/auth.ts", "src/utils/**"],
|
|
160
|
+
reason: "Implementing <bead-id>",
|
|
161
|
+
ttl: 600,
|
|
162
|
+
});
|
|
119
163
|
```
|
|
120
164
|
|
|
121
|
-
|
|
165
|
+
### Escape Hatches
|
|
166
|
+
|
|
167
|
+
Set limits before starting:
|
|
168
|
+
|
|
169
|
+
| Condition | Action |
|
|
170
|
+
| ------------------------------ | ------------------------------------- |
|
|
171
|
+
| Step fails 3x | Stop, analyze, try different approach |
|
|
172
|
+
| Tests fail 5x consecutively | Pause, ask human for guidance |
|
|
173
|
+
| Budget 80% exhausted | Checkpoint commit, reassess scope |
|
|
174
|
+
| Budget exhausted | `/handoff` with progress summary |
|
|
175
|
+
| Blocked on external dependency | Create blocker bead, move on |
|
|
122
176
|
|
|
123
177
|
### With Plan (Planned Mode)
|
|
124
178
|
|
|
125
179
|
For each unchecked step in plan.md:
|
|
126
180
|
|
|
127
|
-
1.
|
|
128
|
-
2.
|
|
129
|
-
3.
|
|
130
|
-
4.
|
|
181
|
+
1. **Check rollback point** from plan (if exists)
|
|
182
|
+
2. Make changes to listed files
|
|
183
|
+
3. Run step verification command
|
|
184
|
+
4. If fails 3x: Use rollback, try different approach
|
|
185
|
+
5. Mark step complete: `- [x]`
|
|
186
|
+
6. **Checkpoint commit** (if L/XL or significant change)
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
git add <files> && git commit -m "WIP: <bead-id> - Step N complete"
|
|
190
|
+
```
|
|
131
191
|
|
|
132
192
|
### Without Plan (Quick Mode)
|
|
133
193
|
|
|
134
|
-
1. Read spec requirements
|
|
194
|
+
1. Read spec requirements and success criteria
|
|
135
195
|
2. Identify files to change
|
|
136
196
|
3. Make minimal, focused changes
|
|
137
197
|
4. Run verification after each logical change
|
|
138
198
|
5. Keep changes atomic and reviewable
|
|
139
199
|
|
|
140
|
-
|
|
200
|
+
### Gate Rules
|
|
141
201
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
202
|
+
| Gate | On Failure |
|
|
203
|
+
| ---------- | ----------------------------------- |
|
|
204
|
+
| Type check | Fix before proceeding |
|
|
205
|
+
| Tests | Fix before proceeding (max 3 tries) |
|
|
206
|
+
| Lint | Auto-fix if possible, else note |
|
|
145
207
|
|
|
146
|
-
|
|
208
|
+
### Track Progress
|
|
147
209
|
|
|
148
|
-
After
|
|
210
|
+
After every 10 tool calls (or per checkpoint frequency):
|
|
149
211
|
|
|
150
212
|
```
|
|
151
213
|
Progress: <bead-id>
|
|
152
214
|
━━━━━━━━━━━━━━━━━━
|
|
153
215
|
|
|
154
|
-
|
|
216
|
+
Tool calls: [N]/[budget]
|
|
217
|
+
Steps: [completed]/[total]
|
|
218
|
+
|
|
219
|
+
Recent changes:
|
|
155
220
|
- src/foo.ts:15 - [what changed]
|
|
156
221
|
|
|
157
222
|
Verification: Test ✓ | Lint ✓ | Types ✓
|
|
@@ -161,29 +226,76 @@ Continue? (yes/pause/stop)
|
|
|
161
226
|
|
|
162
227
|
If "pause" or "stop": Run `/handoff <bead-id>`.
|
|
163
228
|
|
|
164
|
-
## Phase
|
|
229
|
+
## Phase 5: Pre-Completion Verification
|
|
230
|
+
|
|
231
|
+
Before claiming done, verify against spec success criteria:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
cat .beads/artifacts/<bead-id>/spec.md | grep -A 20 "Success Criteria"
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
For each criterion:
|
|
238
|
+
|
|
239
|
+
- [ ] Run the verification command listed
|
|
240
|
+
- [ ] Confirm it passes
|
|
241
|
+
- [ ] Document result
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
Success Criteria Check:
|
|
245
|
+
━━━━━━━━━━━━━━━━━━━━━━
|
|
246
|
+
|
|
247
|
+
- [x] [Criterion 1] - Verify: `npm test auth` ✓
|
|
248
|
+
- [x] [Criterion 2] - Verify: `curl localhost:3000/health` ✓
|
|
249
|
+
- [ ] [Criterion 3] - Verify: [command] ✗ (needs fix)
|
|
250
|
+
```
|
|
165
251
|
|
|
166
|
-
|
|
252
|
+
**Do not proceed until all criteria pass.**
|
|
253
|
+
|
|
254
|
+
## Phase 6: Update Memory (if needed)
|
|
255
|
+
|
|
256
|
+
If you encountered unexpected issues:
|
|
167
257
|
|
|
168
258
|
```typescript
|
|
169
|
-
|
|
259
|
+
memory -
|
|
260
|
+
update({
|
|
261
|
+
file: "project/gotchas",
|
|
262
|
+
content: "## [Issue Title]\n\n[What happened and how to avoid it]",
|
|
263
|
+
mode: "append",
|
|
264
|
+
});
|
|
170
265
|
```
|
|
171
266
|
|
|
172
|
-
|
|
267
|
+
## Phase 7: Complete
|
|
173
268
|
|
|
269
|
+
Release file reservations:
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
bd_release({ _: true });
|
|
174
273
|
```
|
|
175
|
-
Implementation Complete: <bead-id>
|
|
176
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
177
274
|
|
|
178
|
-
|
|
275
|
+
Run full verification suite:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
[project-specific test command]
|
|
279
|
+
[project-specific lint command]
|
|
179
280
|
```
|
|
180
281
|
|
|
181
|
-
|
|
282
|
+
Sync with other agents:
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
bd_sync({ reason: "Implementation complete for <bead-id>" });
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Final report:**
|
|
182
289
|
|
|
183
290
|
If all pass:
|
|
184
291
|
|
|
185
292
|
```
|
|
293
|
+
Implementation Complete: <bead-id>
|
|
294
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
295
|
+
|
|
296
|
+
Tool calls: [actual]/[budget] ([over/under] by [N])
|
|
186
297
|
All gates passed ✓
|
|
298
|
+
All success criteria verified ✓
|
|
187
299
|
|
|
188
300
|
Next: /finish <bead-id>
|
|
189
301
|
```
|
|
@@ -192,6 +304,7 @@ If any fail:
|
|
|
192
304
|
|
|
193
305
|
```
|
|
194
306
|
Gate failed: [which one]
|
|
307
|
+
Retries: [N]/3
|
|
195
308
|
|
|
196
309
|
Fix issues before running /finish.
|
|
197
310
|
```
|