Workflow builder

From Infrasity-Labs/dev-gtm-claude-skills · View interactive version

Workflow builder is an AI agent skill from the GitHub repository Infrasity-Labs/dev-gtm-claude-skills. Design and write deterministic multi-agent workflow scripts (.js files in .claude/workflows/) for Claude Code's Workflow tool. Use when a user wants to build, create, author, scaffold, or run a custom Claude Code workflow, orchestrate sub-agents (fan-out, pipeline, loop, judge-panel), or automate a

How to use this skill

Skill file

Workflow Builder

Author runnable workflow scripts for Claude Code's Workflow tool: deterministic multi-agent orchestration files (.js) that fan work out to fresh-context sub-agents under plain JavaScript control flow. Only leaf agent() calls spend tokens, so the main session stays clean and the whole run is resumable.

ALWAYS start every session with intake (non-negotiable)

Before proposing or writing any workflow, run the intake. Do not skip to code.

  1. Ask what kind of workflow they want. Use this opening question set:
  1. If the user is vague, do NOT stall. Run the recommendation engine to turn whatever you have into 1-2 concrete proposals, then present them with the reasoning:

```bash

python scripts/workflow_intake.py --task "their description" \

--units unknown --stages unknown --needs-all unknown --structured unknown

```

The engine returns a recommended topology (fan-out / pipeline / loop / barrier / judge-panel), model picks, a budget guard, and a one-line rationale per choice. Present those as "Here's what I'd build and why" — never ask the user to re-answer questions they already half-answered.

  1. Confirm the shape with the user (topology + phases + parallel-vs-pipeline) before writing the file. This is the only approval gate.

See references/decision_and_intake_guide.md for the full question framework, the vague-input playbook, and worked recommendation examples.

Decide if a workflow is even the right tool

| Scenario | Use |

|----------|-----|

| Single sub-agent, one task | plain Agent tool |

| Reusable procedure, Claude picks steps dynamically | a Skill |

| Many sub-agents in a fixed topology, deterministic + resumable | Workflow ✓ |

Workflows earn their cost when work is parallel or multi-stage, must be reproducible, long enough to fail halfway (so resume matters), or benefits from isolating each step in its own context window. For one-off tasks, just use Claude directly.

Build → validate → run loop

  1. Scaffold a starter from the confirmed topology:

```bash

python scripts/scaffold_workflow.py --topology pipeline --name pr-triage \

--description "Triage open PRs" > .claude/workflows/pr-triage.js

```

  1. Edit the file: meta block first (pure literal, first statement), then the async body using the injected globals — agent(), pipeline(), parallel(), phase(), log(), budget, args, workflow(). Full surface in references/api_reference.md; copy-paste shapes in references/orchestration_patterns.md.
  2. Validate before running — catches the parser-fatal mistakes:

```bash

python scripts/validate_workflow.py .claude/workflows/pr-triage.js

```

  1. Run it: enable the feature with export CLAUDE_CODE_WORKFLOWS=1, save the file under .claude/workflows/, then use /workflows to launch and watch it live. Press P to pause/resume, X to skip a sub-agent. Failed agents retry automatically.

Hard rules (validator enforces these)

Tooling

All scripts run with --sample (no args) and --help.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.