WikiSkill Harness · macOS

Agents that
teach themselves.

Cairn implements the WikiSkill loop: an agent runs tasks, a curator distils what happened into a knowledge wiki, a second curator proposes one skill change, and the change survives only if it measurably improves the next run.

Get started How it works →

A self-improving loop

Each iteration runs a training split, folds the transcripts into a living wiki, proposes exactly one skill change, and gates it against a held-out validation score. Skills that don't earn their keep are rolled back. The wiki never is.

1

Rollouts

Run the train split on the deploy model via OpenCode V2. Score every transcript with a deterministic verifier. Redact and write condensed traces to raw/iter-NNN/.

DeepSeek V4 Pro · Fireworks
2

Wiki Maintainer

Reads the condensed traces and patches wiki/ with new patterns and observations. The only role that ever touches the wiki.

Claude Sonnet 5 · Bedrock
3

Skill Proposer

Reads wiki/patterns/ and writes exactly one skill diff into skills/. If the diff touches more than one skill folder it is rejected unscored.

Claude Opus 5 · Bedrock
4

Gate

Run the validation split. Accept only if the new score strictly beats the best so far. On accept, commit. On reject, git restore skills/ — but commit the wiki anyway.

Deterministic · No LLM
5

Append & repeat

Write one entry to wiki/skill-impact.md either way. Reload the full skill text into the next iteration's inference agent and go again.

Stop at 100% val · or 8 iters

Data flow

Rollouts on deploy model train split
condensed traces → raw/
Wiki Maintainer patches wiki/
reads patterns
Skill Proposer one diff to skills/
diff scope check → Jev repeat
Gate: validation split accept or git restore
commit + append skill-impact.md
Next iteration inject full SKILL.md text
Two invariants. Only skills/ feeds back into rollouts — the inference agent is sandboxed away from the wiki. The best score starts at the empty-skill baseline; a first proposal that ties it is a rejection.

Three components

A Rust daemon owns the loop, vault, and credentials. A Tauri cockpit relays through it without ever touching a secret. OpenCode V2 executes every rollout in an isolated sandbox.

crates/wikiskilld
wikiskilld
The macOS launchd daemon. Owns every run and schedule, supervises OpenCode under a Seatbelt profile, serves a localhost API with a bearer token, and reads credentials exclusively from the Keychain. Runs survive closing the cockpit.
Rust · Tokio · Axum launchd agent Keychain
crates/wikiskill-core
wikiskill-core
Library crate: the loop, gate, verifier runner, curator agent loops, Bedrock and Fireworks clients, Jev integration, vault and git operations, and the Seatbelt profile generator. 172 tests pass with no network or credentials.
Loop & gate Bedrock · Fireworks Seatbelt
apps/cockpit
Cockpit
A Tauri window that is a pure relay — it reads the daemon's localhost API and renders runs, diffs, skill impact, and patterns. API keys never reach the webview. "Open in Obsidian" links surface every note at a click.
Tauri 2 Runs · Gate · Patterns obsidian:// links

Skills that earn their keep

Every skill must beat the best-so-far validation score on the exact model it will run on. A tie is a rejection. The gate is a deterministic verifier — no LLM, no judgment.

Strict acceptance rule

The baseline is the empty-skill validation score. A proposal is accepted only if its validation score is strictly higher than the best-so-far. On reject, git restore skills/ runs immediately — but the wiki update is committed regardless.

30 train tasks
15 val tasks
15 test tasks

Full skill injection

Every active SKILL.md is concatenated into the inference agent's prompt before each iteration's rollouts — byte-identical across all of them so prompt caching absorbs the cost. The native skill tool is denied; selection is never a variable in a measurement.

8 max iters
390 max rollouts
# wiki/skill-impact.md — appended every iteration

### iter-003 · tighten-tool-ordering · Accepted
- val: 0.733 (best was 0.667) · rule: strict, single run
- diff: skills/tighten-tool-ordering/SKILL.md

### iter-004 · break-repetition-loop · Rejected
- val: 0.600 (best 0.733) · rule: strict, single run
- jev_repeat_of: iter-001 (p=0.82, warned)
- diff: skills/break-repetition-loop/SKILL.md

Obsidian vault.
Git repo. Both.

The vault is an Obsidian folder and a git repo at once. Every accepted change is a commit you can inspect or revert from the cockpit. The wiki is meant to be read by a person; the skills are what the agent executes.

~/Vaults/WikiSkill/ ├── raw/ │ ├── iter-NNN/ condensed traces, 0444 │ ├── _jsonl/ full transcripts │ └── daily/ coding sessions ├── wiki/ │ ├── index.md static catalog │ ├── logs.md append-only │ ├── skill-impact.md │ └── patterns/ one note per pattern ├── skills/ │ └── <name>/ │ ├── SKILL.md what the agent runs │ └── PURPOSE.md [[links]] to patterns └── eval/ ├── train.jsonl ├── val.jsonl └── test.jsonl

⬡ Knowledge graph in Obsidian

Pattern notes, skill PURPOSE files, and impact logs are plain Markdown with [[wikilinks]]. Open any note in Obsidian; use the graph view to see which patterns motivated which skills.

⎇ Every accepted skill is a commit

The daemon commits on accept and git restore skills/ on reject. Revert from the cockpit's Gate view — or from the terminal — if a later iteration regresses.

⚡ Daily-use capture

A small OpenCode plugin posts finished coding sessions to the daemon. The nightly maintainer folds them into the wiki; the weekly proposer checks whether they suggest a skill change.

🔒 Sandboxed reads

The rollout Seatbelt profile denies reads of the vault path entirely. The inference agent cannot read the wiki — the paper shows it degrades skill quality if it can.


The right model
for each role

Rollouts run on the deploy model — the one you code with daily. Skills evolved on a different model hurt rather than help. Curators stay on Claude; counting and gating stay in Rust.

Role Model Endpoint Why
Inference DeepSeek V4 Pro Fireworks Skills must be gated on the model that will run them
Exploratory DeepSeek V4 Flash Fireworks ≈ 1/12th cost; re-gate on Pro before adoption
Wiki Maintainer Claude Sonnet 5 Bedrock runtime Long traces in, structured patch edits out
Skill Proposer Claude Opus 5 Bedrock runtime One high-leverage change per iteration
Decision layer Jev 1.13 TypeSafe API Cheap typed judgments; never gates, writes, or counts

Up in eight steps

macOS only. Everything runs on one machine: a Rust daemon, a vault, and OpenCode V2. See docs/setup.md for the full guide.

Build

Build the daemon and cockpit

cargo build --release
cargo test --workspace   # 172 tests, no network
cd apps/cockpit/src-tauri && cargo build
Executor

Install OpenCode V2 (pinned)

npm install -g @opencode/cli
opencode2 --version   # must be 2.0.x

The daemon checks the version at startup and refuses anything outside the pinned minor.

Vault

Initialise the vault

wikiskilld init --vault ~/Vaults/WikiSkill

Keep the vault outside ~/Documents, ~/Desktop, and iCloud Drive — sync clients race daemon writes.

Credentials

Store API keys in the Keychain

wikiskilld credential set wikiskill-fireworks
wikiskilld credential set wikiskill-jev  # optional
Models

Set model IDs in config.json

# Use inference-profile ids on Bedrock:
# global.anthropic.claude-sonnet-5
# Use dated ids on Fireworks:
# accounts/fireworks/models/deepseek-v4-pro-0813
Tasks

Write your eval task set

# 60 tasks from your own work
# eval/train.jsonl  — 30 tasks
# eval/val.jsonl    — 15 tasks
# eval/test.jsonl   — 15 tasks

A flaky verifier turns the gate into noise. Every number in the cockpit is downstream of this.

Baseline

Measure the empty-skill score

wikiskilld baseline

This is the bar a first proposal has to beat. Without it, any acceptance threshold is arbitrary.

Run

Start the loop

wikiskilld run            # foreground
wikiskilld serve          # daemon + API
wikiskilld install-agent  # launchd