beeops 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.ja.md +156 -0
- package/README.md +80 -0
- package/bin/beeops.js +502 -0
- package/command/bo.md +120 -0
- package/contexts/agent-modes.json +100 -0
- package/contexts/code-reviewer.md +118 -0
- package/contexts/coder.md +247 -0
- package/contexts/default.md +1 -0
- package/contexts/en/agent-modes.json +100 -0
- package/contexts/en/code-reviewer.md +129 -0
- package/contexts/en/coder.md +247 -0
- package/contexts/en/default.md +1 -0
- package/contexts/en/fb.md +15 -0
- package/contexts/en/leader.md +158 -0
- package/contexts/en/log.md +16 -0
- package/contexts/en/queen.md +240 -0
- package/contexts/en/review-leader.md +190 -0
- package/contexts/en/reviewer-base.md +27 -0
- package/contexts/en/security-reviewer.md +200 -0
- package/contexts/en/test-auditor.md +146 -0
- package/contexts/en/tester.md +135 -0
- package/contexts/en/worker-base.md +69 -0
- package/contexts/fb.md +15 -0
- package/contexts/ja/agent-modes.json +100 -0
- package/contexts/ja/code-reviewer.md +129 -0
- package/contexts/ja/coder.md +247 -0
- package/contexts/ja/default.md +1 -0
- package/contexts/ja/fb.md +15 -0
- package/contexts/ja/leader.md +158 -0
- package/contexts/ja/log.md +17 -0
- package/contexts/ja/queen.md +240 -0
- package/contexts/ja/review-leader.md +190 -0
- package/contexts/ja/reviewer-base.md +27 -0
- package/contexts/ja/security-reviewer.md +200 -0
- package/contexts/ja/test-auditor.md +146 -0
- package/contexts/ja/tester.md +135 -0
- package/contexts/ja/worker-base.md +68 -0
- package/contexts/leader.md +158 -0
- package/contexts/log.md +16 -0
- package/contexts/queen.md +240 -0
- package/contexts/review-leader.md +190 -0
- package/contexts/reviewer-base.md +27 -0
- package/contexts/security-reviewer.md +200 -0
- package/contexts/test-auditor.md +146 -0
- package/contexts/tester.md +135 -0
- package/contexts/worker-base.md +69 -0
- package/hooks/checkpoint.py +89 -0
- package/hooks/prompt-context.py +139 -0
- package/hooks/resolve-log-path.py +93 -0
- package/hooks/run-log.py +429 -0
- package/package.json +42 -0
- package/scripts/launch-leader.sh +282 -0
- package/scripts/launch-worker.sh +184 -0
- package/skills/bo-dispatch/SKILL.md +299 -0
- package/skills/bo-issue-sync/SKILL.md +103 -0
- package/skills/bo-leader-dispatch/SKILL.md +211 -0
- package/skills/bo-log-writer/SKILL.md +101 -0
- package/skills/bo-review-backend/SKILL.md +234 -0
- package/skills/bo-review-database/SKILL.md +243 -0
- package/skills/bo-review-frontend/SKILL.md +236 -0
- package/skills/bo-review-operations/SKILL.md +268 -0
- package/skills/bo-review-process/SKILL.md +181 -0
- package/skills/bo-review-security/SKILL.md +214 -0
- package/skills/bo-review-security/references/finance-security.md +351 -0
- package/skills/bo-self-improver/SKILL.md +145 -0
- package/skills/bo-self-improver/refs/agent-manager.md +61 -0
- package/skills/bo-self-improver/refs/command-manager.md +46 -0
- package/skills/bo-self-improver/refs/skill-manager.md +59 -0
- package/skills/bo-self-improver/scripts/analyze.py +359 -0
- package/skills/bo-task-decomposer/SKILL.md +130 -0
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bo-dispatch
|
|
3
|
+
description: Launch Leader/Review Leader in tmux windows, wait for completion, read reports, and determine next action. Queen's dispatch skill for beeops.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# bo-dispatch: Leader launch + completion wait + report processing
|
|
7
|
+
|
|
8
|
+
Operational skill for the Queen to delegate issues to Leaders and Review Leaders.
|
|
9
|
+
Provides agent visualization via tmux windows, event-driven completion waiting, and next-action determination based on reports.
|
|
10
|
+
|
|
11
|
+
## Launching Leaders
|
|
12
|
+
|
|
13
|
+
### For issue tasks
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Implementation Leader
|
|
17
|
+
bash $BO_SCRIPTS_DIR/launch-leader.sh leader {issue_number} {branch}
|
|
18
|
+
|
|
19
|
+
# Review Leader
|
|
20
|
+
bash $BO_SCRIPTS_DIR/launch-leader.sh review-leader {issue_number} {branch}
|
|
21
|
+
|
|
22
|
+
# Fix mode (reuse existing worktree/branch)
|
|
23
|
+
bash $BO_SCRIPTS_DIR/launch-leader.sh leader {issue_number} {branch} fix
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`launch-leader.sh` automatically performs the following:
|
|
27
|
+
- Creates a **new tmux window** for each issue (`issue-{N}` or `review-{N}`)
|
|
28
|
+
- Leader: Launches `claude` with git worktree isolation and appropriate environment variables / tool restrictions
|
|
29
|
+
- Review Leader: Launches `claude` on the main repo (read-only)
|
|
30
|
+
- On completion, writes a report YAML and sends a `tmux wait-for -S queen-wake` signal
|
|
31
|
+
- Users can simply tmux attach to see the Queen and each issue's Leader/Worker in separate windows
|
|
32
|
+
|
|
33
|
+
## Completion Waiting (Event-Driven)
|
|
34
|
+
|
|
35
|
+
### Waiting for Leader completion
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Wait with 30-minute timeout
|
|
39
|
+
(sleep 1800 && tmux wait-for -S queen-wake) &
|
|
40
|
+
TIMER_PID=$!
|
|
41
|
+
tmux wait-for queen-wake
|
|
42
|
+
kill $TIMER_PID 2>/dev/null
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Waiting for Review Leader completion
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
# Wait with 20-minute timeout
|
|
49
|
+
(sleep 1200 && tmux wait-for -S queen-wake) &
|
|
50
|
+
TIMER_PID=$!
|
|
51
|
+
tmux wait-for queen-wake
|
|
52
|
+
kill $TIMER_PID 2>/dev/null
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Post-wake determination
|
|
56
|
+
|
|
57
|
+
Check `.claude/tasks/reports/`:
|
|
58
|
+
- **New report found** — Normal completion. Proceed to report processing.
|
|
59
|
+
- **No report (timeout)** — Check window state.
|
|
60
|
+
|
|
61
|
+
### State check on timeout
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
tmux list-panes -t bo:{window_name} -F '#{@agent_label} #{pane_current_command}' 2>/dev/null
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
| State | Meaning | Action |
|
|
68
|
+
|-------|---------|--------|
|
|
69
|
+
| `claude` is running | Work still in progress | Proceed to next wait-for |
|
|
70
|
+
| Returned to `zsh`/`bash` | Completed but signal failed | Check report manually |
|
|
71
|
+
| Window has disappeared | Abnormal termination | Update status to `error` |
|
|
72
|
+
|
|
73
|
+
## Report Processing
|
|
74
|
+
|
|
75
|
+
### Report files
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
.claude/tasks/reports/
|
|
79
|
+
├── leader-{N}.yaml # Basic report written by launch-leader.sh (guaranteed)
|
|
80
|
+
├── leader-{N}-summary.yaml # Detailed summary written by Leader (optional)
|
|
81
|
+
├── review-leader-{N}.yaml # Basic report written by launch-leader.sh (guaranteed)
|
|
82
|
+
├── review-leader-{N}-verdict.yaml # Verdict written by Review Leader (optional)
|
|
83
|
+
├── worker-{N}-{subtask_id}.yaml # Basic report written by launch-worker.sh (guaranteed)
|
|
84
|
+
├── worker-{N}-{subtask_id}-detail.yaml # Detail written by Worker (optional)
|
|
85
|
+
└── processed/ # Storage for processed reports
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Basic report format
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
issue: 42
|
|
92
|
+
role: leader # leader | review-leader
|
|
93
|
+
status: completed # completed | failed
|
|
94
|
+
exit_code: 0
|
|
95
|
+
branch: feat/issue-42
|
|
96
|
+
timestamp: "2026-03-02T12:00:00Z"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Leader summary format
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
issue: 42
|
|
103
|
+
role: leader
|
|
104
|
+
status: completed
|
|
105
|
+
branch: "feat/issue-42"
|
|
106
|
+
pr: "https://github.com/.../pull/42"
|
|
107
|
+
summary: "High-level overview of the implementation"
|
|
108
|
+
subtasks_completed: 3
|
|
109
|
+
subtasks_total: 3
|
|
110
|
+
concerns: null
|
|
111
|
+
key_changes:
|
|
112
|
+
- file: "file path"
|
|
113
|
+
what: "description of change"
|
|
114
|
+
design_decisions:
|
|
115
|
+
- decision: "what was chosen"
|
|
116
|
+
reason: "rationale"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Review Leader verdict format
|
|
120
|
+
|
|
121
|
+
```yaml
|
|
122
|
+
issue: 42
|
|
123
|
+
role: review-leader
|
|
124
|
+
complexity: standard
|
|
125
|
+
council_members: [worker-code-reviewer, worker-security]
|
|
126
|
+
final_verdict: approve # approve | fix_required
|
|
127
|
+
anti_sycophancy_triggered: false
|
|
128
|
+
merged_findings:
|
|
129
|
+
- source: worker-security
|
|
130
|
+
severity: high
|
|
131
|
+
file: src/api/route.ts
|
|
132
|
+
line: 23
|
|
133
|
+
message: "description of the finding"
|
|
134
|
+
fix_instructions: null
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Next-Action Determination Rules
|
|
138
|
+
|
|
139
|
+
### For Leader reports
|
|
140
|
+
|
|
141
|
+
| Report content | queue.yaml update | Next action |
|
|
142
|
+
|----------------|-------------------|-------------|
|
|
143
|
+
| `status: completed` + summary present | → `review_dispatched` | Launch Review Leader |
|
|
144
|
+
| `status: completed` + no summary | → `review_dispatched` | Launch Review Leader (acceptable without summary) |
|
|
145
|
+
| `status: failed` | → `error` | Move to next task |
|
|
146
|
+
|
|
147
|
+
### For Review Leader verdicts
|
|
148
|
+
|
|
149
|
+
| Verdict | queue.yaml update | Next action |
|
|
150
|
+
|---------|-------------------|-------------|
|
|
151
|
+
| `final_verdict: approve` | → `ci_checking` | Proceed to **CI check phase** |
|
|
152
|
+
| `final_verdict: fix_required` and review_count < 3 | → `fixing` | Restart Leader (fix mode) |
|
|
153
|
+
| `final_verdict: fix_required` and review_count >= 3 | → `stuck` | Skip (awaiting user intervention) |
|
|
154
|
+
|
|
155
|
+
### On Review Leader failure
|
|
156
|
+
|
|
157
|
+
| State | Response |
|
|
158
|
+
|-------|----------|
|
|
159
|
+
| `status: failed` + 1st occurrence | Retry once |
|
|
160
|
+
| `status: failed` + 2nd occurrence | → `error` |
|
|
161
|
+
|
|
162
|
+
## Restarting Leader in fix mode
|
|
163
|
+
|
|
164
|
+
When the Review Leader returns fix_required:
|
|
165
|
+
|
|
166
|
+
1. Write a fix prompt to: `.claude/tasks/prompts/fix-leader-{N}.md`
|
|
167
|
+
2. Include review findings and fix instructions in the fix prompt
|
|
168
|
+
3. Restart with `launch-leader.sh leader {N} {branch} fix` (reuses existing worktree)
|
|
169
|
+
|
|
170
|
+
Fix prompt content:
|
|
171
|
+
```markdown
|
|
172
|
+
You are a Leader agent. Fix the review findings for Issue #{N}.
|
|
173
|
+
|
|
174
|
+
## Review Findings
|
|
175
|
+
{contents of review-leader-{N}-verdict.yaml}
|
|
176
|
+
|
|
177
|
+
## Fix Instructions
|
|
178
|
+
{contents of fix_instructions}
|
|
179
|
+
|
|
180
|
+
## Procedure
|
|
181
|
+
1. Review the findings
|
|
182
|
+
2. Launch Workers to perform the fixes
|
|
183
|
+
3. After fixes are complete, write the summary
|
|
184
|
+
4. Signal queen-wake
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## CI Check Phase
|
|
188
|
+
|
|
189
|
+
After the Review Leader approves, verify that CI passes before marking as done.
|
|
190
|
+
|
|
191
|
+
### CI check procedure
|
|
192
|
+
|
|
193
|
+
1. **Check CI status**:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
gh pr checks {PR_number} 2>&1
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
2. **Determination**:
|
|
200
|
+
|
|
201
|
+
| CI result | queue.yaml update | Next action |
|
|
202
|
+
|-----------|-------------------|-------------|
|
|
203
|
+
| All checks pass | → `done` | Move to next task |
|
|
204
|
+
| Still running/pending | Wait 5 minutes and recheck (up to 3 times) | |
|
|
205
|
+
| Failure present | → `ci_fixing` | Restart Leader in fix mode |
|
|
206
|
+
|
|
207
|
+
3. **Launching CI fix** (on failure):
|
|
208
|
+
|
|
209
|
+
On CI failure, restart the Leader in fix mode. Include the CI failure log in the fix prompt:
|
|
210
|
+
|
|
211
|
+
```markdown
|
|
212
|
+
You are a Leader agent. Fix the CI failures on branch '{branch}'.
|
|
213
|
+
|
|
214
|
+
## CI Failure Details
|
|
215
|
+
{output of gh pr checks}
|
|
216
|
+
|
|
217
|
+
## Fix Instructions
|
|
218
|
+
Launch Workers to fix the CI errors.
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
4. **Recheck after CI fix**:
|
|
222
|
+
|
|
223
|
+
After Leader completion, check `gh pr checks` again.
|
|
224
|
+
- pass → `done`
|
|
225
|
+
- fail (ci_fix_count < 3) → Restart Leader in fix mode again
|
|
226
|
+
- fail (ci_fix_count >= 3) → `stuck`
|
|
227
|
+
|
|
228
|
+
### CI wait loop
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
MAX_WAIT=3
|
|
232
|
+
WAIT_COUNT=0
|
|
233
|
+
while [ $WAIT_COUNT -lt $MAX_WAIT ]; do
|
|
234
|
+
sleep 300 # Wait 5 minutes
|
|
235
|
+
CI_STATUS=$(gh pr checks {PR_number} 2>&1)
|
|
236
|
+
if echo "$CI_STATUS" | grep -q "fail"; then
|
|
237
|
+
break # CI failure → proceed to fix phase
|
|
238
|
+
elif echo "$CI_STATUS" | grep -qE "pass|✓" && ! echo "$CI_STATUS" | grep -qE "pending|running|skipping"; then
|
|
239
|
+
break # All checks pass → proceed to done
|
|
240
|
+
fi
|
|
241
|
+
WAIT_COUNT=$((WAIT_COUNT + 1))
|
|
242
|
+
done
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### After report processing
|
|
246
|
+
|
|
247
|
+
Move processed reports to `processed/` to prevent reprocessing:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
mv .claude/tasks/reports/leader-{N}.yaml .claude/tasks/reports/processed/
|
|
251
|
+
mv .claude/tasks/reports/leader-{N}-summary.yaml .claude/tasks/reports/processed/ 2>/dev/null
|
|
252
|
+
mv .claude/tasks/reports/review-leader-{N}*.yaml .claude/tasks/reports/processed/ 2>/dev/null
|
|
253
|
+
mv .claude/tasks/reports/worker-{N}-*.yaml .claude/tasks/reports/processed/ 2>/dev/null
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## Cleanup
|
|
257
|
+
|
|
258
|
+
Resources have different lifecycles. Clean up each at the right time.
|
|
259
|
+
|
|
260
|
+
### tmux windows — on task completion
|
|
261
|
+
|
|
262
|
+
After task reaches done, stuck, or error, kill the tmux windows:
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
tmux kill-window -t bo:issue-{N} 2>/dev/null || true
|
|
266
|
+
tmux kill-window -t bo:review-{N} 2>/dev/null || true
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Worktrees and branches — after PR merge
|
|
270
|
+
|
|
271
|
+
Worktrees and branches **must be kept alive** until the PR is merged. The Leader's job ends at PR creation; the branch is still needed for review cycles and CI.
|
|
272
|
+
|
|
273
|
+
Clean up only after confirming the PR is merged:
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
# Check if PR is merged
|
|
277
|
+
PR_STATE=$(gh pr view {PR_number} --json state -q '.state' 2>/dev/null)
|
|
278
|
+
if [ "$PR_STATE" = "MERGED" ]; then
|
|
279
|
+
REPO_DIR=$(git rev-parse --show-toplevel)
|
|
280
|
+
WORKTREE_PATH="$REPO_DIR/.claude/worktrees/{branch}"
|
|
281
|
+
|
|
282
|
+
# 1. Remove worktree
|
|
283
|
+
git -C "$REPO_DIR" worktree remove --force "$WORKTREE_PATH" 2>/dev/null || true
|
|
284
|
+
|
|
285
|
+
# 2. Delete branch
|
|
286
|
+
git branch -D {branch} 2>/dev/null || true
|
|
287
|
+
|
|
288
|
+
# 3. Prune stale references
|
|
289
|
+
git worktree prune
|
|
290
|
+
fi
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Session-end cleanup
|
|
294
|
+
|
|
295
|
+
When the Queen session ends (`tmux kill-session -t bo`), prune any stale worktree references:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
git worktree prune
|
|
299
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bo-issue-sync
|
|
3
|
+
description: Sync GitHub Issues to queue.yaml. Detects new issues, analyzes dependencies, assigns priorities, and performs diff-merge.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# bo-issue-sync: Issue → queue.yaml Sync
|
|
7
|
+
|
|
8
|
+
Fetches open Issues from GitHub and syncs them to `.claude/tasks/queue.yaml`.
|
|
9
|
+
Handles adding new Issues, marking closed Issues as done, dependency analysis, and priority assignment in one operation.
|
|
10
|
+
|
|
11
|
+
## Procedure
|
|
12
|
+
|
|
13
|
+
### 1. Determine Repository
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
REPO=$(git remote get-url origin | sed -E 's#.*[:/]([^/]+/[^/.]+)(\.git)?$#\1#')
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Use `-R $REPO` for all subsequent `gh` commands.
|
|
20
|
+
|
|
21
|
+
### 2. Fetch Open Issues
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
gh issue list -R "$REPO" --state open --json number,title,labels,assignees --limit 100
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If 0 issues, display "No issues to process" and exit.
|
|
28
|
+
|
|
29
|
+
### 3. Load queue.yaml
|
|
30
|
+
|
|
31
|
+
If `.claude/tasks/queue.yaml` exists, read it. Otherwise initialize:
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
version: 1
|
|
35
|
+
tasks: []
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 4. Diff Detection and Raw Addition
|
|
39
|
+
|
|
40
|
+
Add Issues not present in queue.yaml with `raw` status:
|
|
41
|
+
|
|
42
|
+
```yaml
|
|
43
|
+
- id: "ISSUE-{number}"
|
|
44
|
+
issue: {number}
|
|
45
|
+
title: "{title}"
|
|
46
|
+
status: raw
|
|
47
|
+
priority: null
|
|
48
|
+
branch: null
|
|
49
|
+
depends_on: []
|
|
50
|
+
review_count: 0
|
|
51
|
+
pr: null
|
|
52
|
+
log:
|
|
53
|
+
- "{ISO8601} created from gh issue"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- Skip Issues already in queue.yaml (with status other than done)
|
|
57
|
+
- Update status to `done` for Issues in queue.yaml that are closed on GitHub
|
|
58
|
+
|
|
59
|
+
### 5. Dependency Analysis
|
|
60
|
+
|
|
61
|
+
For each `raw` Issue:
|
|
62
|
+
|
|
63
|
+
1. Fetch details: `gh issue view {N} -R "$REPO" --json body,labels`
|
|
64
|
+
2. Determine dependencies:
|
|
65
|
+
- Issue body mentions "depends on #XX", "blocked by #XX", "after #XX", etc.
|
|
66
|
+
- Labels include `blocked`, `pending`, etc.
|
|
67
|
+
- Likely modifies the same files as other implementing/queued tasks (inferred from body)
|
|
68
|
+
3. Add task IDs to `depends_on` if dependencies exist
|
|
69
|
+
4. For issues with `pending` label, extract `blocked_reason` from the issue body
|
|
70
|
+
|
|
71
|
+
### 6. Priority Assignment and Queued Status
|
|
72
|
+
|
|
73
|
+
Set priority for each `raw` task and update to `queued`:
|
|
74
|
+
|
|
75
|
+
| Condition | Priority |
|
|
76
|
+
|-----------|----------|
|
|
77
|
+
| Labels include `priority: high`, `urgent`, `bug` | high |
|
|
78
|
+
| Normal feature additions/improvements, `priority: medium` | medium |
|
|
79
|
+
| Labels include `priority: low`, `tech-debt` | low |
|
|
80
|
+
|
|
81
|
+
**Branch name generation**: Derive from Issue title with `feat/`, `fix/`, `chore/` prefix + kebab-case
|
|
82
|
+
|
|
83
|
+
### 7. Write queue.yaml
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
mkdir -p .claude/tasks
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Write `.claude/tasks/queue.yaml` using the Write tool.
|
|
90
|
+
|
|
91
|
+
### 8. Display Status
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
=== Queue Status ===
|
|
95
|
+
Repository: {REPO}
|
|
96
|
+
Total: {N} tasks
|
|
97
|
+
|
|
98
|
+
[HIGH] Ready to start:
|
|
99
|
+
ISSUE-42 Add user authentication queued branch: feat/add-user-auth
|
|
100
|
+
|
|
101
|
+
[BLOCKED] External blockers:
|
|
102
|
+
ISSUE-55 Database migration v2 queued → Waiting for staging deploy
|
|
103
|
+
```
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bo-leader-dispatch
|
|
3
|
+
description: Launch Workers in tmux panes, wait for completion, and evaluate quality. Shared dispatch skill for Leader and Review Leader.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# bo-leader-dispatch: Worker launch + completion wait + quality evaluation
|
|
7
|
+
|
|
8
|
+
Operational skill for Leaders and Review Leaders to delegate subtasks to Workers.
|
|
9
|
+
Provides Worker visualization via tmux split-pane, event-driven completion waiting, and retry determination based on quality evaluation.
|
|
10
|
+
|
|
11
|
+
## Prerequisite: Prepare the prompt file
|
|
12
|
+
|
|
13
|
+
Before launching a Worker, the Leader/Review Leader must write out a prompt file.
|
|
14
|
+
|
|
15
|
+
Path: `.claude/tasks/prompts/worker-{issue}-{subtask_id}.md`
|
|
16
|
+
|
|
17
|
+
If the prompt file does not exist, `launch-worker.sh` will exit with an error.
|
|
18
|
+
|
|
19
|
+
## Launching Workers
|
|
20
|
+
|
|
21
|
+
### Basic syntax
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh {role} {issue} {subtask_id} {branch}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Available roles
|
|
28
|
+
|
|
29
|
+
| Role | Purpose | Launched by |
|
|
30
|
+
|------|---------|-------------|
|
|
31
|
+
| worker-coder | Code implementation | Leader |
|
|
32
|
+
| worker-tester | Test creation | Leader |
|
|
33
|
+
| worker-code-reviewer | Code review | Review Leader |
|
|
34
|
+
| worker-security | Security review | Review Leader |
|
|
35
|
+
| worker-test-auditor | Test audit | Review Leader |
|
|
36
|
+
|
|
37
|
+
### Launch examples
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Launch 2 implementation Workers in parallel
|
|
41
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-coder 42 impl-1 feat/issue-42
|
|
42
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-coder 42 impl-2 feat/issue-42
|
|
43
|
+
|
|
44
|
+
# Test Worker
|
|
45
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-tester 42 test-1 feat/issue-42
|
|
46
|
+
|
|
47
|
+
# Launch Review Workers in parallel
|
|
48
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-code-reviewer 42 review-code feat/issue-42
|
|
49
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-security 42 review-sec feat/issue-42
|
|
50
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-test-auditor 42 review-test feat/issue-42
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`launch-worker.sh` automatically performs the following:
|
|
54
|
+
- **Splits a pane** within the Leader's window (`tmux split-window -h`)
|
|
55
|
+
- Evenly arranges all panes with `tmux select-layout tiled`
|
|
56
|
+
- Launches `claude --dangerously-skip-permissions --no-session-persistence` with appropriate environment variables and tool restrictions
|
|
57
|
+
- Workers share the Leader's worktree (no new worktree is created)
|
|
58
|
+
- On completion, writes a report YAML and sends a `tmux wait-for -S leader-{issue}-wake` signal
|
|
59
|
+
|
|
60
|
+
## Completion Waiting (Event-Driven)
|
|
61
|
+
|
|
62
|
+
### Blocking wait (until all Workers complete)
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
EXPECTED=2 # Set to 1, 2, or 3 based on the number of launched Workers
|
|
66
|
+
RECEIVED=0
|
|
67
|
+
while [ $RECEIVED -lt $EXPECTED ]; do
|
|
68
|
+
(sleep 600 && tmux wait-for -S leader-{issue}-wake) &
|
|
69
|
+
TIMER_PID=$!
|
|
70
|
+
tmux wait-for leader-{issue}-wake
|
|
71
|
+
kill $TIMER_PID 2>/dev/null
|
|
72
|
+
RECEIVED=$((RECEIVED + 1))
|
|
73
|
+
done
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- All Workers use the same `leader-{issue}-wake` signal, so a counter detects when all have completed
|
|
77
|
+
- The counter increments by 1 each time a Worker completes
|
|
78
|
+
- The 10-minute timeout applies per Worker (not for the entire group)
|
|
79
|
+
|
|
80
|
+
### Post-wake determination
|
|
81
|
+
|
|
82
|
+
Check `.claude/tasks/reports/`:
|
|
83
|
+
- **New report found** — Normal completion. Proceed to quality evaluation.
|
|
84
|
+
- **No report (timeout)** — Check pane state.
|
|
85
|
+
|
|
86
|
+
### State check on timeout
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
tmux list-panes -t bo:{window_name} -F '#{@agent_label} #{pane_current_command}' 2>/dev/null
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
| State | Meaning | Action |
|
|
93
|
+
|-------|---------|--------|
|
|
94
|
+
| `claude` is running | Work still in progress | Proceed to next wait-for |
|
|
95
|
+
| Returned to `zsh`/`bash` | Completed but signal failed | Check report manually |
|
|
96
|
+
| Pane has disappeared | Abnormal termination | Record in concerns |
|
|
97
|
+
|
|
98
|
+
## Report Files
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
.claude/tasks/reports/
|
|
102
|
+
├── worker-{N}-{subtask_id}.yaml # Basic report written by launch-worker.sh (guaranteed)
|
|
103
|
+
└── worker-{N}-{subtask_id}-detail.yaml # Detail written by Worker (optional)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Basic report format
|
|
107
|
+
|
|
108
|
+
```yaml
|
|
109
|
+
issue: 42
|
|
110
|
+
subtask_id: impl-1
|
|
111
|
+
role: worker-coder
|
|
112
|
+
status: completed # completed | failed
|
|
113
|
+
exit_code: 0
|
|
114
|
+
branch: feat/issue-42
|
|
115
|
+
timestamp: "2026-03-02T12:00:00Z"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Quality Evaluation Rules
|
|
119
|
+
|
|
120
|
+
Read Worker reports and evaluate quality:
|
|
121
|
+
|
|
122
|
+
### Evaluation flow
|
|
123
|
+
|
|
124
|
+
1. Read the basic report (`worker-{N}-{subtask_id}.yaml`)
|
|
125
|
+
2. Read the detail report (`worker-{N}-{subtask_id}-detail.yaml`) if it exists
|
|
126
|
+
3. Determine based on the following rules:
|
|
127
|
+
|
|
128
|
+
| Condition | Verdict | Action |
|
|
129
|
+
|-----------|---------|--------|
|
|
130
|
+
| `exit_code != 0` | NG | Restart (up to 2 times) |
|
|
131
|
+
| No detail report + exit_code == 0 | Warning | Record in concerns, continue |
|
|
132
|
+
| Detail report does not cover required content | NG | Restart (up to 2 times) |
|
|
133
|
+
| Still failing after 2 restarts | Give up | Record in concerns and continue |
|
|
134
|
+
| `exit_code == 0` and content is sufficient | OK | Proceed to next subtask |
|
|
135
|
+
|
|
136
|
+
### Restart procedure
|
|
137
|
+
|
|
138
|
+
1. Modify the original prompt file (append previous failure information)
|
|
139
|
+
2. Relaunch with the same `launch-worker.sh` command
|
|
140
|
+
3. Wait again
|
|
141
|
+
|
|
142
|
+
```markdown
|
|
143
|
+
# Append previous execution results
|
|
144
|
+
## Previous Failure
|
|
145
|
+
- exit_code: {code}
|
|
146
|
+
- Problem: {description of the problem}
|
|
147
|
+
|
|
148
|
+
## Fix Instructions
|
|
149
|
+
{what needs to be fixed}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Subtask Group Execution Patterns
|
|
153
|
+
|
|
154
|
+
### Parallel execution (independent subtasks)
|
|
155
|
+
|
|
156
|
+
Launch subtasks that do not depend on each other simultaneously:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
# Write prompt files first
|
|
160
|
+
# Write worker-42-impl-api.md
|
|
161
|
+
# Write worker-42-impl-ui.md
|
|
162
|
+
|
|
163
|
+
# Launch in parallel
|
|
164
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-coder 42 impl-api feat/issue-42
|
|
165
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-coder 42 impl-ui feat/issue-42
|
|
166
|
+
|
|
167
|
+
# Wait for 2 Workers
|
|
168
|
+
EXPECTED=2
|
|
169
|
+
RECEIVED=0
|
|
170
|
+
while [ $RECEIVED -lt $EXPECTED ]; do
|
|
171
|
+
(sleep 600 && tmux wait-for -S leader-42-wake) &
|
|
172
|
+
TIMER_PID=$!
|
|
173
|
+
tmux wait-for leader-42-wake
|
|
174
|
+
kill $TIMER_PID 2>/dev/null
|
|
175
|
+
RECEIVED=$((RECEIVED + 1))
|
|
176
|
+
done
|
|
177
|
+
|
|
178
|
+
# Read both reports and evaluate quality
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Sequential execution (dependent subtasks)
|
|
182
|
+
|
|
183
|
+
When a subtask depends on the output of a previous one:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Phase 1: Implementation
|
|
187
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-coder 42 impl-1 feat/issue-42
|
|
188
|
+
# Wait + quality evaluation
|
|
189
|
+
|
|
190
|
+
# Phase 2: Tests (after implementation)
|
|
191
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-tester 42 test-1 feat/issue-42
|
|
192
|
+
# Wait + quality evaluation
|
|
193
|
+
|
|
194
|
+
# Phase 3: PR creation (after all complete)
|
|
195
|
+
bash $BO_SCRIPTS_DIR/launch-worker.sh worker-coder 42 pr feat/issue-42
|
|
196
|
+
# Wait + quality evaluation
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Mixed pattern
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
Phase 1: [worker-coder:impl-api, worker-coder:impl-ui] ← parallel
|
|
203
|
+
Phase 2: [worker-tester:test-1] ← sequential
|
|
204
|
+
Phase 3: [worker-coder:pr] ← sequential
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Important Notes
|
|
208
|
+
|
|
209
|
+
- Workers share the Leader's worktree, so do not launch Workers in parallel if they edit the same files
|
|
210
|
+
- Review Workers are read-only and safe to launch in parallel
|
|
211
|
+
- subtask_id can be any string, but must be unique within the same issue (no duplicates allowed)
|