
huashu-agent-swarm
多Agent蜂群并行协作,纯git自组织,适合大型项目开发。当用户提到"蜂群模式"、"多agent"、"并行开发"、"agent swarm"时使用。
- Installs
- 665
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/alchaincyf/huashu-skills --skill huashu-agent-swarm- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads huashu-agent-swarm automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Infinite Agent Loop - 无限Agent蜂群模式
受Nicholas Carlini用16个Claude实例自主构建C编译器的启发。 没有master agent,纯git自组织,每个agent独立认领任务、写代码、推送。
触发条件
当用户提到「蜂群模式」「多agent并行」「infinite loop」「agent swarm」「启动蜂群」时使用此技能。
前置要求
- tmux(
brew install tmux) - claude CLI(已安装)
- git 仓库(已有或新建)
使用流程
Step 1: 描述项目
用户告诉我:
- 项目目录路径(必须是git仓库)
- 项目目标和总体描述
- 初始任务列表(或让agent自行拆解)
- agent数量(默认8个)
- 代码规范和测试命令
Step 2: 初始化项目
bash SKILL_DIR/scripts/setup_project.sh <项目目录>
这会在项目中创建:
AGENT_PROMPT.md- 从模板生成,需要我根据用户需求定制TASKS.md- 初始任务清单current_tasks/- 任务认领目录agent_logs/- 日志目录
然后我根据 references/agent-prompt-template.md 定制 AGENT_PROMPT.md,填入项目具体信息。
Step 3: 启动蜂群
bash SKILL_DIR/scripts/start_swarm.sh <agent数量> <项目目录>
这会:
- 为每个agent创建 git worktree(共享.git对象库,不浪费磁盘)
- 创建 tmux session,每个pane一个agent
- 每个agent进入无限循环:pull → 认领任务 → 执行 → push → 下一个
Step 4: 打开观测台
python3 SKILL_DIR/scripts/dashboard.py <项目目录> 8420
浏览器打开 http://localhost:8420,可以:
- 实时查看所有agent状态、git log、任务进度
- 查看每个agent的最新日志
- 输入框直接发送指令给agent(写入HUMAN_INPUT.md)
- 一键停止所有agent
也可以用命令行监控:
# 终端状态
bash SKILL_DIR/scripts/status.sh <项目目录>
# 发送指令
bash SKILL_DIR/scripts/send_input.sh <项目目录> "你的指令"
# 直接进入tmux观察
tmux attach -t swarm-<项目名>
Step 5: 停止
bash SKILL_DIR/scripts/stop_swarm.sh <项目目录>
自动停止所有agent + 合并分支 + 清理worktrees。
核心机制
Git自组织协调
- 每个agent通过
current_tasks/*.lock文件认领任务 - 通过
TASKS.md了解全局进度 - 通过
git log了解其他agent的工作 - 冲突由agent自行解决
Git Worktree隔离
- 不用多份clone,用
git worktree实现隔离 - 所有worktree共享同一个
.git对象库 - 每个agent在自己的worktree独立工作
无限循环
- 每个agent完成一个session后自动开始下一个
- 通过
git pull获取其他agent的最新成果 - 通过 sleep 间隔避免API限流
关键配置
| 参数 | 默认值 | 说明 |
|---|---|---|
| agent数量 | 8 | 可在启动时指定 |
| sleep间隔 | 5秒 | agent_loop.sh中可调 |
| 模型 | claude-opus-4-6 | agent_loop.sh中可调 |
风险和应对
| 风险 | 应对 |
|---|---|
| API限流 | sleep间隔 + 可调agent数量 |
| 合并冲突 | AGENT_PROMPT指导小粒度commit |
| 死循环无用功 | 日志监控 + 停止条件 |
| 磁盘空间 | stop_swarm.sh自动清理 |
| 成本失控 | 可在AGENT_PROMPT中限制session数 |
花叔出品 | AI Native Coder · 独立开发者 公众号「花叔」| 30万+粉丝 | AI工具与效率提升 代表作:小猫补光灯(AppStore付费榜Top1)·《一本书玩转DeepSeek》
FAQ
What does the huashu-agent-swarm skill do?
多Agent蜂群并行协作,纯git自组织,适合大型项目开发。当用户提到"蜂群模式"、"多agent"、"并行开发"、"agent swarm"时使用。
How do I install huashu-agent-swarm?
Run npx skills add https://github.com/alchaincyf/huashu-skills --skill huashu-agent-swarm in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/huashu-agent-swarm/ (personal) or .claude/skills/huashu-agent-swarm/ (project).
Which AI agents can use huashu-agent-swarm?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is huashu-agent-swarm safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains huashu-agent-swarm?
It is published by alchaincyf in alchaincyf/huashu-skills. It has 665 recorded installs.
More from alchaincyf/huashu-skills
huashu-md-to-pdf
alchaincyf/huashu-skills
将 Markdown 文档转换为专业的 PDF 白皮书,采用苹果设计风格。 支持完整的 Markdown 语法(代码块、表格、引用、列表等)。 自动生成封面、目录、页眉页脚。 使用场景:技术文档、白皮书、教程、报告等需要专业排版的 Markdown 文档。
huashu-douyin-script
alchaincyf/huashu-skills
抖音爆款脚本创作工作流。从竞品视频拆解到脚本生成的完整流程:下载抖音视频→Gemini视频分析→爆款公式提炼→脚本+分镜生成→AI味审校。 当用户提到"抖音脚本"、"爆款拆解"、"竞品分析"、"带货脚本"、"千川素材"、"种草脚本"、"视频拆解"、"抖音视频分析"时使用此技能。
huashu-proofreading
alchaincyf/huashu-skills
三遍审校降低AI检测率,让文章更有人味。当用户提到"AI味太重"、"像AI写的"、"降低AI检测率"、"审校"、"自然一些"时使用。
huashu-slides
alchaincyf/huashu-skills
从内容到成品PPTX的端到端演示文稿制作,含AI插画生成和18种设计风格。当用户提到"做PPT"、"做幻灯片"、"演示文稿"、"Keynote"、"slides"时使用。
huashu-design
alchaincyf/huashu-skills
设计哲学顾问,从20种风格中推荐3个方向并生成视觉Demo和AI提示词。当用户提到"设计风格"、"设计方向"、"配色方案"、"视觉风格"、"设计评审"、"推荐风格"时使用。
huashu-research
alchaincyf/huashu-skills
结构化网络调研流程,确保调研成果增量保存到文件,不因会话截断丢失。当用户说"调研"、"搜索资料"、"帮我查一下"、"了解一下"、"最新信息"时使用此技能。
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.