/work — Execute Wish Plan
Orchestrate execution of an approved wish. The orchestrator never executes directly — always dispatches via subagent.When to Use
- An approved wish exists and is ready for execution
- After
/reviewreturns SHIP on the plan - Orchestrator needs to dispatch implementation tasks to subagents
Flow
- Load wish — read
.genie/wishes/<slug>/WISH.md, confirm scope. - Pick next task — select next unblocked pending execution group.
- Self-refine — dispatch
/refineon the task prompt with WISH.md as context. - Dispatch worker — send the task to a fresh subagent session.
- Local review — run
/reviewper group against acceptance criteria. On FIX-FIRST, dispatch fix subagent (max 2 loops). - Quality review — dispatch review subagent for quality pass (security, maintainability, perf).
- Validate — run the group validation command, record evidence.
- Signal completion — notify the leader via
genie send. - Repeat until all groups done.
- Handoff —
All work tasks complete. Run /review.
Dispatch
All dispatch uses thegenie spawn command:
| Need | Method |
|---|---|
| Implementation task | genie spawn engineer |
| Review task | genie spawn reviewer (never same agent as engineer) |
| Fix task | genie spawn fixer (separate from reviewer) |
| Quick validation | Bash tool directly — no subagent needed |
State Management
- Workers signal completion via
genie sendto the leader. - Leader tracks state via
genie status <slug>and marks groups complete viagenie done <ref>. - Workers do NOT call
genie done— that is the leader’s responsibility. - If a group gets stuck, the leader can use
genie reset <ref>to retry.
Escalation
When a subagent fails or fix loop limit (2) is exceeded:- Mark task BLOCKED in wish
- Create follow-up task with concrete gaps
- Continue with next unblocked task
- Include blocked items in final handoff
Task Lifecycle Integration
When PostgreSQL tasks exist,/work integrates with the task system at each step:
| Event | Command |
|---|---|
| Claim task before starting | genie task checkout #<seq> |
| Log progress during execution | genie task comment #<seq> "Building group N..." |
| Move task on group completion | genie task move #<seq> --to review --comment "Group N complete" |
| Mark parent task done | genie task done #<parent-seq> --comment "All groups shipped" |
Rules
- Never execute directly — always dispatch subagents
- Never expand scope during execution
- Never skip validation commands
- Never overwrite WISH.md from workers
- Keep work auditable: capture commands + outcomes
- Run local
/reviewper group before signaling done