Adding a tool, rewriting a skill, or swapping a system prompt is cheap. Knowing whether the agent got better is not. Offline evals score a final answer. They miss the trajectory: extra tool hops, silent regressions, and “it still printed the right string” failures.
skilldiff is a weigh-in for agent changes. Run baseline vs. variant on the same tasks. An LLM-as-a-Judge scores both traces, flags tool regressions, and writes a JSON diff an IDE agent can patch against.
pip install skilldiff
skilldiff demo
- A/B agent runs — same
tasks.json, two tool/skill scripts, concurrent trajectories. - LLM-as-a-Judge — Gemini (cloud) or Ollama (local). JSON verdicts, not vibes.
- Shift-left —
skilldiff run --quickonsanitytags for a sub-minute inner loop. - CI gate —
--exit-on-loss/--min-win-ratefail the PR when the variant regresses. - Machine-readable diffs —
.agent_diff/results_<timestamp>.jsonwithfix_suggestionfor Cursor / Claude Code.
Agentic coding workflows keep changing how the model acts: new tools, MCP servers, skills, prompt fragments. Teams then ship those changes because a handful of chat sessions “looked fine.”
That is the evals gap:
| What typical evals measure | What agent changes actually break |
|---|---|
| Final answer vs. gold label | Tool choice, argument quality, extra hops |
| Pass@k on a static prompt | Multi-step traces that succeed for the wrong reason |
| Model-vs-model leaderboards | Skill A vs. skill B on your tasks |
| Human eyeballing in the IDE | Repeatable CI signal with an exit code |
skilldiff treats the agent configuration as the unit under test. The model can stay fixed. You swap tools or skills, record both trajectories, and ask a judge: did the variant complete the job with fewer mistakes, or did it introduce a regression?
It is complementary to fatcheck. fatcheck asks whether instruction files should keep growing. skilldiff asks whether a new skill or tool earned its place.
skilldiff Results
┏━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Task ID ┃ Winner ┃ Baseline ┃ Variant ┃ Step Delta ┃ Regression?┃
┡━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ fetch_page… │ variant │ 7.5 │ 8.8 │ 0 │ No │
│ summarize_… │ variant │ 6.0 │ 9.0 │ -1 │ No │
└─────────────┴──────────┴─────────────┴─────────────┴────────────┴────────────┘
╭────────────────────────────────── Summary ───────────────────────────────────╮
│ Total Tasks: 2 · Variant Wins: 2 · Losses: 0 · Ties: 0 · Win Rate: 100.0% │
╰──────────────────────────────────────────────────────────────────────────────╯
Saved results to .agent_diff/results_<timestamp>.json
skilldiff demo
Mock agents, same table and JSON shape as a live run. Use this to confirm the CLI is installed.
skilldiff does not train a model. It diffs two agent configurations on a frozen task suite.
flowchart TD
A["1. You change a tool, skill, or prompt"]
B["2. skilldiff run --quick<br/>baseline vs variant on sanity tasks"]
C["3. Judge scores both trajectories"]
D["4. Table + JSON + exit code"]
A --> B --> C --> D
Inner loop (local)
flowchart TD
L1["skilldiff run --quick"]
L2["Only tasks tagged sanity"]
L3["See winner, step delta, tool regression"]
L1 --> L2 --> L3
Outer loop (CI)
flowchart TD
C1["PR adds a new tool or skill"]
C2["skilldiff run --exit-on-loss --min-win-rate 80"]
C3["Fail if variant loses any task or win rate drops"]
C1 --> C2 --> C3
Judge guards (so the score is not just “whoever spoke last”):
- Short-circuit — identical
final_outputand step count → tie, no LLM call. - Score parity —
winner=variantrequiresvariant_score > baseline_score. - Swap-order —
--swap-orderre-judges with agents swapped; disagreement → tie.
The agent loop and the judge are both LLMs. A single run is a sample, not a measurement.
| Lever | What it does | What it does not do |
|---|---|---|
Agent temperature=0.2 |
Reduces tool-call jitter | Guarantee the same trace twice |
Judge temperature=0.0 |
Makes verdicts stabler | Remove position bias or model drift |
Short-circuit / score parity / --swap-order |
Catch empty-run ties and label/score fights | Replace n-run evals |
--quick |
Cuts task count (and bill) | Change statistical power |
Practical policy: treat --quick as a smoke test. For a merge gate, run the full suite (or fixtures/demo-repo) more than once if a one-point score swing would flip the winner. --swap-order doubles judge calls (and cost). There is no per-token cost field in v0.1 — use the provider dashboard. Do not compare win rates across different judge models.
Python 3.10+.
pip install skilldiff
# or: pipx install skilldiff
# or from a clone:
pip install -e ".[dev]"
Git fallback: pip install git+https://github.com/shunvel/skilldiff.git
Tag v* uploads to PyPI via Trusted Publishing (.github/workflows/publish.yml).
1. Demo
skilldiff demo
2. Cloud (Gemini)
cp .env.example .env # set GEMINI_API_KEY
skilldiff run --quick --provider gemini --model gemini-3.5-flash-lite \
--tasks fixtures/demo-repo/tasks.json \
--baseline-tools fixtures/demo-repo/baseline_tools.py \
--variant-tools fixtures/demo-repo/variant_tools.py
Free-tier gemini-3.5-flash is capped at 20 requests/day. Use gemini-3.5-flash-lite if you hit 429s.
3. Local (Ollama, 16 GB RAM)
# https://ollama.com/download
ollama serve
ollama pull qwen3:8b
skilldiff run --quick --provider ollama --model qwen3:8b \
--tasks fixtures/demo-repo/tasks.json \
--baseline-tools fixtures/demo-repo/baseline_tools.py \
--variant-tools fixtures/demo-repo/variant_tools.py
| Model | RAM (approx.) | Notes |
|---|---|---|
qwen3:8b |
~6 GB | Default. Best local balance for tool calling. |
qwen3:4b |
~3 GB | Faster, weaker tools. |
qwen3:27b |
~18 GB+ | Too large for 16 GB machines. |
If Ollama is not running, both agents fail the same way and the judge short-circuits to a 5.0/5.0 tie. That is a setup miss, not a real comparison.
4. CI gate
skilldiff run --quick --provider gemini --model gemini-3.5-flash-lite \
--tasks fixtures/demo-repo/tasks.json \
--baseline-tools fixtures/demo-repo/baseline_tools.py \
--variant-tools fixtures/demo-repo/variant_tools.py \
--exit-on-loss --min-win-rate 80
Store GEMINI_API_KEY as a CI secret. Never commit .env.
| Flag | Default | Description |
|---|---|---|
--tasks |
tasks.json |
Task suite JSON |
--quick |
off | Only tasks tagged sanity |
--baseline-tools |
required | Python script of baseline tools |
--variant-tools |
required | Python script of variant tools |
--provider |
gemini |
gemini or ollama |
--model |
provider default | e.g. gemini-3.5-flash-lite, qwen3:8b |
--ollama-host |
http://localhost:11434 |
Ollama URL |
--exit-on-loss |
off | Exit 1 if variant loses any task |
--min-win-rate |
none | Exit 1 if win rate is below this |
--output-dir |
.agent_diff |
JSON results directory |
--swap-order |
off | Second judge pass to reduce position bias |
Mock trajectories. No key, no Ollama.