/hub:run — One-Shot Lifecycle

One-shot lifecycle command that chains init → baseline → spawn → eval → merge in a single invocation.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/run, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering/agenthub/skills/run#main ~/.claude/skills/run

For one project only, change the path to .claude/skills/run. This skill also uses bench.py, result_ranker.py — copying SKILL.md alone won't be enough. See the folder on GitHub.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of /hub:run — One-Shot Lifecycle

Show the full text111 lines
namedescriptioncommand
runOne-shot lifecycle command that chains init → baseline → spawn → eval → merge in a single invocation. Use when the user runs /hub:run or asks to execute a full AgentHub competition end-to-end./hub:run

/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: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 /hub: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 /hub: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 /hub:merge. If declined, inform the user they can:

  • /hub:merge --agent agent-{N} to pick a different winner
  • /hub: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 /hub:spawn
1---
2name: "run"
3description: "One-shot lifecycle command that chains init → baseline → spawn → eval → merge in a single invocation. Use when the user runs /hub:run or asks to execute a full AgentHub competition end-to-end."
4command: /hub:run
5---
6 
7# /hub:run — One-Shot Lifecycle
8 
9Run the full AgentHub lifecycle in one command: initialize, capture baseline, spawn agents, evaluate results, and merge the winner.
10 
11## Usage
12 
13```
14/hub:run --task "Reduce p50 latency" --agents 3 \
15 --eval "pytest bench.py --json" --metric p50_ms --direction lower \
16 --template optimizer
17 
18/hub:run --task "Refactor auth module" --agents 2 --template refactorer
19 
20/hub:run --task "Cover untested utils" --agents 3 \
21 --eval "pytest --cov=utils --cov-report=json" --metric coverage_pct --direction higher \
22 --template test-writer
23 
24/hub:run --task "Write 3 email subject lines for spring sale campaign" --agents 3 --judge
25```
26 
27## Parameters
28 
29| Parameter | Required | Description |
30|-----------|----------|-------------|
31| `--task` | Yes | Task description for agents |
32| `--agents` | No | Number of parallel agents (default: 3) |
33| `--eval` | No | Eval command to measure results (skip for LLM judge mode) |
34| `--metric` | No | Metric name to extract from eval output (required if `--eval` given) |
35| `--direction` | No | `lower` or `higher` — which direction is better (required if `--metric` given) |
36| `--template` | No | Agent template: `optimizer`, `refactorer`, `test-writer`, `bug-fixer` |
37 
38## What It Does
39 
40Execute these steps sequentially:
41 
42### Step 1: Initialize
43 
44Run `/hub:hub-init` with the provided arguments:
45 
46```bash
47python {skill_path}/scripts/hub_init.py \
48 --task "{task}" --agents {N} \
49 [--eval "{eval_cmd}"] [--metric {metric}] [--direction {direction}]
50```
51 
52Display the session ID to the user.
53 
54### Step 2: Capture Baseline
55 
56If `--eval` was provided:
57 
581. Run the eval command in the current working directory
592. Extract the metric value from stdout
603. Display: `Baseline captured: {metric} = {value}`
614. Append `baseline: {value}` to `.agenthub/sessions/{session-id}/config.yaml`
62 
63If no `--eval` was provided, skip this step.
64 
65### Step 3: Spawn Agents
66 
67Run `/hub:spawn` with the session ID.
68 
69If `--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.
70 
71Launch all agents in a single message with multiple Agent tool calls (true parallelism).
72 
73### Step 4: Wait and Monitor
74 
75After spawning, inform the user that agents are running. When all agents complete (Agent tool returns results):
76 
771. Display a brief summary of each agent's work
782. Proceed to evaluation
79 
80### Step 5: Evaluate
81 
82Run `/hub:eval` with the session ID:
83 
84- If `--eval` was provided: metric-based ranking with `result_ranker.py`
85- If no `--eval`: LLM judge mode (coordinator reads diffs and ranks)
86 
87If baseline was captured, pass `--baseline {value}` to `result_ranker.py` so deltas are shown.
88 
89Display the ranked results table.
90 
91### Step 6: Confirm and Merge
92 
93Present the results to the user and ask for confirmation:
94 
95```
96Agent-2 is the winner (128ms, -52ms from baseline).
97Merge agent-2's branch? [Y/n]
98```
99 
100If confirmed, run `/hub:merge`. If declined, inform the user they can:
101- `/hub:merge --agent agent-{N}` to pick a different winner
102- `/hub:eval --judge` to re-evaluate with LLM judge
103- Inspect branches manually
104 
105## Critical Rules
106 
107- **Sequential execution** — each step depends on the previous
108- **Stop on failure** — if any step fails, report the error and stop
109- **User confirms merge** — never auto-merge without asking
110- **Template is optional** — without `--template`, agents use the default dispatch prompt from `/hub:spawn`
111 

Discussion