Skip to content
AI & Agents
Command

/swarm

Orchestrate a parallel opencode worker swarm on a task (worktree isolation, you merge)

From plugin
claude-skills
30k169 skills127 agents169 commands2 MCP
$ npx -y skills add alirezarezvani/claude-skills --agent claude-code

Command definition

swarm.md
description: Orchestrate a parallel opencode worker swarm on a task (worktree isolation, you merge)
allowed-tools: Bash(git:*), Bash(node:*), Read(*), Edit(*), Grep(*), Glob(*)

You are the ORCHESTRATOR of a free opencode worker swarm. Task: $ARGUMENTS

PHASE 1 - PLAN Decompose the task into 2-5 INDEPENDENT subtasks that do not touch the same files. Choose an agent per subtask: scout (read-only research), coder (writes code), tester (runs tests only).

PHASE 2 - ISOLATE If any subtask writes files: create one git worktree per writing worker: git worktree add "../<repo-name>-wt-N" -b swarm/N Record each worktree path. If no subtask writes files, skip worktrees.

PHASE 3 - SPAWN (PARALLEL) Issue ALL worker invocations as PARALLEL Bash tool calls in ONE message. Each invocation:

node "$HIVEMIND_HOME/scripts/oc-worker.mjs" --agent <agent> --dir <worktree-or-cwd> --timeout 900 "<SUBTASK>"

Notes:

  • scout workers may omit --dir to read THIS repo.
  • coder/tester workers MUST get their own --dir (worktree path).
  • Never run two writing workers against the same directory.

PHASE 4 - REVIEW (you, personally) Each output line contains {result, tokens}. For every writing worker run: git diff main...swarm/N Review the diff yourself line by line. You are the only merger.

PHASE 5 - INTEGRATE

  • Merge approved branches: git merge swarm/N
  • Reject: delete branch + git worktree remove.
  • Run the test suite after all merges.

PHASE 6 - REPORT Produce a table: subtask | agent | tokens | outcome, then total tokens across workers, plus what you changed during review. Flag any worker whose output you rejected and why.

HARD RULES:

  • Worker outputs enter your context ONLY via the script's single compact JSON line.
  • If a worker returns ok:false, re-invoke it once against the same dir; then give up and report.
  • NEVER let raw opencode NDJSON streams reach this conversation.
  • Workers never share directories. You never delegate merging or reviewing.
Read more
@alirezarezvani
Ships withclaude-skills

411 production-ready skills for Claude Code and 12 other coding agents, covering engineering, product, marketing, compliance, finance and the C-suite. We test whether each skill loads when you ask in plain words, and publish the results.

30k200 skills127 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
29.6k
Star history of alirezarezvani/claude-skills on GitHub, a chart by star-history.com

Other commands on claude-skills.

focused-fix

focused-fix

Command

Deep-dive feature repair — systematically fix an entire feature/module across all its files and dependencies. Usage: /focused-fix…

plugin-audit

plugin-audit

Command

Comprehensive audit pipeline for skills, plugins, agents, and commands. Validates structure, quality, security, marketplace…

More commands from other plugins.

devbox-entrypoint

devbox-entrypoint

Command

Context: runloop resumes a devbox by re-running the same entrypoint script, which invokes `cn serve --id <agentId> ...`. Because…

@continuedev@continuedevInstall Command
c

c

Command

Shortcut for "continue working" — pick the work in flight back up exactly where it stopped and keep going until it is done or…

lifeos2w20k
@danielmiessler@danielmiesslerInstall Command
sidecar

sidecar

Command

Spawn a read-only sidecar subagent to investigate something in this checkout without editing files, moving branches, or touching…

@builderio@builderioInstall Command