opencodekit 0.16.5 → 0.16.7
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 +106 -384
- package/dist/template/.opencode/README.md +170 -104
- package/dist/template/.opencode/agent/build.md +39 -32
- package/dist/template/.opencode/agent/explore.md +2 -0
- package/dist/template/.opencode/agent/review.md +3 -0
- package/dist/template/.opencode/agent/scout.md +22 -11
- package/dist/template/.opencode/command/create.md +164 -106
- package/dist/template/.opencode/command/design.md +6 -2
- package/dist/template/.opencode/command/handoff.md +6 -4
- package/dist/template/.opencode/command/init.md +1 -1
- package/dist/template/.opencode/command/plan.md +26 -23
- package/dist/template/.opencode/command/research.md +13 -6
- package/dist/template/.opencode/command/resume.md +8 -6
- package/dist/template/.opencode/command/review-codebase.md +2 -2
- package/dist/template/.opencode/command/ship.md +1 -1
- package/dist/template/.opencode/command/start.md +30 -25
- package/dist/template/.opencode/command/status.md +9 -42
- package/dist/template/.opencode/command/ui-review.md +1 -1
- package/dist/template/.opencode/command/verify.md +11 -11
- package/dist/template/.opencode/dcp.jsonc +2 -0
- package/dist/template/.opencode/memory/README.md +67 -37
- package/dist/template/.opencode/memory/_templates/prd.md +102 -18
- package/dist/template/.opencode/memory/project/gotchas.md +31 -0
- package/dist/template/.opencode/memory/project/tech-stack.md +1 -1
- package/dist/template/.opencode/memory.db +0 -0
- package/dist/template/.opencode/memory.db-shm +0 -0
- package/dist/template/.opencode/memory.db-wal +0 -0
- package/dist/template/.opencode/opencode.json +9 -23
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/skill/beads/SKILL.md +10 -10
- package/dist/template/.opencode/skill/beads-bridge/SKILL.md +64 -47
- package/dist/template/.opencode/skill/brainstorming/SKILL.md +19 -5
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +30 -63
- package/dist/template/.opencode/skill/context-management/SKILL.md +115 -0
- package/dist/template/.opencode/skill/deep-research/SKILL.md +4 -4
- package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +305 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +3 -3
- package/dist/template/.opencode/skill/prd/SKILL.md +47 -122
- package/dist/template/.opencode/skill/prd-task/SKILL.md +48 -4
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +120 -24
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +79 -61
- package/dist/template/.opencode/skill/tool-priority/SKILL.md +31 -22
- package/dist/template/.opencode/tool/context7.ts +183 -0
- package/dist/template/.opencode/tool/memory-admin.ts +445 -0
- package/dist/template/.opencode/tool/swarm.ts +572 -0
- package/package.json +1 -1
- package/dist/template/.opencode/memory/_templates/spec.md +0 -66
- package/dist/template/.opencode/memory/beads-workflow.md +0 -564
- package/dist/template/.opencode/tool/beads-sync.ts +0 -657
- package/dist/template/.opencode/tool/context7-query-docs.ts +0 -89
- package/dist/template/.opencode/tool/context7-resolve-library-id.ts +0 -113
- package/dist/template/.opencode/tool/memory-maintain.ts +0 -167
- package/dist/template/.opencode/tool/memory-migrate.ts +0 -319
- package/dist/template/.opencode/tool/swarm-delegate.ts +0 -180
- package/dist/template/.opencode/tool/swarm-monitor.ts +0 -388
- package/dist/template/.opencode/tool/swarm-plan.ts +0 -697
|
@@ -1,12 +1,37 @@
|
|
|
1
1
|
# Beads PRD Template
|
|
2
2
|
|
|
3
|
-
**Bead:** bd-[id]
|
|
4
|
-
**Created:** [date]
|
|
5
|
-
**Status:** Draft
|
|
3
|
+
**Bead:** bd-[id]
|
|
4
|
+
**Created:** [date]
|
|
5
|
+
**Status:** Draft | In Review | Approved
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Bead Metadata
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```yaml
|
|
10
|
+
depends_on: [] # Bead IDs that must complete before this one
|
|
11
|
+
parallel: true # Can run concurrently with other parallel beads
|
|
12
|
+
conflicts_with: [] # Bead IDs that modify same files (cannot parallelize)
|
|
13
|
+
blocks: [] # Bead IDs waiting on this one
|
|
14
|
+
estimated_hours: 2 # Time estimate for planning
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Problem Statement
|
|
20
|
+
|
|
21
|
+
### What problem are we solving?
|
|
22
|
+
|
|
23
|
+
[Clear description of the problem. Include user impact and business impact.]
|
|
24
|
+
|
|
25
|
+
### Why now?
|
|
26
|
+
|
|
27
|
+
[What triggered this work? Cost of inaction?]
|
|
28
|
+
|
|
29
|
+
### Who is affected?
|
|
30
|
+
|
|
31
|
+
- **Primary users:** [Description]
|
|
32
|
+
- **Secondary users:** [Description]
|
|
33
|
+
|
|
34
|
+
---
|
|
10
35
|
|
|
11
36
|
## Scope
|
|
12
37
|
|
|
@@ -17,20 +42,55 @@ What exactly are we building and why does it exist?
|
|
|
17
42
|
### Out-of-Scope
|
|
18
43
|
|
|
19
44
|
- [List what's explicitly off-limits]
|
|
45
|
+
- [Deferred to future iterations]
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Proposed Solution
|
|
50
|
+
|
|
51
|
+
### Overview
|
|
52
|
+
|
|
53
|
+
[One paragraph describing what this feature does when complete.]
|
|
20
54
|
|
|
21
|
-
|
|
55
|
+
### User Flow (if user-facing)
|
|
22
56
|
|
|
23
57
|
1. [Step 1]
|
|
24
58
|
2. [Step 2]
|
|
25
59
|
3. [Step 3]
|
|
26
60
|
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Requirements
|
|
64
|
+
|
|
65
|
+
### Functional Requirements
|
|
66
|
+
|
|
67
|
+
#### [Requirement Name]
|
|
68
|
+
|
|
69
|
+
Brief description of what must be true.
|
|
70
|
+
|
|
71
|
+
**Scenarios:**
|
|
72
|
+
|
|
73
|
+
- **WHEN** [precondition or trigger] **THEN** [expected outcome]
|
|
74
|
+
- **WHEN** [edge case condition] **THEN** [expected behavior]
|
|
75
|
+
|
|
76
|
+
### Non-Functional Requirements
|
|
77
|
+
|
|
78
|
+
- **Performance:** [constraint if applicable]
|
|
79
|
+
- **Security:** [constraint if applicable]
|
|
80
|
+
- **Accessibility:** [WCAG level if applicable]
|
|
81
|
+
- **Compatibility:** [constraint if applicable]
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
27
85
|
## Success Criteria
|
|
28
86
|
|
|
29
|
-
- [ ] [Specific, measurable
|
|
87
|
+
- [ ] [Specific, measurable criterion 1]
|
|
30
88
|
- Verify: `[command or manual check]`
|
|
31
|
-
- [ ] [Specific, measurable
|
|
89
|
+
- [ ] [Specific, measurable criterion 2]
|
|
32
90
|
- Verify: `[command or manual check]`
|
|
33
91
|
|
|
92
|
+
---
|
|
93
|
+
|
|
34
94
|
## Technical Context
|
|
35
95
|
|
|
36
96
|
### Existing Patterns
|
|
@@ -41,26 +101,44 @@ What exactly are we building and why does it exist?
|
|
|
41
101
|
|
|
42
102
|
- `src/relevant/file.ts` - Why relevant
|
|
43
103
|
|
|
44
|
-
|
|
104
|
+
### Affected Files
|
|
45
105
|
|
|
46
|
-
|
|
106
|
+
Files this bead will modify (for conflict detection):
|
|
47
107
|
|
|
48
|
-
|
|
108
|
+
```yaml
|
|
109
|
+
files:
|
|
110
|
+
- src/path/to/file.ts # Why
|
|
111
|
+
- src/path/to/other.ts # Why
|
|
112
|
+
```
|
|
49
113
|
|
|
50
|
-
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Risks & Mitigations
|
|
117
|
+
|
|
118
|
+
| Risk | Likelihood | Impact | Mitigation |
|
|
119
|
+
| ------ | ------------ | ------------ | --------------- |
|
|
120
|
+
| Risk 1 | High/Med/Low | High/Med/Low | How to mitigate |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Open Questions
|
|
125
|
+
|
|
126
|
+
| Question | Owner | Due Date | Status |
|
|
127
|
+
| ---------- | ----- | -------- | ------------- |
|
|
128
|
+
| Question 1 | Name | Date | Open/Resolved |
|
|
51
129
|
|
|
52
130
|
---
|
|
53
131
|
|
|
54
132
|
## Tasks
|
|
55
133
|
|
|
56
|
-
Write tasks in a machine-convertible format for `prd-task
|
|
134
|
+
Write tasks in a machine-convertible format for `prd-task` skill.
|
|
57
135
|
|
|
58
|
-
Rules
|
|
136
|
+
**Rules:**
|
|
59
137
|
|
|
60
|
-
- Each task is a `### <Title> [category]` heading
|
|
61
|
-
- Provide one sentence describing the end state
|
|
62
|
-
- Include `**
|
|
63
|
-
- Include `**
|
|
138
|
+
- Each task is a `### <Title> [category]` heading
|
|
139
|
+
- Provide one sentence describing the end state
|
|
140
|
+
- Include `**Metadata:**` with dependency info
|
|
141
|
+
- Include `**Verification:**` with bullet steps proving it works
|
|
64
142
|
|
|
65
143
|
### <Task Title> [category]
|
|
66
144
|
|
|
@@ -106,3 +184,9 @@ files: []
|
|
|
106
184
|
| `parallel` | Can run concurrently with other parallel tasks | `true` / `false` |
|
|
107
185
|
| `conflicts_with` | Cannot run in parallel (same files) | `["Update config"]` |
|
|
108
186
|
| `files` | Files this task modifies (for conflict detection) | `["src/db/schema.ts", "src/db/client.ts"]` |
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Notes
|
|
191
|
+
|
|
192
|
+
[Additional context, constraints, or decisions]
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
purpose: Footguns, edge cases, and warnings discovered during development
|
|
3
|
+
updated: 2026-02-04
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Gotchas
|
|
7
|
+
|
|
8
|
+
Track unexpected behaviors, edge cases, and warnings here. Update when you hit something surprising.
|
|
9
|
+
|
|
10
|
+
## OpenCode Config
|
|
11
|
+
|
|
12
|
+
- **`compaction` key invalid**: Not in official schema at opencode.ai/config.json. Remove if present.
|
|
13
|
+
- **`experimental` key invalid**: Not in schema. Remove if present.
|
|
14
|
+
- **`tools` key invalid**: Not in schema. Remove if present.
|
|
15
|
+
- **`formatter` valid but undocumented**: Works but missing from schema (schema incomplete).
|
|
16
|
+
|
|
17
|
+
## Memory System
|
|
18
|
+
|
|
19
|
+
- Subagents (explore, scout, review) should NOT write to memory - only leader agents
|
|
20
|
+
- Use `observation: false` and `memory-update: false` in agent configs to enforce
|
|
21
|
+
|
|
22
|
+
## Build System
|
|
23
|
+
|
|
24
|
+
- `dist/` is generated - never edit directly
|
|
25
|
+
- Build copies `.opencode/` to `dist/template/` via rsync
|
|
26
|
+
- Run `npm run build` to regenerate
|
|
27
|
+
|
|
28
|
+
## Beads
|
|
29
|
+
|
|
30
|
+
- Only leader agents (build, plan) should modify beads state
|
|
31
|
+
- Subagents read with `br show <id>`, report findings back
|
|
@@ -45,7 +45,7 @@ This file is automatically injected into ALL AI prompts via `opencode.json` inst
|
|
|
45
45
|
## Active Integrations
|
|
46
46
|
|
|
47
47
|
- **OpenCode AI:** @opencode-ai/plugin (^1.1.12) - OpenCode integration
|
|
48
|
-
- **Beads CLI:**
|
|
48
|
+
- **Beads CLI:** beads_rust (br) - Task tracking CLI
|
|
49
49
|
|
|
50
50
|
---
|
|
51
51
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -43,11 +43,6 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"autoupdate": false,
|
|
46
|
-
"compaction": {
|
|
47
|
-
"auto": true,
|
|
48
|
-
"prune": true
|
|
49
|
-
},
|
|
50
|
-
"experimental": {},
|
|
51
46
|
"formatter": {
|
|
52
47
|
"biome": {
|
|
53
48
|
"command": ["npx", "@biomejs/biome", "check", "--write", "$FILE"],
|
|
@@ -170,18 +165,12 @@
|
|
|
170
165
|
"reasoning": true,
|
|
171
166
|
"tool_call": true,
|
|
172
167
|
"options": {
|
|
173
|
-
"
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
"high": {
|
|
177
|
-
"options": {
|
|
178
|
-
"reasoningEffort": "high"
|
|
179
|
-
}
|
|
168
|
+
"thinking": {
|
|
169
|
+
"type": "enabled",
|
|
170
|
+
"budgetTokens": 31999
|
|
180
171
|
},
|
|
181
|
-
"
|
|
182
|
-
"
|
|
183
|
-
"reasoningEffort": "max"
|
|
184
|
-
}
|
|
172
|
+
"interleaved": {
|
|
173
|
+
"field": "reasoning_content"
|
|
185
174
|
}
|
|
186
175
|
}
|
|
187
176
|
}
|
|
@@ -262,7 +251,8 @@
|
|
|
262
251
|
"tool_call": true,
|
|
263
252
|
"options": {
|
|
264
253
|
"reasoningEffort": "medium",
|
|
265
|
-
"reasoningSummary": "auto"
|
|
254
|
+
"reasoningSummary": "auto",
|
|
255
|
+
"textVerbosity": "medium"
|
|
266
256
|
},
|
|
267
257
|
"variants": {
|
|
268
258
|
"high": {
|
|
@@ -287,7 +277,8 @@
|
|
|
287
277
|
"tool_call": true,
|
|
288
278
|
"options": {
|
|
289
279
|
"reasoningEffort": "medium",
|
|
290
|
-
"reasoningSummary": "auto"
|
|
280
|
+
"reasoningSummary": "auto",
|
|
281
|
+
"textVerbosity": "medium"
|
|
291
282
|
},
|
|
292
283
|
"variants": {
|
|
293
284
|
"fast": {
|
|
@@ -794,11 +785,6 @@
|
|
|
794
785
|
},
|
|
795
786
|
"share": "manual",
|
|
796
787
|
"small_model": "opencode/gpt-5-nano",
|
|
797
|
-
"tools": {
|
|
798
|
-
"context7-query-docs": true,
|
|
799
|
-
"context7-resolve-library-id": true,
|
|
800
|
-
"grepsearch": true
|
|
801
|
-
},
|
|
802
788
|
"tui": {
|
|
803
789
|
"diff_style": "auto",
|
|
804
790
|
"scroll_acceleration": {
|
|
@@ -308,12 +308,12 @@ For parallel execution with multiple subagents, use the **beads-bridge** skill:
|
|
|
308
308
|
skill({ name: "beads-bridge" });
|
|
309
309
|
```
|
|
310
310
|
|
|
311
|
-
**beads-bridge** provides:
|
|
311
|
+
**beads-bridge** provides (via unified `swarm` tool):
|
|
312
312
|
|
|
313
|
-
- `
|
|
314
|
-
- `swarm
|
|
315
|
-
- `swarm
|
|
316
|
-
- `swarm
|
|
313
|
+
- `swarm({ operation: "sync" })` - Sync Beads tasks to OpenCode todos for subagent visibility
|
|
314
|
+
- `swarm({ operation: "monitor" })` - Real-time progress tracking and visualization
|
|
315
|
+
- `swarm({ operation: "plan" })` - Task classification and dependency analysis
|
|
316
|
+
- `swarm({ operation: "delegate" })` - Create delegation packets for workers
|
|
317
317
|
|
|
318
318
|
**When to use beads vs beads-bridge:**
|
|
319
319
|
|
|
@@ -321,24 +321,24 @@ skill({ name: "beads-bridge" });
|
|
|
321
321
|
| ------------------------------ | -------------------------------- |
|
|
322
322
|
| Single agent, linear work | `beads` skill only |
|
|
323
323
|
| Multiple agents in parallel | `beads-bridge` + `beads` |
|
|
324
|
-
| Need subagents to see tasks | `beads-bridge` (
|
|
325
|
-
| Track worker progress visually | `beads-bridge` (swarm
|
|
324
|
+
| Need subagents to see tasks | `beads-bridge` (swarm sync push) |
|
|
325
|
+
| Track worker progress visually | `beads-bridge` (swarm monitor) |
|
|
326
326
|
|
|
327
327
|
**Example swarm workflow:**
|
|
328
328
|
|
|
329
329
|
```typescript
|
|
330
330
|
// 1. Push beads to OpenCode todos (subagents can see via todoread)
|
|
331
|
-
|
|
331
|
+
swarm({ operation: "sync", action: "push" });
|
|
332
332
|
|
|
333
333
|
// 2. Spawn workers in parallel using Task tool
|
|
334
334
|
Task({ subagent_type: "general", description: "Worker 1", prompt: "..." });
|
|
335
335
|
Task({ subagent_type: "general", description: "Worker 2", prompt: "..." });
|
|
336
336
|
|
|
337
337
|
// 3. Monitor progress
|
|
338
|
-
|
|
338
|
+
swarm({ operation: "monitor", action: "render_block", team_name: "my-swarm" });
|
|
339
339
|
|
|
340
340
|
// 4. Pull completed work back to beads
|
|
341
|
-
|
|
341
|
+
swarm({ operation: "sync", action: "pull" });
|
|
342
342
|
```
|
|
343
343
|
|
|
344
344
|
## Rules
|
|
@@ -24,13 +24,17 @@ Bridge between Beads git-backed task tracking, OpenCode's native todo system, an
|
|
|
24
24
|
|
|
25
25
|
**Key Tools**:
|
|
26
26
|
|
|
27
|
-
| Tool
|
|
28
|
-
|
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
27
|
+
| Tool | Purpose | When to Use |
|
|
28
|
+
| ------- | --------------------------- | ---------------------------------------------------- |
|
|
29
|
+
| `swarm` | Unified swarm coordination | All swarm operations (sync, monitor, plan, delegate) |
|
|
30
|
+
| `Task` | Parallel subagent execution | Spawning worker swarms |
|
|
31
|
+
|
|
32
|
+
**swarm operations:**
|
|
33
|
+
|
|
34
|
+
- `sync`: Sync Beads ↔ OpenCode todos (start of session, before spawning)
|
|
35
|
+
- `monitor`: Progress tracking/visualization (during swarm execution)
|
|
36
|
+
- `plan`: Task classification + dependency graphs (before spawning workers)
|
|
37
|
+
- `delegate`: Create delegation packets (assigning work to workers)
|
|
34
38
|
|
|
35
39
|
## When to Use This Skill
|
|
36
40
|
|
|
@@ -48,8 +52,9 @@ Make Beads tasks visible to subagents:
|
|
|
48
52
|
|
|
49
53
|
```typescript
|
|
50
54
|
// Push Beads to OpenCode todos
|
|
51
|
-
const result = await
|
|
52
|
-
operation: "
|
|
55
|
+
const result = await swarm({
|
|
56
|
+
operation: "sync",
|
|
57
|
+
action: "push",
|
|
53
58
|
filter: "open", // or "in_progress", "all"
|
|
54
59
|
});
|
|
55
60
|
|
|
@@ -63,8 +68,9 @@ Check current swarm progress:
|
|
|
63
68
|
|
|
64
69
|
```typescript
|
|
65
70
|
// Check swarm status
|
|
66
|
-
const status = await
|
|
67
|
-
operation: "
|
|
71
|
+
const status = await swarm({
|
|
72
|
+
operation: "monitor",
|
|
73
|
+
action: "status",
|
|
68
74
|
team_name: "api-refactor-swarm",
|
|
69
75
|
});
|
|
70
76
|
|
|
@@ -72,8 +78,9 @@ const stats = JSON.parse(status).summary;
|
|
|
72
78
|
console.log(`Workers: ${stats.total_workers}, Completed: ${stats.completed}`);
|
|
73
79
|
|
|
74
80
|
// Render TUI for visualization
|
|
75
|
-
const ui = await
|
|
76
|
-
operation: "
|
|
81
|
+
const ui = await swarm({
|
|
82
|
+
operation: "monitor",
|
|
83
|
+
action: "render_block",
|
|
77
84
|
team_name: "api-refactor-swarm",
|
|
78
85
|
});
|
|
79
86
|
console.log(ui);
|
|
@@ -85,8 +92,9 @@ For work that spans multiple sessions, use shared task lists:
|
|
|
85
92
|
|
|
86
93
|
```typescript
|
|
87
94
|
// Create a shared list that persists across sessions
|
|
88
|
-
const list = await
|
|
89
|
-
operation: "
|
|
95
|
+
const list = await swarm({
|
|
96
|
+
operation: "sync",
|
|
97
|
+
action: "create_shared",
|
|
90
98
|
name: "api-refactor-swarm",
|
|
91
99
|
tasks: JSON.stringify([
|
|
92
100
|
{ id: "task-1", content: "Refactor auth endpoint", status: "pending", priority: "high" },
|
|
@@ -95,8 +103,9 @@ const list = await beads_sync({
|
|
|
95
103
|
});
|
|
96
104
|
|
|
97
105
|
// Workers update the shared list as they complete work
|
|
98
|
-
await
|
|
99
|
-
operation: "
|
|
106
|
+
await swarm({
|
|
107
|
+
operation: "sync",
|
|
108
|
+
action: "update_shared",
|
|
100
109
|
list_id: list.list_id,
|
|
101
110
|
tasks: JSON.stringify([{ id: "task-1", status: "completed" }]),
|
|
102
111
|
});
|
|
@@ -108,8 +117,9 @@ Create persistent task lists that survive session boundaries:
|
|
|
108
117
|
|
|
109
118
|
```typescript
|
|
110
119
|
// Create a shared list for a swarm
|
|
111
|
-
const list = await
|
|
112
|
-
operation: "
|
|
120
|
+
const list = await swarm({
|
|
121
|
+
operation: "sync",
|
|
122
|
+
action: "create_shared",
|
|
113
123
|
name: "api-refactor-swarm",
|
|
114
124
|
tasks: JSON.stringify([
|
|
115
125
|
{ id: "task-1", content: "Refactor auth endpoint", status: "pending", priority: "high" },
|
|
@@ -120,7 +130,7 @@ const list = await beads_sync({
|
|
|
120
130
|
|
|
121
131
|
// Share the list ID with workers
|
|
122
132
|
console.log(`List ID: ${list.list_id}`);
|
|
123
|
-
// Workers can access via:
|
|
133
|
+
// Workers can access via: swarm({ operation: "sync", action: "get_shared", list_id: "..." })
|
|
124
134
|
```
|
|
125
135
|
|
|
126
136
|
### 5. Worker Updates to Shared List
|
|
@@ -129,8 +139,9 @@ Workers can update their task status:
|
|
|
129
139
|
|
|
130
140
|
```typescript
|
|
131
141
|
// Worker completes a task
|
|
132
|
-
await
|
|
133
|
-
operation: "
|
|
142
|
+
await swarm({
|
|
143
|
+
operation: "sync",
|
|
144
|
+
action: "update_shared",
|
|
134
145
|
list_id: "shl_abc123",
|
|
135
146
|
tasks: JSON.stringify([{ id: "task-1", status: "completed" }]),
|
|
136
147
|
});
|
|
@@ -144,14 +155,15 @@ Full cycle from Beads task to swarm execution and back:
|
|
|
144
155
|
|
|
145
156
|
```typescript
|
|
146
157
|
// 1. Start: Push Beads to todos
|
|
147
|
-
await
|
|
158
|
+
await swarm({ operation: "sync", action: "push" });
|
|
148
159
|
|
|
149
160
|
// 2. Claim the parent Bead
|
|
150
161
|
await bash("br update parent-task --status in_progress");
|
|
151
162
|
|
|
152
163
|
// 3. Analyze and spawn swarm
|
|
153
|
-
const analysis = await
|
|
154
|
-
operation: "
|
|
164
|
+
const analysis = await swarm({
|
|
165
|
+
operation: "plan",
|
|
166
|
+
action: "analyze",
|
|
155
167
|
task: "Implement API refactor",
|
|
156
168
|
files: "src/api/users.ts,src/api/posts.ts,src/api/auth.ts",
|
|
157
169
|
});
|
|
@@ -160,11 +172,12 @@ const analysis = await swarm_plan({
|
|
|
160
172
|
// ... spawn workers, monitor progress ...
|
|
161
173
|
|
|
162
174
|
// 5. Complete: Pull completed todos back to Beads
|
|
163
|
-
await
|
|
175
|
+
await swarm({ operation: "sync", action: "pull" });
|
|
164
176
|
|
|
165
177
|
// 6. Clear swarm state
|
|
166
|
-
await
|
|
167
|
-
operation: "
|
|
178
|
+
await swarm({
|
|
179
|
+
operation: "monitor",
|
|
180
|
+
action: "clear",
|
|
168
181
|
team_name: "api-refactor-swarm",
|
|
169
182
|
});
|
|
170
183
|
|
|
@@ -176,12 +189,13 @@ await bash("git add .beads/ && git commit -m 'close parent-task'");
|
|
|
176
189
|
|
|
177
190
|
### Pattern B: Dependency-Aware Task Scheduling
|
|
178
191
|
|
|
179
|
-
Use swarm
|
|
192
|
+
Use swarm tool's dependency graph for proper ordering:
|
|
180
193
|
|
|
181
194
|
```typescript
|
|
182
195
|
// Get full analysis with dependency graph
|
|
183
|
-
const analysis = await
|
|
184
|
-
operation: "
|
|
196
|
+
const analysis = await swarm({
|
|
197
|
+
operation: "plan",
|
|
198
|
+
action: "analyze",
|
|
185
199
|
task: "Refactor authentication system",
|
|
186
200
|
files: "src/auth/service.ts,src/auth/types.ts,src/routes/auth.ts,src/middleware/auth.ts",
|
|
187
201
|
});
|
|
@@ -216,8 +230,9 @@ When work needs to continue in a new session:
|
|
|
216
230
|
|
|
217
231
|
```typescript
|
|
218
232
|
// End of session 1: Save state to memory and shared list
|
|
219
|
-
await
|
|
220
|
-
operation: "
|
|
233
|
+
await swarm({
|
|
234
|
+
operation: "sync",
|
|
235
|
+
action: "update_shared",
|
|
221
236
|
list_id: "api-refactor-swarm",
|
|
222
237
|
tasks: JSON.stringify([
|
|
223
238
|
{ id: "worker-1", content: "Auth service", status: "completed" },
|
|
@@ -249,13 +264,15 @@ await bash("br sync --flush-only");
|
|
|
249
264
|
await bash("git add .beads/ && git commit -m 'session handoff'");
|
|
250
265
|
|
|
251
266
|
// Start of session 2: Check status and continue
|
|
252
|
-
const status = await
|
|
253
|
-
operation: "
|
|
267
|
+
const status = await swarm({
|
|
268
|
+
operation: "monitor",
|
|
269
|
+
action: "status",
|
|
254
270
|
team_name: "api-refactor-swarm",
|
|
255
271
|
});
|
|
256
272
|
|
|
257
|
-
const shared = await
|
|
258
|
-
operation: "
|
|
273
|
+
const shared = await swarm({
|
|
274
|
+
operation: "sync",
|
|
275
|
+
action: "get_shared",
|
|
259
276
|
list_id: "api-refactor-swarm",
|
|
260
277
|
});
|
|
261
278
|
|
|
@@ -275,29 +292,29 @@ console.log(`Continuing swarm with ${shared.tasks.length} tasks...`);
|
|
|
275
292
|
|
|
276
293
|
```
|
|
277
294
|
SESSION START:
|
|
278
|
-
|
|
279
|
-
swarm
|
|
295
|
+
swarm({ operation: "sync", action: "push" }) // Make Beads visible to subagents
|
|
296
|
+
swarm({ operation: "monitor", action: "status", team_name: "..." }) // Check swarm status
|
|
280
297
|
|
|
281
298
|
DURING WORK:
|
|
282
|
-
swarm
|
|
283
|
-
swarm
|
|
284
|
-
|
|
299
|
+
swarm({ operation: "monitor", action: "progress_update", ... }) // Track worker progress
|
|
300
|
+
swarm({ operation: "monitor", action: "render_block", ... }) // TUI visualization
|
|
301
|
+
swarm({ operation: "sync", action: "update_shared", ... }) // Cross-session updates
|
|
285
302
|
|
|
286
303
|
SESSION END:
|
|
287
|
-
|
|
288
|
-
swarm
|
|
304
|
+
swarm({ operation: "sync", action: "pull" }) // Sync completed todos back to Beads
|
|
305
|
+
swarm({ operation: "monitor", action: "clear", team_name: "..." }) // Cleanup swarm state
|
|
289
306
|
br sync --flush-only // Export Beads changes
|
|
290
307
|
git add .beads/ && git commit -m "..." // Commit changes to git
|
|
291
308
|
|
|
292
309
|
RECOVERY:
|
|
293
|
-
|
|
294
|
-
swarm
|
|
310
|
+
swarm({ operation: "sync", action: "get_shared", list_id: "..." }) // Get shared task list
|
|
311
|
+
swarm({ operation: "monitor", action: "status", team_name: "..." }) // Check swarm status
|
|
295
312
|
```
|
|
296
313
|
|
|
297
314
|
## Rules
|
|
298
315
|
|
|
299
316
|
1. **Always push Beads at session start** - Subagents need visibility via todoread
|
|
300
|
-
2. **Use shared lists for long-running swarms** - Cross-session persistence via
|
|
317
|
+
2. **Use shared lists for long-running swarms** - Cross-session persistence via swarm sync
|
|
301
318
|
3. **Pull completed todos back to Beads** - Keep tracking system in sync
|
|
302
319
|
4. **Check swarm status before spawning** - Avoid duplicate work
|
|
303
320
|
5. **Clear swarm state when done** - Cleanup after completion
|
|
@@ -11,6 +11,10 @@ Help turn ideas into fully formed designs and specs through natural collaborativ
|
|
|
11
11
|
|
|
12
12
|
Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design in small sections (200-300 words), checking after each section whether it looks right so far.
|
|
13
13
|
|
|
14
|
+
**Part of:** `development-lifecycle` skill (Phase 1: Ideation)
|
|
15
|
+
|
|
16
|
+
**Output template:** `.opencode/memory/_templates/design.md`
|
|
17
|
+
|
|
14
18
|
## The Process
|
|
15
19
|
|
|
16
20
|
**Understanding the idea:**
|
|
@@ -39,15 +43,25 @@ Start by understanding the current project context, then ask questions one at a
|
|
|
39
43
|
|
|
40
44
|
**Documentation:**
|
|
41
45
|
|
|
42
|
-
- Write the validated design to `.beads/artifacts/<bead-id>/design.md`
|
|
46
|
+
- Write the validated design to `.beads/artifacts/<bead-id>/design.md`
|
|
47
|
+
- Use template from `.opencode/memory/_templates/design.md`
|
|
43
48
|
- Use elements-of-style:writing-clearly-and-concisely skill if available
|
|
44
49
|
- Commit the design document to git
|
|
45
50
|
|
|
46
|
-
**
|
|
51
|
+
**Next Phase (if continuing):**
|
|
52
|
+
|
|
53
|
+
- Ask: "Ready to create the PRD?"
|
|
54
|
+
- Load next skill: `skill({ name: "prd" })`
|
|
55
|
+
- This moves to Phase 2: Specification
|
|
56
|
+
|
|
57
|
+
**Alternative paths:**
|
|
58
|
+
|
|
59
|
+
- Use `skill({ name: "using-git-worktrees" })` to create isolated workspace first
|
|
60
|
+
- Use `skill({ name: "writing-plans" })` if skipping formal PRD
|
|
61
|
+
|
|
62
|
+
**Full lifecycle reference:**
|
|
47
63
|
|
|
48
|
-
-
|
|
49
|
-
- Use skill({ name: "using-git-worktrees" }) to create isolated workspace
|
|
50
|
-
- Use skill({ name: "writing-plans" }) to create detailed implementation plan
|
|
64
|
+
- Use `skill({ name: "development-lifecycle" })` to see all phases
|
|
51
65
|
|
|
52
66
|
## Key Principles
|
|
53
67
|
|