No slash command · from Agent Flow
Orchestrates ordered multi-step pipelines with bash, json, and primitive stages. Use for workflows where each step feeds the next, with declarative wiring and per-stage guards.
Ships in Agent Flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Make it visible: the moment you start, say so in one line (skill + run-id) so it's clear an Agent Flow run is happening;
/agentflow:boardthen lists every run on disk — the audit trail.
Portable bundle. To use this skill in another project, copy:
${CLAUDE_PLUGIN_ROOT}/skills/pipe/(this folder: SKILL.md + defaults.md)${CLAUDE_PLUGIN_ROOT}/dist/(common.js,state/pipe.js, plus all child primitives' state.py)${CLAUDE_PLUGIN_ROOT}/dist/hook/continue.js— generalized Stop hook- the Stop hook is wired automatically by the plugin (hooks/hooks.json)
You are the orchestrator of a /agentflow:pipe run. The pipe itself is a state machine: each turn you call state/pipe.js tick <run-id> and act on the JSON it returns. The composer never mutates child state; it only reads it to decide when to advance.
{
"type": "bash",
"name": "fetch-issues", // optional, human-readable label
"spec": {
"command": "gh issue list --json number,title,body --limit 500 > \"$PIPE_OUTPUT_PATH\"",
"output_path": ".agentflow/pipe/<run-id>/issues.json" // optional; defaults to stage-N.out
}
}
Bash stages run synchronously inside a turn. Env vars exposed:
PIPE_RUN_ID, STAGE_INDEX, PIPE_OUTPUT_PATH, PIPE_PREV_RESULT_POINTER.{
"type": "json",
"name": "build-config",
"spec": {
"value": {"source": "run", "run_id": "{{stages.review.run_id}}", "path": "{{stages.partition.result_pointer}}"},
"output_path": ".agentflow/pipe/<run-id>/config.json"
}
}
JSON stages write a JSON document directly to output_path, with template substitution applied to every string leaf inside value. They run synchronously and are fully auto-drivable. Use this instead of bash+printf to construct small JSON files between primitive stages: it handles Windows path escaping correctly, doesn't depend on shell quoting, and the result always parses as valid JSON.
Template syntax (resolved by /agentflow:pipe at tick time, in bash.command, bash.output_path, json.value (recursively), json.output_path, and in primitive stages' init_args):
{{run.id}}, {{run.dir}} — this pipe run's id / working dir{{stages.<name>.run_id}} — a named primitive stage's child run-id{{stages.<name>.result_pointer}} — a named stage's result_pointer{{stages.<name>.cmd}} — a named primitive stage's child cmdFilters can be appended with |:
{{X|json}} — JSON-encode the resolved value (wraps strings in quotes, escapes backslashes). USE THIS when splicing into JSON contexts (especially for Windows paths whose backslashes would otherwise produce invalid JSON).{{X|shell}} — POSIX shell-quote.{{X}} or {{X|raw}} — raw substitution (default).Stage names MUST be unique; that's the lookup key for {{stages.<name>...}}.
{
"type": "primitive",
"name": "triage",
"spec": {
"cmd": "foreach",
"init_args": [
"--items", ".agentflow/pipe/<run-id>/items.json",
"--task-prompt", "...",
"--model", "haiku",
"--concurrency", "4"
]
}
}
The orchestrator generates the child run-id (the tick output suggests one), runs the child's init CLI, then calls state/pipe.js start-primitive-child to record it. The Stop hook resumes the CHILD on subsequent turns. When the child is done, the next pipe tick returns advance_after_child and the orchestrator calls state/pipe.js advance.
/agentflow:pipe (--stages <stages.json> | --workflow <workflow.json>) \
[--run-id NAME] [--context-policy summary|none|last-only|full] [--no-stop-on-failure]
--stages is a JSON array of stage descriptors (see Stage types below); --workflow is a declarative
WorkflowSpec ({name, config, stages}) that compiles into the same stages. If neither is given →
stop with a clear message. To AUTHOR a workflow-file use /agentflow:create-workflow; to RUN one in a single step
use /agentflow:run-workflow.
Read ${CLAUDE_PLUGIN_ROOT}/skills/pipe/defaults.md. Use defaults when CLI/spec do not supply a value.
--stages: read/parse the JSON array. --workflow: pass the file straight to init --workflow
(it reads stages + optional config). Either way the canonical state lands under .agentflow/pipe/<run-id>/.config > defaults).run-id is missing: generate pipe-<8 char hash> from the stages/workflow JSON.init validates every primitive stage's flags; a clear early failure beats a mid-run one.node "${CLAUDE_PLUGIN_ROOT}/dist/state/pipe.js" init <run-id> \
--stages .agentflow/pipe/<run-id>/stages.json \
--context-policy <policy> --max-auto-continues <N> \
[--no-stop-on-failure] [--auto-continue|--no-auto-continue] [--force]
If the run-id exists without --force: ask the user resume or reset.
node "${CLAUDE_PLUGIN_ROOT}/dist/state/pipe.js" tick <run-id>
Output is JSON; the action field tells you what to do next.
donePrint the final report:
result_pointer (the last completed stage's pointer)result_pointer if it is a readable text/markdown filefailedPrint the failure:
error stringresult_pointer of any earlier successful stage if usefulrun_bashExecute the command. The command receives env vars: PIPE_RUN_ID, STAGE_INDEX, PIPE_OUTPUT_PATH, PIPE_PREV_RESULT_POINTER.
Run via Bash tool, capture stdout to output_path. Then record:
node "${CLAUDE_PLUGIN_ROOT}/dist/state/pipe.js" complete-bash-stage <run-id> \
--exit-code <code> --output-path <output_path> [--error "<short reason>"]
After this, loop back to tick within the same turn (bash stages are fast; chaining them is fine). Continue until you hit spawn_primitive or done.
spawn_primitiveThe output includes cmd, suggested_child_run_id, and init_args. Steps:
suggested_child_run_id (you may override only if there is a real reason).
node "${CLAUDE_PLUGIN_ROOT}/dist/state/<cmd>.js" init <suggested_child_run_id> <init_args...>
node "${CLAUDE_PLUGIN_ROOT}/dist/state/pipe.js" start-primitive-child <run-id> \
--child-cmd <cmd> --child-run-id <suggested_child_run_id>
DO NOT also run the child's dispatch loop yourself here. Let the child's own SKILL.md handle it via cross-turn auto-continue.
await_primitiveThis means a primitive child is still working. Exit the turn — you should not normally see this directly because the hook prefers the child's checker, but if you do, just exit and the next Stop firing will resume the child.
advance_after_childThe current primitive stage's child is done (or failed). Call:
node "${CLAUDE_PLUGIN_ROOT}/dist/state/pipe.js" advance <run-id>
Then tick again within the same turn to see the next action.
When tick returns done, print:
run_id, stage_count, total turns used (from auto_continues)result_pointer if textualThe Stop hook detects /agentflow:pipe runs with auto_continue=true and residual work. /agentflow:pipe's predicate yields to running primitive children — while a child is running, /agentflow:pipe returns no residual and the hook resumes the child instead. /agentflow:pipe is re-entered only when the orchestrator needs to act (start a stage, advance after a child, finalize).
max_auto_continues: 50 is the pipe-level cap (on top of each child's own cap).
is_done) to decide when to advance. Children manage their own state per the single-writer rule.<pipe-run-id>-s<N>-<cmd>) makes provenance obvious./agentflow:group → /agentflow:foreach): when a primitive stage's input is the output file of a prior stage, pass it via the appropriate flag of the child primitive — e.g. /agentflow:foreach init expects --items <path>. The orchestrator constructs init_args accordingly when building the stages.json./agentflow:pipe with the same run-id without --force resumes from where it left off.stages.json:
[
{
"type": "primitive", "name": "triage",
"spec": {
"cmd": "foreach",
"init_args": [
"--items", ".agentflow/pipe/audit-001/files.json",
"--task-prompt", "Quick severity triage. Output: {has_issues, severity_hint}",
"--model", "haiku", "--concurrency", "8"
]
}
},
{
"type": "primitive", "name": "group-by-domain",
"spec": {
"cmd": "group",
"init_args": [
"--method", "jsonpath",
"--input-source", ".agentflow/pipe/audit-001/group-input.json",
"--method-config", "{\"path\":\"data.domain\"}"
]
}
},
{
"type": "primitive", "name": "deep-review",
"spec": {
"cmd": "foreach",
"init_args": [
"--items", ".agentflow/pipe/audit-001/groups-as-items.json",
"--task-prompt", "Deep code-review of every file in this group, cross-referenced.",
"--model", "opus", "--concurrency", "3"
]
}
},
{
"type": "primitive", "name": "digest",
"spec": {
"cmd": "reduce",
"init_args": [
"--inputs", ".agentflow/pipe/audit-001/digest-inputs.json",
"--task-prompt", "Executive summary by severity, top hotspots, recurring patterns.",
"--model", "opus", "--output-format", "markdown"
]
}
}
]
The orchestrator's job is to prepare those input files between stages (e.g. take the previous stage's result_pointer and shape it into the next stage's --items / --inputs). For v2, /agentflow:pipe will gain helpers to declare these wiring transformations declaratively. For v1, prep is the orchestrator's responsibility — keep it explicit.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alesaiani/agentflow --plugin agentflow23 skills in this plugin
/auditDeep code-audit recipe: discover files in a target → review each (LLM, cached) → partition by
component → executive digest with hotspots and recurring patterns. A layer-3 recipe over /agentflow:pipe
(the 6-stage pipeline and caching are detailed in the body).
USE when the user asks to "review / audit / find bugs across" a folder, repo, or glob and wants a
persisted, structured report — and the target is large enough (≥ ~10 files) that per-file parallelism
plus a digest beats reading inline.
DON'T use for a few named files (read them inline), exploratory questions ("what does this do?"), or
generic per-item work that isn't a code review (→ /agentflow:foreach).
Not a `/`-menu command — it's the shipped `workflows/audit/` recipe: reach it by asking ("audit src
for bugs"), or run it directly with `/agentflow:run-workflow workflows/audit/WORKFLOW.md`.
/boardWorkspace dashboard: lists every active framework run across all primitives, highlights blockers (stuck items, exhausted auto-continue caps), shows cumulative cost, and suggests the next action. The natural command to run after re-opening Claude Code in a workspace with in-flight runs, or whenever the user wants a one-shot overview of "what's going on".
USE this skill when:
- the user has just (re)opened the workspace and wants to know what is in flight;
- the user says "what's going on", "show me everything", "any active runs", "where are we", "any pipelines running";
- the user wants a one-shot health check + suggested next action.
DON'T use this to inspect a specific run in depth (use `/agentflow:inspect show <id>` or `tree <id>`), or
to modify state (board is read-only). Explicit: `/agentflow:board` or `/agentflow:board --json`.