opencodekit 0.16.15 → 0.16.17

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 (69) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/template/.opencode/AGENTS.md +1 -1
  3. package/dist/template/.opencode/agent/plan.md +77 -161
  4. package/dist/template/.opencode/command/create.md +75 -307
  5. package/dist/template/.opencode/command/design.md +53 -589
  6. package/dist/template/.opencode/command/handoff.md +76 -180
  7. package/dist/template/.opencode/command/init.md +45 -211
  8. package/dist/template/.opencode/command/plan.md +62 -514
  9. package/dist/template/.opencode/command/pr.md +56 -226
  10. package/dist/template/.opencode/command/research.md +55 -266
  11. package/dist/template/.opencode/command/resume.md +33 -138
  12. package/dist/template/.opencode/command/review-codebase.md +54 -202
  13. package/dist/template/.opencode/command/ship.md +78 -127
  14. package/dist/template/.opencode/command/start.md +47 -577
  15. package/dist/template/.opencode/command/status.md +55 -354
  16. package/dist/template/.opencode/command/ui-review.md +52 -298
  17. package/dist/template/.opencode/command/verify.md +36 -250
  18. package/dist/template/.opencode/memory.db-shm +0 -0
  19. package/dist/template/.opencode/memory.db-wal +0 -0
  20. package/dist/template/.opencode/plugin/README.md +8 -4
  21. package/dist/template/.opencode/plugin/swarm-enforcer.ts +182 -27
  22. package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +112 -0
  23. package/dist/template/.opencode/skill/augment-context-engine/mcp.json +6 -0
  24. package/dist/template/.opencode/skill/core-data-expert/SKILL.md +82 -0
  25. package/dist/template/.opencode/skill/core-data-expert/references/batch-operations.md +543 -0
  26. package/dist/template/.opencode/skill/core-data-expert/references/cloudkit-integration.md +259 -0
  27. package/dist/template/.opencode/skill/core-data-expert/references/concurrency.md +522 -0
  28. package/dist/template/.opencode/skill/core-data-expert/references/fetch-requests.md +643 -0
  29. package/dist/template/.opencode/skill/core-data-expert/references/glossary.md +233 -0
  30. package/dist/template/.opencode/skill/core-data-expert/references/migration.md +393 -0
  31. package/dist/template/.opencode/skill/core-data-expert/references/model-configuration.md +597 -0
  32. package/dist/template/.opencode/skill/core-data-expert/references/performance.md +300 -0
  33. package/dist/template/.opencode/skill/core-data-expert/references/persistent-history.md +553 -0
  34. package/dist/template/.opencode/skill/core-data-expert/references/project-audit.md +60 -0
  35. package/dist/template/.opencode/skill/core-data-expert/references/saving.md +574 -0
  36. package/dist/template/.opencode/skill/core-data-expert/references/stack-setup.md +625 -0
  37. package/dist/template/.opencode/skill/core-data-expert/references/testing.md +300 -0
  38. package/dist/template/.opencode/skill/core-data-expert/references/threading.md +589 -0
  39. package/dist/template/.opencode/skill/swift-concurrency/SKILL.md +246 -0
  40. package/dist/template/.opencode/skill/swift-concurrency/references/actors.md +640 -0
  41. package/dist/template/.opencode/skill/swift-concurrency/references/async-algorithms.md +822 -0
  42. package/dist/template/.opencode/skill/swift-concurrency/references/async-await-basics.md +249 -0
  43. package/dist/template/.opencode/skill/swift-concurrency/references/async-sequences.md +670 -0
  44. package/dist/template/.opencode/skill/swift-concurrency/references/core-data.md +533 -0
  45. package/dist/template/.opencode/skill/swift-concurrency/references/glossary.md +128 -0
  46. package/dist/template/.opencode/skill/swift-concurrency/references/linting.md +142 -0
  47. package/dist/template/.opencode/skill/swift-concurrency/references/memory-management.md +542 -0
  48. package/dist/template/.opencode/skill/swift-concurrency/references/migration.md +1076 -0
  49. package/dist/template/.opencode/skill/swift-concurrency/references/performance.md +574 -0
  50. package/dist/template/.opencode/skill/swift-concurrency/references/sendable.md +578 -0
  51. package/dist/template/.opencode/skill/swift-concurrency/references/tasks.md +604 -0
  52. package/dist/template/.opencode/skill/swift-concurrency/references/testing.md +565 -0
  53. package/dist/template/.opencode/skill/swift-concurrency/references/threading.md +452 -0
  54. package/dist/template/.opencode/skill/swiftui-expert-skill/SKILL.md +290 -0
  55. package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-advanced.md +351 -0
  56. package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-basics.md +284 -0
  57. package/dist/template/.opencode/skill/swiftui-expert-skill/references/animation-transitions.md +326 -0
  58. package/dist/template/.opencode/skill/swiftui-expert-skill/references/image-optimization.md +286 -0
  59. package/dist/template/.opencode/skill/swiftui-expert-skill/references/layout-best-practices.md +312 -0
  60. package/dist/template/.opencode/skill/swiftui-expert-skill/references/liquid-glass.md +377 -0
  61. package/dist/template/.opencode/skill/swiftui-expert-skill/references/list-patterns.md +153 -0
  62. package/dist/template/.opencode/skill/swiftui-expert-skill/references/modern-apis.md +400 -0
  63. package/dist/template/.opencode/skill/swiftui-expert-skill/references/performance-patterns.md +377 -0
  64. package/dist/template/.opencode/skill/swiftui-expert-skill/references/scroll-patterns.md +305 -0
  65. package/dist/template/.opencode/skill/swiftui-expert-skill/references/sheet-navigation-patterns.md +292 -0
  66. package/dist/template/.opencode/skill/swiftui-expert-skill/references/state-management.md +447 -0
  67. package/dist/template/.opencode/skill/swiftui-expert-skill/references/text-formatting.md +285 -0
  68. package/dist/template/.opencode/skill/swiftui-expert-skill/references/view-structure.md +276 -0
  69. package/package.json +1 -1
@@ -1,625 +1,95 @@
1
1
  ---
2
- description: Start working on a bead - claim it and prepare context
3
- argument-hint: "<bead-id> [--worktree] [--research] [--parallel]"
2
+ description: Start working on a bead - claim it and prepare workspace
3
+ argument-hint: "<bead-id> [--worktree]"
4
4
  agent: build
5
5
  ---
6
6
 
7
7
  # Start: $ARGUMENTS
8
8
 
9
- You're claiming a task and preparing to work on it. This is the entry point before implementation.
9
+ Claim a task and prepare workspace. Bridge between specification (`/create`) and implementation (`/ship`).
10
10
 
11
- > **Lifecycle context:** IdeationDesign Specification Task Conversion → Planning → **Implementation** → Verification
11
+ > **Workflow:** `/create`**`/start <id>`**`/ship <id>`
12
12
  >
13
- > **CCPM Philosophy:** One issue ≠ one task. One issue = multiple parallel work streams.
14
- > Agents are "context firewalls" - they do heavy work and return concise summaries.
15
-
16
- ## Parse Arguments
17
-
18
- | Argument | Default | Description |
19
- | ------------ | -------- | ---------------------------------------------- |
20
- | `<bead-id>` | required | The bead to start working on |
21
- | `--worktree` | false | Create isolated git worktree for this work |
22
- | `--research` | false | Run parallel subagent research before starting |
23
- | `--parallel` | auto | Analyze and spawn parallel work streams |
13
+ > Bead MUST have `prd.md` (created via `/create`).
24
14
 
25
15
  ## Load Skills
26
16
 
27
17
  ```typescript
28
- skill({ name: "development-lifecycle" }); // Phase guidance
29
18
  skill({ name: "beads" });
30
- skill({ name: "beads-bridge" }); // For cross-session todo coordination
31
- skill({ name: "prd" }); // PRD creation workflow
32
- skill({ name: "prd-task" }); // PRD to executable tasks conversion
33
- skill({ name: "memory-system" });
34
-
35
- // Load conditionally based on flags
36
- if (flags.includes("--parallel")) {
37
- skill({ name: "swarm-coordination" }); // Parallel work orchestration
38
- skill({ name: "agent-teams" }); // Team patterns and coordination
39
- }
19
+ skill({ name: "prd-task" }); // PRD executable tasks
40
20
  ```
41
21
 
42
- ## Ensure Git Hooks Installed
22
+ ## Parse Arguments
23
+
24
+ | Argument | Default | Description |
25
+ | ------------ | -------- | ---------------------------- |
26
+ | `<bead-id>` | required | The bead to start |
27
+ | `--worktree` | false | Create isolated git worktree |
43
28
 
44
- First-time setup per repo (prevents stale JSONL issues):
29
+ ## Phase 1: Pre-flight
45
30
 
46
31
  ```bash
47
- br hooks install 2>/dev/null || echo "Hooks already installed"
32
+ git status --porcelain
33
+ git branch --show-current
34
+ br list --status=in_progress
48
35
  ```
49
36
 
50
- ## Current State
51
-
52
- ### Git Status
53
-
54
- !`git status --porcelain`
55
- !`git branch --show-current`
56
-
57
- ### Active Tasks
58
-
59
- !`br list --status=in_progress`
60
-
61
- If you have uncommitted changes, ask the user:
37
+ - If uncommitted changes: ask user to stash, commit, or continue
38
+ - If other tasks in progress: warn before claiming another
62
39
 
63
- 1. Stash them (`git stash`)
64
- 2. Commit them first
65
- 3. Continue anyway (risky)
66
-
67
- If you already have tasks in_progress, warn the user before claiming another.
68
-
69
- ## Task Details
70
-
71
- !`br show $ARGUMENTS`
72
-
73
- Identify the task type from the bead:
74
-
75
- | Type | Hierarchy Level | Typical Scope |
76
- | --------- | --------------- | --------------------------------- |
77
- | `epic` | Parent | Multi-session, has subtasks |
78
- | `task` | Middle | Single session, may have subtasks |
79
- | `subtask` | Leaf | Single focused unit of work |
80
-
81
- Check for parent/child relationships:
40
+ ## Phase 2: Validate Specification
82
41
 
83
42
  ```bash
84
- br dep tree $ARGUMENTS 2>/dev/null || echo "No dependencies"
43
+ br show $ARGUMENTS
44
+ ls .beads/artifacts/$ARGUMENTS/
85
45
  ```
86
46
 
87
- ## Claim The Task
47
+ Verify `prd.md` exists and has real content (not just placeholders). If missing or incomplete, tell user to run `/create` first.
48
+
49
+ ## Phase 3: Claim and Branch
88
50
 
89
51
  ```bash
90
52
  br update $ARGUMENTS --status in_progress
91
53
  ```
92
54
 
93
- ## Sync Beads State to OpenCode Todos
94
-
95
- Make beads tasks visible to subagents via todoread:
96
-
97
- ```typescript
98
- // Push beads state to OpenCode todos
99
- swarm({ operation: "sync", action: "push" });
100
- ```
101
-
102
- This enables subagents to see task context via `todoread()` without beads access.
103
-
104
- ## Workspace Setup
105
-
106
- ### Create Feature Branch
107
-
108
- Extract task info and parent branch for a readable branch name:
55
+ Create a feature branch:
109
56
 
110
57
  ```bash
111
- # Get current branch (parent branch)
112
- PARENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
113
-
114
- # Get task title and type from bead
115
- BEAD_INFO=$(br show $ARGUMENTS --json 2>/dev/null)
116
- BEAD_TITLE=$(echo "$BEAD_INFO" | jq -r '.title // ""' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | cut -c1-40)
117
- BEAD_TYPE=$(echo "$BEAD_INFO" | jq -r '.type // "task"')
118
-
119
- # Map bead type to branch prefix
120
- case "$BEAD_TYPE" in
121
- "bug") PREFIX="fix" ;;
122
- "feature"|"epic") PREFIX="feat" ;;
123
- "refactor") PREFIX="refactor" ;;
124
- "chore") PREFIX="chore" ;;
125
- *) PREFIX="feat" ;;
126
- esac
127
-
128
- # Create branch: <parent>/<type>/<bead-id>-<description>
129
- BRANCH_NAME="${PARENT_BRANCH}/${PREFIX}/$ARGUMENTS-${BEAD_TITLE}"
130
- git checkout -b "$BRANCH_NAME" 2>/dev/null || echo "Branch already exists or already on it"
58
+ git checkout -b feat/$ARGUMENTS-<short-title>
131
59
  ```
132
60
 
133
- **Branch naming convention:**
134
- | Parent Branch | Bead Type | Example |
135
- |---------------|-----------|---------|
136
- | main | bug | `main/fix/br-a1b2-login-error` |
137
- | develop | feature | `develop/feat/br-c3d4-user-auth` |
138
- | release-v2 | chore | `release-v2/chore/br-e5f6-update-deps` |
139
-
140
- ### Option B: Git Worktree (if --worktree flag)
141
-
142
- For isolated work that won't conflict with main workspace:
61
+ If `--worktree`:
143
62
 
144
63
  ```typescript
145
64
  skill({ name: "using-git-worktrees" });
146
65
  ```
147
66
 
148
- **When to use worktrees:**
149
-
150
- - Epic-level work spanning multiple sessions
151
- - Parallel work on different features
152
- - Need to keep main workspace clean
153
- - Long-running features with frequent context switches
154
-
155
- **Worktree setup:**
156
-
157
- ```bash
158
- # Get current branch (parent branch)
159
- PARENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
160
-
161
- # Get task title for readable worktree name
162
- BEAD_INFO=$(br show $ARGUMENTS --json 2>/dev/null)
163
- BEAD_TITLE=$(echo "$BEAD_INFO" | jq -r '.title // ""' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | cut -c1-40)
164
- BEAD_TYPE=$(echo "$BEAD_INFO" | jq -r '.type // "task"')
165
-
166
- # Map bead type to branch prefix
167
- case "$BEAD_TYPE" in
168
- "bug") PREFIX="fix" ;;
169
- "feature"|"epic") PREFIX="feat" ;;
170
- "refactor") PREFIX="refactor" ;;
171
- *) PREFIX="feat" ;;
172
- esac
173
-
174
- # Create branch: <parent>/<type>/<bead-id>-<description>
175
- BRANCH_NAME="${PARENT_BRANCH}/${PREFIX}/$ARGUMENTS-${BEAD_TITLE}"
176
-
177
- # Verify .gitignore has worktree directory
178
- grep -q "^\.worktrees/$" .gitignore || echo ".worktrees/" >> .gitignore
179
-
180
- # Create worktree with readable branch name
181
- git worktree add ".worktrees/$ARGUMENTS" -b "$BRANCH_NAME"
182
-
183
- # Navigate to worktree
184
- cd .worktrees/$ARGUMENTS
185
-
186
- # Install dependencies (auto-detect project type)
187
- [ -f package.json ] && npm install
188
- [ -f Cargo.toml ] && cargo build
189
- [ -f requirements.txt ] && pip install -r requirements.txt
190
- [ -f go.mod ] && go mod download
191
- ```
192
-
193
- **Beads in worktrees:** The `.beads/` database is shared with main repo automatically. No special configuration needed unless using `BEADS_DIR` for external storage.
194
-
195
- ## Parallel Research (if --research flag or epic-level work)
196
-
197
- For complex tasks, gather context before diving in:
198
-
199
- ```typescript
200
- // Run subagents in parallel - multiple Task calls in one message
201
- Task({
202
- subagent_type: "explore",
203
- description: "Explore codebase patterns",
204
- prompt: `Research codebase patterns for $ARGUMENTS:
205
- - Find similar implementations
206
- - Identify affected files
207
- - Note testing patterns used
208
- Return: File list, patterns found, testing approach`,
209
- });
210
-
211
- Task({
212
- subagent_type: "scout",
213
- description: "Research external docs",
214
- prompt: `Research external docs for $ARGUMENTS:
215
- - API documentation for libraries involved
216
- - Best practices for the approach
217
- - Common pitfalls to avoid
218
- Return: Key findings, code examples, warnings`,
219
- });
220
-
221
- // Both run in parallel, results available immediately
222
- ```
223
-
224
- **Subagent delegation rules:**
225
-
226
- - Subagents are **read-only** - they don't modify beads state
227
- - Results returned immediately when all complete
228
- - Use for research, not for implementation
229
-
230
- ## Existing Artifacts
231
-
232
- !`ls .beads/artifacts/$ARGUMENTS/ 2>/dev/null || echo "No artifacts yet"`
233
-
234
- Look for:
235
-
236
- - `prd.md` - PRD created via `prd` skill (defines WHAT to build)
237
- - `prd.json` - Executable tasks from `prd-task` skill
238
- - `progress.txt` - PRD execution progress (append-only)
239
- - `research.md` - Previous research
240
- - `plan.md` - Implementation plan
241
- - `handoffs/` - Previous session handoffs
242
-
243
- ### PRD Workflow (if prd.md exists but no prd.json)
244
-
245
- If `prd.md` exists but `prd.json` doesn't, convert PRD to tasks:
246
-
247
- ```typescript
248
- // The prd-task skill converts PRD markdown to executable JSON
249
- // Read prd.md → Extract ## Tasks section → Write prd.json
250
- skill({ name: "prd-task" });
251
-
252
- // Then parse the PRD
253
- // This creates:
254
- // - .beads/artifacts/$ARGUMENTS/prd.json (task list)
255
- // - .beads/artifacts/$ARGUMENTS/progress.txt (progress log)
256
- ```
257
-
258
- ### PRD Workflow (if neither exists)
259
-
260
- If no PRD exists and task is complex (epic/feature), consider creating one:
261
-
262
- ```typescript
263
- // The prd skill guides PRD creation with:
264
- // - Clarifying questions (5-7 max)
265
- // - Problem/solution framing
266
- // - Machine-convertible Tasks section
267
- skill({ name: "prd" });
268
-
269
- // Creates: .beads/artifacts/$ARGUMENTS/prd.md
270
- ```
271
-
272
- ## Check Previous Sessions
273
-
274
- ```typescript
275
- search_session({ query: "$ARGUMENTS" });
276
- list_sessions({ limit: 3 });
277
- ```
278
-
279
- Load context from previous work on this bead.
280
-
281
- ## Load Related Memory (Semantic Search)
282
-
283
- Search for relevant past work and learnings before starting:
284
-
285
- ```typescript
286
- // Find similar past work (semantic similarity)
287
- memory_search({ query: "[task title/description from bead]", limit: 3 });
288
-
289
- // Find related observations (gotchas, patterns, learnings)
290
- memory_search({ query: "[task keywords] gotchas patterns", limit: 3 });
291
- ```
292
-
293
- **Review findings before diving in.** Past observations may contain:
294
-
295
- - Gotchas to avoid
296
- - Patterns that worked well
297
- - Decisions already made
298
-
299
- If memory search fails (Ollama not running), continue without it.
300
-
301
- ## Parallel Stream Analysis (if --parallel flag or epic/task type)
302
-
303
- > **CCPM Insight:** A single task isn't one unit of work. It's multiple parallel work streams.
304
- > Streams are determined by analyzing the ACTUAL task requirements, not hardcoded categories.
305
-
306
- ### Step 1: Analyze Work Streams
307
-
308
- Use swarm planning to analyze the specific task:
309
-
310
- ```typescript
311
- // Get task details from bead
312
- const beadInfo = br show $ARGUMENTS --json;
313
- const taskTitle = beadInfo.title;
314
- const taskDescription = beadInfo.description;
315
-
316
- // Read prd/plan if exists for file context
317
- const prdContent = read(".beads/artifacts/$ARGUMENTS/prd.md");
318
- const planContent = read(".beads/artifacts/$ARGUMENTS/plan.md");
319
-
320
- // Analyze THIS SPECIFIC task for parallel execution
321
- const analysis = swarm({
322
- operation: "plan",
323
- action: "analyze",
324
- task: taskTitle, // User's actual task
325
- context: taskDescription, // User's requirements
326
- files: "[files from spec/plan]", // Actual affected files
327
- });
328
- ```
329
-
330
- The analysis returns **task-specific** streams:
331
-
332
- ```typescript
333
- // Example analysis result (varies per task):
334
- {
335
- classification: "search", // Can parallelize
336
- recommended_agents: 3,
337
- streams: [
338
- { id: "stream-1", scope: "src/auth/*", purpose: "Authentication logic" },
339
- { id: "stream-2", scope: "src/api/auth/*", purpose: "Auth endpoints" },
340
- { id: "stream-3", scope: "tests/auth/*", purpose: "Auth test coverage" },
341
- ]
342
- }
343
- ```
344
-
345
- ### Step 2: Create Dynamic Delegation Packets
346
-
347
- **For EACH stream from analysis** (not hardcoded):
348
-
349
- ```typescript
350
- // Iterate over streams from analysis - these are DYNAMIC based on task
351
- for (const stream of analysis.streams) {
352
- swarm({
353
- operation: "delegate",
354
- bead_id: "$ARGUMENTS",
355
- title: stream.purpose, // From analysis, not hardcoded
356
- expected_outcome: `Complete ${stream.purpose} for task requirements`,
357
- required_tools: "read, grep, lsp, edit, bash",
358
- must_do: "LSP before edits, verify changes, run relevant tests",
359
- must_not_do: "no new deps without approval, stay within assigned scope",
360
- acceptance_checks: "[derived from spec.md acceptance criteria]",
361
- context: `Files: ${stream.scope}, Purpose: ${stream.purpose}`,
362
- write: true,
363
- });
364
- }
365
- ```
366
-
367
- ### Step 3: Spawn Workers for Each Stream
368
-
369
- ```typescript
370
- // Launch workers based on ACTUAL analysis results
371
- for (const stream of analysis.streams) {
372
- // Initialize monitoring for this stream
373
- swarm({
374
- operation: "monitor",
375
- action: "progress_update",
376
- team_name: "$ARGUMENTS-swarm",
377
- worker_id: stream.id,
378
- phase: "starting",
379
- progress: 0,
380
- status: "working",
381
- file: stream.scope,
382
- });
383
-
384
- // Spawn worker with task-specific instructions
385
- Task({
386
- subagent_type: "general",
387
- description: `${stream.id}: ${stream.purpose}`,
388
- prompt: `Execute work stream for $ARGUMENTS.
389
-
390
- **Your Assignment:**
391
- - Scope: ${stream.scope}
392
- - Purpose: ${stream.purpose}
393
-
394
- **Load Context:**
395
- - Delegation: .beads/artifacts/$ARGUMENTS/delegation.md
396
- - Spec: .beads/artifacts/$ARGUMENTS/spec.md (if exists)
397
-
398
- **Work:**
399
- Complete all work within your assigned scope that fulfills the task requirements.
400
-
401
- **Return CONCISE summary only:**
402
- - Files modified: [list]
403
- - Changes made: [brief description]
404
- - Verification: [pass/fail + what was checked]
405
-
406
- DO NOT return verbose output or file contents.`,
407
- });
408
- }
409
-
410
- // All workers execute in parallel, results return when complete
411
- ```
412
-
413
- ### Step 4: Monitor Progress
67
+ ## Phase 4: Convert PRD to Tasks
414
68
 
415
- ```typescript
416
- // Render progress visualization
417
- swarm({
418
- operation: "monitor",
419
- action: "render_block",
420
- team_name: "$ARGUMENTS-swarm",
421
- });
422
- ```
69
+ If `prd.json` doesn't exist yet, use `prd-task` skill to convert PRD markdown → executable JSON.
423
70
 
424
- **Output shows ACTUAL streams (dynamic):**
71
+ If `prd.json` already exists, show progress (completed/total tasks).
425
72
 
426
- ```
427
- ┌─ $ARGUMENTS-swarm ──────────────────────────┐
428
- │ stream-1 [████████░░] 80% src/auth/* │
429
- │ stream-2 [██████░░░░] 60% src/api/auth/* │
430
- │ stream-3 [████░░░░░░] 40% tests/auth/* │
431
- └─────────────────────────────────────────────┘
432
- ```
433
-
434
- ### Anti-Serial-Collapse Check
73
+ ## Phase 5: Report and Route
435
74
 
436
- Before proceeding, verify parallelization makes sense:
437
-
438
- ```typescript
439
- swarm({
440
- operation: "plan",
441
- action: "check",
442
- task: taskTitle,
443
- files: analysis.streams.length,
444
- recommended_agents: analysis.recommended_agents,
445
- });
446
- ```
447
-
448
- **Warning signs:**
449
-
450
- - Only 1 stream identified for multi-file task
451
- - All streams depend on each other (should be sequential)
452
- - Same files appear in multiple streams (conflict risk)
453
-
454
- ### When NOT to Parallelize
455
-
456
- Skip parallel analysis if:
457
-
458
- - Task is a `subtask` (leaf-level, already atomic)
459
- - Only 1-2 files affected
460
- - Sequential dependency chain (each step needs previous)
461
- - User explicitly passed `--no-parallel`
462
-
463
- ## PRD Tasks (If Present)
464
-
465
- If `.beads/artifacts/$ARGUMENTS/prd.json` exists, execution is PRD-driven:
466
-
467
- ```typescript
468
- // Load the prd-task skill for execution guidance
469
- skill({ name: "prd-task" });
75
+ Output:
470
76
 
471
- // Read task list
472
- const prdJson = read(".beads/artifacts/$ARGUMENTS/prd.json");
473
- const tasks = JSON.parse(prdJson).tasks;
77
+ 1. Bead type and status
78
+ 2. Branch name
79
+ 3. Workspace (main or worktree)
80
+ 4. Artifact status (prd.md validated, prd.json exists/created)
81
+ 5. Next step recommendation
474
82
 
475
- // Find next incomplete task
476
- const nextTask = tasks.find((t) => !t.passes);
477
-
478
- if (nextTask) {
479
- console.log(`Next PRD task: ${nextTask.id}`);
480
- console.log(`Description: ${nextTask.description}`);
481
- console.log(`Verification steps:`);
482
- nextTask.steps.forEach((s) => console.log(` - ${s}`));
483
- }
484
- ```
485
-
486
- **PRD execution flow:**
487
-
488
- 1. Read `prd.json` for task list
489
- 2. Find next task where `passes: false`
490
- 3. Implement to satisfy verification steps
491
- 4. Mark `passes: true` when verification passes
492
- 5. Append progress to `progress.txt`
493
- 6. Repeat until all tasks pass
494
-
495
- Proceed directly to implementation using the PRD tasks as the guide.
496
-
497
- ## Determine Next Step
498
-
499
- Based on task type and what exists:
500
-
501
- ### For Epics (parent tasks)
502
-
503
- | State | Next Command |
504
- | ------------------ | --------------------------------- |
505
- | No subtasks | `/plan $ARGUMENTS --create-beads` |
506
- | Has ready subtasks | `/start <first-subtask-id>` |
507
- | All subtasks done | `/ship $ARGUMENTS` |
508
-
509
- ### For Tasks/Subtasks (leaf work)
510
-
511
- | Artifacts Found | Next Step |
512
- | -------------------- | ----------------------------------------- |
513
- | Nothing | Ask user for task description |
514
- | Only prd.md | `/plan $ARGUMENTS` or use `prd-task` |
515
- | prd.md (no prd.json) | Run `prd-task` skill to convert to tasks |
516
- | prd.json exists | `/ship $ARGUMENTS` (PRD-driven execution) |
517
- | prd.md + research.md | `/plan $ARGUMENTS` |
518
- | plan.md exists | `/ship $ARGUMENTS` |
519
-
520
- ### PRD vs Plan Decision
521
-
522
- | Situation | Use PRD | Use Plan |
523
- | ------------------------------------ | ----------------------- | ------------------ |
524
- | New feature with unclear scope | ✅ Ask questions first | ❌ |
525
- | Bug fix or small change | ❌ | ✅ Quick plan |
526
- | Multi-session epic | ✅ PRD for each subtask | ✅ High-level plan |
527
- | Refactoring with known scope | ❌ | ✅ Plan with tasks |
528
- | Feature needing stakeholder sign-off | ✅ PRD for review | ❌ |
529
-
530
- ## Output
531
-
532
- ```
533
- Started: $ARGUMENTS
534
- ━━━━━━━━━━━━━━━━━━━
535
-
536
- Type: [epic/task/subtask]
537
- Branch: $ARGUMENTS
538
- Workspace: [main | worktree: .worktrees/$ARGUMENTS]
539
- Status: in_progress
540
-
541
- Hierarchy:
542
- ├── Parent: [parent-id or "none"]
543
- └── Children: [count or "none"]
544
-
545
- Artifacts:
546
- • prd.md: [exists/missing]
547
- • research.md: [exists/missing]
548
- • plan.md: [exists/missing]
549
- • prd.json: [exists/missing] ([N] tasks, [M] complete)
550
-
551
- [If PRD exists:]
552
- ┌─ PRD Progress ──────────────────────────┐
553
- │ Tasks: [completed]/[total] │
554
- │ Next: [task-id] - [description] │
555
- │ Verification: │
556
- │ • [step 1] │
557
- │ • [step 2] │
558
- └─────────────────────────────────────────┘
559
-
560
- ┌─ Parallel Analysis ─────────────────────┐
561
- │ Classification: [search/chain/blocked] │
562
- │ Streams: [N] identified from task │
563
- │ Agents: [N] recommended │
564
- │ │
565
- │ Streams detected: │
566
- │ • [stream.purpose from analysis] │
567
- │ • [stream.purpose from analysis] │
568
- │ • ... │
569
- └─────────────────────────────────────────┘
570
-
571
- [If parallel spawned:]
572
- ┌─ $ARGUMENTS-swarm ──────────────────────┐
573
- │ [stream-id] [░░░░░░░░░░] 0% [scope] │
574
- │ [stream-id] [░░░░░░░░░░] 0% [scope] │
575
- │ ... │
576
- └─────────────────────────────────────────┘
577
-
578
- Next: [recommended command based on state]
579
- ```
580
-
581
- ## Quick Start
582
-
583
- If `--quick` flag is passed and plan.md exists, skip directly to:
584
-
585
- ```
586
- /implement $ARGUMENTS
587
- ```
588
-
589
- ---
590
-
591
- ## Agent Return Format (CCPM Pattern)
592
-
593
- > **Key insight:** Agents are context firewalls. They do heavy work and return CONCISE summaries.
594
-
595
- When spawning subagents, always specify the return format:
596
-
597
- ```typescript
598
- Task({
599
- subagent_type: "explore",
600
- prompt: `...
601
-
602
- Return ONLY:
603
- - 3-5 key files (not all files examined)
604
- - Pattern summary (not full code)
605
- - Actionable insights (not observations)
606
-
607
- DO NOT return verbose output or file contents.`,
608
- });
609
- ```
610
-
611
- **Good return:** "Found auth pattern in 3 files: src/auth/\*.ts uses JWT with 24h expiry"
612
-
613
- **Bad return:** [dumps entire file contents]
614
-
615
- ---
83
+ | State | Next Command |
84
+ | ------------------ | ------------------------ |
85
+ | Has prd.json | `/ship $ARGUMENTS` |
86
+ | Epic with subtasks | `/start <first-subtask>` |
87
+ | Complex task | `/plan $ARGUMENTS` |
616
88
 
617
89
  ## Related Commands
618
90
 
619
- | Need | Command |
620
- | -------------------- | -------------------------------- |
621
- | Skip to implement | `/ship $ARGUMENTS` |
622
- | Research first | `/research $ARGUMENTS` |
623
- | Plan implementation | `/plan $ARGUMENTS` |
624
- | Convert PRD to tasks | Use `prd-task` skill |
625
- | Check PRD progress | Read `prd.json` + `progress.txt` |
91
+ | Need | Command |
92
+ | ------------------- | ------------ |
93
+ | Create spec first | `/create` |
94
+ | Plan implementation | `/plan <id>` |
95
+ | Implement and ship | `/ship <id>` |