hub-run
它能做什么
这项技能一次性运行整个多智能体流程。适合希望多个智能体尝试同一任务、并自动合并最佳结果的人。
适用场景
- ✓当你想一次性完整运行竞赛,而不必逐步操作的时候。
- ✓当你希望多智能体任务用更少的手动设置完成时。
- ✓当你需要一个针对可测量任务、从开始到合并的固定流程的时候。
技能链接
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/agenthub/skills/hub-run/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请使用优化器模板,用三个智能体降低我们的 p50 延迟,并合并最快的那一个。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会初始化会话,记录基线,启动智能体,评估它们的结果,并合并获胜者。它以任务、智能体数量、评测命令、指标、方向和模板作为输入。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
/hub-run — One-Shot Lifecycle
Run the full AgentHub lifecycle in one command: initialize, capture baseline, spawn agents, evaluate results, and merge the winner.
Usage
/hub-run --task "Reduce p50 latency" --agents 3 \
--eval "pytest bench.py --json" --metric p50_ms --direction lower \
--template optimizer
/hub-run --task "Refactor auth module" --agents 2 --template refactorer
/hub-run --task "Cover untested utils" --agents 3 \
--eval "pytest --cov=utils --cov-report=json" --metric coverage_pct --direction higher \
--template test-writer
/hub-run --task "Write 3 email subject lines for spring sale campaign" --agents 3 --judge
Parameters
| Parameter | Required | Description |
|---|---|---|
--task |
Yes | Task description for agents |
--agents |
No | Number of parallel agents (default: 3) |
--eval |
No | Eval command to measure results (skip for LLM judge mode) |
--metric |
No | Metric name to extract from eval output (required if --eval given) |
--direction |
No | lower or higher — which direction is better (required if --metric given) |
--template |
No | Agent template: optimizer, refactorer, test-writer, bug-fixer |
What It Does
Execute these steps sequentially:
Step 1: Initialize
Run /hub-init with the provided arguments:
python {skill_path}/scripts/hub_init.py \
--task "{task}" --agents {N} \
[--eval "{eval_cmd}"] [--metric {metric}] [--direction {direction}]
Display the session ID to the user.
Step 2: Capture Baseline
If --eval was provided:
- Run the eval command in the current working directory
- Extract the metric value from stdout
- Display:
Baseline captured: {metric} = {value} - Append
baseline: {value}to.agenthub/sessions/{session-id}/config.yaml
If no --eval was provided, skip this step.
Step 3: Spawn Agents
Run /agenthub:spawn with the session ID.
If --template was provided, use the template dispatch prompt from ../agenthub/references/agent-templates.md instead of the default dispatch prompt. Pass the eval command, metric, and baseline to the template variables.
Launch all agents in a single message with multiple Agent tool calls (true parallelism).
Step 4: Wait and Monitor
After spawning, inform the user that agents are running. When all agents complete (Agent tool returns results):
- Display a brief summary of each agent's work
- Proceed to evaluation
Step 5: Evaluate
Run /agenthub:eval with the session ID:
- If
--evalwas provided: metric-based ranking withresult_ranker.py - If no
--eval: LLM judge mode (coordinator reads diffs and ranks)
If baseline was captured, pass --baseline {value} to result_ranker.py so deltas are shown.
Display the ranked results table.
Step 6: Confirm and Merge
Present the results to the user and ask for confirmation:
Agent-2 is the winner (128ms, -52ms from baseline).
Merge agent-2's branch? [Y/n]
If confirmed, run /agenthub:merge. If declined, inform the user they can:
/agenthub:merge --agent agent-{N}to pick a different winner/agenthub:eval --judgeto re-evaluate with LLM judge- Inspect branches manually
Critical Rules
- Sequential execution — each step depends on the previous
- Stop on failure — if any step fails, report the error and stop
- User confirms merge — never auto-merge without asking
- Template is optional — without
--template, agents use the default dispatch prompt from/agenthub:spawn
常见问题
有哪些模板可用?
优化器、重构器、测试编写者和错误修复者,每个都有各自的工作模式。
它需要评测命令吗?
不需要。没有评测命令时,它使用 LLM 评委模式比较结果。
对于可测量的任务,我需要提供什么?
指标名称,以及数值越低还是越高越好。
详情
作者的原始描述
Use for /hub-run, or to run a whole AgentHub competition end to end: init, baseline, spawn, eval and merge.
热度
- GitHub 星标
- 29k
- 排名
- #9532
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-launcher-orchestrator
29k帮你的智能体从一个清晰的目标出发,逐步规划、构建、测试并定时运行你自己账户中的 Claude 托管智能体。
grade-iterate
29k让你的智能体按评分标准为托管 AI 智能体的工作打分,并在固定的轮次内改进,因此它永远不会无限循环。
interview
29k让你的智能体就一个 AI 智能体的想法对你进行访谈,并在任何上线之前,把你的回答整理成一份简单的构建计划。
run-without-you
29k帮你的智能体设置托管 AI 智能体,使其按计划或在某个事件发生时运行,并在启动前检查定时设置。