원클릭으로
swarm-pipeline
Pipeline and task-graph orchestration. Sequential stages with dependency edges — linear chain or arbitrary DAG.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Pipeline and task-graph orchestration. Sequential stages with dependency edges — linear chain or arbitrary DAG.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Fan-out parallel specialists for concurrent analysis. Dispatch read-only reviewers, researchers, and analyzers against a target.
Dispatch a swarm using any orchestration pattern. Routes to the appropriate pattern-specific skill based on the selected preset.
Map-reduce orchestration. Parallel mappers process input chunks independently, then a dedicated reducer merges all outputs.
Speculative orchestration. Competing implementations in isolated worktrees, evaluated by a judge who selects the winner.
Self-claiming pool orchestration. Workers race to claim tasks from a shared pool, loop until the pool is empty.
| name | swarm-pipeline |
| description | Pipeline and task-graph orchestration. Sequential stages with dependency edges — linear chain or arbitrary DAG. |
This skill is invoked by the
swarmdispatcher. You should already have the goal, target, and selected roles from the dispatcher. If invoked directly, start from step 1.
Orchestrate sequential stages with dependency edges. Handles two config shapes:
pattern: pipeline with stages array — linear chain where
each stage blocks the next. Stages support multiple roles.pattern: task-graph with nodes map — arbitrary DAG with
depends_on edges supporting fan-in and fan-out. Each node has
a single role (not a list).Pipeline is a degenerate task-graph (linear topology). Both use the
same blocks/blockedBy primitives for automatic stage
transitions.
You MUST complete these steps in order:
Determine from the user's request (or dispatcher context):
If unclear, ask the user. Do not guess scope.
Read $CLAUDE_PLUGIN_ROOT/config/swarm-roles.yaml to get the
preset config.
Determine the topology:
stages array → pipeline (linear chain)nodes map → task-graph (arbitrary DAG)The dispatcher has already validated config shape (role existence,
required fields, subagent_type values). The checks below cover
pipeline/task-graph-specific semantics.
stages[].roles list must contain
at least 1 entry. A stage with no roles would block the relay
indefinitely. If empty, report the error and abort.depends_on references
do not create cycles. If cycles found, report the error and abort.depends_on entries must
reference existing node names.stages)Convert the linear stages array into a dependency chain:
stage[0] → stage[1] → stage[2] → ...
Each stage blocks the next. Stages with multiple roles create parallel tasks within the stage (fan-out within a stage, sequential between stages).
nodes)Read each node's depends_on list to build the DAG:
analyze → migrate-users ──→ validate
→ migrate-orders ──↗
All graph validation (cycles, dangling references) was completed in step 2. This step is construction only — do not re-validate here.
Only one team can exist per session. Before creating a new team, check if one already exists.
If a team exists:
TeamDelete)./resume): agents
from the previous session are gone but the team and task list
persist. Offer the user two options:
TeamDelete the orphaned team, then
proceed with a fresh swarm.TaskList for completed
tasks, synthesize any available findings from completed tasks,
then TeamDelete and optionally re-run incomplete tasks.Present the dispatch plan using AskUserQuestion:
I'll dispatch a {pipeline|task-graph} with these stages:
Stage 1: {name} — {roles}
↓
Stage 2: {name} — {roles} (blocked by: stage 1)
↓
Stage 3: {name} — {roles} (blocked by: stage 2)
Target: {files/scope}
Proceed?
For task-graph, show the DAG structure with dependency arrows.
Do NOT spawn anything until the user confirms.
swarm-pipeline-{goal-slug}-{timestamp}swarm-task-graph-{goal-slug}-{timestamp}Generate the timestamp from the current date/time as a Unix epoch.
TeamCreate with team_name: "swarm-{topology}-{goal-slug}-{ts}"
One task per role per stage/node via TaskCreate:
subject: imperative title including stage namedescription: detailed scope, target, stage context, reporting
expectationsactiveForm: present-continuous spinner labelSet dependencies via TaskUpdate:
addBlockedBy pointing to
the previous stage's tasksaddBlockedBy matching
the node's depends_on referencesFirst stage / root nodes have no blockers — they start immediately.
Relay tasks — one per stage transition via TaskCreate:
subject: "Relay stage {N} findings to stage {N+1}"description: "Collect findings from stage {N} agents, forward
to stage {N+1} agents via SendMessage, wait for acknowledgment"activeForm: "Relaying stage {N} findings"addBlockedBy: all task IDs from stage N — relay auto-unblocks
when the source stage completesaddBlockedBy
list of stage N+1's agent tasks (in addition to stage N's tasks)This makes relay a visible, trackable step in the task list. The lead claims and completes relay tasks as part of step 8.
For each role in each stage/node, spawn one agent via Agent with:
team_name: the team name from step 6name: {stage-name}-{role-name} (e.g., implement-implementer)subagent_type: from the role configmodel: from the role config (if specified)isolation: from the role config (if specified — see isolation
handling below)run_in_background: trueprompt: composed from the parts belowBefore spawning, check each role's isolation field:
isolation: worktree is set:
subagent_type to general-purposeRole {name}: using general-purpose (worktree isolation requires write access)isolation: "worktree" to the Agent tool callisolation is absent: use the role's subagent_type as-isYour name is {name}. You are part of team {team_name}.
You are working on stage "{stage-name}" of a {pipeline|task-graph}.
Instructions:
- Claim your task from TaskList, mark it in_progress, then
completed when done.
- Send your findings to the team lead via SendMessage when
complete.
- Include a summary field in your message (5-10 words).
Your task may be blocked by earlier stages. When it unblocks, do
NOT claim it immediately. Wait for the team lead to send you a
"start" message via SendMessage containing upstream findings.
Only claim your task and begin work AFTER receiving the lead's
start message.
First-stage agents (no blockers): claim your task immediately.
The prompt field from swarm-roles.yaml for this role.
## Goal
{goal description from user}
## Target
{target files, scope, or context}
## Upstream Context
{forwarded findings from completed predecessor stages — empty for
first stage, populated by lead relay in step 8}
{any additional context the user provided}
This is the lead's core responsibility in pipeline orchestration.
When a stage completes (all its tasks are done and agents have sent findings):
TaskCreate:
subject: "Relay stage {N} findings to stage {N+1}"description: summary of what to forwardactiveForm: "Relaying stage findings"addBlockedBy: all task IDs from the completed stageSendMessage — include the stage name and a summary of what
was done. End the message with: "You may now claim your task
and begin work."SendMessage before marking the relay task completedDo NOT proceed to the next relay until downstream agents have acknowledged. If an agent does not acknowledge, nudge it.
isolation: worktree): each
stage works on the branch from the previous stage. The lead
includes the branch name in the forwarded context so the next
stage can check it out.As each stage completes, its agents send findings via
SendMessage. The lead accumulates findings across all stages.
Normal flow: stages complete sequentially (or per the DAG). Each stage's agents go idle after sending.
Error handling:
Once all stages are complete:
Synthesize findings into a unified report that shows the progression through stages.
## Pipeline Analysis Report
**Goal:** {goal}
**Target:** {target}
**Topology:** {pipeline|task-graph}
### Stage: {stage-1-name}
{findings from stage 1}
### Stage: {stage-2-name}
{findings from stage 2, including how they built on stage 1}
...
### Summary
{brief overall assessment — how the pipeline progressed and
final outcome}
After presenting the report:
Wait for the user to decide next steps.
When the user indicates they're done:
shutdown_request to each agent via SendMessage
(include the monitor agent if watchdog: true was active)shutdown_response from each. If an agent does not
respond after a reasonable wait, send one nudge message. If
still unresponsive, proceed — the agent may have crashed or
terminated.TeamDelete to clean up. TeamDelete is the authoritative
cleanup mechanism — it will fail if active agents remain. If
it fails, retry after unresponsive agents have timed out.