Usage: /benchmark-skills <skillA> <skillB> <task…> — requires two skills and a task. Compare two specific skills head-to-head by running the same coding task under each, in isolated git worktrees, then comparing gates, cost, tokens, and review findings. Expensive and side-effecting; spawns two headless agent sessions and leaves worktrees on disk. Invoke only on an explicit request naming two skills and a task. Do not trigger on casual mention of comparing or benchmarking skills — for a static...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Benchmark Skills?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tashtit-benchmark-skills)
---
name: benchmark-skills
description: "Usage: /benchmark-skills <skillA> <skillB> <task…> — requires two skills and a task. Compare two specific skills head-to-head by running the same coding task under each, in isolated git worktrees, then comparing gates, cost, tokens, and review findings. Expensive and side-effecting; spawns two headless agent sessions and leaves worktrees on disk. Invoke only on an explicit request naming two skills and a task. Do not trigger on casual mention of comparing or benchmarking skills — for a static read-only comparison use compare-skills instead."
---
# Benchmark Skills
Compare two skills head-to-head on the **same coding task** by running it under two isolated arms — one per skill — and comparing efficiency, behavior, and output-quality metrics.
The two skills are the **only** intentional asymmetry. Prompt, base commit, model, and every quality layer are identical by construction, so any delta is attributable to the skill.
> **Cost warning.** This spawns two headless agent sessions and creates two git worktrees that are kept after the run. Confirm the user wants this before starting if the request was at all ambiguous. For a cheap static comparison of authoring quality, use `compare-skills` instead.
## Host resolution (do this first, once)
The headless CLI, its flags, the review-subprocess invocation, the telemetry schema, and the metric names are **host-specific**. Resolve them deterministically instead of guessing:
1. Run `scripts/resolve-host.sh`. It prints the path of the reference file for the current host and exits non-zero if the host cannot be identified.
2. If it exits non-zero, **stop** and tell the user the host could not be determined — do not run any CLI.
3. Read **only** the file it printed (never the other host's file). It defines the exact **Headless invocation**, **Review-layer subprocess**, **Telemetry parsing**, and **Report metric rows** referenced by name below.
## Arguments
| Param | Required | Notes |
| --- | --- | --- |
| `skillA` | ✅ | First skill. Arm A. |
| `skillB` | ✅ | Second skill. Arm B. |
| `task` | ✅ | The identical prompt passed to both arms. |
`skillA`, `skillB`, and `task` are the only arguments. The rest of the run is fixed by design so the usage stays simple: both arms use the **session's current model**, branch from the **current HEAD**, run the **gates and review** quality layers, do a **single run per arm**, and **keep** both worktrees afterward. If the user explicitly asks for something different — a different base commit, the judge layer, more than one run, or removing the worktrees afterward — honor that request; otherwise never prompt for these.
When invoked as `/benchmark-skills <skillA> <skillB> <task…>`, parse from `$ARGUMENTS`: `skillA` and `skillB` are positional args 1 and 2, and `task` is the remaining positional text. When triggered from a natural-language request, extract the same values from the user's message.
**If any of `skillA`, `skillB`, or `task` is missing, ask for it — never guess a task.** Running the wrong task wastes two headless sessions.
## Steps
1. Determine `skillA`, `skillB`, and `task` as described above. If any is missing, ask and stop.
2. Resolve both skill paths against known load paths (`.claude/skills/`, `.github/skills/`, `src/skills/`, plugin skill paths). If either is unresolvable, report the error and stop. Then **classify each source** — see the **Skill isolation** section of the resolved host reference:
- **Loose skill** — a `SKILL.md` inside the repo tree, so an arm removes the other skill with a single-file delete in the worktree.
- **Plugin skill** — installed outside the repo and enabled through an `enabledPlugins` map shared by every worktree. A worktree delete does **not** remove it; instead each arm's enablement is **pinned by writing the host's highest-precedence settings file into the worktree** (the host reference's **Skill isolation** procedure). If a plugin skill's files are not installed, or a managed scope force-enables it so enablement cannot be pinned, **stop** and tell the user — never run an arm that can still reach the skill it is supposed to exclude.
3. Resolve `base` to the current HEAD:
```bash
base = git rev-parse HEAD
```
4. Generate a `run-id` from the current timestamp (e.g. `20260803-143021`).
5. Run both arms **in parallel** (isolated worktrees). Each arm must have exactly one of the two skills present — a loose skill is toggled by deleting its file, a plugin skill by pinning its enablement per the host reference (on for the arm that keeps it, off for the arm that excludes it). Use the **Headless invocation** from the resolved host reference for each session, capturing JSONL to `runs/<arm>-<run-id>.jsonl`:
**Arm A** — only `skillA` present:
```bash
git worktree add -b bench/A-<run-id> bench/A-<run-id> <base>
# keep skillA, exclude skillB in this arm:
# loose skill → delete <resolved skillB path>; ensure skillA is present
# plugin skill → pin skillA ON and skillB OFF via the Skill isolation procedure
cd bench/A-<run-id>
# headless session per the resolved host reference → runs/A-<run-id>.jsonl
```
**Arm B** — only `skillB` present:
```bash
git worktree add -b bench/B-<run-id> bench/B-<run-id> <base>
# keep skillB, exclude skillA in this arm:
# loose skill → delete <resolved skillA path>; ensure skillB is present
# plugin skill → pin skillB ON and skillA OFF via the Skill isolation procedure
cd bench/B-<run-id>
# headless session per the resolved host reference → runs/B-<run-id>.jsonl
```
6. For each arm, run the quality layers in the worktree, before any teardown:
**`gates`** — run deterministic checks (tests / build / lint) → pass/fail per gate.
**Commit the result:**
```bash
# <pin-pathspec>: see the resolved host reference's Skill isolation section
git add -A <pin-pathspec> && git commit -m "bench: <arm> arm result"
git diff <base> > runs/<arm>-<run-id>.diff
```
If the host's **Skill isolation** procedure put an enablement pin inside the
worktree, `<pin-pathspec>` is `-- ':(exclude)<pin-path>'` — the pin is arm-revealing
and must not reach the diff. Omit it when the pin lives outside the worktree (Claude
Code's `--settings`) or when isolating loose skills, where no pin exists. Then run
the host reference's **pin-leak check** if it defines one, and treat a leak as an
invalid run rather than reviewing a diff that reveals the arm.
**`review`** — code-review the diff using the **Review-layer subprocess** from the resolved host reference, run inside the arm's worktree so it inherits the host's project-context file and skills. Do **not** pass the arm label to the reviewer (arm-blind). Both skills are assumed to be non-review skills, so the same review skill auto-triggers identically in both arms. → findings by severity.
**`judge`** (only if the user explicitly requested it) — judge the diff against the task for **task-correctness only**.
**Telemetry** — parse `runs/<arm>-<run-id>.jsonl` per the **Telemetry parsing** section of the resolved host reference.
**Fired-check** — from the same JSONL, determine whether the arm's skill was actually **invoked**, using the **Skill-invocation detection** section of the resolved host reference. The task is run exactly as written and neither skill is force-invoked, so this check is what separates a real comparison from a skill that simply never triggered. Record `skill_fired` (yes/no): `skillA` in arm A, `skillB` in arm B.
7. **Interpret the fired-check before recommending a winner:**
- If a skill did **not** fire in its own arm, that arm did not exercise the skill — do not read its metrics as that skill's result. Mark the arm **inconclusive** and tell the user the task did not trigger that skill; a fair head-to-head needs a task whose request matches both skills' stated triggers.
- If the excluded skill fired in an arm (e.g. `skillB` fired in arm A), isolation leaked — report the arm **invalid**, fix isolation, and re-run.
- Only compare the two arms as a head-to-head when each fired its own skill and neither fired the other.
8. Worktrees are **always kept**. Never auto-remove — use `remove-worktrees` to clean up later.
9. Emit the report, substituting the **Report metric rows** from the resolved host reference for the `<host cost/token rows>` line:
```text
metric | A (<skillA>) | B (<skillB>)
------------------|--------------------|-------------------
skill_fired | yes | yes
gates_passed | ... | ...
review_findings | 0c 1h 2m | 0c 0h 1m
<host cost/token rows>
duration | ... | ...
turns | ... | ...
tool_calls | ... | ...
files_changed | ... | ...
worktree | bench/A-<run-id> | bench/B-<run-id>
### Recommendation
<which skill to use, and the tradeoff — e.g. "B produces cleaner code and is
faster/cheaper; prefer B unless skillA has other advantages for this codebase.">
```
If the fired-check flagged either arm **inconclusive** or **invalid** (step 7), say so above the table and withhold the recommendation for that pairing.
## Validity guardrails
1. Identical **prompt**, **base commit**, and **model** across arms.
2. Each arm has exactly one of the two skills present. For loose skills this is a single-file delete; a plugin skill is shared by every worktree, so its enablement is pinned per arm via the host reference's **Skill isolation** procedure (writing the host's highest-precedence settings file into the worktree) — or the run stopped. No other skill state differs between arms, and the per-arm fired-check confirms each arm ran its own skill and not the other.
3. **Arm-blind reviewer** — the review subprocess receives the diff and project context, never the arm label.
4. Single-run results are **directional**, not statistical. Report them as such. If the user needs statistical confidence, they can request repeated runs and compare distributions.
5. **Fired-check.** Neither skill is force-invoked; triggering must happen naturally. An arm whose own skill never fired is **inconclusive**, and an arm where the excluded skill fired is **invalid**. Only compare arms that each fired their own skill and not the other.