| name | workflow |
| description | Multi-phase agent orchestration system. Bootstraps .claude/workflows/ in any project.
Commands: init (bootstrap), run (execute), list (show workflows), create (new from template), plan (build plan).
Use when: "init workflows", "run workflow X", "list workflows", "create workflow".
|
| allowed-tools | ["Bash","Read","Write","Edit","Agent","Glob","Grep"] |
Workflow Engine
Portable multi-phase agent orchestration. Bootstraps .claude/workflows/ in any project.
Commands
Two kinds. Skill actions (init, run, create) are orchestrated by Claude.
CLI subcommands are run via bun run .claude/workflows/cli.ts <subcommand>:
| CLI subcommand | Purpose |
|---|
list | List discoverable workflows |
plan <name> '<args>' | Build plan as JSON |
show <name> '<args>' | Build plan in readable form |
validate <name> '<args>' | Validate args against args_schema |
meta <name> | Print workflow metadata |
init โ Bootstrap workflow system in current project
Run: bun run <skill-dir>/skills/workflow/scripts/init.ts
This generates in the current project:
.claude/workflows/
โโโ cli.ts # bun run .claude/workflows/cli.ts <command>
โโโ src/ # Runtime (symlinked to plugin)
โ โโโ types.ts
โ โโโ runtime.ts
โ โโโ validator.ts
โโโ templates/ # Starter workflows (copied, user can customize)
โโโ README.md
Non-destructive: existing files are NEVER overwritten.
run <workflow> [args] โ Execute a workflow
- Build plan:
bun run .claude/workflows/cli.ts show <name> '<args-json>'
- Parse plan output
- Execute stage by stage (agents in same stage run in parallel)
- Validate each agent output against schema; on failure, retry the agent once with the validation errors fed back
- Report results
Adversarial verify โ for verified-swarm/survey-round, a Verify phase runs
several independent voters per item. Run that item's Fix agent only if the
majority rejected it; skip the rest. This catches agents that suppress errors
instead of fixing them.
Convergence loop โ survey-round is the plan for one round only. The
static-plan runtime cannot express a round-loop, so drive it yourself: run the
round, read the Survey agent's remaining, and repeat until remaining == 0 or a
MAX_ROUNDS cap. The orchestrate skill describes the full loop.
Agent invocation:
Agent({
description: "<label>",
prompt: "<prompt>\n\nIMPORTANT: Return ONLY valid JSON matching this schema:\n<schema>\n\nNo markdown fences, no commentary, only the JSON object.",
})
list โ List workflows
bun run .claude/workflows/cli.ts list
plan <workflow> [args] โ Build plan without executing
- Readable:
bun run .claude/workflows/cli.ts show <name> '<args-json>'
- JSON:
bun run .claude/workflows/cli.ts plan <name> '<args-json>'
create <name> [template] โ Create new workflow from template
- Pick template:
single-agent โ one agent, schema-validated output
multi-stage โ implement โ verify โ fix pipeline
parallel-swarm โ N agents in parallel + aggregate
verified-swarm โ parallel implement + 3-vote adversarial verify + conditional fix
survey-round โ one round of a convergence loop (survey โ fix โ verify)
- Copy
<skill-dir>/skills/workflow/templates/<template>.workflow.ts to .claude/workflows/<name>.workflow.ts
- Rewrite the import:
../src/types.ts โ ./src/types.ts (templates live one dir deeper than root workflows)
- Prompt user for customization
- Write with TODO markers
How to discover
The skill directory is wherever this plugin is installed. Check:
~/.claude/plugins/claude-workflow-plugin/skills/workflow/
- Or the directory containing this SKILL.md file
Use ${CLAUDE_SKILL_DIR} environment variable if available, or ask the user.
Workflow File Contract
import type { WorkflowMeta, WorkflowContext } from "./src/types.ts";
export const meta: WorkflowMeta = { name, description, phases, args_schema? };
export function execute(ctx: WorkflowContext): Record<string, unknown> { ... }
Runtime API in ctx:
ctx.agent(prompt, { label, phase, schema }) โ register agent
ctx.pipeline(items, stage) โ parallel stage
ctx.multiPipeline(items, ...stages) โ multi-stage
ctx.phase(title) โ mark phase
ctx.log(msg) โ structured log
ctx.validate(value, schema) โ JSON Schema validation