workflow

A command for building a new feature as a defined sequence of stages, signals, and limits. It combines contract design, invariant writing, state-machine authoring, effect checks, and execution into one workflow.

In plain words
What is it for?
Use it to design and build a workflow, define what each stage receives and produces, identify rules that must always hold, declare side effects, check for looping problems, and run the finished machine.
Why use it?
It replaces an open-ended agent loop with named steps and bounded ways to recover from failures or involve a person. This makes the feature's behavior easier to inspect and check.

Command

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/cognitive-fab/polygraph/workflow
Clone the repo
git clone --depth 1 https://github.com/cognitive-fab/polygraph
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 427 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.00057 $0.00427
Opus 5 $0.00028 $0.00214
Sonnet 5 $0.00011 $0.00085
Haiku 4.5 $0.00006 $0.00043

Measured yesterday against content hash 233f78ff4d16, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

workflow 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 yesterday.

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/workflow.md · 30 lines

What it actually says

Invoke the workflow skill over $ARGUMENTS and follow its steps in order.

This is the COMPOSITION command: it drives the whole toolset end-to-end for a NEW feature built the workflows-not-loops way (polygen authors the machine, polyrun's checkers gate the effect composition, polyrun executes, polyvers evolves later). The design conversation in Step 1 — stages along the data flow, every failure answered with either a targeted bend-back or a human escalation, the fuzzy middle scoped to named stages — happens WITH the user before any file is written.

Reference material shipped with the plugin:

  • ${CLAUDE_PLUGIN_ROOT}/examples/workflows-not-loops/MANUAL.md — the recipe
  • ${CLAUDE_PLUGIN_ROOT}/examples/workflows-not-loops/ — document pipeline (incl. the polygen bisimulation and the v1→v2 polyvers evolution)
  • ${CLAUDE_PLUGIN_ROOT}/examples/todo-machine/ — an ordinary app (durable timers replace the cron scan; clickable HTTP shell)

No API key is required end-to-end: machine authoring follows the polygen skill's Step 0 choice (scripted with ANTHROPIC_API_KEY for the CI-grade, pinned-model run — or keyless in-session authoring gated by the same local checkers), and every checking tier (check.mjs, check-effects, deploy gate) and polyrun itself never need one. Always state the standard disclosure: exhaustive over the declared domains — a consistency check, not a proof.

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. yesterday First seen · 30 lines · 0 tokens per session scan A 233f78ff4d16

Subscribe to this mod's changes

workflow is a command published in the GitHub repository cognitive-fab/polygraph (11 stars, last pushed 5d ago), licensed Apache-2.0. It adds 57 tokens to every session and 427 once invoked, about $0.0003 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.