opencodekit 0.12.2 → 0.12.4

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.
Files changed (33) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +40 -417
  3. package/dist/template/.opencode/agent/build.md +119 -9
  4. package/dist/template/.opencode/agent/planner.md +0 -1
  5. package/dist/template/.opencode/agent/rush.md +81 -19
  6. package/dist/template/.opencode/command/accessibility-check.md +1 -1
  7. package/dist/template/.opencode/command/commit.md +1 -1
  8. package/dist/template/.opencode/command/create.md +68 -441
  9. package/dist/template/.opencode/command/finish.md +82 -252
  10. package/dist/template/.opencode/command/fix-ci.md +52 -247
  11. package/dist/template/.opencode/command/fix-types.md +32 -292
  12. package/dist/template/.opencode/command/fix-ui.md +49 -234
  13. package/dist/template/.opencode/command/fix.md +57 -194
  14. package/dist/template/.opencode/command/handoff.md +66 -243
  15. package/dist/template/.opencode/command/implement.md +67 -231
  16. package/dist/template/.opencode/command/issue.md +42 -190
  17. package/dist/template/.opencode/command/plan.md +86 -442
  18. package/dist/template/.opencode/command/pr.md +3 -1
  19. package/dist/template/.opencode/command/research-and-implement.md +69 -370
  20. package/dist/template/.opencode/command/research.md +72 -197
  21. package/dist/template/.opencode/command/resume.md +70 -438
  22. package/dist/template/.opencode/command/status.md +11 -11
  23. package/dist/template/.opencode/command/triage.md +23 -18
  24. package/dist/template/.opencode/memory/project/commands.md +139 -7
  25. package/dist/template/.opencode/memory/project/gotchas.md +85 -0
  26. package/dist/template/.opencode/opencode.json +556 -510
  27. package/dist/template/.opencode/plugin/beads.ts +181 -16
  28. package/dist/template/.opencode/skill/beads/SKILL.md +15 -0
  29. package/dist/template/.opencode/skill/context-engineering/SKILL.md +94 -0
  30. package/dist/template/.opencode/skill/memory-system/SKILL.md +107 -0
  31. package/dist/template/.opencode/skill/session-management/SKILL.md +111 -0
  32. package/dist/template/.opencode/skill/tool-priority/SKILL.md +115 -0
  33. package/package.json +1 -1
@@ -1,526 +1,170 @@
1
1
  ---
2
- description: Create implementation plan with optional bead decomposition
3
- argument-hint: "<bead-id> [--create-beads] [--parallel]"
2
+ description: Create implementation plan for a bead
3
+ argument-hint: "<bead-id> [--create-beads]"
4
4
  agent: planner
5
5
  ---
6
6
 
7
- # Plan
7
+ # Plan: $ARGUMENTS
8
8
 
9
- **Load skills:**
9
+ You're creating an implementation plan. Design first, then execute.
10
10
 
11
- ```typescript
12
- skill({ name: "beads" }); // For hierarchy and dependencies
13
- skill({ name: "writing-plans" }); // For plan structure
14
- ```
15
-
16
- ## Arguments
17
-
18
- | Argument | Default | Description |
19
- | ---------------- | -------- | ------------------------------------- |
20
- | `<bead-id>` | required | The bead to plan |
21
- | `--create-beads` | false | Create child beads for each plan task |
22
- | `--parallel` | false | Identify parallel execution tracks |
23
-
24
- ## Phase 1: Load Context
25
-
26
- ```typescript
27
- bd_show({ id: "$ARGUMENTS" });
28
- ```
29
-
30
- Read artifacts:
31
-
32
- ```typescript
33
- read({ filePath: ".beads/artifacts/<bead-id>/spec.md" });
34
- read({ filePath: ".beads/artifacts/<bead-id>/research.md" });
35
- read({ filePath: ".beads/artifacts/<bead-id>/design.md" }); // May not exist
36
- ```
37
-
38
- If spec.md missing: "Run `/create <bead-id>` first."
39
- If research.md missing and complexity > M: "Run `/research <bead-id>` first."
40
- If design.md exists: Resume from saved design options.
11
+ ## Load Context
41
12
 
42
- Reserve files while planning:
43
-
44
- ```typescript
45
- bd_reserve({
46
- paths: [
47
- ".beads/artifacts/<bead-id>/design.md",
48
- ".beads/artifacts/<bead-id>/plan.md",
49
- ],
50
- reason: "Planning $ARGUMENTS",
51
- ttl: 1200,
52
- });
13
+ ```bash
14
+ bd show $ARGUMENTS
15
+ cat .beads/artifacts/$ARGUMENTS/spec.md
16
+ cat .beads/artifacts/$ARGUMENTS/research.md 2>/dev/null
53
17
  ```
54
18
 
55
- ## Phase 2: Analyze for Decomposition
19
+ If spec.md missing: "Run `/create $ARGUMENTS` first."
20
+ If complexity > M and no research: "Consider `/research $ARGUMENTS` first."
56
21
 
57
- Before generating options, analyze if this bead should be decomposed:
22
+ ## Analyze For Decomposition
58
23
 
59
- ```
60
- DECOMPOSITION ANALYSIS
61
- ━━━━━━━━━━━━━━━━━━━━━━
24
+ Should this be one bead or multiple?
62
25
 
63
- Bead: <bead-id>
64
- Title: [title from bead]
65
- Current Type: [task/feature/epic]
26
+ **Keep as single bead:**
66
27
 
67
- Complexity Signals:
68
- [✓/✗] Multiple domains (frontend + backend)
69
- [✓/✗] Multiple files in different areas
70
- [✓/✗] Natural phases (setup → implement → test)
71
- [✓/✗] Could benefit from parallel execution
72
- [✓/✗] Estimated > 50 tool calls
28
+ - Single domain (just frontend OR just backend)
29
+ - 2-3 files max
30
+ - ~50 tool calls or less
31
+ - No natural phases
73
32
 
74
- Recommendation: [DECOMPOSE / SINGLE PLAN]
33
+ **Decompose into subtasks:**
75
34
 
76
- If DECOMPOSE: Will create Epic + child beads
77
- If SINGLE PLAN: Will create plan.md with task checklist
78
- ```
35
+ - Crosses domains (frontend + backend)
36
+ - Multiple independent pieces
37
+ - Natural phases (setup → implement → test)
38
+ - Could benefit from parallel agents
79
39
 
80
- If `--create-beads` flag is set, proceed with decomposition.
81
- If complexity warrants decomposition, suggest it:
40
+ If decomposition makes sense, ask: "This would benefit from subtasks. Create child beads?"
82
41
 
83
- ```
84
- This bead would benefit from decomposition into subtasks.
42
+ ## Generate Design Options
85
43
 
86
- Benefits:
87
- • Parallel agent execution
88
- • Better context management
89
- • Clearer progress tracking
44
+ Present 2-3 approaches:
90
45
 
91
- Create child beads? (yes/no)
92
46
  ```
47
+ ## Option A: [Name]
93
48
 
94
- ## Phase 3: Generate Design Options
95
-
96
- Present 2-3 approaches with this format:
97
-
98
- ```markdown
99
- ## Design Options
100
-
101
- ### Option A: [Name]
102
-
103
- **Approach:** [1-2 sentence description]
104
-
105
- **Changes:**
106
-
107
- - `src/foo.ts` - [what changes]
108
- - `src/bar.ts` - [what changes]
49
+ Approach: [1-2 sentences]
109
50
 
110
- **Pros:** [bullet list]
111
- **Cons:** [bullet list]
51
+ Changes:
52
+ - `src/foo.ts` - [what]
53
+ - `src/bar.ts` - [what]
112
54
 
113
- **Estimation:**
114
-
115
- - Tool calls: ~[N] (S=5-20, M=20-50, L=50-100, XL=needs decomposition)
116
- - Files touched: [N]
117
- - Risk: [low/medium/high]
118
-
119
- **Parallelization potential:** [High/Medium/Low]
55
+ Pros: [list]
56
+ Cons: [list]
57
+ Effort: [S/M/L] (~N tool calls)
120
58
 
121
59
  ---
122
60
 
123
- ### Option B: [Name]
61
+ ## Option B: [Name]
124
62
 
125
- [Same format]
63
+ [same format]
126
64
 
127
65
  ---
128
66
 
129
- **Recommendation:** Option [A/B] because [reason].
67
+ Recommendation: Option [A/B] because [reason].
130
68
  ```
131
69
 
132
- Save to `.beads/artifacts/<bead-id>/design.md` with status `Pending Approval`.
133
-
134
- ## Phase 4: Get Approval
135
-
136
- **STOP and wait for human response.**
137
-
138
- ```
139
- Pick an option (A/B/C), modify, or "none" to propose alternatives.
140
- ```
70
+ Save to `.beads/artifacts/$ARGUMENTS/design.md`.
141
71
 
142
- Do not proceed until user confirms.
72
+ **STOP. Wait for user to pick an option.**
143
73
 
144
- ## Phase 5: Create Plan with Task Contracts
74
+ ## Create Plan
145
75
 
146
- After approval, write `.beads/artifacts/<bead-id>/plan.md`:
76
+ After approval, write `.beads/artifacts/$ARGUMENTS/plan.md`:
147
77
 
148
78
  ```markdown
149
- # Implementation Plan: [Title]
79
+ # Plan: [Title]
150
80
 
151
- **Bead:** <bead-id>
152
- **Date:** <date>
153
- **Approach:** [selected option name]
154
- **Estimation:** ~[N] tool calls, [N] files
155
- **Decomposition:** [Yes - child beads created / No - single bead]
156
-
157
- ## Dependency Graph
158
- ```
159
-
160
- [Task 1] ──┬──> [Task 2a] ──┬──> [Task 4]
161
- │ │
162
- └──> [Task 2b] ──┘
163
-
164
- └──> [Task 3] (can run parallel)
165
-
166
- ````
167
-
168
- **Parallel Tracks:**
169
- - Track A: Tasks 1 → 2a → 4
170
- - Track B: Tasks 1 → 2b → 3 (independent after Task 1)
81
+ **Bead:** $ARGUMENTS
82
+ **Approach:** [selected option]
83
+ **Estimate:** ~N tool calls
171
84
 
172
85
  ## Tasks
173
86
 
174
- ### Task 1: [Title]
87
+ ### 1. [Task name]
175
88
 
176
- | Field | Value |
177
- | ------------- | ---------------------------------- |
178
- | **Bead** | [child-bead-id if created] |
179
- | **Files** | `src/foo.ts` |
180
- | **Input** | [What this task receives/needs] |
181
- | **Output** | [What this task produces] |
182
- | **Success** | [Concrete verification criteria] |
183
- | **Rollback** | [How to undo if this fails] |
184
- | **Depends** | None |
185
- | **Effort** | S (~10 tool calls) |
89
+ Files: `src/foo.ts`
90
+ Changes:
186
91
 
187
- **Changes:**
188
- - [ ] [Specific change 1]
189
- - [ ] [Specific change 2]
92
+ - [ ] [specific change]
93
+ - [ ] [specific change]
190
94
 
191
- **Verification:**
192
- ```bash
193
- [Actual command to verify success]
194
- ````
95
+ Verify: `npm test -- foo.test.ts`
195
96
 
196
97
  ---
197
98
 
198
- ### Task 2a: [Title]
99
+ ### 2. [Task name]
199
100
 
200
- | Field | Value |
201
- | ------------ | -------------------------------- |
202
- | **Bead** | [child-bead-id if created] |
203
- | **Files** | `src/bar.ts` |
204
- | **Input** | Output from Task 1 |
205
- | **Output** | [What this produces] |
206
- | **Success** | [Test passes, type checks, etc.] |
207
- | **Rollback** | `git checkout src/bar.ts` |
208
- | **Depends** | Task 1 |
209
- | **Effort** | M (~30 tool calls) |
101
+ Depends on: Task 1
102
+ Files: `src/bar.ts`
103
+ Changes:
210
104
 
211
- **Changes:**
105
+ - [ ] [specific change]
212
106
 
213
- - [ ] [Specific change]
214
-
215
- **Verification:**
216
-
217
- ```bash
218
- npm run test -- src/bar.test.ts
219
- ```
107
+ Verify: `npm test -- bar.test.ts`
220
108
 
221
109
  ---
222
110
 
223
- [Continue for all tasks...]
224
-
225
- ## Escape Hatches
226
-
227
- - **Max iterations per task:** 3 attempts before human intervention
228
- - **Checkpoint after:** Tasks 2a, 3 (high-risk points)
229
- - **Abort if:** [Condition that means we should stop]
230
-
231
111
  ## Final Verification
232
112
 
233
- - [ ] All task verifications pass
234
- - [ ] `npm run type-check` passes
235
- - [ ] `npm run test` passes
236
- - [ ] Manual smoke test: [specific action]
237
-
238
- ## Risks
239
-
240
- | Risk | Likelihood | Impact | Mitigation |
241
- | -------- | ---------- | ------ | --------------- |
242
- | [Risk 1] | Medium | High | [How to handle] |
243
- | [Risk 2] | Low | Medium | [How to handle] |
244
-
245
- ````
246
-
247
- ## Phase 6: Create Child Beads (if --create-beads or user approved)
248
-
249
- For each task in the plan, create a child bead:
250
-
251
- ```typescript
252
- // Get parent bead ID
253
- const parentId = "$ARGUMENTS";
254
-
255
- // Task 1: No dependencies
256
- const task1 = bd_add({
257
- title: "[Task 1 title from plan]",
258
- type: "task",
259
- pri: 2,
260
- parent: parentId,
261
- desc: "[Task 1 description]",
262
- tags: ["[domain]", "[size]"],
263
- });
264
-
265
- // Task 2a: Depends on Task 1
266
- const task2a = bd_add({
267
- title: "[Task 2a title from plan]",
268
- type: "task",
269
- pri: 2,
270
- parent: parentId,
271
- deps: [task1.id],
272
- desc: "[Task 2a description]",
273
- tags: ["[domain]", "[size]"],
274
- });
275
-
276
- // Task 2b: Also depends on Task 1 (parallel with 2a)
277
- const task2b = bd_add({
278
- title: "[Task 2b title from plan]",
279
- type: "task",
280
- pri: 2,
281
- parent: parentId,
282
- deps: [task1.id],
283
- desc: "[Task 2b description]",
284
- tags: ["[domain]", "[size]"],
285
- });
286
-
287
- // Task 3: Depends on Task 1 (parallel track)
288
- const task3 = bd_add({
289
- title: "[Task 3 title from plan]",
290
- type: "task",
291
- pri: 2,
292
- parent: parentId,
293
- deps: [task1.id],
294
- desc: "[Task 3 description]",
295
- tags: ["[domain]", "[size]"],
296
- });
297
-
298
- // Task 4: Depends on 2a and 2b
299
- const task4 = bd_add({
300
- title: "[Task 4 title from plan]",
301
- type: "task",
302
- pri: 2,
303
- parent: parentId,
304
- deps: [task2a.id, task2b.id],
305
- desc: "[Task 4 description]",
306
- tags: ["[domain]", "[size]"],
307
- });
308
- ````
309
-
310
- ### Update Plan with Bead IDs
311
-
312
- After creating beads, update plan.md to include bead IDs in each task table.
313
-
314
- ### Visualize Dependency Graph
315
-
113
+ - [ ] `npm test`
114
+ - [ ] `npm run type-check`
316
115
  ```
317
- CHILD BEADS CREATED
318
- ━━━━━━━━━━━━━━━━━━━
319
-
320
- Parent: <parent-id> "[Title]"
321
116
 
322
- <parent>.1 [Task 1] ──┬──> <parent>.2 [Task 2a] ──┬──> <parent>.5 [Task 4]
323
- (READY) │ │ │
324
- │ ▼ │
325
- └──> <parent>.3 [Task 2b] ──┘
326
-
327
- └──> <parent>.4 [Task 3]
328
- (parallel track)
117
+ ## If Creating Child Beads
329
118
 
330
- READY NOW: <parent>.1
331
- PARALLEL AFTER .1: <parent>.2, <parent>.3, <parent>.4
332
- FINAL: <parent>.5
119
+ With `--create-beads` flag or user approval:
333
120
 
334
- Run `bd ready` to see claimable work.
335
- ```
336
-
337
- ## Phase 7: Upgrade Parent to Epic (if needed)
121
+ ```bash
122
+ # Task 1 (no blockers)
123
+ bd create "[task 1 title]" -t task -p 2
338
124
 
339
- If parent was a `task` or `feature` and we created children, upgrade it:
125
+ # Task 2 (blocked by task 1)
126
+ bd create "[task 2 title]" -t task -p 2
127
+ bd dep add bd-[task2] bd-[task1] --type blocks
340
128
 
341
- ```typescript
342
- // Check current type
343
- const parent = bd_show({ id: parentId });
344
-
345
- if (parent.type !== "epic" && childBeadsCreated > 0) {
346
- // Update parent to epic type
347
- bd_msg({
348
- subj: "Upgraded to Epic",
349
- body: `${parentId} upgraded from ${parent.type} to epic with ${childBeadsCreated} subtasks`,
350
- to: "all",
351
- importance: "normal",
352
- global: true,
353
- });
354
- }
129
+ # Visualize
130
+ bd dep tree $ARGUMENTS
355
131
  ```
356
132
 
357
- ## Phase 8: Generate ADR & Sync
358
-
359
- Create `.beads/artifacts/<bead-id>/adr.md`:
360
-
361
- ```markdown
362
- # ADR: [Decision Title]
363
-
364
- **Status:** Accepted
365
- **Date:** <date>
366
- **Bead:** <bead-id>
367
-
368
- ## Context
369
-
370
- [Problem statement from spec.md - why we needed to decide]
371
-
372
- ## Decision
373
-
374
- We chose **[Option Name]** because:
375
-
376
- - [Reason 1]
377
- - [Reason 2]
378
-
379
- ## Alternatives Considered
380
-
381
- - **[Option B]:** Rejected because [reason]
382
- - **[Option C]:** Rejected because [reason]
383
-
384
- ## Decomposition Decision
385
-
386
- [If child beads created:]
387
- We decomposed this into [N] subtasks because:
388
-
389
- - [Reason: parallel execution, context management, etc.]
390
-
391
- Child beads: <parent>.1, <parent>.2, ...
392
-
393
- [If not decomposed:]
394
- We kept this as a single bead because:
395
-
396
- - [Reason: small scope, single domain, etc.]
133
+ Update plan.md with bead IDs.
397
134
 
398
- ## Consequences
399
-
400
- **Positive:**
401
-
402
- - [Benefit 1]
403
- - [Benefit 2]
404
-
405
- **Negative:**
406
-
407
- - [Tradeoff 1]
408
- - [Tradeoff 2]
409
-
410
- ## Confirmation
411
-
412
- This decision is confirmed when:
413
-
414
- - [ ] Implementation complete per plan.md
415
- - [ ] All verification steps pass
416
- ```
417
-
418
- Update bead and sync:
135
+ ## Sync
419
136
 
420
137
  ```typescript
421
- bd_msg({
422
- subj: "Plan approved",
423
- body: `Approach: [selected option]\nTasks: [count]\nChild beads: [yes/no]\nEstimate: ~[N] tool calls`,
424
- to: "all",
425
- importance: "normal",
426
- global: true,
427
- });
428
-
429
- bd_release({ _: true });
430
- bd_sync({ reason: "Plan approved for $ARGUMENTS" });
138
+ bd_sync({ reason: "Sync plan" });
431
139
  ```
432
140
 
433
141
  ## Output
434
142
 
435
- ### Without Child Beads
143
+ Without child beads:
436
144
 
437
145
  ```
438
- Plan Approved: <bead-id>
439
- ━━━━━━━━━━━━━━━━━━━━━━━━
146
+ Plan: $ARGUMENTS
440
147
 
441
- Approach: [selected option]
442
- Tasks: [count] (tracked in plan.md)
443
- Estimate: ~[N] tool calls
148
+ Approach: [selected]
149
+ Tasks: [count]
150
+ Estimate: ~N tool calls
444
151
 
445
152
  Artifacts:
446
- - .beads/artifacts/<bead-id>/design.md (approved)
447
- - .beads/artifacts/<bead-id>/plan.md
448
- - .beads/artifacts/<bead-id>/adr.md
153
+ - .beads/artifacts/$ARGUMENTS/design.md
154
+ - .beads/artifacts/$ARGUMENTS/plan.md
449
155
 
450
- Next: /implement <bead-id>
156
+ Next: /implement $ARGUMENTS
451
157
  ```
452
158
 
453
- ### With Child Beads
159
+ With child beads:
454
160
 
455
161
  ```
456
- Plan Approved: <bead-id> (Epic)
457
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
458
-
459
- Approach: [selected option]
460
- Child beads created: [count]
162
+ Plan: $ARGUMENTS (Epic)
461
163
 
462
164
  Subtasks:
463
- ├── <bead>.1: [Task 1] [S] ← READY
464
- ├── <bead>.2: [Task 2a] [M] ← blocked by .1
465
- ├── <bead>.3: [Task 2b] [M] ← blocked by .1
466
- ├── <bead>.4: [Task 3] [S] ← blocked by .1
467
- └── <bead>.5: [Task 4] [M] ← blocked by .2, .3
165
+ ├── bd-[x].1: [title] ← READY
166
+ ├── bd-[x].2: [title] ← blocked by .1
167
+ └── bd-[x].3: [title] ← blocked by .2
468
168
 
469
- Parallel Tracks:
470
- • Track A: .1 → .2 → .5
471
- • Track B: .1 → .3 → .5
472
- • Track C: .1 → .4
473
-
474
- Artifacts:
475
- - .beads/artifacts/<bead-id>/design.md
476
- - .beads/artifacts/<bead-id>/plan.md
477
- - .beads/artifacts/<bead-id>/adr.md
478
-
479
- Next Steps:
480
- ├── Start first task: /implement <bead>.1
481
- ├── See ready work: bd ready
482
- └── See blocked tasks: bd_blocked()
483
-
484
- For parallel agents:
485
- ├── Agent 1 (backend): claim <bead>.1
486
- ├── Agent 2 (frontend): wait for .1, then claim .3
487
- └── Agent 3 (qa): wait for .2 and .3, then claim .5
488
- ```
489
-
490
- ## When to Create Child Beads
491
-
492
- | Scenario | Create Beads? |
493
- | ------------------------------- | ------------------------------------ |
494
- | Simple task, single domain | No - use plan.md checklist |
495
- | 2-3 tasks, same domain | No - use plan.md checklist |
496
- | 3+ tasks, multiple domains | Yes - enables parallel agents |
497
- | Tasks with complex dependencies | Yes - beads tracks dependencies |
498
- | Long-running work (days) | Yes - better progress tracking |
499
- | Work that may span sessions | Yes - beads persists across sessions |
500
-
501
- ## Integration with Agent Workflow
502
-
503
- After plan creates child beads:
504
-
505
- ```typescript
506
- // Any agent can check ready work
507
- bd_init({ team: "project", role: "backend" });
508
- bd_ready(); // Shows <parent>.1 as ready
509
-
510
- // Agent claims and works
511
- bd_claim(); // Gets <parent>.1
512
- // ... do the work ...
513
- bd_done({ id: "<parent>.1", msg: "Completed setup" });
514
-
515
- // Now <parent>.2, .3, .4 become ready (unblocked)
516
- // Multiple agents can claim them in parallel
517
- ```
518
-
519
- ## Examples
520
-
521
- ```bash
522
- /plan bd-auth01 # Plan without creating beads
523
- /plan bd-auth01 --create-beads # Plan and create child beads
524
- /plan bd-auth01 --parallel # Focus on parallel execution
525
- /plan bd-auth01 --create-beads --parallel # Full decomposition
169
+ Next: /implement bd-[x].1
526
170
  ```
@@ -212,8 +212,10 @@ bd_msg({
212
212
  importance: "normal",
213
213
  global: true,
214
214
  });
215
+ ```
215
216
 
216
- bd_sync({ reason: "PR created for $ARGUMENTS" });
217
+ ```typescript
218
+ bd_sync({ reason: "Sync PR creation" });
217
219
  ```
218
220
 
219
221
  ## Output