Skip to main content
ClaudeWave
Skill324 estrellas del repoactualizado yesterday

work

The `/work` skill orchestrates execution of an approved wish by dispatching implementation tasks to subagents in sequence, managing each task group through refinement, worker dispatch, local and quality reviews with fix loops, validation, and progress tracking. Use this skill after a wish receives SHIP approval and requires coordinated multi-step execution across task groups with oversight and validation gates.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/automagik-dev/genie /tmp/work && cp -r /tmp/work/skills/work ~/.claude/skills/work
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

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.md` in 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
1. **Load wish:** read `.genie/wishes/<slug>/WISH.md` from the shared worktree, confirm scope.
2. **Pick next task:** select next unblocked pending execution group (or use injected group context).
3. **Task checkout (v4):** if a PG task exists for this group, claim it before starting:
   ```bash
   genie task checkout #<seq>
   ```
4. **Self-refine:** dispatch `/refine` on 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).
5. **Dispatch worker:** send the task to a fresh subagent session (see Dispatch).
6. **Progress update (v4):** log progress as task comments during execution:
   ```bash
   genie task comment #<seq> "Building group N..."
   ```
7. **Local review:** run `/review` against the wish spec for this group's acceptance criteria before signaling done. On FIX-FIRST, dispatch fix subagent (max 2 loops).
8. **Quality review:** dispatch review subagent for quality pass (security, maintainability, perf). On FIX-FIRST, dispatch fix subagent (max 1 loop).
9. **Validate:** run the group validation command, record evidence.
10. **Group done (v4):** move the task to review stage:
    ```bash
    genie task move #<seq> --to review --comment "Group N complete"
    ```
11. **Signal completion:** notify the leader via `genie agent send 'Group N complete — all criteria met' --to <leader>`.
12. **Repeat** steps 2-11 until all groups done.
13. **Wish done (v4):** mark the parent task done:
    ```bash
    genie task done #<parent-seq> --comment "All groups shipped"
    ```
14. **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 `/review` returns SHIP on the plan

## Dispatch

All dispatch uses the `genie agent spawn` command. The orchestrator spawns subagents for each role — never executes work directly.

```bash
# 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:**

1. **Group goal** — one sentence describing what this group achieves
2. **Group deliverables** — the numbered list of concrete outputs
3. **Acceptance criteria** — the checkbox list the engineer must satisfy
4. **Validation command** — the exact command to run to verify the work (e.g., `bun run check`)
5. **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 send` to the leader when a group is done.
- **Leader tracks** wish-group state via `genie wish status <slug>` and marks groups complete via `genie wish done <slug>#<group>` (and, when PG tasks exist, `genie task done #<seq>`).
- 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 wish 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 #<