opencodekit 0.16.4 → 0.16.6
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 +5 -1
- 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/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/verify.md +11 -11
- 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.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 +0 -10
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/skill/beads/SKILL.md +164 -380
- package/dist/template/.opencode/skill/beads/references/BOUNDARIES.md +23 -22
- package/dist/template/.opencode/skill/beads/references/DEPENDENCIES.md +23 -29
- package/dist/template/.opencode/skill/beads/references/RESUMABILITY.md +5 -8
- package/dist/template/.opencode/skill/beads/references/WORKFLOWS.md +43 -39
- package/dist/template/.opencode/skill/beads-bridge/SKILL.md +80 -53
- 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/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,28 +1,124 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "PRD Task Schema",
|
|
4
|
+
"description": "Executable task list converted from PRD markdown",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["beadId", "tasks"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"beadId": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Bead identifier (e.g., bd-abc123)"
|
|
11
|
+
},
|
|
12
|
+
"prdName": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Optional slug for the PRD"
|
|
15
|
+
},
|
|
16
|
+
"tasks": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"items": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"required": ["id", "category", "description", "steps", "passes"],
|
|
21
|
+
"properties": {
|
|
22
|
+
"id": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Task identifier (e.g., functional-1, api-2)"
|
|
25
|
+
},
|
|
26
|
+
"category": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "Task category (e.g., functional, api, db, ui)"
|
|
29
|
+
},
|
|
30
|
+
"description": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "One sentence describing the end state"
|
|
33
|
+
},
|
|
34
|
+
"steps": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": { "type": "string" },
|
|
37
|
+
"description": "Verification steps that prove the task is complete"
|
|
38
|
+
},
|
|
39
|
+
"passes": {
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"default": false,
|
|
42
|
+
"description": "Whether all verification steps pass"
|
|
43
|
+
},
|
|
44
|
+
"metadata": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"description": "Task dependency and execution metadata",
|
|
47
|
+
"properties": {
|
|
48
|
+
"depends_on": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": { "type": "string" },
|
|
51
|
+
"description": "Task IDs that must complete first"
|
|
52
|
+
},
|
|
53
|
+
"parallel": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"default": true,
|
|
56
|
+
"description": "Can run concurrently with other parallel tasks"
|
|
57
|
+
},
|
|
58
|
+
"conflicts_with": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"items": { "type": "string" },
|
|
61
|
+
"description": "Task IDs that modify same files (cannot parallelize)"
|
|
62
|
+
},
|
|
63
|
+
"files": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": { "type": "string" },
|
|
66
|
+
"description": "Files this task will modify"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"context": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"description": "Technical context from the PRD",
|
|
76
|
+
"properties": {
|
|
77
|
+
"patterns": {
|
|
78
|
+
"type": "array",
|
|
79
|
+
"items": { "type": "string" },
|
|
80
|
+
"description": "Existing codebase patterns to follow"
|
|
81
|
+
},
|
|
82
|
+
"keyFiles": {
|
|
83
|
+
"type": "array",
|
|
84
|
+
"items": { "type": "string" },
|
|
85
|
+
"description": "Key files to reference"
|
|
86
|
+
},
|
|
87
|
+
"nonGoals": {
|
|
88
|
+
"type": "array",
|
|
89
|
+
"items": { "type": "string" },
|
|
90
|
+
"description": "Explicitly out of scope items"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"beadMetadata": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"description": "Bead-level metadata from PRD",
|
|
97
|
+
"properties": {
|
|
98
|
+
"depends_on": {
|
|
99
|
+
"type": "array",
|
|
100
|
+
"items": { "type": "string" },
|
|
101
|
+
"description": "Bead IDs that must complete before this one"
|
|
102
|
+
},
|
|
103
|
+
"parallel": {
|
|
104
|
+
"type": "boolean",
|
|
105
|
+
"description": "Can run concurrently with other parallel beads"
|
|
106
|
+
},
|
|
107
|
+
"conflicts_with": {
|
|
108
|
+
"type": "array",
|
|
109
|
+
"items": { "type": "string" },
|
|
110
|
+
"description": "Bead IDs that modify same files"
|
|
111
|
+
},
|
|
112
|
+
"blocks": {
|
|
113
|
+
"type": "array",
|
|
114
|
+
"items": { "type": "string" },
|
|
115
|
+
"description": "Bead IDs waiting on this one"
|
|
116
|
+
},
|
|
117
|
+
"estimated_hours": {
|
|
118
|
+
"type": "number",
|
|
119
|
+
"description": "Time estimate for planning"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
17
122
|
}
|
|
18
|
-
],
|
|
19
|
-
"context": {
|
|
20
|
-
"patterns": [
|
|
21
|
-
"API routes: src/routes/items.ts",
|
|
22
|
-
"Validation: src/lib/validate.ts",
|
|
23
|
-
"DB queries: src/db/queries/"
|
|
24
|
-
],
|
|
25
|
-
"keyFiles": ["src/db/schema.ts", "src/routes/index.ts"],
|
|
26
|
-
"nonGoals": ["OAuth/social login", "Password reset", "Email verification"]
|
|
27
123
|
}
|
|
28
124
|
}
|
|
@@ -24,20 +24,23 @@ Coordinate multiple agents working on independent tasks in parallel using Kimi K
|
|
|
24
24
|
|
|
25
25
|
**Key Tools**:
|
|
26
26
|
|
|
27
|
-
| Tool
|
|
28
|
-
|
|
|
29
|
-
| `swarm
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
| Tool | Purpose | When to Use |
|
|
28
|
+
| ------- | -------------------------- | -------------------- |
|
|
29
|
+
| `swarm` | Unified swarm coordination | All swarm operations |
|
|
30
|
+
|
|
31
|
+
**swarm operations:**
|
|
32
|
+
|
|
33
|
+
- `plan`: Task classification & dependency graph (before spawning workers)
|
|
34
|
+
- `delegate`: Create delegation packets (assigning work to workers)
|
|
35
|
+
- `monitor`: Progress tracking + TUI visualization (during swarm execution)
|
|
36
|
+
- `sync`: Sync Beads ↔ OpenCode todos (session start, cross-session)
|
|
33
37
|
|
|
34
38
|
**Key Distinction**:
|
|
35
39
|
|
|
36
40
|
- **Swarm**: Parallel execution of independent tasks with dynamic allocation
|
|
37
41
|
- **Beads**: Task tracking and dependency management across sessions
|
|
38
42
|
- **Task tool**: Spawning individual subagents for research/execution
|
|
39
|
-
- **swarm
|
|
40
|
-
- **swarm-monitor tool**: Progress tracking, TUI visualization, todo persistence
|
|
43
|
+
- **swarm tool**: Unified operations for planning, monitoring, delegation, and sync
|
|
41
44
|
|
|
42
45
|
**When to Use Swarm Coordination**:
|
|
43
46
|
|
|
@@ -62,7 +65,7 @@ Coordinate multiple agents working on independent tasks in parallel using Kimi K
|
|
|
62
65
|
│ - Parses plan into tasks │
|
|
63
66
|
│ - Creates delegation packets │
|
|
64
67
|
│ - Spawns worker agents via Task tool │
|
|
65
|
-
│ - Monitors progress via swarm
|
|
68
|
+
│ - Monitors progress via swarm tool │
|
|
66
69
|
│ - Synthesizes final results │
|
|
67
70
|
└─────────────────────────────────────────────────────────────────┘
|
|
68
71
|
│ │ │
|
|
@@ -93,7 +96,8 @@ Analyze the user's actual task to determine optimal swarm strategy:
|
|
|
93
96
|
|
|
94
97
|
```typescript
|
|
95
98
|
// 1. Classify the task and build dependency graph
|
|
96
|
-
const analysis = await
|
|
99
|
+
const analysis = await swarm({
|
|
100
|
+
operation: "plan",
|
|
97
101
|
operation: "analyze",
|
|
98
102
|
task: "<user's request from input>",
|
|
99
103
|
files: "<detected files from glob/grep>",
|
|
@@ -110,7 +114,8 @@ const analysis = await swarm_plan({
|
|
|
110
114
|
const plan = JSON.parse(analysis);
|
|
111
115
|
|
|
112
116
|
// 2. Check for serial collapse
|
|
113
|
-
const check = await
|
|
117
|
+
const check = await swarm({
|
|
118
|
+
operation: "plan",
|
|
114
119
|
operation: "check",
|
|
115
120
|
task: "<user's request>",
|
|
116
121
|
files: String(plan.file_count),
|
|
@@ -135,10 +140,11 @@ Make Beads tasks visible to subagents:
|
|
|
135
140
|
|
|
136
141
|
```typescript
|
|
137
142
|
// Push Beads to OpenCode todos (subagents see via todoread)
|
|
138
|
-
await
|
|
143
|
+
await swarm({ operation: "sync", operation: "push", filter: "open" });
|
|
139
144
|
|
|
140
145
|
// Check for existing swarm state
|
|
141
|
-
const status = await
|
|
146
|
+
const status = await swarm({
|
|
147
|
+
operation: "monitor",
|
|
142
148
|
operation: "status",
|
|
143
149
|
team_name: "plan-implementation",
|
|
144
150
|
});
|
|
@@ -147,7 +153,8 @@ const stats = JSON.parse(status).summary;
|
|
|
147
153
|
if (stats.total_workers > 0) {
|
|
148
154
|
console.log(`Found existing swarm with ${stats.total_workers} workers`);
|
|
149
155
|
// Render current progress
|
|
150
|
-
const ui = await
|
|
156
|
+
const ui = await swarm({
|
|
157
|
+
operation: "monitor",
|
|
151
158
|
operation: "render_block",
|
|
152
159
|
team_name: "plan-implementation",
|
|
153
160
|
});
|
|
@@ -160,7 +167,8 @@ if (stats.total_workers > 0) {
|
|
|
160
167
|
For each task, create a delegation packet:
|
|
161
168
|
|
|
162
169
|
```typescript
|
|
163
|
-
|
|
170
|
+
swarm({
|
|
171
|
+
operation: "delegate",
|
|
164
172
|
bead_id: "task-1",
|
|
165
173
|
title: "Implement auth service",
|
|
166
174
|
expected_outcome: "Auth service with JWT tokens, tests pass",
|
|
@@ -199,7 +207,7 @@ Requirements:
|
|
|
199
207
|
1. Follow all MUST DO constraints
|
|
200
208
|
2. Avoid all MUST NOT DO items
|
|
201
209
|
3. Run acceptance checks before claiming done
|
|
202
|
-
4. Report progress via swarm
|
|
210
|
+
4. Report progress via swarm monitor`,
|
|
203
211
|
});
|
|
204
212
|
});
|
|
205
213
|
|
|
@@ -216,14 +224,16 @@ Monitor with beautiful block UI, progress tracking, and auto-persistence:
|
|
|
216
224
|
let allComplete = false;
|
|
217
225
|
while (!allComplete) {
|
|
218
226
|
// Option A: Render beautiful TUI block
|
|
219
|
-
const ui = await
|
|
227
|
+
const ui = await swarm({
|
|
228
|
+
operation: "monitor",
|
|
220
229
|
operation: "render_block",
|
|
221
230
|
team_name: "plan-implementation",
|
|
222
231
|
});
|
|
223
232
|
console.log(ui); // Markdown block with tables, emojis, progress
|
|
224
233
|
|
|
225
234
|
// Option B: Get detailed status
|
|
226
|
-
const status = await
|
|
235
|
+
const status = await swarm({
|
|
236
|
+
operation: "monitor",
|
|
227
237
|
operation: "status",
|
|
228
238
|
team_name: "plan-implementation",
|
|
229
239
|
});
|
|
@@ -246,7 +256,8 @@ When all workers complete:
|
|
|
246
256
|
|
|
247
257
|
```typescript
|
|
248
258
|
// 1. Get final status
|
|
249
|
-
const finalStatus = await
|
|
259
|
+
const finalStatus = await swarm({
|
|
260
|
+
operation: "monitor",
|
|
250
261
|
operation: "status",
|
|
251
262
|
team_name: "plan-implementation",
|
|
252
263
|
});
|
|
@@ -255,13 +266,10 @@ const finalStatus = await swarm_monitor({
|
|
|
255
266
|
await bash("npm run typecheck && npm run lint && npm test");
|
|
256
267
|
|
|
257
268
|
// 3. Pull completed todos back to Beads
|
|
258
|
-
await
|
|
269
|
+
await swarm({ operation: "sync", operation: "pull" });
|
|
259
270
|
|
|
260
271
|
// 4. Clear swarm data
|
|
261
|
-
await
|
|
262
|
-
operation: "clear",
|
|
263
|
-
team_name: "plan-implementation",
|
|
264
|
-
});
|
|
272
|
+
await swarm({ operation: "monitor", operation: "clear", team_name: "plan-implementation" });
|
|
265
273
|
|
|
266
274
|
// 5. Close parent bead
|
|
267
275
|
await bash("br close parent-task --reason 'Swarm completed all subtasks'");
|
|
@@ -269,7 +277,7 @@ await bash("br close parent-task --reason 'Swarm completed all subtasks'");
|
|
|
269
277
|
|
|
270
278
|
## Dependency Graph Features
|
|
271
279
|
|
|
272
|
-
The `swarm
|
|
280
|
+
The `swarm` tool's plan operation includes full dependency graph analysis:
|
|
273
281
|
|
|
274
282
|
### Structure
|
|
275
283
|
|
|
@@ -297,7 +305,8 @@ interface TaskNode {
|
|
|
297
305
|
### Usage
|
|
298
306
|
|
|
299
307
|
```typescript
|
|
300
|
-
const analysis = await
|
|
308
|
+
const analysis = await swarm({
|
|
309
|
+
operation: "plan",
|
|
301
310
|
operation: "analyze",
|
|
302
311
|
task: "Refactor API layer",
|
|
303
312
|
files: "src/api/users.ts,src/api/posts.ts,src/api/auth.ts",
|
|
@@ -362,7 +371,8 @@ read({ filePath: ".beads/artifacts/<task-id>/delegation.md" });
|
|
|
362
371
|
### 2. Announce Start with Progress
|
|
363
372
|
|
|
364
373
|
```typescript
|
|
365
|
-
await
|
|
374
|
+
await swarm({
|
|
375
|
+
operation: "monitor",
|
|
366
376
|
operation: "progress_update",
|
|
367
377
|
team_name: "plan-implementation",
|
|
368
378
|
worker_id: "worker-1",
|
|
@@ -381,7 +391,8 @@ Report progress every 25%:
|
|
|
381
391
|
|
|
382
392
|
```typescript
|
|
383
393
|
// At 25%, 50%, 75% completion
|
|
384
|
-
await
|
|
394
|
+
await swarm({
|
|
395
|
+
operation: "monitor",
|
|
385
396
|
operation: "progress_update",
|
|
386
397
|
team_name: "plan-implementation",
|
|
387
398
|
worker_id: "worker-1",
|
|
@@ -405,7 +416,8 @@ npm test
|
|
|
405
416
|
|
|
406
417
|
```typescript
|
|
407
418
|
// Mark as completed
|
|
408
|
-
await
|
|
419
|
+
await swarm({
|
|
420
|
+
operation: "monitor",
|
|
409
421
|
operation: "progress_update",
|
|
410
422
|
team_name: "plan-implementation",
|
|
411
423
|
worker_id: "worker-1",
|
|
@@ -424,7 +436,8 @@ Workers report failures via progress updates with error status:
|
|
|
424
436
|
|
|
425
437
|
```typescript
|
|
426
438
|
// Worker reports error via progress update
|
|
427
|
-
await
|
|
439
|
+
await swarm({
|
|
440
|
+
operation: "monitor",
|
|
428
441
|
operation: "progress_update",
|
|
429
442
|
team_name: "plan-implementation",
|
|
430
443
|
worker_id: "worker-1",
|
|
@@ -437,7 +450,7 @@ await swarm_monitor({
|
|
|
437
450
|
|
|
438
451
|
### Leader Response
|
|
439
452
|
|
|
440
|
-
1. Check worker status via `
|
|
453
|
+
1. Check worker status via `swarm({ operation: "monitor", operation: "status" })`
|
|
441
454
|
2. Review error details in progress entries
|
|
442
455
|
3. Decide: fix locally or reassign to new worker
|
|
443
456
|
|
|
@@ -447,7 +460,8 @@ Workers should report blockers via progress updates:
|
|
|
447
460
|
|
|
448
461
|
```typescript
|
|
449
462
|
// Worker reports blocker via progress update
|
|
450
|
-
await
|
|
463
|
+
await swarm({
|
|
464
|
+
operation: "monitor",
|
|
451
465
|
operation: "progress_update",
|
|
452
466
|
team_name: "plan-implementation",
|
|
453
467
|
worker_id: "worker-2",
|
|
@@ -472,20 +486,20 @@ await swarm_monitor({
|
|
|
472
486
|
|
|
473
487
|
Swarm works on top of Beads:
|
|
474
488
|
|
|
475
|
-
1. **Session start**: `
|
|
489
|
+
1. **Session start**: `swarm sync push` to make tasks visible
|
|
476
490
|
2. **Leader claims parent** bead
|
|
477
491
|
3. **Workers claim child** beads (via delegation packets)
|
|
478
|
-
4. **Progress tracked** via `swarm
|
|
479
|
-
5. **Completion syncs** back via `
|
|
492
|
+
4. **Progress tracked** via `swarm monitor progress_update`
|
|
493
|
+
5. **Completion syncs** back via `swarm sync pull`
|
|
480
494
|
6. **Close parent** bead with `br close`
|
|
481
495
|
|
|
482
496
|
```typescript
|
|
483
497
|
// Full integration workflow
|
|
484
|
-
await
|
|
498
|
+
await swarm({ operation: "sync", action: "push" }); // Make Beads visible
|
|
485
499
|
// ... spawn swarm ...
|
|
486
|
-
await
|
|
500
|
+
await swarm({ operation: "monitor", action: "render_block", team_name: "..." }); // Monitor progress
|
|
487
501
|
// ... monitor completion ...
|
|
488
|
-
await
|
|
502
|
+
await swarm({ operation: "sync", action: "pull" }); // Sync completed back
|
|
489
503
|
await bash("br close parent-task --reason 'Swarm completed'");
|
|
490
504
|
```
|
|
491
505
|
|
|
@@ -493,54 +507,58 @@ await bash("br close parent-task --reason 'Swarm completed'");
|
|
|
493
507
|
|
|
494
508
|
```
|
|
495
509
|
SWARM LAUNCH (PARL):
|
|
496
|
-
0. SETUP:
|
|
510
|
+
0. SETUP: swarm({ operation: "sync", action: "push" })
|
|
497
511
|
→ Make Beads visible to subagents
|
|
498
|
-
1. ANALYZE: swarm
|
|
512
|
+
1. ANALYZE: swarm({ operation: "plan", action: "analyze", task: userRequest, files: detectedFiles })
|
|
499
513
|
→ Get classification, phases, dependency_graph
|
|
500
|
-
2. CHECK: swarm
|
|
514
|
+
2. CHECK: swarm({ operation: "plan", action: "check", ... })
|
|
501
515
|
→ Detect/prevent serial collapse
|
|
502
|
-
3. DELEGATE:
|
|
516
|
+
3. DELEGATE: swarm({ operation: "delegate", ... })
|
|
503
517
|
→ Create packets for each worker
|
|
504
518
|
4. SPAWN: Task({ subagent_type: "general" })
|
|
505
519
|
→ Launch workers using parallelizable_groups order
|
|
506
|
-
5. MONITOR:
|
|
520
|
+
5. MONITOR: swarm({ operation: "monitor", action: "render_block" })
|
|
507
521
|
→ Real-time TUI progress
|
|
508
522
|
6. VERIFY: npm run typecheck && npm run lint && npm test
|
|
509
|
-
7. CLOSE:
|
|
523
|
+
7. CLOSE: swarm({ operation: "sync", action: "pull" }) && br close <bead>
|
|
510
524
|
|
|
511
525
|
WORKER EXECUTION:
|
|
512
526
|
1. Read delegation packet
|
|
513
|
-
2. Report START:
|
|
527
|
+
2. Report START: swarm({ operation: "monitor", action: "progress_update", progress: 0, status: "working" })
|
|
514
528
|
3. Execute with constraints
|
|
515
|
-
4. Report PROGRESS (every 25%):
|
|
529
|
+
4. Report PROGRESS (every 25%): swarm({ operation: "monitor", action: "progress_update", progress: 25/50/75 })
|
|
516
530
|
5. Run acceptance checks
|
|
517
|
-
6. Report DONE:
|
|
531
|
+
6. Report DONE: swarm({ operation: "monitor", action: "progress_update", progress: 100, status: "completed" })
|
|
518
532
|
|
|
519
533
|
COORDINATION:
|
|
520
|
-
- Progress: .beads/swarm-progress.jsonl (via swarm
|
|
521
|
-
- Delegation: .beads/artifacts/<id>/delegation.md (via swarm
|
|
522
|
-
- Analysis: swarm
|
|
534
|
+
- Progress: .beads/swarm-progress.jsonl (via swarm monitor)
|
|
535
|
+
- Delegation: .beads/artifacts/<id>/delegation.md (via swarm delegate)
|
|
536
|
+
- Analysis: swarm tool for classification + dependency graphs
|
|
523
537
|
|
|
524
538
|
RECOVERY:
|
|
525
|
-
- Check:
|
|
526
|
-
- Use shared task lists:
|
|
539
|
+
- Check: swarm({ operation: "monitor", action: "status" })
|
|
540
|
+
- Use shared task lists: swarm({ operation: "sync", action: "create_shared" })
|
|
527
541
|
- Continue with remaining workers
|
|
528
542
|
|
|
529
543
|
SHUTDOWN:
|
|
530
|
-
- All workers done →
|
|
544
|
+
- All workers done → swarm({ operation: "monitor", action: "clear" })
|
|
531
545
|
- Run full test suite
|
|
532
|
-
-
|
|
546
|
+
- swarm({ operation: "sync", action: "pull" })
|
|
533
547
|
- Close parent bead
|
|
534
548
|
```
|
|
535
549
|
|
|
536
550
|
## Tools Reference
|
|
537
551
|
|
|
538
|
-
| Tool
|
|
539
|
-
|
|
|
540
|
-
| **swarm
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
552
|
+
| Tool | Purpose | Key Operations |
|
|
553
|
+
| --------- | -------------------------- | ------------------------------------- |
|
|
554
|
+
| **swarm** | Unified swarm coordination | `plan`, `monitor`, `delegate`, `sync` |
|
|
555
|
+
|
|
556
|
+
**swarm operations:**
|
|
557
|
+
|
|
558
|
+
- `plan`: Task analysis + dependency DAG (actions: analyze, classify, check, allocate)
|
|
559
|
+
- `delegate`: Create delegation packets
|
|
560
|
+
- `monitor`: Progress tracking + visualization (actions: progress_update, render_block, status, clear)
|
|
561
|
+
- `sync`: Beads ↔ OpenCode todos (actions: push, pull, create_shared, get_shared, update_shared, list_shared)
|
|
544
562
|
|
|
545
563
|
## Tmux Integration (Visual Swarm Monitoring)
|
|
546
564
|
|
|
@@ -681,7 +699,7 @@ This renders the beautiful TUI block and shows:
|
|
|
681
699
|
|
|
682
700
|
1. **Leader spawns, workers execute** - Clear role separation
|
|
683
701
|
2. **Delegation packets are contracts** - Workers follow them strictly
|
|
684
|
-
3. **Progress tracking for coordination** - All status via swarm
|
|
702
|
+
3. **Progress tracking for coordination** - All status via swarm monitor progress updates
|
|
685
703
|
4. **Non-overlapping assignments** - Ensure workers edit different files
|
|
686
704
|
5. **Acceptance checks required** - Workers verify before reporting done
|
|
687
705
|
6. **Persist periodically** - Enable cross-session recovery
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
name: tool-priority
|
|
2
3
|
description: Use when choosing between tools or need tool reference - covers LSP, search, swarm, memory, and research tools with correct syntax
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -13,8 +14,8 @@ description: Use when choosing between tools or need tool reference - covers LSP
|
|
|
13
14
|
3. **glob** - File discovery by name pattern
|
|
14
15
|
4. **skill** - Load skills for specialized knowledge
|
|
15
16
|
5. **task** - Parallel subagent execution
|
|
16
|
-
6. **Swarm
|
|
17
|
-
7. **Memory tools** - memory-search, memory-read, memory-update
|
|
17
|
+
6. **Swarm tool** - swarm (plan, monitor, delegate, sync operations)
|
|
18
|
+
7. **Memory tools** - memory-search, memory-read, memory-update, memory-admin
|
|
18
19
|
8. **Research tools** - context7, websearch, codesearch, grepsearch
|
|
19
20
|
9. **read/edit/write** - File operations (always read before edit)
|
|
20
21
|
|
|
@@ -94,12 +95,16 @@ Task({
|
|
|
94
95
|
|
|
95
96
|
### Swarm Coordination Tools
|
|
96
97
|
|
|
97
|
-
| Tool
|
|
98
|
-
|
|
|
99
|
-
| **
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
| Tool | Purpose | Key Operations |
|
|
99
|
+
| --------- | -------------------------- | ------------------------------------- |
|
|
100
|
+
| **swarm** | Unified swarm coordination | `plan`, `monitor`, `delegate`, `sync` |
|
|
101
|
+
|
|
102
|
+
**swarm operations:**
|
|
103
|
+
|
|
104
|
+
- `plan`: Task analysis (actions: analyze, classify, check, allocate)
|
|
105
|
+
- `monitor`: Progress tracking (actions: progress_update, render_block, status, clear)
|
|
106
|
+
- `delegate`: Create delegation packets for workers
|
|
107
|
+
- `sync`: Beads ↔ OpenCode sync (actions: push, pull, create_shared, update_shared)
|
|
103
108
|
|
|
104
109
|
### Memory Tools
|
|
105
110
|
|
|
@@ -112,15 +117,19 @@ Task({
|
|
|
112
117
|
|
|
113
118
|
### Research Tools
|
|
114
119
|
|
|
115
|
-
| Tool
|
|
116
|
-
|
|
|
117
|
-
| **
|
|
118
|
-
| **
|
|
119
|
-
| **
|
|
120
|
-
| **
|
|
121
|
-
| **
|
|
122
|
-
| **
|
|
123
|
-
|
|
120
|
+
| Tool | Purpose | When to Use |
|
|
121
|
+
| ----------------- | ---------------------------- | ----------------------- |
|
|
122
|
+
| **context7** | Library documentation lookup | API reference, examples |
|
|
123
|
+
| **websearch** | Recent info, troubleshooting | Docs not in Context7 |
|
|
124
|
+
| **codesearch** | Real implementation patterns | GitHub code examples |
|
|
125
|
+
| **grepsearch** | Cross-repo patterns | grep.app search |
|
|
126
|
+
| **webfetch** | Specific URL content | User-provided links |
|
|
127
|
+
| **review (Task)** | Second opinion | Validate approach |
|
|
128
|
+
|
|
129
|
+
**context7 operations:**
|
|
130
|
+
|
|
131
|
+
- `resolve`: Find library ID from name (e.g., "react" → "/reactjs/react.dev")
|
|
132
|
+
- `query`: Get documentation for a library topic
|
|
124
133
|
|
|
125
134
|
## Workflow Pattern
|
|
126
135
|
|
|
@@ -244,14 +253,14 @@ SEARCHING:
|
|
|
244
253
|
|
|
245
254
|
PARALLEL WORK:
|
|
246
255
|
Task({ subagent_type: "explore", ... }) → Parallel subagent
|
|
247
|
-
|
|
248
|
-
|
|
256
|
+
swarm({ operation: "sync", action: "push" }) → Sync to todos
|
|
257
|
+
swarm({ operation: "monitor", action: "progress_update" }) → Track progress
|
|
249
258
|
|
|
250
259
|
RESEARCH:
|
|
251
|
-
|
|
252
|
-
|
|
260
|
+
context7({ operation: "resolve", libraryName: "..." })
|
|
261
|
+
context7({ operation: "query", libraryId: "...", topic: "..." })
|
|
253
262
|
websearch({ query: "..." })
|
|
254
|
-
Task({ subagent_type: "review", description: "Second opinion", prompt: "Review the approach." })
|
|
263
|
+
Task({ subagent_type: "review", description: "Second opinion", prompt: "Review the approach." })
|
|
255
264
|
|
|
256
265
|
MEMORY:
|
|
257
266
|
memory_search({ query: "..." }) → Find past learnings
|