跳到正文
Skillpedia
智能体29k · #9535

spawn

它能做什么

这项技能为已经设置好的会话启动并行智能体。适合希望每个智能体在同一任务上尝试不同策略的人。

适用场景

  • ✓当会话已设置完成、智能体准备开始工作的时候。
  • ✓当你希望每个智能体在同一任务上尝试不同策略的时候。
  • ✓当你希望智能体遵循优化器、重构器、测试编写者或错误修复者的模式时。

技能链接

https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agenthub/skills/spawn/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agenthub/skills/spawn/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请使用重构器模板,为最近一次会话启动智能体。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会加载会话设置,并为每个工作树用派发提示启动一个智能体。选择模板后,它会采用该模板的模式,并让每个智能体使用不同的策略。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

/agenthub:spawn — Launch Parallel Agents

Spawn N subagents that work on the same task in parallel, each in an isolated git worktree.

Usage

/agenthub:spawn                                    # Spawn agents for the latest session
/agenthub:spawn 20260317-143022                    # Spawn agents for a specific session
/agenthub:spawn --template optimizer               # Use optimizer template for dispatch prompts
/agenthub:spawn --template refactorer              # Use refactorer template

Templates

When --template <name> is provided, use the dispatch prompt from ../agenthub/references/agent-templates.md instead of the default prompt below. Available templates:

Template Pattern Use Case
optimizer Edit → eval → keep/discard → repeat x10 Performance, latency, size reduction
refactorer Restructure → test → iterate until green Code quality, tech debt
test-writer Write tests → measure coverage → repeat Test coverage gaps
bug-fixer Reproduce → diagnose → fix → verify Bug fix with competing approaches

When using a template, replace all {variables} with values from the session config. Assign each agent a different strategy appropriate to the template and task — diverse strategies maximize the value of parallel exploration.

What It Does

  1. Load session config from .agenthub/sessions/{session-id}/config.yaml
  2. For each agent 1..N:
    • Write task assignment to .agenthub/board/dispatch/
    • Build agent prompt with task, constraints, and board write instructions
  3. Launch ALL agents in a single message with multiple Agent tool calls:
Agent(
  prompt: "You are agent-{i} in hub session {session-id}.

Your task: {task}

Read your full assignment at .agenthub/board/dispatch/{seq}-agent-{i}.md

Instructions:
1. Work in your worktree — make changes, run tests, iterate
2. Commit all changes with descriptive messages
3. Write your result summary to .agenthub/board/results/agent-{i}-result.md
   Include: approach taken, files changed, metric if available, confidence level
4. Exit when done

Constraints:
- Do NOT read or modify other agents' work
- Do NOT access .agenthub/board/results/ for other agents
- Commit early and often with descriptive messages
- If you hit a dead end, commit what you have and explain in your result",
  isolation: "worktree"
)
  1. Update session state to running via:
python {skill_path}/scripts/session_manager.py --update {session-id} --state running

Critical Rules

  • All agents in ONE message — spawn all Agent tool calls simultaneously for true parallelism
  • isolation: "worktree" is mandatory — each agent needs its own filesystem
  • Never modify session config after spawn — agents rely on stable configuration
  • Each agent gets a unique board post — dispatch posts are numbered sequentially

After Spawn

Tell the user:

  • {N} agents launched in parallel
  • Each working in an isolated worktree
  • Monitor with /hub-status
  • Evaluate when done with /agenthub:eval
常见问题

为什么每个智能体都要使用不同的策略?

不同策略能并行探索更多方案,使最终比较更有价值。

智能体在哪里工作?

每个智能体都在自己独立的 git 工作树中工作。

我能使用哪些模板?

优化器、重构器、测试编写者和错误修复者。

详情

作者的原始描述

Use to launch the competing agents for an initialized AgentHub session in isolated worktrees.

repo: alirezarezvani/claude-skills

热度

GitHub 星标
29k
排名
#9535
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能