/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
- Run the line below. It pulls the whole folder into
~/.claude/skills/run, including the files SKILL.md points to. - Describe your job in plain words. Claude Code follows the skill from there.
npx degit alirezarezvani/claude-skills/engineering/agenthub/skills/run#main ~/.claude/skills/runFor 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)
- On this page open ⋯ → Download .md.
- Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
- Pick the file and Save. Claude shows the name and description and runs a security scan.
- Check the skill is switched on.
- Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
- ChatGPT: make a Project and paste it into Instructions.
- 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.
Paste into Claude, ChatGPT or Cursor.
Source of /hub:run — One-Shot Lifecycle
Show the full text111 lines
| name | description | command |
|---|---|---|
| run | 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. | /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:
- 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 /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):
- Display a brief summary of each agent's work
- Proceed to evaluation
Step 5: Evaluate
Run /hub: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 /hub:merge. If declined, inform the user they can:
/hub:merge --agent agent-{N}to pick a different winner/hub: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/hub:spawn
| 1 | |
| 2 | name "run" |
| 3 | description "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." |
| 4 | command /hub:run |
| 5 | |
| 6 | |
| 7 | # /hub:run — One-Shot Lifecycle |
| 8 | |
| 9 | Run 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 | |
| 40 | Execute these steps sequentially: |
| 41 | |
| 42 | ### Step 1: Initialize |
| 43 | |
| 44 | Run `/hub:hub-init` with the provided arguments: |
| 45 | |
| 46 | |
| 47 | python {skill_path}/scripts/hub_init.py \ |
| 48 | --task "{task}" --agents {N} \ |
| 49 | [--eval "{eval_cmd}"] [--metric {metric}] [--direction {direction}] |
| 50 | |
| 51 | |
| 52 | Display the session ID to the user. |
| 53 | |
| 54 | ### Step 2: Capture Baseline |
| 55 | |
| 56 | If `--eval` was provided: |
| 57 | |
| 58 | Run the eval command in the current working directory |
| 59 | Extract the metric value from stdout |
| 60 | Display: `Baseline captured: {metric} = {value}` |
| 61 | Append `baseline: {value}` to `.agenthub/sessions/{session-id}/config.yaml` |
| 62 | |
| 63 | If no `--eval` was provided, skip this step. |
| 64 | |
| 65 | ### Step 3: Spawn Agents |
| 66 | |
| 67 | Run `/hub:spawn` with the session ID. |
| 68 | |
| 69 | 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. |
| 70 | |
| 71 | Launch all agents in a single message with multiple Agent tool calls (true parallelism). |
| 72 | |
| 73 | ### Step 4: Wait and Monitor |
| 74 | |
| 75 | After spawning, inform the user that agents are running. When all agents complete (Agent tool returns results): |
| 76 | |
| 77 | Display a brief summary of each agent's work |
| 78 | Proceed to evaluation |
| 79 | |
| 80 | ### Step 5: Evaluate |
| 81 | |
| 82 | Run `/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 | |
| 87 | If baseline was captured, pass `--baseline {value}` to `result_ranker.py` so deltas are shown. |
| 88 | |
| 89 | Display the ranked results table. |
| 90 | |
| 91 | ### Step 6: Confirm and Merge |
| 92 | |
| 93 | Present the results to the user and ask for confirmation: |
| 94 | |
| 95 | |
| 96 | Agent-2 is the winner (128ms, -52ms from baseline). |
| 97 | Merge agent-2's branch? [Y/n] |
| 98 | |
| 99 | |
| 100 | If 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
Browse more free Claude skills.