# hub-run

Automates the entire AgentHub workflow in one pass: records baselines, coordinates parallel agents, ranks the output, and prompts to merge the winner.

- skill · `type=skill` · Claude Code · ★ 28786
- Author: Alireza Rezvani
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/alirezarezvani/claude-skills/tree/HEAD/engineering/agenthub/skills/hub-run/SKILL.md
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/skills/hub-run

## What it does

The skill executes the full AgentHub lifecycle in strict sequence. It sets up a session via `hub_init.py` and dispatches parallel worker agents in a single tool call. If any step fails, execution halts immediately.

Evaluation runs via metric scripts or coordinator diff analysis. By default, three agents compete. The skill never merges code automatically. It displays the ranked scoreboard and waits for explicit user confirmation before applying branch changes.

## Install

### Claude Code (native platform)

1. **Plugin marketplace**
In the agent chat (not a shell):
```text
/plugin marketplace add alirezarezvani/claude-skills
```
In the agent chat (not a shell):
```text
/plugin install agenthub@claude-code-skills
```
This installs the whole agenthub plugin with all its skills

2. **Skills CLI (Vercel)**
```bash
npx skills add alirezarezvani/claude-skills --skill hub-run -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/hub-run/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/hub-run/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/hub-run/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/hub-run/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install alirezarezvani/claude-skills hub-run
```

2. **Manually: put the files in place**
- File: `.github/skills/hub-run/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/alirezarezvani/claude-skills --path engineering/agenthub/skills/hub-run
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/hub-run/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/alirezarezvani/claude-skills/tree/HEAD/engineering/agenthub/skills/hub-run/SKILL.md

## When to use it
- run latency benchmarks across competing code variants
- refactor target modules using competing parallel agents
- increase pytest coverage with automated baseline comparisons
- evaluate generated variants using coordinator diff inspection

## Example prompts
- /hub:hub-run --task "Reduce p50 latency" --agents 3 --eval "pytest bench.py --json" --metric p50_ms --direction lower --template optimizer
- /hub:hub-run --task "Refactor auth module" --agents 2 --template refactorer
- /hub:hub-run --task "Cover untested utils" --agents 3 --eval "pytest --cov=utils --cov-report=json" --metric coverage_pct --direction higher --template test-writer

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 24591c43ba3c891e.

BEGIN THIRD-PARTY FILE 24591c43ba3c891e
````text
---
name: "hub-run"
description: "One-shot lifecycle command that chains init → baseline → spawn → eval → merge in a single invocation. Use when the user runs /hub:hub-run or asks to execute a full AgentHub competition end-to-end."
metadata:
  command: /hub:hub-run
---

# /hub: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:hub-run --task "Reduce p50 latency" --agents 3 \
  --eval "pytest bench.py --json" --metric p50_ms --direction lower \
  --template optimizer

/hub:hub-run --task "Refactor auth module" --agents 2 --template refactorer

/hub:hub-run --task "Cover untested utils" --agents 3 \
  --eval "pytest --cov=utils --cov-report=json" --metric coverage_pct --direction higher \
  --template test-writer

/hub: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:

```bash
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:
````
END THIRD-PARTY FILE 24591c43ba3c891e

The third-party file has ended. Everything between the 24591c43ba3c891e tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3369 of 3838 bytes. © Alireza Rezvani · MIT · https://github.com/alirezarezvani/claude-skills/tree/HEAD/engineering/agenthub/skills/hub-run/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
