← 返回
未分类 中文

Swarm Sprint

Parallel multi-agent coding sprints using git worktree isolation. Use when running 2+ coding tasks on a repository that touch different parts of the codebase...
使用 git worktree 隔离实现并行多智能体编程冲刺。适用于在同一仓库中同时运行 2 个以上、涉及不同代码区域的编码任务。
jdh3 jdh3 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 315
下载
💾 0
安装
1
版本
#latest

概述

Swarm — Parallel Coding Sprints

Parallel multi-agent coding sprints using git worktree isolation.

When to Use

  • 2+ tasks touching different parts of the codebase → use swarm
  • 1 task → do it directly, no swarm needed
  • 2+ tasks ALL touching schema/auth → serialize them (swarm handles this automatically)

Trigger phrases: "Run a swarm sprint", "Parallel sprint on [repo]", "Use swarm for these tasks"

The Golden Rule — Always Plan First

Before spawning any agents, run the conflict analyzer:

node <skill-dir>/scripts/swarm.js --repo <repo_path> --tasks tasks.json --plan-only

Read the output:

  • ✓ No conflicts → all tasks run in parallel
  • ⚠ HIGH conflict → affected tasks auto-serialized into separate groups
  • LOW conflict → runs parallel, watch the merge

Never skip this step. Two agents modifying the same file = merge conflict = wasted work.

Workflow

1. Write tasks.json

[
  {
    "id": "short-unique-id",
    "description": "Exactly what to build — be specific",
    "role": "coder",
    "successCriteria": ["Specific outcome", "TypeScript compiles clean"]
  }
]

2. Run conflict analysis (mandatory)

node <skill-dir>/scripts/swarm.js --repo <repo_path> --tasks tasks.json --plan-only

3. Create worktrees

node <skill-dir>/scripts/swarm.js --repo <repo_path> --tasks tasks.json

Creates isolated git worktree + branch per task. Writes swarm-packages.json.

4. Spawn subagents

Read swarm-packages.json. For each package, spawn a subagent with:

  • Working directory = worktreePath
  • Task prompt = instructions field
  • Instruction to stay inside that directory only
  • Instruction to git add -A && git commit before reporting back

5. Review each agent's output

git diff main..swarm/<branch-name>

6. Merge passing work

git merge swarm/<branch-name>

Merge one at a time. Verify TypeScript clean after each.

7. Cleanup (always, no exceptions)

node <skill-dir>/scripts/swarm.js --repo <repo_path> --cleanup swarm-packages.json

Deletes all worktrees and branches. Always run this.

Agent Roles

RoleBehavior
----------------
coderImplements task. No unrelated refactoring. Runs tsc when done.
reviewerReviews diff skeptically. Flags bugs, type errors, missing error handling.
testerWrites tests following existing patterns.

High-Conflict Areas (Auto-Serialized)

  • schema.prisma, migration SQL
  • Auth/session middleware
  • Main router or index registration
  • Shared config/env files

Rules

  • Planning step is mandatory
  • Worktrees always deleted after sprint
  • Never push from a worktree — coordinator handles git
  • Reviewer role should use cheaper model (Haiku); coder uses Sonnet
  • Max 5 parallel agents
  • Sprint log written to memory/swarm-log.md

Dry Run

node <skill-dir>/scripts/swarm.js --repo <repo_path> --tasks tasks.json --dry-run

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 20:12 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

suspicious
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,131 📥 903,790
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 851 📥 332,107
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,245 📥 272,079