ワンクリックで
swarm-swarm
Self-claiming pool orchestration. Workers race to claim tasks from a shared pool, loop until the pool is empty.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Self-claiming pool orchestration. Workers race to claim tasks from a shared pool, loop until the pool is empty.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
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.
Pipeline and task-graph orchestration. Sequential stages with dependency edges — linear chain or arbitrary DAG.
Speculative orchestration. Competing implementations in isolated worktrees, evaluated by a judge who selects the winner.
SOC 職業分類に基づく
| name | swarm-swarm |
| description | Self-claiming pool orchestration. Workers race to claim tasks from a shared pool, loop until the pool is empty. |
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 a pool of interchangeable workers that self-assign from a shared task list. Workers claim tasks, complete them, and loop back for more until the pool is empty.
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.
From the preset, determine:
worker_role: the role all workers share (default:
researcher)worker_count: how many concurrent workers to spawn
(default: 3)The dispatcher has already validated config shape (role existence,
required fields, subagent_type values, numeric ranges). The checks
below cover swarm-specific semantics.
worker_count > 7, warn the user that large
swarms may hit context limits and recommend 3-5 workers.Analyze the target to determine discrete work units. Each work unit becomes one task in the pool:
The number of tasks can (and often should) exceed the worker count. Workers will loop through the pool.
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 swarm with these parameters:
- Worker role: {role name}
- Worker count: {N}
- Task pool: {M} tasks
- Target: {files/scope}
Tasks:
1. {work unit 1}
2. {work unit 2}
...
Proceed?
Do NOT spawn anything until the user confirms.
Use format: swarm-swarm-{goal-slug}-{timestamp}
Generate the timestamp from the current date/time as a Unix epoch.
TeamCreate with team_name: "swarm-swarm-{goal-slug}-{timestamp}"
One task per work unit via TaskCreate:
subject: imperative title for the work unitdescription: detailed scope, specific files/modules, reporting
expectationsactiveForm: present-continuous spinner labelAll tasks are independent — no blocks/blockedBy dependencies.
No owner assigned — workers self-claim.
Spawn N worker agents via Agent with:
team_name: the team name from step 6name: worker-{n} (e.g., worker-1, worker-2)subagent_type: from the worker role configmodel: from the worker role config (if specified)run_in_background: trueprompt: composed from the parts belowBefore spawning, check the worker 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 a pool worker. Your workflow is a loop:
1. Check TaskList for unclaimed tasks (status: pending, no owner)
2. Claim one by setting yourself as owner and marking it in_progress
3. Verify the claim: call TaskGet on the task you claimed. If the
owner is not your name, another worker claimed it first — go back
to step 1
4. Complete the work described in the task
5. Send your findings to the team lead via SendMessage
- Include a summary field (5-10 words)
- Include the task subject in your message
6. Mark the task as completed
7. Go back to step 1
When no unclaimed tasks remain, go idle.
The prompt field from swarm-roles.yaml for the worker role.
## Goal
{goal description from user}
## Target
{target scope — workers will self-select from the task pool}
{any additional context the user provided}
Workers send findings via SendMessage after each task they
complete. Messages are delivered automatically.
Normal flow: Workers loop through multiple tasks, sending findings after each. Workers go idle when the pool is empty.
Error handling:
Once all tasks are completed (or you've noted stuck ones):
Synthesize findings into a unified report organized by theme or severity, not by worker or task.
## Swarm Analysis Report
**Goal:** {goal}
**Target:** {target}
**Workers:** {N workers, M tasks completed}
### Critical Issues
{findings rated critical/high, with file:line references}
### Important Issues
{findings rated medium/important}
### Suggestions
{lower-priority findings and recommendations}
### Summary
{brief overall assessment — 2-3 sentences}
After presenting the report:
Wait for the user to decide next steps.
When the user indicates they're done:
shutdown_request to each worker 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.