workmachinelisted
Install: claude install-skill av/skills
# Workmachine — An Explicit State Machine, Executed by Subagents
```
state, effects = init(machine)
execute(effects)
while state is active:
event = nextEvent()
state, effects = transition(machine, state, event)
execute(effects)
return state.output
```
That is the whole orchestrator. Everything else in this skill exists to make
each of those five names concrete:
| Runtime name | What it is in a workmachine run |
|---|---|
| `machine` | `machine.md` — states, event alphabet, transition table, budgets, final states. Authored once in Phase 1. Never edited at runtime except through the ESCALATE protocol. |
| `state` | one line in `state.md` — the current state name plus its visit count; and the `output` slot once a final state is reached. |
| `init` | run the scaffold, author the machine, enter the initial state, and evaluate that state's **entry effects**. |
| `effects` | a list of side-effects a state emits on entry: subagent dispatches (by role-prompt path), `state.md`/`events.md` writes, git spot-checks. Effects **never decide anything**. |
| `execute` | dispatch the effect's subagents **in parallel**, read their TINY statuses, spot-check commits. |
| `nextEvent()` | pop ONE event token from the queue in `state.md`. Tokens come only from the alphabet; they are produced by collapsing tiny statuses with the machine's **event rules**, or by the clock / the user. |
| `transition` | a **pure table lookup**: `(state, event) → (next state, effects)`. Table miss → `ESCALATE