opencodekit 0.14.0 → 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 +53 -18
- package/dist/template/.opencode/.background-tasks.json +96 -0
- package/dist/template/.opencode/.ralph-state.json +12 -0
- package/dist/template/.opencode/AGENTS.md +112 -6
- package/dist/template/.opencode/agent/build.md +60 -8
- package/dist/template/.opencode/agent/explore.md +1 -0
- package/dist/template/.opencode/agent/looker.md +124 -0
- package/dist/template/.opencode/agent/planner.md +40 -1
- package/dist/template/.opencode/agent/review.md +1 -0
- package/dist/template/.opencode/agent/rush.md +53 -6
- package/dist/template/.opencode/agent/scout.md +1 -1
- package/dist/template/.opencode/agent/vision.md +0 -1
- package/dist/template/.opencode/command/brainstorm.md +58 -3
- package/dist/template/.opencode/command/finish.md +18 -8
- package/dist/template/.opencode/command/fix.md +24 -15
- package/dist/template/.opencode/command/implement.md +95 -29
- package/dist/template/.opencode/command/import-plan.md +30 -8
- package/dist/template/.opencode/command/new-feature.md +105 -14
- package/dist/template/.opencode/command/plan.md +78 -11
- package/dist/template/.opencode/command/pr.md +25 -15
- package/dist/template/.opencode/command/ralph-loop.md +97 -0
- package/dist/template/.opencode/command/revert-feature.md +15 -3
- package/dist/template/.opencode/command/skill-optimize.md +71 -7
- package/dist/template/.opencode/command/start.md +63 -15
- package/dist/template/.opencode/dcp.jsonc +11 -7
- package/dist/template/.opencode/memory/{project/beads-workflow.md → beads-workflow.md} +53 -0
- package/dist/template/.opencode/memory/observations/2026-01-09-pattern-ampcode-mcp-json-includetools-pattern.md +42 -0
- package/dist/template/.opencode/memory/project/conventions.md +53 -3
- package/dist/template/.opencode/memory/project/gotchas.md +52 -5
- package/dist/template/.opencode/memory/vector_db/memories.lance/_transactions/{0-8d00d272-cb80-463b-9774-7120a1c994e7.txn → 0-0d25ba80-ba3b-4209-9046-b45d6093b4da.txn} +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/_versions/1.manifest +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/data/{001010101000000101110001f998d04b63936ff83f9a34152d.lance → 1111100101010101011010004a9ef34df6b29f36a9a53a2892.lance} +0 -0
- package/dist/template/.opencode/opencode.json +529 -587
- package/dist/template/.opencode/package.json +2 -1
- package/dist/template/.opencode/plugin/lsp.ts +299 -0
- package/dist/template/.opencode/plugin/memory.ts +77 -1
- package/dist/template/.opencode/plugin/package.json +1 -1
- package/dist/template/.opencode/plugin/ralph-wiggum.ts +182 -0
- package/dist/template/.opencode/plugin/skill-mcp.ts +155 -36
- package/dist/template/.opencode/skill/chrome-devtools/SKILL.md +43 -65
- package/dist/template/.opencode/skill/chrome-devtools/mcp.json +19 -0
- package/dist/template/.opencode/skill/executing-plans/SKILL.md +32 -2
- package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +42 -17
- package/dist/template/.opencode/skill/playwright/SKILL.md +58 -133
- package/dist/template/.opencode/skill/playwright/mcp.json +16 -0
- package/dist/template/.opencode/tool/background.ts +461 -0
- package/dist/template/.opencode/tool/memory-search.ts +2 -2
- package/dist/template/.opencode/tool/ralph.ts +203 -0
- package/package.json +4 -16
- package/dist/template/.opencode/memory/vector_db/memories.lance/_transactions/1-a3bea825-dad3-47dd-a6d6-ff41b76ff7b0.txn +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/_versions/2.manifest +0 -0
- package/dist/template/.opencode/memory/vector_db/memories.lance/data/010000101010000000010010701b3840d38c2b5f275da99978.lance +0 -0
- /package/dist/template/.opencode/memory/{project/README.md → README.md} +0 -0
- /package/dist/template/.opencode/plugin/{notification.ts → notification.ts.bak} +0 -0
|
@@ -46,8 +46,43 @@ Before acting, answer three questions in your head:
|
|
|
46
46
|
|
|
47
47
|
**Is this mine to do?** Rush handles well-defined, localized (1-3 files), greenfield tasks. If any of these fail—ambiguous scope, system-wide changes, or legacy code with hidden invariants—delegate immediately. Don't power through complexity; avoid it.
|
|
48
48
|
|
|
49
|
+
**Do I need to clarify?** If the request is ambiguous and wrong interpretation wastes significant effort, use the `question` tool to ask ONE focused question. But keep it rare—Rush moves fast. If you're unsure, delegate to @build who handles complexity better.
|
|
50
|
+
|
|
49
51
|
**Do I need to read first?** If you're about to edit a file you haven't seen, stop. Read it. Never speculate about uninspected code.
|
|
50
52
|
|
|
53
|
+
## Using the Question Tool (Sparingly)
|
|
54
|
+
|
|
55
|
+
Rush uses questions rarely—only when wrong interpretation would waste significant effort AND the task is still small enough for Rush.
|
|
56
|
+
|
|
57
|
+
**Good triggers (still ask fast):**
|
|
58
|
+
|
|
59
|
+
- "Delete this" → Ask: Which files/branches specifically?
|
|
60
|
+
- "Rename X" → Ask: New name preference?
|
|
61
|
+
- Binary choice that user must decide
|
|
62
|
+
|
|
63
|
+
**Bad triggers (delegate instead):**
|
|
64
|
+
|
|
65
|
+
- "Add auth" → Too complex for Rush, delegate to @build
|
|
66
|
+
- Multiple design decisions → Delegate to @planner
|
|
67
|
+
- Research needed → Delegate to @scout
|
|
68
|
+
|
|
69
|
+
**If you need to ask more than ONE question, the task is too complex for Rush. Delegate.**
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
question({
|
|
73
|
+
questions: [
|
|
74
|
+
{
|
|
75
|
+
header: "Confirm",
|
|
76
|
+
question: "Delete feature/old-auth branch?",
|
|
77
|
+
options: [
|
|
78
|
+
{ label: "Yes, delete it", description: "Removes remote and local" },
|
|
79
|
+
{ label: "No, keep it", description: "Abort operation" },
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
51
86
|
## Bail Triggers
|
|
52
87
|
|
|
53
88
|
Delegate immediately when you hit any of these:
|
|
@@ -96,12 +131,23 @@ For delegations, verify the subagent actually answered the question. "Done" with
|
|
|
96
131
|
|
|
97
132
|
## Parallel When Multiple Unknowns
|
|
98
133
|
|
|
99
|
-
If you need to look up multiple things before proceeding, fire them in
|
|
134
|
+
If you need to look up multiple things before proceeding, fire them in background:
|
|
100
135
|
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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" });
|
|
105
151
|
```
|
|
106
152
|
|
|
107
153
|
Don't wait sequentially for each answer. Rush is fast because it parallelizes.
|
|
@@ -114,7 +160,8 @@ Delegate to specialized agents:
|
|
|
114
160
|
- Library docs, patterns → @scout
|
|
115
161
|
- Code review, debugging → @review
|
|
116
162
|
- Architecture, 3+ phases → @planner
|
|
117
|
-
- UI/UX
|
|
163
|
+
- UI/UX analysis, design critique → @vision
|
|
164
|
+
- Media extraction (OCR, PDFs, diagrams) → @looker
|
|
118
165
|
- Complex multi-step work → @build
|
|
119
166
|
|
|
120
167
|
## Beads Task Ownership (Leader Pattern)
|
|
@@ -275,7 +275,56 @@ bd create "[Idea name]" -t task -p 2
|
|
|
275
275
|
|
|
276
276
|
## Output
|
|
277
277
|
|
|
278
|
+
```markdown
|
|
279
|
+
Brainstorm Complete: $ARGUMENTS
|
|
280
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
281
|
+
|
|
282
|
+
Duration: [N] minutes
|
|
283
|
+
Ideas generated: [N]
|
|
284
|
+
Ideas evaluated: [N]
|
|
285
|
+
|
|
286
|
+
Top 3:
|
|
287
|
+
|
|
288
|
+
1. [Idea 1] - Score: [N]
|
|
289
|
+
2. [Idea 2] - Score: [N]
|
|
290
|
+
3. [Idea 3] - Score: [N]
|
|
291
|
+
|
|
292
|
+
Recommendation: [Chosen approach]
|
|
293
|
+
Confidence: [High/Medium/Low]
|
|
294
|
+
|
|
295
|
+
Artifacts:
|
|
296
|
+
|
|
297
|
+
- .beads/artifacts/<bead-id>/brainstorm.md (if bead)
|
|
298
|
+
- Observation created ✓
|
|
299
|
+
|
|
300
|
+
Follow-up beads: [N] created
|
|
278
301
|
```
|
|
302
|
+
|
|
303
|
+
**Use question tool for next steps:**
|
|
304
|
+
|
|
305
|
+
```typescript
|
|
306
|
+
question({
|
|
307
|
+
questions: [
|
|
308
|
+
{
|
|
309
|
+
header: "Next Step",
|
|
310
|
+
question: "What should we do next with $ARGUMENTS?",
|
|
311
|
+
options: [
|
|
312
|
+
{
|
|
313
|
+
label: "Research approach (Recommended)",
|
|
314
|
+
description: "Validate with /research",
|
|
315
|
+
},
|
|
316
|
+
{ label: "Create implementation plan", description: "Plan with /plan" },
|
|
317
|
+
{
|
|
318
|
+
label: "Explore more",
|
|
319
|
+
description: "Continue brainstorming other aspects",
|
|
320
|
+
},
|
|
321
|
+
{ label: "Done for now", description: "Save findings, revisit later" },
|
|
322
|
+
],
|
|
323
|
+
},
|
|
324
|
+
],
|
|
325
|
+
});
|
|
326
|
+
```
|
|
327
|
+
|
|
279
328
|
Brainstorm Complete: $ARGUMENTS
|
|
280
329
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
281
330
|
|
|
@@ -284,6 +333,7 @@ Ideas generated: [N]
|
|
|
284
333
|
Ideas evaluated: [N]
|
|
285
334
|
|
|
286
335
|
Top 3:
|
|
336
|
+
|
|
287
337
|
1. [Idea 1] - Score: [N]
|
|
288
338
|
2. [Idea 2] - Score: [N]
|
|
289
339
|
3. [Idea 3] - Score: [N]
|
|
@@ -292,21 +342,25 @@ Recommendation: [Chosen approach]
|
|
|
292
342
|
Confidence: [High/Medium/Low]
|
|
293
343
|
|
|
294
344
|
Artifacts:
|
|
345
|
+
|
|
295
346
|
- .beads/artifacts/<bead-id>/brainstorm.md (if bead)
|
|
296
347
|
- Observation created ✓
|
|
297
348
|
|
|
298
349
|
Follow-up beads: [N] created
|
|
350
|
+
|
|
299
351
|
```
|
|
300
352
|
|
|
301
353
|
**Next steps:**
|
|
302
354
|
|
|
303
355
|
```
|
|
356
|
+
|
|
304
357
|
If ready to proceed:
|
|
305
|
-
|
|
306
|
-
|
|
358
|
+
/research <bead-id> # Validate approach
|
|
359
|
+
/plan <bead-id> # Create implementation plan
|
|
307
360
|
|
|
308
361
|
If need more exploration:
|
|
309
|
-
|
|
362
|
+
/brainstorm <new-aspect> # Continue ideation
|
|
363
|
+
|
|
310
364
|
```
|
|
311
365
|
|
|
312
366
|
## Anti-Patterns
|
|
@@ -316,3 +370,4 @@ If need more exploration:
|
|
|
316
370
|
- ❌ **Infinite brainstorming** - Time box and decide
|
|
317
371
|
- ❌ **No decision** - Brainstorming must produce a recommendation
|
|
318
372
|
- ❌ **No capture** - Undocumented ideas are lost ideas
|
|
373
|
+
```
|
|
@@ -116,17 +116,27 @@ git commit -m "$ARGUMENTS: [what was done]
|
|
|
116
116
|
Closes: $ARGUMENTS"
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
## Close The Task (
|
|
119
|
+
## Close The Task (Use Question Tool)
|
|
120
120
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
```typescript
|
|
122
|
+
question({
|
|
123
|
+
questions: [
|
|
124
|
+
{
|
|
125
|
+
header: "Close",
|
|
126
|
+
question: "Should I close bead $ARGUMENTS?",
|
|
127
|
+
options: [
|
|
128
|
+
{
|
|
129
|
+
label: "Yes, close it (Recommended)",
|
|
130
|
+
description: "All gates passed, task complete",
|
|
131
|
+
},
|
|
132
|
+
{ label: "No, keep open", description: "Need more work or review" },
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
});
|
|
127
137
|
```
|
|
128
138
|
|
|
129
|
-
If user confirms:
|
|
139
|
+
If user confirms close:
|
|
130
140
|
|
|
131
141
|
```bash
|
|
132
142
|
bd close $ARGUMENTS --reason "Completed: [1-line summary]"
|
|
@@ -115,23 +115,32 @@ git status
|
|
|
115
115
|
git diff --cached --stat
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
-
**
|
|
118
|
+
**Use question tool to get commit decision:**
|
|
119
119
|
|
|
120
|
+
```typescript
|
|
121
|
+
question({
|
|
122
|
+
questions: [
|
|
123
|
+
{
|
|
124
|
+
header: "Commit",
|
|
125
|
+
question: "Fix Complete: $ARGUMENTS. What should I do next?",
|
|
126
|
+
options: [
|
|
127
|
+
{
|
|
128
|
+
label: "Commit changes (Recommended)",
|
|
129
|
+
description: "Git commit and bd sync",
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: "Show diff first",
|
|
133
|
+
description: "Review changes before committing",
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: "Skip commit",
|
|
137
|
+
description: "I'll review and commit manually",
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
});
|
|
120
143
|
```
|
|
121
|
-
Fix Complete: $ARGUMENTS
|
|
122
|
-
━━━━━━━━━━━━━━━━━━━━━━━
|
|
123
|
-
|
|
124
|
-
Root cause: [brief]
|
|
125
|
-
Changes: [files]
|
|
126
|
-
Tests: Pass ✓
|
|
127
|
-
|
|
128
|
-
Would you like me to:
|
|
129
|
-
1. Commit these changes
|
|
130
|
-
2. Show full diff first
|
|
131
|
-
3. Skip commit (I'll review manually)
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
**Wait for user confirmation before committing.**
|
|
135
144
|
|
|
136
145
|
If user confirms:
|
|
137
146
|
|
|
@@ -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
|
|
@@ -67,7 +99,25 @@ If dirty, ask whether to stash, commit, or continue.
|
|
|
67
99
|
Create a branch if not already on one for this task:
|
|
68
100
|
|
|
69
101
|
```bash
|
|
70
|
-
|
|
102
|
+
# Get current branch (parent branch)
|
|
103
|
+
PARENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
104
|
+
|
|
105
|
+
# Get task title for readable branch name
|
|
106
|
+
BEAD_INFO=$(bd show $ARGUMENTS --json 2>/dev/null)
|
|
107
|
+
BEAD_TITLE=$(echo "$BEAD_INFO" | jq -r '.title // ""' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | cut -c1-40)
|
|
108
|
+
BEAD_TYPE=$(echo "$BEAD_INFO" | jq -r '.type // "task"')
|
|
109
|
+
|
|
110
|
+
# Map bead type to branch prefix
|
|
111
|
+
case "$BEAD_TYPE" in
|
|
112
|
+
"bug") PREFIX="fix" ;;
|
|
113
|
+
"feature"|"epic") PREFIX="feat" ;;
|
|
114
|
+
"refactor") PREFIX="refactor" ;;
|
|
115
|
+
*) PREFIX="feat" ;;
|
|
116
|
+
esac
|
|
117
|
+
|
|
118
|
+
# Create branch: <parent>/<type>/<bead-id>-<description>
|
|
119
|
+
BRANCH_NAME="${PARENT_BRANCH}/${PREFIX}/$ARGUMENTS-${BEAD_TITLE}"
|
|
120
|
+
git checkout -b "$BRANCH_NAME" 2>/dev/null || echo "Already on branch"
|
|
71
121
|
```
|
|
72
122
|
|
|
73
123
|
Mark the task in progress (if not already):
|
|
@@ -104,7 +154,7 @@ First, get a quick codebase overview:
|
|
|
104
154
|
|
|
105
155
|
```typescript
|
|
106
156
|
// Quick overview of relevant directories
|
|
107
|
-
repo-map({ path: "src", format: "compact", maxDepth: 3 });
|
|
157
|
+
repo - map({ path: "src", format: "compact", maxDepth: 3 });
|
|
108
158
|
```
|
|
109
159
|
|
|
110
160
|
Then search for relevant patterns and learnings:
|
|
@@ -138,36 +188,45 @@ If memory search fails (Ollama not running), continue without it.
|
|
|
138
188
|
|
|
139
189
|
## Parallel Subagent Research (if --parallel or complex task)
|
|
140
190
|
|
|
141
|
-
**Delegation Pattern: Fire
|
|
191
|
+
**Delegation Pattern: Fire in Background, Collect When Needed**
|
|
142
192
|
|
|
143
|
-
For complex tasks, launch research subagents in
|
|
193
|
+
For complex tasks, launch research subagents in background before diving into code:
|
|
144
194
|
|
|
145
195
|
```typescript
|
|
146
196
|
// Codebase patterns - find similar implementations
|
|
147
|
-
|
|
148
|
-
|
|
197
|
+
background_start({
|
|
198
|
+
agent: "explore",
|
|
149
199
|
prompt: `For implementing $ARGUMENTS, find:
|
|
150
200
|
1. Similar patterns in this codebase (grep/ast-grep)
|
|
151
201
|
2. Related test files and testing patterns
|
|
152
202
|
3. Configuration or setup requirements
|
|
153
203
|
Return: File paths, code patterns, test approach`,
|
|
154
|
-
|
|
155
|
-
});
|
|
204
|
+
title: "explore-patterns",
|
|
205
|
+
}); // → bg_123_abc
|
|
156
206
|
|
|
157
207
|
// External best practices - library docs
|
|
158
|
-
|
|
159
|
-
|
|
208
|
+
background_start({
|
|
209
|
+
agent: "scout",
|
|
160
210
|
prompt: `Research best practices for $ARGUMENTS:
|
|
161
211
|
1. Official documentation for libraries involved
|
|
162
212
|
2. Common implementation patterns (Context7, GitHub)
|
|
163
213
|
3. Known pitfalls or gotchas
|
|
164
214
|
Return: Code examples, API usage, warnings`,
|
|
165
|
-
|
|
166
|
-
});
|
|
215
|
+
title: "scout-docs",
|
|
216
|
+
}); // → bg_456_def
|
|
167
217
|
|
|
168
218
|
// Continue working immediately - don't wait for results
|
|
219
|
+
// Collect later with: background_output({ taskId: "bg_123_abc" })
|
|
169
220
|
```
|
|
170
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
|
+
|
|
171
230
|
**Subagent Rules:**
|
|
172
231
|
| Agent | Use For | Can Do | Cannot Do |
|
|
173
232
|
| -------- | ------------------------------ | ---------------- | ---------------- |
|
|
@@ -296,26 +355,33 @@ git status
|
|
|
296
355
|
git diff --cached --stat
|
|
297
356
|
```
|
|
298
357
|
|
|
299
|
-
**
|
|
300
|
-
|
|
301
|
-
```
|
|
302
|
-
Implementation Complete: $ARGUMENTS
|
|
303
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
304
|
-
|
|
305
|
-
Type: [epic/task/subtask]
|
|
306
|
-
Tests: Pass ✓
|
|
307
|
-
Changes: [files modified]
|
|
308
|
-
|
|
309
|
-
Subtasks: [N completed / M total] (if applicable)
|
|
358
|
+
**Use question tool to get commit decision:**
|
|
310
359
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
360
|
+
```typescript
|
|
361
|
+
question({
|
|
362
|
+
questions: [
|
|
363
|
+
{
|
|
364
|
+
header: "Commit",
|
|
365
|
+
question: "Implementation Complete: $ARGUMENTS. What should I do next?",
|
|
366
|
+
options: [
|
|
367
|
+
{
|
|
368
|
+
label: "Commit changes (Recommended)",
|
|
369
|
+
description: "Git commit and bd sync",
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
label: "Show diff first",
|
|
373
|
+
description: "Review changes before committing",
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
label: "Skip commit",
|
|
377
|
+
description: "I'll review and commit manually",
|
|
378
|
+
},
|
|
379
|
+
],
|
|
380
|
+
},
|
|
381
|
+
],
|
|
382
|
+
});
|
|
315
383
|
```
|
|
316
384
|
|
|
317
|
-
**Wait for user confirmation before committing.**
|
|
318
|
-
|
|
319
385
|
If user confirms:
|
|
320
386
|
|
|
321
387
|
```bash
|
|
@@ -46,7 +46,7 @@ Before importing, check for existing beads with similar titles:
|
|
|
46
46
|
|
|
47
47
|
Compare plan titles against existing beads:
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
````
|
|
50
50
|
Duplicate Check:
|
|
51
51
|
━━━━━━━━━━━━━━━━
|
|
52
52
|
|
|
@@ -59,8 +59,19 @@ Options:
|
|
|
59
59
|
2. Force import (create duplicates)
|
|
60
60
|
3. Cancel import
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
```typescript
|
|
63
|
+
question({
|
|
64
|
+
questions: [{
|
|
65
|
+
header: "Duplicates",
|
|
66
|
+
question: "Potential duplicates found. What should I do?",
|
|
67
|
+
options: [
|
|
68
|
+
{ label: "Skip duplicates (Recommended)", description: "Import only new items" },
|
|
69
|
+
{ label: "Force import", description: "Create duplicate beads anyway" },
|
|
70
|
+
{ label: "Cancel import", description: "Stop and review plan" }
|
|
71
|
+
]
|
|
72
|
+
}]
|
|
73
|
+
});
|
|
74
|
+
````
|
|
64
75
|
|
|
65
76
|
If `--force` flag set, skip this check and import everything.
|
|
66
77
|
|
|
@@ -78,7 +89,7 @@ Parse the plan for:
|
|
|
78
89
|
|
|
79
90
|
Report:
|
|
80
91
|
|
|
81
|
-
|
|
92
|
+
````
|
|
82
93
|
Plan Analysis: [filename]
|
|
83
94
|
━━━━━━━━━━━━━━━━━━━━━━━━
|
|
84
95
|
|
|
@@ -95,10 +106,21 @@ Structure:
|
|
|
95
106
|
│ └── [Issue 1] [L] → depends on [Epic 1/Issue 2]
|
|
96
107
|
└── ...
|
|
97
108
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
109
|
+
```typescript
|
|
110
|
+
question({
|
|
111
|
+
questions: [{
|
|
112
|
+
header: "Import",
|
|
113
|
+
question: "Plan analyzed. Should I proceed with import?",
|
|
114
|
+
options: [
|
|
115
|
+
{ label: "Proceed with import (Recommended)", description: "Create epics and issues" },
|
|
116
|
+
{ label: "Modify plan", description: "Need changes before importing" },
|
|
117
|
+
{ label: "Cancel", description: "Stop and review plan" }
|
|
118
|
+
]
|
|
119
|
+
}]
|
|
120
|
+
});
|
|
121
|
+
````
|
|
122
|
+
|
|
123
|
+
**STOP and wait for user approval** (unless `--dry-run`, then just show preview).
|
|
102
124
|
|
|
103
125
|
---
|
|
104
126
|
|
|
@@ -54,27 +54,29 @@ Before creating anything, understand the landscape.
|
|
|
54
54
|
### Parallel Subagent Research
|
|
55
55
|
|
|
56
56
|
```typescript
|
|
57
|
-
// Fire both in
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
67
|
-
});
|
|
66
|
+
title: "explore-codebase",
|
|
67
|
+
}); // → bg_123_abc
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
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
|
-
|
|
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
|
|
@@ -142,10 +144,34 @@ Key risks identified:
|
|
|
142
144
|
- [Risk 1]: Mitigation: [...]
|
|
143
145
|
- [Risk 2]: Mitigation: [...]
|
|
144
146
|
|
|
145
|
-
Proceed with spec? (yes/modify/explore-more)
|
|
146
147
|
```
|
|
147
148
|
|
|
148
|
-
**STOP
|
|
149
|
+
**STOP. Use question tool to get user approval:**
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
question({
|
|
153
|
+
questions: [
|
|
154
|
+
{
|
|
155
|
+
header: "Approve",
|
|
156
|
+
question:
|
|
157
|
+
"Should I proceed with creating the specification for $ARGUMENTS?",
|
|
158
|
+
options: [
|
|
159
|
+
{
|
|
160
|
+
label: "Yes, proceed",
|
|
161
|
+
description: "Approach looks good, create spec",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: "Modify approach",
|
|
165
|
+
description: "Need changes to brainstorming",
|
|
166
|
+
},
|
|
167
|
+
{ label: "Explore more", description: "Need more research first" },
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
});
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Wait for user's answer before proceeding to spec creation.**
|
|
149
175
|
|
|
150
176
|
---
|
|
151
177
|
|
|
@@ -398,8 +424,17 @@ skill({ name: "using-git-worktrees" });
|
|
|
398
424
|
# Ensure .gitignore has worktree directory
|
|
399
425
|
grep -q "^\.worktrees/$" .gitignore || echo ".worktrees/" >> .gitignore
|
|
400
426
|
|
|
401
|
-
#
|
|
402
|
-
git
|
|
427
|
+
# Get current branch (parent branch)
|
|
428
|
+
PARENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
|
|
429
|
+
|
|
430
|
+
# Create readable branch name from feature name
|
|
431
|
+
FEATURE_SLUG=$(echo "[feature-name]" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | cut -c1-40)
|
|
432
|
+
|
|
433
|
+
# Create branch: <parent>/feat/<epic-id>-<description>
|
|
434
|
+
BRANCH_NAME="${PARENT_BRANCH}/feat/[epic-id]-${FEATURE_SLUG}"
|
|
435
|
+
|
|
436
|
+
# Create worktree for the epic with readable branch
|
|
437
|
+
git worktree add ".worktrees/[epic-id]" -b "$BRANCH_NAME"
|
|
403
438
|
|
|
404
439
|
# Setup in worktree
|
|
405
440
|
cd .worktrees/[epic-id]
|
|
@@ -418,7 +453,63 @@ npm test
|
|
|
418
453
|
|
|
419
454
|
---
|
|
420
455
|
|
|
421
|
-
## Phase 8:
|
|
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
|
|
422
513
|
|
|
423
514
|
```bash
|
|
424
515
|
bd sync
|