con un clic
flow
Flow protocol — design and operate state machine workflows with FLOW.md + WORK.md
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Flow protocol — design and operate state machine workflows with FLOW.md + WORK.md
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Step 2 — Architecture and domain design, one feature at a time
Step 1 — discover requirements through stakeholder interviews and write Gherkin acceptance criteria
Generate and update architecture diagrams, living glossary, and system overview from existing project docs
Enforce code quality using ruff, pytest coverage, and static type checking
Create pull requests with conventional commits, proper formatting, and branch workflow
Create releases with hybrid major.minor.calver versioning and optional custom release naming
| name | flow |
| version | 2.0 |
| description | Flow protocol — design and operate state machine workflows with FLOW.md + WORK.md |
| author | software-engineer |
| audience | all-agents |
| workflow | session-management |
This skill defines how to design, create, and operate a state machine workflow using two files:
FLOW.md — the static state machine definition (never changes during execution)WORK.md — the dynamic work tracker (updated by agents at every state transition)The project's current workflow is defined in the root FLOW.md. Load this skill when:
A finite state machine (FSM) consists of:
Design principles (from FSM theory and workflow management best practices):
flowchart LR
FLOW["FLOW.md<br/>What are the rules?<br/>(static, versioned with the project)"]
WORK["WORK.md<br/>What is happening now?<br/>(dynamic, updated by agents)"]
Agents read FLOW.md to know what to do. They read WORK.md to know what is active and where it is. They write only to WORK.md during normal operation.
FLOW.md defines the minimal set of variables each work item must carry in WORK.md. Variables should satisfy:
@state via FLOW.md)Common variables (adapt to your workflow):
| Variable | Type | Description |
|---|---|---|
@id | identifier | Unique name of the work item |
@state | state name | Current state in the workflow |
@branch | git ref | Where the work lives in version control |
Add variables only when they cannot be derived. Example: @owner is unnecessary if each state in FLOW.md already declares its owner.
Follow these steps when creating a new FLOW.md from scratch or modifying an existing one.
Answer these questions:
For each phase, write a state entry:
State name — short, uppercase, unambiguous (e.g. STEP-3-RED)
Owner — the role that executes this state
Entry guard — detectable condition that confirms we are in this state
Action — what the owner does
Exit — what triggers the transition out
Failure route — where to go if the action cannot complete
Smell check:
States are detected in order. Write detection rules as an ordered list where:
This ordering is the FSM's auto-detection mechanism and makes WORK.md self-healing.
List only the variables agents cannot derive. Reference them as @variable throughout FLOW.md. WORK.md entries must carry every variable in this list.
List each role with its agent file path. Every state owner must appear in this table. These are the prerequisites for running the workflow.
Include a Mermaid stateDiagram-v2. It must show every state and every valid transition including failure routes. This is the primary human-readable artifact.
FLOW.md — understand the workflow rulesWORK.md — find the active item; note @id, @state, @branchFLOW.md to verify @stateWORK.md, update WORK.md to match reality (filesystem wins)FLOW.md — if any missing, stop and report.feature file) for context@branchWORK.md:
@state to the new stategit add WORK.md && git commit -m "chore: @id transition to @state"
git add -A && git commit -m "WIP(@id): <what was done>"
The agent who completes a state is responsible for updating WORK.md to the next state before doing any other work. Transitions are atomic: update WORK.md, commit, then proceed.
If WORK.md and auto-detection disagree, the filesystem is the source of truth. Update WORK.md to match. Never "correct" the filesystem to match WORK.md.
# WORK — Active Work Tracking
This file tracks live work items. The workflow rules live in `FLOW.md`.
Each item carries exactly the variables defined by `FLOW.md`:
- @id — <description>
- @state — <description>
- @branch — <description>
---
## Active Items
- @id: <value>
@state: <value>
@branch: <value>
Multiple active items are allowed when the workflow permits parallel work. Each is a separate bullet entry under ## Active Items.
Use the templates bundled with this skill as starting points:
flow.md.template — empty FLOW.md skeletonwork.md.template — empty WORK.md skeletonSteps:
flow.md.template to your project root as FLOW.mdwork.md.template to your project root as WORK.mdFLOW.mdWORK.mdFLOW.md and WORK.md at session startWORK.md and committingmainWORK.md is missing, create it from work.md.template before any other workWORK.md, trust the filesystem and update WORK.md