Agent skill
work
Execute an approved wish plan — orchestrate subagents per task group with fix loops, validation, and review handoff.
Install this agent skill to your Project
npx add-skill https://github.com/automagik-dev/genie/tree/main/skills/work
SKILL.md
/work — Execute Wish Plan
The engineer's skill, invoked via genie work <agent> <ref> dispatch. Orchestrate execution of an approved wish from .genie/wishes/<slug>/WISH.md. The orchestrator never executes directly — always dispatch via subagent.
Context Injection
This skill receives its execution context from the dispatch layer:
- Wish path —
.genie/wishes/<slug>/WISH.mdin the shared worktree - Group context — which execution group(s) to work on
- Injected section — the specific group definition extracted from the wish
If context is injected, use it directly. Do not re-parse the wish for information already provided.
Flow
- Load wish: read
.genie/wishes/<slug>/WISH.mdfrom the shared worktree, confirm scope. - Pick next task: select next unblocked pending execution group (or use injected group context).
- Task checkout (v4): if a PG task exists for this group, claim it before starting:
bash
genie task checkout #<seq> - Self-refine: dispatch
/refineon the task prompt (text mode) with WISH.md as context anchor. Read output from/tmp/prompts/<slug>.md. Fallback: proceed with original prompt if refiner fails (non-blocking). - Dispatch worker: send the task to a fresh subagent session (see Dispatch).
- Progress update (v4): log progress as task comments during execution:
bash
genie task comment #<seq> "Building group N..." - Local review: run
/reviewagainst the wish spec for this group's acceptance criteria before signaling done. On FIX-FIRST, dispatch fix subagent (max 2 loops). - Quality review: dispatch review subagent for quality pass (security, maintainability, perf). On FIX-FIRST, dispatch fix subagent (max 1 loop).
- Validate: run the group validation command, record evidence.
- Group done (v4): move the task to review stage:
bash
genie task move #<seq> --to review --comment "Group N complete" - Signal completion: notify the leader via
genie agent send 'Group N complete — all criteria met' --to <leader>. - Repeat steps 2-11 until all groups done.
- Wish done (v4): mark the parent task done:
bash
genie task done #<parent-seq> --comment "All groups shipped" - Handoff:
All work tasks complete. Run /review.
When to Use
- An approved wish exists and is ready for execution
- Orchestrator needs to dispatch implementation tasks to subagents
- After
/reviewreturns SHIP on the plan
Dispatch
All dispatch uses the genie agent spawn command. The orchestrator spawns subagents for each role — never executes work directly.
# Spawn an engineer for the task
genie agent spawn engineer
# Spawn a reviewer (always separate from engineer)
genie agent spawn reviewer
# Spawn a fixer for FIX-FIRST gaps
genie agent spawn fixer
| Need | Method |
|---|---|
| Implementation task | genie agent spawn engineer |
| Review task | genie agent spawn reviewer (never same agent as engineer) |
| Fix task | genie agent spawn fixer (separate from reviewer) |
| Quick validation | Bash tool directly — no subagent needed |
Coordinate via genie agent send '<message>' --to <agent>. Use genie agent send '<message>' --broadcast for team-wide updates.
Context Curation
When dispatching an engineer for a group, the team-lead MUST extract the relevant context from WISH.md and paste it directly into the dispatch prompt. Do NOT tell the engineer to "read WISH.md" — curate the context for them.
Why: Reading WISH.md wastes engineer context window on metadata, other groups, and scope sections irrelevant to their task. Curated context = better focus, fewer hallucinations about scope, and faster execution.
What to extract and paste into the dispatch prompt:
- Group goal — one sentence describing what this group achieves
- Group deliverables — the numbered list of concrete outputs
- Acceptance criteria — the checkbox list the engineer must satisfy
- Validation command — the exact command to run to verify the work (e.g.,
bun run check) - Depends-on — any groups that must complete first (for context on what the engineer can assume exists)
Example dispatch prompt structure:
Execute Group N of wish "<slug>".
Goal: <one sentence>
Deliverables:
1. <deliverable 1>
2. <deliverable 2>
Acceptance Criteria:
- [ ] <criterion 1>
- [ ] <criterion 2>
Validation: <command>
Depends-on: <group refs or "none">
Anti-pattern: "Implement Group 2. Read WISH.md for details." — this forces the engineer to parse an entire wish document, navigate to the right section, and risk being distracted by other groups' scope. The team-lead has already read the wish; don't make the engineer re-read it.
State Management
- Workers signal completion via
genie agent sendto the leader when a group is done. - Leader tracks state via
genie task status <slug>and marks groups complete viagenie task done <ref>. - Workers do NOT call
genie task done— that is the leader's responsibility after verifying the work. - 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 (v4)
When PG tasks exist for the wish, use genie task commands to track execution:
| Event | Command |
|---|---|
| Start working on group | genie task checkout #<seq> |
| Progress update | genie task comment #<seq> "<status>" |
| Group complete | genie task move #<seq> --to review --comment "Group N complete" |
| All groups done | genie task done #<parent-seq> --comment "All groups shipped" |
| Group blocked | genie task block #<seq> --reason "<reason>" |
Graceful degradation: If no PG task exists for the wish (e.g., PG unavailable or wish was created before v4), skip all genie task commands and fall back to current behavior. Task integration is optional — the core flow must never break due to missing tasks.
Example: Full Dispatch Cycle
Wish fix-dispatch-initial-prompt has 1 execution group. The orchestrator runs /work:
# 1. Dispatch wave (spawns engineers automatically)
genie work fix-dispatch-initial-prompt
# Output: 🚀 Dispatching Wave 1 — 1 group(s)
# ✅ Group "1" set to in_progress
# 🔧 Dispatching work to engineer for "fix-dispatch-initial-prompt#1"
# 2. Monitor (ALWAYS sleep 60 between checks)
sleep 60 && genie task status fix-dispatch-initial-prompt
# Output: Group 1: 🔄 in_progress
# 3. Check again
sleep 60 && genie task status fix-dispatch-initial-prompt
# Output: Group 1: ✅ done — Progress: 1/1 done
# 4. All groups done → local review
genie agent spawn reviewer
genie agent send 'Review wish fix-dispatch-initial-prompt. Run bun test and check all 5 call sites.' --to reviewer
# Reviewer returns: SHIP
# 5. Create PR
git add -A && git commit -m "fix: pass initialPrompt to handleWorkerSpawn in all dispatch commands"
git push origin HEAD
gh pr create --base dev --title "fix: pass initialPrompt to dispatch" --body "Fixes #745. Wish: fix-dispatch-initial-prompt"
For multi-wave wishes, call genie work <slug> again after each wave completes — it dispatches the next wave automatically.
Rules
- Never execute directly — always dispatch subagents.
- Never expand scope during execution.
- Never skip validation commands.
- Never overwrite WISH.md from workers — refined prompts are runtime context only.
- Keep work auditable: capture commands + outcomes.
- Run local
/reviewper group before signaling done — never skip the review gate.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
genie
Single entry point for all genie operations — auto-routes natural language to the right skill, detects existing lifecycle state, and handles operational commands. Use when planning features, reporting bugs, managing teams, or asking about the system.
refine
Transform a brief or prompt into a structured, production-ready prompt via prompt-optimizer. File or text mode.
review
Validate plans, execution, or PRs against wish criteria — returns SHIP / FIX-FIRST / BLOCKED with severity-tagged gaps.
wish
Convert an idea into a structured wish plan with scope, acceptance criteria, and execution groups for /work.
learn
Diagnose and fix agent behavioral surfaces when the user corrects a mistake — connects to Claude native memory.
dream
Batch-execute SHIP-ready wishes overnight — pick wishes, orchestrate workers, review PRs, wake up to results.
Didn't find tool you were looking for?