workflow

A command that turns a plain-language task into a workflow script and runs it with the StateGraph engine, a system for connecting steps and decisions. It also includes the project’s documented quality checks in the workflow.

In plain words
What is it for?
Use it to plan and run ad-hoc workflows, connect dependent steps, run independent checks in parallel, and validate the result.
Why use it?
It organizes multi-step coding work and makes required checks part of the process instead of relying on memory.

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/yorrick/agent-skills/workflow
Clone the repo
git clone --depth 1 https://github.com/yorrick/agent-skills
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,819 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00018 $0.06819
Opus 5 $0.00009 $0.03410
Sonnet 5 $0.00004 $0.01364
Haiku 4.5 $0.00002 $0.00682

Measured 2d ago against content hash 033be14ad543, 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 1 finding 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

result = subprocess.run(
dev-loop/commands/workflow.md · 593 lines

How it starts

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

Workflow Generator

You generate and execute ad-hoc workflow scripts using the StateGraph engine.

The user's request is: $ARGUMENTS

Engine location

The workflow engine is at: ${CLAUDE_PLUGIN_ROOT}/scripts/engine.py

What to do

  1. Read CLAUDE.md and list quality gates. Before anything else, read CLAUDE.md (or AGENTS.md, GEMINI.md) in the repo root. If it exists, extract every quality gate command it mentions (e.g., uv run ruff check ., uv run pyright, npx playwright test, npm run build). Write them down — you will need to add a workflow node for each one.
  2. Understand the request. Read relevant source files to understand the codebase context.
  3. Design the workflow. Decide which nodes, edges, and routers are needed. Pick the right node type for each step. For every quality gate from step 1, add a dedicated shell_node (or include the command in an LLM node prompt). If CLAUDE.md says "run ruff check", there must be a node that runs ruff. If it says "run pyright", there must be a node for pyright. No exceptions. Look for parallelization opportunities — independent quality gates can run in parallel via add_parallel_edges.
  4. Write the script. Create a Python script at /tmp/workflow_NNNN.py (use a random 4-digit suffix). Always include --diagram flag handling (see template).
  5. Show the diagram first. Run with uv run /tmp/workflow_NNNN.py --diagram and show the user the rendered ASCII diagram so they can see the workflow graph before execution. The script template already uses graph.to_ascii() for this — do NOT change it to to_mermaid(). The ASCII version renders a visual box-and-arrow diagram directly in the terminal.
  6. Run it. Execute with uv run /tmp/workflow_NNNN.py.
  7. Report the result. Show the user what happened.

Script template

Every generated script follows this structure:

#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = ["mermaid-ascii"]
# ///
import os
import sys
sys.path.insert(0, "${CLAUDE_PLUGIN_ROOT}/scripts")

import asyncio
from engine import (
    StateGraph, claude_node, codex_node, gemini_node,
    shell_node, python_node, template_node,
    detect_available_models, END,
)


def build_graph(models: dict[str, bool] | None = None) -> StateGraph:
    """Build the workflow graph. Accepts optional models dict for testing."""
    if models is None:
        models = detect_available_models()
    HAS_CODEX = models["codex"]
    HAS_GEMINI = models["gemini"]

    graph = StateGraph(max_iterations=5)

    # ... define nodes and edges ...
    # Use codex_node/gemini_node when available and appropriate,
    # fall back to claude_node otherwise. See model selection guide below.

    return graph


if __name__ == "__main__":
    graph = build_graph()
    if "--diagram" in sys.argv:
        print(graph.to_ascii())
        sys.exit(0)
    initial_state = {"work_dir": os.getcwd()}
    asyncio.run(graph.run(initial_state))

Read the full file on GitHub · 593 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 · 593 lines · 18 tokens per session scan A 033be14ad543

Subscribe to this mod's changes

workflow is a command published in the GitHub repository yorrick/agent-skills (10 stars, last pushed 1mo ago), licensed MIT. It adds 18 tokens to every session and 6,819 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.