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

hub-run

它能做什么

这项技能一次性运行整个多智能体流程。适合希望多个智能体尝试同一任务、并自动合并最佳结果的人。

适用场景

  • ✓当你想一次性完整运行竞赛,而不必逐步操作的时候。
  • ✓当你希望多智能体任务用更少的手动设置完成时。
  • ✓当你需要一个针对可测量任务、从开始到合并的固定流程的时候。

技能链接

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

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

使用方法

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

可直接粘贴的消息

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

可以这样问 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:

  1. Run the eval command in the current working directory
  2. Extract the metric value from stdout
  3. Display: Baseline captured: {metric} = {value}
  4. 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):

  1. Display a brief summary of each agent's work
  2. Proceed to evaluation

Step 5: Evaluate

Run /agenthub:eval with the session ID:

  • If --eval was provided: metric-based ranking with result_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 --judge to 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.

repo: alirezarezvani/claude-skills

热度

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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能