Plugin de Claude Code · código abiertoClaude Code plugin · open source

SWARM descubre, analiza, diseña, implementa, entregadiscovers, analyzes, designs, implements, delivers

Transcripción de una ejecución real de /swarm:run: el enjambre descubre, diseña, implementa con TDD y para en un gate de aprobación antes de entregar.Transcript of a real /swarm:run: the swarm discovers, designs, implements with TDD and stops at an approval gate before delivery.

$ /swarm:run "añade export CSV al listadoadd CSV export to the list"
→ orchestrator (judgement) · tier: full
→ discovery-orchestrator · 4 preguntasquestions
→ design-orchestrator · review panel · blind-judge
→ test-writer RED → implementer GREEN
→ review panel (diff) · verifier → GATE
✓ 3/3 fases, worktree aislado, sin mergear todavíaphases, isolated worktree, not merged yet
44agentesagents
3tiers de modelomodel tiers
7/10umbral del juez ciegoblind-judge threshold
−58%tokens por run típico vs v0.1tokens per typical run vs v0.1
1punto de entradaentry point
MIT, código abiertoMIT, open source sin paso de buildno build step corre en local, sobre tu reporuns locally, on your repo

Un equipo de software sénior, en un comando. A senior software team, in one command. 44 agentes de responsabilidad única que descubren, analizan, diseñan, implementan y entregan: un panel de revisión puntúa cada plan y cada diff, TDD en worktree aislado y un verificador que nunca construyó lo que revisa. Sobre tu repo, en local. 44 single-responsibility agents that discover, analyze, design, implement and deliver: a review panel scores every plan and every diff, TDD in an isolated worktree, and a verifier that never built what it checks. On your repo, locally.

fig. 1 · el flujo completofig. 1 · the full flow

  1. 01
    objetivoobjective
    Escribes lo que quieres, tal cual. Si es ambiguo, el gate de interpretación te pregunta en lenguaje llano antes de decidir nada. Después el orquestador clasifica el tier: direct (responde sin abrir run), light o full.You write what you want, as-is. If it's ambiguous, the interpretation gate asks in plain language before deciding anything. Then the orchestrator classifies the tier: direct (answers without opening a run), light or full.
    GATE · pregunta solo si hace faltaGATE · asks only when needed
  2. 02
    memoria unificadaunified memory
    memory-orchestrator · mechanical comprueba un hash del repo. Si no cambió, reusa el context-pack ya construido; si cambió,checks a hash of the repo. If it didn't change, it reuses the already-built context-pack; if it did, memory-builder · mechanical lo re-escanea UNA vez. Ningún otro agente vuelve a leer el repo entero.rescans it ONCE. No other agent reads the whole repo again. 1 escaneo, compartido por todos los agentes del run1 scan, shared by every agent in the run
  3. 03
    discovery
    Preguntas de producto al owner en UNA tanda: nunca un interrogatorio.Product questions to the owner in ONE batch, never an interrogation.
  4. 04
    análisisanalysis
    7 lentes de auditoría read-only (arquitectura, seguridad, rendimiento, datos, SOLID…). Se lanzan solo las que el objetivo necesita, nunca las 7 a la vez.7 read-only audit lenses (architecture, security, performance, data, SOLID…). Only the ones the objective needs run, never all 7 at once.
  5. 05
    diseño + specdesign + spec
    pattern-advisor + domain-modeler informan afeed planner · judgement, que escribe el plan en un fichero versionado — no se queda solo en la conversación., which writes the plan to a versioned file — never left sitting only in the conversation.
  6. 06
    panel de revisiónreview panel
    review-orchestrator lanza lentes independientes de un solo objetivo —completeness-critic, fact-checker, simplicity-critic y las tres de grill (arquitecto, operador, ingeniero)— ANTES de escribir código. Un script determinista deduplica, refuter ataca cada hallazgo bloqueante y blind-judge puntúa de 0 a 10 con un modelo distinto al del autor.launches independent single-objective lenses — completeness-critic, fact-checker, simplicity-critic and the three grill lenses (architect, operator, engineer) — BEFORE any code is written. A deterministic script dedups, refuter attacks every blocking finding and blind-judge scores 0-10 on a model other than the author's. ↺ no es lineal:not linear: por debajo de 7 es KO y el plan vuelve al paso 05; máximo dos rondas, un segundo KO escala al owner.below 7 is a KO and the plan goes back to step 05; at most two rounds, a second KO escalates to the owner.
    GATE · juez ciego ≥ 7/10GATE · blind judge ≥ 7/10
  7. 07
    TDD RED → GREEN
    test-writer → implementer · standard Test primero. Una fase del plan por invocación, en worktree aislado —nunca sobre tu rama activa—; migration-engineer y doc-writer solo si la fase los necesita, y quality-fixer corre los --fix deterministas.Test first. One plan phase per invocation, in an isolated worktree — never on your active branch —; migration-engineer and doc-writer only when the phase needs them, and quality-fixer runs the deterministic --fixes.
  8. 08
    revisiónreview
    El mismo panel revisa el diff en el worktree aislado, con juez ciego incluido, antes del merge local a la rama del run — nunca sobre tu rama.The same panel reviews the diff in the isolated worktree, blind judge included, before the local merge to the run's branch — never on your branch. ↺ tampoco es lineal:not linear either: hasta 2 rondas de arreglo con el paso 07 antes de fusionar.up to 2 rounds of fixes with step 07 before merging.
  9. 09
    verificaciónverification
    verifier · judgement, un agente read-only que NUNCA construyó lo que revisa, comprueba que el veredicto del dominio sale de hallazgos reales persistidos. Un KO devuelve el trabajo una vez; un segundo KO cierra el run BLOCKED en vez de en un verde falso., a read-only agent that NEVER built what it checks, confirms the domain's verdict traces to real persisted findings. A KO sends the work back once; a second KO closes the run BLOCKED instead of in a false green.
    GATE · independiente de quien ejecutóGATE · independent of who executed
  10. 10
    entregadelivery
    Push y PR solo por invocación explícita y separada, tras una aprobación que nombra remoto, rama y base. swarm nunca mergea la PR.Push and PR only by a separate, explicit invocation, after an approval that names remote, branch and base. swarm never merges the PR.
    GATE · el owner apruebaGATE · the owner approves

fig. 2 · los 44 agentesfig. 2 · the 44 agents

Cómo funciona, en diagramasHow it works, in diagrams

Diagramas interactivos hechos con Archify, sacados del propio repo: recorre los caminos, haz zoom o ábrelos a pantalla completa.Interactive diagrams built with Archify, taken from the repo itself: trace the paths, zoom in, or open them full screen.

Diagrama de la arquitectura de swarm: el orquestador raíz, los siete dominios con sus agentes hoja, el panel de revisión y el verificador independiente.Diagram of swarm's architecture: the root orchestrator, the seven domains with their leaf agents, the review panel and the independent verifier.
fig. 1Arquitectura de agentesAgent architectureAbrir interactivo ↗ (pestaña nueva)Open interactive ↗ (new tab)
Diagrama de flujo de /swarm:run: interpretación del objetivo, clasificación de tier (direct, light o full), memoria, discovery con una sola tanda de preguntas y cierre.Flow diagram of /swarm:run: objective interpretation, tier classification (direct, light or full), memory, discovery with one batch of questions, and close.
fig. 2El flujo de /swarm:runThe /swarm:run flowAbrir interactivo ↗ (pestaña nueva)Open interactive ↗ (new tab)
Diagrama de cómo toda escritura en .swarm/ pasa por una única instancia de memory-orchestrator con lock, y cómo cada mensaje se refleja en el buzón del destinatario.Diagram of how every write to .swarm/ goes through a single memory-orchestrator instance with a lock, and how each message is mirrored to the recipient's mailbox.
fig. 3Escritura de memoria y buzónMemory write and mailboxAbrir interactivo ↗ (pestaña nueva)Open interactive ↗ (new tab)
Diagrama de los stack packs: memory-builder detecta el pack una vez (por ejemplo php-ddd-symfony8) y envía su cabecera a las ocho hojas pack-aware; sin pack, el stack queda como generic.Diagram of stack packs: memory-builder detects the pack once (for example php-ddd-symfony8) and sends its header to the eight pack-aware leaves; without a pack, the stack stays generic.
fig. 4Stack packsStack packsAbrir interactivo ↗ (pestaña nueva)Open interactive ↗ (new tab)
Diagrama del flujo de un stack pack propio: detección una vez por run, resolución de la ruta del pack y cómo lo consumen las ocho hojas, env-checker y los asesores de diseño.Diagram of your own stack pack's flow: detection once per run, resolving the pack path, and how the eight leaves, env-checker and the design advisors consume it.
fig. 5Crear un stack packWriting a stack packAbrir interactivo ↗ (pestaña nueva)Open interactive ↗ (new tab)
0.2.2 · ampliado en 0.2.40.2.2 · extended in 0.2.4

Proporcional por diseñoProportional by design

/swarm:run dimensiona el objetivo con un vistazo barato al repo antes de tocar nada: una pregunta de solo-lectura se responde en nativo, sin subagentes ni .swarm/; un cambio acotado trae solo el componente puntual que su valor justifica. Cada spawn y cada skip queda en el log con su motivo, en el formato real de sizing.md./swarm:run sizes the goal with a cheap look at the repo before touching anything: a read-only question is answered natively, no subagents or .swarm/; a bounded change pulls only the one component its value justifies. Every spawn and every skip is logged with its reason, in sizing.md's real log format.

Diagrama de una pregunta de solo análisis respondida en nativo con Read y Grep: sizing decide «direct», sin subagentes, orchestrator, .swarm/ ni paneles de revisión — ejecución real medida en 23,5 s y $0,36.Diagram of an analysis-only question answered natively with Read and Grep: sizing decides 'direct', no subagents, orchestrator hop, .swarm/ or review panels — measured real run: 23.5s and $0.36.
fig. 6swarm al 1% — pregunta / análisis1% swarm — question / analysisAbrir interactivo ↗ (pestaña nueva)Open interactive ↗ (new tab)
Diagrama de una feature acotada donde Claude planifica e implementa en nativo y el enjambre solo trae el context pack, security-auditor y el juez ciego sobre el plan, cada uno con su motivo de spawn; ejemplo ilustrativo, no una ejecución medida.Diagram of a bounded feature where Claude plans and implements natively and the swarm pulls only the context pack, security-auditor and the blind judge on the plan, each with its spawn reason; illustrative example, not a measured run.
fig. 7swarm al ~20% — añadir login~20% swarm — add loginAbrir interactivo ↗ (pestaña nueva)Open interactive ↗ (new tab)

Medido una vez, sin valor de benchmark: una pregunta pequeña de solo lectura se resolvió en nativo en 23,5 s y 0,36 $, sin subagentes y sin tocar ficheros. Antes, una pregunta de análisis mayor lanzaba el pipeline completo (356 s, 4,28 $). Son preguntas distintas, así que no es una comparativa. Falta medir swarm frente a Claude nativo en una tarea grande, que es para lo que está pensado.Measured once, not a benchmark: a small read-only question was answered natively in 23.5 s and $0.36, with no subagents and no files touched. Before, a larger analysis question launched the full pipeline (356 s, $4.28). The questions differ, so this is not a comparison. Swarm versus native Claude on a large task, which is what it is built for, has not been measured yet.

0.2.4, tras un run real que lanzó 18 agentes para escribir un solo plan: si el entregable es un plan, corre solo planner y una ronda de panel; el orquestador raíz nunca escribe el artefacto; discovery puede lanzar solo la investigación, sin preguntas; y la segunda ronda del panel comprueba los bloqueos de la primera en vez de revisar desde cero. Estas rutas tienen tests en scripts y hook, pero aún no están medidas en un run real.0.2.4, after a real run that launched 18 agents to write one plan: when the deliverable is a plan, only planner and one panel round run; the root orchestrator never writes the artifact; discovery can launch research alone, with no questions; and the panel's second round checks the first round's blockers instead of reviewing from scratch. These routes have tests on scripts and hook, but are not yet measured on a real run.

Novedad en 0.2New in 0.2

Ningún agente nombra un modelo.No agent names a model.

Cada agente declara un tier; qué modelo corre cada tier vive en un solo fichero, models.json, y un script determinista lo resuelve — nunca lo adivina un modelo. Un .swarm/models.json lo sobreescribe por repo, que es como otro host mapea los tiers a sus propios modelos.Each agent declares a tier; which model runs each tier lives in a single file, models.json, and a deterministic script resolves it — a model never guesses. A .swarm/models.json overrides it per repo, which is how another host maps tiers to its own models.

29judgement

Auditar, revisar, juzgar, planificar, orquestar. Nunca cae al modelo de un tier más débil: si se agota la lista, hereda el de la sesión.Audit, review, judge, plan, orchestrate. It never falls to a weaker tier's model: an exhausted list inherits the session model.

8standard

Ejecutar un plan cerrado: escribir código, tests y docs. Si su salida no pasa la verificación, reintenta una vez escalando de tier.Execute a closed plan: write code, tests and docs. If its output fails verification, it retries once on an escalated tier.

7mechanical

Correr scripts, curar memoria, recoger datos del entorno. Lo determinista lo hace un script; el modelo solo el residuo.Run scripts, curate memory, collect environment facts. What's deterministic is done by a script; the model only handles the residue.

El juez ciego se resuelve con --avoid el modelo del autor; si la independencia no se puede demostrar, el panel lo dice en su salida en vez de callarlo.The blind judge is resolved with --avoid the author's model; when independence can't be proven, the panel says so in its output instead of hiding it.

Coste, medidoCost, measured

Núcleo corto, el resto bajo demanda.A short core, the rest on demand.

Cada agente carga solo su fichero núcleo y el skill de protocolo. Lo que necesita solo a veces vive en ficheros que lee cuando una línea WHEN <condición> → Read <ruta> se dispara. Es un invariante con test: un fichero bajo demanda al que nadie apunta, o un núcleo que se pasa de su presupuesto de líneas, rompe la suite.Each agent loads only its core file and the protocol skill. What it needs only sometimes lives in files it reads when a WHEN <condition> → Read <path> line fires. It's a tested invariant: an on-demand file nothing points to, or a core file over its line budget, fails the suite.

Tokens por run típico antes y después de separar núcleo y material bajo demandaTokens per typical run before and after splitting core and on-demand material
MétricaMetricantesbeforeahoranow
SKILL.md, precargado en cada agenteSKILL.md, preloaded into every agent398 líneas398 lines118 líneas118 lines
Ficheros bajo demandaOn-demand files134
Run típico, totalTypical run, total~147,8k tok~147.8k tok~61,8k tok~61.8k tok −58%
Coste always-on, cada sesión (antes de llamar a swarm) · 0.2.0 → 0.2.1Always-on cost, every session (before any swarm call) · 0.2.0 → 0.2.1~3.581 tok~3,581 tok~1.196 tok~1,196 tok −67%

Medido, no estimado: del commit a07e655 a a39cbd4, según la sección «Cost» del README (el coste always-on, con claude plugin details). Presupuestos: hoja ≤80 líneas, orquestador de dominio ≤150, raíz ≤370, SKILL.md ≤120. Tokens por run medidos en el commit a39cbd4, sin volver a medir desde entonces. Claude Code 2.1.292 informa ~1.838 tok de coste always-on para 0.2.3: cambió su estimación, el texto de las descripciones no creció.Measured, not estimated: from commit a07e655 to a39cbd4, per the README's "Cost" section (the always-on cost, via claude plugin details). Budgets: leaf ≤80 lines, domain orchestrator ≤150, root ≤370, SKILL.md ≤120. Tokens per run were measured at commit a39cbd4 and not re-measured since. Claude Code 2.1.292 reports ~1,838 tok of always-on cost for 0.2.3: its estimate changed, the description text did not grow.

No hace falta que sepas leer el código.You don't need to read code.

Describe lo que quieres.Describe what you want. Si el objetivo es ambiguo, swarm te pregunta en lenguaje llano antes de empezar.If the goal is ambiguous, swarm asks in plain language before starting.

Nada se mergea sin que tú lo apruebes.Nothing merges without your approval. Cada gate (push, entrega, decisiones importantes) te pregunta primero.Every gate (push, delivery, important decisions) asks you first.

Confianza, no jerga.Trust, not jargon. Las preguntas hablan de impacto de negocio, nunca de vocabulario interno del proyecto.Questions speak in business impact, never in internal project vocabulary.

InstalaciónInstall

Local, en dos minutos.Local, in two minutes.

$ /plugin marketplace add davidgarciagordo/swarm
$ /plugin install swarm@swarm
$ /swarm:run "<lo que quieraswhatever you want>"

O desde el catálogo: $ /plugin marketplace add davidgarciagordo/claude-plugins → $ /plugin install swarm@davidgarciagordo-plugins. Sin marketplace: $ claude --plugin-dir /ruta/a/swarmOr from the catalog: $ /plugin marketplace add davidgarciagordo/claude-plugins → $ /plugin install swarm@davidgarciagordo-plugins. Without a marketplace: $ claude --plugin-dir /path/to/swarm