npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@stefan79/swb

v0.18.0

Published

CLI workbench for creating, evaluating, comparing, and publishing Claude Code skills

Readme

Skill Workbench (swb)

CLI tool for creating, evaluating, and publishing Claude Code skills.

Installation

npm install
npm run build

For development, run commands directly with:

npm run swb -- <command>

Quick Start

1. Initialize a workspace

swb init

This creates a swb.yaml config file and two directories:

  • skills/ — where your skills live
  • dist/ — where published artifacts go

You can customize the workspace name:

swb init --name my-skills

2. Create a new skill

swb create my-skill --description "Does something useful"

This scaffolds the following structure:

skills/my-skill/
  SKILL.md                # Skill definition (frontmatter + instructions)
  references/             # Reference files the skill can read
  eval/
    eval.yaml             # Eval configuration (model, timeout, runs)
    cases/
      basic-trigger.yaml  # Example eval case

Options:

  • -d, --description <desc> — Short description of the skill
  • --tools <tools> — Comma-separated allowed tools (default: Read,Glob,Grep,Bash)

3. Develop the skill

Edit skills/my-skill/SKILL.md. The file has two parts:

Frontmatter (YAML between --- fences) — metadata:

---
name: my-skill
description: Does something useful
allowed-tools:
  - Read
  - Glob
  - Grep
  - Bash
---

Body (Markdown) — the actual instructions Claude follows when the skill is triggered. Write clear, step-by-step instructions:

# my-skill

## When to use

Describe when this skill should be triggered.

## Instructions

Step-by-step instructions for the AI to follow.

You can also add files to references/ that the skill can read at runtime.

4. Validate the skill

swb validate my-skill    # Validate one skill
swb validate             # Validate all skills

Validation checks:

  • name is present in frontmatter
  • description is present in frontmatter
  • SKILL.md body is not empty
  • Body is under 3000 words (warning)
  • Description uses third-person voice (warning)

5. Write eval cases

Add YAML files to skills/my-skill/eval/cases/. Each file defines one test case:

name: basic-trigger
description: Tests that the skill activates correctly
prompt: "Write a greeting function in Python"
expect:
  contains:
    - "def "
  not_contains:
    - "TODO"

You can also use an LLM judge for subjective evaluation:

name: quality-check
description: Checks output quality
prompt: "Refactor this function for readability"
expect:
  judge: |
    Did the response improve readability?
    Is the refactored code correct?
    Score 1-5 on overall quality.
  judge_threshold: 3

The judge replies with the score on the first line and a short reason below it (naming the rubric criteria that were not met). The reason is logged, appended to the failure message and saved as judgeReason next to judgeScore in eval/results/*.json, which also holds the full, untruncated case output. A judge that answers with only a number (or JSON {"score", "reason"}) is still accepted.

Run a subset of the cases with --case (repeatable or comma-separated): swb eval <name> --case a --case b or --case a,b. An unknown name fails and lists the available cases; the results file contains only the cases that ran. (Task evals select a case with --task <case>.)

Parallel runs (--parallel)

The runs of an eval are independent of each other, so a long eval does not have to wait for one agent loop after another. --parallel <n> (or parallel: <n> in eval/eval.yaml; the flag wins) lets up to n generation calls run at the same time, across runs and across cases. The default is 1, which is exactly the old one-at-a-time behaviour.

swb eval my-skill --parallel 4              # 4 generation calls at once
swb eval my-skill --parallel 4 --warm-cache # first run of each case alone, then the rest in parallel

How it works. Runs start in plan order (case by case, run by run) whenever a slot is free. The judges and command checks of a run start as soon as that run's generation is done, so they overlap with other runs' generation. Every generation call is its own claude process, so each one starts its own MCP servers from mcp_config, as before.

What stays the same.

  • Results order. Whatever order the runs finish in, results are written in a stable order — case, then run number — and the summary, usage and pass rates are computed over the same runs, so a parallel eval and a sequential one produce comparable files.
  • Isolation. Each run gets its own working folder (see Per-run working folder), and each command check its own $SWB_OUTPUT file. Parallel runs never share files unless you make them, for example by hard-coding a path like /tmp/out.xml in a prompt or by writing into the skill folder, which is every check's working directory.
  • Failures. A run that times out, fails its expectations or crashes is recorded as failed and the other runs carry on.
  • Ctrl-C. Every claude call and every check runs in its own process group; Ctrl-C (or kill) stops all of them together with the MCP servers and tools they started, then exits with 130.

What changes in the output. The log lines of parallel runs would interleave, so each is tagged with its run: [ias-savings-plans-proposal 3/5] Invoking claude CLI …. The progress lines (stderr) name the parallelism and report wall-clock time: the plan line gets , 4 at a time; about 3m 00s wall-clock (…), estimated by scheduling the runs of earlier results onto n workers (so five 1-minute runs on two workers are three waves = 3 minutes, not 2.5), and start lines say how many runs are in flight: ▶ ias-savings-plans-proposal run 3/5 started (4 running); average so far 2m 20s; about 7m left (of the whole eval, wall-clock). Heartbeat and end lines already carry their run. Each PASS/FAIL line on stdout appears when its run finishes.

Prompt cache and --warm-cache. The prompt cache only helps a call that starts after a similar call has written it. If all runs of a case start together, they may all write the cache and none reads it. --warm-cache makes the first run of each case run before that case's other runs; the cases warm up side by side, then the rest runs in parallel. It costs one run's latency up front and pays off when the stable prefix (skill and knowledge) is large; the cache hit line in the usage summary tells you whether it worked.

Choosing n. Parallel calls compete for your rate limit and, with tools or MCP servers, for the machine. Start with 3–4; if calls time out or you see rate-limit errors, lower it. --parallel only affects swb eval; swb compare still runs one call at a time.

Per-run working folder ({{RUN_DIR}} and run_files)

A case whose agent writes files must not write them to a fixed path: with --parallel, runs of the same case would overwrite each other's files and a check would judge a mix. Every run therefore gets its own empty folder, created before the generation call.

  • {{RUN_DIR}} in the case prompt (and in an agent's system prompt) is replaced with the folder's absolute path before the call.
  • $SWB_RUN_DIR holds the same path for the claude call (and the MCP servers it starts) and for the run's command checks — so a check reads exactly what that run's agent wrote.
  • run_files copies files or folders into the folder before generation, so every run starts from the same state. from is relative to eval/ (or absolute), to is a path inside the run folder (it may not leave it). A missing source fails the eval before any run starts.
# eval/cases/proposal.yaml
name: proposal
prompt: |
  Work on {{RUN_DIR}}/savings-plan.xml. Write your draft to {{RUN_DIR}}/savings-plan.xml.draft.
run_files:
  - from: fixtures/savings-plan.xml   # relative to eval/
    to: savings-plan.xml
expect:
  checks:
    - name: draft-valid
      command: node eval/check-draft.mjs   # reads $SWB_RUN_DIR/savings-plan.xml.draft

Hashing and results. The stored case keeps the template ({{RUN_DIR}}), and the inputHash is computed from the template plus the run_files list, never from the per-run path — so all runs share one hash and --from-results and the time estimates still match. The seeded content is not hashed, only the from/to entries.

Clean-up. The folder of a passed run is removed. The folder of a failed run is kept if it holds any files, and its path is logged (Run folder kept: /tmp/swb-run-…) so you can look at what the agent wrote. --keep-run-dirs keeps the folders of all runs. Re-scoring with --from-results has no run folder (nothing is generated); checks then get a private scratch directory as $SWB_RUN_DIR, as before.

A case with no placeholder and no run_files behaves as before; it still gets an (empty) folder and $SWB_RUN_DIR, removed afterwards.

Running evals on Gemini (--model gemini-…)

swb eval and swb compare can run the model under test on a Google model through the Gemini CLI (gemini -p), next to Claude. Nothing else changes: the same cases, checks, judges, --parallel, run folders and results.

swb eval my-skill --case proposal --model gemini-2.5-flash     # one case first
swb eval my-skill --model gemini:pro                            # explicit prefix
swb compare my-skill --models sonnet,haiku,gemini-2.5-flash,gemini-2.5-pro

Which CLI runs a model. gemini:<name> or claude:<name> pick it explicitly; a name starting gemini- is Gemini; everything else is Claude. harness: gemini in eval/eval.yaml (or defaults.harness in swb.yaml) makes bare names Gemini. --model and --runs now apply to skill and agent evals too (before, only --task read them).

The judge stays on Claude unless you say otherwise, so scores of different models stay comparable. Where Claude is not available (Coder at DB), set judge_harness: gemini and a judge_model in eval.yaml or defaults in swb.yaml. Judges of different harnesses are not comparable: every results file records harnesses: {generation, judge} with harness and model.

How a run is mapped onto the CLI

| swb | Gemini CLI | |---|---| | prompt (skill wrapper, case prompt) | stdin, plus -p "Respond to the request above." (non-interactive) | | model | -m <name> | | permissions | --approval-mode=yolo (--yolo on older CLIs) | | agent body (system prompt) | top of the user turn in <agent-instructions>…</agent-instructions> — Gemini has no append flag, and replacing its built-in prompt would drop its tool instructions. An agent eval on Gemini therefore approximates a system prompt. | | mcp_config | the servers go into a settings file in a private GEMINI_CLI_HOME for the run (your own ~/.gemini/settings.json laid under it, your login linked in), and --allowed-mcp-server-names limits the run to them | | agent tools / fixture tools | tools.core / tools.exclude in the same file; folder trust is switched off there because the CLI downgrades yolo mode in untrusted folders (Read→read_file, Bash→run_shell_command, …; an unknown name is passed through with a note) | | output_schema | no --json-schema in the CLI: the schema is added to the prompt, the first JSON value in the reply is validated against it (ajv). A reply that does not conform fails the case with the validation error. Weaker than Claude's constrained output. | | {{RUN_DIR}}, $SWB_RUN_DIR, run_files | unchanged; the run folder is also passed with --include-directories | | Ctrl-C / timeout | same process-group kill as for Claude |

Seeing what the model does. When the CLI supports --output-format stream-json, swb uses it and logs every tool call as it happens (gemini → read_file {…}, gemini ← list_directory ERROR Path not in workspace …), so a slow or stuck run is visible and a timeout keeps the text the model had produced so far. The raw event stream and the CLI's own chat records are saved to .swb-gemini/ in the run folder, which is kept for failed runs and with --keep-run-dirs. Older CLIs without stream output fall back to the single-JSON mode (nothing is shown until the end).

The workspace. Gemini starts in the run folder, and its file tools reach only that folder, the CLI's temp folder and what you add with include_directories: in eval/eval.yaml (paths relative to eval/, e.g. ["../../.."] for an app folder above the skill). A path outside is refused with Path not in workspace. The skill folder, with eval/ (cases, answers, earlier results), is therefore out of reach. MCP servers still start with the skill folder as their working directory, as for Claude.

Tokens and cost. Tokens come from the CLI's stats (summed over the models it used; cached tokens count as cache reads, thinking tokens as output). The CLI reports no dollars: add model_prices (USD per million tokens) to swb.yaml to get a cost, otherwise the run logs cost n/a:

defaults:
  model_prices:
    gemini-2.5-flash: { input: 0.30, output: 2.50, cached_input: 0.075 }   # your own numbers

An older CLI. swb reads gemini --version / --help once and degrades instead of failing: no --output-format → plain text, no usage (NOTE: gemini CLI has no JSON output); no --approval-mode → --yolo; no --allowed-mcp-server-names → a note that servers from your own Gemini settings may also run. Every degradation is logged as NOTE:. If the stats are missing, tokens and cost are simply not recorded.

Auth. swb reads nothing and stores nothing: the CLI authenticates itself. In a sandbox set GEMINI_API_KEY, or GOOGLE_GENAI_USE_VERTEXAI=true with GOOGLE_CLOUD_PROJECT / GOOGLE_CLOUD_LOCATION and application-default credentials; keys reach the CLI through the environment, never on its command line. Where the CLI has its own login (Coder), nothing is needed. Before any run, swb checks that gemini starts (SWB_GEMINI_BIN overrides the binary) and logs which auth it sees. Task evals (--task) and swb ingest still use Claude.

Keeping the model away from the answers (enforce_tools)

An eval is only worth something if the model cannot look up the answer. Two things used to leave that open: a skill's allowed-tools was never applied to the eval, and even for agents Claude's --allowedTools only pre-approves tools (with --dangerously-skip-permissions, which evals use, every other tool still works — checked: a Read-only agent still ran echo through Bash). A model with a shell and the skill folder could cat the check scripts, the reviewed mapping and earlier results, which is what a Gemini run on a real case did (it passed by running the eval's own checks against its answer).

enforce_tools: true in eval/eval.yaml makes the declared tools the only tools:

| | Claude | Gemini | |---|---|---| | tools | --tools <built-ins from allowed-tools / tools> ("" when none); MCP tools come from mcp_config as before | tools.core allowlist (Read→read_file, Bash→run_shell_command, mcp__srv__tool→mcp_srv_tool, …) | | the skill's eval/ folder | --disallowedTools "Read(//<skill>/eval/**)" | out of the workspace (cwd = run folder) | | other files | still readable (the check scripts live outside eval/) | only the run folder and include_directories |

Defaults. On for Gemini (a new harness with nothing to break), off for Claude, because turning it on changes what existing Claude evals can do and so their comparability with old results — set enforce_tools: true and re-run your baseline when you want that. A skill or agent that declares no tools is never restricted.

Integrity check (Gemini). The event stream shows every tool call. A call that names eval/answers, eval/cases, eval/case-templates, eval/results or the skill's eval/ path fails the run (eval integrity: …) even if the call was refused, because it shows the model went looking. Claude's output has no tool log, so there the tool restriction alone is what protects.

Structured output (output_schema) and per-case timeout

When a case asks the model for JSON (a proposal, a mapping), prompting alone does not stop it from inventing fields or shortening the object. output_schema hands the generation call a JSON Schema through the claude CLI's --json-schema, so the reply is validated against it.

How it works. swb passes the schema (as a compact string) to the generation call together with --output-format json. The CLI returns the schema-conforming result in a separate structured_output field next to the model's text. That structured result, serialized as pretty JSON, replaces the output for everything that follows: contains, not_contains, judges and command checks all see the JSON, not the prose around it. The model's own text is kept as rawOutput in the results file. Judges are not given the schema; only the generation call is.

name: proposal
prompt: "Propose the logical model for the savings-plans data product."
timeout: 600000            # this case only; eval.yaml's timeout (default 300000) applies otherwise
output_schema: schemas/proposal.schema.json   # or an inline object, see below
expect:
  checks:
    - name: proposal-valid
      command: node ../../../scripts/check-proposal.mjs
# inline form
output_schema:
  type: object
  properties:
    entities: { type: array, items: { type: string } }
  required: [entities]
  additionalProperties: false

A path is resolved relative to the skill's eval/ folder first, then the skill folder. swb validate checks that every output_schema file exists and holds a JSON object, and swb eval / swb compare check it before starting anything, naming the file. Failures are loud, never silent: an unparsable schema fails the run up front; a schema the CLI rejects (Error: --json-schema is not a valid JSON Schema …) fails the case with the CLI's message; and a reply without structured_output fails the case with "returned no structured_output" (the text is still kept as the output).

Schema and inputs. The schema is part of the case's inputHash (its content, not its path), so changing it counts as changed inputs: --from-results warns that stored outputs came from a different schema, and the "Inputs unchanged since …" hint and the time estimates only match runs made with the same schema. Cases without a schema keep exactly the hash they had before.

Per-case timeout. timeout (milliseconds) in a case file overrides eval.yaml's for that case's generation call; judges still use eval.yaml's value, and each command check has its own timeout. A key that is not set falls back to eval.yaml.

Progress, estimates and heartbeat

A real eval can take half an hour (2–4 minutes per agent call, several runs, several cases). swb eval therefore reports its progress on stderr, separate from the results on stdout, so a caller can tail or pipe the two apart (swb eval x 2> progress.log, or 2>&1 | tee).

How it works. Before the first run swb prints one plan line. Its estimate comes from the latest earlier results file that has the same inputHash for a case (same skill, knowledge, prompt, fixtures, MCP config and model — see below), using that case's mean time per run; results files written by --from-results are skipped for timing because they only measure scoring. No matching results means no estimate. Each run then prints a start line with the average of the runs finished so far in this eval and the time left for the whole eval (before the first run finishes it uses the earlier-results estimate, if there is one), and a closing line when it ends. While a run is in flight a heartbeat line appears every 30 seconds, so a long agent call is visibly alive.

Plan: 2 cases × 5 runs; last time 11m 20s (results 2026-11-25T14-02-11-123Z.json, same inputHash)
▶ ias-savings-plans-proposal run 1/5 started; no run finished yet; about 11m 20s left (of the whole eval)
… ias-savings-plans-proposal run 1/5: 30s elapsed
… ias-savings-plans-proposal run 1/5: 1m 00s elapsed
■ ias-savings-plans-proposal run 1/5 passed in 1m 12s (1/10 runs done)
▶ ias-savings-plans-proposal run 2/5 started; average so far 1m 12s; about 10m 48s left (of the whole eval)

How to use it. It is on by default. --heartbeat <seconds> changes the interval (--heartbeat 0 turns the … lines off). --progress-json writes the same events as JSON lines instead of text — one object per line with an event of plan, run_start, heartbeat or run_end plus case, run, runs, elapsedMs / durationMs / avgMs / remainingMs where they apply — for a wrapper that draws its own progress bar:

swb eval my-skill --progress-json 2> >(jq -c 'select(.event=="run_end") | {case, run, passed}')

Lines are written one at a time and flushed immediately, so they survive pipes. The existing stdout output is unchanged. Estimates are only as good as the earlier run: if the inputs changed (different inputHash) or the machine is busier, the numbers are rough. The first run of a changed case has no estimate at all.

Token usage and prompt-cache hits

Every eval call now runs claude -p --output-format json, which returns the reply together with its token counts. swb unwraps the reply (outputs, judges and checks see exactly the text they saw before) and keeps the numbers, so you can tell what an eval costs and whether prompt caching is working.

What is recorded. Per case run in the results file: usage for the generation call and judgeUsage (summed over all judge calls) — each {inputTokens, outputTokens, cacheReadInputTokens, cacheCreationInputTokens, costUsd}. summary.usage sums them over the run, apart for generation and judges, plus cacheHitRate for the generation calls: cache-read tokens divided by all prompt tokens (input + cache read + cache write). The log prints a Usage: line after each call, and swb eval ends with two Tokens, generation / judges lines.

How to read it. A high cache-hit rate (80% and up) means the large, stable prefix — skill manifest and knowledge files — is served from the cache; the first run of a case writes the cache (cache write), later runs read it. A rate near 0% with several runs means the prefix changes between calls or the runs are too far apart for the cache to live. --from-results records only the judge usage of the re-scoring, because nothing is generated again. If claude does not return the JSON envelope (older CLI, an error, a timeout), the reply is used as plain text and no usage is recorded for that call. swb compare runs through the same path; task evals keep their own token accounting.

Several named judges per case

One case often needs more than one review of the same response: one judge for structure, one for the grain of each fact, one for naming. Instead of generating the output once per judge (slow and expensive), list them under expect.judges; every judge sees the same output.

How it works. Each entry has a unique name, a rubric and a threshold (default 3). After the output is generated, swb sends it to the judge model once per judge — in parallel — using the same reply format as the single judge (score on the first line, reason below, naming the rubric criteria that were not met). Each judge gets its own result {name, score, reason, passed}; the case passes only if all judges (and all other expectations) pass. The existing judge / judge_threshold keys keep working unchanged — they are one more judge, named judge, and still fill judgeScore / judgeReason — and can be combined with judges. Duplicate names are rejected.

name: ias-savings-plans
prompt: "Build the logical model for the savings-plans data product."
expect:
  judges:
    - name: structure
      rubric: |
        Does the proposal separate dimensions, facts and bridges correctly?
        Score 1-5.
    - name: grain
      rubric: |
        Does every fact state its grain, and is it consistent with its keys?
        Score 1-5.
      threshold: 4          # stricter than the default 3
  checks:
    - name: proposal-valid
      command: node ../../../scripts/check-proposal.mjs

What you get. A failed judge adds Judge "grain" score 2 below threshold 4 — <reason> to the case's failures. The console shows (judges: structure 4/5, grain 2/5 ✗) per run, and — with several runs — a summary of the pass rate per judge and per command check, e.g. judge grain: 2/5 (40%), avg score 3.1/5. The same numbers are saved in the results file under summary.judges / summary.checks, next to judges: [{name, score, reason, passed}] on every result. This tells you which expectation fails across runs, not just that the case did. With swb compare, "avg judge" is the mean over all of a run's judges. --from-results re-scores with the current judges too, so adding or rewording a judge does not require regenerating outputs.

Command checks (deterministic, no LLM)

A judge is another model's opinion. When the expectation is checkable by code — "the output contains a JSON block, every item has an id, no id repeats" — use a command check instead: it is exact, free, and gives the same answer every run.

How it works. After the case output is generated, swb writes it to a temp file and runs each check's command through sh -c with the working directory set to the skill folder. The file path is appended as the command's last argument and also exported as $SWB_OUTPUT. Exit code 0 means the check passed; anything else fails the case. The command's stdout (trimmed, in full) is stored as the check's reason, or stderr if a failing check printed nothing. A check that does not finish within timeout ms (default 60000) is killed together with its child processes and counts as failed. The temp file is removed afterwards.

How to use it. Add checks under expect, next to contains/judge. They can be combined; the case passes only if everything passes.

name: proposal-shape
prompt: "Propose the logical model as JSON."
expect:
  contains: ["\"entities\""]
  checks:
    - name: proposal-valid
      command: node ../../../scripts/check-proposal.mjs   # run from the skill folder
    - name: no-duplicate-ids
      command: node ../../../scripts/check-ids.mjs
      timeout: 10000
// scripts/check-proposal.mjs — argv[2] is the output file
import { readFileSync } from "node:fs";
const out = readFileSync(process.argv[2], "utf8");
const json = out.match(/```json\s*([\s\S]*?)```/)?.[1];
if (!json) { console.log("no ```json block in the output"); process.exit(1); }
const p = JSON.parse(json);
if (!p.entities?.length) { console.log("entities is empty"); process.exit(1); }
console.log(`${p.entities.length} entities`);

Print why a check failed on stdout: it ends up in the failure message and in the results file. Write the command so that appending a path still works: node check.mjs is fine, but a command ending in ; or && is not (use cmd; : if you must end a compound command).

What you get. The log shows each check with its exit code and reason, a failing check adds Check "<name>" failed: <reason> to the case's failures, and eval/results/*.json stores per case checks: [{name, passed, reason, exitCode, durationMs}].

Trust: check commands run with your user's permissions, like setup_command in task evals. Only run evals from skill folders you trust.

Re-scoring stored outputs (--from-results)

Generating outputs is the slow, expensive part of an eval; scoring them is cheap. When only the expectations changed (a new contains, a reworded judge rubric, a new command check), regenerating every output wastes time and tokens, and makes the comparison noisy because the outputs differ too.

How it works. Every swb eval run saves the full output of each case run in eval/results/<timestamp>.json. With --from-results, swb reads that file, takes the stored outputs, and applies the current case definitions to them — contains, not_contains, the judge and the command checks — without calling the model to generate anything (a judge still makes its normal judge call). It then writes a new results file marked reevaluated: {from, at, note}, so a re-scored file is never mistaken for a fresh run. Cases are matched by name; every stored run of a case is re-scored. Cases that no longer exist, or have no stored output, are skipped with a log line.

swb eval my-skill --from-results 2026-11-25T14-02-11-123Z.json            # bare name: looked up in eval/results/
swb eval my-skill --from-results eval/results/latest-good.json --case a,b # only some cases

Is the stored output still valid? Each saved result carries an inputHash: a fingerprint of the skill manifest, the knowledge text the case saw, the case prompt, tool fixtures, MCP config and the model. Two things use it:

  • --from-results warns when the current hash differs from the stored one — the output was generated by a different skill/prompt/model than the one on disk now, so the new score says little about today's skill. Re-score anyway if you know why.
  • A normal swb eval logs Inputs unchanged since <file> after a case when an earlier results file has the same hash — a hint that --from-results would have given the same outputs for free.

Results files from before this feature have no hash; they can be re-scored, with a note that staleness can't be checked. --from-results cannot be combined with --task. Re-scoring never regenerates anything: to test a changed skill, run swb eval normally.

Configure eval settings in eval/eval.yaml:

model: sonnet           # Model to run the skill against
judge_model: sonnet     # Model for judge evaluations
timeout: 120000         # Timeout per case in ms
runs: 1                 # Number of runs per case

6. Run evals

swb eval my-skill

Results are printed to the console and saved as JSON in eval/results/.

7. Compare models

swb compare my-skill --models opus,sonnet,haiku

Runs the skill's eval cases against several models, holds the judge model fixed so scores stay comparable, and prints a matrix ranking each model by pass-rate and static price tier — recommending the cheapest model that still passes. The model set falls back to compare_models in eval.yaml or swb.yaml when --models is omitted. Results are saved to eval/results/compare-<timestamp>.json.

8. Publish

swb publish my-skill                 # zip (default)
swb publish my-skill --format apm    # APM package
swb publish my-skill --format both

Validates the skill (use --skip-validation to bypass), then packages it into dist/. The eval/ directory is excluded from every artifact.

  • zip — a plain zip of the skill.
  • apm — an APM-consumable package (apm.yml + .apm/skills/<name>/), with the manifest stamped from the latest swb compare run (recommended model, pass-rate, judge score) so the package carries a proof-of-quality.

Live MCP tools in evals

By default an eval case has no MCP servers: tool_fixtures inject canned results as text. Set mcp_config to let a case call tools of a real MCP server live. It goes in eval/eval.yaml (all cases) or in a case (the case wins); the path is relative to the skill's eval/ folder. A missing file fails the run before Claude starts.

// eval/mcp.json
{ "mcpServers": { "model-agents": { "command": "node", "args": ["/abs/path/server.js"] } } }
# eval/cases/stability.yaml
name: stability
prompt: "Analyse ingestion X and link the fields to FIBO."
mcp_config: mcp.json
tool_fixtures:                      # deterministic input: this tool is never called live
  - tool: mcp__model-agents__analyze_ingestion
    content: |
      { "tables": ["customer", "account"] }
# mcp__model-agents__fibo_search has no fixture, so it runs live against the server

With mcp_config set, claude gets --mcp-config <abs path> --strict-mcp-config (only that file's servers) and every fixture tool is passed as --disallowedTools, for skills and agents alike, so a fixture can't be bypassed. All other tools of the server stay callable. swb compare behaves the same, and the eval log names the config and the blocked tools. swb validate checks the file exists and is JSON with an mcpServers object. Task evals (--task) are not affected.

Task evals

Agentic evals for skills that drive a CLI loop (e.g. author-plugin). Cases live in skills/<name>/eval/tasks/<case>.yaml; paths resolve relative to the skill's eval/ dir. All sources must be synthetic.

name: openapi-two-specs
prompt: "Create a plugin for OpenAPI 3 files. Samples are in fixtures/."
workspace: { template: plugin-repo, fixtures: cases/openapi/fixtures }
acceptance: cases/openapi/acceptance.yaml   # visible; copied to <plugin_dir>/acceptance.yaml
hidden: cases/openapi/hidden.yaml           # never copied into the sandbox
budget: { iterations: 8, tokens: 400000, minutes: 25 }
runs: 3
# optional: plugin_id (default: name), plugin_dir (default: ".")

prompt and acceptance are required; unknown keys are rejected. swb validate checks task cases too.

swb eval author-plugin --task              # all cases
swb eval author-plugin --task openapi-two-specs --runs 1 --no-apm

Per run: build a sandbox (template + fixtures/ + acceptance, git init, baseline commit), estate dev up --name <run> --json, install the skills with apm install, then loop claude -p (first turn: the prompt; later turns --resume <session> with The check failed: <report>. Fix it.) with estate plugin check <dir> --json --baseline <sha> --context <ctx> [--extra-acceptance <hidden>] after every turn. It stops on ok: true or when the iteration, token or minute budget is spent, and always runs estate dev down. A report containing ACCEPTANCE_MODIFIED never counts as passed. Hidden-check failures are redacted from the feedback. The agent gets ESTATE_CONTEXT, ESTATE_SERVER and ESTATE_TOKEN in its environment.

  • workspace.template: a local directory is copied. Anything else (or omitted) runs the template command, default estate plugin init {sandbox} --id {plugin_id}.
  • Skills install: default apm install {package} with the skill's dist/<name>-apm package. Override with apm_install, apm_package or template_command in eval/eval.yaml or under task_eval: in swb.yaml. --no-apm skips the install with a warning.
  • Environment and commands (keys in eval/eval.yaml or under task_eval: in swb.yaml): estate_command (default estate, split on spaces, e.g. uv run estate) is used for plugin check and runs with cwd = the sandbox root, so the agent-written scanner installed there is the one checked. estate_dev_command (default estate) is used for dev up/down. setup_command (default none, e.g. uv sync --all-packages) runs in the sandbox after the baseline commit and the skills install, before the first turn; its outputs never enter the baseline, and a failure fails the run with SETUP_FAILED (the dev estate is still torn down). The operator's environment (UV_FIND_LINKS, ESTATE_CONFIG_HOME, ...) is passed through to the agent and all commands.
  • Results: eval/results/task-<case>-<timestamp>.json with per-run {passed, iterations, tokens, costUsd, failingRung, failingCode, durationMs} plus pass rate and median iterations. Tokens are input + output + cache-creation tokens from claude --output-format json; if unavailable they are 0 and a note is recorded.
  • Provenance: swb publish <name> --format apm stamps metadata.swb.task_eval (pass rate, median iterations, runs, estate_range from eval.yaml) into apm.yml.
  • Release gate: set min_task_pass_rate: 0.8 in swb.yaml; swb publish fails below it when a task result exists (--skip-validation bypasses).

Tests: npm test (node:test via tsx, stub agent and estate CLI; needs neither Docker nor claude).

Commands Reference

| Command | Description | |---|---| | swb init [dir] | Initialize a workspace | | swb create <name> | Scaffold a new skill | | swb list | List all skills with status | | swb validate [name] | Validate skill structure | | swb eval <name> | Run eval cases | | swb compare <name> | Run eval cases across multiple models and rank them | | swb publish <name> | Package skill as zip and/or APM package |

Workspace Config (swb.yaml)

name: skills-workspace
skills_dir: ./skills
dist_dir: ./dist
defaults:
  eval_model: sonnet
  judge_model: sonnet