flow-run

A command for starting or continuing a file-based delivery workflow, where project files record the current stage and run state. It checks that the project is configured and resumes an unfinished run when appropriate.

In plain words
What is it for?
Use it to begin a new delivery run for a feature request or continue an existing run through its defined stages.
Why use it?
It prevents a workflow from being started or resumed based only on an unreliable status flag and surfaces invalid or damaged state for repair.

Command

Part of the cairnkit plugin — 2 skills, 7 commands, 11 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/shenchangmin/cairnkit/flow-run
Clone the repo
git clone --depth 1 https://github.com/shenchangmin/cairnkit

Or install cairnkit, the plugin that ships this one along with the rest of its 2 skills, 7 commands, 11 agents.

Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 813 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.00813
Opus 5 $0.00010 $0.00407
Sonnet 5 $0.00004 $0.00163
Haiku 4.5 $0.00002 $0.00081

Measured 2d ago against content hash 970cdee9c37a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

flow-run scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/flow-run.md · 59 lines

How it starts

The opening of the file, as written. The whole thing — 59 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/flow-run

Start or resume the delivery workflow for this project.

Steps

  1. Verify the project is initialised. Run cairn --root . config show.

    • Exit 2 means there is no valid cairnkit.yaml: tell the user to use the team-init entrypoint first and stop.
    • Exit 0: read has_run from the JSON.
  2. Inspect before deciding start vs resume. If has_run is true, first run cairn --root . state show. Exit 4 means corrupt STATE: surface the engine repair guidance and stop. Never decide from has_run alone.

  3. Start a genuinely new run. If has_run is false, or the existing state's stage is DONE, derive <run-id> as <YYYY-MM-DD>-<short-slug> from today's date and the original user request. It must be 1–128 characters, start with an ASCII letter or digit, and then contain only ASCII letters, digits, _, or -; never use a path separator, ., .., whitespace, a control character, or raw request text. Then run:

    For the first run use cairn --root . state init --run-id <run-id>. When the prior stage is DONE, use cairn --root . state new --run-id <run-id> so the engine archives the completed STATE safely. The engine rejects an existing workflow directory; on that collision, add a numeric suffix (-2, -3, ...) while staying within 128 characters and retry with a new ID. Never reuse or delete the old directory.

  4. Resume only the same active intent. When state show reports a non-DONE stage, resume only if this invocation explicitly asks to resume that run and its original request is known or the user supplies it. If the invocation contains a distinct new task, stop, show the active run ID and stage, and ask the user to choose between resuming it or abandoning it for a new run; never substitute the new request into the active run. Run state new --force only after the user explicitly chooses to abandon/reset the active run; derive a unique new run ID as above. Do not force or reset implicitly.

Read the full file on GitHub · 59 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 59 lines · 20 tokens per session scan A 970cdee9c37a

Subscribe to this mod's changes

flow-run is a command published in the GitHub repository shenchangmin/cairnkit (1 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 813 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.