opencodekit 0.16.7 → 0.16.9
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/command/plan.md +30 -30
- package/dist/template/.opencode/command/review-codebase.md +2 -2
- package/dist/template/.opencode/command/start.md +3 -3
- package/dist/template/.opencode/command/status.md +14 -14
- package/dist/template/.opencode/command/ui-review.md +1 -1
- package/dist/template/.opencode/command/verify.md +3 -3
- package/dist/template/.opencode/memory/_templates/prd.md +1 -1
- package/dist/template/.opencode/opencode.json +65 -1
- package/dist/template/.opencode/plugin/compaction.ts +86 -80
- package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +5 -5
- package/dist/template/.opencode/skill/gemini-large-context/SKILL.md +2 -2
- package/dist/template/.opencode/skill/memory-system/SKILL.md +1 -1
- package/dist/template/.opencode/skill/prd/SKILL.md +1 -1
- package/dist/template/.opencode/skill/prd-task/SKILL.md +2 -2
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +1 -1
- package/dist/template/.opencode/skill/source-code-research/SKILL.md +7 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -759,7 +759,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
759
759
|
// package.json
|
|
760
760
|
var package_default = {
|
|
761
761
|
name: "opencodekit",
|
|
762
|
-
version: "0.16.
|
|
762
|
+
version: "0.16.9",
|
|
763
763
|
description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
764
764
|
keywords: ["agents", "cli", "mcp", "opencode", "opencodekit", "template"],
|
|
765
765
|
license: "MIT",
|
|
@@ -292,24 +292,24 @@ PARENT=$ARGUMENTS
|
|
|
292
292
|
|
|
293
293
|
# Task 1 (no blockers - starts immediately)
|
|
294
294
|
br create "[Task 1 title]" --type task --priority 2
|
|
295
|
-
# Capture:
|
|
295
|
+
# Capture: br-xxx1
|
|
296
296
|
|
|
297
297
|
# Link to parent
|
|
298
|
-
br dep add
|
|
298
|
+
br dep add br-xxx1 $PARENT
|
|
299
299
|
|
|
300
300
|
# Task 2 (blocked by Task 1)
|
|
301
301
|
br create "[Task 2 title]" --type task --priority 2
|
|
302
|
-
# Capture:
|
|
302
|
+
# Capture: br-xxx2
|
|
303
303
|
|
|
304
|
-
br dep add
|
|
305
|
-
br dep add
|
|
304
|
+
br dep add br-xxx2 $PARENT
|
|
305
|
+
br dep add br-xxx2 br-xxx1 # br-xxx2 blocked by br-xxx1
|
|
306
306
|
|
|
307
307
|
# Task 3 (blocked by Task 2)
|
|
308
308
|
br create "[Task 3 title]" --type task --priority 2
|
|
309
|
-
# Capture:
|
|
309
|
+
# Capture: br-xxx3
|
|
310
310
|
|
|
311
|
-
br dep add
|
|
312
|
-
br dep add
|
|
311
|
+
br dep add br-xxx3 $PARENT
|
|
312
|
+
br dep add br-xxx3 br-xxx2 # br-xxx3 blocked by br-xxx2
|
|
313
313
|
```
|
|
314
314
|
|
|
315
315
|
### Create Subtasks (for complex tasks)
|
|
@@ -317,15 +317,15 @@ br dep add bd-xxx3 bd-xxx2 # bd-xxx3 blocked by bd-xxx2
|
|
|
317
317
|
```bash
|
|
318
318
|
# For Task 2, create subtasks:
|
|
319
319
|
br create "[Subtask 2.1 title]" --type subtask --priority 2
|
|
320
|
-
# Capture:
|
|
320
|
+
# Capture: br-xxx2.1
|
|
321
321
|
|
|
322
|
-
br dep add
|
|
322
|
+
br dep add br-xxx2.1 br-xxx2
|
|
323
323
|
|
|
324
324
|
br create "[Subtask 2.2 title]" --type subtask --priority 2
|
|
325
|
-
# Capture:
|
|
325
|
+
# Capture: br-xxx2.2
|
|
326
326
|
|
|
327
|
-
br dep add
|
|
328
|
-
br dep add
|
|
327
|
+
br dep add br-xxx2.2 br-xxx2
|
|
328
|
+
br dep add br-xxx2.2 br-xxx2.1 # Sequential dependency
|
|
329
329
|
```
|
|
330
330
|
|
|
331
331
|
### Verify Hierarchy
|
|
@@ -351,11 +351,11 @@ Write `.beads/artifacts/$ARGUMENTS/plan.md`:
|
|
|
351
351
|
```
|
|
352
352
|
|
|
353
353
|
$ARGUMENTS (Epic/Task)
|
|
354
|
-
├──
|
|
355
|
-
├──
|
|
356
|
-
│ ├──
|
|
357
|
-
│ └──
|
|
358
|
-
└──
|
|
354
|
+
├── br-xxx1: [Title] [S] ← READY
|
|
355
|
+
├── br-xxx2: [Title] [M] → blocked by br-xxx1
|
|
356
|
+
│ ├── br-xxx2.1: [Subtask] [S]
|
|
357
|
+
│ └── br-xxx2.2: [Subtask] [S] → blocked by br-xxx2.1
|
|
358
|
+
└── br-xxx3: [Title] [S] → blocked by br-xxx2
|
|
359
359
|
|
|
360
360
|
```
|
|
361
361
|
|
|
@@ -363,7 +363,7 @@ $ARGUMENTS (Epic/Task)
|
|
|
363
363
|
|
|
364
364
|
## Task 1: [Title] [S]
|
|
365
365
|
|
|
366
|
-
**Bead:**
|
|
366
|
+
**Bead:** br-xxx1
|
|
367
367
|
**Estimate:** ~10 tool calls (30 min)
|
|
368
368
|
**Blocked by:** None
|
|
369
369
|
|
|
@@ -380,7 +380,7 @@ $ARGUMENTS (Epic/Task)
|
|
|
380
380
|
|
|
381
381
|
## Task 2: [Title] [M]
|
|
382
382
|
|
|
383
|
-
**Bead:**
|
|
383
|
+
**Bead:** br-xxx2
|
|
384
384
|
**Estimate:** ~30 tool calls (1-2 hours)
|
|
385
385
|
**Blocked by:** Task 1
|
|
386
386
|
|
|
@@ -388,7 +388,7 @@ $ARGUMENTS (Epic/Task)
|
|
|
388
388
|
|
|
389
389
|
### 2.1: [Subtask Title] [S]
|
|
390
390
|
|
|
391
|
-
**Bead:**
|
|
391
|
+
**Bead:** br-xxx2.1
|
|
392
392
|
**Files:** `src/bar.ts`
|
|
393
393
|
**Changes:**
|
|
394
394
|
- [ ] [Specific change]
|
|
@@ -397,7 +397,7 @@ $ARGUMENTS (Epic/Task)
|
|
|
397
397
|
|
|
398
398
|
### 2.2: [Subtask Title] [S]
|
|
399
399
|
|
|
400
|
-
**Bead:**
|
|
400
|
+
**Bead:** br-xxx2.2
|
|
401
401
|
**Blocked by:** 2.1
|
|
402
402
|
**Files:** `src/baz.ts`
|
|
403
403
|
**Changes:**
|
|
@@ -409,7 +409,7 @@ $ARGUMENTS (Epic/Task)
|
|
|
409
409
|
|
|
410
410
|
## Task 3: [Title] [S]
|
|
411
411
|
|
|
412
|
-
**Bead:**
|
|
412
|
+
**Bead:** br-xxx3
|
|
413
413
|
**Estimate:** ~10 tool calls (30 min)
|
|
414
414
|
**Blocked by:** Task 2
|
|
415
415
|
|
|
@@ -517,19 +517,19 @@ Approach: [Selected option]
|
|
|
517
517
|
Total estimate: ~N tool calls ([X-Y hours])
|
|
518
518
|
|
|
519
519
|
Hierarchy:
|
|
520
|
-
├──
|
|
521
|
-
├──
|
|
522
|
-
│ ├──
|
|
523
|
-
│ └──
|
|
524
|
-
└──
|
|
520
|
+
├── br-xxx1: [Title] [S] ← READY
|
|
521
|
+
├── br-xxx2: [Title] [M] → blocked by br-xxx1
|
|
522
|
+
│ ├── br-xxx2.1: [Subtask] [S]
|
|
523
|
+
│ └── br-xxx2.2: [Subtask] [S]
|
|
524
|
+
└── br-xxx3: [Title] [S] → blocked by br-xxx2
|
|
525
525
|
|
|
526
526
|
Artifacts:
|
|
527
527
|
├── .beads/artifacts/$ARGUMENTS/design.md
|
|
528
528
|
└── .beads/artifacts/$ARGUMENTS/plan.md
|
|
529
529
|
|
|
530
|
-
Ready to start:
|
|
530
|
+
Ready to start: br-xxx1
|
|
531
531
|
|
|
532
|
-
Next: /start
|
|
532
|
+
Next: /start br-xxx1
|
|
533
533
|
```
|
|
534
534
|
|
|
535
535
|
---
|
|
@@ -35,7 +35,7 @@ Parse `$ARGUMENTS` to determine what to review:
|
|
|
35
35
|
| Input | Scope | How to Get Code |
|
|
36
36
|
| ------------------------ | ---------------------- | ------------------------------------------- |
|
|
37
37
|
| File/directory path | That path only | `read` or `glob` + `read` |
|
|
38
|
-
| Bead ID (e.g., `
|
|
38
|
+
| Bead ID (e.g., `br-123`) | Implementation vs spec | `br show` then `git diff` from spec |
|
|
39
39
|
| PR number (e.g., `#45`) | PR changes | `gh pr diff 45` |
|
|
40
40
|
| `all` or empty | Recent changes | `git diff main...HEAD` or `git diff HEAD~5` |
|
|
41
41
|
|
|
@@ -200,7 +200,7 @@ Skip creating beads for Minor issues (just report them).
|
|
|
200
200
|
/review-codebase src/auth/login.ts
|
|
201
201
|
|
|
202
202
|
# Review against a bead spec
|
|
203
|
-
/review-codebase
|
|
203
|
+
/review-codebase br-feature-auth
|
|
204
204
|
|
|
205
205
|
# Review a PR
|
|
206
206
|
/review-codebase #45
|
|
@@ -127,9 +127,9 @@ git checkout -b "$BRANCH_NAME" 2>/dev/null || echo "Branch already exists or alr
|
|
|
127
127
|
**Branch naming convention:**
|
|
128
128
|
| Parent Branch | Bead Type | Example |
|
|
129
129
|
|---------------|-----------|---------|
|
|
130
|
-
| main | bug | `main/fix/
|
|
131
|
-
| develop | feature | `develop/feat/
|
|
132
|
-
| release-v2 | chore | `release-v2/chore/
|
|
130
|
+
| main | bug | `main/fix/br-a1b2-login-error` |
|
|
131
|
+
| develop | feature | `develop/feat/br-c3d4-user-auth` |
|
|
132
|
+
| release-v2 | chore | `release-v2/chore/br-e5f6-update-deps` |
|
|
133
133
|
|
|
134
134
|
### Option B: Git Worktree (if --worktree flag)
|
|
135
135
|
|
|
@@ -112,18 +112,18 @@ IN PROGRESS
|
|
|
112
112
|
━━━━━━━━━━━
|
|
113
113
|
ID │ Priority │ Title │ Assignee │ Age
|
|
114
114
|
─────────┼──────────┼──────────────────────────┼──────────┼────────
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
br-abc12 │ P0 │ Fix auth regression │ user │ 2h
|
|
116
|
+
br-def34 │ P1 │ Add user dashboard │ user │ 1d
|
|
117
|
+
br-ghi56 │ P2 │ Refactor logging │ user │ 3h
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
READY TO START
|
|
121
121
|
━━━━━━━━━━━━━━
|
|
122
122
|
ID │ Priority │ Title │ Blocked By
|
|
123
123
|
─────────┼──────────┼──────────────────────────┼───────────
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
br-xyz11 │ P1 │ Add notifications │ -
|
|
125
|
+
br-xyz22 │ P2 │ Update API docs │ -
|
|
126
|
+
br-xyz33 │ P2 │ Add analytics │ br-abc12
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
GIT STATUS
|
|
@@ -164,11 +164,11 @@ TASK COMPLIANCE
|
|
|
164
164
|
[Check .beads/artifacts/<id>/ for each in-progress task]
|
|
165
165
|
|
|
166
166
|
Complete (spec + plan):
|
|
167
|
-
✓
|
|
168
|
-
✓
|
|
167
|
+
✓ br-abc12: Fix auth regression
|
|
168
|
+
✓ br-def34: Add user dashboard
|
|
169
169
|
|
|
170
170
|
Incomplete:
|
|
171
|
-
⚠
|
|
171
|
+
⚠ br-ghi56: Missing plan.md
|
|
172
172
|
|
|
173
173
|
Compliance: 2/3 (67%)
|
|
174
174
|
|
|
@@ -186,7 +186,7 @@ REQUIRED ACTIONS
|
|
|
186
186
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
187
187
|
Priority │ Action │ Command
|
|
188
188
|
─────────┼─────────────────────────────────────┼────────────────────
|
|
189
|
-
HIGH │ Add plan for
|
|
189
|
+
HIGH │ Add plan for br-ghi56 │ /plan br-ghi56
|
|
190
190
|
MEDIUM │ Review 2 stale tasks │ /triage --stale
|
|
191
191
|
LOW │ Push 2 local commits │ git push
|
|
192
192
|
|
|
@@ -300,7 +300,7 @@ staging-deploy │ ✓ Passing │ 1d ago
|
|
|
300
300
|
|
|
301
301
|
Failed Check: feature/auth
|
|
302
302
|
└── Jest tests: 2 failures in auth.test.ts
|
|
303
|
-
└── Fix: /implement
|
|
303
|
+
└── Fix: /implement br-abc12 (related task)
|
|
304
304
|
```
|
|
305
305
|
|
|
306
306
|
## Examples
|
|
@@ -324,13 +324,13 @@ RECOMMENDED NEXT STEPS
|
|
|
324
324
|
Based on current status:
|
|
325
325
|
|
|
326
326
|
1. High Priority Messages:
|
|
327
|
-
→ Reply to build-1:
|
|
327
|
+
→ Reply to build-1: br msg --to "build-1" --subj "Re: API spec" --body "..."
|
|
328
328
|
|
|
329
329
|
2. Continue In-Progress Work:
|
|
330
|
-
→ /implement
|
|
330
|
+
→ /implement br-abc12 (P0, 2h old)
|
|
331
331
|
|
|
332
332
|
3. Start Ready Tasks:
|
|
333
|
-
→ /start
|
|
333
|
+
→ /start br-xyz11 (P1, unblocked)
|
|
334
334
|
|
|
335
335
|
4. Session Maintenance:
|
|
336
336
|
→ Consider /handoff if switching tasks
|
|
@@ -302,7 +302,7 @@ br dep add <task-id> <bead-id>
|
|
|
302
302
|
/ui-review src/components/Card.tsx --responsive
|
|
303
303
|
|
|
304
304
|
# Review and link to bead
|
|
305
|
-
/ui-review screenshots/dashboard.png --bead=
|
|
305
|
+
/ui-review screenshots/dashboard.png --bead=br-feature-123
|
|
306
306
|
|
|
307
307
|
# Full review with dark mode
|
|
308
308
|
/ui-review app/page.tsx --responsive --dark-mode
|
|
@@ -287,13 +287,13 @@ Cannot proceed until:
|
|
|
287
287
|
|
|
288
288
|
```bash
|
|
289
289
|
# Full verification
|
|
290
|
-
/verify
|
|
290
|
+
/verify br-feature-auth
|
|
291
291
|
|
|
292
292
|
# Quick check (gates only)
|
|
293
|
-
/verify
|
|
293
|
+
/verify br-feature-auth --quick
|
|
294
294
|
|
|
295
295
|
# Verify and auto-fix where possible
|
|
296
|
-
/verify
|
|
296
|
+
/verify br-feature-auth --fix
|
|
297
297
|
```
|
|
298
298
|
|
|
299
299
|
---
|
|
@@ -167,11 +167,34 @@
|
|
|
167
167
|
"options": {
|
|
168
168
|
"thinking": {
|
|
169
169
|
"type": "enabled",
|
|
170
|
-
"budgetTokens":
|
|
170
|
+
"budgetTokens": 8192,
|
|
171
|
+
"reasoning_effort": "high"
|
|
171
172
|
},
|
|
172
173
|
"interleaved": {
|
|
173
174
|
"field": "reasoning_content"
|
|
174
175
|
}
|
|
176
|
+
},
|
|
177
|
+
"variants": {
|
|
178
|
+
"high": {
|
|
179
|
+
"options": {
|
|
180
|
+
"thinkingBudget": 16384,
|
|
181
|
+
"type": "enabled",
|
|
182
|
+
"reasoning_effort": "high"
|
|
183
|
+
},
|
|
184
|
+
"interleaved": {
|
|
185
|
+
"field": "reasoning_content"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"max": {
|
|
189
|
+
"options": {
|
|
190
|
+
"thinkingBudget": 32768,
|
|
191
|
+
"type": "enabled",
|
|
192
|
+
"reasoning_effort": "high"
|
|
193
|
+
},
|
|
194
|
+
"interleaved": {
|
|
195
|
+
"field": "reasoning_content"
|
|
196
|
+
}
|
|
197
|
+
}
|
|
175
198
|
}
|
|
176
199
|
}
|
|
177
200
|
}
|
|
@@ -355,6 +378,47 @@
|
|
|
355
378
|
"top_p": 0.95
|
|
356
379
|
},
|
|
357
380
|
"reasoning": true
|
|
381
|
+
},
|
|
382
|
+
"kimi-k2.5-free": {
|
|
383
|
+
"limit": {
|
|
384
|
+
"context": 262144,
|
|
385
|
+
"output": 32768
|
|
386
|
+
},
|
|
387
|
+
"temperature": true,
|
|
388
|
+
"reasoning": true,
|
|
389
|
+
"tool_call": true,
|
|
390
|
+
"options": {
|
|
391
|
+
"thinking": {
|
|
392
|
+
"type": "enabled",
|
|
393
|
+
"budgetTokens": 8192,
|
|
394
|
+
"reasoning_effort": "high"
|
|
395
|
+
},
|
|
396
|
+
"interleaved": {
|
|
397
|
+
"field": "reasoning_content"
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
"variants": {
|
|
401
|
+
"high": {
|
|
402
|
+
"options": {
|
|
403
|
+
"thinkingBudget": 16384,
|
|
404
|
+
"type": "enabled",
|
|
405
|
+
"reasoning_effort": "high"
|
|
406
|
+
},
|
|
407
|
+
"interleaved": {
|
|
408
|
+
"field": "reasoning_content"
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
"max": {
|
|
412
|
+
"options": {
|
|
413
|
+
"thinkingBudget": 32768,
|
|
414
|
+
"type": "enabled",
|
|
415
|
+
"reasoning_effort": "high"
|
|
416
|
+
},
|
|
417
|
+
"interleaved": {
|
|
418
|
+
"field": "reasoning_content"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
358
422
|
}
|
|
359
423
|
}
|
|
360
424
|
},
|
|
@@ -20,83 +20,89 @@
|
|
|
20
20
|
import type { Plugin } from "@opencode-ai/plugin";
|
|
21
21
|
|
|
22
22
|
export const CompactionPlugin: Plugin = async ({ $, directory }) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
23
|
+
const MEMORY_DIR = `${directory}/.opencode/memory`;
|
|
24
|
+
const HANDOFF_DIR = `${MEMORY_DIR}/handoffs`;
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
"experimental.session.compacting": async (input, output) => {
|
|
28
|
+
// 1. Load session context (CONTINUITY.md pattern) - HIGHEST PRIORITY
|
|
29
|
+
let sessionContext = "";
|
|
30
|
+
try {
|
|
31
|
+
const sessionFile = `${MEMORY_DIR}/session-context.md`;
|
|
32
|
+
const content = await $`cat ${sessionFile} 2>/dev/null`.text();
|
|
33
|
+
if (content.trim()) {
|
|
34
|
+
sessionContext = `\n## Session Continuity (Compaction-Safe)\n${content}`;
|
|
35
|
+
}
|
|
36
|
+
} catch {
|
|
37
|
+
// No session context yet
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 2. Load project memory files
|
|
41
|
+
let memoryContext = "";
|
|
42
|
+
try {
|
|
43
|
+
const memoryFiles =
|
|
44
|
+
await $`find ${MEMORY_DIR}/project -name '*.md' -type f 2>/dev/null | head -10`.quiet();
|
|
45
|
+
if (memoryFiles.stdout) {
|
|
46
|
+
const files = memoryFiles.stdout.toString().trim().split("\n");
|
|
47
|
+
for (const file of files) {
|
|
48
|
+
const content = await $`cat ${file}`.text();
|
|
49
|
+
if (content.trim() && !content.includes("<!-- ")) {
|
|
50
|
+
const name = file.split("/").pop()?.replace(".md", "");
|
|
51
|
+
memoryContext += `\n## Project ${name}\n${content}`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
} catch {
|
|
56
|
+
// Memory dir doesn't exist or other error
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// 3. Inject beads in-progress state
|
|
60
|
+
let beadsContext = "";
|
|
61
|
+
try {
|
|
62
|
+
const result =
|
|
63
|
+
await $`cd ${directory} && br list --status in_progress --json 2>/dev/null`.quiet();
|
|
64
|
+
if (result.stdout) {
|
|
65
|
+
const inProgress = JSON.parse(result.stdout.toString());
|
|
66
|
+
if (inProgress.length > 0) {
|
|
67
|
+
beadsContext = `\n## Active Beads (In Progress)\n${inProgress.map((b: { id: string; title: string }) => `- ${b.id}: ${b.title}`).join("\n")}`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
} catch {
|
|
71
|
+
// Beads not available, skip
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// 4. Load most recent handoff file (session continuity)
|
|
75
|
+
let handoffContext = "";
|
|
76
|
+
try {
|
|
77
|
+
const result =
|
|
78
|
+
await $`ls -t ${HANDOFF_DIR}/*.md 2>/dev/null | head -1`.quiet();
|
|
79
|
+
if (result.stdout) {
|
|
80
|
+
const handoffPath = result.stdout.toString().trim();
|
|
81
|
+
if (handoffPath) {
|
|
82
|
+
const handoffContent = await $`cat ${handoffPath}`.text();
|
|
83
|
+
handoffContext = `\n## Previous Session Handoff\n\n${handoffContent}\n\n**IMPORTANT**: Resume work from where previous session left off.`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
} catch {
|
|
87
|
+
// No handoff files, skip
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Inject all context - session context FIRST (most important)
|
|
91
|
+
const allContext = [
|
|
92
|
+
sessionContext,
|
|
93
|
+
beadsContext,
|
|
94
|
+
handoffContext,
|
|
95
|
+
memoryContext,
|
|
96
|
+
]
|
|
97
|
+
.filter(Boolean)
|
|
98
|
+
.join("\n");
|
|
99
|
+
|
|
100
|
+
if (allContext) {
|
|
101
|
+
output.context.push(`## Session Context\n${allContext}\n`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Append workflow-specific rules to OpenCode's default prompt
|
|
105
|
+
output.prompt = `${output.prompt}
|
|
100
106
|
|
|
101
107
|
## Additional Rules for This Workflow
|
|
102
108
|
|
|
@@ -123,7 +129,7 @@ Update session-context.md when:
|
|
|
123
129
|
After compaction: Check session-context.md, ask 1-3 targeted questions if gaps exist.
|
|
124
130
|
|
|
125
131
|
### Beads Workflow
|
|
126
|
-
- PRESERVE: Bead IDs (
|
|
132
|
+
- PRESERVE: Bead IDs (br-xxx format), bead states, in-progress task IDs
|
|
127
133
|
- DROP: Closed/completed beads (already tracked in git)
|
|
128
134
|
|
|
129
135
|
### TodoWrite Items
|
|
@@ -141,6 +147,6 @@ If you discover:
|
|
|
141
147
|
- PRESERVE: File paths (file:line_number), user constraints, decisions, UNCONFIRMED items
|
|
142
148
|
- DROP: Failed attempts, superseded info, verbose tool outputs, exploration dead-ends
|
|
143
149
|
`;
|
|
144
|
-
|
|
145
|
-
|
|
150
|
+
},
|
|
151
|
+
};
|
|
146
152
|
};
|
|
@@ -263,23 +263,23 @@ User: "I want to add a dark mode toggle"
|
|
|
263
263
|
→ skill({ name: "brainstorming" })
|
|
264
264
|
→ Questions about scope, triggers, persistence
|
|
265
265
|
→ Design decisions documented
|
|
266
|
-
→ Output: .beads/artifacts/
|
|
266
|
+
→ Output: .beads/artifacts/br-dark-mode/design.md
|
|
267
267
|
|
|
268
268
|
2. SPECIFICATION
|
|
269
269
|
→ skill({ name: "prd" })
|
|
270
270
|
→ Full PRD with requirements
|
|
271
271
|
→ Tasks section for conversion
|
|
272
|
-
→ Output: .beads/artifacts/
|
|
272
|
+
→ Output: .beads/artifacts/br-dark-mode/prd.md
|
|
273
273
|
|
|
274
274
|
3. TASK CONVERSION
|
|
275
275
|
→ skill({ name: "prd-task" })
|
|
276
276
|
→ JSON task list with dependencies
|
|
277
|
-
→ Output: .beads/artifacts/
|
|
277
|
+
→ Output: .beads/artifacts/br-dark-mode/prd.json
|
|
278
278
|
|
|
279
279
|
4. PLANNING
|
|
280
280
|
→ skill({ name: "writing-plans" })
|
|
281
281
|
→ Bite-sized implementation steps
|
|
282
|
-
→ Output: .beads/artifacts/
|
|
282
|
+
→ Output: .beads/artifacts/br-dark-mode/plan.md
|
|
283
283
|
|
|
284
284
|
5. IMPLEMENTATION
|
|
285
285
|
→ skill({ name: "executing-plans" })
|
|
@@ -291,7 +291,7 @@ User: "I want to add a dark mode toggle"
|
|
|
291
291
|
→ Tests pass: ✓
|
|
292
292
|
→ Lint clean: ✓
|
|
293
293
|
→ Build succeeds: ✓
|
|
294
|
-
→ br close
|
|
294
|
+
→ br close br-dark-mode --reason "Dark mode implemented and verified"
|
|
295
295
|
```
|
|
296
296
|
|
|
297
297
|
---
|
|
@@ -120,11 +120,11 @@ When researching within task boundaries:
|
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
122
|
# 1. Include bead spec in context
|
|
123
|
-
gemini -p "@src/ @.beads/artifacts/
|
|
123
|
+
gemini -p "@src/ @.beads/artifacts/br-xxx/spec.md
|
|
124
124
|
Research implementations matching spec constraints"
|
|
125
125
|
|
|
126
126
|
# 2. Save findings to bead artifacts
|
|
127
|
-
# Write to .beads/artifacts/
|
|
127
|
+
# Write to .beads/artifacts/br-xxx/research.md
|
|
128
128
|
```
|
|
129
129
|
|
|
130
130
|
### Delegating Large Research to Gemini
|
|
@@ -92,7 +92,7 @@ observation({
|
|
|
92
92
|
confidence: "high", // high, medium, low
|
|
93
93
|
files_read: "src/auth.ts, src/middleware.ts", // Files consulted
|
|
94
94
|
files_modified: "src/auth.ts", // Files changed
|
|
95
|
-
bead_id: "
|
|
95
|
+
bead_id: "br-abc123", // Link to task (optional)
|
|
96
96
|
});
|
|
97
97
|
```
|
|
98
98
|
|
|
@@ -15,7 +15,7 @@ The PRD describes WHAT to build and WHY, not HOW or in WHAT ORDER.
|
|
|
15
15
|
|
|
16
16
|
## Beads-Native Output (Recommended)
|
|
17
17
|
|
|
18
|
-
When you are working on a Beads task (you have a bead id like `
|
|
18
|
+
When you are working on a Beads task (you have a bead id like `br-...`), the PRD should live with the task artifacts:
|
|
19
19
|
|
|
20
20
|
- Write PRD to: `.beads/artifacts/<bead-id>/prd.md`
|
|
21
21
|
|
|
@@ -26,7 +26,7 @@ This template uses Beads artifacts (no `.opencode/state`).
|
|
|
26
26
|
|
|
27
27
|
## Workflow
|
|
28
28
|
|
|
29
|
-
1. Input: bead id (`
|
|
29
|
+
1. Input: bead id (`br-...`).
|
|
30
30
|
2. Read `.beads/artifacts/<bead-id>/prd.md`.
|
|
31
31
|
3. Extract tasks from `## Tasks`.
|
|
32
32
|
4. Write `.beads/artifacts/<bead-id>/prd.json`.
|
|
@@ -56,7 +56,7 @@ Write JSON to `.beads/artifacts/<bead-id>/prd.json`.
|
|
|
56
56
|
|
|
57
57
|
```json
|
|
58
58
|
{
|
|
59
|
-
"beadId": "
|
|
59
|
+
"beadId": "br-...",
|
|
60
60
|
"prdName": "<optional-slug>",
|
|
61
61
|
"tasks": [
|
|
62
62
|
{
|
|
@@ -362,13 +362,13 @@ If opensrc doesn't work:
|
|
|
362
362
|
|
|
363
363
|
Source code research complements other tools:
|
|
364
364
|
|
|
365
|
-
| Method
|
|
366
|
-
|
|
|
367
|
-
| **Context7**
|
|
368
|
-
| **codesearch**
|
|
365
|
+
| Method | Best For | Source Code Adds |
|
|
366
|
+
| -------------- | -------------------------- | ------------------------------ |
|
|
367
|
+
| **Context7** | API docs, official guides | Implementation details |
|
|
368
|
+
| **codesearch** | Usage patterns in the wild | Canonical implementation |
|
|
369
369
|
| **grepsearch** | Real-world examples | How library itself works |
|
|
370
|
-
| **Web search**
|
|
371
|
-
| **Codebase**
|
|
370
|
+
| **Web search** | Tutorials, blog posts | Ground truth from source |
|
|
371
|
+
| **Codebase** | Project-specific patterns | How dependencies actually work |
|
|
372
372
|
|
|
373
373
|
**Recommended flow:**
|
|
374
374
|
|
|
@@ -437,7 +437,7 @@ read({
|
|
|
437
437
|
|
|
438
438
|
// 6. Document findings
|
|
439
439
|
write({
|
|
440
|
-
filePath: ".beads/artifacts/
|
|
440
|
+
filePath: ".beads/artifacts/br-xxx/research.md",
|
|
441
441
|
content: `# Zod Async Refinements
|
|
442
442
|
|
|
443
443
|
**Finding:** Async refinements use \`parseAsync()\` not \`parse()\`
|
package/package.json
CHANGED