opencodekit 0.14.4 → 0.14.5
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 +7 -7
- package/dist/template/.opencode/.background-tasks.json +18 -0
- package/dist/template/.opencode/command/analyze-project.md +187 -358
- package/dist/template/.opencode/command/implement.md +29 -30
- package/dist/template/.opencode/command/new-feature.md +10 -10
- package/dist/template/.opencode/command/plan.md +13 -15
- package/dist/template/.opencode/command/start.md +11 -12
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/tool/background.ts +147 -99
- package/package.json +7 -7
|
@@ -61,9 +61,11 @@ bd ready --json | grep -q "$ARGUMENTS"
|
|
|
61
61
|
// Get all READY subtasks for this epic
|
|
62
62
|
// bd list --parent $ARGUMENTS --status=open --json
|
|
63
63
|
|
|
64
|
-
// Fire all READY subtasks in parallel
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
// Fire all READY subtasks in parallel using Task tool
|
|
65
|
+
// Multiple Task calls in one message run simultaneously
|
|
66
|
+
Task({
|
|
67
|
+
subagent_type: "rush",
|
|
68
|
+
description: "Execute subtask 1",
|
|
67
69
|
prompt: `Execute bd-subtask1: [Subtask description]
|
|
68
70
|
|
|
69
71
|
Context: Part of epic $ARGUMENTS
|
|
@@ -71,20 +73,20 @@ background_start({
|
|
|
71
73
|
Requirements:
|
|
72
74
|
- Complete all work items
|
|
73
75
|
- Run verification commands
|
|
74
|
-
- Commit with bead ID in message
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
title: "subtask-1"
|
|
78
|
-
}) // Fire more for each READY subtask...
|
|
76
|
+
- Commit with bead ID in message
|
|
77
|
+
- Close the bead when done: bd close bd-subtask1 --reason "Completed: ..."`,
|
|
78
|
+
});
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
Task({
|
|
81
|
+
subagent_type: "rush",
|
|
82
|
+
description: "Execute subtask 2",
|
|
83
|
+
prompt: `Execute bd-subtask2: [Subtask description]
|
|
84
|
+
...same pattern...`,
|
|
85
|
+
});
|
|
82
86
|
|
|
87
|
+
// Results available immediately after all complete
|
|
83
88
|
// Check newly unblocked subtasks
|
|
84
89
|
bd ready // → Next wave now READY
|
|
85
|
-
|
|
86
|
-
// Cleanup
|
|
87
|
-
background_cancel({ all: true })
|
|
88
90
|
```
|
|
89
91
|
|
|
90
92
|
## Git State Check
|
|
@@ -188,44 +190,41 @@ If memory search fails (Ollama not running), continue without it.
|
|
|
188
190
|
|
|
189
191
|
## Parallel Subagent Research (if --parallel or complex task)
|
|
190
192
|
|
|
191
|
-
**Delegation Pattern:
|
|
193
|
+
**Delegation Pattern: Parallel Task Calls**
|
|
192
194
|
|
|
193
|
-
For complex tasks, launch research subagents in
|
|
195
|
+
For complex tasks, launch research subagents in parallel before diving into code.
|
|
196
|
+
Multiple Task calls in a single message run simultaneously:
|
|
194
197
|
|
|
195
198
|
```typescript
|
|
196
199
|
// Codebase patterns - find similar implementations
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
Task({
|
|
201
|
+
subagent_type: "explore",
|
|
202
|
+
description: "Find codebase patterns",
|
|
199
203
|
prompt: `For implementing $ARGUMENTS, find:
|
|
200
204
|
1. Similar patterns in this codebase (grep/ast-grep)
|
|
201
205
|
2. Related test files and testing patterns
|
|
202
206
|
3. Configuration or setup requirements
|
|
203
207
|
Return: File paths, code patterns, test approach`,
|
|
204
|
-
|
|
205
|
-
}); // → bg_123_abc
|
|
208
|
+
});
|
|
206
209
|
|
|
207
210
|
// External best practices - library docs
|
|
208
|
-
|
|
209
|
-
|
|
211
|
+
Task({
|
|
212
|
+
subagent_type: "scout",
|
|
213
|
+
description: "Research best practices",
|
|
210
214
|
prompt: `Research best practices for $ARGUMENTS:
|
|
211
215
|
1. Official documentation for libraries involved
|
|
212
216
|
2. Common implementation patterns (Context7, GitHub)
|
|
213
217
|
3. Known pitfalls or gotchas
|
|
214
218
|
Return: Code examples, API usage, warnings`,
|
|
215
|
-
|
|
216
|
-
}); // → bg_456_def
|
|
219
|
+
});
|
|
217
220
|
|
|
218
|
-
//
|
|
219
|
-
// Collect later with: background_output({ taskId: "bg_123_abc" })
|
|
221
|
+
// Both run in parallel, results available immediately
|
|
220
222
|
```
|
|
221
223
|
|
|
222
|
-
**
|
|
224
|
+
**Subagent Tools:**
|
|
223
225
|
| Tool | Purpose |
|
|
224
226
|
| ---- | ------- |
|
|
225
|
-
| `
|
|
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) |
|
|
227
|
+
| `Task` | Delegate to subagent, runs in parallel when multiple calls in one message |
|
|
229
228
|
|
|
230
229
|
**Subagent Rules:**
|
|
231
230
|
| Agent | Use For | Can Do | Cannot Do |
|
|
@@ -54,29 +54,29 @@ Before creating anything, understand the landscape.
|
|
|
54
54
|
### Parallel Subagent Research
|
|
55
55
|
|
|
56
56
|
```typescript
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
// Run both in parallel - multiple Task calls in one message
|
|
58
|
+
Task({
|
|
59
|
+
subagent_type: "explore",
|
|
60
|
+
description: "Explore codebase for feature",
|
|
60
61
|
prompt: `Research codebase for "${$ARGUMENTS}":
|
|
61
62
|
1. Find similar implementations or patterns
|
|
62
63
|
2. Identify likely affected directories
|
|
63
64
|
3. Find existing tests in related areas
|
|
64
65
|
4. Check for related beads (open or closed)
|
|
65
66
|
Return: File paths, patterns, test locations, related beads`,
|
|
66
|
-
|
|
67
|
-
}); // → bg_123_abc
|
|
67
|
+
});
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
Task({
|
|
70
|
+
subagent_type: "scout",
|
|
71
|
+
description: "Research best practices",
|
|
71
72
|
prompt: `Research best practices for "${$ARGUMENTS}":
|
|
72
73
|
1. Industry patterns for this type of feature
|
|
73
74
|
2. Library/framework recommendations
|
|
74
75
|
3. Common pitfalls to avoid
|
|
75
76
|
Return: Recommendations, code examples, warnings`,
|
|
76
|
-
|
|
77
|
-
}); // → bg_456_def
|
|
77
|
+
});
|
|
78
78
|
|
|
79
|
-
//
|
|
79
|
+
// Both run in parallel, results available immediately
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
### Check Existing Work
|
|
@@ -73,38 +73,36 @@ If memory search fails (Ollama not running), continue to subagent research.
|
|
|
73
73
|
|
|
74
74
|
## Phase 1: Parallel Subagent Research
|
|
75
75
|
|
|
76
|
-
Gather context before designing.
|
|
76
|
+
Gather context before designing. Run both in parallel:
|
|
77
77
|
|
|
78
78
|
```typescript
|
|
79
|
-
// Codebase patterns
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
// Codebase patterns - run in parallel with scout
|
|
80
|
+
Task({
|
|
81
|
+
subagent_type: "explore",
|
|
82
|
+
description: "Explore codebase for planning",
|
|
82
83
|
prompt: `For planning $ARGUMENTS, research the codebase:
|
|
83
84
|
1. Find similar implementations or patterns
|
|
84
85
|
2. Identify affected files and their structure
|
|
85
86
|
3. Find related tests and testing patterns
|
|
86
87
|
4. Check for potential conflicts with in-progress work
|
|
87
88
|
Return: File paths, code patterns, test approach, conflicts`,
|
|
88
|
-
|
|
89
|
-
}); // → bg_123_abc
|
|
89
|
+
});
|
|
90
90
|
|
|
91
|
-
// External best practices
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
// External best practices - run in parallel with explore
|
|
92
|
+
Task({
|
|
93
|
+
subagent_type: "scout",
|
|
94
|
+
description: "Research implementation approaches",
|
|
94
95
|
prompt: `Research implementation approaches for $ARGUMENTS:
|
|
95
96
|
1. Best practices from official documentation
|
|
96
97
|
2. Common patterns in open source projects
|
|
97
98
|
3. Pitfalls and anti-patterns to avoid
|
|
98
99
|
Return: Recommendations, code examples, warnings`,
|
|
99
|
-
|
|
100
|
-
}); // → bg_456_def
|
|
100
|
+
});
|
|
101
101
|
|
|
102
|
-
//
|
|
103
|
-
background_output({ taskId: "bg_123_abc" });
|
|
104
|
-
background_output({ taskId: "bg_456_def" });
|
|
102
|
+
// Both run in parallel, results available immediately
|
|
105
103
|
```
|
|
106
104
|
|
|
107
|
-
**
|
|
105
|
+
**Integrate findings into your plan.**
|
|
108
106
|
|
|
109
107
|
---
|
|
110
108
|
|
|
@@ -169,36 +169,35 @@ cd .worktrees/$ARGUMENTS
|
|
|
169
169
|
For complex tasks, gather context before diving in:
|
|
170
170
|
|
|
171
171
|
```typescript
|
|
172
|
-
//
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
// Run subagents in parallel - multiple Task calls in one message
|
|
173
|
+
Task({
|
|
174
|
+
subagent_type: "explore",
|
|
175
|
+
description: "Explore codebase patterns",
|
|
175
176
|
prompt: `Research codebase patterns for $ARGUMENTS:
|
|
176
177
|
- Find similar implementations
|
|
177
178
|
- Identify affected files
|
|
178
179
|
- Note testing patterns used
|
|
179
180
|
Return: File list, patterns found, testing approach`,
|
|
180
|
-
|
|
181
|
-
}); // → bg_123_abc
|
|
181
|
+
});
|
|
182
182
|
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
Task({
|
|
184
|
+
subagent_type: "scout",
|
|
185
|
+
description: "Research external docs",
|
|
185
186
|
prompt: `Research external docs for $ARGUMENTS:
|
|
186
187
|
- API documentation for libraries involved
|
|
187
188
|
- Best practices for the approach
|
|
188
189
|
- Common pitfalls to avoid
|
|
189
190
|
Return: Key findings, code examples, warnings`,
|
|
190
|
-
|
|
191
|
-
}); // → bg_456_def
|
|
191
|
+
});
|
|
192
192
|
|
|
193
|
-
//
|
|
193
|
+
// Both run in parallel, results available immediately
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
**Subagent delegation rules:**
|
|
197
197
|
|
|
198
198
|
- Subagents are **read-only** - they don't modify beads state
|
|
199
|
-
- Results
|
|
199
|
+
- Results returned immediately when all complete
|
|
200
200
|
- Use for research, not for implementation
|
|
201
|
-
- Cleanup at session end: `background_cancel({ all: true })`
|
|
202
201
|
|
|
203
202
|
## Existing Artifacts
|
|
204
203
|
|