一键导入
dispatching-parallel-agents
Use when facing 2 or more independent tasks that can be worked on without shared state or sequential dependencies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when facing 2 or more independent tasks that can be worked on without shared state or sequential dependencies
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Use when reviewing a spec or task graph for completeness before implementation
Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, logging in, or automating browser actions
Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, logging in, or automating browser actions
Use when decomposing a spec, design, or feature description into a task dependency graph with self-evaluating acceptance criteria
Use when doing creative product, feature, component, functionality, or behavior design work
Use when infrastructure or features are built but before declaring done -- verifies work is wired into the system and actively used
基于 SOC 职业分类
| name | dispatching-parallel-agents |
| description | Use when facing 2 or more independent tasks that can be worked on without shared state or sequential dependencies |
Run a pipeline of N workers against a prioritized task queue. Each worker executes one task end-to-end via oro work. As workers complete, merge results and immediately launch the next task.
Core principle: Keep N worker slots saturated. Merge as you go. Never wait for all workers to finish before starting more.
Don't use when:
Before dispatching, clean house:
git worktree list # check for orphaned worktrees from previous sessions
oro task ready # get prioritized queue
oro task list --status=in_progress # check for stale claims
Remove stale worktrees from previous sessions. Reset stale in_progress tasks if the worker is gone.
Process the queue in this order:
Within each tier: higher priority (P0 > P1 > P2) first.
oro task dep addFill empty slots up to N concurrency:
Primary — oro work (handles worktree, TDD, QG, ops review, merge):
oro work <task-id> & # background, or use Task tool with run_in_background
Fallback — Task agent (when work is not a task, or oro unavailable):
You are working in an isolated git worktree at: /absolute/path/.worktrees/<id>
Branch: agent/<id>
FIRST: oro task update <id> --status=in_progress
## Task
[task description]
## Rules
- ONLY modify files within /absolute/path/.worktrees/<id>
- Run tests: go test -C /absolute/path/.worktrees/<id> ./pkg/... -race -count=1
- Commit your work with a descriptive message before completing
- Do NOT push, merge, or rebase
- Close task: oro task close <id> --reason="summary"
IMPORTANT: Tell agents to use go -C <worktree> or absolute paths, never cd <worktree>. The cd persists in the Bash tool cwd — if the worktree is later removed, ALL subsequent bash commands fail silently.
run_in_background: truetasks for persistent tracking.oro task close <id> — the task IS the outputRebase + fast-forward merge. Always. This gives clean linear history without duplicate commits.
git stash # save dirty tasks file
git worktree remove --force .worktrees/<id> # remove worktree, keep branch
git rebase main <branch> # rebase onto current main
git checkout main # switch back to main
git merge --ff-only <branch> # fast-forward (no merge commit)
git branch -D <branch> # delete merged branch
git stash pop # restore tasks state
Why not cherry-pick? Cherry-pick duplicates commit hashes, polluting git log and breaking git bisect. Rebase preserves authorship and produces identical diffs with clean history.
Worktree removal unblocks rebase. The rebase guard hook only fires when worktrees are active. Remove the worktree first (step 2), then rebase freely — even while other worktrees exist for different agents.
CRITICAL: Do not backfill or use any tools between removing a worktree and completing the merge. Removing a worktree can corrupt the hook resolver's CWD — all tools break until the merge sequence finishes. Complete the full 7-step sequence atomically.
Launch the next task from the queue into the freed slot. Repeat until queue is empty.
Check dependency chains: if task X was blocking task Y (same file), Y is now unblocked.
When all workers are done and merged:
go test ./... # full test suite on main
git push # push when green
Agents frequently make these errors — check before merging:
| Problem | Detection | Fix |
|---|---|---|
| Didn't commit | git -C .worktrees/X log shows same commit as main | Stage + commit from manager |
| Syntax errors | go -C .worktrees/X build ./... fails | Read the file, fix, recommit |
| Wrong package name | Linter rejects | Fix the package declaration, recommit |
Always verify agent commits compile before merging: go -C .worktrees/X build ./...
When git rebase main agent/X produces conflicts:
| Situation | Action |
|---|---|
| Worker completes, merge succeeds | Pull. Launch next. |
| Worker completes, merge conflicts | Resolve during rebase, build + test, continue. |
| Worker fails (test failure) | Inspect worktree. Fix + recommit, or re-dispatch. |
| Worker killed (signal:killed) | Resource contention. Reduce concurrency. Re-dispatch. |
| Worker stuck (no progress) | Check output file tail. Kill and re-dispatch if needed. |
| Task too large (worker decomposes) | Worker promotes to epic. Pick up children in next cycle. |
Do NOT blindly retry failed workers. Inspect first.
Use raw Task agents instead of oro work when:
oro binary is unavailable or brokenoro work's lifecycleTask agent prompt template must include:
oro task update <id> --status=in_progress at startoro task close <id> at end| Mistake | Fix |
|---|---|
| Batch dispatch (wait for all, then merge all) | Pipeline: merge each as it finishes, backfill |
Not claiming tasks (in_progress) | Worker prompt must include oro task update at start |
| Dispatching overlapping file scopes | Same file = sequential deps via oro task dep add |
| Using TaskOutput to read transcripts | Trust notifications. Read task, not transcript. |
| Using tools between worktree remove and merge complete | Complete the 7-step merge atomically |
| Polling agents with sleep loops | Trust task notifications |
| Forgetting stale worktree cleanup | Preflight: git worktree list |
Using cd into worktrees | Shell cwd persists — use absolute paths |