Compare commits

..

24 Commits

Author SHA1 Message Date
9b2a6bcd58 Clear reconciled wayfinder subagents 2026-08-02 14:23:44 -04:00
13cf92f627 fix(slice): write implementation tickets 2026-08-01 22:10:14 -04:00
40b16b8796 fix(skills): require isolated review and test workers 2026-08-01 18:19:32 -04:00
0f2b13c5f9 feat(wayfinder): default to isolated frontier workers 2026-08-01 17:52:09 -04:00
d758f722f9 feat(skills): add isolated worker workflow guidance 2026-08-01 16:37:09 -04:00
346413cd7d Add implementation workflow skills 2026-08-01 12:12:07 -04:00
f283646124 Add slice skill 2026-07-31 23:36:43 -04:00
99df169fbd Relax Wayfinder session ticket limit 2026-07-31 20:46:14 -04:00
8035e0e436 Allow AFK prototype tickets 2026-07-31 20:43:18 -04:00
012a4bfd1e Unify Wayfinder ticket artifacts 2026-07-31 20:38:27 -04:00
b5c6e33730 Tighten grill turn-ending protocol 2026-07-31 19:36:03 -04:00
778e726d4c Trim redundant skill-build fixture 2026-07-31 18:51:34 -04:00
d3bc9a5760 Remove benchmark skill 2026-07-31 18:50:42 -04:00
8479ad096c Remove obsolete skills placeholder 2026-07-31 18:48:54 -04:00
d0c9f94713 Remove consume and wiki skills 2026-07-31 18:45:55 -04:00
942d32dcba Make artifact naming destination-driven 2026-07-31 18:45:11 -04:00
96f795a63a fix(wayfinder): simplify map references 2026-07-31 16:03:00 -04:00
80cecf3350 feat(skills): adapt planning skills to artifact workflow 2026-07-31 15:13:31 -04:00
181dcc7a9e docs: record gitea-axi view limitation 2026-07-31 10:41:45 -04:00
7d22ff0c02 fix(skills): align invocation and prose conventions 2026-07-31 10:40:56 -04:00
4da2452084 feat(wayfinder): add artifact-backed planning skill 2026-07-31 10:35:25 -04:00
7550096968 feat(prototype): add throwaway prototype skill 2026-07-31 10:28:50 -04:00
cbc03650d1 feat(research): add durable research skill 2026-07-31 10:05:24 -04:00
8ad93c7617 feat(skills): support flat numbered artifacts 2026-07-31 09:23:13 -04:00
35 changed files with 1485 additions and 4414 deletions

4
.gitignore vendored
View File

@@ -6,12 +6,8 @@ result-*
# Ignore automatically generated direnv output
.direnv
# Benchmark run artifacts: reports and local history, keyed by skill name.
tests/.reports/
# BEGIN mkSkillsShellHook
# Generated by mkSkillsShellHook. Nix-delivered skill symlinks, kept out of git.
.claude/skills
.agents/skills/gitea-axi
.agents/skills/benchmark-skill
# END mkSkillsShellHook

View File

@@ -1,7 +1,7 @@
# skills
Personal agent skills packaged through Nix.
The domain glossary lives at `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/skills/CONTEXT.md`.
The domain glossary lives at `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/skills/011-skills-context.md`.
## Conventions
@@ -10,11 +10,27 @@ The domain glossary lives at `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/sk
- Skill source lives under `skills/<name>/`.
Do not edit generated links under `.agents/skills/` or `.claude/skills/` as source.
- Run `nix flake check` before considering a repository-wide change complete.
The check builds every packaged skill plus the Home Manager module, shell hook, and benchmark core tests.
The check builds every packaged skill plus the Home Manager module and shell hook.
- The dev shell may place Nix-delivered skills into `.agents/skills/` and maintain `.claude/skills` as a compatibility symlink.
Generated ignore entries belong in the root `.gitignore`, not inside `.agents/skills/`, because skill scanners honor ignore files inside scanned skill directories.
## Gotchas
- `python3` is supplied by the default Nix dev shell, not the ambient environment.
Enter `nix develop` before running Python-based project tools.
- A skill-local `GLOSSARY.md` is runtime reference for that skill and has no relationship to the project's AI-artifacts-vault context glossary.
- This repository owns packaged skill sources only.
Enabling, replacing, or removing them in a consumer repository such as dotfiles is outside its scope.
- `nix flake check` evaluates the Git snapshot and omits untracked skill files.
Use `nix flake check "path:$PWD"` to include a newly created skill before staging it.
- `$(xdg-user-dir DOCUMENTS)/ai-artifacts` is itself an Obsidian vault for AI-generated artifacts, distinct from the personal vault where AI-generated notes are forbidden.
- Project artifact filenames carry globally allocated identifiers.
Discover context and ADR artifacts through the AI artifacts vault convention rather than assuming fixed names or type directories.
- Do not turn opportunistic use of another skill into a declared dependency.
Invocation of an unrelated skill remains the agent's discretion unless the current skill directly requires its contract.
- Do not instruct a skill to execute synchronously.
In-process execution is the baseline, while isolation and parallelism belong to an external caller or runtime.
- When adapting an upstream skill, preserve mechanics the upstream skill leaves unspecified.
Customize only the surfaces required to fit the local workflow rather than turning incidental choices into new contracts.
- The installed `gitea-axi pr view` does not support `--fields`.
Use plain `gitea-axi pr view <number>`.
- Wayfinder `ticket/task/human` tickets can still be implementation work.
They are blocked only at the point where human input is required.

View File

@@ -1,358 +0,0 @@
# Feeds the committed run-bundle fixtures through the benchmark skill's
# deterministic core and asserts the per-arm metrics, the per-case and
# skill-level Efficacy and Regression verdicts, and the rendered report — for
# both the three-arm shape and the degenerate two-arm "no previous version"
# shape.
# It also drives the longitudinal layer: the per-skill history append-and-trim,
# the two trend ribbons including the two-arm gap in the regression series, and
# the per-badge fragility chips on a clean run and a green-but-fragile one.
# Last it drives the all-skills leaderboard: the tiered sort, the not-applicable
# Regression cell, and the links out to each per-skill report.
# No LLM runs.
{
pkgs,
}:
let
core = ../skills/benchmark-skill/core/benchmark_core.py;
threeArm = ./fixtures/benchmark/three-arm-bundle.json;
twoArm = ./fixtures/benchmark/two-arm-bundle.json;
clean = ./fixtures/benchmark/clean-bundle.json;
fragile = ./fixtures/benchmark/fragile-bundle.json;
in
pkgs.runCommandLocal "benchmark-core-check"
{
nativeBuildInputs = [ pkgs.python3 ];
inherit core threeArm twoArm clean fragile;
}
''
fail() { echo "FAIL: $1" >&2; exit 1; }
# --- three-arm run --------------------------------------------------------
echo "the core scores a three-arm run and renders its report"
python3 "$core" "$threeArm" --json three.json --html three.html \
|| fail "the core exited non-zero on the three-arm bundle"
echo "the three-arm results model carries both verdicts, net margins, and metrics"
python3 - three.json <<'PY' || fail "a three-arm results-model assertion failed"
import json, sys
r = json.load(open(sys.argv[1]))
assert r["armShape"] == "three-arm", r["armShape"]
# Efficacy is red: dead-weight fails the wins floor and hard-gate-fail trips
# the gate. Regression is red: regressed-still-valuable loses twice to the
# previous version.
assert r["efficacyVerdict"] == "red", r["efficacyVerdict"]
assert r["regressionVerdict"] == "red", r["regressionVerdict"]
assert r["efficacyNetMargin"] == 12, r["efficacyNetMargin"]
assert r["regressionNetMargin"] == 3, r["regressionNetMargin"]
new = r["armMetrics"]["new"]
assert new["turns"] == 60, new["turns"]
assert new["rawTokens"] == 228000, new["rawTokens"]
assert new["costEquivalentTokens"] == 246000, new["costEquivalentTokens"]
assert abs(new["imputedCost"] - 1.23) < 1e-9, new["imputedCost"]
base = r["armMetrics"]["baseline"]
assert base["turns"] == 40, base["turns"]
assert base["rawTokens"] == 114000, base["rawTokens"]
assert base["costEquivalentTokens"] == 123000, base["costEquivalentTokens"]
prev = r["armMetrics"]["previous"]
assert prev["turns"] == 60, prev["turns"]
assert prev["rawTokens"] == 174000, prev["rawTokens"]
assert prev["costEquivalentTokens"] == 195500, prev["costEquivalentTokens"]
assert abs(prev["imputedCost"] - 0.9775) < 1e-9, prev["imputedCost"]
# Cost-table rows render in arm order: new-skill, previous-version, no-skill.
assert [a["id"] for a in r["arms"]] == ["new", "previous", "baseline"], \
[a["id"] for a in r["arms"]]
cases = {c["name"]: c for c in r["cases"]}
# Authored order is preserved, never reshuffled by verdict.
assert [c["name"] for c in r["cases"]] == [
"clean-both", "regressed-still-valuable", "dead-weight", "hard-gate-fail"
]
a = cases["clean-both"]
assert a["efficacyPassed"] is True
assert a["regressionPassed"] is True
assert a["comparisons"]["efficacy"]["trials"] == ["WIN", "WIN", "WIN", "WIN", "TIE"]
assert a["comparisons"]["regression"]["trials"] == ["TIE", "TIE", "WIN", "TIE", "TIE"]
# Efficacy green but regression red the exact crossing this feature exists
# to catch: still beats no-skill, yet degraded from the released version.
b = cases["regressed-still-valuable"]
assert b["efficacyPassed"] is True
assert b["regressionPassed"] is False
assert b["comparisons"]["regression"]["losses"] == 2
assert b["comparisons"]["regression"]["flaggedLosses"] == [0, 1]
# Efficacy red but regression green already dead weight, but the edit did
# not make it worse.
c = cases["dead-weight"]
assert c["efficacyPassed"] is False
assert c["regressionPassed"] is True
assert c["comparisons"]["efficacy"]["wins"] == 0
assert c["comparisons"]["efficacy"]["losses"] == 1
assert c["comparisons"]["efficacy"]["flaggedLosses"] == [2]
assert c["comparisons"]["regression"]["wins"] == 3
# The hard gate fails efficacy outright but does not gate regression, which
# is judged purely on losses.
d = cases["hard-gate-fail"]
assert d["hardFailed"] is True
assert d["efficacyPassed"] is False
assert d["regressionPassed"] is True
assert d["comparisons"]["efficacy"]["wins"] == 5
print("three-arm results-model assertions passed")
PY
echo "the three-arm report shows both badges, the three-row table, and evidence"
grep -q '<!doctype html>' three.html || fail "three-arm report is not self-contained"
grep -q 'Efficacy: RED' three.html || fail "three-arm report is missing the red Efficacy badge"
grep -q 'Regression: RED' three.html || fail "three-arm report is missing the red Regression badge"
grep -qi 'regress' three.html || fail "three-arm report is missing the verdict headline"
grep -q 'Cost-equiv tokens' three.html || fail "three-arm report is missing the cost table"
grep -q 'Previous version' three.html || fail "three-arm report is missing the previous-version row"
grep -q 'shared-context cache' three.html || fail "three-arm report is missing the cache footnote"
grep -q 'new-vs-no-skill' three.html || fail "three-arm footnote omits the new-vs-no-skill ratio"
grep -q 'new-vs-old' three.html || fail "three-arm footnote omits the new-vs-old ratio"
for name in clean-both regressed-still-valuable dead-weight hard-gate-fail; do
grep -q "$name" three.html || fail "three-arm report omits case $name"
done
grep -q 'class="cell LOSS"' three.html || fail "three-arm report is missing a LOSS cell"
grep -q 'Hard assertion failed' three.html || fail "three-arm report does not flag the hard failure"
grep -q ' open>' three.html || fail "three-arm report does not auto-expand a failing case"
grep -q 'class="cmps"' three.html || fail "three-arm report does not lay comparisons side by side"
# Evidence for the failed regression comparison: new vs previous on trial 1.
grep -q 'OUT-new-regressed-still-valuable-t0' three.html || fail "missing new evidence for the regression loss"
grep -q 'OUT-previous-regressed-still-valuable-t0' three.html || fail "missing previous evidence for the regression loss"
# Evidence for the failed efficacy comparison: new vs baseline on trial 3.
grep -q 'OUT-new-dead-weight-t2' three.html || fail "missing new evidence for the efficacy loss"
grep -q 'OUT-baseline-dead-weight-t2' three.html || fail "missing baseline evidence for the efficacy loss"
# A clean, collapsed case emits no losing-trial evidence.
if grep -q 'OUT-new-clean-both' three.html; then fail "a clean case leaked losing-trial evidence"; fi
# --- two-arm run ----------------------------------------------------------
echo "the core scores the degenerate two-arm run"
python3 "$core" "$twoArm" --json two.json --html two.html \
|| fail "the core exited non-zero on the two-arm bundle"
echo "the two-arm results model reads regression as not-applicable"
python3 - two.json <<'PY' || fail "a two-arm results-model assertion failed"
import json, sys
r = json.load(open(sys.argv[1]))
assert r["armShape"] == "two-arm", r["armShape"]
assert r["efficacyVerdict"] == "red", r["efficacyVerdict"]
assert r["regressionVerdict"] == "not-applicable", r["regressionVerdict"]
assert r["regressionNetMargin"] is None, r["regressionNetMargin"]
assert r["efficacyNetMargin"] == 9, r["efficacyNetMargin"]
new = r["armMetrics"]["new"]
assert new["turns"] == 45, new["turns"]
assert new["rawTokens"] == 171000, new["rawTokens"]
assert new["costEquivalentTokens"] == 184500, new["costEquivalentTokens"]
assert abs(new["imputedCost"] - 0.9225) < 1e-9, new["imputedCost"]
base = r["armMetrics"]["baseline"]
assert base["turns"] == 30, base["turns"]
assert base["rawTokens"] == 85500, base["rawTokens"]
assert base["costEquivalentTokens"] == 92250, base["costEquivalentTokens"]
assert "previous" not in r["armMetrics"], "two-arm run has no previous arm"
assert [c["name"] for c in r["cases"]] == [
"clean-pass", "regresses-baseline", "hard-gate-fail"
]
for c in r["cases"]:
assert c["regressionPassed"] is None, (c["name"], c["regressionPassed"])
b = {c["name"]: c for c in r["cases"]}["regresses-baseline"]
assert b["efficacyPassed"] is False
assert b["comparisons"]["efficacy"]["losses"] == 2
assert b["comparisons"]["efficacy"]["flaggedLosses"] == [3, 4]
h = {c["name"]: c for c in r["cases"]}["hard-gate-fail"]
assert h["hardFailed"] is True
print("two-arm results-model assertions passed")
PY
echo "the two-arm report reads Regression as not-applicable and drops the previous row"
grep -q 'Efficacy: RED' two.html || fail "two-arm report is missing the Efficacy badge"
grep -q 'Regression: N/A' two.html || fail "two-arm report does not read Regression as not-applicable"
grep -q 'new-vs-no-skill' two.html || fail "two-arm footnote omits the new-vs-no-skill ratio"
if grep -q 'new-vs-old' two.html; then fail "two-arm footnote names a new-vs-old ratio that does not apply"; fi
if grep -q 'Previous version' two.html; then fail "two-arm report shows a previous-version row"; fi
grep -q 'OUT-new-regresses-baseline-t3' two.html || fail "missing new evidence for the two-arm efficacy loss"
grep -q 'OUT-baseline-regresses-baseline-t3' two.html || fail "missing baseline evidence for the two-arm efficacy loss"
# --- clean run: fully collapsed, one narrowest-margin chip, ribbons ---------
echo "the core rests a clean run fully collapsed with a lone narrowest-margin chip"
python3 "$core" "$clean" --json clean.json --html clean.html --history clean.history.jsonl \
|| fail "the core exited non-zero on the clean bundle"
python3 - clean.json <<'PY' || fail "a clean-run assertion failed"
import json, sys
r = json.load(open(sys.argv[1]))
assert r["efficacyVerdict"] == "green", r["efficacyVerdict"]
assert r["regressionVerdict"] == "green", r["regressionVerdict"]
cases = {c["name"]: c for c in r["cases"]}
# The narrowest efficacy case (fewest wins) carries the chip, the roomy one does not.
assert [ch["axis"] for ch in cases["narrowest"]["chips"]] == ["efficacy"], cases["narrowest"]["chips"]
assert cases["roomy"]["chips"] == [], cases["roomy"]["chips"]
# The efficacy chip carries the case's win count, not merely its label text.
assert cases["narrowest"]["chips"][0]["wins"] == 3, cases["narrowest"]["chips"]
print("clean-run assertions passed")
PY
if grep -q ' open>' clean.html; then fail "a clean run did not rest fully collapsed"; fi
grep -q 'class="chip efficacy"' clean.html || fail "clean run omits the narrowest-margin efficacy chip"
if grep -q 'class="chip regression"' clean.html; then fail "clean run shows a spurious regression chip"; fi
grep -q 'class="ribbons"' clean.html || fail "clean run omits the trend ribbons"
grep -q 'class="spark"' clean.html || fail "clean run omits a sparkline"
grep -q 'class="ring"' clean.html || fail "clean run does not ring the current run"
# --- history append-and-trim and the two-ribbon window with a two-arm gap ---
echo "the core appends to and trims the per-skill history and plots the ribbon window"
python3 - seed.history.jsonl <<'PY' || fail "seeding the history fixture failed"
import json, sys
# 55 prior runs, all three-arm except the most recent, which is two-arm and so
# must plot a gap on the regression axis once it lands inside the 7-run window.
lines = []
for i in range(55):
two = i == 54
lines.append({
"generatedAt": f"seed-{i}",
"armShape": "two-arm" if two else "three-arm",
"efficacyNet": i % 5,
"efficacyPass": True,
"regressionNet": None if two else i % 3,
"regressionPass": None if two else True,
})
open(sys.argv[1], "w").write("".join(json.dumps(l) + "\n" for l in lines))
PY
python3 "$core" "$clean" --json trend.json --history seed.history.jsonl \
|| fail "the core exited non-zero on the seeded-history run"
python3 - seed.history.jsonl trend.json <<'PY' || fail "a history/trend assertion failed"
import json, sys
lines = [json.loads(l) for l in open(sys.argv[1]) if l.strip()]
# 55 prior + this run = 56, trimmed oldest-first back to the cap of 50.
assert len(lines) == 50, len(lines)
gens = [l["generatedAt"] for l in lines]
assert "seed-0" not in gens and "seed-5" not in gens, "oldest runs were not trimmed"
assert "seed-6" in gens and "seed-54" in gens, "recent runs were wrongly trimmed"
assert lines[-1]["armShape"] == "three-arm", lines[-1]
assert lines[-1]["efficacyNet"] == 8 and lines[-1]["regressionNet"] == 1, lines[-1]
t = json.load(open(sys.argv[2]))["trend"]
eff, reg = t["efficacy"]["points"], t["regression"]["points"]
assert len(eff) == 7 and len(reg) == 7, (len(eff), len(reg))
# Efficacy has a value every run, while regression breaks at the two-arm run.
assert all(p["net"] is not None for p in eff), "efficacy series should have no gaps"
assert eff[-1]["current"] and reg[-1]["current"], "the current run is ringed on both axes"
assert reg[5]["net"] is None, [p["net"] for p in reg]
assert reg[-1]["net"] is not None, "the current three-arm run has a regression dot"
assert t["regression"]["applicable"] == 6, t["regression"]["applicable"]
print("history/trend assertions passed")
PY
# --- green-but-fragile run: independent per-badge chips, both on one case ----
echo "the core chips each fragility axis independently, and both on a doubly-fragile case"
python3 "$core" "$fragile" --json fragile.json --html fragile.html \
|| fail "the core exited non-zero on the fragile bundle"
python3 - fragile.json <<'PY' || fail "a fragility-chip assertion failed"
import json, sys
r = json.load(open(sys.argv[1]))
assert r["efficacyVerdict"] == "green" and r["regressionVerdict"] == "green"
cases = {c["name"]: c for c in r["cases"]}
# One case is both the narrowest efficacy margin and at exactly one regression
# loss, so it carries both chips.
# The others carry at most their own axis.
assert {ch["axis"] for ch in cases["both"]["chips"]} == {"efficacy", "regression"}, cases["both"]["chips"]
assert [ch["axis"] for ch in cases["reg-only"]["chips"]] == ["regression"], cases["reg-only"]["chips"]
assert cases["none"]["chips"] == [], cases["none"]["chips"]
print("fragility-chip assertions passed")
PY
grep -q 'class="chip efficacy"' fragile.html || fail "fragile run omits the efficacy chip"
grep -q 'class="chip regression"' fragile.html || fail "fragile run omits the regression chip"
# --- all-skills leaderboard: tiered sort, the N/A cell, and per-skill links ---
echo "the core ranks per-skill results into a tiered index leaderboard"
# A synthetic clean-green skill whose narrowest efficacy margin sits above the
# floor, so it is the one input that reaches the clean-green tier. The four
# scored models above supply the other tiers: three-arm regresses (tier 0),
# two-arm fails efficacy with regression not-applicable (tier 1), and the
# clean and fragile green runs are both one flip from failing (tier 2).
python3 - robust.results.json leaky.results.json <<'PY' || fail "writing the leaderboard fixtures failed"
import json, sys
# A clean-green skill whose narrowest efficacy margin clears the floor, the
# one input that reaches the clean-green tier.
json.dump({
"skill": "robust-skill",
"efficacyVerdict": "green",
"regressionVerdict": "green",
"cases": [{"chips": [{"axis": "efficacy", "wins": 5}]}],
}, open(sys.argv[1], "w"))
# An efficacy-red skill whose still-green regression axis sits one loss from
# regressing, so it carries a regression chip yet belongs in the red tier.
json.dump({
"skill": "leaky-skill",
"efficacyVerdict": "red",
"regressionVerdict": "green",
"cases": [{"chips": [{"axis": "regression"}]}],
}, open(sys.argv[2], "w"))
PY
python3 "$core" --leaderboard \
three.json two.json clean.json fragile.json robust.results.json leaky.results.json \
--json board.json --html board.html \
|| fail "the core exited non-zero rendering the leaderboard"
python3 - board.json <<'PY' || fail "a leaderboard assertion failed"
import json, sys
rows = json.load(open(sys.argv[1]))
# Any red first regressions above efficacy failures, efficacy failures
# ordered by name then fragile-passing by name, then clean green.
assert [r["skill"] for r in rows] == [
"sample-skill", "leaky-skill", "sample-skill-2arm",
"clean-skill", "fragile-skill", "robust-skill",
], [r["skill"] for r in rows]
assert [r["tier"] for r in rows] == [0, 1, 1, 2, 2, 3], [r["tier"] for r in rows]
by = {r["skill"]: r for r in rows}
# The regressed skill outranks the merely-efficacy-failed ones.
assert by["sample-skill"]["regressionVerdict"] == "red"
# A skill with no previous version reads not-applicable in its Regression cell.
assert by["sample-skill-2arm"]["regressionVerdict"] == "not-applicable"
assert by["sample-skill-2arm"]["efficacyVerdict"] == "red"
# The fragile tier reuses the per-badge chips: a floor-bound efficacy margin,
# a case one loss from regressing, or both.
assert by["clean-skill"]["fragileAxes"] == ["efficacy"], by["clean-skill"]
assert by["fragile-skill"]["fragileAxes"] == ["efficacy", "regression"], by["fragile-skill"]
assert by["robust-skill"]["fragileAxes"] == [], by["robust-skill"]
# A red skill carries no fragility chip even when a still-passing axis is at
# its edge, so the chip stays the marker of the fragile-but-passing tier.
assert by["leaky-skill"]["fragileAxes"] == [], by["leaky-skill"]
# Every row links out to its per-skill report, keyed by skill name.
for r in rows:
assert r["href"] == r["skill"] + ".html", r
print("leaderboard assertions passed")
PY
echo "the leaderboard is self-contained and links out to each per-skill report"
grep -q '<!doctype html>' board.html || fail "the leaderboard is not self-contained"
for skill in sample-skill sample-skill-2arm clean-skill fragile-skill robust-skill leaky-skill; do
grep -q "href=\"$skill.html\"" board.html || fail "the leaderboard omits the link to $skill"
done
grep -q '>N/A<' board.html || fail "the leaderboard omits the not-applicable Regression cell"
grep -q 'near regressing' board.html || fail "the leaderboard omits the regression fragility chip"
grep -q 'narrow efficacy' board.html || fail "the leaderboard omits the efficacy fragility chip"
touch "$out"
''

View File

@@ -1,496 +0,0 @@
{
"skill": "clean-skill",
"generatedAt": "2026-07-24T10:00:00Z",
"temperature": 1.0,
"trialsPerCase": 5,
"arms": [
{
"id": "new",
"label": "New skill"
},
{
"id": "previous",
"label": "Previous version"
},
{
"id": "baseline",
"label": "No skill"
}
],
"comparisons": [
{
"id": "efficacy",
"label": "Efficacy",
"new": "new",
"against": "baseline",
"rule": "efficacy"
},
{
"id": "regression",
"label": "Regression",
"new": "new",
"against": "previous",
"rule": "regression"
}
],
"cases": [
{
"name": "narrowest",
"description": "narrowest scenario",
"softCriteria": [
"a good answer for narrowest"
],
"trials": [
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-narrowest-t0",
"previous": "OUT-previous-narrowest-t0",
"baseline": "OUT-baseline-narrowest-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-narrowest-t1",
"previous": "OUT-previous-narrowest-t1",
"baseline": "OUT-baseline-narrowest-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-narrowest-t2",
"previous": "OUT-previous-narrowest-t2",
"baseline": "OUT-baseline-narrowest-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-narrowest-t3",
"previous": "OUT-previous-narrowest-t3",
"baseline": "OUT-baseline-narrowest-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-narrowest-t4",
"previous": "OUT-previous-narrowest-t4",
"baseline": "OUT-baseline-narrowest-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
}
]
},
{
"name": "roomy",
"description": "roomy scenario",
"softCriteria": [
"a good answer for roomy"
],
"trials": [
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "new",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-roomy-t0",
"previous": "OUT-previous-roomy-t0",
"baseline": "OUT-baseline-roomy-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-roomy-t1",
"previous": "OUT-previous-roomy-t1",
"baseline": "OUT-baseline-roomy-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-roomy-t2",
"previous": "OUT-previous-roomy-t2",
"baseline": "OUT-baseline-roomy-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-roomy-t3",
"previous": "OUT-previous-roomy-t3",
"baseline": "OUT-baseline-roomy-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-roomy-t4",
"previous": "OUT-previous-roomy-t4",
"baseline": "OUT-baseline-roomy-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
}
]
}
]
}

View File

@@ -1,725 +0,0 @@
{
"skill": "fragile-skill",
"generatedAt": "2026-07-24T11:00:00Z",
"temperature": 1.0,
"trialsPerCase": 5,
"arms": [
{
"id": "new",
"label": "New skill"
},
{
"id": "previous",
"label": "Previous version"
},
{
"id": "baseline",
"label": "No skill"
}
],
"comparisons": [
{
"id": "efficacy",
"label": "Efficacy",
"new": "new",
"against": "baseline",
"rule": "efficacy"
},
{
"id": "regression",
"label": "Regression",
"new": "new",
"against": "previous",
"rule": "regression"
}
],
"cases": [
{
"name": "both",
"description": "both scenario",
"softCriteria": [
"a good answer for both"
],
"trials": [
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "new",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-both-t0",
"previous": "OUT-previous-both-t0",
"baseline": "OUT-baseline-both-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-both-t1",
"previous": "OUT-previous-both-t1",
"baseline": "OUT-baseline-both-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-both-t2",
"previous": "OUT-previous-both-t2",
"baseline": "OUT-baseline-both-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-both-t3",
"previous": "OUT-previous-both-t3",
"baseline": "OUT-baseline-both-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "fixture"
},
"regression": {
"winner": "previous",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-both-t4",
"previous": "OUT-previous-both-t4",
"baseline": "OUT-baseline-both-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
}
]
},
{
"name": "reg-only",
"description": "reg-only scenario",
"softCriteria": [
"a good answer for reg-only"
],
"trials": [
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-reg-only-t0",
"previous": "OUT-previous-reg-only-t0",
"baseline": "OUT-baseline-reg-only-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-reg-only-t1",
"previous": "OUT-previous-reg-only-t1",
"baseline": "OUT-baseline-reg-only-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-reg-only-t2",
"previous": "OUT-previous-reg-only-t2",
"baseline": "OUT-baseline-reg-only-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-reg-only-t3",
"previous": "OUT-previous-reg-only-t3",
"baseline": "OUT-baseline-reg-only-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "previous",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-reg-only-t4",
"previous": "OUT-previous-reg-only-t4",
"baseline": "OUT-baseline-reg-only-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
}
]
},
{
"name": "none",
"description": "none scenario",
"softCriteria": [
"a good answer for none"
],
"trials": [
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-none-t0",
"previous": "OUT-previous-none-t0",
"baseline": "OUT-baseline-none-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-none-t1",
"previous": "OUT-previous-none-t1",
"baseline": "OUT-baseline-none-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-none-t2",
"previous": "OUT-previous-none-t2",
"baseline": "OUT-baseline-none-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-none-t3",
"previous": "OUT-previous-none-t3",
"baseline": "OUT-baseline-none-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
},
{
"hard": {
"ran": true,
"pass": true
},
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "fixture"
},
"regression": {
"winner": "tie",
"rationale": "fixture"
}
},
"outputs": {
"new": "OUT-new-none-t4",
"previous": "OUT-previous-none-t4",
"baseline": "OUT-baseline-none-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 500,
"cacheCreation": 200,
"cacheRead": 300,
"turns": 3
},
"previous": {
"input": 900,
"output": 450,
"cacheCreation": 180,
"cacheRead": 270,
"turns": 3
},
"baseline": {
"input": 600,
"output": 300,
"cacheCreation": 0,
"cacheRead": 0,
"turns": 2
}
}
}
]
}
]
}

View File

@@ -1,954 +0,0 @@
{
"skill": "sample-skill",
"generatedAt": "2026-07-24T12:00:00Z",
"temperature": 1.0,
"trialsPerCase": 5,
"arms": [
{
"id": "new",
"label": "New skill"
},
{
"id": "previous",
"label": "Previous version"
},
{
"id": "baseline",
"label": "No skill"
}
],
"comparisons": [
{
"id": "efficacy",
"label": "Efficacy",
"new": "new",
"against": "baseline",
"rule": "efficacy"
},
{
"id": "regression",
"label": "Regression",
"new": "new",
"against": "previous",
"rule": "regression"
}
],
"cases": [
{
"name": "clean-both",
"description": "New beats baseline and holds steady versus the previous version.",
"softCriteria": [
"The answer is grounded in the fixture."
],
"trials": [
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-clean-both-t0",
"previous": "OUT-previous-clean-both-t0",
"baseline": "OUT-baseline-clean-both-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-clean-both-t1",
"previous": "OUT-previous-clean-both-t1",
"baseline": "OUT-baseline-clean-both-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "new",
"rationale": "judge: regression new"
}
},
"outputs": {
"new": "OUT-new-clean-both-t2",
"previous": "OUT-previous-clean-both-t2",
"baseline": "OUT-baseline-clean-both-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-clean-both-t3",
"previous": "OUT-previous-clean-both-t3",
"baseline": "OUT-baseline-clean-both-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "judge: efficacy tie"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-clean-both-t4",
"previous": "OUT-previous-clean-both-t4",
"baseline": "OUT-baseline-clean-both-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
}
]
},
{
"name": "regressed-still-valuable",
"description": "New still beats baseline but has degraded from the previous version.",
"softCriteria": [
"The answer resolves the user's request."
],
"trials": [
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "previous",
"rationale": "judge: regression previous"
}
},
"outputs": {
"new": "OUT-new-regressed-still-valuable-t0",
"previous": "OUT-previous-regressed-still-valuable-t0",
"baseline": "OUT-baseline-regressed-still-valuable-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "previous",
"rationale": "judge: regression previous"
}
},
"outputs": {
"new": "OUT-new-regressed-still-valuable-t1",
"previous": "OUT-previous-regressed-still-valuable-t1",
"baseline": "OUT-baseline-regressed-still-valuable-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-regressed-still-valuable-t2",
"previous": "OUT-previous-regressed-still-valuable-t2",
"baseline": "OUT-baseline-regressed-still-valuable-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "judge: efficacy tie"
},
"regression": {
"winner": "new",
"rationale": "judge: regression new"
}
},
"outputs": {
"new": "OUT-new-regressed-still-valuable-t3",
"previous": "OUT-previous-regressed-still-valuable-t3",
"baseline": "OUT-baseline-regressed-still-valuable-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-regressed-still-valuable-t4",
"previous": "OUT-previous-regressed-still-valuable-t4",
"baseline": "OUT-baseline-regressed-still-valuable-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
}
]
},
{
"name": "dead-weight",
"description": "New does not beat baseline, but the edit did not make it worse.",
"softCriteria": [
"The answer is correct."
],
"trials": [
{
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "judge: efficacy tie"
},
"regression": {
"winner": "new",
"rationale": "judge: regression new"
}
},
"outputs": {
"new": "OUT-new-dead-weight-t0",
"previous": "OUT-previous-dead-weight-t0",
"baseline": "OUT-baseline-dead-weight-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "judge: efficacy tie"
},
"regression": {
"winner": "new",
"rationale": "judge: regression new"
}
},
"outputs": {
"new": "OUT-new-dead-weight-t1",
"previous": "OUT-previous-dead-weight-t1",
"baseline": "OUT-baseline-dead-weight-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "baseline",
"rationale": "judge: efficacy baseline"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-dead-weight-t2",
"previous": "OUT-previous-dead-weight-t2",
"baseline": "OUT-baseline-dead-weight-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "judge: efficacy tie"
},
"regression": {
"winner": "new",
"rationale": "judge: regression new"
}
},
"outputs": {
"new": "OUT-new-dead-weight-t3",
"previous": "OUT-previous-dead-weight-t3",
"baseline": "OUT-baseline-dead-weight-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "judge: efficacy tie"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-dead-weight-t4",
"previous": "OUT-previous-dead-weight-t4",
"baseline": "OUT-baseline-dead-weight-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
}
]
},
{
"name": "hard-gate-fail",
"description": "New sweeps both head-to-heads but violates a hard assertion.",
"softCriteria": [
"The output is well-formed."
],
"trials": [
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t0",
"previous": "OUT-previous-hard-gate-fail-t0",
"baseline": "OUT-baseline-hard-gate-fail-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t1",
"previous": "OUT-previous-hard-gate-fail-t1",
"baseline": "OUT-baseline-hard-gate-fail-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t2",
"previous": "OUT-previous-hard-gate-fail-t2",
"baseline": "OUT-baseline-hard-gate-fail-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": false
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t3",
"previous": "OUT-previous-hard-gate-fail-t3",
"baseline": "OUT-baseline-hard-gate-fail-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
},
"regression": {
"winner": "tie",
"rationale": "judge: regression tie"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t4",
"previous": "OUT-previous-hard-gate-fail-t4",
"baseline": "OUT-baseline-hard-gate-fail-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
},
"previous": {
"input": 800,
"output": 1600,
"cacheCreation": 300,
"cacheRead": 6000,
"turns": 3
}
},
"hard": {
"ran": true,
"pass": true
}
}
]
}
]
}

View File

@@ -1,515 +0,0 @@
{
"skill": "sample-skill-2arm",
"generatedAt": "2026-07-24T12:00:00Z",
"temperature": 1.0,
"trialsPerCase": 5,
"arms": [
{
"id": "new",
"label": "New skill"
},
{
"id": "baseline",
"label": "No skill"
}
],
"comparisons": [
{
"id": "efficacy",
"label": "Efficacy",
"new": "new",
"against": "baseline",
"rule": "efficacy"
}
],
"cases": [
{
"name": "clean-pass",
"description": "New skill reliably beats the no-skill baseline.",
"softCriteria": [
"The answer is grounded in the fixture.",
"The answer follows the skill's format."
],
"trials": [
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-clean-pass-t0",
"baseline": "OUT-baseline-clean-pass-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-clean-pass-t1",
"baseline": "OUT-baseline-clean-pass-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-clean-pass-t2",
"baseline": "OUT-baseline-clean-pass-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-clean-pass-t3",
"baseline": "OUT-baseline-clean-pass-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "judge: efficacy tie"
}
},
"outputs": {
"new": "OUT-new-clean-pass-t4",
"baseline": "OUT-baseline-clean-pass-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": true
}
}
]
},
{
"name": "regresses-baseline",
"description": "New skill does not reliably beat the baseline.",
"softCriteria": [
"The answer resolves the user's request."
],
"trials": [
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-regresses-baseline-t0",
"baseline": "OUT-baseline-regresses-baseline-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-regresses-baseline-t1",
"baseline": "OUT-baseline-regresses-baseline-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
}
},
{
"comparisons": {
"efficacy": {
"winner": "tie",
"rationale": "judge: efficacy tie"
}
},
"outputs": {
"new": "OUT-new-regresses-baseline-t2",
"baseline": "OUT-baseline-regresses-baseline-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
}
},
{
"comparisons": {
"efficacy": {
"winner": "baseline",
"rationale": "judge: efficacy baseline"
}
},
"outputs": {
"new": "OUT-new-regresses-baseline-t3",
"baseline": "OUT-baseline-regresses-baseline-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
}
},
{
"comparisons": {
"efficacy": {
"winner": "baseline",
"rationale": "judge: efficacy baseline"
}
},
"outputs": {
"new": "OUT-new-regresses-baseline-t4",
"baseline": "OUT-baseline-regresses-baseline-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
}
}
]
},
{
"name": "hard-gate-fail",
"description": "Output wins the head-to-head but violates a hard assertion.",
"softCriteria": [
"The output is correct."
],
"trials": [
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t0",
"baseline": "OUT-baseline-hard-gate-fail-t0"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t1",
"baseline": "OUT-baseline-hard-gate-fail-t1"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t2",
"baseline": "OUT-baseline-hard-gate-fail-t2"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": false
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t3",
"baseline": "OUT-baseline-hard-gate-fail-t3"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": true
}
},
{
"comparisons": {
"efficacy": {
"winner": "new",
"rationale": "judge: efficacy new"
}
},
"outputs": {
"new": "OUT-new-hard-gate-fail-t4",
"baseline": "OUT-baseline-hard-gate-fail-t4"
},
"usage": {
"new": {
"input": 1000,
"output": 2000,
"cacheCreation": 400,
"cacheRead": 8000,
"turns": 3
},
"baseline": {
"input": 500,
"output": 1000,
"cacheCreation": 200,
"cacheRead": 4000,
"turns": 2
}
},
"hard": {
"ran": true,
"pass": true
}
}
]
}
]
}

View File

@@ -1 +0,0 @@
# delta — another top-level skill

View File

@@ -34,8 +34,8 @@ pkgs.runCommandLocal "skill-build-check"
echo "content tier: discovery finds every skill regardless of nesting depth,"
echo " and stops at a skill rather than descending into its assets"
[ "$expectedNames" = "alpha beta delta gamma" ] \
|| fail "discovered names were [$expectedNames], expected [alpha beta delta gamma]"
[ "$expectedNames" = "alpha beta gamma" ] \
|| fail "discovered names were [$expectedNames], expected [alpha beta gamma]"
echo "content tier: each built skill has SKILL.md at its \$out root"
beta_path=

View File

@@ -90,26 +90,18 @@
inherit pkgs mkSkill mkSkillsShellHook;
};
# Proves the benchmark skill's deterministic core at its single seam:
# it feeds committed fixtures to the core and asserts the metrics, the
# Efficacy verdict, and the rendered report.
benchmark-core = import ./checks/benchmark-core.nix {
inherit pkgs;
};
};
# A working shell for developing skills in this repo.
# Python runs the benchmark core, while gitea-axi backs its project skill.
# Both project skills are placed into ./.agents/skills/ on entry, with
# ./.claude/skills as a compatibility symlink.
# The gitea-axi project skill is placed into ./.agents/skills/ on entry,
# with ./.claude/skills as a compatibility symlink.
devShells.default = pkgs.mkShell {
packages = [
pkgs.python3
gitea-axi.packages.${system}.gitea-axi
];
shellHook = mkSkillsShellHook [
gitea-axi.packages.${system}.gitea-axi-skill
(skillPackages pkgs).benchmark-skill
];
};
}

View File

View File

@@ -1,50 +0,0 @@
# The `case.md` authoring contract
Tests live in a top-level `tests/` tree that mirrors `skills/` by full path.
A skill at `skills/<maybe/cosmetic/nesting>/<skill>/` has its tests at `tests/skills/<maybe/cosmetic/nesting>/<skill>/`.
Under that mirror point, each **case** is its own directory holding a `case.md` and an optional fixture.
Tests sit outside `skills/` on purpose: a skill is packaged and placed on its own, and its tests must never ride along.
## `case.md`
```
---
description: <one-line scenario>
---
## Prompt
<the realistic user request, given identically to every arm>
## Seed (optional; conversation-based skills only)
**User:** ...
**Assistant:** ...
## Hard assertions (executable; $OUTPUT = arm's final message, $WORLD = its fixture copy)
```sh
test -f "$WORLD/review.md"
grep -qE '<pattern>' "$OUTPUT"
```
## Soft criteria
- <a statement the judge grounds the comparisons on>
```
- **`description`** — a one-line summary of the scenario, in the frontmatter.
- **`## Prompt`** — the realistic user request.
It is authored once and arm-agnostically, and every arm receives it verbatim.
Do not mention the skill by name or hint that a skill exists, or the baseline arm stops being an honest counterfactual.
- **`## Seed`** — optional, for conversation-driven skills whose input is a discussion rather than a file tree.
It is a role-tagged transcript (`**User:**` / `**Assistant:**`) injected as the subagent's prior context before the prompt.
- **`## Hard assertions`** — optional, a `sh` code block whose lines are each a separate predicate, together forming a deterministic gate.
Each predicate runs with `$OUTPUT` bound to the path of the arm's captured final message and `$WORLD` bound to the path of that arm's fresh fixture copy.
The gate passes only when **every** predicate exits zero — evaluate them so an earlier failure is never masked by a later success, not by a block's trailing exit code alone.
Any non-zero exit fails the gate, and a failed gate fails the case outright, against the new-skill arm only.
- **`## Soft criteria`** — at least one natural-language statement the blind judge grounds its comparisons on.
Describe what a good answer looks like, not which arm should win.
## Fixtures
A case ships a hermetic, committed fixture so a run is reproducible and needs no live external state.
File-and-tree skills get a fixture directory named `fixture/` beside `case.md`, whose contents populate each arm's world root — so a `$WORLD/<file>` predicate names a file directly under `fixture/`.
Conversation-driven skills use `## Seed` instead.
Every arm-and-trial combination runs against a **fresh copy** of the fixture, so writes never leak between runs.

View File

@@ -1,216 +0,0 @@
---
name: benchmark-skill
description: Benchmark a skill's efficacy against a no-skill baseline and, when a released version exists, its regression against that version, rendering an HTML report. Run deliberately as /benchmark-skill <name> for one skill, or /benchmark-skill with no argument for the all-skills leaderboard, never automatically.
disable-model-invocation: true
---
# benchmark-skill
Prove that a skill genuinely improves the agent's work rather than reading well and adding nothing.
Running `/benchmark-skill <name>` executes that skill's authored test cases as a controlled experiment and produces a self-contained HTML report carrying two independent verdicts: an **Efficacy verdict** (does the skill beat no-skill) and a **Regression verdict** (did my in-progress edit degrade it from the released version).
Running `/benchmark-skill` with **no argument** benchmarks every skill that follows the `tests/` convention and renders an index leaderboard over their reports (step 7).
Each case runs a **new-skill arm** (the working tree) and a **no-skill baseline arm**, and — whenever the skill already exists on main and its directory differs from that released state — a third **previous-version arm** materialized from main's `HEAD`.
Each arm runs several times, and a blind judge decides which arm's output better satisfies the case's author-written expectations.
Two head-to-heads fall out of the arms per trial: **efficacy** pairs the new arm against no-skill, and **regression** pairs it against the previous version.
When the skill is brand-new or unchanged from main, there is no previous version to compare against and the run degrades to the two-arm efficacy-only shape, with the Regression verdict reading not-applicable.
This skill runs **in-session as an AI script**: you orchestrate the arms and judges as subagents via the workflow mechanism, so the whole battery stays on the interactive subscription quota.
The mechanical, non-judgment work — summing token usage, collapsing verdicts, applying the pass rules, rendering the report — is done by a committed program, [`core/benchmark_core.py`](core/benchmark_core.py), so the numbers are exact and reproducible rather than re-derived each run.
You do the judgment work — running arms and judging — that the agent is actually good at.
The authoring contract for a test case is [`CASE-FORMAT.md`](CASE-FORMAT.md).
Read it before you read the target skill's tests.
Report artifacts live under a git-ignored `tests/.reports/` directory at the repo root, flat and keyed by skill name.
Run from the repo root: every path in the steps below is relative to it.
## 1. Resolve the target and validate its tests tree
The user passes the skill name as `<name>`.
With **no `<name>`** you are in the all-skills mode: skip to step 7, which enumerates the skills and drives steps 16 for each.
Find the skill's directory by its leaf name under `skills/` (any depth), and find its tests at the mirror point under `tests/skills/…/<name>/`.
If no skill directory maps to `<name>`, stop and say so.
If the skill exists but has no tests directory or no case directories, report that the skill has no tests and stop — there is nothing to benchmark.
Validate the shape of the tests tree at run time:
- Each case directory has a `case.md` that parses per `CASE-FORMAT.md`.
- Any fixture a case references exists.
- The test directory maps to a real skill.
Report any malformed case and stop.
A benchmark on a broken tree would produce meaningless numbers.
Done when every case parses, its fixture exists, and you have the case list in stable authored order.
## 2. Fix the arms and per-run settings
Always run a **new-skill arm** and a **no-skill baseline arm**.
Add a third **previous-version arm** exactly when a released version exists to compare against, decided automatically with no flag or argument:
- Resolve the repo's default branch dynamically — `git symbolic-ref refs/remotes/origin/HEAD` (or `git remote show origin`), never a hardcoded `"main"` literal — and call its tip `HEAD`.
- Diff the skill's directory against `HEAD` (`git diff --quiet HEAD -- <skill-dir>`). Add the previous-version arm only when the directory both **exists at `HEAD`** and **differs** from it.
- A brand-new skill absent from `HEAD`, or a skill unchanged from it, has no meaningful previous version, so the run stays two-arm efficacy-only.
Arms run at the session's realistic default temperature (around 1.0), so the result reflects whether the skill *reliably* helps across variance rather than helping once by luck.
Per-arm temperature is not settable through the in-session workflow surface, so a skill's temperature-zero override for a genuinely mechanical task is a documented knob for the future headless path, not something to set here.
Each case runs **5 paired trials**.
For each trial, trial *i*'s new-skill output is judged against trial *i*'s no-skill output for efficacy and — on a three-arm run — against trial *i*'s previous-version output for regression.
There is no reuse of arms or judgments across arms or runs.
## 3. Run the arms and judges as subagents
Use the workflow mechanism (the `Workflow` tool) to fan out the arms and judges.
For each case, for each of the 5 trials, run every arm, then judge each comparison's pair.
**Every arm receives the identical `## Prompt`, authored once and arm-agnostically.**
For a conversation-driven case, inject the `## Seed` transcript as the subagent's prior context before the prompt.
**Give each arm-and-trial a hermetic fixture-only world.**
Make a fresh copy of the case fixture *outside the repo* — under a system temp path such as one from `mktemp -d`, never under `tests/.reports/`.
That copy is the **world**: it is the arm subagent's **working directory** and the `$WORLD` the hard-assertion gate reads, so a `$WORLD/<file>` predicate resolves against the fixture root.
Because the world lives outside the repo, nothing under `skills/` or the grading `tests/` tree sits on any path the arm reaches from there, so the baseline cannot discover the skill's assets and no arm can read its own case's soft criteria or hard assertions.
Each arm-and-trial gets its own fresh world, so writes never leak between them.
- **New-skill arm** — force-invoke the skill.
Materialize the skill into an **isolated temp path outside the world** — a copy of its working-tree directory, so it reflects uncommitted edits and carries none of its repo surroundings.
Point the subagent at that copy, tell it to use that skill, and have it read the skill's `SKILL.md` and any assets it references, so the real skill machinery is exercised.
Its working directory is the fresh world, and it also receives the prompt.
- **Previous-version arm** (three-arm runs only) — force-invoked identically to the new-skill arm, differing only in which skill it points at.
Materialize the skill's directory **at the default branch's `HEAD`** into its own isolated temp path (`git --work-tree=<temp> checkout HEAD -- <skill-dir>`, or `git archive HEAD <skill-dir>` piped into the temp path), since each skill is self-contained and needs none of the rest of the repo.
Point the subagent at that checkout and otherwise treat it exactly as the new-skill arm — same world, same prompt.
- **No-skill baseline arm** — the honest counterfactual of the skill not existing.
Materialize no skill for it: give it the bare prompt with the skill absent from its context, and do not mention the skill or hint that one exists.
Instruct it to stay within its working directory, since the isolation is soft and the subagent shares the machine.
The cases are held fixed to the working tree: all arms run against today's prompt, fixture, and expectations, so the skill version is the only variable between the new and previous-version arms.
Capture each arm's **final message** to a file — this is the `$OUTPUT` the hard-assertion gate reads and the text the judge compares.
**The judge** — one blind judge subagent per trial per comparison, so a three-arm trial draws two judgments (efficacy and regression) and a two-arm trial draws one.
For each comparison, show the judge the two arms' final messages as unlabelled **A** and **B**, with the order randomized per trial (record which of A/B is the new arm so you can map the verdict back).
The same judge machinery serves both comparisons; only the pair of outputs handed over differs — efficacy pairs new against no-skill, regression pairs new against the previous version.
Ground it on the case's `## Soft criteria` rather than letting it free-form its own standard, and instruct it explicitly to **discount mere length and formatting differences** — a skill must not win by being more verbose.
Have it return a single winner: A, B, or tie.
## 4. Run the hard-assertion gate
Run the case's `## Hard assertions` against the **new arm only**, once per trial, with `$OUTPUT` and `$WORLD` bound as `CASE-FORMAT.md` defines — that trial's new-arm final message and its world.
Record each trial's pass or fail into the bundle for the core to score.
A case with no `## Hard assertions` block simply has no gate.
## 5. Collect the run data
The deterministic core is a pure transform: it takes the collected data and returns the results model and HTML.
Assemble one **run bundle** JSON with this shape and write it under `tests/.reports/.work/<name>-bundle.json`:
The shape below is the **three-arm** run.
For a two-arm run, drop the `previous` arm, drop the `regression` comparison, and drop the `previous` key from each trial's `outputs` and `usage` — the core reads the arm shape off the presence of a regression comparison.
```json
{
"skill": "<name>",
"generatedAt": "<ISO-8601 timestamp>",
"temperature": 1.0,
"trialsPerCase": 5,
"arms": [
{"id": "new", "label": "New skill"},
{"id": "previous", "label": "Previous version"},
{"id": "baseline", "label": "No skill"}
],
"comparisons": [
{"id": "efficacy", "label": "Efficacy", "new": "new", "against": "baseline", "rule": "efficacy"},
{"id": "regression", "label": "Regression", "new": "new", "against": "previous", "rule": "regression"}
],
"cases": [
{
"name": "<case directory name>",
"description": "<from case.md frontmatter>",
"softCriteria": ["<each ## Soft criteria entry>"],
"trials": [
{
"hard": {"ran": true, "pass": true},
"comparisons": {
"efficacy": {"winner": "new", "rationale": "<judge's one line>"},
"regression": {"winner": "tie", "rationale": "<judge's one line>"}
},
"outputs": {
"new": "<new arm's final message>",
"previous": "<previous-version arm's final message>",
"baseline": "<no-skill arm's final message>"
},
"usage": {
"new": {"input": 0, "output": 0, "cacheCreation": 0, "cacheRead": 0, "turns": 0},
"previous": {"input": 0, "output": 0, "cacheCreation": 0, "cacheRead": 0, "turns": 0},
"baseline": {"input": 0, "output": 0, "cacheCreation": 0, "cacheRead": 0, "turns": 0}
}
}
]
}
]
}
```
- **`comparisons`** carries one entry per head-to-head, keyed by the comparison id.
`regression` is present only on a three-arm run.
Each **`winner`** is an arm id (`"new"`, `"baseline"`, or `"previous"`) or `"tie"`, mapped back from that comparison's blind A/B answer.
- **`hard`** carries the gate result for that trial's new arm.
Omit it or set `ran: false` when the case has no hard assertions.
The gate feeds the Efficacy axis only.
The Regression axis is judged purely on the head-to-head.
- **`outputs`** is each arm's captured final message, keyed by arm id.
The core surfaces the losing-trial pair as report evidence, so a failed comparison shows the new arm's output beside the one it lost to.
- **`usage`** is the per-arm-per-trial transcript usage.
Recover it by reading each arm-subagent's transcript file (the per-agent JSONL the workflow writes) and summing each message's token usage into the four components — `input`, `output`, `cacheCreation` (cache-creation input tokens), `cacheRead` (cache-read input tokens).
`turns` is the count of tool-call rounds in that transcript.
If a transcript genuinely lacks usage data, record zeros rather than guessing — cost never gates a verdict.
## 6. Score and render
Run the core over the bundle, writing the report and a machine-readable model:
```sh
python3 skills/benchmark-skill/core/benchmark_core.py \
tests/.reports/.work/<name>-bundle.json \
--json tests/.reports/<name>.results.json \
--html tests/.reports/<name>.html \
--history tests/.reports/<name>.history.jsonl
```
The core collapses each trial of each comparison to a WIN, TIE, or LOSS for the new arm, applies each comparison's pass rule — efficacy passes at wins ≥ 3 and losses ≤ 1, regression passes at losses ≤ 1 with no wins floor — flags any loss for human review, and yields the two skill-level verdicts: **Efficacy** (green when every case beats no-skill) and **Regression** (green when no case degraded, not-applicable on a two-arm run).
With `--history` it appends this run's summary line — each axis's net margin and pass/fail plus the two-arm/three-arm flag — to the per-skill history file, trimming it oldest-first at roughly the last fifty runs.
That history file lives in the git-ignored reports directory and is ephemeral: cleaning the directory resets it, consistent with reports being transient artifacts.
It renders the self-contained HTML report — the two verdict badges, two stacked trend ribbons plotting each axis's net-margin over the recent runs (the regression ribbon leaving a gap for any two-arm run), a headline reading the badges together, run metadata, the per-arm cost table (a previous-version row on a three-arm run), and the cases in stable authored order, each auto-expanding on any failure or flagged loss to show the losing-trial output pair — alongside the machine-readable model.
A clean run rests fully collapsed, and each green badge still flags its most fragile case with a chip so a barely-green skill cannot look robust.
Cost is reported but never gates a verdict.
Clean up the scratch when done: remove the `tests/.reports/.work/` directory and every per-arm world and skill materialization you created under the system temp path — including the previous-version checkout.
Done when `tests/.reports/<name>.html` exists.
Report both verdicts, the path to the report, and any flagged losses or regressions to the user.
## 7. Benchmark every skill and render the leaderboard
This step runs only in the all-skills mode — `/benchmark-skill` with no `<name>`.
Enumerate every skill the same way step 1 resolves one: each skill directory under `skills/` (any depth) whose mirror point under `tests/skills/…/` holds case directories.
A skill with no tests directory is skipped rather than failing the batch; note which skills were skipped.
Run steps 16 for each skill in turn, so each writes its own per-skill report and results model under `tests/.reports/`, flat and keyed by skill name — the per-skill HTML is latest-only and overwritten each run, since the longitudinal data lives in the per-skill history file.
Then render the index over every per-skill results model:
```sh
python3 skills/benchmark-skill/core/benchmark_core.py --leaderboard \
tests/.reports/*.results.json \
--html tests/.reports/index.html \
--generated-at "<ISO-8601 timestamp>"
```
The core sorts the rows — any red first with regressions ordered above efficacy failures, then fragile-but-passing skills, then clean green — and links each row out to its `<name>.html`.
A skill with no previous version reads not-applicable in its Regression cell.
The fragile-but-passing tier reuses the per-badge fragility signal from the per-skill reports: a case one loss from regressing, or a narrowest efficacy margin sitting on the pass floor.
Done when `tests/.reports/index.html` exists.
Report the leaderboard path, and per skill both verdicts and any flagged losses or regressions, to the user.

View File

@@ -1,852 +0,0 @@
#!/usr/bin/env python3
"""Deterministic scoring and rendering for a skill benchmark run.
A pure transform: given a collected run bundle (per-arm transcript usage,
hard-assertion results, and the per-trial judge verdicts for each comparison) it
produces the results model and a self-contained HTML report. No LLM, no network,
no clock — the `generatedAt` stamp is supplied by the caller so the transform
stays pure.
The model is parameterized over the arms and the comparisons, so one path serves
both the three-arm run (efficacy against no-skill and regression against the
previous version) and the degenerate two-arm run with no previous version.
When `--history` names a per-skill history file, the run's summary line is
appended to it, the file is trimmed oldest-first, and the report grows two trend
ribbons plotted from the recent tail. That file read-and-rewrite is the only side
effect, opt-in and deterministic given the same file contents and inputs.
Given `--leaderboard`, the positional arguments are read as several per-skill
results models instead, and the transform yields the index leaderboard: one row
per skill carrying both verdicts, sorted with regressions first, then efficacy
failures, then fragile-but-passing skills, then clean green.
Usage:
benchmark_core.py <bundle.json> [--json <out.json>] [--html <out.html>]
[--history <hist.jsonl>]
benchmark_core.py --leaderboard <results.json>... [--json <out.json>]
[--html <out.html>] [--generated-at <stamp>]
With no output flags it writes the model as JSON to stdout.
"""
import argparse
import html
import json
import sys
# Opus 4.8 per-million-token rates, in US dollars.
# Cache creation is the 5-minute-TTL write, priced at 1.25x input.
# Cache read is priced at 0.1x input.
# Cost is reported alongside quality but never gates a verdict.
DEFAULT_PRICING = {
"input": 5.0,
"output": 25.0,
"cacheCreation": 6.25,
"cacheRead": 0.5,
}
USAGE_COMPONENTS = ("input", "output", "cacheCreation", "cacheRead")
WIN, TIE, LOSS = "WIN", "TIE", "LOSS"
# The per-skill history is a JSON-lines tail of run summaries kept in the
# git-ignored reports directory.
# It is capped and trimmed oldest-first, and the ribbons plot only its most
# recent window.
HISTORY_CAP = 50
RIBBON_WINDOW = 7
# Efficacy passes at three wins, so this is the floor a green case sits above.
EFFICACY_WINS_FLOOR = 3
def _arm_usage_totals(bundle, arm_id):
"""Sum an arm's transcript usage across every case and trial."""
totals = {c: 0 for c in USAGE_COMPONENTS}
turns = 0
for case in bundle["cases"]:
for trial in case["trials"]:
usage = trial["usage"][arm_id]
for c in USAGE_COMPONENTS:
totals[c] += usage.get(c, 0)
turns += usage.get("turns", 0)
return totals, turns
def _arm_metrics(bundle, arm_id, pricing):
components, turns = _arm_usage_totals(bundle, arm_id)
raw_tokens = sum(components.values())
imputed_cost = sum(components[c] * pricing[c] for c in USAGE_COMPONENTS) / 1_000_000
# Cost-equivalent tokens: the dollar cost expressed in units of base input
# tokens, so a single figure captures the pricing-weighted total.
cost_equivalent_tokens = round(imputed_cost * 1_000_000 / pricing["input"])
return {
"turns": turns,
"rawTokens": raw_tokens,
"components": components,
"costEquivalentTokens": cost_equivalent_tokens,
"imputedCost": imputed_cost,
}
def _collapse_trial(verdict, comparison):
"""A trial's head-to-head becomes WIN, TIE, or LOSS for the new arm.
A tie is a non-win. Any winner that is neither the new nor the against arm
(a malformed verdict) is treated as a tie rather than crashing the run.
"""
winner = verdict.get("winner")
if winner == comparison["new"]:
return WIN
if winner == comparison["against"]:
return LOSS
return TIE
# Each comparison names a pass rule keyed here.
# Efficacy hunts for a reliable win, so it needs a wins floor.
# Regression hunts for a degradation, so a tie is already a success and only losses matter.
PASS_RULES = {
"efficacy": lambda wins, losses: wins >= 3 and losses <= 1,
"regression": lambda wins, losses: losses <= 1,
}
def _comparison_by_rule(comparisons, rule):
"""The comparison carrying a given pass rule, or None if absent."""
return next((c for c in comparisons if c["rule"] == rule), None)
def _score_case(case, comparisons):
hard_failed = any(
t.get("hard", {}).get("ran") and not t["hard"].get("pass", False)
for t in case["trials"]
)
per_comparison = {}
for comp in comparisons:
strip, flagged, evidence = [], [], []
for i, trial in enumerate(case["trials"]):
outcome = _collapse_trial(trial["comparisons"][comp["id"]], comp)
strip.append(outcome)
if outcome == LOSS:
flagged.append(i)
# The losing-trial output pair lets the report surface the new
# arm's output beside the one it lost to, for a human to eyeball.
outputs = trial.get("outputs", {})
evidence.append({
"trial": i,
"new": outputs.get(comp["new"], ""),
"against": outputs.get(comp["against"], ""),
})
wins = strip.count(WIN)
ties = strip.count(TIE)
losses = strip.count(LOSS)
head_to_head = PASS_RULES[comp["rule"]](wins, losses)
# The hard gate is new-arm-only and fails efficacy outright.
# It catches the current skill emitting malformed output.
# Regression is relative to the previous version, so it is judged purely on losses.
passed = head_to_head and not (hard_failed and comp["rule"] == "efficacy")
per_comparison[comp["id"]] = {
"trials": strip,
"wins": wins,
"ties": ties,
"losses": losses,
"passed": passed,
"flaggedLosses": flagged,
"evidence": evidence,
}
efficacy_id = _comparison_by_rule(comparisons, "efficacy")["id"]
regression = _comparison_by_rule(comparisons, "regression")
return {
"name": case["name"],
"description": case.get("description", ""),
"softCriteria": case.get("softCriteria", []),
"hardFailed": hard_failed,
"comparisons": per_comparison,
"efficacyPassed": per_comparison[efficacy_id]["passed"],
"regressionPassed": (
per_comparison[regression["id"]]["passed"] if regression else None
),
}
def _net_margin(cases, comparison_id):
"""Wins minus losses for a comparison, summed across every case."""
total = 0
for case in cases:
comp = case["comparisons"][comparison_id]
total += comp["wins"] - comp["losses"]
return total
def _flag_fragility(cases, efficacy_id, regression, efficacy_green, regression_green):
"""Chip the most fragile passing case on each green axis.
A green run still names its weakest case so a barely-green skill cannot pass
for robust. The efficacy chip lands on the single case closest to dropping
under the three-win floor, ties broken by authored order. The regression chip
lands on every case sitting at its one tolerated loss, so a case fragile on
both axes carries both.
"""
for case in cases:
case["chips"] = []
if efficacy_green and cases:
narrowest = min(cases, key=lambda c: c["comparisons"][efficacy_id]["wins"])
wins = narrowest["comparisons"][efficacy_id]["wins"]
narrowest["chips"].append({
"axis": "efficacy",
"wins": wins,
"label": f"narrowest efficacy margin · {wins}W",
})
if regression is not None and regression_green:
for case in cases:
if case["comparisons"][regression["id"]]["losses"] == 1:
case["chips"].append({
"axis": "regression",
"label": "one loss from regressing",
})
def build_results(bundle):
"""Turn a run bundle into the results model."""
pricing = DEFAULT_PRICING
comparisons = bundle["comparisons"]
arms = bundle["arms"]
regression = _comparison_by_rule(comparisons, "regression")
arm_metrics = {a["id"]: _arm_metrics(bundle, a["id"], pricing) for a in arms}
cases = [_score_case(c, comparisons) for c in bundle["cases"]]
efficacy_id = _comparison_by_rule(comparisons, "efficacy")["id"]
efficacy_green = all(c["efficacyPassed"] for c in cases)
# No previous-version arm means the regression axis has nothing to measure,
# so it reads not-applicable rather than green or red.
if regression is None:
regression_verdict = "not-applicable"
regression_net = None
else:
regression_verdict = (
"green" if all(c["regressionPassed"] for c in cases) else "red"
)
regression_net = _net_margin(cases, regression["id"])
_flag_fragility(
cases, efficacy_id, regression, efficacy_green, regression_verdict == "green"
)
return {
"skill": bundle["skill"],
"generatedAt": bundle.get("generatedAt", ""),
"temperature": bundle.get("temperature"),
"trialsPerCase": bundle.get("trialsPerCase"),
"armShape": "three-arm" if regression is not None else "two-arm",
"arms": arms,
"comparisons": comparisons,
"efficacyVerdict": "green" if efficacy_green else "red",
"regressionVerdict": regression_verdict,
"efficacyNetMargin": _net_margin(cases, efficacy_id),
"regressionNetMargin": regression_net,
"armMetrics": arm_metrics,
"cases": cases,
}
# --- History and trend --------------------------------------------------------
def summary_line(results):
"""The one-line run summary appended to the per-skill history.
It records each axis's net margin and pass/fail plus the arm shape — all the
ribbons need to redraw both sparklines and show a gap for any two-arm run. A
two-arm run has no regression measurement, so both its regression fields are
null.
"""
three_arm = results["armShape"] == "three-arm"
return {
"generatedAt": results.get("generatedAt", ""),
"armShape": results["armShape"],
"efficacyNet": results["efficacyNetMargin"],
"efficacyPass": results["efficacyVerdict"] == "green",
"regressionNet": results["regressionNetMargin"],
"regressionPass": (results["regressionVerdict"] == "green") if three_arm else None,
}
def load_history(path):
"""Read the JSON-lines history, tolerating a missing or empty file."""
try:
with open(path) as f:
return [json.loads(line) for line in f if line.strip()]
except FileNotFoundError:
return []
def trim_history(lines):
"""Keep the most recent runs, dropping the oldest past the cap."""
return lines[-HISTORY_CAP:]
def write_history(path, lines):
"""Rewrite the history file with the given lines, oldest first."""
with open(path, "w") as f:
for line in lines:
f.write(json.dumps(line) + "\n")
def build_trend(series):
"""Ribbon data for both axes over the most recent window of runs.
A run with no value on an axis — a two-arm run on the regression axis — plots
no dot and breaks the line, so the gap reads as absent rather than being
interpolated across. The delta compares against the previous run that actually
carries a value on that axis, so a two-arm gap does not blank the comparison.
"""
window = series[-RIBBON_WINDOW:]
def axis(net_key, pass_key):
points = [
{
"net": run.get(net_key),
"pass": run.get(pass_key),
"current": i == len(window) - 1,
}
for i, run in enumerate(window)
]
valued = [p for p in points if p["net"] is not None]
current_net = points[-1]["net"] if points else None
delta = None
if current_net is not None and len(valued) >= 2:
delta = valued[-1]["net"] - valued[-2]["net"]
return {
"points": points,
"current": current_net,
"delta": delta,
"green": sum(1 for p in points if p["pass"] is True),
"applicable": len(valued),
}
return {
"efficacy": axis("efficacyNet", "efficacyPass"),
"regression": axis("regressionNet", "regressionPass"),
}
# --- All-skills leaderboard ---------------------------------------------------
def _fragile_axes(results):
"""The axes on which a passing skill sits one trial-flip from failing.
Reuses the per-badge fragility chips rather than recomputing margins: the
regression chip already marks a case one loss from regressing, and the
efficacy chip marks the narrowest case, fragile exactly when its win count
rests on the pass floor. A green run always chips its narrowest efficacy
case, so the floor test is what tells a barely-green skill from a roomy one.
"""
axes = set()
for case in results["cases"]:
for chip in case.get("chips", []):
if chip["axis"] == "regression":
axes.add("regression")
elif chip["axis"] == "efficacy" and chip.get("wins") == EFFICACY_WINS_FLOOR:
axes.add("efficacy")
return sorted(axes)
def _leaderboard_tier(results, fragile):
"""The sort tier, most urgent first.
A regression outranks an efficacy failure because it means a skill that was
working just broke — the sharper signal mid-edit. A passing skill still one
flip from failing sorts above a clean sweep.
"""
if results["regressionVerdict"] == "red":
return 0
if results["efficacyVerdict"] == "red":
return 1
if fragile:
return 2
return 3
def build_leaderboard(models):
"""Rank per-skill results into leaderboard rows, most urgent first.
Rows within a tier order by skill name, so the board diffs cleanly run to run.
"""
rows = []
for m in models:
axes = _fragile_axes(m)
tier = _leaderboard_tier(m, bool(axes))
rows.append({
"skill": m["skill"],
"efficacyVerdict": m["efficacyVerdict"],
"regressionVerdict": m["regressionVerdict"],
# Fragility marks a passing skill one flip from failing, so a red skill
# carries no chip even when a still-passing axis is at its edge.
"fragileAxes": axes if tier == 2 else [],
"tier": tier,
"href": f"{m['skill']}.html",
})
rows.sort(key=lambda r: (r["tier"], r["skill"]))
return rows
# --- HTML rendering -----------------------------------------------------------
_STYLE = """
:root { color-scheme: light; }
body { font: 15px/1.5 -apple-system, system-ui, sans-serif; margin: 0; padding: 2rem;
color: #1a1a1a; background: #fafafa; }
.wrap { max-width: 60rem; margin: 0 auto; }
h1 { font-size: 1.4rem; margin: 0 0 .25rem; }
.badges { display: flex; gap: .5rem; margin: .25rem 0; flex-wrap: wrap; }
.badge { display: inline-block; padding: .2rem .7rem; border-radius: 999px;
font-weight: 600; font-size: .85rem; }
.badge.green { background: #d6f5df; color: #0f6b34; }
.badge.red { background: #fbdcdc; color: #9b1c1c; }
.badge.na { background: #eee; color: #666; }
.headline { font-size: 1.02rem; font-weight: 600; margin: .8rem 0 .2rem; }
.meta { color: #666; font-size: .85rem; margin: .5rem 0 1rem; }
.ribbons { display: grid; gap: .5rem; margin: .5rem 0 1.5rem; }
.ribbon { display: grid; grid-template-columns: 6.5rem 1fr auto; align-items: center;
gap: 1rem; border: 1px solid #e5e5e5; border-radius: 8px;
padding: .5rem .9rem; background: #fff; }
.rlabel { font-weight: 600; font-size: .85rem; }
.spark { width: 100%; height: 44px; display: block; }
.spark .line { fill: none; stroke: #c4c4c4; stroke-width: 1.5; }
.spark .zero { stroke: #e5e5e5; stroke-width: 1; stroke-dasharray: 2 3; }
.spark .dot.pass { fill: #2f9e5f; }
.spark .dot.fail { fill: #c0392b; }
.spark .ring { fill: none; stroke: #1a1a1a; stroke-width: 1.5; }
.readout { font-size: .8rem; color: #555; white-space: nowrap; text-align: right; }
.readout .up { color: #0f6b34; font-weight: 600; }
.readout .down { color: #9b1c1c; font-weight: 600; }
.chip { display: inline-block; margin-left: .5rem; padding: .05rem .55rem;
border-radius: 999px; font-size: .7rem; font-weight: 600;
vertical-align: middle; }
.chip.efficacy { background: #fff1cf; color: #8a5a00; }
.chip.regression { background: #e9e2fb; color: #5b3ea8; }
table { border-collapse: collapse; width: 100%; margin: .5rem 0; font-size: .9rem; }
th, td { text-align: right; padding: .4rem .6rem; border-bottom: 1px solid #e5e5e5; }
th:first-child, td:first-child { text-align: left; }
thead th { border-bottom: 2px solid #ccc; }
.footnote { color: #777; font-size: .8rem; margin: .3rem 0 1.5rem; }
.board td, .board th { text-align: left; }
.board td.verdict, .board th.verdict { text-align: right; }
.board a { color: #1a56c4; text-decoration: none; font-weight: 600; }
.board a:hover { text-decoration: underline; }
.case { border: 1px solid #e5e5e5; border-radius: 8px; padding: 1rem 1.25rem;
margin: .75rem 0; background: #fff; }
.case.fail { border-color: #f0b6b6; }
.case .desc { color: #666; font-size: .85rem; margin: 0 0 .6rem; }
.strip { display: flex; gap: .3rem; margin: .3rem 0; flex-wrap: wrap; }
.cell { width: 2.6rem; text-align: center; padding: .2rem 0; border-radius: 4px;
font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.cell.WIN { background: #d6f5df; color: #0f6b34; }
.cell.TIE { background: #eee; color: #555; }
.cell.LOSS { background: #fbdcdc; color: #9b1c1c; }
.result { font-size: .85rem; font-weight: 600; }
.result.pass { color: #0f6b34; }
.result.fail { color: #9b1c1c; }
.tag { font-size: .75rem; color: #9b1c1c; font-weight: 600; }
.crit { color: #555; font-size: .82rem; margin: .5rem 0 0; padding-left: 1.1rem; }
.case > summary { cursor: pointer; font-weight: 600; font-size: 1rem;
list-style-position: outside; }
.case > summary::marker { color: #999; }
.cmps { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
gap: 1rem; align-items: start; margin: .5rem 0 .2rem; }
.cmp { min-width: 0; }
.evidence { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
gap: .6rem; margin: .4rem 0 0; }
.evidence figure { margin: 0; }
.evidence figcaption { font-size: .72rem; color: #666; font-weight: 600;
margin: 0 0 .2rem; }
.evidence pre { margin: 0; padding: .5rem .6rem; background: #f6f6f6;
border: 1px solid #e5e5e5; border-radius: 4px; font-size: .78rem;
white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence .lead { grid-column: 1 / -1; font-size: .78rem; color: #9b1c1c;
font-weight: 600; margin: .3rem 0 0; }
"""
def _document(title, body):
"""Wrap rendered body markup in the self-contained HTML document shell."""
return (
"<!doctype html><html><head><meta charset=\"utf-8\">"
f"<title>{title}</title><style>{_STYLE}</style></head><body>"
+ body
+ "</body></html>"
)
def _fmt_int(n):
return f"{n:,}"
def _fmt_cost(d):
return f"${d:,.4f}"
def _plural(n, noun):
return f"{n} {noun}" if n == 1 else f"{n} {noun}s"
def _headline(results):
"""One 'so what' sentence reading the two verdicts together.
Every clause it states is backed by a verdict or a case count rendered on the
same screen.
"""
eff = results["efficacyVerdict"]
reg = results["regressionVerdict"]
eff_fail = sum(1 for c in results["cases"] if not c["efficacyPassed"])
reg_fail = sum(1 for c in results["cases"] if c["regressionPassed"] is False)
if reg == "not-applicable":
if eff == "green":
return "This skill earns its keep against no-skill, with no previous version to regress against."
return (f"This skill does not beat no-skill on {_plural(eff_fail, 'case')}, "
"with no previous version to regress against.")
if eff == "green" and reg == "green":
return "This skill earns its keep and this edit held quality steady."
if eff == "green" and reg == "red":
return f"Still valuable, but this edit regressed {_plural(reg_fail, 'case')}."
if eff == "red" and reg == "green":
return (f"This skill does not beat no-skill on {_plural(eff_fail, 'case')}, "
"but this edit did not make it worse.")
return (f"This skill does not beat no-skill on {_plural(eff_fail, 'case')} "
f"and this edit regressed {_plural(reg_fail, 'case')}.")
_BADGE_TEXT = {"green": "GREEN", "red": "RED", "not-applicable": "N/A"}
_BADGE_CLASS = {"green": "green", "red": "red", "not-applicable": "na"}
def _state_badge(state):
return f"<span class=\"badge {_BADGE_CLASS[state]}\">{_BADGE_TEXT[state]}</span>"
def _badge(label, state):
return f"<span class=\"badge {_BADGE_CLASS[state]}\">{label}: {_BADGE_TEXT[state]}</span>"
def _sparkline(points, width=240, height=44):
"""An inline SVG net-margin sparkline where gaps break the line and drop no dot."""
nets = [p["net"] for p in points if p["net"] is not None]
if not nets:
return f"<svg viewBox=\"0 0 {width} {height}\" class=\"spark\"></svg>"
pad_x, pad_y = 10, 9
lo, hi = min(nets), max(nets)
n = len(points)
def x(i):
return width / 2 if n == 1 else pad_x + i * (width - 2 * pad_x) / (n - 1)
def y(v):
if hi == lo:
return height / 2
return height - pad_y - (v - lo) / (hi - lo) * (height - 2 * pad_y)
parts = [
f"<svg viewBox=\"0 0 {width} {height}\" class=\"spark\" "
"preserveAspectRatio=\"xMidYMid meet\" xmlns=\"http://www.w3.org/2000/svg\">"
]
if lo < 0 < hi:
zy = y(0)
parts.append(f"<line x1=\"0\" y1=\"{zy:.1f}\" x2=\"{width}\" y2=\"{zy:.1f}\" class=\"zero\"/>")
# Split the run into contiguous valued segments so a gap leaves a real break.
segments, current = [], []
for i, p in enumerate(points):
if p["net"] is None:
if current:
segments.append(current)
current = []
else:
current.append((x(i), y(p["net"])))
if current:
segments.append(current)
for seg in segments:
if len(seg) >= 2:
coords = " ".join(f"{px:.1f},{py:.1f}" for px, py in seg)
parts.append(f"<polyline points=\"{coords}\" class=\"line\"/>")
for i, p in enumerate(points):
if p["net"] is None:
continue
cx, cy = x(i), y(p["net"])
if p["current"]:
parts.append(f"<circle cx=\"{cx:.1f}\" cy=\"{cy:.1f}\" r=\"5.5\" class=\"ring\"/>")
cls = "dot pass" if p["pass"] else "dot fail"
parts.append(f"<circle cx=\"{cx:.1f}\" cy=\"{cy:.1f}\" r=\"3\" class=\"{cls}\"/>")
parts.append("</svg>")
return "".join(parts)
def _ribbon_readout(axis):
"""The net / delta-vs-previous / green-count line beneath a ribbon."""
net = "net —" if axis["current"] is None else f"net {axis['current']:+d}"
delta = axis["delta"]
if delta is None:
change = ""
elif delta > 0:
change = f"<span class=\"up\">▲ {delta}</span> vs prev"
elif delta < 0:
change = f"<span class=\"down\">▼ {abs(delta)}</span> vs prev"
else:
change = "±0 vs prev"
if axis["applicable"]:
green = f"{axis['green']}/{axis['applicable']} green"
else:
green = "no runs yet"
return " · ".join(bit for bit in (net, change, green) if bit)
def _render_ribbons(results):
"""Two stacked net-margin ribbons, empty when no history was supplied."""
trend = results.get("trend")
if not trend:
return ""
out = ["<div class=\"ribbons\">"]
for key, label in (("efficacy", "Efficacy"), ("regression", "Regression")):
axis = trend[key]
out.append("<div class=\"ribbon\">")
out.append(f"<div class=\"rlabel\">{label}</div>")
out.append(_sparkline(axis["points"]))
out.append(f"<div class=\"readout\">{_ribbon_readout(axis)}</div>")
out.append("</div>")
out.append("</div>")
return "".join(out)
def render_html(results):
e = html.escape
arm_labels = {a["id"]: a["label"] for a in results["arms"]}
three_arm = results["armShape"] == "three-arm"
out = []
out.append("<div class=\"wrap\">")
out.append(f"<h1>Benchmark — {e(results['skill'])}</h1>")
out.append("<div class=\"badges\">")
out.append(_badge("Efficacy", results["efficacyVerdict"]))
out.append(_badge("Regression", results["regressionVerdict"]))
out.append("</div>")
meta_bits = [f"arm shape: {e(results['armShape'])}"]
if results.get("trialsPerCase") is not None:
meta_bits.append(f"{results['trialsPerCase']} trials/case")
if results.get("temperature") is not None:
meta_bits.append(f"temperature {results['temperature']}")
if results.get("generatedAt"):
meta_bits.append(e(results["generatedAt"]))
out.append(f"<div class=\"meta\">{' · '.join(meta_bits)}</div>")
out.append(_render_ribbons(results))
out.append(f"<p class=\"headline\">{e(_headline(results))}</p>")
# Per-arm cost table.
out.append("<table><thead><tr><th>Arm</th><th>Turns</th><th>Raw tokens</th>"
"<th>Cost-equiv tokens</th><th>Imputed cost</th></tr></thead><tbody>")
for arm in results["arms"]:
m = results["armMetrics"][arm["id"]]
out.append(
f"<tr><td>{e(arm['label'])}</td><td>{_fmt_int(m['turns'])}</td>"
f"<td>{_fmt_int(m['rawTokens'])}</td>"
f"<td>{_fmt_int(m['costEquivalentTokens'])}</td>"
f"<td>{_fmt_cost(m['imputedCost'])}</td></tr>"
)
out.append("</tbody></table>")
if three_arm:
footnote = ("Absolute cost is inflated by shared-context cache overhead, "
"so the trustworthy signals are two ratios: new-vs-no-skill "
"(what the skill costs over nothing) and new-vs-old (what this "
"edit added or saved), not the absolute figures.")
else:
footnote = ("Absolute cost is inflated by shared-context cache overhead, "
"so the trustworthy signal is the new-vs-no-skill ratio, not "
"the absolute figures.")
out.append(f"<p class=\"footnote\">{footnote}</p>")
# Cases in stable authored order, each a collapsible panel that auto-expands
# when either comparison fails or carries a flagged loss.
for case in results["cases"]:
comps = case["comparisons"]
expanded = case["hardFailed"] or any(
c["flaggedLosses"] or not c["passed"] for c in comps.values()
)
failed = (not case["efficacyPassed"]) or case["regressionPassed"] is False
cls = "case fail" if failed else "case"
opened = " open" if expanded else ""
chips = "".join(
f"<span class=\"chip {ch['axis']}\">{e(ch['label'])}</span>"
for ch in case.get("chips", [])
)
out.append(f"<details class=\"{cls}\"{opened}>")
out.append(f"<summary>{e(case['name'])}{chips}</summary>")
if case["description"]:
out.append(f"<p class=\"desc\">{e(case['description'])}</p>")
if case["hardFailed"]:
out.append("<p class=\"tag\">Hard assertion failed — case fails outright.</p>")
out.append("<div class=\"cmps\">")
for comp in results["comparisons"]:
c = comps[comp["id"]]
out.append("<div class=\"cmp\">")
out.append(f"<div><strong>{e(comp['label'])}</strong></div>")
out.append("<div class=\"strip\">")
for outcome in c["trials"]:
out.append(f"<span class=\"cell {outcome}\">{outcome}</span>")
out.append("</div>")
rc = "pass" if c["passed"] else "fail"
summary = (f"{c['wins']}W / {c['ties']}T / {c['losses']}L — "
f"{'PASS' if c['passed'] else 'FAIL'}")
out.append(f"<div class=\"result {rc}\">{summary}</div>")
if c["flaggedLosses"]:
trials = ", ".join(f"#{i + 1}" for i in c["flaggedLosses"])
out.append(f"<div class=\"tag\">Loss flagged for review: trial {trials}</div>")
new_label = arm_labels.get(comp["new"], comp["new"])
against_label = arm_labels.get(comp["against"], comp["against"])
for ev in c["evidence"]:
out.append("<div class=\"evidence\">")
out.append(f"<p class=\"lead\">Trial #{ev['trial'] + 1} — losing output pair</p>")
out.append(
f"<figure><figcaption>{e(new_label)}</figcaption>"
f"<pre>{e(ev['new'])}</pre></figure>"
)
out.append(
f"<figure><figcaption>{e(against_label)}</figcaption>"
f"<pre>{e(ev['against'])}</pre></figure>"
)
out.append("</div>")
out.append("</div>")
out.append("</div>")
if case["softCriteria"]:
out.append("<ul class=\"crit\">")
for crit in case["softCriteria"]:
out.append(f"<li>{e(crit)}</li>")
out.append("</ul>")
out.append("</details>")
out.append("</div>")
return _document(f"Benchmark — {e(results['skill'])}", "".join(out))
_FRAGILE_LABEL = {"efficacy": "narrow efficacy", "regression": "near regressing"}
def render_leaderboard(rows, generated_at=""):
"""The all-skills index: one linked row per skill carrying both verdicts."""
e = html.escape
out = ["<div class=\"wrap\">", "<h1>Skill benchmarks</h1>"]
meta = [e(generated_at)] if generated_at else []
meta.append(_plural(len(rows), "skill"))
out.append(f"<div class=\"meta\">{' · '.join(meta)}</div>")
out.append("<table class=\"board\"><thead><tr><th>Skill</th>"
"<th class=\"verdict\">Efficacy</th>"
"<th class=\"verdict\">Regression</th></tr></thead><tbody>")
for r in rows:
chips = "".join(
f"<span class=\"chip {axis}\">{_FRAGILE_LABEL[axis]}</span>"
for axis in r["fragileAxes"]
)
out.append(
f"<tr><td><a href=\"{e(r['href'])}\">{e(r['skill'])}</a>{chips}</td>"
f"<td class=\"verdict\">{_state_badge(r['efficacyVerdict'])}</td>"
f"<td class=\"verdict\">{_state_badge(r['regressionVerdict'])}</td></tr>"
)
out.append("</tbody></table></div>")
return _document("Skill benchmarks", "".join(out))
def _write_outputs(model, render, json_out, html_out):
"""Emit a model as JSON and/or rendered HTML, or to stdout if neither given."""
if json_out:
with open(json_out, "w") as f:
json.dump(model, f, indent=2)
if html_out:
with open(html_out, "w") as f:
f.write(render())
if not json_out and not html_out:
json.dump(model, sys.stdout, indent=2)
sys.stdout.write("\n")
def main(argv=None):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"inputs",
nargs="+",
help="the run-bundle JSON, or the per-skill results JSONs with --leaderboard",
)
parser.add_argument("--json", dest="json_out", help="write the model here")
parser.add_argument("--html", dest="html_out", help="write the HTML here")
parser.add_argument(
"--history",
dest="history",
help="append this run to the JSON-lines history file and draw the trend ribbons",
)
parser.add_argument(
"--leaderboard",
action="store_true",
help="render the index leaderboard over the given per-skill results JSONs",
)
parser.add_argument(
"--generated-at",
dest="generated_at",
default="",
help="timestamp stamped on the leaderboard index",
)
args = parser.parse_args(argv)
if args.leaderboard:
if args.history:
parser.error("--history does not apply in leaderboard mode")
models = []
for path in args.inputs:
with open(path) as f:
models.append(json.load(f))
rows = build_leaderboard(models)
_write_outputs(
rows, lambda: render_leaderboard(rows, args.generated_at),
args.json_out, args.html_out,
)
return 0
if len(args.inputs) != 1:
parser.error("scoring a run takes exactly one bundle; use --leaderboard for many")
with open(args.inputs[0]) as f:
bundle = json.load(f)
results = build_results(bundle)
if args.history:
series = load_history(args.history) + [summary_line(results)]
write_history(args.history, trim_history(series))
results["trend"] = build_trend(series)
_write_outputs(
results, lambda: render_html(results), args.json_out, args.html_out
)
return 0
if __name__ == "__main__":
raise SystemExit(main())

View File

@@ -1,131 +0,0 @@
---
name: consume
description: "Consume a project (or, later, another source) into the agent's AI-managed wiki — distil generalized, transferable knowledge into the artifact store, then clear the consumed scaffolding. Deliberate: run as /skill:consume [target], never automatically."
disable-model-invocation: true
---
# consume
Mine a source for its knowledge, routing each fact to the agent's AI-managed wiki or the target's always-loaded docs, then clear the consumed scaffolding once the knowledge is safely captured.
`/consume [target]` ingests one target — a filesystem path, defaulting to the current directory — and distils what it mines into two channels.
It is the write side of a pair with the read-only `/wiki`, which it invokes to read the rest of the AI-managed wiki.
The **pull channel** is the wiki — reusable knowledge a future agent retrieves on demand — and a fact earns a note there only if it both **generalizes** past the target it came from and is **trigger-able**, meaning some symptom, error, or task would send that agent looking for it.
The **push channel** is the target's own always-loaded documentation, its `AGENTS.md`, which carries what is useful but not wiki-shaped: a concrete repo-specific answer, or a proactive rule whose value is firing unprompted.
A single fact mined from the source usually splits across both — the transferable general lesson to the pull channel, the specific residue it leaves behind to the push channel.
Nothing is written and nothing is deleted until the user approves the plan.
## The write surfaces
Consume writes to two channels and nowhere else.
The AI-managed wiki lives at `$(xdg-user-dir DOCUMENTS)/ai-artifacts/wiki`.
Resolve it, and if it does not exist report that the wiki is unreachable and stop.
Write pull-channel notes only directly under that flat directory.
Outside the wiki, the sanctioned content write is the target's own always-loaded documentation, its `AGENTS.md` — the push channel of step 6.
Everything else in the target is read-only.
All reading of the wider AI-managed wiki goes through `/wiki` (step 3).
## 1. Select the branch
Resolve the artifact project directory as `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>`, where `<project>` is the lowercase basename of the target directory.
Route the target through this ladder, first match wins:
- An artifact project directory containing `spec/` or `tasks/` → a project: follow [`project.md`](project.md).
- No rung matches → report that the target is not something consume knows how to read, write nothing, and stop.
Done when a branch file is selected, or consume has stopped on an unsupported target.
## 2. Read the target and establish ground truth
Follow the selected branch file to understand the target's *current* state.
The branch file names its source of truth and what within the target is merely stale intent; ground your understanding in the former, never the latter.
Done when you understand what the target actually is now, from its branch's source of truth.
## 3. Read what the wiki already knows
Two reads with different jobs:
- Invoke `/wiki` on the concepts the target raised, to learn what the whole AI-managed wiki already holds — so new notes link to existing notes and hubs, and you do not re-capture knowledge the wiki already has.
- Scan the AI-managed wiki directly for the concept notes you may need to enrich.
Done when you know which existing notes bear on what you are about to write.
## 4. Plan the notes
Route every fact you mined through two acceptance axes.
- **Generalizes** — it teaches something that holds on a *different* target, not a fact true only of this one.
- **Trigger-able** — a recognizable symptom, error, or task would send a future agent to retrieve it.
Two premises stand behind trigger-ability.
The wiki is retrieval-on-demand, so knowledge whose only value is firing *unprompted* does not belong there however well it generalizes.
And the reader is an amnesiac agent, so "the reader will internalize it" is never a reason to keep a note — trigger-ability, not memorability, is the axis.
A fact earns a **pull-channel note** only when it passes *both* axes.
A fact that fails either axis but is still useful to the target goes to the **push channel**, the target's `AGENTS.md`: a **specific residue** that fails *generalizes* (the concrete repo-specific answer), or a **proactive rule** that generalizes but is not trigger-able (a verification-discipline or design-stance rule whose value is firing unprompted).
A fact that fails both axes and is useful to no one is dropped.
Most source lines split rather than route whole: the transferable **general lesson** goes to the pull channel, the **specific residue** it leaves behind goes to the push channel — recorded in the target's `AGENTS.md` when that file does not already hold it.
So plan both destinations together, deciding for each pull-channel note whether it is new or an update to an existing note whose knowledge is now stale or thinner than what you have learned.
Keep each pull-channel note atomic — one transferable idea per note.
When a note carries two independent lessons, split it.
Write as many notes as the knowledge warrants; the count follows from atomicity, not from a target number.
Then build the contribution map: for every file you consumed, the notes it feeds and the exact sections that contributed — including any file that fed no note, recorded as feeding nothing.
The mapping is many-to-many — one file may feed several notes, and one note may draw on several files.
Done when every mined fact has a decided destination — pull note, push item, or explicit drop — every pull-channel note passes both axes and is atomic, and every consumed file, including those feeding no note, is mapped with its contributing sections named.
## 5. Present the plan and wait for approval
Write the plan as a self-contained HTML file to the session's scratchpad directory and give the user its path.
The report is a complete ledger of every mined fact's disposition, not only of what gets written, so the selection bar itself can be reviewed:
1. **Wiki write-set (pull)** — each note to write or update, with its **trigger line**: one sentence naming the symptom, error, or task that would send a reader to retrieve it, and the `[[hub]]` wikilinks it belongs under.
2. **Contribution map** — for every consumed file, the notes it feeds and the exact contributing sections, including any file that fed nothing.
3. **Push write-set (target `AGENTS.md`)** — each proactive rule and each specific residue to add, each existing entry to trim to its residue, and each pure-general entry to remove, with the exact text and where it lands.
4. **Ref-fixes** — each file holding a reference to a spec or task file about to be deleted, and how the reference is fixed or removed. These accompany the scaffolding deletion of step 7, not the target write-set.
5. **Flagged, not authored** — any `[[hub]]` a note links that does not yet exist under `tags/`, and any push knowledge whose home is a hook or checklist rather than `AGENTS.md` — surfaced for the user to act on by hand.
6. **Drops** — every mined fact considered and cut, one line of why each.
The wiki write-set and the target-`AGENTS.md` write-set are approved independently: the user may accept one and decline the other.
A declined target write-set degrades to flagged suggestions — reported for the user to apply by hand, written nowhere.
The ref-fixes and the scaffolding deletion are not a write-set to accept or decline — they follow from proceeding with the run and execute in step 7, gated only behind the wiki writes.
Stop and wait for the user's explicit approval.
Write nothing and delete nothing until they approve.
Done when the user has ruled on each write-set.
## 6. Write the notes and reconcile the push channel
Write the approved wiki write-set first.
Write each new note directly under the output area the branch declares as distilled markdown.
When updating an existing note, preserve its format.
Link a hub whether or not its note exists yet — a dangling `[[hub]]` is a valid link and still feeds `/wiki` recall.
Then, if the target write-set was approved, reconcile the target's `AGENTS.md`: add the proactive rules and any specific residue the file does not already hold, trim mixed entries to their specific residue, and remove the pure-general entries.
Removal is gated on capture — trim or remove an entry only when its general part is present in the wiki, written just now in this run or confirmed already there via `/wiki`, never on the intention to write a note.
If the target write-set was declined, write nothing to the target and leave its items as the flagged suggestions of step 5.
Done when the approved wiki notes are written and, if approved, the target's `AGENTS.md` is reconciled.
## 7. Clear the consumed scaffolding
With the notes written, perform the branch's cleanup — the branch file names exactly what to remove and what references to repair.
Deletion never precedes the writes of step 6.
Done when the branch's cleanup has run.
## 8. Report
Tell the user what you created, updated, and left untouched across both channels — wiki notes written or updated, and the target's `AGENTS.md` reconciliation applied or, if declined, left as flagged suggestions.
Repeat the suggested new hubs and any hook-or-checklist items from the report, so the wiki's `tags/` and the target's other channels can be filled in by hand.
Done when the summary names every note written or updated, every target edit applied or flagged, and every suggested hub.

View File

@@ -1,33 +0,0 @@
# project branch
How consume reads a project target, and what it clears afterward.
Reached from step 1 of [`SKILL.md`](SKILL.md) when the target's artifact project directory contains `spec/` or `tasks/`.
## Read the source, mine the specs
The source code is the truth for *what* the project is and does now.
Read it thoroughly enough to understand its current state and to surface the reusable ideas it embodies — techniques, patterns, decisions, gotchas.
A gotcha usually carries two separable things — a transferable principle and a concrete repo-specific answer — so surface both.
Step 4 of SKILL.md routes the principle to the pull channel and the residue to the target's push channel.
The artifact project's `spec/` and `tasks/` directories are the canonical record of *why* — the reasoning, trade-offs, and intent behind what the code became.
They are the richest source of the generalizable lessons, and cleanup destroys them, so mine their reasoning now or lose it.
But they are not current fact: where a spec or task disagrees with the source, the source wins, and where one describes work later abandoned or changed, the source is what actually happened.
Together these are the raw material the writing logic generalizes; extracting the generalized notes themselves is step 4 of SKILL.md, not this branch's job.
Done when you understand the project's current state from its source and have mined its specs and tasks for the reasoning behind it.
## Output location
Project notes land flat under `$(xdg-user-dir DOCUMENTS)/ai-artifacts/wiki/`.
Do not create subdirectories there.
## Cleanup
After the notes are written (step 6 of SKILL.md), delete the spec and task files that were present under the artifact project's `spec/` and `tasks/` directories when you read the project in step 2 — the scaffolding this run consumed.
A file added after that read is not swept up.
Remove `spec/` or `tasks/` when the cleanup leaves it empty.
Deleting those files can strand references to them.
Scan the target and its artifact project directory for pointers to each file about to be deleted — in `AGENTS.md`, `CONTEXT.md`, ADRs, and sibling specs — and fix or remove each one, following the pointer wherever it lands rather than checking the push channel alone.

View File

@@ -1,4 +1,4 @@
# CONTEXT.md Format
# Context Artifact Format
## Structure

View File

@@ -10,6 +10,9 @@ Keep going not until it feels like you understand each other, but until the deci
Ask one question at a time, in plain text, and wait for the answer before the next.
Never use an interactive question tool.
While the interview is active, every assistant turn must end with exactly one of: the next numbered question, the final decision summary, or a plain statement that grill is paused because the user explicitly changed tasks.
If the turn includes a correction, file edit, apology, or explanation, follow it with the next numbered question unless the user explicitly paused grill or changed tasks.
Do not use dangling transition phrases such as “continuing” unless the continuation is actually present in the same message.
Every question carries **options** — the concrete choices, each with its trade-offs — followed by your **recommendation**, the option you would pick and why.
When the question turns on an existing document, artifact, or piece of code, open it with a **context quote**: blockquote the exact passage, so the user sees what you mean without hunting for it.
@@ -21,21 +24,23 @@ This holds even when another skill invoked grill: grill delivers its summary and
## 1. Select the mode
Resolve the artifact root with `$(xdg-user-dir DOCUMENTS)/ai-artifacts`.
Use the lowercase basename of the current working directory as `<project>`.
The context file is `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>/CONTEXT.md`.
Its sibling `adr/` directory owns the project's ADRs.
Create the project directory and `adr/` only when a write requires them.
Resolve the artifact destination before looking for or creating artifacts.
Default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when a write requires it.
Read the destination's `AGENTS.md` before any artifact write.
Inspect the destination directly for its context artifact, using the destination naming convention instead of assuming a filename.
- **Domain Modeling Mode** — a context file was found.
- **Domain Modeling Mode** — exactly one context artifact was found.
Run the interview and maintain the project's domain model as terms settle (see [Domain Modeling Mode](#domain-modeling-mode)).
- **Free Mode** — no context file, and the plan raises no project-specific vocabulary worth pinning down.
- **Free Mode** — no context artifact was found, and the plan raises no project-specific vocabulary worth pinning down.
Run the interview with no document side effects.
- **Clarification** — no context file, but the plan introduces terms specific to this project that later work will need to use consistently — the kind of terms [`CONTEXT-FORMAT.md`](CONTEXT-FORMAT.md) admits, not general programming concepts.
- **Clarification** — no context artifact was found, but the plan introduces terms specific to this project that later work will need to use consistently — the kind of terms [`CONTEXT-FORMAT.md`](CONTEXT-FORMAT.md) admits, not general programming concepts.
Before interviewing, ask whether to create a glossary.
If yes, create it at `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>/CONTEXT.md` and continue in Domain Modeling Mode.
If yes, choose the context artifact filename from the destination's `AGENTS.md` and nearby artifact convention, allocate any required identifier, and continue in Domain Modeling Mode.
If no, continue in Free Mode.
Stop and report the conflicting paths if more than one matching context artifact exists.
Done when the interview is running in Domain Modeling Mode or Free Mode.
## 2. Run the interview
@@ -66,9 +71,9 @@ Active only when step 1 selected this mode.
### Glossary
As a term crystallizes, update the context file right then — do not batch these to the end.
As a term crystallizes, update the context artifact right then — do not batch these to the end.
When a settling term clashes with one already in the glossary, call it out and reconcile to a single canonical word.
Keep the file a glossary and nothing else: vocabulary and ubiquitous language, no implementation detail.
Keep the artifact a glossary and nothing else: vocabulary and ubiquitous language, no implementation detail.
Write it in the format of [`CONTEXT-FORMAT.md`](CONTEXT-FORMAT.md).
### ADRs
@@ -80,7 +85,9 @@ Offer to record an architectural decision only when all three hold:
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons.
If any of the three is missing, skip it.
A recorded decision lives in the sibling `adr/` directory, numbered one past the highest already there (`0001-slug.md`), and can be a single paragraph:
A recorded decision lives directly in the resolved artifact destination.
Choose its filename from the destination's `AGENTS.md` and nearby artifact convention, allocating an identifier only when that convention requires one.
It can be a single paragraph:
> # {Short title of the decision}
>

122
skills/implement/SKILL.md Normal file
View File

@@ -0,0 +1,122 @@
---
name: implement
description: Implement scoped work using the local implementation workflow, following Wayfinder ticket protocol when an implementation ticket artifact is part of the selected work.
disable-model-invocation: true
---
# implement
Implement scoped work and hand off working code.
This skill defines execution protocol rather than deciding what work the agent is allowed to implement.
When selected work has a Wayfinder ticket artifact, follow the Wayfinder artifact lifecycle.
When selected work has no Wayfinder artifact, implement normally and use the same review, commit, and handoff discipline without creating a tracking artifact.
This skill delegates to other skills by name.
Before satisfying a delegated skill step, explicitly load that skill's `SKILL.md` with `read` unless the harness has already injected that skill's full content into the current context.
Do not satisfy a delegated skill step by imitating its title from memory.
## 1. Establish the selected work
Identify the work to implement from the user's request and current context.
Use a Wayfinder implementation ticket artifact, issue, spec, direct request, branch context, or other clear source when that is what the agent has selected.
Do not require a Wayfinder artifact and do not create one just to satisfy this skill.
Old `.claude/tasks` files may be ordinary context, but their lifecycle semantics are not part of this workflow.
When the selected work has a Wayfinder ticket artifact, re-read it before claiming.
Verify that blockers are satisfied by the artifact metadata and that no other session has claimed it.
Claim it before changing code by setting `status: claimed`, `claimed-by` to the current session identifier, and `claimed-at` to the current timestamp.
Use `PI_SESSION_ID` when available.
Done when the selected work is clear, and any Wayfinder ticket artifact is freshly read and claimed when applicable.
## 2. Verify the execution checkout
Assume the current checkout is the assigned execution checkout.
Do not create, lease, clean up, or switch worktrees.
Report the checkout path and branch when useful for handoff.
Check the working tree before changing code.
Stop on unrelated or ambiguous uncommitted changes.
Continue only when dirty state is clearly already part of the selected work.
Never auto-stash.
For source-changing implementation work that will be committed, work on a non-default branch unless repository context explicitly directs otherwise.
If an appropriate non-default branch is already prepared, continue there.
If you are on the default branch, fast-forward the default branch first and create a task branch.
Stop if the default branch cannot fast-forward cleanly.
Follow repository, user, or orchestrator branch naming conventions.
If no convention is discoverable and you must create a branch, choose a clear short descriptive name and report it.
Check declared implementation blockers where they exist.
Stop when prerequisite implementation work is not reachable from the current base, and report the likely unmerged prerequisite.
Do not automatically branch from, merge, or cherry-pick sibling task work.
Follow an explicit integration-branch or wide-refactor plan only when the selected work names that exception.
Done when the checkout, branch, dirty state, and reachable prerequisites are safe for the selected implementation work.
## 3. Implement the work
Use `test-driven-development` as a strong default when behavior can usefully be specified and tested before implementation.
Load `test-driven-development` before deciding whether it applies.
Skip it only when the work is mechanical, documentation-only, exploratory, or when test-first would not add value.
When skipping it, state the reason before implementation.
Skipping test-driven development is an agent judgment, not an omission.
Build the selected work in the assigned checkout.
Run focused verification while working and run broader verification when the repository or change calls for it.
Treat working code and tests as the implementation artifact.
Do not create a separate process report for test-driven development.
Record only durable outcomes such as tests added or changed, verification run, and deviations worth noting.
Stage created and modified files intentionally.
Do not use broad staging that sweeps unrelated files into the change.
Done when the selected work is implemented as working code and locally verified to the level the change warrants.
## 4. Review the final intended handoff state
Load and run `review` before reporting final handoff or resolving a Wayfinder ticket.
Choose review timing by judgment.
Review may happen before commit, after commit, or both.
The review must cover the final intended handoff state, including a local uncommitted handoff when no commit is made.
Do not report final handoff until review has run or you have explained why review could not cover that state.
Fix blocking review findings unless the agent or user explicitly accepts them.
When code changes are made in response to review, rerun `review` on the relevant change set.
Record accepted blocking findings in the final handoff or Wayfinder closeout when they affect a future reader's decision to trust or continue the work.
Handle non-blocking findings by judgment.
Fix them when cheap or high-value, and otherwise report or record only when useful.
Done when review has covered the final intended handoff state and blocking findings are fixed or explicitly accepted.
## 5. Commit and hand off
Follow the repository's commit and PR conventions.
Discover those conventions from repository instructions or recent history rather than assuming them.
Commit only the selected work.
Use one commit when that is the natural shape, but follow the repository's convention when it expects a different history shape.
Push and open a PR when the repository and selected workflow call for that handoff.
If there is no remote or no supported forge workflow, stop after the local handoff point and report what remains for a human.
Keep PR and handoff text focused on what was built, verification, review disposition, and any deviations that matter.
Done when the implementation has a concrete handoff state: committed locally, pushed, opened as a PR, or stopped with the exact remaining human action reported.
## 6. Close out Wayfinder artifacts when present
When the selected work has a Wayfinder ticket artifact, re-read it before closeout.
Record durable coordination facts only.
Wayfinder `status` is the lifecycle authority.
Acceptance criteria checkboxes may be updated as useful detail with `[x]` for satisfied criteria and `[-]` for deliberately dropped criteria when practical.
Checkbox state is not the source of truth.
Keep Implementation Notes concise.
Capture only what future agents or humans need: deviations, dropped or changed scope, verification, branch, commit, PR, or why the ticket remains unresolved.
Use judgment for partial or ambiguous outcomes, but keep lifecycle recording honest.
Do not imply completion when the work is not complete.
When resolving a Wayfinder ticket, set `status: resolved` and repair the owning map's Frontier according to Wayfinder artifact rules.
Put detailed implementation records in the ticket, commit, PR, and working code rather than in the map.
The parent map should receive only the concise outcome summary required by Wayfinder.
Done when any Wayfinder ticket and parent map agree with the implementation's actual lifecycle state.

100
skills/prototype/LOGIC.md Normal file
View File

@@ -0,0 +1,100 @@
# Logic Prototype
A tiny interactive terminal app that lets the user drive a state model by hand. Use this when the question is about **business logic, state transitions, or data shape** — the kind of thing that looks reasonable on paper but only feels wrong once you push it through real cases.
## When this is the right shape
- "I'm not sure if this state machine handles the edge case where X then Y."
- "Does this data model actually let me represent the case where..."
- "I want to feel out what the API should look like before writing it."
- Anything where the user wants to **press buttons and watch state change**.
If the question is "what should this look like" — wrong branch. Use [UI.md](UI.md).
## Process
### 1. State the question
Before writing code, write down what state model and what question you're prototyping.
Use one paragraph in the prototype's README or a comment at the top of the file.
A logic prototype that answers the wrong question is pure waste, so make the question explicit enough to check later whether the user is watching now or returning to it AFK.
Done when the prototype states one concrete logic question and the model being tested.
### 2. Pick the language
Use whatever the host project uses. If the project has no obvious runtime (e.g. a docs repo), ask.
Match the project's existing conventions for tooling.
Don't add a new package manager or runtime just for the prototype.
Done when the prototype has a runnable host-project language and toolchain without introducing a new runtime convention.
### 3. Isolate the logic in a portable module
Put the actual logic — the bit that's answering the question — behind a small, pure interface that could be lifted out and dropped into the real codebase later. The TUI around it is throwaway; the logic module shouldn't be.
The right shape depends on the question:
- **A pure reducer** — `(state, action) => state`. Good when actions are discrete events and state is a single value.
- **A state machine** — explicit states and transitions. Good when "which actions are even legal right now" is part of the question.
- **A small set of pure functions** over a plain data type. Good when there's no implicit current state — just transformations.
- **A class or module with a clear method surface** when the logic genuinely owns ongoing internal state.
Pick whichever shape best fits the question being asked, *not* whichever is easiest to wire to a TUI. Keep it pure: no I/O, no terminal code, no `console.log` for control flow. The TUI imports it and calls into it; nothing flows the other direction.
This is what makes the prototype useful past its own lifetime.
When the question is answered, the validated reducer, machine, or function set can be lifted into the real module on its own.
Done when all tested logic lives behind one portable, pure interface and the TUI depends on it in only one direction.
### 4. Build the smallest TUI that exposes the state
Build it as a **lightweight TUI** — on every tick, clear the screen (`console.clear()` / `print("\033[2J\033[H")` / equivalent) and re-render the whole frame. The user should always see one stable view, not an ever-growing scrollback.
Each frame has two parts, in this order:
1. **Current state**, pretty-printed and diff-friendly (one field per line, or formatted JSON). Use **bold** for field names or section headers and **dim** for less important context (timestamps, IDs, derived values). Native ANSI escape codes are fine — `\x1b[1m` bold, `\x1b[2m` dim, `\x1b[0m` reset. No need to pull in a styling library unless one is already in the project.
2. **Keyboard shortcuts**, listed at the bottom: `[a] add user [d] delete user [t] tick clock [q] quit`. Bold the key, dim the description, or vice-versa — whatever reads cleanly.
Behaviour:
1. **Initialise state** — a single in-memory object/struct. Render the first frame on start.
2. **Read one keystroke (or one line)** at a time, dispatch to a handler that mutates state.
3. **Re-render** the full frame after every action — don't append, replace.
4. **Loop until quit.**
The whole frame should fit on one screen.
Done when every available action re-renders a complete one-screen view of the current state and shortcuts.
### 5. Make it runnable in one command
Add a script to the project's existing task runner (`package.json` scripts, `Makefile`, `justfile`, `pyproject.toml`). The user should run `pnpm run <prototype-name>` or equivalent — never need to remember a path.
If the host project has no task runner, put the command at the top of the prototype's README.
Done when a fresh user can launch the prototype with one documented command.
### 6. Evaluate it
In HITL mode, give the user the run command.
They drive it themselves.
The interesting moments are when they say "wait, that shouldn't be possible" or "huh, I assumed X would be different" because those expose bugs in the idea.
Add actions when the feedback needs them.
In AFK mode, run the command yourself and drive the hard cases that answer the stated question.
Record the observations that support the verdict.
Done when the evaluator can exercise the model and the prototype exposes every state transition needed to reach a verdict.
## Production mapping
When the shared [SKILL](SKILL.md) permits production work, lift the validated reducer, machine, or function set into the real module.
Keep the TUI shell on the throwaway branch.
## Anti-patterns
- **Don't generalise.** No "what if we wanted to support X later." The prototype answers one question.
- **Don't blur the logic and the TUI together.** If the reducer / state machine references `console.log`, prompts, or terminal escape codes, it's no longer portable. Keep the TUI as a thin shell over a pure module.
- **Don't ship the TUI shell into production.** The shell is optimised for being driven by hand from a terminal. The logic module behind it is the bit worth keeping.

88
skills/prototype/SKILL.md Normal file
View File

@@ -0,0 +1,88 @@
---
name: prototype
description: Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
---
# Prototype
A prototype is **throwaway code that answers one question**.
The question decides the branch.
The interaction mode decides who reaches the verdict.
Use AFK mode when the question has objective observable criteria the agent can test end to end.
Use HITL mode when the verdict depends on human judgment, taste, or UX feel.
## 1. Pick a branch
Identify the question from the user's prompt and surrounding code.
Ask when it remains genuinely ambiguous and the user is reachable.
- **Does this logic or state model feel right?**
Follow [`LOGIC.md`](LOGIC.md) to build a tiny interactive terminal app that pushes the model through hard-to-reason-about cases.
- **What should this look like?**
Follow [`UI.md`](UI.md) to build several radically different UI variants on one route with a URL-controlled switcher.
When the user is unavailable, default to Logic for a backend module and UI for a page or component, then state the assumption in the prototype.
Done when exactly one branch and one design question govern the prototype.
## Common rules
- **Throwaway from day one.**
Locate the code close to where it would be used, but name it so nobody mistakes it for production.
Follow the project's routing and source-layout conventions rather than inventing a new top-level structure.
- **One command to run.**
Use the project's existing task runner so the user does not need to remember a path or setup sequence.
- **No persistence by default.**
Keep state in memory unless persistence is the question being tested.
Use an unmistakably disposable database or local file when that question requires one.
- **Skip polish.**
Add no tests, production-grade error handling, speculative abstractions, or unrelated cleanup.
- **Surface state.**
Show the full relevant state after every Logic action or UI variant switch.
## 2. Build and reach a verdict
Follow the selected branch through its evaluation step.
In HITL mode, hand the prototype to the user and iterate in response to their feedback.
In AFK mode, run the prototype yourself and evaluate the objective observations against the question.
Do not treat a runnable prototype as the result.
The result is the verdict that answers the design question.
Done when the verdict is explicit, or when the prototype establishes that it did not resolve the question.
## 3. Capture the primary source
Commit the complete prototype to a throwaway branch outside main.
The branch is the primary source.
Resolve the artifact destination before naming the file.
When the caller provides a destination directory, use it exactly.
Otherwise, default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when needed.
Before choosing a filename, read the destination's `AGENTS.md`.
Use the naming convention declared there, or infer it from nearby artifacts when the file delegates naming to local context.
Do not assume a counter, numeric prefix, slug shape, or artifact-type suffix unless the destination convention requires it.
If no convention can be determined, choose the least surprising lowercase descriptive Markdown filename and state that the destination did not define a naming convention.
When the caller provides an existing ticket artifact path, use it exactly, do not allocate a filename, and complete that artifact in place.
Otherwise, allocate any identifier required by the destination convention and include `parent` only when an earlier artifact directly caused the prototype.
The Prototype artifact links the throwaway branch and preserves the question, run instructions, verdict, and branch-appropriate evidence.
When the resolved file is an existing ticket artifact, preserve its workflow metadata and complete the result in that file.
The branch-appropriate evidence is:
- UI evidence uses screenshots.
- Logic evidence uses useful code snippets and, where needed, a short interaction transcript.
Done when the complete prototype is committed outside main and exactly one Prototype artifact preserves the result according to the destination convention.
## 4. Fold in the decision when permitted
A planning-only caller such as Wayfinder stops after the verdict and leaves production code unchanged.
Otherwise, fold the validated decision into production only when the caller permits implementation.
Follow the selected branch's **Production mapping** and keep all other throwaway code out of main.
Done when production is unchanged for a planning-only run, or contains only the permitted validated decision for an implementation run.

124
skills/prototype/UI.md Normal file
View File

@@ -0,0 +1,124 @@
# UI Prototype
Generate **several radically different UI variations** on a single route, switchable from a floating bottom bar. The user flips between variants in the browser, picks one (or steals bits from each), then throws the rest away.
If the question is about logic/state rather than what something looks like — wrong branch. Use [LOGIC.md](LOGIC.md).
## When this is the right shape
- "What should this page look like?"
- "I want to see a few options for this dashboard before committing."
- "Try a different layout for the settings screen."
- Any time the user would otherwise spend a day picking between three vague mockups in their head.
## Two sub-shapes — strongly prefer sub-shape A
A UI prototype is much easier to judge when it's **butting up against the rest of the app** — real header, real sidebar, real data, real density. A throwaway route on its own is a vacuum: every variant looks fine in isolation. Default to sub-shape A whenever there's a plausible existing page to host the variants. Only reach for sub-shape B if the prototype genuinely has no nearby home.
### Sub-shape A — adjustment to an existing page (preferred)
The route already exists. Variants are rendered **on the same route**, gated by a `?variant=` URL search param. The existing data fetching, params, and auth all stay — only the rendering swaps. This is the default; pick it unless there's a specific reason not to.
If the prototype is for something that doesn't yet have a page but *would naturally live inside one* (a new section of the dashboard, a new card on the settings screen, a new step in an existing flow) — that's still sub-shape A. Mount the variants inside the host page.
### Sub-shape B — a new page (last resort)
Only use this when the thing being prototyped genuinely has no existing page to live inside — e.g. an entirely new top-level surface, or a flow that can't be embedded anywhere sensible.
Create a **throwaway route** following whatever routing convention the project already uses — don't invent a new top-level structure. Name it so it's obviously a prototype (e.g. include the word `prototype` in the path or filename). Same `?variant=` pattern.
Before committing to sub-shape B, sanity-check: is there really no existing page this could be embedded in? An empty route hides design problems that a populated one would expose.
In both sub-shapes the floating bottom bar is identical.
## Process
### 1. State the question and pick N
Default to **3 variants**. More than 5 stops being radically different and starts being noise — cap there.
Write down the plan in one line, in the prototype's location or a top-of-file comment:
> "Three variants of the settings page, switchable via `?variant=`, on the existing `/settings` route."
This works whether the user is here to push back or not.
Done when the prototype states one concrete UI question, its host route, and a variant count from three through five.
### 2. Generate radically different variants
Draft each variant. Hold each one to:
- The page's purpose and the data it has access to.
- The project's component library / styling system (TailwindCSS, shadcn, MUI, plain CSS, whatever).
- A clear exported component name, e.g. `VariantA`, `VariantB`, `VariantC`.
Variants must be **structurally different** — different layout, different information hierarchy, different primary affordance, not just different colours. Three slightly-tweaked card grids isn't a UI prototype, it's wallpaper. If two drafts come out too similar, redo one with explicit "do not use a card grid" guidance.
Done when every variant materially differs in layout, information hierarchy, and primary affordance while using the project's existing design system.
### 3. Wire them together
Create a single switcher component on the route:
```tsx
// pseudo-code — adapt to the project's framework
const variant = searchParams.get('variant') ?? 'A';
return (
<>
{variant === 'A' && <VariantA {...data} />}
{variant === 'B' && <VariantB {...data} />}
{variant === 'C' && <VariantC {...data} />}
<PrototypeSwitcher variants={['A','B','C']} current={variant} />
</>
);
```
For sub-shape A (existing page): keep all the existing data fetching above the switcher; only the rendered subtree changes per variant.
For sub-shape B (new page): the throwaway route under `/prototype/<name>` mounts the same switcher.
Done when one route renders every variant from the URL parameter without duplicating data loading.
### 4. Build the floating switcher
A small fixed-position bar at the bottom-centre of the screen with three pieces:
- **Left arrow** — cycles to the previous variant (wraps around).
- **Variant label** — shows the current variant key and, if the variant exports a name, that name too. e.g. `B — Sidebar layout`.
- **Right arrow** — cycles forward (wraps around).
Behaviour:
- Clicking an arrow updates the URL search param (use the framework's router — `router.replace` on Next, `navigate` on React Router, etc) so the variant is shareable and reload-stable.
- Keyboard: `←` and `→` arrow keys also cycle. Don't intercept arrow keys when an `<input>`, `<textarea>`, or `[contenteditable]` is focused.
- Visually distinct from the page (e.g. high-contrast pill, subtle shadow) so it's obviously not part of the design being evaluated.
- Hidden in production builds — gate on `process.env.NODE_ENV !== 'production'` or an equivalent check, so a stray prototype merge can't ship the bar to users.
Put the switcher in a single shared component so both sub-shapes can reuse it. Locate it wherever shared UI lives in the project.
Done when mouse and keyboard controls cycle through every shareable variant without intercepting text-editing keys, and the switcher cannot render in production.
### 5. Evaluate it
In HITL mode, surface the URL and the `?variant=` keys.
The user flips through the variants and may combine elements rather than choosing one unchanged.
In AFK mode, open the URL yourself, compare every variant against the stated objective criteria, and record the observations that support the verdict.
Use HITL instead when the decision depends on taste, product judgment, or UX feel.
Done when the evaluator can compare every variant in its host context and the prototype exposes enough contrast to reach a verdict.
## Production mapping
When the shared [SKILL](SKILL.md) permits production work, keep the full variant set on the throwaway branch and apply the verdict as follows:
- **Sub-shape A** — fold the winner into the existing page and drop the losing variants and switcher from main.
- **Sub-shape B** — promote the winner to a real route and drop the throwaway route and switcher from main.
## Anti-patterns
- **Variants that differ only in colour or copy.** That's a tweak, not a prototype. Real variants disagree about structure.
- **Sharing too much code between variants.** A shared `<Header>` is fine; a shared `<Layout>` defeats the point. Each variant should be free to throw out the layout.
- **Wiring variants to real mutations.** Read-only prototypes are fine. If a variant needs to mutate, point it at a stub — the question is "what should this look like", not "does the backend work".
- **Promoting the prototype directly to production.** The variant code was written under prototype constraints (no tests, minimal error handling). Rewrite it properly when you fold it in.

52
skills/research/SKILL.md Normal file
View File

@@ -0,0 +1,52 @@
---
name: research
description: Investigate a question against high-trust primary sources and capture the cited findings as a Research artifact. Use when a topic needs documentation, API, specification, source-code, or other reading legwork.
---
# Research
Investigate one question and preserve the findings in one cited Research artifact.
Run in the current process.
Isolation and concurrency belong to the caller.
## 1. Resolve the artifact
Resolve the artifact destination before naming the file.
When the caller provides a destination directory, use it exactly.
Otherwise, default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when needed.
Before choosing a filename, read the destination's `AGENTS.md`.
Use the naming convention declared there, or infer it from nearby artifacts when the file delegates naming to local context.
Do not assume a counter, numeric prefix, slug shape, or artifact-type suffix unless the destination convention requires it.
If no convention can be determined, choose the least surprising lowercase descriptive Markdown filename and state that the destination did not define a naming convention.
When the caller provides an existing ticket artifact path, use it exactly, do not allocate a filename, and complete that artifact in place.
Otherwise, allocate any identifier required by the destination convention and include `parent` only when an earlier artifact directly caused the research.
Done when one authoritative Research artifact path and its metadata are settled according to the destination convention.
## 2. Investigate the question
Use primary sources such as official documentation, specifications, source code, and first-party APIs rather than relying on secondary accounts.
Follow every substantive claim back to the primary source that owns it.
Use secondary material only to discover primary sources.
When no primary source establishes a needed claim, record that limitation instead of presenting the claim as settled.
Done when the question is answered as far as primary evidence permits and every substantive claim has an owning source or an explicit evidence gap.
## 3. Write the Research artifact
Write the findings to the resolved Markdown file and follow the destination's artifact conventions.
When the resolved file is an existing ticket artifact, preserve its workflow metadata and complete the result in that file.
Keep the question, findings, limitations, and citations sufficient for a future reader to evaluate the result without reconstructing the research session.
Do not create a source dump or research log.
Done when exactly one Research artifact exists at the resolved path and every substantive claim in it cites its source.
## 4. Return the result
Report the artifact path and a concise statement of what the research established or could not establish.
Done when the caller can locate the artifact and understand whether the question was resolved.

121
skills/review/SKILL.md Normal file
View File

@@ -0,0 +1,121 @@
---
name: review
description: Produce a structured, report-only review of a context-selected change set across risk, standards, intent, evidence, and documentation.
---
# review
Review a change set selected from context and produce a structured review report.
This skill is standalone and context-driven.
It does not know about implementation lifecycle, Wayfinder claiming, task resolution, PR creation, or ticket closeout.
It must not edit code.
Reviewer prompts live under [`reviewers/`](reviewers/).
Load the relevant reviewer files before running independent dimension reviews.
## 1. Select and capture the change set
Select the relevant change set from current context.
The change set may be uncommitted changes, branch changes, a PR, explicit files, or another clear source.
State what change set you selected before reviewing.
Ask or stop only when scope ambiguity would make the review untrustworthy.
Capture enough material for reviewers to inspect the selected change set.
This may include a diff, changed-file list, commit list, PR details, relevant intent source, available verification evidence, and repository instructions or standards sources.
Do not overprescribe mode selection or intent-source taxonomy.
Use agent judgment when the selected change set and intent source are clear enough to review.
Done when the chosen change set is explicit and reviewers have enough input to judge it.
## 2. Run dimension reviews
Run independent dimension reviewers through whatever real context boundary the current harness provides.
A separate agent, worker, subprocess, or documented headless session is sufficient when each reviewer can inspect its dimension without seeing the parent review's intermediate conclusions.
Use one reviewer per dimension when practical.
If no real context boundary is available, stop before reviewing and report that independent review cannot be completed in the current runtime.
Do not replace independent reviewers with in-process role switches.
Use these reviewer files:
- [`reviewers/risk.md`](reviewers/risk.md)
- [`reviewers/standards.md`](reviewers/standards.md)
- [`reviewers/intent.md`](reviewers/intent.md)
- [`reviewers/evidence.md`](reviewers/evidence.md)
- [`reviewers/documentation.md`](reviewers/documentation.md)
Each reviewer should follow its own purpose, boundary, rubric, and output expectations.
The shared base finding shape is flexible:
```markdown
- **Severity**: error | warning | info
**Blocking**: yes | no
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <impact>
**Suggested fix**: <concrete next action, or none>
```
Reviewers may add dimension-specific fields where useful.
Reviewers classify findings as blocking or non-blocking.
The caller or user decides final disposition.
Done when each applicable dimension has returned findings or a clear statement that the dimension does not apply.
## 3. Run targeted checks when useful
Run targeted checks when they are needed to assess a dimension.
Prefer focused commands that clarify evidence, risk, or standards conformance.
Do not turn review into a full external validation pipeline.
If a full suite or expensive check is clearly needed, explain why before relying on it.
Record commands and artifacts that materially influenced the review.
Do not present unrun checks as evidence.
Done when the review has enough evidence for its findings and limitations are stated honestly.
## 4. Aggregate the structured review report
Produce a structured review report, not a gate artifact and not a pass/fail verdict.
Keep sections separate so one dimension does not mask another.
Deduplicate exact duplicates only.
Mention when separate dimensions independently flag the same issue.
Use this report shape unless the selected change set calls for a small adaptation:
```markdown
## Reviewed change set
<what was reviewed and how it was captured>
## Risk
<risk reviewer section>
## Standards
<standards reviewer section>
## Intent
<intent reviewer section>
## Evidence
<evidence reviewer section>
## Documentation
<documentation reviewer section>
## Summary
- Blocking findings: <count>
- Non-blocking findings: <count>
- Targeted checks run: <commands or none>
- Evidence limitations: <limitations or none>
```
Do not invent a pass/fail verdict.
Use blocking findings present or absent as the review's actionable summary.
Done when the report states the reviewed change set, preserves every applicable dimension, and summarizes blocking status and evidence limitations.

View File

@@ -0,0 +1,30 @@
# Documentation reviewer
Review only documentation consequences of the selected change set.
Do not make Risk, Standards, Intent, or Evidence findings unless the issue directly affects documentation correctness.
Look for user-facing, operator-facing, contributor-facing, and agent-facing documentation that should change because behavior, interfaces, commands, options, workflows, or constraints changed.
Also look for stale documentation introduced or left behind by the change.
Do not demand new documentation surfaces for every change.
Prefer updating the existing owner of the fact when one is discoverable.
Documentation findings may be non-blocking when the change is internal and no durable reader would be misled.
They may be blocking when users, operators, future contributors, or agents would reasonably make a wrong decision from stale or missing documentation.
## Output format
```markdown
## Documentation
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Documentation owner**: <file, artifact, or none known>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <reader impact>
**Suggested fix**: <concrete next action, or none>
```

View File

@@ -0,0 +1,38 @@
# Evidence reviewer
Review only whether the selected change set has convincing evidence.
Do not make Risk, Standards, Intent, or Documentation findings unless the issue directly affects evidentiary value.
Check tests, commands, artifacts, manual checks, and any evidence the change provides.
You may recommend or run targeted checks when the orchestrating review context allows it.
Do not present unrun checks as evidence.
Reject source-grep pseudo-tests as proof of behavior.
A test whose only evidence is matching implementation source text, tokens, lines, syntax, prompt phrases, regexes, AST shapes, or incidental snapshots does not prove behavior.
Prefer evidence that demonstrates observable behavior, state, output, side effects, failure modes, or semantic meaning through a public or executable interface.
For declarative artifacts, prefer invoking the real consumer or parsing into a typed or normalized semantic model.
Reading file contents is legitimate when the file itself is the owned output or serialized contract under test.
## Output format
```markdown
## Evidence
Evidence checked:
- <command, test, artifact, or none>
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Evidence checked**: <command, test, artifact, or none>
**Evidence gap**: <what remains unproven, or none>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <trust or verification impact>
**Suggested fix**: <concrete next action, or none>
```

View File

@@ -0,0 +1,33 @@
# Intent reviewer
Review only whether the selected change set satisfies the apparent intent.
Do not make Risk, Standards, Evidence, or Documentation findings unless the issue directly changes intent fidelity.
Use the clearest available intent source from context.
Possible sources include a Wayfinder task, issue, spec, direct request, PR description, branch context, commit messages, or conversation context.
Do not invent requirements.
When intent is inferred rather than explicit, say so and treat it with appropriate caution.
Look for missing requested behavior, partial implementation, behavior outside the selected scope, and implementations that appear to satisfy wording while violating the underlying request.
Do not require remote branch, PR, or CI outcomes when another workflow step owns those outcomes.
## Output format
```markdown
## Intent
Intent source: <source or none>
Intent confidence: <explicit|inferred|unavailable>
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Intent source**: <task, spec, issue, request, branch context, or none>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <intent or correctness impact>
**Suggested fix**: <concrete next action, or none>
```

View File

@@ -0,0 +1,46 @@
# Risk reviewer
Review only risk.
Do not make Standards, Intent, Evidence, or Documentation findings unless the issue directly changes the risk assessment.
Assess how much attention the selected change set warrants before handoff.
Use the worst-factor-wins rubric from the old local review workflow.
Rate each factor Low, Medium, or High with a concise reason:
- Blast radius.
- Reversibility.
- Test coverage.
- Sensitive domain.
- Size and complexity.
- Runtime criticality.
Overall risk is the highest factor.
Risk alone need not block.
Missing evidence for a risky change may be blocking when a future reader should not trust the handoff without more proof.
## Output format
```markdown
## Risk
**Overall: <LOW|MEDIUM|HIGH>**
- Blast radius: <rating> — <reason>
- Reversibility: <rating> — <reason>
- Test coverage: <rating> — <reason>
- Sensitive domain: <rating> — <reason>
- Size and complexity: <rating> — <reason>
- Runtime criticality: <rating> — <reason>
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Risk factor**: <factor or none>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <risk impact>
**Suggested fix**: <concrete next action, or none>
```

View File

@@ -0,0 +1,43 @@
# Standards reviewer
Review only repository standards and maintainability.
Do not make Risk, Intent, Evidence, or Documentation findings unless the issue directly affects standards conformance.
Use repository instructions and discovered standards sources such as `AGENTS.md`, `CONTRIBUTING.md`, coding standards, or nearby conventions.
When documented standards conflict with generic advice, the repository standard wins.
Also apply this smell baseline when tooling or project standards do not already cover the issue:
- Mysterious Name.
- Duplicated Code.
- Feature Envy.
- Data Clumps.
- Primitive Obsession.
- Repeated Switches.
- Shotgun Surgery.
- Divergent Change.
- Speculative Generality.
- Message Chains.
- Middle Man.
- Refused Bequest.
Treat smell findings as judgment calls, not automatic hard violations.
Skip anything deterministic tooling already enforces unless the current review evidence shows the tool is not being run.
## Output format
```markdown
## Standards
### Findings
Use `No findings.` when this reviewer has no findings.
- **Severity**: <error|warning|info>
**Blocking**: <yes|no>
**Standard source**: <file and rule, smell baseline, or convention>
**Location**: <file, line, command, artifact, or none>
**Finding**: <specific issue>
**Why it matters**: <maintainability or standards impact>
**Suggested fix**: <concrete next action, or none>
```

178
skills/slice/SKILL.md Normal file
View File

@@ -0,0 +1,178 @@
---
name: slice
description: Turn a settled plan, spec, conversation, or artifact into Wayfinder implementation tickets for tracer-bullet slices. Run deliberately as /skill:slice when the user asks to slice work.
disable-model-invocation: true
---
# slice
Turn settled source material into implementation-ready Wayfinder tickets.
Use this when the user asks to slice a plan, spec, conversation, or artifact into agent-grabbable implementation work.
Do not use this to resolve planning fog.
If the source contains unresolved decisions, report them instead of inventing implementation slices.
`slice` writes Wayfinder `ticket/implementation` artifacts for implementation slices and `ticket/task/human` artifacts only when the slice cannot proceed without human action.
It does not write legacy `.claude/tasks/` files.
## 1. Gather source material
Work from the current conversation first.
If the caller passes paths, artifact links, issue references, or URLs, read the referenced body and relevant comments or nearby artifact context before slicing.
When source material names a Wayfinder artifact, use that artifact as the default provenance parent.
When no source artifact exists, use the active Wayfinder map if one is clear from context.
When neither exists, create or select the minimal Wayfinder parent required by the destination's artifact rules before writing tickets.
Explore the codebase when the current implementation state is not already understood.
Use the project's established vocabulary and respect relevant ADRs, context artifacts, and repository instructions.
Look for prefactoring that makes the change easier before slicing the behavior.
Done when the source, project context, and default parent artifact are known.
## 2. Resolve the artifact destination
Resolve the destination before naming files.
Use an explicitly supplied destination directory exactly.
Otherwise, default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI-artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when a new artifact requires it.
Read the destination's `AGENTS.md` before any artifact write.
Follow the destination's filename, identifier, slug, frontmatter, and wikilink conventions.
If Wayfinder artifact reference is available, read it before writing.
The minimum Wayfinder ticket contract is:
```markdown
---
status: open
parent: "[[<source-artifact-or-map>]]"
blocked-by: []
tags:
- ticket/implementation
---
# <task name>
## Question
<one precise implementation action sized to one agent session>
```
Use `ticket/task/human` instead of `ticket/implementation` when execution or validation requires human input before implementation can proceed.
Do not create claims.
Tickets start open and unclaimed.
Done when the destination and artifact conventions are known.
## 3. Draft slices
Break the work into tracer-bullet slices.
Each normal slice must deliver a narrow complete path through every layer the change requires.
Do not create horizontal layer-only slices.
Reject any proposed slice whose title or delivered behavior is only parsing, only schema, only API, only UI, only tests, or only documentation when those layers are part of one user-visible change.
For a small feature, one slice is usually correct because parsing, behavior, tests, and documentation belong in the same coherent commit.
A completed slice must be demoable or verifiable on its own.
A slice should make sense as one coherent commit.
Put prefactoring slices before behavior slices that depend on them.
Record blocking edges while drafting.
Use blockers only for work that genuinely gates the slice.
A slice with no blockers can start immediately.
Use `parent` for provenance and `blocked-by` for prerequisites.
Use the wide-refactor exception when a single mechanical change has a blast radius that prevents any vertical slice from landing green.
Sequence that work as expand, migration batches, and contract.
The expand slice adds the new form beside the old so nothing breaks.
Each migration batch is sized by blast radius and is blocked by the expand slice.
The contract slice removes the old form and is blocked by every migration batch.
When migration batches cannot stay green alone, keep the sequence but state the integration-branch constraint and add a final integrate-and-verify slice.
Done when every currently implementable slice has a title, type, blockers, delivered behavior, acceptance criteria, and any needed handoff notes.
## 4. Classify ticket type
Use `ticket/implementation` when an agent can complete and verify the implementation slice without live human input.
Use `ticket/task/human` when execution or validation depends on the user before implementation can proceed.
Examples include subjective UI judgment, physical device checks, unavailable credentials, external account approval, or behavior only the human can confirm.
Do not mark a ticket human merely because it is important or risky.
Make the required human involvement explicit in the ticket body.
If slicing reveals a precise unresolved planning question, do not disguise it as an implementation ticket.
Report it and stop, unless the caller asks to create the appropriate Wayfinder research, prototype, or grill ticket.
Done when each proposed slice has the correct ticket type.
## 5. Review before writing
Present the proposed breakdown and wait for approval unless the caller explicitly asks for noninteractive output.
For each slice show exactly this review shape:
```markdown
1. **Title**: <proposed task title>
**Type**: implementation or human task
**Blocked by**: <proposed blockers, or None>
**What it delivers**: <end-to-end behavior or implementation result>
**Acceptance criteria**:
- <observable completion check>
```
Ask the user whether the granularity feels right, whether the blocking edges are correct, and whether any slices should be merged or split.
Iterate until the breakdown is approved.
In explicitly noninteractive mode, write the best breakdown and record any assumptions in `## Implementation Notes`.
Done when the proposed slices are approved or noninteractive assumptions are explicit.
## 6. Write ticket artifacts
Allocate filenames and identifiers according to the destination convention.
Create one Wayfinder ticket artifact per approved slice.
Use the destination's wikilink style when referring to artifacts.
Never refer to a ticket by a bare identifier, filename, or slug in user-facing text.
Each ticket body should use this shape:
```markdown
# <task name>
## Question
<one precise implementation action sized to one agent session>
## What to build
<concise end-to-end behavior or implementation result, not a layer-by-layer checklist>
## Acceptance criteria
- [ ] <observable criterion>
## Implementation Notes
<concise handoff guidance when useful>
```
Keep `## Implementation Notes` empty when no guidance earns its place.
Later implementing agents may append execution notes, verification results, and reasons for deliberately dropped criteria.
Avoid brittle file paths and code snippets unless a prototype or prior decision snippet encodes the decision more precisely than prose can.
Done when every approved slice has exactly one open, unclaimed Wayfinder ticket artifact.
## 7. Advance the Frontier
Re-read the map or parent artifact before editing shared state.
If there is a Wayfinder map, recompute its Frontier from ticket metadata.
A ticket belongs on the Frontier when it is open, every blocker is satisfied, and it has no claim.
The map's Frontier is the only map section that links to ticket artifacts.
Do not copy ticket details into the map.
If the destination uses identifier allocation and concurrent writes caused duplicate identifiers or filenames, preserve pre-existing artifacts, rename current outputs, update wikilinks, and advance the counter as needed.
Done when the ticket artifacts and map Frontier agree with current ticket metadata.
## 8. Report
Report the created ticket artifacts by title using the destination's link style.
Summarize the current Frontier.
Mention any assumptions, unresolved planning questions, or human-dependent validation tickets.
Done when the user can choose the next implementation task from the Frontier.

58
skills/subagents/SKILL.md Normal file
View File

@@ -0,0 +1,58 @@
---
name: subagents
description: Delegate isolated work through Pi subagent tools. Use when a workflow needs an independent worker, fresh context, parallel reviewers, or hidden role separation.
disable-model-invocation: true
---
# subagents
## 1. Confirm support
Prefer tool calls when the current runtime exposes them.
The supported tool names are `subagent_spawn`, `subagent_batch`, `subagent_list`, `subagent_status`, `subagent_result`, and `subagent_cancel`.
If these tools are unavailable, do not pretend that an in-process role switch is a subagent.
State that Pi subagent tools are unavailable in the current runtime.
Do not perform the delegated subagent work in-process.
Done when the run has a supported subagent tool path.
## 2. Prepare a bounded prompt
Give each subagent a self-contained prompt.
Include the role, task, repository path, relevant files or artifacts, constraints, and expected output shape.
Do not expose private planning state that the workflow is trying to isolate.
For test-driven development, send one behavior at a time rather than a backlog.
For review, send one review dimension at a time unless batching independent dimensions.
Use `context: "independent"` for a fresh worker by default.
Use `context: "fork"` only when the child intentionally needs the parent transcript as starting context.
Choose named agents only when the project has configured them.
Do not invent named agents as part of the delegation.
Done when the prompt is narrow enough that the subagent can complete without sharing hidden state or requiring follow-up orchestration.
## 3. Spawn and track workers
Use `subagent_spawn` for one worker.
Use `subagent_batch` when several independent workers can run in parallel.
Both spawn tools return before the child work is complete.
Record accepted child ids and per-entry failures.
Use `subagent_list` or `subagent_status` to track lifecycle when needed.
Use `subagent_result` to retrieve completion output.
Use `subagent_cancel` for stale or no-longer-needed workers.
Do not claim the delegated work is complete until every required child result is available or a failed child has an explicit disposition.
Treat `queued`, `starting`, `running`, and `settling` as incomplete states.
Treat `failed`, `cancelled`, `timed_out`, and `orphaned` as failures unless the caller explicitly accepts the missing result.
Done when every required worker result has been collected or every missing result has a stated disposition.
## 4. Integrate results
Use subagent output as evidence, not as an unquestioned command.
Preserve which child produced each material finding.
When subagents disagree, report the disagreement rather than averaging it away.
When a subagent result changes implementation direction, verify the relevant facts in the parent context before editing code.
Done when the parent has integrated child results into the caller workflow with provenance and limitations visible.

View File

@@ -0,0 +1,77 @@
---
name: test-driven-development
description: Drive red-green-refactor implementation with tests written by someone other than the implementation agent, using public behavior and independent expected values.
---
# test-driven-development
Use test-driven development as process discipline for behavior-bearing changes.
The result is working behavior plus useful tests, not a separate report artifact.
## 1. Establish roles and behavior backlog
Name the two functional roles before writing tests.
The implementation agent changes production code and drives the loop.
The test writer writes and edits tests.
Tests are always written by someone other than the agent doing implementation.
Launch an independent test writer through whatever real context boundary the current harness provides.
A separate agent, worker, subprocess, or documented headless session is sufficient when it cannot see the implementation agent's private backlog.
If no real context boundary is available, stop before writing tests and report that test-driven development cannot be completed in the current runtime.
Do not replace the independent test writer with an in-process role switch.
Do not silently skip the independent-test-writer requirement.
The implementation agent may keep a private behavior backlog.
Keep that backlog isolated from the test writer.
The test writer receives one behavior at a time, not the whole backlog.
Done when roles are explicit and the implementation agent has the next behavior ready without exposing the whole backlog to the test writer.
## 2. Choose the public seam and source of truth
Test public behavior through the interface the code exposes or the task requires.
When the seam is unclear, identify the smallest public seam that can prove the behavior.
Do not test internals just to make RED easy.
Each test needs an independent source of truth for expected values.
Acceptable sources include a spec, task, intent excerpt, worked example, known-good literal, existing behavior being preserved, user clarification, or external standard.
The implementation agent's derived computation is not enough.
Done when the next behavior has a public seam, enough context for the test writer, and an independent expected-value source.
## 3. Run one red-green cycle
Give the test writer exactly one behavior, the public seam and context, the independent expected-value source, and any relevant project test conventions.
The test writer writes or edits one test for that behavior and confirms it fails for the intended reason.
A failing test should fail because the behavior is missing or wrong, not because of import, syntax, fixture, or collection errors.
The implementation agent writes the minimal production code needed to pass that test.
The implementation agent must not edit test-writer-authored tests.
If the test has a mechanical defect, send the error back to the test writer.
If the implementation agent believes the test asserts the wrong semantics, pause for user or intent clarification.
Done when one behavior has a meaningful failing test and then passes through production-code changes made by the implementation agent.
## 4. Repeat behavior by behavior
Repeat the red-green cycle one behavior at a time.
Do not bulk-write tests before implementation.
Do not let the test writer see the behavior backlog.
Do not add speculative behavior while making the current test pass.
Run focused verification as each behavior lands.
Use broader verification when the repository or change warrants it.
Done when every selected behavior has passed through the one-behavior red-green loop or has been deliberately deferred by the implementation agent's judgment.
## 5. Refactor only after green
Never refactor while RED.
After tests pass, the implementation agent may refactor production code.
Refactoring means changing code structure without changing externally observable behavior.
The test writer updates tests only for deliberate public seam changes or test defects.
A test failure during refactoring normally means production behavior broke.
Fix production code unless the public seam changed deliberately.
Done when refactoring, if any, is complete and the relevant tests remain green.

View File

@@ -0,0 +1,154 @@
# Wayfinder artifacts
## Resolve the project
Resolve the artifact destination before naming files.
When the caller provides a destination directory, use it exactly.
Otherwise, default to `$(xdg-user-dir DOCUMENTS)/ai-artifacts/projects/<project>` when the AI artifacts vault is available, where `<project>` is the lowercase basename of the current working directory.
If that vault is unavailable, fall back to `./docs` in the current project.
Create the destination directory only when a new artifact requires it.
Read the destination's `AGENTS.md` before any artifact write.
Allocate identifiers only when the destination convention requires them.
## Names
Use an effort name that identifies one durable effort and is not reused for another map in the project.
Choose each filename from the destination's `AGENTS.md` and nearby artifact convention.
Do not assume a counter, numeric prefix, slug shape, or artifact-type suffix unless the destination convention requires it.
If no convention can be determined, choose the least surprising lowercase descriptive Markdown filename and state that the destination did not define a naming convention.
Refer to artifacts through the link style used by the destination.
Never use a bare identifier as a human-facing reference.
Ticket filenames use the substantive artifact type as their artifact-type suffix: `research`, `prototype`, `grill`, `task`, or `implementation`.
Do not use `ticket` as a filename artifact-type suffix.
## Map
The map is the effort's root artifact and has no `parent`.
It is a route summary rather than the store for ticket resolutions.
Only the Frontier links to tickets or other artifacts.
```markdown
---
status: open
tags:
- wayfinder/map
---
# <effort name>
## Destination
<one or two lines describing what reaching the end of this map looks like>
## Notes
<standing domain, skill, and execution guidance>
## Frontier
- [[<open-unblocked-unclaimed-ticket>]]
## Decisions so far
<one plain-language decision or implementation outcome per resolved ticket, without artifact links>
## Not yet specified
<in-scope fog that is not precise enough to ticket>
## Out of scope
<work consciously ruled beyond the destination>
```
Map status is `open` while any live ticket or fog remains and `complete` when neither remains.
The Frontier is a derived navigation index and the map's only artifact-link section.
Ticket metadata is authoritative.
Repair the Frontier whenever it is missing, stale, or inconsistent with ticket state.
Order Frontier links by the destination's declared ordering unless the user chooses another ticket.
Fall back to filename order when no ordering is declared.
Under **Decisions so far**, record one concise, self-contained decision or implementation outcome for each resolved ticket.
Do not link or identify the resolved ticket, or copy supporting detail from the canonical resolution into the map.
## Tickets
A new ticket starts as:
```markdown
---
status: open
parent: "[[<map-or-surfacing-ticket>]]"
blocked-by: []
tags:
- ticket/<type>
---
# <ticket name>
## Question
<one precise question, prerequisite action, or implementation slice sized to one agent session>
```
Use one of these tags:
- `ticket/research`
- `ticket/prototype/afk`
- `ticket/prototype/hitl`
- `ticket/grill`
- `ticket/task/afk`
- `ticket/task/human`
- `ticket/implementation`
`parent` records provenance.
An initial ticket points to the map.
A ticket surfaced by another ticket points to the surfacing ticket.
An artifact may have many children, which agents find by searching for backlinks to its wikilink.
`blocked-by` records zero or more upstream artifacts that must resolve before the ticket becomes actionable.
It is independent of `parent`.
A ticket blocker is satisfied when its status is `resolved`.
A non-ticket blocker is satisfied when its artifact exists.
A ticket is on the Frontier when its status is `open`, every blocker is satisfied, and it has no claim.
A `ticket/task/afk` ticket is prerequisite work that unblocks the route.
A `ticket/implementation` ticket is a code, configuration, documentation, or test slice that delivers part of an execution map's destination.
## Claims and status
Ticket status is one of:
- `open`
- `claimed`
- `resolved`
- `out-of-scope`
Claim a ticket by setting `status: claimed`, `claimed-by` to the current execution-session identifier, and `claimed-at` to the current timestamp before doing any work.
Use `PI_SESSION_ID` when available and an equivalent harness session identifier otherwise.
Claims do not expire automatically.
The acting agent uses the available context to recover an abandoned claim.
Only resolved tickets contribute decisions or implementation outcomes under **Decisions so far**.
An out-of-scope ticket is closed, while **Out of scope** states the excluded work and reason in plain language without linking or identifying the ticket.
## Results
A ticket is a self-resolving artifact.
Its canonical result lives in that same artifact rather than in a child result artifact.
When invoking `research`, `prototype`, or `implement`, provide the resolved ticket artifact path.
The called skill completes the ticket artifact in place and does not edit the map.
The coordinating Wayfinder agent validates the updated ticket artifact, marks the ticket resolved when the called skill has not already done so, and updates the map.
If a called skill cannot honor this artifact contract, leave the ticket unresolved and record the incompatibility instead of silently storing the result elsewhere.
Navigate the artifact journey forward by finding every note whose `parent` links to the current artifact.
Do not duplicate those relationships through per-artifact Next sections.
## Concurrent writes
Re-read every shared artifact immediately before editing it.
After concurrent workers return, detect duplicate identifiers or filenames, preserve pre-existing artifacts, rename current outputs when required by the destination convention, update their links, and advance any counter required by that convention.
Recompute the Frontier only after returned artifacts and ticket states have been reconciled.

176
skills/wayfinder/SKILL.md Normal file
View File

@@ -0,0 +1,176 @@
---
name: wayfinder
description: Plan or coordinate a huge chunk of work that exceeds one agent session as a durable map of tickets, then resolve them until the way to the destination is clear.
disable-model-invocation: true
---
# Wayfinder
A loose idea has arrived that is too large for one agent session and wrapped in fog.
Wayfinding charts the way to a **destination** rather than charging at it.
It creates a durable map of questions whose resolutions are decisions, findings, prototypes, completed prerequisites, or explicit implementation slices.
Read [`ARTIFACTS.md`](ARTIFACTS.md) before charting or working a map.
It is the single source of truth for how maps, tickets, claims, blocking, resolutions, and the Frontier live in the resolved artifact destination.
## Plan, don't do
Wayfinder plans by default.
The map is complete when nothing remains to decide before someone performs the destination work.
The urge to implement the destination usually marks the edge of a planning map and the time to hand off.
An effort may explicitly permit execution in its Notes, but otherwise preserve resolutions rather than deliver the destination.
A map may explicitly be an execution map when the destination is a tracked implementation effort rather than a route to a later handoff.
Execution maps use the same ticket, claim, and Frontier mechanics, but implementation tickets may deliver slices of the destination.
The destination varies by effort and shapes every ticket.
It may be a spec to hand off, a decision to lock before planning, a change whose route must be understood before implementation, or an implementation effort whose slices need coordination.
## Refer by name
Refer to every map and ticket by its human-readable title using the destination's link style, never by a bare identifier, filename, or slug.
When the destination convention includes an artifact identifier, keep it inside the link without letting it stand in for the name.
## Ticket types
Every ticket is either **HITL**, worked through a live exchange with the human, or **AFK**, driven by the agent.
A HITL ticket only resolves through that exchange.
The agent never speaks for the human's side.
- **Research** (AFK): Investigate documentation, third-party APIs, or resources outside the current working directory through `research`.
The called skill completes the Research ticket artifact in place.
- **Prototype** (AFK or HITL): Raise the fidelity of a logic, state-model, or UI decision through `prototype`.
Use AFK when the question has objective observable criteria the agent can test end to end.
Use HITL when the verdict depends on human judgment, taste, or UX feel.
The called skill completes the Prototype ticket artifact in place after the verdict is reached.
- **Grill** (HITL): Resolve a decision through `grill`.
This is the default ticket type.
- **Task** (AFK or HITL): Perform prerequisite work that fits the map's destination.
In a planning map, a Task earns its place by unblocking a decision rather than delivering part of the destination.
The agent performs it where possible and otherwise gives the human a precise checklist.
- **Implementation** (AFK): Deliver a code, configuration, documentation, or test slice of an execution map through `implement`.
Implementation tickets expect checkout verification, tests where useful, review, commit or handoff, and Wayfinder closeout.
## Fog of war
The map is deliberately incomplete.
Beyond its tickets lies the **fog of war**, where in-scope questions are visible but cannot yet be stated precisely because they depend on unresolved questions.
Resolving a ticket clears the fog ahead of it and graduates newly precise questions into tickets.
Use this test:
- Create a ticket when the question is precise now, even if it is blocked.
- Keep an entry under **Not yet specified** when the question cannot yet be phrased precisely.
Do not pre-slice fog into speculative tickets.
One fog entry may become several tickets or disappear as the frontier advances.
The destination fixes scope.
Work beyond it belongs under **Out of scope**, never under **Not yet specified**.
When an existing ticket proves to be beyond the destination, mark it out of scope and summarize the excluded work and reason in that section without an artifact link.
Do not record a scope boundary as a decision on the route.
## Select the mode
- A loose idea without a map uses **Chart the map**.
- An existing map uses **Work through the map**.
- A session working a map with unblocked AFK Frontier tickets uses **Coordinate workers** inside **Work through the map** when the current harness provides a real isolation or concurrency mechanism.
Worker coordination is the default for AFK Frontier work when an isolation or concurrency mechanism is available.
The current session acts as coordinator.
A worker session resolves exactly one claimed ticket and stops.
A coordinating session may dispatch multiple open Frontier tickets through whatever real isolation or concurrency mechanism the current harness provides.
A coordinating session does not claim tickets it intends to delegate.
Each worker claims its own ticket so accountability remains attached to the session doing the work.
An interactive Wayfinder session may resolve multiple tickets sequentially only when worker coordination is unavailable, unnecessary, or explicitly not selected.
It must complete the full reconcile, claim, resolve, record, and frontier-advance loop before selecting another ticket.
Do not auto-consume HITL tickets without user participation.
## Chart the map
1. **Name the destination.**
Invoke `grill` to settle what this map is finding its way toward.
Done when the destination names the spec, decision, or change at the end of the effort and fixes its scope.
2. **Map the frontier breadth-first.**
Invoke `grill` again to fan out across the whole space without resolving any one branch in depth.
Surface every currently precise question, its blocking relationships, and the remaining fog.
If no fog remains and the whole route fits one session, stop and ask how the user wants to proceed instead of creating a map.
Done when every visible in-scope uncertainty has exactly one home as a precise ticket question or an honest fog entry.
3. **Create the map and tickets.**
Create the map first, then every currently precise ticket, then wire blocking relationships in a second pass according to [`ARTIFACTS.md`](ARTIFACTS.md).
Done when the map is the effort root, every precise question has one ticket, every known blocking edge is represented, and the Frontier is current.
4. **Dispatch Research.**
Invoke `research` for each Research ticket using whatever isolation or concurrency the caller provides.
Reconcile each completed Research ticket according to [`ARTIFACTS.md`](ARTIFACTS.md).
Leave a ticket open with the reason visible when its Research run cannot complete.
Done when every dispatched Research ticket is resolved or records why it remains open.
5. **Stop.**
Stop without resolving a HITL ticket.
Done when charting has created and dispatched the visible route without consuming its human decision work.
## Work through the map
1. **Orient.**
Read the map at low resolution rather than loading every ticket.
Reconcile its derived Frontier against ticket metadata.
Done when the destination, Notes, prior decisions, fog, scope boundary, and current Frontier agree with the artifacts.
2. **Claim one ticket or coordinate workers.**
If unblocked AFK Frontier tickets can be delegated through a real isolation or concurrency mechanism, use **Coordinate workers** instead of claiming a ticket here.
Use the user-named ticket when it is actionable and not delegated.
Otherwise take the first Frontier ticket in the destination's declared ordering, falling back to filename order when no ordering is declared.
Persist the claim before doing any direct work.
Done when exactly one unblocked ticket records this session's claim with `status: claimed`, or the session has switched to worker coordination without claiming delegated tickets.
3. **Resolve by type.**
Invoke `research`, `prototype`, `grill`, or `implement` for the corresponding ticket type.
Perform a Task through the capability or human checklist it requires.
Load related artifacts only when needed.
Done when the question has a resolution, the prerequisite Task is complete, or the implementation slice has a concrete handoff state.
4. **Record the resolution.**
Persist the canonical result in the ticket artifact, resolve the ticket, and append its concise decision or implementation outcome under the map's **Decisions so far** according to [`ARTIFACTS.md`](ARTIFACTS.md).
Do not link or identify the resolved ticket from the map.
Done when the resolution lives in the ticket artifact and the map states only the resulting decision or outcome.
5. **Advance the frontier.**
Create tickets surfaced by the resolution and wire their blockers.
Graduate newly precise fog, remove invalidated tickets, move beyond-destination work out of scope, and recompute the Frontier.
Re-read shared artifacts before each write because other sessions may edit the effort concurrently.
Done when every newly visible question has exactly one home and the map agrees with all current ticket metadata.
6. **Complete, continue, or stop.**
When no unresolved tickets or fog remain, mark the map complete and stop for an explicit handoff instruction.
In a worker session, stop after one ticket is resolved and the frontier is advanced.
In an interactive or coordinating session, continue to another Frontier ticket only after reconciling the map and shared artifacts again.
Otherwise stop.
Done when the map records its current lifecycle state and no destination work has begun without permission.
## Coordinate workers
1. **Select dispatchable tickets.**
Re-read the map and current Frontier before dispatch.
Select only open, unclaimed, unblocked AFK tickets.
Do not dispatch HITL tickets without live user participation.
Include every eligible AFK Frontier ticket unless serial execution or likely conflict requires selecting a smaller batch.
Done when every selected ticket is eligible and no selected ticket has been claimed by the coordinator.
2. **Dispatch workers.**
Send each selected worker exactly one ticket, the artifact path, the map context it needs, and the instruction to claim the ticket itself before work.
Route Research tickets through `research`, AFK Prototype tickets through `prototype`, Implementation tickets through `implement`, and AFK Task tickets through the focused task capability or checklist they require.
Use whatever real isolation or concurrency mechanism the current harness provides.
If no such mechanism exists, stop and report that worker coordination is unavailable in this runtime.
Use parallel workers when selected tickets are independent.
Use serial workers when tickets likely edit the same files, checkout, branch, or shared artifact surfaces.
Done when every selected ticket has either a launched worker or a visible dispatch failure.
3. **Join workers.**
Wait for every launched worker to finish, fail, time out, or be cancelled before treating coordination as complete.
Do not implement in the coordinator while workers are running.
Do not report final handoff while workers are still running.
Done when every launched worker has a terminal result or an explicit recovery status.
4. **Reconcile worker results.**
Re-read every shared artifact touched by returned workers.
Validate each ticket's claim, status, and canonical result.
Detect duplicate surfaced tickets or filenames, preserve pre-existing artifacts, and repair links according to [`ARTIFACTS.md`](ARTIFACTS.md).
Record whether a failed worker's claim remains, was reopened, or needs human recovery.
When Pi subagents supplied the worker results, call `subagent_clear` for each terminal child only after its findings have been reconciled into the artifacts or recovery record.
Done when all returned work is reconciled, every failed or missing worker result has an honest artifact state, and no reconciled terminal subagent remains in the visible work set.
5. **Advance the frontier.**
Recompute the Frontier after reconciliation, not before.
Mark the map `complete` only when no live ticket or fog remains.
Never use `resolved` as a map status.
Done when the map status, Frontier, and ticket metadata agree.

View File

@@ -1,49 +0,0 @@
---
name: wiki
description: Answer from the user's AI-managed wiki — read-only. Fires when a question plausibly concerns the user's recorded project knowledge, setup, config, decisions, preferences, or how-to notes rather than general world facts, or on "check my notes/vault/wiki", "what do my notes say about…", "do I have anything on…". Returns a synthesized answer with the source note paths, or states plainly that the wiki has nothing relevant.
---
# wiki
Answer a question from the user's AI-managed wiki, read-only.
The wiki is a knowledge base the user maintains, and this skill only ever reads it.
It searches the wiki and nothing else — not the web, not general knowledge — and the caller decides whether to combine the result with other sources.
The caller may be the user directly, a subagent, or another skill such as `/consume`, and the process below is the same for all three.
## 1. Resolve the wiki
The artifact root lives at `$(xdg-user-dir DOCUMENTS)/ai-artifacts`.
Its notes live under `wiki/` and its topic hubs live under `tags/`.
If either directory does not resolve or does not exist, report that the wiki is unreachable and stop.
Done when you have the wiki and tag paths.
## 2. Gather candidate notes
Expand the question into several search terms — synonyms, related concepts, and named entities — so a note worded differently than the question is still found.
Search with ripgrep over the Markdown files directly, not obsidian-cli, so retrieval works whether or not Obsidian is running: `rg -l -i` each term over `*.md` under `wiki/`.
Then widen for recall through the topic hubs under `tags/`.
Each note in `tags/` names a topic, and every note on that topic links to it with a bare `[[topic]]` wikilink, so for any hub matching the question, add its members — the notes containing `[[<hub-name>]]` — to the candidates.
Done when you have a candidate set of note paths.
## 3. Read to saturation, following links
Read every candidate note.
Within each, follow every `[[wikilink]]` that bears on the question to its note and read that one too, then repeat on those notes' links.
Continue until a full pass surfaces no note you have not already read — saturation.
There is no cap on how many notes you read, and a broad question legitimately pulls in many.
Read only Markdown — attachments and other binaries are not sources.
Done when every note bearing on the question has been read and a further pass finds nothing new.
## 4. Answer with provenance, or report nothing
If the notes answer the question, synthesize the answer, then list the notes whose content you drew on by path, each with its key excerpt, and cite that path for every claim taken from the wiki.
A note that only led you to others, such as an empty topic hub, is a discovery aid rather than a source, so leave it out of the list.
If nothing relevant was found, say plainly that the wiki has nothing on the question.
Do not pad the answer with wiki-flavored prose that no note supports, and do not create a note to fill the gap.
Done when the answer cites its source notes, or explicitly reports that the wiki has nothing relevant.