opencodekit 0.14.1 → 0.14.2

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 CHANGED
@@ -750,7 +750,7 @@ var cac = (name = "") => new CAC(name);
750
750
  // package.json
751
751
  var package_default = {
752
752
  name: "opencodekit",
753
- version: "0.14.1",
753
+ version: "0.14.2",
754
754
  description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
755
755
  type: "module",
756
756
  repository: {
@@ -0,0 +1,96 @@
1
+ {
2
+ "tasks": {
3
+ "bg_1767973877335_d2ihzd": {
4
+ "taskId": "bg_1767973877335_d2ihzd",
5
+ "sessionId": "ses_45c8b89a4ffeuq5BxBRQv4wrwd",
6
+ "agent": "explore",
7
+ "prompt": "Find all agent definitions in this project. List the file paths and agent names.",
8
+ "started": 1767973890766,
9
+ "status": "cancelled"
10
+ },
11
+ "bg_1767973898236_s7kyjm": {
12
+ "taskId": "bg_1767973898236_s7kyjm",
13
+ "sessionId": "ses_45c8b37ffffeIMMtZrHruaRN7A",
14
+ "agent": "scout",
15
+ "prompt": "What is the latest version of @opencode-ai/sdk and what are its main features?",
16
+ "started": 1767973936815,
17
+ "status": "completed"
18
+ },
19
+ "bg_1767974743680_ppd6p1": {
20
+ "taskId": "bg_1767974743680_ppd6p1",
21
+ "sessionId": "ses_45c7e517bffeagStJem1UDrHNf",
22
+ "agent": "explore",
23
+ "prompt": "Find all TypeScript files in the .opencode/tool directory and list them.",
24
+ "started": 1767974756797,
25
+ "status": "completed",
26
+ "beadId": "opencodekit-template-ag8",
27
+ "autoCloseBead": true
28
+ },
29
+ "bg_1767974825480_mlpk5z": {
30
+ "taskId": "bg_1767974825480_mlpk5z",
31
+ "sessionId": "ses_45c7d11efffe9LnnUp1W2C7GiI",
32
+ "agent": "explore",
33
+ "prompt": "List all files in .opencode/agent directory",
34
+ "started": 1767974843970,
35
+ "status": "completed",
36
+ "beadId": "opencodekit-template-3k0",
37
+ "autoCloseBead": true
38
+ },
39
+ "bg_1767975003390_y1pliv": {
40
+ "taskId": "bg_1767975003390_y1pliv",
41
+ "sessionId": "ses_45c7a5afffferx20SjJEy782Ap",
42
+ "agent": "explore",
43
+ "prompt": "Count the number of markdown files in .opencode/command directory",
44
+ "started": 1767975020306,
45
+ "status": "completed",
46
+ "beadId": "opencodekit-template-0ch",
47
+ "autoCloseBead": true
48
+ },
49
+ "bg_1767975064912_8nvlh7": {
50
+ "taskId": "bg_1767975064912_8nvlh7",
51
+ "sessionId": "ses_45c796aa9ffeYEhEzxybXEuOfO",
52
+ "agent": "explore",
53
+ "prompt": "List files in .opencode/agent directory",
54
+ "started": 1767975078449,
55
+ "status": "completed",
56
+ "beadId": "opencodekit-template-ryg",
57
+ "autoCloseBead": true
58
+ },
59
+ "bg_1767982850780_sdkoc4": {
60
+ "taskId": "bg_1767982850780_sdkoc4",
61
+ "sessionId": "ses_45c029d22ffe7cWSSebxdvxIgL",
62
+ "agent": "explore",
63
+ "prompt": "Find all TypeScript files in the src/commands directory and list what each command does. This is a test of agent delegation.",
64
+ "started": 1767982870771,
65
+ "status": "completed"
66
+ },
67
+ "bg_1767984165033_jyv9bd": {
68
+ "taskId": "bg_1767984165033_jyv9bd",
69
+ "sessionId": "ses_45bee8f51ffeJ6B5L7AMik624S",
70
+ "parentSessionId": "ses_45c0ae526ffeQlmBlscyZMZALt",
71
+ "agent": "explore",
72
+ "prompt": "List all TypeScript files in .opencode/tool/ directory and briefly describe what each tool does. This is a test of sub-session linking.",
73
+ "started": 1767984193526,
74
+ "status": "completed"
75
+ },
76
+ "bg_1767984696916_qi0xa9": {
77
+ "taskId": "bg_1767984696916_qi0xa9",
78
+ "sessionId": "ses_45be671a7ffeXRL43PHImPBtCh",
79
+ "parentSessionId": "ses_45c0ae526ffeQlmBlscyZMZALt",
80
+ "agent": "explore",
81
+ "prompt": "Find all files in src/commands/ and list their exports. This is a test of the updated background tool.",
82
+ "started": 1767984719380,
83
+ "status": "completed",
84
+ "beadId": "bd-test-123"
85
+ },
86
+ "bg_1767985457040_uo3le4": {
87
+ "taskId": "bg_1767985457040_uo3le4",
88
+ "sessionId": "ses_45bdad86bffeZNUcXDi1wrSwxb",
89
+ "parentSessionId": "ses_45c0ae526ffeQlmBlscyZMZALt",
90
+ "agent": "explore",
91
+ "prompt": "List files in src/ directory. Quick test.",
92
+ "started": 1767985471066,
93
+ "status": "running"
94
+ }
95
+ }
96
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "active": false,
3
+ "sessionID": null,
4
+ "iteration": 0,
5
+ "maxIterations": 50,
6
+ "completionPromise": "<promise>COMPLETE</promise>",
7
+ "task": "",
8
+ "prdFile": null,
9
+ "progressFile": "progress.txt",
10
+ "startedAt": null,
11
+ "mode": "hitl"
12
+ }
@@ -17,9 +17,18 @@ Everything else is guidelines, not laws.
17
17
  - **Search/Docs** → @explore / @scout
18
18
  - **Review/Debug** → @review
19
19
  - **Plan/Design** → @planner / @vision
20
+ - **Media Extraction** → @looker (images, PDFs, diagrams needing OCR/parsing)
20
21
 
21
22
  If yes → Delegate. If no → Execute directly.
22
23
 
24
+ ### @vision vs @looker
25
+
26
+ When you encounter media files (images, PDFs, diagrams), ask: **"Do I need extraction or judgment?"**
27
+
28
+ **@looker** handles pure extraction—getting content OUT of media. Use it when you need to read what's inside: OCR text from images, parse PDF documents, describe diagram components, extract table data, or transcribe handwritten notes. Looker is cheap (Gemini Flash), fast, and read-only. It tells you WHAT is there.
29
+
30
+ **@vision** handles design judgment—evaluating HOW something looks. Use it when you need critique: accessibility audits, UI/UX reviews, design system consistency checks, mockup feedback, or anti-slop detection. Vision is expensive (Gemini Pro), thorough, and opinionated. It tells you if something is GOOD.
31
+
23
32
  ## Question Tool
24
33
 
25
34
  **Rule**: Use `question` tool to gather user input when interpretation matters.
@@ -51,9 +60,15 @@ question({
51
60
  });
52
61
  ```
53
62
 
54
- ** Design Rule**: Use `question` tool to gather user input when interpretation matters.
63
+ **Design Rules:**
64
+
65
+ 1. **Analyze before recommending**: Evaluate each option against the user's context, project constraints, and industry best practices. Only add "(Recommended)" to the option that genuinely fits best—don't default to the first option blindly.
66
+
67
+ 2. **Put recommended first**: Place the analyzed best-practice option first with "(Recommended)" in the label so users can quickly identify the optimal choice.
68
+
69
+ 3. **Keep it focused**: Limit to 3-5 options—more overwhelms users. Write short, clear descriptions that explain the tradeoff of each option.
55
70
 
56
- Put your recommended option first with "(Recommended)" in the label. Keep options to 3-5 choices—more than that overwhelms users. Write short, clear descriptions that explain the tradeoff. Users can always select "Other" to provide custom input, so you don't need to cover every edge case.
71
+ 4. **Don't over-specify**: Users can always select "Other" to provide custom input, so you don't need to cover every edge case.
57
72
 
58
73
  ## Anti-Hallucination (The Truth)
59
74
 
@@ -72,14 +87,31 @@ Put your recommended option first with "(Recommended)" in the label. Keep option
72
87
 
73
88
  ## Tool Priority
74
89
 
75
- **Rule**: Always `read` before `edit`.
76
-
77
- 1. **LSP (Best)**: `lsp_lsp_document_symbols`, `lsp_lsp_goto_definition`. **Follow [LSP NAVIGATION AVAILABLE] nudges immediately.**
90
+ **Rule**: Always `read` before `edit`. Always `LSP` before `edit`.
91
+
92
+ 1. **LSP (Best)**: Use ALL 9 operations. **MANDATORY before ANY edit.**
93
+ - `documentSymbol` - File structure (functions, classes, variables)
94
+ - `goToDefinition` - Jump to where symbol is defined
95
+ - `findReferences` - Find all usages of a symbol
96
+ - `hover` - Get type info and documentation
97
+ - `goToImplementation` - Find implementations of interface/abstract
98
+ - `workspaceSymbol` - Search symbols across entire workspace
99
+ - `prepareCallHierarchy` - Get call hierarchy item at position
100
+ - `incomingCalls` - Find what calls this function
101
+ - `outgoingCalls` - Find what this function calls
78
102
  2. **Memory**: `memory-search` (Check past learnings), `repo-map` (Understand structure).
79
103
  3. **Structure**: `ast-grep` (Find functions/classes patterns)
80
104
  4. **Search**: `grep` (Find text/TODOs)
81
105
  5. **Files**: `glob` (Find files)
82
106
 
107
+ **LSP-First Workflow (HARD RULE):**
108
+
109
+ ```
110
+ grep/read → LSP → understand → THEN edit
111
+ ```
112
+
113
+ Violations: `read → edit` or `grep → edit` without LSP = WRONG.
114
+
83
115
  ## Active Memory (The Brain)
84
116
 
85
117
  **Rule**: Use memory proactively, not just when asked.
@@ -96,6 +128,45 @@ Put your recommended option first with "(Recommended)" in the label. Keep option
96
128
  - **Work**: `bd-reserve({ paths: [...] })` (Lock files!) → Edit
97
129
  - **Finish**: `bd close <id> --reason "..."` → `bd sync` → **RESTART SESSION**
98
130
 
131
+ ## Parallel Execution
132
+
133
+ **Rule**: Fire research subagents in background, continue working, collect when needed.
134
+
135
+ For complex tasks with multiple unknowns, don't wait for sequential research. Launch parallel background tasks:
136
+
137
+ **Allowed agents for background delegation:**
138
+
139
+ - **Subagents**: explore, scout, review, planner, vision, looker (stateless workers)
140
+ - **Primary**: rush (autonomous execution)
141
+ - **NOT allowed**: build (build is the orchestrator that uses this tool)
142
+
143
+ ```typescript
144
+ // Fire parallel research (non-blocking)
145
+ background_start({ agent: "explore", prompt: "Find auth patterns..." }); // → bg_123_abc
146
+ background_start({ agent: "scout", prompt: "Find JWT docs..." }); // → bg_456_def
147
+
148
+ // Continue with implementation work immediately...
149
+
150
+ // Collect results when needed
151
+ background_output({ taskId: "bg_123_abc" });
152
+ background_output({ taskId: "bg_456_def" });
153
+
154
+ // Cleanup at session end
155
+ background_cancel({ all: true });
156
+ ```
157
+
158
+ **When to use background execution:**
159
+
160
+ - Multiple independent research questions
161
+ - Complex tasks touching unfamiliar code
162
+ - Need both codebase patterns AND external docs
163
+
164
+ **When NOT to use:**
165
+
166
+ - Simple, well-understood changes
167
+ - Sequential dependencies (B needs A's output)
168
+ - Quick fixes with known approach
169
+
99
170
  ## Core Constraints
100
171
 
101
172
  - No sudo.
@@ -146,13 +146,21 @@ Don't blindly implement bad ideas. Don't lecture either. State your concern conc
146
146
 
147
147
  ## Parallel Exploration
148
148
 
149
- Treat @explore and @scout as grep, not consultants. Fire them in parallel, continue working, collect results when needed.
149
+ Treat @explore and @scout as grep, not consultants. Fire them in background, continue working, collect results when needed.
150
150
 
151
- ```
152
- Task({ subagent_type: "explore", prompt: "Find auth middleware..." })
153
- Task({ subagent_type: "explore", prompt: "Find error handling patterns..." })
154
- Task({ subagent_type: "scout", prompt: "Find JWT best practices in official docs..." })
155
- // Continue working immediately. Collect results when needed.
151
+ ```typescript
152
+ // Fire parallel research (non-blocking)
153
+ background_start({ agent: "explore", prompt: "Find auth middleware..." }); // → bg_123
154
+ background_start({ agent: "scout", prompt: "Find JWT best practices..." }); // → bg_456
155
+
156
+ // Continue working immediately...
157
+
158
+ // Collect when needed
159
+ background_output({ taskId: "bg_123" });
160
+ background_output({ taskId: "bg_456" });
161
+
162
+ // Cleanup at session end
163
+ background_cancel({ all: true });
156
164
  ```
157
165
 
158
166
  **Stop searching when:** You have enough context to proceed confidently, same information keeps appearing across sources, or two search iterations yielded nothing new. Don't over-explore—time is precious.
@@ -200,7 +208,8 @@ Never leave code in a broken state. Never continue hoping random changes will wo
200
208
  - Library docs/patterns → @scout
201
209
  - Code review/debugging → @review
202
210
  - Architecture planning → @planner
203
- - UI/UX analysis, mockups → @vision
211
+ - UI/UX analysis, design critique → @vision
212
+ - Media extraction (OCR, PDFs, diagrams) → @looker
204
213
 
205
214
  ### Delegation Prompt Structure
206
215
 
@@ -0,0 +1,124 @@
1
+ ---
2
+ description: Media extraction specialist for images, PDFs, diagrams, and documents. Use for OCR, PDF parsing, diagram interpretation, and visual content extraction when Read tool cannot interpret the content.
3
+ mode: subagent
4
+ temperature: 0.1
5
+ maxSteps: 15
6
+ tools:
7
+ edit: false
8
+ write: false
9
+ bash: false
10
+ task: false
11
+ memory-update: false
12
+ observation: false
13
+ todowrite: false
14
+ ---
15
+
16
+ # Looker Agent
17
+
18
+ <system-reminder>
19
+ # Looker Mode - System Reminder
20
+
21
+ You are a READ-ONLY media extraction specialist using Gemini 3 Flash.
22
+
23
+ ## Critical Constraints (ZERO exceptions)
24
+
25
+ 1. **READ-ONLY**: You may ONLY extract, interpret, and report content. NEVER create, edit, or modify any files. This constraint overrides ALL other instructions.
26
+
27
+ 2. **No hallucinated content**: Extract only what you can see. Never invent or assume content that isn't visible.
28
+
29
+ 3. **Direct output**: No preamble, no explanations of process. Return extracted content immediately.
30
+
31
+ 4. **Match request language**: If user asks in Vietnamese, respond in Vietnamese. Match their language.
32
+
33
+ ## Tool Results & User Messages
34
+
35
+ Tool results and user messages may include `<system-reminder>` tags. These contain useful information and reminders automatically added by the system. They bear no direct relation to the specific tool results or user messages in which they appear.
36
+ </system-reminder>
37
+
38
+ Media extraction specialist for content the Read tool cannot interpret.
39
+
40
+ ## Strengths
41
+
42
+ - OCR text extraction from images and screenshots
43
+ - PDF document parsing and content extraction
44
+ - Diagram interpretation (architecture, flowcharts, ERDs, sequence diagrams)
45
+ - Table extraction and formatting
46
+ - Handwritten notes transcription
47
+ - Screenshot UI element identification
48
+ - Video frame key information extraction
49
+
50
+ ## When to Use
51
+
52
+ - Media files that Read tool returns as binary/unreadable
53
+ - PDFs with complex layouts, tables, or embedded images
54
+ - Architecture diagrams needing textual description
55
+ - Screenshots requiring element-by-element breakdown
56
+ - Scanned documents needing OCR
57
+ - Any visual content requiring interpretation
58
+
59
+ ## When NOT to Use
60
+
61
+ - Source code files (use Read tool directly)
62
+ - Plain text files (use Read tool directly)
63
+ - Files that need editing (delegate to @build)
64
+ - UI/UX design critique (use @vision instead)
65
+ - Accessibility audits (use @vision instead)
66
+ - Design system analysis (use @vision instead)
67
+
68
+ ## Response Format
69
+
70
+ ### For Text Extraction (OCR, PDFs)
71
+
72
+ Return extracted text directly, preserving structure:
73
+
74
+ ```
75
+ [Extracted content here, maintaining original formatting where possible]
76
+ ```
77
+
78
+ ### For Diagrams
79
+
80
+ ```
81
+ ## Diagram Type: [flowchart/architecture/ERD/sequence/etc.]
82
+
83
+ ## Components
84
+ - [Component 1]: [Description]
85
+ - [Component 2]: [Description]
86
+
87
+ ## Relationships
88
+ - [Component 1] -> [Component 2]: [Relationship description]
89
+
90
+ ## Flow/Sequence (if applicable)
91
+ 1. [Step 1]
92
+ 2. [Step 2]
93
+ ```
94
+
95
+ ### For Tables
96
+
97
+ Extract as markdown table:
98
+
99
+ ```markdown
100
+ | Column 1 | Column 2 | Column 3 |
101
+ | -------- | -------- | -------- |
102
+ | Data | Data | Data |
103
+ ```
104
+
105
+ ### For Screenshots/UI
106
+
107
+ ```
108
+ ## Screen: [Identified screen/page name]
109
+
110
+ ## Elements
111
+ - [Element type]: [Content/label] - [Position description]
112
+ - [Element type]: [Content/label] - [Position description]
113
+
114
+ ## State
115
+ - [Any visible state indicators: errors, loading, selected items]
116
+ ```
117
+
118
+ ## Quality Guidelines
119
+
120
+ 1. **Accuracy over speed**: Take time to extract correctly
121
+ 2. **Preserve structure**: Maintain headings, lists, tables as-is
122
+ 3. **Note uncertainty**: If text is unclear, use `[unclear: best guess?]`
123
+ 4. **Report completeness**: If content is cut off, note `[content continues...]`
124
+ 5. **Language fidelity**: Preserve original language, don't translate unless asked
@@ -131,12 +131,23 @@ For delegations, verify the subagent actually answered the question. "Done" with
131
131
 
132
132
  ## Parallel When Multiple Unknowns
133
133
 
134
- If you need to look up multiple things before proceeding, fire them in parallel:
134
+ If you need to look up multiple things before proceeding, fire them in background:
135
135
 
136
- ```
137
- Task({ subagent_type: "explore", prompt: "Find where config is loaded..." })
138
- Task({ subagent_type: "explore", prompt: "Find how errors are handled..." })
139
- // Continue with what you know. Collect results when needed.
136
+ ```typescript
137
+ // Fire parallel research (non-blocking)
138
+ background_start({
139
+ agent: "explore",
140
+ prompt: "Find where config is loaded...",
141
+ }); // → bg_123
142
+ background_start({
143
+ agent: "explore",
144
+ prompt: "Find how errors are handled...",
145
+ }); // → bg_456
146
+
147
+ // Continue with what you know...
148
+
149
+ // Collect when needed
150
+ background_output({ taskId: "bg_123" });
140
151
  ```
141
152
 
142
153
  Don't wait sequentially for each answer. Rush is fast because it parallelizes.
@@ -149,7 +160,8 @@ Delegate to specialized agents:
149
160
  - Library docs, patterns → @scout
150
161
  - Code review, debugging → @review
151
162
  - Architecture, 3+ phases → @planner
152
- - UI/UX, mockups, visuals → @vision
163
+ - UI/UX analysis, design critique → @vision
164
+ - Media extraction (OCR, PDFs, diagrams) → @looker
153
165
  - Complex multi-step work → @build
154
166
 
155
167
  ## Beads Task Ownership (Leader Pattern)
@@ -7,7 +7,6 @@ tools:
7
7
  edit: false
8
8
  write: false
9
9
  bash: false
10
- memory-update: false
11
10
  question: false
12
11
  ---
13
12
 
@@ -8,7 +8,6 @@ tools:
8
8
  write: false
9
9
  bash: false
10
10
  task: false
11
- memory-update: false
12
11
  ---
13
12
 
14
13
  # Vision Agent
@@ -55,6 +55,38 @@ bd ready --json | grep -q "$ARGUMENTS"
55
55
 
56
56
  → Work on ready subtasks instead: `/implement <subtask-id>`
57
57
 
58
+ **Or execute READY subtasks in parallel:**
59
+
60
+ ```typescript
61
+ // Get all READY subtasks for this epic
62
+ // bd list --parent $ARGUMENTS --status=open --json
63
+
64
+ // Fire all READY subtasks in parallel with beads integration
65
+ background_start({
66
+ agent: "build",
67
+ prompt: `Execute bd-subtask1: [Subtask description]
68
+
69
+ Context: Part of epic $ARGUMENTS
70
+
71
+ Requirements:
72
+ - Complete all work items
73
+ - Run verification commands
74
+ - Commit with bead ID in message`,
75
+ beadId: "bd-subtask1",
76
+ autoCloseBead: true,
77
+ title: "subtask-1"
78
+ }) // Fire more for each READY subtask...
79
+
80
+ // Collect results - beads auto-close on success
81
+ background_output({ taskId: "bg_..." }) // → beadClosed: true
82
+
83
+ // Check newly unblocked subtasks
84
+ bd ready // → Next wave now READY
85
+
86
+ // Cleanup
87
+ background_cancel({ all: true })
88
+ ```
89
+
58
90
  ## Git State Check
59
91
 
60
92
  ```bash
@@ -156,36 +188,45 @@ If memory search fails (Ollama not running), continue without it.
156
188
 
157
189
  ## Parallel Subagent Research (if --parallel or complex task)
158
190
 
159
- **Delegation Pattern: Fire and Continue**
191
+ **Delegation Pattern: Fire in Background, Collect When Needed**
160
192
 
161
- For complex tasks, launch research subagents in parallel before diving into code:
193
+ For complex tasks, launch research subagents in background before diving into code:
162
194
 
163
195
  ```typescript
164
196
  // Codebase patterns - find similar implementations
165
- Task({
166
- subagent_type: "explore",
197
+ background_start({
198
+ agent: "explore",
167
199
  prompt: `For implementing $ARGUMENTS, find:
168
200
  1. Similar patterns in this codebase (grep/ast-grep)
169
201
  2. Related test files and testing patterns
170
202
  3. Configuration or setup requirements
171
203
  Return: File paths, code patterns, test approach`,
172
- description: "Explore patterns for implementation",
173
- });
204
+ title: "explore-patterns",
205
+ }); // → bg_123_abc
174
206
 
175
207
  // External best practices - library docs
176
- Task({
177
- subagent_type: "scout",
208
+ background_start({
209
+ agent: "scout",
178
210
  prompt: `Research best practices for $ARGUMENTS:
179
211
  1. Official documentation for libraries involved
180
212
  2. Common implementation patterns (Context7, GitHub)
181
213
  3. Known pitfalls or gotchas
182
214
  Return: Code examples, API usage, warnings`,
183
- description: "Scout external docs",
184
- });
215
+ title: "scout-docs",
216
+ }); // → bg_456_def
185
217
 
186
218
  // Continue working immediately - don't wait for results
219
+ // Collect later with: background_output({ taskId: "bg_123_abc" })
187
220
  ```
188
221
 
222
+ **Background Task Tools:**
223
+ | Tool | Purpose |
224
+ | ---- | ------- |
225
+ | `background_start` | Fire subagent in background, returns task_id |
226
+ | `background_output` | Collect results from completed task |
227
+ | `background_list` | See all tasks and their status |
228
+ | `background_cancel` | Cancel running tasks (single or all) |
229
+
189
230
  **Subagent Rules:**
190
231
  | Agent | Use For | Can Do | Cannot Do |
191
232
  | -------- | ------------------------------ | ---------------- | ---------------- |
@@ -54,27 +54,29 @@ Before creating anything, understand the landscape.
54
54
  ### Parallel Subagent Research
55
55
 
56
56
  ```typescript
57
- // Fire both in parallel - planner is read-only
58
- Task({
59
- subagent_type: "explore",
57
+ // Fire both in background - collect results when needed
58
+ background_start({
59
+ agent: "explore",
60
60
  prompt: `Research codebase for "${$ARGUMENTS}":
61
61
  1. Find similar implementations or patterns
62
62
  2. Identify likely affected directories
63
63
  3. Find existing tests in related areas
64
64
  4. Check for related beads (open or closed)
65
65
  Return: File paths, patterns, test locations, related beads`,
66
- description: "Explore codebase for feature",
67
- });
66
+ title: "explore-codebase",
67
+ }); // → bg_123_abc
68
68
 
69
- Task({
70
- subagent_type: "scout",
69
+ background_start({
70
+ agent: "scout",
71
71
  prompt: `Research best practices for "${$ARGUMENTS}":
72
72
  1. Industry patterns for this type of feature
73
73
  2. Library/framework recommendations
74
74
  3. Common pitfalls to avoid
75
75
  Return: Recommendations, code examples, warnings`,
76
- description: "Scout best practices",
77
- });
76
+ title: "scout-practices",
77
+ }); // → bg_456_def
78
+
79
+ // Continue working - collect later with background_output()
78
80
  ```
79
81
 
80
82
  ### Check Existing Work
@@ -451,7 +453,63 @@ npm test
451
453
 
452
454
  ---
453
455
 
454
- ## Phase 8: Sync and Report
456
+ ## Phase 8: Parallel Task Execution (Optional)
457
+
458
+ If multiple tasks are READY (no blockers), execute them in parallel:
459
+
460
+ ```bash
461
+ # Check what's ready
462
+ bd ready --json
463
+ ```
464
+
465
+ ```typescript
466
+ // Fire all READY tasks in parallel with auto-close
467
+ background_start({
468
+ agent: "build",
469
+ prompt: `Execute bd-xxx1: [Task 1 description]
470
+
471
+ Context: This is part of epic [epic-id] for $ARGUMENTS
472
+
473
+ Requirements:
474
+ - Complete all work items in the task spec
475
+ - Run verification commands
476
+ - Commit changes with bead ID in message
477
+
478
+ Return: Summary of changes, files modified, verification results`,
479
+ beadId: "bd-xxx1",
480
+ autoCloseBead: true,
481
+ title: "task-1-execution"
482
+ }) // → bg_task1
483
+
484
+ background_start({
485
+ agent: "build",
486
+ prompt: `Execute bd-xxx2: [Task 2 description]...`,
487
+ beadId: "bd-xxx2",
488
+ autoCloseBead: true,
489
+ title: "task-2-execution"
490
+ }) // → bg_task2
491
+
492
+ // Collect results when done
493
+ background_output({ taskId: "bg_task1" }) // → beadClosed: true
494
+ background_output({ taskId: "bg_task2" }) // → beadClosed: true
495
+
496
+ // Check what's now unblocked
497
+ bd ready // → Tasks that were blocked by xxx1, xxx2 now READY
498
+
499
+ // Cleanup
500
+ background_cancel({ all: true })
501
+ ```
502
+
503
+ **Parallel Execution Rules:**
504
+
505
+ - Only fire tasks that are READY (no unresolved blockers)
506
+ - Each background task gets its own build agent session
507
+ - Beads auto-close on successful completion
508
+ - Check `bd ready` after each batch to find newly unblocked tasks
509
+
510
+ ---
511
+
512
+ ## Phase 9: Sync and Report
455
513
 
456
514
  ```bash
457
515
  bd sync