From claude-code
Design reproducible multi-step flows in Claude Code — decide between a single ordered skill, multiple step commands, hook-gated state, and when to escalate a step to subagents, an agent team, or a dynamic workflow. Use when the user wants a repeatable procedure (step 1 → 2 → 3), a "pipeline", enforced step ordering, a gated process where a later step must check an earlier one, or asks how to package a multi-step process as a plugin. Also triggers on "make this reproducible", "marker file", "state machine", "step 2 needs step 1", "fan out", or "skill vs command vs workflow". Picks the lightest structure that fits and shows the marker-file + hook gating pattern.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code:pipeline Describe the multi-step process to make reproducible (e.g. 'lint, then test, then release')Describe the multi-step process to make reproducible (e.g. 'lint, then test, then release')The summary Claude sees in its skill listing — used to decide when to auto-load this skill
```text
$ARGUMENTS
When the user invokes /claude-code:pipeline, help them structure a repeatable
multi-step process for the task in $ARGUMENTS. If empty, ask what procedure
they want to make reproducible and whether step order must be enforced or just
documented.
Pick the lightest structure that fits — most pipelines are one skill, not a plugin full of gated commands.
The core question: do steps just need to run in order, or must order be enforced (a later step refuses until an earlier one is done)?
| Your need | Build | Notes |
|---|---|---|
| Steps are instructions Claude follows in sequence | One skill with an ordered procedure | The default. Simplest, reproducible, marketplace-shippable. |
| Each step is heavy (own context, own entry point) | Multiple step commands in one plugin (thing:step-1, thing:step-2) | Split only when a single skill would be too large or each step is invoked separately. |
| Order must be enforced | Skill/commands + hooks + a marker file | Claude Code has no native step ordering — you build it (Step 3). |
| Native ordered tasks, one session | Agent team (task list has dependencies) | A pending task can't be claimed until its deps complete. Experimental, in-session, not a package. |
Custom commands are skills now.
.claude/commands/x.mdand.claude/skills/x/SKILL.mdboth create/x. So "a step" = a skill; a plugin just bundles several of them (plus agents, MCP, hooks) under one namespace.
Default recommendation: one skill containing the ordered steps + a marker file for state. Escalate to multiple commands only when each step is genuinely complex. Escalate to hooks only when order must be guaranteed, not just followed.
A single plugin holds everything the pipeline needs:
plugins/thing/
skills/run/SKILL.md # the ordered procedure (steps 1→3)
scripts/*.sh # write/read .thing/ state markers
agents/*.md # subagent roles a step can delegate to
hooks/hooks.json # the gate (Step 3)
.mcp.json # any MCP servers a step calls
The skill body drives the flow: it runs the bundled scripts to record progress
(.thing/step-1.done) and reads them to decide what's next. Ship subagent
definitions alongside so a step can delegate to them by name.
There is no built-in prerequisite graph — hooks give you the mechanism (block, read state, inject context); you supply the state. The pattern:
mkdir -p .thing && touch .thing/step-1.done
PreToolUse is the earliest
block point; UserPromptSubmit gates at the prompt; Stop keeps the turn
going until done. The hook inspects the filesystem and decides:
#!/usr/bin/env bash
# PreToolUse gate: block step-2 work until step-1 is done
if [ ! -f .thing/step-1.done ]; then
echo '{"hookSpecificOutput":{"hookEventName":"PreToolUse",
"permissionDecision":"deny",
"permissionDecisionReason":"Run /thing:step-1 first."}}'
exit 0
fi
exit 0
additionalContext
("step 1 is not done yet") so Claude self-corrects. Use exit 2 + stderr,
or {"decision":"block","reason":...} on events that support it
(UserPromptSubmit, PostToolUse, Stop, …).For the full hook I/O contract (exit codes, per-event JSON shapes, the prompt-injection trap), use
/claude-code:hook— don't re-derive it here.
A skill advises; it does not guarantee. Bake the fan-out strategy into the skill body, and choose the primitive by how much determinism you need:
| Per-step need | Use | Bake into the skill? |
|---|---|---|
| Offload one noisy side-task; only the summary matters | Subagent | ✅ Fully — write the delegation, ship the agents/*.md definition in the plugin, reference it by name |
| A few workers that must talk/challenge each other | Agent team | ✅ Guidance only — the skill designs the team + spawn prompt (see /claude-code:agent-teams) |
| Deterministic, large-scale fan-out (same orchestration every run) | Workflow | ⚠️ Point at it — the skill tells the user to create/run it via /claude-code:create-workflow; the JS can't ship in the plugin |
The determinism ladder, in one line:
Skill by default (steps + fan-out strategy) → add hooks + markers when order must be enforced → escalate a step to a workflow only when it needs guaranteed heavy fan-out. The skill holds the plan; hooks hold the gate; a workflow holds a step that must run the same way every time.
.claude/workflows/; package the authoring guidance, not the workflow.Skill/command/hook/orchestration behavior shifts across versions. When being wrong would mislead, verify against the canonical docs: skills & commands, hooks, subagents, agent teams, workflows.
npx claudepluginhub nq-rdl/agent-extensions --plugin claude-codeGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.