/skill-dev:workflow-creator [create <task> | audit <script.js> | optimize <script.js>]from Skill Dev
Create, audit or optimize a Claude Code dynamic workflow: the .js script (export const meta + agent()/pipeline()/parallel()) that orchestrates many subagents and is saved as /<name> in .claude/workflows/, ~/.claude/workflows/ or a plugin. Use whenever someone wants such a script written, checked against the official authoring rules, made cheaper or faster, relocated, or carved out of a skill's fan-out step, in any language: 'napisz workflow do migracji', 'zrób z tego dynamic workflow', 'zoptymalizuj ten workflow, za dużo tokenów', 'write a workflow that audits every route', 'review my .claude/workflows script', 'why does /my-workflow not show up', 'this workflow never finishes'. Also when a 'make a skill' request describes dozens of independent items handled the same way: that is a workflow. NOT for a phased SKILL.md process with gates or mid-run human decisions (workflow-skill-creator), NOT for running an existing workflow (invoke /<name>), NOT for CI pipelines.
Ships in Skill Dev. 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; scripts run unread.
A dynamic workflow moves orchestration out of the conversation and into a script: the script
holds the loop, the branching and the intermediate results, and Claude's context holds only
the final answer. That is its whole value, and also why it fails differently from a skill. A
weak skill skips a step. A weak workflow runs 200 agents against the wrong branch, returns
null slots that read as "nothing found", or loops to the 1000-agent cap because nobody set
a token target. None of those look wrong in the transcript.
This skill does three jobs, picked by the first argument: create a script for a task,
audit an existing script, optimize one that is correct but slow or expensive. With no
argument: a .js path means audit, anything else means create.
Everything here was checked against Claude Code 2.1.294. The script API lives in the session
as the bundled /workflow-authoring skill, which is always current for the installed version.
Load it first in every job; the files in references/ are the distilled, stable parts and the
rules that the bundled reference does not cover.
The checker needs Node 18+ and nothing else; claude --version is read to compare against the
version this skill was checked on. Check first:
node --version && claude --version
Copy this list into your reply and work down it:
[ ] 1 right tool? → one sentence: why a workflow and not a skill, a subagent or a chat turn
[ ] 2 load the reference → /workflow-authoring run; version noted
[ ] 3 contract → objective, boundaries, roles, evidence standard, stop rule
[ ] 4 shape → phases, items, schema per handoff, pipeline vs barrier decided
[ ] 5 write → <name>.js
[ ] 6 lint → check_workflow.mjs PASS, or every major explained
[ ] 7 permissions → allow rules the agents need; baseRef checked when worktrees are used
[ ] 8 pilot → one small slice through args; journal read
[ ] 9 save → location chosen and named; /reload-skills; /<name> visible
A workflow pays off when the task is larger than one context (dozens of files, many sources), when the same step runs across many items, or when a quality pattern should be repeatable (independent reviewers, adversarial verification of every finding, a judge panel). The flowchart test: if you cannot sketch the task as fan-out, a loop with a stop rule, or typed handoffs between stages, it does not need a script.
Say no when the task is sequential, needs a human decision mid-way (a run cannot ask anything), fits in one agent, or is a "make it better" with no evidence standard. Say "partly" when an existing skill has one fan-out phase: keep the skill as the owner of the process and give only that phase to a workflow. A skill may instruct Claude to call the Workflow tool; that is a sanctioned trigger.
Run /workflow-authoring with the Skill tool and read claude --version. If the version is
newer than 2.1.294, trust the loaded reference over references/api.md
wherever they differ, and say so in the handover.
Write five lines before any JavaScript, and keep them as a comment at the top of the body:
src/routes/
classified as guarded or unguarded, each unguarded one verified by a refuter."file:line for findings, the command and exit code for verdicts.A vague contract gives a vague script, and a script is harder to fix than a sentence.
Read references/patterns.md and pick the closest shape: discover, transform, verify; review dimensions then refute each finding; loop until a check passes; loop until dry; judge panel. Then decide:
args; the script needs the shape only at the
orchestration step.r.files or spreads
...r, that agent has a schema. Keep schemas small: few required fields fail validation
less often, and each failed validation costs an agent turn.pipeline() by default. A barrier only when the next stage needs all results at once:
dedup, early exit on zero, cross-item comparison. Name the reason in a comment.~/.claude/agents/ bring their own rules; use
agentType: 'fe-tester' rather than pasting testing rules into a prompt. Check the agent
exists with Glob before naming it.low for listing and mechanical rewrites, the session default or
higher for verify and judge stages. Leave model unset unless the user asks.isolation: 'worktree'. Worktrees
branch from the repository default branch unless worktree.baseRef is "head", so a
migration on a feature branch silently works on main without it. The script cannot
merge; it returns branches and worktree paths for the user or a later workflow.log() what was dropped.export const meta first, a pure literal with name, description, optional whenToUse
and phases whose titles match phase() calls exactly. Then plain JavaScript: no types, no
imports, no Date.now(), Math.random() or bare new Date(). Guard every args access.
.filter(Boolean) every parallel() and pipeline() result. label on every fan-out agent,
log() at every stage transition with a count. Name the file <name>.js.
Prompts return data, not messages for a human. They name what the agent must not touch. They
do not restate CLAUDE.md. They contain no credentials; scripts are persisted and shown in
/workflows.
node ${CLAUDE_SKILL_DIR}/scripts/check_workflow.mjs <script.js>
FAIL means a blocker the runtime would also reject or a loop that cannot end: fix it.
WARN lists majors; fix each or write one line on why it is intended (a worktree on the
default branch, a slice that is logged elsewhere). The checker reads only the script and the
settings files; walk section C and D of
references/audit-rubric.md for what it cannot see.
List the tools the agents will call and check they are in allow rules: Bash(npx vitest *),
Bash(npm run *), Bash(git *), WebFetch(domain:…). A run pauses on every prompt an agent
hits, and a 40-agent run that pauses 40 times is not unattended. For headless use add
Workflow(<name>). When worktrees are used, read worktree.baseRef from the settings and
git branch --show-current, and state which branch the agents will see.
Run on one directory or three items through args, in the user's session, before the full
run. Read the result and, when it is empty or odd, the run's journal.jsonl under
~/.claude/projects/, which holds each agent's actual return value. Note the token total from
/workflows in the handover so the full run has a known price.
Choose with the user and name the path in the handover:
<repo>/.claude/workflows/<name>.js when the team should have it. Wins a name clash.~/.claude/workflows/<name>.js for a personal workflow that works in every project.<plugin>/workflows/<name>.js to distribute it; runs as /<plugin>:<name>.Then /reload-skills and confirm /<name> appears in autocomplete. Details and the symlink
rules are in references/locations-and-settings.md.
node ${CLAUDE_SKILL_DIR}/scripts/check_workflow.mjs <script.js>.severity CODE file:line fix, and a short list of what already works so it
survives a rewrite.Optimize only a script that passes audit; a faster wrong script is worse. Measure first: the
previous run's token total and wall-clock from /workflows, and the agent count. Then apply
the levers in this order, each with its expected effect written down:
pipeline() stages. Wall-clock drops
to the slowest single-item chain.low on mechanical stages. Keep verify and judge stages at the session level.subagentPromptCacheTtl: "1h" for runs
longer than five minutes between sibling starts.args, bound discovery loops with a
dry counter and a round cap.Re-run the lint after each change and re-pilot on the same slice, so the before and after numbers compare.
/workflow-authoring and these files disagree, the
session's version is right; note the difference in the handover so the files get updated.workflow-skill-creator); this skill produces
the .js that such a skill may call for one fan-out phase.scripts/check_workflow.mjs: static checker, zero dependencies, --json for machines,
exit 2 on blockers and 1 on majors. tests/test_check.mjs runs it on the three fixtures in
tests/fixtures/ (a sound migration, a script with ten seeded defects, a correct but slow
review).evals/evals.json (opens in a new tab)references/api.md (opens in a new tab)references/audit-rubric.md (opens in a new tab)references/locations-and-settings.md (opens in a new tab)references/patterns.md (opens in a new tab)scripts/check_workflow.mjs (opens in a new tab)tests/fixtures/broken-audit-routes.js (opens in a new tab)tests/fixtures/good-migrate-logic.js (opens in a new tab)tests/fixtures/slow-review.js (opens in a new tab)tests/test_check.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/skill-ab-optimizerContinuously tests and improves Claude Code skills using A/B experimentation and Auto Research ML loop. Provides quantitative metrics on skill effectiveness and automatically approves only changes that improve outcomes./skill-auditAudits one Claude Code skill for authoring quality — the frontmatter contract, whether the description will actually trigger, the progressive-disclosure budget, dead links and orphan reference files, prose economy, language consistency, and whether bundled scripts and references earn their cost, and whether a multi-step flow shows its progress in a task list. Use whenever the user asks to review, audit, tighten, trim, or clean up a skill, says a SKILL.md has grown bloated or rambling, wonders whether its reference files are still linked or whether anyone reads them, asks why a skill never fires, or wants to know what to cut before shipping it. Not for auditing a whole marketplace repo's manifests and READMEs — that is marketplace-creator — and not for measuring whether a wording change improved triggering, which is skill-ab-optimizer. This one reads the skill and proposes edits.Other plugins' skills for the same job
/workflow-skill-creatorCreate, rework or audit a workflow skill — one that carries a repeatable process through ordered steps, where a step quietly skipped still yields a result that looks fine. Use when someone wants a new skill for a multi-step process, an existing skill reshaped into phases or moved to a lighter or stricter tier, or a flow skill checked against good practice, in any language the user writes in: 'make a skill for this workflow', 'turn this process into a skill', 'split this skill into phases', 'this skill keeps skipping steps', 'enforce the step order', 'audit this workflow skill', 'is this skill tiered right', 'does this skill need a gate'. Also use it when a plain request to create a skill turns out to describe dependent steps, a human decision mid-way, or a write to Jira or GitHub. NOT for skills with no ordering (use a general skill creator), NOT for general authoring review of frontmatter, links or prose (use a skill-audit skill), and NOT for running an existing flow skill — invoke that skill instead.npx claudepluginhub janszewczyk/claude-plugins --plugin skill-dev