workflow-builder
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 repeatable multi-step task across fresh-context agents.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- workflow-builder
- license
- MIT
- metadata
- { "targets": "Claude Code Workflow tool (CLAUDE_CODE_WORKFLOWS=1, /workflows)", "version": "1.0.0", "inspired_by": "https://github.com/ray-amjad/claude-code-workflow-creator (Ray Amjad)" }
- description
- 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 repeatable multi-step task across fresh-context agents.
02 资源文件 14
- 脚本assets/examples/pr-triage.js3.5 KB
- 脚本assets/templates/fan-out.js1.1 KB
- 脚本assets/templates/loop-until-budget.js1.2 KB
- 脚本assets/templates/pipeline.js1.2 KB
- 参考文档expected_outputs/intake_pr_review.json1.2 KB
- 脚本expected_outputs/scaffold_pipeline.js1.2 KB
- 参考文档expected_outputs/validate_sample.txt555 B
- 参考文档README.md1.4 KB
- 参考文档references/api_reference.md6.3 KB
- 参考文档references/decision_and_intake_guide.md5.8 KB
- 参考文档references/orchestration_patterns.md5.4 KB
- 脚本scripts/scaffold_workflow.py6.7 KB
- 脚本scripts/validate_workflow.py10.7 KB
- 脚本scripts/workflow_intake.py10.2 KB
03 SKILL.md 正文
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.
-
Ask what kind of workflow they want. Use this opening question set:
- What repeatable, multi-step task do you want to automate?
- What is the one unit of work a single sub-agent does once?
- How many units — a known list, or discovered by looping?
- Do later steps need all prior results at once, or can each item flow on its own?
- Does any step need structured data back (a verdict, a list, scores)?
- Roughly how many tokens / how deep should it go?
-
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:
python scripts/workflow_intake.py --task "their description" \ --units unknown --stages unknown --needs-all unknown --structured unknownThe 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.
-
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
- Scaffold a starter from the confirmed topology:
python scripts/scaffold_workflow.py --topology pipeline --name pr-triage \ --description "Triage open PRs" > .claude/workflows/pr-triage.js - Edit the file:
metablock 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. - Validate before running — catches the parser-fatal mistakes:
python scripts/validate_workflow.py .claude/workflows/pr-triage.js - Run it: enable the feature with
export CLAUDE_CODE_WORKFLOWS=1, save the file under.claude/workflows/, then use/workflowsto 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)
metais a pure literal and the first statement — no variables, spreads, template strings, or function calls inside it.- No non-determinism:
Date.now(),Math.random(), arglessnew Date()break resume — pass timestamps viaargs. - No filesystem / Node APIs (
require,fs,process, network) in the orchestrator — that work belongs insideagent()prompts. parallel()takes thunks (() => agent(...)), not bare promises. Default topipeline()unless a stage needs the whole prior result set.- Guard every open-ended loop with a counter or
budget.remaining()check — unguarded loops hit the 1000-agent cap. - Filter skipped/failed agents:
results.filter(Boolean).
Tooling
scripts/workflow_intake.py— intake recommendation engine (topology + model + budget + rationale from vague input).scripts/validate_workflow.py— stdlib linter for the rules above; PASS / WARN / FAIL with line numbers.scripts/scaffold_workflow.py— generate a starter.jsfor any topology.assets/templates/— fan-out, pipeline, loop-until-budget starters.assets/examples/— a complete runnable workflow.
All scripts run with --sample (no args) and --help.
04 同仓库更多 Skills
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
web-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
ui-styling
Create beautiful, accessible user interfaces with shadcn/ui components (built on Radix UI + Tailwind), Tailwind CSS utility-first styling, and canvas-based visual designs. Use when building user interfaces, implementing design systems, creating responsive layouts, adding accessible components (dialogs, dropdowns, forms, tables), customizing themes and colors, implementing dark mode, generating visual designs and posters, or establishing consistent styling patterns across applications.
design
Comprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG, Gemini 3.1 Pro), social photos (HTML→screenshot, multi-platform). Actions: design logo, create CIP, generate mockups, build slides, design banner, generate icon, create social photos, social media images, brand identity, design system. Platforms: Facebook, Twitter, LinkedIn, YouTube, Instagram, Pinterest, TikTok, Threads, Google Ads.
design-system
Token architecture, component specifications, and slide generation. Three-layer tokens (primitive→semantic→component), CSS variables, spacing/typography scales, component specs, strategic slide creation. Use for design tokens, systematic design, brand-compliant presentations.
banner-design
Design banners for social media, ads, website heroes, creative assets, and print. Multiple art direction options with optional generated or supplied visuals. Actions: design, create, generate banner. Platforms: Facebook, Twitter/X, LinkedIn, YouTube, Instagram, Google Display, website hero, print. Styles: minimalist, gradient, bold typography, photo-based, illustrated, geometric, retro, glassmorphism, 3D, neon, duotone, editorial, collage.