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,522 +1,154 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Resume work on a bead from
|
|
2
|
+
description: Resume work on a bead from previous session
|
|
3
3
|
argument-hint: "<bead-id>"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Resume: $ARGUMENTS
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
You're picking up where a previous session left off. Recover context, verify state, continue work.
|
|
10
10
|
|
|
11
|
-
## Load
|
|
11
|
+
## Load Skills
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
skill({ name: "beads" });
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Prerequisites
|
|
20
|
-
|
|
21
|
-
- Bead ID must exist
|
|
22
|
-
- Handoff file should be present (created by `/handoff`)
|
|
23
|
-
- Previous session context should be accessible
|
|
24
|
-
|
|
25
|
-
## Phase 1: Initialize Environment
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
bd_init({ _: true, team: "project", role: "builder" });
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Phase 2: Validate Bead Exists
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
bd_show({ id: "$ARGUMENTS" });
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**If bead not found:**
|
|
17
|
+
## Verify The Task Exists
|
|
38
18
|
|
|
19
|
+
```bash
|
|
20
|
+
bd show $ARGUMENTS
|
|
39
21
|
```
|
|
40
|
-
ERROR: Bead '$ARGUMENTS' not found
|
|
41
22
|
|
|
42
|
-
|
|
43
|
-
[list from bd_ls]
|
|
23
|
+
If not found, check `bd list --status=all`. Maybe it was closed, or you have the wrong ID.
|
|
44
24
|
|
|
45
|
-
|
|
46
|
-
- bd-abc12 (similar prefix)
|
|
47
|
-
- bd-xyz99 (in progress)
|
|
25
|
+
## Check Git State
|
|
48
26
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
27
|
+
```bash
|
|
28
|
+
git branch --show-current
|
|
29
|
+
git rev-parse --short HEAD
|
|
30
|
+
git status --porcelain
|
|
52
31
|
```
|
|
53
32
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
Before diving in, check for coordination updates:
|
|
33
|
+
If you're not on the right branch:
|
|
57
34
|
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
bd_reservations({ reason: "Check for conflicting locks" });
|
|
35
|
+
```bash
|
|
36
|
+
git checkout $ARGUMENTS 2>/dev/null || git checkout feature/$ARGUMENTS
|
|
61
37
|
```
|
|
62
38
|
|
|
63
|
-
|
|
39
|
+
If there are uncommitted changes, decide: stash, commit, or discard.
|
|
64
40
|
|
|
65
|
-
|
|
66
|
-
⚠️ ATTENTION REQUIRED
|
|
67
|
-
━━━━━━━━━━━━━━━━━━━━━
|
|
68
|
-
|
|
69
|
-
Message from qa-agent (2h ago):
|
|
70
|
-
"Found regression in auth flow - hold on bd-abc12 until fixed"
|
|
41
|
+
## Find The Handoff
|
|
71
42
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
2. Switch to different task (/triage)
|
|
75
|
-
3. Reply for clarification
|
|
43
|
+
```bash
|
|
44
|
+
ls -t .beads/artifacts/$ARGUMENTS/handoffs/ 2>/dev/null | head -1
|
|
76
45
|
```
|
|
77
46
|
|
|
78
|
-
|
|
47
|
+
If a handoff exists, read it:
|
|
79
48
|
|
|
49
|
+
```bash
|
|
50
|
+
cat .beads/artifacts/$ARGUMENTS/handoffs/[latest].md
|
|
80
51
|
```
|
|
81
|
-
⚠️ FILE CONFLICT
|
|
82
|
-
━━━━━━━━━━━━━━━━
|
|
83
52
|
|
|
84
|
-
|
|
53
|
+
The handoff tells you:
|
|
85
54
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
1. Wait for lock to expire
|
|
91
|
-
2. Message be-agent to coordinate
|
|
92
|
-
3. Work on non-conflicting files first
|
|
93
|
-
```
|
|
55
|
+
- What was completed
|
|
56
|
+
- Where work stopped
|
|
57
|
+
- What to do next
|
|
58
|
+
- Any blockers
|
|
94
59
|
|
|
95
|
-
##
|
|
60
|
+
## Load Previous Session Context
|
|
96
61
|
|
|
97
|
-
|
|
62
|
+
Search for related work:
|
|
98
63
|
|
|
99
64
|
```typescript
|
|
100
|
-
// Search past sessions for work on this bead
|
|
101
65
|
search_session({ query: "$ARGUMENTS" });
|
|
66
|
+
list_sessions({ project: "current", limit: 5 });
|
|
102
67
|
```
|
|
103
68
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
### Step 2: Find Related Sessions
|
|
107
|
-
|
|
108
|
-
```typescript
|
|
109
|
-
list_sessions({ project: "current", limit: 10, _: true });
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Step 3: Identify Relevant Session
|
|
113
|
-
|
|
114
|
-
Look for sessions that:
|
|
115
|
-
|
|
116
|
-
- Mention the bead ID
|
|
117
|
-
- Modified files in the bead's scope
|
|
118
|
-
- Have handoff mentions
|
|
69
|
+
Load the most recent relevant session:
|
|
119
70
|
|
|
120
71
|
```typescript
|
|
121
|
-
read_session(
|
|
72
|
+
read_session({ session_reference: "last", project: "current" });
|
|
122
73
|
```
|
|
123
74
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
From session, note:
|
|
75
|
+
Extract from session:
|
|
127
76
|
|
|
128
77
|
- Files modified
|
|
129
78
|
- Decisions made
|
|
130
79
|
- Where work stopped
|
|
131
|
-
-
|
|
80
|
+
- Problems encountered
|
|
132
81
|
|
|
133
|
-
##
|
|
82
|
+
## Load Artifacts
|
|
134
83
|
|
|
135
|
-
|
|
84
|
+
Read all available context:
|
|
136
85
|
|
|
137
86
|
```bash
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
**If no handoffs directory:**
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
No handoff found for $ARGUMENTS
|
|
145
|
-
|
|
146
|
-
This bead may not have been started with /start, or
|
|
147
|
-
no handoff was created before the previous session ended.
|
|
148
|
-
|
|
149
|
-
Fallback: Loading from bead spec and plan...
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Load Handoff Content
|
|
153
|
-
|
|
154
|
-
```typescript
|
|
155
|
-
read({ filePath: ".beads/artifacts/$ARGUMENTS/handoffs/<latest>.md" });
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Parse Handoff Structure
|
|
159
|
-
|
|
160
|
-
Expected format:
|
|
161
|
-
|
|
162
|
-
```markdown
|
|
163
|
-
# Handoff: $ARGUMENTS
|
|
164
|
-
|
|
165
|
-
## Summary
|
|
166
|
-
|
|
167
|
-
[What was accomplished]
|
|
168
|
-
|
|
169
|
-
## Progress
|
|
170
|
-
|
|
171
|
-
- [x] Step 1
|
|
172
|
-
- [x] Step 2
|
|
173
|
-
- [ ] Step 3 ← STOPPED HERE
|
|
174
|
-
- [ ] Step 4
|
|
175
|
-
|
|
176
|
-
## Current State
|
|
177
|
-
|
|
178
|
-
- Branch: feature/auth
|
|
179
|
-
- Commit: abc1234
|
|
180
|
-
- Working: src/auth/service.ts
|
|
181
|
-
|
|
182
|
-
## Resume Instructions
|
|
183
|
-
|
|
184
|
-
[Specific next actions]
|
|
185
|
-
|
|
186
|
-
## Blockers
|
|
187
|
-
|
|
188
|
-
[Any known issues]
|
|
189
|
-
|
|
190
|
-
## Files Modified
|
|
191
|
-
|
|
192
|
-
- src/auth/service.ts (+45/-12)
|
|
193
|
-
- src/auth/types.ts (+8/-0)
|
|
87
|
+
cat .beads/artifacts/$ARGUMENTS/spec.md 2>/dev/null
|
|
88
|
+
cat .beads/artifacts/$ARGUMENTS/plan.md 2>/dev/null
|
|
89
|
+
cat .beads/artifacts/$ARGUMENTS/research.md 2>/dev/null
|
|
194
90
|
```
|
|
195
91
|
|
|
196
|
-
##
|
|
92
|
+
## Check For Stale Context
|
|
197
93
|
|
|
198
|
-
|
|
94
|
+
If the handoff is more than 3 days old, things may have changed:
|
|
199
95
|
|
|
200
96
|
```bash
|
|
201
|
-
git
|
|
202
|
-
git
|
|
203
|
-
git status --porcelain
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### Compare with Handoff
|
|
207
|
-
|
|
208
|
-
```typescript
|
|
209
|
-
const handoffCommit = parseHandoff().commit;
|
|
210
|
-
const currentCommit = getCurrentCommit();
|
|
211
|
-
|
|
212
|
-
if (handoffCommit !== currentCommit) {
|
|
213
|
-
// Check if we're ahead or behind
|
|
214
|
-
const isAhead = isAncestor(handoffCommit, currentCommit);
|
|
215
|
-
const isBehind = isAncestor(currentCommit, handoffCommit);
|
|
216
|
-
|
|
217
|
-
if (isAhead) {
|
|
218
|
-
console.log(
|
|
219
|
-
"Current branch is ahead of handoff - new commits since handoff",
|
|
220
|
-
);
|
|
221
|
-
} else if (isBehind) {
|
|
222
|
-
console.log(
|
|
223
|
-
"WARNING: Current branch is behind handoff - commits may be lost",
|
|
224
|
-
);
|
|
225
|
-
} else {
|
|
226
|
-
console.log("WARNING: Branches have diverged");
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
**Mismatch Handling:**
|
|
232
|
-
|
|
233
|
-
```
|
|
234
|
-
⚠️ GIT STATE MISMATCH
|
|
235
|
-
━━━━━━━━━━━━━━━━━━━━━
|
|
236
|
-
|
|
237
|
-
Handoff Commit: abc1234 "feat: add auth middleware"
|
|
238
|
-
Current Commit: def5678 "fix: typo in readme"
|
|
239
|
-
Branch: main (expected: feature/auth)
|
|
240
|
-
|
|
241
|
-
Options:
|
|
242
|
-
1. Switch to correct branch:
|
|
243
|
-
git checkout feature/auth
|
|
244
|
-
|
|
245
|
-
2. Continue on current branch:
|
|
246
|
-
[Work may not align with handoff]
|
|
247
|
-
|
|
248
|
-
3. View diff between commits:
|
|
249
|
-
git diff abc1234..def5678
|
|
97
|
+
git log --oneline -10 # What happened since?
|
|
98
|
+
git diff [handoff-commit]..HEAD --stat # What files changed?
|
|
250
99
|
```
|
|
251
100
|
|
|
252
|
-
|
|
101
|
+
If significant changes occurred on main, consider rebasing:
|
|
253
102
|
|
|
254
103
|
```bash
|
|
255
|
-
|
|
256
|
-
git
|
|
257
|
-
|
|
258
|
-
# Checkout if found
|
|
259
|
-
git checkout "$ARGUMENTS" 2>/dev/null || git checkout "feature/$ARGUMENTS"
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
## Phase 7: Load All Artifacts
|
|
263
|
-
|
|
264
|
-
Read all bead context in parallel:
|
|
265
|
-
|
|
266
|
-
```typescript
|
|
267
|
-
read({ filePath: ".beads/artifacts/$ARGUMENTS/spec.md" });
|
|
268
|
-
read({ filePath: ".beads/artifacts/$ARGUMENTS/research.md" });
|
|
269
|
-
read({ filePath: ".beads/artifacts/$ARGUMENTS/plan.md" });
|
|
270
|
-
read({ filePath: ".beads/artifacts/$ARGUMENTS/review.md" });
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
**If files missing, note gaps:**
|
|
274
|
-
|
|
275
|
-
```
|
|
276
|
-
Artifact Status:
|
|
277
|
-
✓ spec.md - loaded
|
|
278
|
-
✓ plan.md - loaded
|
|
279
|
-
✗ research.md - not found (may not be needed)
|
|
280
|
-
✗ review.md - not found (will create during work)
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
## Phase 8: Stale Handoff Detection
|
|
284
|
-
|
|
285
|
-
Check if handoff is too old:
|
|
286
|
-
|
|
287
|
-
```typescript
|
|
288
|
-
const handoffAge = Date.now() - new Date(handoff.timestamp);
|
|
289
|
-
const hoursOld = handoffAge / (1000 * 60 * 60);
|
|
290
|
-
|
|
291
|
-
if (hoursOld > 72) {
|
|
292
|
-
// 3 days
|
|
293
|
-
console.warn(`⚠️ Handoff is ${Math.floor(hoursOld / 24)} days old`);
|
|
294
|
-
console.warn("Context may be outdated. Consider:");
|
|
295
|
-
console.warn("1. Re-reading current file state");
|
|
296
|
-
console.warn("2. Checking for changes by others");
|
|
297
|
-
console.warn("3. Re-running /research if needed");
|
|
298
|
-
}
|
|
104
|
+
git fetch origin
|
|
105
|
+
git rebase origin/main
|
|
299
106
|
```
|
|
300
107
|
|
|
301
|
-
|
|
108
|
+
## Report Status
|
|
302
109
|
|
|
303
110
|
```
|
|
304
|
-
|
|
305
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
111
|
+
Resuming: $ARGUMENTS
|
|
306
112
|
|
|
307
|
-
|
|
308
|
-
|
|
113
|
+
Branch: [branch]
|
|
114
|
+
Commit: [hash]
|
|
115
|
+
Handoff: [date] ([age])
|
|
309
116
|
|
|
310
|
-
|
|
311
|
-
-
|
|
312
|
-
-
|
|
117
|
+
Progress:
|
|
118
|
+
- [x] [completed]
|
|
119
|
+
- [x] [completed]
|
|
120
|
+
- [ ] [in progress] <- resume here
|
|
121
|
+
- [ ] [remaining]
|
|
313
122
|
|
|
314
|
-
|
|
315
|
-
1. Check for merge conflicts: git merge --no-commit main
|
|
316
|
-
2. Re-read key files to refresh context
|
|
317
|
-
3. Update plan if approach changed
|
|
123
|
+
Next: [from handoff resume instructions]
|
|
318
124
|
```
|
|
319
125
|
|
|
320
|
-
##
|
|
126
|
+
## Continue Work
|
|
321
127
|
|
|
322
|
-
|
|
128
|
+
Mark in progress if not already:
|
|
323
129
|
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
bd_reserve({ paths: filesToEdit, ttl: 600, reason: "Resuming $ARGUMENTS" });
|
|
130
|
+
```bash
|
|
131
|
+
bd update $ARGUMENTS --status in_progress
|
|
327
132
|
```
|
|
328
133
|
|
|
329
|
-
|
|
134
|
+
Then continue with implementation:
|
|
330
135
|
|
|
331
136
|
```
|
|
332
|
-
╔══════════════════════════════════════════════════════════════════════════╗
|
|
333
|
-
║ RESUMING: $ARGUMENTS ║
|
|
334
|
-
╠══════════════════════════════════════════════════════════════════════════╣
|
|
335
|
-
|
|
336
|
-
TASK INFO
|
|
337
|
-
━━━━━━━━━
|
|
338
|
-
Title: [from bead]
|
|
339
|
-
Priority: [P0-P4]
|
|
340
|
-
Status: In Progress
|
|
341
|
-
Created: [date]
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
CONTEXT SOURCES
|
|
345
|
-
━━━━━━━━━━━━━━━
|
|
346
|
-
Source │ Status │ Age
|
|
347
|
-
────────────────────┼────────┼────────
|
|
348
|
-
Handoff │ ✓ │ 2 days
|
|
349
|
-
Previous Session │ ✓ │ 2 days
|
|
350
|
-
Spec │ ✓ │ -
|
|
351
|
-
Plan │ ✓ │ -
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
PREVIOUS SESSION SUMMARY
|
|
355
|
-
━━━━━━━━━━━━━━━━━━━━━━━━
|
|
356
|
-
Session: ses_abc123 (2 days ago)
|
|
357
|
-
Duration: 45 min
|
|
358
|
-
Messages: 34
|
|
359
|
-
Focus: Implementing auth middleware
|
|
360
|
-
|
|
361
|
-
Key Actions:
|
|
362
|
-
- Created AuthMiddleware class
|
|
363
|
-
- Added token validation
|
|
364
|
-
- Stopped at: refresh token logic
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
PROGRESS
|
|
368
|
-
━━━━━━━━
|
|
369
|
-
[x] Set up project structure
|
|
370
|
-
[x] Create base service class
|
|
371
|
-
[x] Add authentication logic
|
|
372
|
-
[ ] Implement refresh tokens ← RESUME HERE
|
|
373
|
-
[ ] Add rate limiting
|
|
374
|
-
[ ] Write tests
|
|
375
|
-
[ ] Update documentation
|
|
376
|
-
|
|
377
|
-
Completed: 3/7 (43%)
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
GIT STATE
|
|
381
|
-
━━━━━━━━━
|
|
382
|
-
Branch: feature/auth
|
|
383
|
-
Commit: abc1234 "feat: add auth middleware"
|
|
384
|
-
Status: Clean ✓
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
RESUME INSTRUCTIONS
|
|
388
|
-
━━━━━━━━━━━━━━━━━━━
|
|
389
|
-
From handoff:
|
|
390
|
-
|
|
391
|
-
"Left off implementing refresh token rotation. The TokenService
|
|
392
|
-
is ready but needs the rotateToken() method. See TODO in
|
|
393
|
-
src/auth/token-service.ts:45. Tests are set up but empty."
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
FILES TO MODIFY
|
|
397
|
-
━━━━━━━━━━━━━━━
|
|
398
|
-
src/auth/token-service.ts (add rotateToken method)
|
|
399
|
-
src/auth/token-service.test.ts (add tests)
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
FILE LOCKS ACQUIRED
|
|
403
|
-
━━━━━━━━━━━━━━━━━━━
|
|
404
|
-
✓ src/auth/token-service.ts (10 min)
|
|
405
|
-
✓ src/auth/token-service.test.ts (10 min)
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
BLOCKERS
|
|
409
|
-
━━━━━━━━
|
|
410
|
-
[If any blockers from handoff:]
|
|
411
|
-
- Waiting on API spec for refresh endpoint (ask be-agent)
|
|
412
|
-
|
|
413
|
-
[If no blockers:]
|
|
414
|
-
No known blockers
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
READY TO CONTINUE
|
|
418
|
-
━━━━━━━━━━━━━━━━━
|
|
419
|
-
|
|
420
|
-
Load skill: skill({ name: "executing-plans" })
|
|
421
|
-
|
|
422
|
-
Then continue with:
|
|
423
137
|
/implement $ARGUMENTS
|
|
424
|
-
|
|
425
|
-
Or if you need to re-orient:
|
|
426
|
-
- Read src/auth/token-service.ts to see current state
|
|
427
|
-
- Check plan.md for detailed steps
|
|
428
|
-
|
|
429
|
-
╚══════════════════════════════════════════════════════════════════════════╝
|
|
430
|
-
```
|
|
431
|
-
|
|
432
|
-
## Phase 11: Determine Next Action
|
|
433
|
-
|
|
434
|
-
Based on state, recommend action:
|
|
435
|
-
|
|
436
|
-
```typescript
|
|
437
|
-
const nextAction = determineNextAction({
|
|
438
|
-
hasSpec: !!spec,
|
|
439
|
-
hasResearch: !!research,
|
|
440
|
-
hasPlan: !!plan,
|
|
441
|
-
planProgress: calculateProgress(plan),
|
|
442
|
-
hasBlockers: blockers.length > 0,
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
switch (nextAction) {
|
|
446
|
-
case "NEEDS_SPEC":
|
|
447
|
-
return "/create $ARGUMENTS - Add specification";
|
|
448
|
-
case "NEEDS_RESEARCH":
|
|
449
|
-
return "/research $ARGUMENTS - Research required";
|
|
450
|
-
case "NEEDS_PLAN":
|
|
451
|
-
return "/plan $ARGUMENTS - Create implementation plan";
|
|
452
|
-
case "CONTINUE_IMPLEMENTATION":
|
|
453
|
-
return "/implement $ARGUMENTS - Continue building";
|
|
454
|
-
case "BLOCKED":
|
|
455
|
-
return "Address blockers first, then /implement";
|
|
456
|
-
case "READY_TO_FINISH":
|
|
457
|
-
return "/finish $ARGUMENTS - Complete and close";
|
|
458
|
-
}
|
|
459
|
-
```
|
|
460
|
-
|
|
461
|
-
**Decision Table:**
|
|
462
|
-
|
|
463
|
-
| State | Action |
|
|
464
|
-
| ----------------------------- | ----------------------- |
|
|
465
|
-
| No spec.md | `/create $ARGUMENTS` |
|
|
466
|
-
| No research.md (complex task) | `/research $ARGUMENTS` |
|
|
467
|
-
| No plan.md | `/plan $ARGUMENTS` |
|
|
468
|
-
| Plan < 100% complete | `/implement $ARGUMENTS` |
|
|
469
|
-
| Plan 100% + tests pass | `/finish $ARGUMENTS` |
|
|
470
|
-
| Has blockers | Address blockers first |
|
|
471
|
-
|
|
472
|
-
## Error Recovery
|
|
473
|
-
|
|
474
|
-
### No Bead Found
|
|
475
|
-
|
|
476
|
-
```
|
|
477
|
-
ERROR: Bead not found
|
|
478
|
-
|
|
479
|
-
Possible causes:
|
|
480
|
-
1. Typo in bead ID
|
|
481
|
-
2. Bead was closed/deleted
|
|
482
|
-
3. Using wrong project
|
|
483
|
-
|
|
484
|
-
Check: bd_ls({ status: "all", limit: 20, offset: 0 })
|
|
485
|
-
```
|
|
486
|
-
|
|
487
|
-
### No Session Context
|
|
488
|
-
|
|
489
138
|
```
|
|
490
|
-
WARNING: No previous session found for this bead
|
|
491
139
|
|
|
492
|
-
|
|
493
|
-
Context may be limited.
|
|
140
|
+
Or if you need to re-plan:
|
|
494
141
|
|
|
495
|
-
Recommendation: Read key files manually before continuing.
|
|
496
142
|
```
|
|
497
|
-
|
|
498
|
-
### Corrupted Handoff
|
|
499
|
-
|
|
143
|
+
/plan $ARGUMENTS
|
|
500
144
|
```
|
|
501
|
-
ERROR: Handoff file is corrupted or incomplete
|
|
502
145
|
|
|
503
|
-
|
|
504
|
-
- Progress checklist
|
|
505
|
-
- Resume instructions
|
|
506
|
-
|
|
507
|
-
Fallback: Using plan.md for progress tracking
|
|
508
|
-
```
|
|
146
|
+
## If Context Is Too Stale
|
|
509
147
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
After resume, the loaded skill will guide execution:
|
|
513
|
-
|
|
514
|
-
```typescript
|
|
515
|
-
skill({ name: "executing-plans" });
|
|
516
|
-
```
|
|
148
|
+
If more than a week old or significant changes happened:
|
|
517
149
|
|
|
518
|
-
|
|
150
|
+
1. Re-read key files to refresh understanding
|
|
151
|
+
2. Check if the approach in plan.md is still valid
|
|
152
|
+
3. Consider running `/research $ARGUMENTS` again if external factors changed
|
|
519
153
|
|
|
520
|
-
|
|
521
|
-
- Progress is tracked in plan.md
|
|
522
|
-
- Handoff is created before context limit
|
|
154
|
+
Don't blindly follow an outdated plan. Verify it still makes sense.
|
|
@@ -25,7 +25,7 @@ bd_ls({ status: "in_progress", limit: 10, offset: 0 });
|
|
|
25
25
|
bd_ls({ status: "ready", limit: 10, offset: 0 });
|
|
26
26
|
bd_inbox({ n: 5, unread: true, global: true });
|
|
27
27
|
bd_doctor({ reason: "Health check" });
|
|
28
|
-
bd_reservations(
|
|
28
|
+
bd_reservations();
|
|
29
29
|
|
|
30
30
|
// Sessions
|
|
31
31
|
list_sessions({ project: "current", since: "today", limit: 5, _: true });
|
|
@@ -112,9 +112,9 @@ IN PROGRESS
|
|
|
112
112
|
━━━━━━━━━━━
|
|
113
113
|
ID │ Priority │ Title │ Agent │ Age
|
|
114
114
|
─────────┼──────────┼──────────────────────────┼──────────┼────────
|
|
115
|
-
bd-abc12 │ P0 │ Fix auth regression │
|
|
116
|
-
bd-def34 │ P1 │ Add user dashboard │
|
|
117
|
-
bd-ghi56 │ P2 │ Refactor logging │
|
|
115
|
+
bd-abc12 │ P0 │ Fix auth regression │ build │ 2h
|
|
116
|
+
bd-def34 │ P1 │ Add user dashboard │ build │ 1d
|
|
117
|
+
bd-ghi56 │ P2 │ Refactor logging │ build │ 3h
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
READY TO START
|
|
@@ -133,9 +133,9 @@ MESSAGES
|
|
|
133
133
|
|
|
134
134
|
From │ Subject │ Time
|
|
135
135
|
────────────┼──────────────────────────────────┼────────
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
build-1 │ Need API spec for dashboard │ 2h ago
|
|
137
|
+
review │ Tests failing on staging │ 4h ago
|
|
138
|
+
build-2 │ Migration complete │ 1d ago
|
|
139
139
|
|
|
140
140
|
[If no messages:]
|
|
141
141
|
📭 No unread messages
|
|
@@ -148,8 +148,8 @@ FILE LOCKS
|
|
|
148
148
|
|
|
149
149
|
Path │ Owner │ Expires
|
|
150
150
|
───────────────────────────────┼───────────┼─────────
|
|
151
|
-
src/auth/service.ts │
|
|
152
|
-
src/components/Dashboard.tsx │
|
|
151
|
+
src/auth/service.ts │ build │ 8m
|
|
152
|
+
src/components/Dashboard.tsx │ build │ 15m
|
|
153
153
|
|
|
154
154
|
[If no locks:]
|
|
155
155
|
🔓 No active file locks
|
|
@@ -215,7 +215,7 @@ REQUIRED ACTIONS
|
|
|
215
215
|
━━━━━━━━━━━━━━━━
|
|
216
216
|
Priority │ Action │ Command
|
|
217
217
|
─────────┼─────────────────────────────────────┼────────────────────
|
|
218
|
-
HIGH │ Reply to
|
|
218
|
+
HIGH │ Reply to build-1 question │ bd_msg(...)
|
|
219
219
|
HIGH │ Add plan for bd-ghi56 │ /plan bd-ghi56
|
|
220
220
|
MEDIUM │ Review 2 stale tasks │ /triage --stale
|
|
221
221
|
LOW │ Push 2 local commits │ git push
|
|
@@ -332,7 +332,7 @@ RECOMMENDED NEXT STEPS
|
|
|
332
332
|
Based on current status:
|
|
333
333
|
|
|
334
334
|
1. High Priority Messages:
|
|
335
|
-
→ Reply to
|
|
335
|
+
→ Reply to build-1: bd_msg({ to: "build-1", subj: "Re: API spec", body: "..." })
|
|
336
336
|
|
|
337
337
|
2. Continue In-Progress Work:
|
|
338
338
|
→ /implement bd-abc12 (P0, 2h old)
|