opencodekit 0.15.21 → 0.16.0

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 (116) hide show
  1. package/dist/index.js +5 -7
  2. package/dist/template/.opencode/AGENTS.md +21 -20
  3. package/dist/template/.opencode/agent/build.md +88 -7
  4. package/dist/template/.opencode/agent/explore.md +1 -1
  5. package/dist/template/.opencode/agent/general.md +54 -4
  6. package/dist/template/.opencode/agent/looker.md +1 -1
  7. package/dist/template/.opencode/agent/painter.md +1 -1
  8. package/dist/template/.opencode/agent/plan.md +52 -0
  9. package/dist/template/.opencode/agent/review.md +1 -1
  10. package/dist/template/.opencode/agent/scout.md +3 -3
  11. package/dist/template/.opencode/agent/vision.md +1 -1
  12. package/dist/template/.opencode/command/create.md +201 -95
  13. package/dist/template/.opencode/command/design.md +5 -7
  14. package/dist/template/.opencode/command/handoff.md +7 -0
  15. package/dist/template/.opencode/command/init.md +25 -47
  16. package/dist/template/.opencode/command/plan.md +35 -16
  17. package/dist/template/.opencode/command/resume.md +7 -18
  18. package/dist/template/.opencode/command/ship.md +156 -0
  19. package/dist/template/.opencode/command/start.md +315 -28
  20. package/dist/template/.opencode/command/ui-review.md +5 -7
  21. package/dist/template/.opencode/command/verify.md +279 -0
  22. package/dist/template/.opencode/memory/_templates/README.md +57 -19
  23. package/dist/template/.opencode/memory/_templates/prd.md +29 -0
  24. package/dist/template/.opencode/memory/_templates/project/tech-stack.md +50 -0
  25. package/dist/template/.opencode/memory/_templates/proposal.md +38 -0
  26. package/dist/template/.opencode/memory/_templates/spec.md +66 -0
  27. package/dist/template/.opencode/memory/_templates/tasks.md +198 -0
  28. package/dist/template/.opencode/memory/observations/2026-02-01-decision-add-skills-vs-commands-to-global-agents-.md +15 -0
  29. package/dist/template/.opencode/memory/observations/2026-02-01-decision-build-agent-auto-loads-skills-contextual.md +31 -0
  30. package/dist/template/.opencode/memory/observations/2026-02-01-decision-fixed-agent-configuration-for-opencodeki.md +25 -0
  31. package/dist/template/.opencode/memory/observations/2026-02-01-decision-focused-agents-md-upgrade-for-opencode-k.md +14 -0
  32. package/dist/template/.opencode/memory/observations/2026-02-01-decision-implement-tier-1-permission-upgrades.md +15 -0
  33. package/dist/template/.opencode/memory/observations/2026-02-01-decision-instructions-config-explicit-paths-not-w.md +40 -0
  34. package/dist/template/.opencode/memory/observations/2026-02-01-decision-merged-context-into-memory-project-singl.md +42 -0
  35. package/dist/template/.opencode/memory/observations/2026-02-01-decision-oracle-tool-should-use-review-agent-not-.md +14 -0
  36. package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-agent-auto-loads-skills-contextuall.md +31 -0
  37. package/dist/template/.opencode/memory/observations/2026-02-01-decision-plan-phased-oracle-command-merge-into-ne.md +14 -0
  38. package/dist/template/.opencode/memory/observations/2026-02-01-decision-prd-workflow-uses-prd-and-prd-task-skill.md +23 -0
  39. package/dist/template/.opencode/memory/observations/2026-02-01-decision-prefer-review-agent-via-opencode-cli-ove.md +14 -0
  40. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-add-ship-command-with.md +14 -0
  41. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command-.md +14 -0
  42. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-oracle-tool-and-add-ship-command.md +14 -0
  43. package/dist/template/.opencode/memory/observations/2026-02-01-decision-remove-skills-vs-commands-section-from-a.md +14 -0
  44. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-tool-with-ship-command-fl.md +14 -0
  45. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-oracle-with-ship-command-workflo.md +14 -0
  46. package/dist/template/.opencode/memory/observations/2026-02-01-decision-replace-proxypal-oracle-with-cli-review-.md +14 -0
  47. package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-dist-template-only-tech-stack.md +50 -0
  48. package/dist/template/.opencode/memory/observations/2026-02-01-decision-simplified-templates-only-tech-stack-md.md +26 -0
  49. package/dist/template/.opencode/memory/observations/2026-02-01-decision-subagents-load-minimal-skills-stay-lean.md +29 -0
  50. package/dist/template/.opencode/memory/observations/2026-02-01-decision-user-approved-permission-upgrades-in-ope.md +15 -0
  51. package/dist/template/.opencode/memory/observations/2026-02-01-discovery-verify-command-already-implemented.md +28 -0
  52. package/dist/template/.opencode/memory/observations/2026-02-01-feature-openspec-phase-b-complete-template-upgra.md +43 -0
  53. package/dist/template/.opencode/memory/observations/2026-02-01-learning-build-agent-should-use-dynamic-lsp-not-f.md +14 -0
  54. package/dist/template/.opencode/memory/observations/2026-02-01-learning-kimi-k2-5-model-requires-temperature-1-0.md +22 -0
  55. package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-already-imple.md +27 -0
  56. package/dist/template/.opencode/memory/observations/2026-02-01-learning-opencode-context-injection-uses-instruct.md +35 -0
  57. package/dist/template/.opencode/memory/observations/2026-02-01-learning-update-build-agent-prompt-to-use-context.md +14 -0
  58. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-using-opencode-expert-.md +14 -0
  59. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-g.md +14 -0
  60. package/dist/template/.opencode/memory/observations/2026-02-01-learning-upgrade-agents-md-with-opencode-expert-r.md +14 -0
  61. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-prefers-copilot-gpt-5-2-codex-mediu.md +14 -0
  62. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-contextu.md +15 -0
  63. package/dist/template/.opencode/memory/observations/2026-02-01-learning-user-wants-general-agent-prompt-reviewed.md +15 -0
  64. package/dist/template/.opencode/memory/project/command-rules.md +122 -0
  65. package/dist/template/.opencode/memory/project/tech-stack.md +50 -0
  66. package/dist/template/.opencode/memory/research/ccpm-analysis.md +334 -0
  67. package/dist/template/.opencode/memory/research/openspec-analysis.md +226 -0
  68. package/dist/template/.opencode/opencode.json +916 -803
  69. package/dist/template/.opencode/skill/tool-priority/SKILL.md +2 -2
  70. package/package.json +1 -1
  71. package/dist/template/.opencode/command/accessibility-check.md +0 -331
  72. package/dist/template/.opencode/command/agent-browser.md +0 -21
  73. package/dist/template/.opencode/command/analyze-mockup.md +0 -423
  74. package/dist/template/.opencode/command/analyze-project.md +0 -295
  75. package/dist/template/.opencode/command/brainstorm.md +0 -373
  76. package/dist/template/.opencode/command/cloudflare.md +0 -70
  77. package/dist/template/.opencode/command/commit.md +0 -245
  78. package/dist/template/.opencode/command/complete-next-task.md +0 -77
  79. package/dist/template/.opencode/command/design-audit.md +0 -480
  80. package/dist/template/.opencode/command/edit-image.md +0 -242
  81. package/dist/template/.opencode/command/finish.md +0 -255
  82. package/dist/template/.opencode/command/fix-ci.md +0 -109
  83. package/dist/template/.opencode/command/fix-types.md +0 -104
  84. package/dist/template/.opencode/command/fix-ui.md +0 -117
  85. package/dist/template/.opencode/command/fix.md +0 -168
  86. package/dist/template/.opencode/command/frontend-design.md +0 -21
  87. package/dist/template/.opencode/command/generate-diagram.md +0 -349
  88. package/dist/template/.opencode/command/generate-icon.md +0 -283
  89. package/dist/template/.opencode/command/generate-image.md +0 -246
  90. package/dist/template/.opencode/command/generate-pattern.md +0 -247
  91. package/dist/template/.opencode/command/generate-storyboard.md +0 -250
  92. package/dist/template/.opencode/command/implement.md +0 -609
  93. package/dist/template/.opencode/command/import-plan.md +0 -406
  94. package/dist/template/.opencode/command/index-knowledge.md +0 -25
  95. package/dist/template/.opencode/command/integration-test.md +0 -424
  96. package/dist/template/.opencode/command/issue.md +0 -102
  97. package/dist/template/.opencode/command/new-feature.md +0 -651
  98. package/dist/template/.opencode/command/opensrc.md +0 -58
  99. package/dist/template/.opencode/command/quick-build.md +0 -238
  100. package/dist/template/.opencode/command/ralph.md +0 -41
  101. package/dist/template/.opencode/command/research-and-implement.md +0 -148
  102. package/dist/template/.opencode/command/research-ui.md +0 -466
  103. package/dist/template/.opencode/command/restore-image.md +0 -424
  104. package/dist/template/.opencode/command/revert-feature.md +0 -386
  105. package/dist/template/.opencode/command/skill-create.md +0 -517
  106. package/dist/template/.opencode/command/skill-optimize.md +0 -556
  107. package/dist/template/.opencode/command/summarize.md +0 -412
  108. package/dist/template/.opencode/command/triage.md +0 -398
  109. package/dist/template/.opencode/memory/_templates/project/architecture.md +0 -60
  110. package/dist/template/.opencode/memory/_templates/project/commands.md +0 -72
  111. package/dist/template/.opencode/memory/_templates/project/conventions.md +0 -68
  112. package/dist/template/.opencode/memory/_templates/project/gotchas.md +0 -41
  113. package/dist/template/.opencode/skill/notebooklm/SKILL.md +0 -272
  114. package/dist/template/.opencode/skill/notebooklm/references/setup.md +0 -353
  115. package/dist/template/.opencode/tool/notebooklm.ts +0 -488
  116. package/dist/template/.opencode/tool/oracle.ts +0 -240
@@ -0,0 +1,156 @@
1
+ ---
2
+ description: Ship a bead - implement, verify, review, close
3
+ argument-hint: "<bead-id> [--parallel] [--swarm]"
4
+ agent: build
5
+ ---
6
+
7
+ # Ship: $ARGUMENTS
8
+
9
+ This command combines implementation and finish gates. It implements, verifies, runs review, then closes.
10
+
11
+ ## Load Skills
12
+
13
+ ```typescript
14
+ skill({ name: "beads" });
15
+ skill({ name: "test-driven-development" });
16
+ skill({ name: "verification-before-completion" });
17
+ skill({ name: "finishing-a-development-branch" });
18
+ skill({ name: "receiving-code-review" });
19
+ skill({ name: "swarm-coordination" });
20
+ skill({ name: "beads-bridge" });
21
+ ```
22
+
23
+ ## Skill Routing
24
+
25
+ - Use **systematic-debugging** when a gate fails and root cause is unclear.
26
+ - Use **receiving-code-review** to triage review feedback after the review agent runs.
27
+
28
+ ## Verify Task & Claim
29
+
30
+ ```bash
31
+ bd show $ARGUMENTS
32
+ bd update $ARGUMENTS --status in_progress
33
+ ```
34
+
35
+ ## Pre-Flight Verification
36
+
37
+ Run `/verify $ARGUMENTS --quick` to check:
38
+
39
+ - All spec requirements addressed
40
+ - All gates passing
41
+ - No obvious contradictions
42
+
43
+ If verification fails, fix issues before proceeding.
44
+
45
+ ## Implement (Keep It Focused)
46
+
47
+ - Read before edit
48
+ - Delegate research if unclear (Task → explore/scout)
49
+ - Keep scope ≤ 3 files or create subtasks
50
+
51
+ If the task is large (3+ independent subtasks), use swarm mode.
52
+
53
+ ## Run Verification Gates
54
+
55
+ Detect project type:
56
+
57
+ ```bash
58
+ ls package.json Cargo.toml pyproject.toml go.mod Makefile 2>/dev/null
59
+ ```
60
+
61
+ **Node/TypeScript:**
62
+
63
+ ```bash
64
+ npm run build 2>/dev/null || true
65
+ npm test
66
+ npm run lint 2>/dev/null || true
67
+ npm run typecheck 2>/dev/null || true
68
+ ```
69
+
70
+ **Rust:**
71
+
72
+ ```bash
73
+ cargo build
74
+ cargo test
75
+ cargo clippy -- -D warnings
76
+ ```
77
+
78
+ **Python:**
79
+
80
+ ```bash
81
+ pytest
82
+ ruff check .
83
+ mypy . 2>/dev/null || true
84
+ ```
85
+
86
+ **Go:**
87
+
88
+ ```bash
89
+ go build ./...
90
+ go test ./...
91
+ golangci-lint run
92
+ ```
93
+
94
+ If ANY gate fails, stop and fix before proceeding.
95
+
96
+ ## Stage Changes For Review
97
+
98
+ ```bash
99
+ git add -A
100
+ git status
101
+ git diff --cached --stat
102
+ ```
103
+
104
+ ## Spawn Review Agent (After Tests)
105
+
106
+ ```typescript
107
+ Task({
108
+ subagent_type: "review",
109
+ description: "Review changes for $ARGUMENTS",
110
+ prompt: `Review the staged changes for bead $ARGUMENTS.
111
+
112
+ Context:
113
+ - Use git status and git diff --cached to see changes
114
+ - Focus on correctness, edge cases, and risks
115
+ - Report issues with file:line references
116
+
117
+ Return:
118
+ - Summary of findings
119
+ - Critical/High/Medium issues (if any)
120
+ `,
121
+ });
122
+ ```
123
+
124
+ If review finds issues, fix them, re-run verification gates, then re-run review.
125
+
126
+ ## Verify Success Criteria
127
+
128
+ ```bash
129
+ cat .beads/artifacts/$ARGUMENTS/spec.md
130
+ ```
131
+
132
+ Ensure all criteria are met before closing.
133
+
134
+ ## Close Bead (Ask First)
135
+
136
+ ```typescript
137
+ question({
138
+ questions: [
139
+ {
140
+ header: "Close",
141
+ question: "Ship complete. Close bead $ARGUMENTS?",
142
+ options: [
143
+ { label: "Yes, close it (Recommended)", description: "All gates passed" },
144
+ { label: "No, keep open", description: "Need more work" },
145
+ ],
146
+ },
147
+ ],
148
+ });
149
+ ```
150
+
151
+ If confirmed:
152
+
153
+ ```bash
154
+ bd close $ARGUMENTS --reason "Shipped: verification + review passed"
155
+ bd sync
156
+ ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Start working on a bead - claim it and prepare context
3
- argument-hint: "<bead-id> [--worktree] [--research]"
3
+ argument-hint: "<bead-id> [--worktree] [--research] [--parallel]"
4
4
  agent: build
5
5
  ---
6
6
 
@@ -8,6 +8,9 @@ agent: build
8
8
 
9
9
  You're claiming a task and preparing to work on it. This is the entry point before implementation.
10
10
 
11
+ > **CCPM Philosophy:** One issue ≠ one task. One issue = multiple parallel work streams.
12
+ > Agents are "context firewalls" - they do heavy work and return concise summaries.
13
+
11
14
  ## Parse Arguments
12
15
 
13
16
  | Argument | Default | Description |
@@ -15,12 +18,15 @@ You're claiming a task and preparing to work on it. This is the entry point befo
15
18
  | `<bead-id>` | required | The bead to start working on |
16
19
  | `--worktree` | false | Create isolated git worktree for this work |
17
20
  | `--research` | false | Run parallel subagent research before starting |
21
+ | `--parallel` | auto | Analyze and spawn parallel work streams |
18
22
 
19
23
  ## Load Skills
20
24
 
21
25
  ```typescript
22
26
  skill({ name: "beads" });
23
27
  skill({ name: "beads-bridge" }); // For cross-session todo coordination
28
+ skill({ name: "prd" }); // PRD creation workflow
29
+ skill({ name: "prd-task" }); // PRD to executable tasks conversion
24
30
  ```
25
31
 
26
32
  ## Ensure Git Hooks Installed
@@ -218,13 +224,42 @@ Task({
218
224
  Look for:
219
225
 
220
226
  - `spec.md` - Requirements and constraints
221
- - `prd.md` - PRD (optional, recommended for features)
222
- - `prd.json` - PRD tasks (generated from prd.md)
227
+ - `prd.md` - PRD created via `prd` skill (defines WHAT to build)
228
+ - `prd.json` - Executable tasks from `prd-task` skill
223
229
  - `progress.txt` - PRD execution progress (append-only)
224
230
  - `research.md` - Previous research
225
231
  - `plan.md` - Implementation plan
226
232
  - `handoffs/` - Previous session handoffs
227
233
 
234
+ ### PRD Workflow (if prd.md exists but no prd.json)
235
+
236
+ If `prd.md` exists but `prd.json` doesn't, convert PRD to tasks:
237
+
238
+ ```typescript
239
+ // The prd-task skill converts PRD markdown to executable JSON
240
+ // Read prd.md → Extract ## Tasks section → Write prd.json
241
+ skill({ name: "prd-task" });
242
+
243
+ // Then parse the PRD
244
+ // This creates:
245
+ // - .beads/artifacts/$ARGUMENTS/prd.json (task list)
246
+ // - .beads/artifacts/$ARGUMENTS/progress.txt (progress log)
247
+ ```
248
+
249
+ ### PRD Workflow (if neither exists)
250
+
251
+ If no PRD exists and task is complex (epic/feature), consider creating one:
252
+
253
+ ```typescript
254
+ // The prd skill guides PRD creation with:
255
+ // - Clarifying questions (5-7 max)
256
+ // - Problem/solution framing
257
+ // - Machine-convertible Tasks section
258
+ skill({ name: "prd" });
259
+
260
+ // Creates: .beads/artifacts/$ARGUMENTS/prd.md
261
+ ```
262
+
228
263
  ## Check Previous Sessions
229
264
 
230
265
  ```typescript
@@ -240,21 +275,10 @@ Search for relevant past work and learnings before starting:
240
275
 
241
276
  ```typescript
242
277
  // Find similar past work (semantic similarity)
243
- memory -
244
- search({
245
- query: "[task title/description from bead]",
246
- mode: "semantic",
247
- limit: 3,
248
- });
278
+ memory_search({ query: "[task title/description from bead]", limit: 3 });
249
279
 
250
280
  // Find related observations (gotchas, patterns, learnings)
251
- memory -
252
- search({
253
- query: "[task keywords]",
254
- mode: "semantic",
255
- type: "observation",
256
- limit: 3,
257
- });
281
+ memory_search({ query: "[task keywords] gotchas patterns", limit: 3 });
258
282
  ```
259
283
 
260
284
  **Review findings before diving in.** Past observations may contain:
@@ -265,10 +289,196 @@ memory -
265
289
 
266
290
  If memory search fails (Ollama not running), continue without it.
267
291
 
292
+ ## Parallel Stream Analysis (if --parallel flag or epic/task type)
293
+
294
+ > **CCPM Insight:** A single task isn't one unit of work. It's multiple parallel work streams.
295
+ > Streams are determined by analyzing the ACTUAL task requirements, not hardcoded categories.
296
+
297
+ ### Step 1: Analyze Work Streams
298
+
299
+ Use swarm planning to analyze the specific task:
300
+
301
+ ```typescript
302
+ // Get task details from bead
303
+ const beadInfo = bd show $ARGUMENTS --json;
304
+ const taskTitle = beadInfo.title;
305
+ const taskDescription = beadInfo.description;
306
+
307
+ // Read spec/plan if exists for file context
308
+ const specContent = read(".beads/artifacts/$ARGUMENTS/spec.md");
309
+ const planContent = read(".beads/artifacts/$ARGUMENTS/plan.md");
310
+
311
+ // Analyze THIS SPECIFIC task for parallel execution
312
+ const analysis = swarm_plan({
313
+ operation: "analyze",
314
+ task: taskTitle, // User's actual task
315
+ context: taskDescription, // User's requirements
316
+ files: "[files from spec/plan]", // Actual affected files
317
+ });
318
+ ```
319
+
320
+ The analysis returns **task-specific** streams:
321
+
322
+ ```typescript
323
+ // Example analysis result (varies per task):
324
+ {
325
+ classification: "search", // Can parallelize
326
+ recommended_agents: 3,
327
+ streams: [
328
+ { id: "stream-1", scope: "src/auth/*", purpose: "Authentication logic" },
329
+ { id: "stream-2", scope: "src/api/auth/*", purpose: "Auth endpoints" },
330
+ { id: "stream-3", scope: "tests/auth/*", purpose: "Auth test coverage" },
331
+ ]
332
+ }
333
+ ```
334
+
335
+ ### Step 2: Create Dynamic Delegation Packets
336
+
337
+ **For EACH stream from analysis** (not hardcoded):
338
+
339
+ ```typescript
340
+ // Iterate over streams from analysis - these are DYNAMIC based on task
341
+ for (const stream of analysis.streams) {
342
+ swarm_delegate({
343
+ bead_id: "$ARGUMENTS",
344
+ title: stream.purpose, // From analysis, not hardcoded
345
+ expected_outcome: `Complete ${stream.purpose} for task requirements`,
346
+ required_tools: "read, grep, lsp, edit, bash",
347
+ must_do: "LSP before edits, verify changes, run relevant tests",
348
+ must_not_do: "no new deps without approval, stay within assigned scope",
349
+ acceptance_checks: "[derived from spec.md acceptance criteria]",
350
+ context: `Files: ${stream.scope}, Purpose: ${stream.purpose}`,
351
+ write: true,
352
+ });
353
+ }
354
+ ```
355
+
356
+ ### Step 3: Spawn Workers for Each Stream
357
+
358
+ ```typescript
359
+ // Launch workers based on ACTUAL analysis results
360
+ for (const stream of analysis.streams) {
361
+ // Initialize monitoring for this stream
362
+ swarm_monitor({
363
+ operation: "progress_update",
364
+ team_name: "$ARGUMENTS-swarm",
365
+ worker_id: stream.id,
366
+ phase: "starting",
367
+ progress: 0,
368
+ status: "working",
369
+ file: stream.scope,
370
+ });
371
+
372
+ // Spawn worker with task-specific instructions
373
+ Task({
374
+ subagent_type: "general",
375
+ description: `${stream.id}: ${stream.purpose}`,
376
+ prompt: `Execute work stream for $ARGUMENTS.
377
+
378
+ **Your Assignment:**
379
+ - Scope: ${stream.scope}
380
+ - Purpose: ${stream.purpose}
381
+
382
+ **Load Context:**
383
+ - Delegation: .beads/artifacts/$ARGUMENTS/delegation.md
384
+ - Spec: .beads/artifacts/$ARGUMENTS/spec.md (if exists)
385
+
386
+ **Work:**
387
+ Complete all work within your assigned scope that fulfills the task requirements.
388
+
389
+ **Return CONCISE summary only:**
390
+ - Files modified: [list]
391
+ - Changes made: [brief description]
392
+ - Verification: [pass/fail + what was checked]
393
+
394
+ DO NOT return verbose output or file contents.`,
395
+ });
396
+ }
397
+
398
+ // All workers execute in parallel, results return when complete
399
+ ```
400
+
401
+ ### Step 4: Monitor Progress
402
+
403
+ ```typescript
404
+ // Render progress visualization
405
+ swarm_monitor({
406
+ operation: "render_block",
407
+ team_name: "$ARGUMENTS-swarm",
408
+ });
409
+ ```
410
+
411
+ **Output shows ACTUAL streams (dynamic):**
412
+
413
+ ```
414
+ ┌─ $ARGUMENTS-swarm ──────────────────────────┐
415
+ │ stream-1 [████████░░] 80% src/auth/* │
416
+ │ stream-2 [██████░░░░] 60% src/api/auth/* │
417
+ │ stream-3 [████░░░░░░] 40% tests/auth/* │
418
+ └─────────────────────────────────────────────┘
419
+ ```
420
+
421
+ ### Anti-Serial-Collapse Check
422
+
423
+ Before proceeding, verify parallelization makes sense:
424
+
425
+ ```typescript
426
+ swarm_plan({
427
+ operation: "check",
428
+ task: taskTitle,
429
+ files: analysis.streams.length,
430
+ recommended_agents: analysis.recommended_agents,
431
+ });
432
+ ```
433
+
434
+ **Warning signs:**
435
+
436
+ - Only 1 stream identified for multi-file task
437
+ - All streams depend on each other (should be sequential)
438
+ - Same files appear in multiple streams (conflict risk)
439
+
440
+ ### When NOT to Parallelize
441
+
442
+ Skip parallel analysis if:
443
+
444
+ - Task is a `subtask` (leaf-level, already atomic)
445
+ - Only 1-2 files affected
446
+ - Sequential dependency chain (each step needs previous)
447
+ - User explicitly passed `--no-parallel`
448
+
268
449
  ## PRD Tasks (If Present)
269
450
 
270
- - If `.beads/artifacts/$ARGUMENTS/prd.json` exists: next is `/complete-next-task $ARGUMENTS`.
271
- - If `.beads/artifacts/$ARGUMENTS/prd.md` exists but `prd.json` does not: generate tasks with `prd-task` (see `/create` for the full PRD workflow).
451
+ If `.beads/artifacts/$ARGUMENTS/prd.json` exists, execution is PRD-driven:
452
+
453
+ ```typescript
454
+ // Load the prd-task skill for execution guidance
455
+ skill({ name: "prd-task" });
456
+
457
+ // Read task list
458
+ const prdJson = read(".beads/artifacts/$ARGUMENTS/prd.json");
459
+ const tasks = JSON.parse(prdJson).tasks;
460
+
461
+ // Find next incomplete task
462
+ const nextTask = tasks.find((t) => !t.passes);
463
+
464
+ if (nextTask) {
465
+ console.log(`Next PRD task: ${nextTask.id}`);
466
+ console.log(`Description: ${nextTask.description}`);
467
+ console.log(`Verification steps:`);
468
+ nextTask.steps.forEach((s) => console.log(` - ${s}`));
469
+ }
470
+ ```
471
+
472
+ **PRD execution flow:**
473
+
474
+ 1. Read `prd.json` for task list
475
+ 2. Find next task where `passes: false`
476
+ 3. Implement to satisfy verification steps
477
+ 4. Mark `passes: true` when verification passes
478
+ 5. Append progress to `progress.txt`
479
+ 6. Repeat until all tasks pass
480
+
481
+ Proceed directly to implementation using the PRD tasks as the guide.
272
482
 
273
483
  ## Determine Next Step
274
484
 
@@ -280,17 +490,28 @@ Based on task type and what exists:
280
490
  | ------------------ | --------------------------------- |
281
491
  | No subtasks | `/plan $ARGUMENTS --create-beads` |
282
492
  | Has ready subtasks | `/start <first-subtask-id>` |
283
- | All subtasks done | `/finish $ARGUMENTS` |
493
+ | All subtasks done | `/ship $ARGUMENTS` |
284
494
 
285
495
  ### For Tasks/Subtasks (leaf work)
286
496
 
287
- | Artifacts Found | Next Command |
288
- | --------------------- | -------------------------------- |
289
- | Nothing | `/research $ARGUMENTS` |
290
- | Only spec.md | `/plan $ARGUMENTS` |
291
- | spec.md + research.md | `/plan $ARGUMENTS` |
292
- | plan.md exists | `/implement $ARGUMENTS` |
293
- | prd.json exists | `/complete-next-task $ARGUMENTS` |
497
+ | Artifacts Found | Next Step |
498
+ | --------------------- | ----------------------------------------- |
499
+ | Nothing | `/research $ARGUMENTS` or create PRD |
500
+ | Only spec.md | `/plan $ARGUMENTS` or create PRD |
501
+ | prd.md (no prd.json) | Run `prd-task` skill to convert to tasks |
502
+ | prd.json exists | `/ship $ARGUMENTS` (PRD-driven execution) |
503
+ | spec.md + research.md | `/plan $ARGUMENTS` |
504
+ | plan.md exists | `/ship $ARGUMENTS` |
505
+
506
+ ### PRD vs Plan Decision
507
+
508
+ | Situation | Use PRD | Use Plan |
509
+ | ------------------------------------ | ----------------------- | ------------------ |
510
+ | New feature with unclear scope | ✅ Ask questions first | ❌ |
511
+ | Bug fix or small change | ❌ | ✅ Quick plan |
512
+ | Multi-session epic | ✅ PRD for each subtask | ✅ High-level plan |
513
+ | Refactoring with known scope | ❌ | ✅ Plan with tasks |
514
+ | Feature needing stakeholder sign-off | ✅ PRD for review | ❌ |
294
515
 
295
516
  ## Output
296
517
 
@@ -311,8 +532,35 @@ Artifacts:
311
532
  • spec.md: [exists/missing]
312
533
  • research.md: [exists/missing]
313
534
  • plan.md: [exists/missing]
314
-
315
- Research: [launched/skipped]
535
+ • prd.md: [exists/missing]
536
+ • prd.json: [exists/missing] ([N] tasks, [M] complete)
537
+
538
+ [If PRD exists:]
539
+ ┌─ PRD Progress ──────────────────────────┐
540
+ │ Tasks: [completed]/[total] │
541
+ │ Next: [task-id] - [description] │
542
+ │ Verification: │
543
+ │ • [step 1] │
544
+ │ • [step 2] │
545
+ └─────────────────────────────────────────┘
546
+
547
+ ┌─ Parallel Analysis ─────────────────────┐
548
+ │ Classification: [search/chain/blocked] │
549
+ │ Streams: [N] identified from task │
550
+ │ Agents: [N] recommended │
551
+ │ │
552
+ │ Streams detected: │
553
+ │ • [stream.purpose from analysis] │
554
+ │ • [stream.purpose from analysis] │
555
+ │ • ... │
556
+ └─────────────────────────────────────────┘
557
+
558
+ [If parallel spawned:]
559
+ ┌─ $ARGUMENTS-swarm ──────────────────────┐
560
+ │ [stream-id] [░░░░░░░░░░] 0% [scope] │
561
+ │ [stream-id] [░░░░░░░░░░] 0% [scope] │
562
+ │ ... │
563
+ └─────────────────────────────────────────┘
316
564
 
317
565
  Next: [recommended command based on state]
318
566
  ```
@@ -324,3 +572,42 @@ If `--quick` flag is passed and plan.md exists, skip directly to:
324
572
  ```
325
573
  /implement $ARGUMENTS
326
574
  ```
575
+
576
+ ---
577
+
578
+ ## Agent Return Format (CCPM Pattern)
579
+
580
+ > **Key insight:** Agents are context firewalls. They do heavy work and return CONCISE summaries.
581
+
582
+ When spawning subagents, always specify the return format:
583
+
584
+ ```typescript
585
+ Task({
586
+ subagent_type: "explore",
587
+ prompt: `...
588
+
589
+ Return ONLY:
590
+ - 3-5 key files (not all files examined)
591
+ - Pattern summary (not full code)
592
+ - Actionable insights (not observations)
593
+
594
+ DO NOT return verbose output or file contents.`,
595
+ });
596
+ ```
597
+
598
+ **Good return:** "Found auth pattern in 3 files: src/auth/\*.ts uses JWT with 24h expiry"
599
+
600
+ **Bad return:** [dumps entire file contents]
601
+
602
+ ---
603
+
604
+ ## Related Commands
605
+
606
+ | Need | Command |
607
+ | -------------------- | -------------------------------- |
608
+ | Skip to implement | `/ship $ARGUMENTS` |
609
+ | Create PRD first | `/create $ARGUMENTS --prd` |
610
+ | Research first | `/research $ARGUMENTS` |
611
+ | Plan implementation | `/plan $ARGUMENTS` |
612
+ | Convert PRD to tasks | Use `prd-task` skill |
613
+ | Check PRD progress | Read `prd.json` + `progress.txt` |
@@ -300,10 +300,8 @@ bd dep add <task-id> <bead-id>
300
300
 
301
301
  ## Related Commands
302
302
 
303
- | Need | Command |
304
- | ------------------- | ---------------------- |
305
- | Analyze mockup | `/analyze-mockup` |
306
- | Fix UI issues | `/fix-ui` |
307
- | Accessibility audit | `/accessibility-check` |
308
- | Design from scratch | `/design` |
309
- | Audit design system | `/design-audit` |
303
+ | Need | Command |
304
+ | -------------------- | --------------- |
305
+ | Design from scratch | `/design` |
306
+ | Start implementation | `/start <bead>` |
307
+ | Ship implementation | `/ship <bead>` |