alchaincyf/huashu-skills / huashu-agent-swarm
huashu-agent-swarm
Verified多Agent蜂群并行协作,纯git自组织,适合大型项目开发。当用户提到"蜂群模式"、"多agent"、"并行开发"、"agent swarm"时使用。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 3.6 KB |
| references/agent-prompt-template.md | markdown | 4.1 KB |
| references/carlini-lessons.md | markdown | 3.3 KB |
| scripts/agent_loop.shexecutable | script | 2.8 KB |
| scripts/dashboard.pyexecutable | script | 20.6 KB |
| scripts/send_input.shexecutable | script | 1.0 KB |
| scripts/setup_project.shexecutable | script | 2.7 KB |
| scripts/start_swarm.shexecutable | script | 3.3 KB |
| scripts/status.shexecutable | script | 2.7 KB |
| scripts/stop_swarm.shexecutable | script | 2.3 KB |
scripts/stop_swarm.sh
View on GitHub#!/bin/bash
# stop_swarm.sh - 停止所有Agent并清理worktrees
# 用法: bash stop_swarm.sh [项目目录]
PROJECT_DIR="${1:-.}"
PROJECT_DIR="$(cd "$PROJECT_DIR" && pwd)"
PROJECT_NAME="$(basename "$PROJECT_DIR")"
SESSION="swarm-${PROJECT_NAME}"
echo "=== 停止蜂群: $SESSION ==="
# ===== 停止tmux session =====
if tmux has-session -t "$SESSION" 2>/dev/null; then
tmux kill-session -t "$SESSION"
echo "tmux session 已停止"
else
echo "tmux session 不存在(可能已停止)"
fi
# ===== 合并agent分支的成果到main =====
echo ""
echo "检查agent分支的未合并提交..."
cd "$PROJECT_DIR"
MAIN_BRANCH=$(git branch --show-current 2>/dev/null || echo "main")
for dir in "${PROJECT_DIR}"-agent-*; do
[ -d "$dir" ] || continue
AGENT_NUM=$(echo "$dir" | grep -o '[0-9]*$')
BRANCH_NAME="agent-${AGENT_NUM}-work"
# 检查分支是否有未合并的提交
AHEAD=$(git log "${MAIN_BRANCH}..${BRANCH_NAME}" --oneline 2>/dev/null | wc -l | tr -d ' ')
if [ "$AHEAD" -gt 0 ]; then
echo " Agent-${AGENT_NUM}: 有 ${AHEAD} 个未合并提交"
echo " 合并 ${BRANCH_NAME} → ${MAIN_BRANCH}..."
git merge "$BRANCH_NAME" --no-edit 2>/dev/null || {
echo " 警告: 合并冲突,请手动解决"
echo " 运行: git merge $BRANCH_NAME"
}
fi
done
# ===== 清理worktrees =====
echo ""
echo "清理 worktrees..."
for dir in "${PROJECT_DIR}"-agent-*; do
if [ -d "$dir" ]; then
AGENT_NUM=$(echo "$dir" | grep -o '[0-9]*$')
git -C "$PROJECT_DIR" worktree remove "$dir" --force 2>/dev/null || {
echo " 警告: 无法清理 $dir,尝试强制删除..."
rm -rf "$dir"
git -C "$PROJECT_DIR" worktree prune
}
echo " Agent-${AGENT_NUM}: worktree 已清理"
# 删除agent分支
BRANCH_NAME="agent-${AGENT_NUM}-work"
git -C "$PROJECT_DIR" branch -D "$BRANCH_NAME" 2>/dev/null || true
fi
done
git -C "$PROJECT_DIR" worktree prune 2>/dev/null
# ===== 清理lock文件 =====
echo ""
echo "清理 lock 文件..."
rm -f "$PROJECT_DIR/current_tasks/"*.lock 2>/dev/null
echo "lock 文件已清理"
echo ""
echo "=== 蜂群已完全停止 ==="
echo ""
echo "查看成果:"
echo " git -C $PROJECT_DIR log --oneline -20"
echo ""
echo "日志在: $PROJECT_DIR/agent_logs/"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |