OR Key
drop another .md file to compare - side-by-side diff against evolve

evolve

Lets your assistant keep improving itself and only keeps changes that help.
description: "Triggers on prompt mention of 'evolve'."
personal 2 files 10 recent evals

What it does for you

Lets your assistant keep improving itself and only keeps changes that help.

What it produces

A recent result, so you can see the kind of work it returns.

loading…

How to get it

These run inside the Snappy workspace. Want this working in your business? I set skills like this up with you, in one focused week.

Work with me
For developers how this skill is built, graded, and how it runs

at a glance- the short version

actorState/bin/evolve/run.ts (proposer + applier).
auditorHealth_score() reading ndjson
eval modeauto-shape
categoryOps
stages4
dependseval, dispatch

what's inside - the parts that make up a skill 2/4 present

A skill is just a few plain-text files. Only the main one is required. The rest are optional, added as the work needs them. This is what the skill is made of; how it runs is just below.

The skill
state/skills/evolve/SKILL.md present
the skill itself, in plain text
The main file. It says what the skill is and lays out the steps in plain English.
Code
state/lib/evolve.ts not present
code the skill can run
Optional. Many skills are just words and need no code at all.
Scripts
state/bin/evolve/ not present
helper scripts
Optional. Added when a skill has a few commands to run.
Loader
state/skills/evolve/AGENTS.md present
what the AI loads on the fly
Loaded automatically the moment this skill is needed. Kept short on purpose.

how it's graded - what counts as a good run 5 criteria · 4 deterministic · 1 judge

Each row is one thing a good run has to get right. deterministic means a quick check decides, pass or fail. judge means the AI reads the result and rates it. Grading each piece on its own (instead of one overall score) shows exactly where a run fell short, so the fix is obvious.

name
kind
check
working_tree_clean_exit_code
deterministic
The skill script exits with code 3 if the working tree is not clean at invocation.
log_integrity_and_completeness
deterministic
Each iteration appends a well-formed row to 'state/log/evolve.ndjson' containing fields {i, candidate, baseline, new, delta, kept, wall_time_ms} as specified.
mutation_catalog_adherence
deterministic
The 'candidate' field in 'state/log/evolve.ndjson' logs matches one of the 8 specified mutation names in the documented catalog for its corresponding iteration 'i'.
keep_revert_logic_adherence
deterministic
For each iteration, the 'kept' field in 'state/log/evolve.ndjson' is true if 'delta' > 0.005, and false otherwise, reflecting the 'keep_or_revert()' logic.
side_effect_honesty
judge
The skill only modifies the local git repository and 'state/log/evolve.ndjson', without pushing commits or altering other system states not explicitly mentioned.

how it runs - the shared frame every skill uses 5/5 present

Every skill runs the same way. One part does the work, a separate part checks it, and a short loader hands the AI exactly what it needs for the job. Anything this skill doesn't use shows a one-line note saying why, on purpose, not by accident.

makes the work The worker
present
State/bin/evolve/run.ts (proposer + applier). an AI model
Does the actual work. Whatever it produces is what gets checked next.
checks the work The reviewer
present
Health_score() reading ndjson the checker
A separate checker grades the work, so the part that made it can't approve its own work.
frame
learns Self-correction
present
fixes itself learns from gaps
When a run hits a gap, the skill gets edited on the spot [FIXED] or queued for a bigger rewrite [LOGGED], so it keeps getting better.
tidies up Background fixes
present
queued for rewrite runs in the background
Bigger fixes that can't be made on the spot get queued and rewritten in the background later.
remembers Run history
present
state/log/evals.ndjson auto-shape runs
Every run is written down here, so the next time this skill is used it already knows how the last runs went.
Critical rules the things this skill must not get wrong
  1. NEVER disable or weaken the revert primitive — it is the ONLY safety. No "pause on N regressions", no "stop if score drops", no manual confirm.
  2. NEVER skip measure() — a committed mutation without a measurement is a silent bias in baseline.
  3. NEVER rewrite rows in state/log/evolve.ndjson — the log is append-only; it is the artifact.
  4. ALWAYS start from a clean working tree (harness exits 3 if dirty). Stash first, don't force.
  5. DO NOT push to remote from inside the harness. Local commits only; operator chooses when to push.
  6. Mutations MUST be idempotent — a no-op candidate SKIPs cleanly, never double-commits.

what it has learned - fixes written back in over time sample

When a run hits something this skill didn't handle, the fix gets written back into the skill so it doesn't happen again. FIXED means it was corrected on the spot. LOGGED means it's queued for a bigger rewrite. Either way, the skill gets a little better and never makes the same mistake twice.

  1. Loading feedback rows…

how the work flows- who makes it, who checks it

inputs evaldispatch
actor State/bin/evolve/run.ts (proposer + applier).
1 generator
invoke
actor = State/bin/evolve/run.ts (proposer + applier).
npx tsx state/bin/evolve/run.ts --max=<n>` (default 10)
auditor Health_score() reading ndjson
2 data
Scope — no side effects
Read state/log/evolve.ndjson to see what stuck and what didn't. This is
what this step does
Read state/log/evolve.ndjson to see what stuck and what didn't. This is the audit surface.
3 data
Log + eval
The harness itself appends to state/log/evolve.ndjson. Eval is shape-based:
what this step does
The harness itself appends to state/log/evolve.ndjson. Eval is shape-based: row presence + fields {i, candidate, baseline, new, delta, kept, wall_time_ms} intact. The delta sign determines whether the mutation landed.

SKILL.md- the skill, written out in plain English

evolve

The machine version of chaos-injection. snappy-os runs mutations on itself indefinitely, reverting what regresses and keeping what compounds. No human in the loop - the revert primitive IS the safety. No stop condition; "999 and then another 999" is the doctrine.

Steps

1. Scope - no side effects

Read state/log/evolve.ndjson to see what stuck and what didn't. This is the audit surface.

2. Gate

Working tree MUST be clean before starting. Any uncommitted change is a failure mode - the harness can't distinguish a regression from operator noise. The harness aborts with exit 3 if the tree is dirty.

3. Act - the loop

npx tsx state/bin/evolve/run.ts --max=3     # smoke (3 iterations)
npx tsx state/bin/evolve/run.ts --max=10    # default sanity
npx tsx state/bin/evolve/run.ts --max=999   # real session

Each iteration:

  1. propose_mutation(i) - deterministic, rotating over a 5-candidate catalog.
  2. apply_candidate() - edit + git add + git commit (local only).
  3. measure() - recompute health_score.
  4. keep_or_revert() - keep if Δ > 0.005, else git revert HEAD --no-edit.
  5. Append one row to state/log/evolve.ndjson.

4. Log + eval

The harness itself appends to state/log/evolve.ndjson. Eval is shape-based: row presence + fields {i, candidate, baseline, new, delta, kept, wall_time_ms} intact. The delta sign determines whether the mutation landed.

Health score

Composite metric in [0, 1]:

WeightComponentSource
0.35rolling-20 eval meanstate/log/evals.ndjson
0.25open-breakage invertedstate/log/breakage-report.ndjson (latest-per-area)
0.20parity mean across runtimesstate/log/parity.ndjson (last batch)
0.10sync-drift invertedstate/log/sync-events.ndjson (tail 500)
0.10recurring-area invertedstate/log/breakage-report.ndjson (open-row count by area, last 7d)

Mutation catalog

Five seed candidates (rotated by (i-1) % N). Three earlier candidates (tune-breaker-cooldown, tighten-graduation-bar, swap-tui-view-order) were pruned 2026-04-26 because their target files (autopilot/break.sh, byline/tui.sh) and concept (graduation bar) were retired.

  1. add-lint-rule-trailing-newline - new warn rule in state/lint/check.ts
  2. extend-parity-canonical-5-to-6 - add ops to CANONICAL_SKILLS in state/lint/parity-test.ts
  3. tighten-lint-rule - promote eval-unknown lint from warn → error in state/lint/check.ts
  4. add-eval-gate-threshold - raise auto-eval gate 0.50 → 0.55 in state/lint/check.ts
  5. prune-redundant-skill - new warn rule: skills must have a paired <name>/AGENTS.md loader

Mutations are idempotent - already-applied mutations SKIP cleanly (logged, no commit).

Eval

Actor: state/bin/evolve/run.ts (proposer + applier). Auditor: health_score() reading ndjson logs the actor does NOT write.

The actor cannot game the score because the score is sourced from independent logs (evals, breakage, parity, sync-events, pid-trends).

Score convention:

OutcomeScore
Row appended with all required fields1.0
Row missing fields / malformed0.0

The kept/reverted decision is the evolutionary signal, not the eval.

Gotchas

  • Working tree MUST be clean before invoke - exit 3 otherwise.
  • Mutations are staged as local commits and NOT pushed. Operator decides

when (or whether) to push.

  • The revert is the safety. There is no "pause on N regressions" knob -

that would cap the harness's agency (doctrine).

  • Do not add LLM calls on the hot path - determinism lets the harness run

overnight without operator babysitting.

  • Iterations are append-only; never rewrite rows in evolve.ndjson.

Graduation

Graduated on first commit - this skill is born with a sidecar. The prose is documentation, not the implementation.

Rubric

criteria:
  - name: working_tree_clean_exit_code
    kind: deterministic
    check: "The skill script exits with code 3 if the working tree is not clean at invocation."
  - name: log_integrity_and_completeness
    kind: deterministic
    check: "Each iteration appends a well-formed row to 'state/log/evolve.ndjson' containing fields {i, candidate, baseline, new, delta, kept, wall_time_ms} as specified."
  - name: mutation_catalog_adherence
    kind: deterministic
    check: "The 'candidate' field in 'state/log/evolve.ndjson' logs matches one of the 8 specified mutation names in the documented catalog for its corresponding iteration 'i'."
  - name: keep_revert_logic_adherence
    kind: deterministic
    check: "For each iteration, the 'kept' field in 'state/log/evolve.ndjson' is true if 'delta' > 0.005, and false otherwise, reflecting the 'keep_or_revert()' logic."
  - name: side_effect_honesty
    kind: judge
    check: "The skill only modifies the local git repository and 'state/log/evolve.ndjson', without pushing commits or altering other system states not explicitly mentioned."

AGENTS.md- what the AI loads when this skill comes up

evolve - loader

Per-turn rules for the evolve skill. Full reference: state/skills/evolve/SKILL.md. Do not skip these.

Critical Rules

  • NEVER disable or weaken the revert primitive - it is the ONLY safety. No "pause on N regressions", no "stop if score drops", no manual confirm.
  • NEVER skip measure() - a committed mutation without a measurement is a silent bias in baseline.
  • NEVER rewrite rows in state/log/evolve.ndjson - the log is append-only; it is the artifact.
  • ALWAYS start from a clean working tree (harness exits 3 if dirty). Stash first, don't force.
  • DO NOT push to remote from inside the harness. Local commits only; operator chooses when to push.
  • Mutations MUST be idempotent - a no-op candidate SKIPs cleanly, never double-commits.

Commands

| ui dashboard | state/skills/evolve/resources/ui.openui | |invoke: npx tsx state/bin/evolve/run.ts --max=<n> (default 10) |smoke: npx tsx state/bin/evolve/run.ts --max=3 |real: npx tsx state/bin/evolve/run.ts --max=999 |log: state/log/evolve.ndjson (append-only)

OpenUI Resource

  • Skill-owned OpenUI Lang resource: state/skills/evolve/resources/ui.openui. Read it before rendering or editing this skill's generated component surface.
  • Treat this resource as a first-class artifact of the skill, not a generic chat response. Improve it when the skill's user-facing output needs to become richer.
  • System resources compose OpenUI primitives and inherit SnappyChat tokens. Use ui_contract: branded in SKILL.md only for deliberate platform or client visuals.

Known Pitfalls

  • Statusline/hook runs can dirty the working tree between iterations - if a revert leaves drift, the harness aborts (exit 4). Investigate the hook, don't patch the harness.
  • pid-trends.ts is invoked per-iteration; if absent, recurring-area component defaults to 1.0 (no penalty) - don't confuse absence with perfection.
  • health_score reads evals.ndjson tail-20 - if the log was recently truncated, baseline may be artificially low. Use a longer window for real sessions.

Self-Test

  1. [ ] Is the working tree clean before invoke?
  2. [ ] Is the mutation catalog idempotent (re-running the same iter is a no-op)?
  3. [ ] Does every iteration append exactly one row to evolve.ndjson?
  4. [ ] Does a reverted iteration leave the working tree clean?

Self-report

If this loader fell short, append a line:

echo "[$(date -u +%FT%TZ)] evolve: <what was missing>" >> state/log/loader-feedback.log

<!-- kernel-ok: historical attribution for the PID-loader pattern. -->

Self-correcting loader (PID feedback)

This is the rule that makes loaders learn. Ported from snappy-kernel, where it demonstrably worked: the snappy-dom-cartographer skill mapped Skool admin UI once, every later ship-agent inherited the full map for free.

Before you finish, do two things:

1. Fix gaps (P - proportional). MANDATORY. If this loader didn't cover your case - if you had to read another file, run an undocumented command, work around a wrong selector, or discover a quirk - you MUST attempt an Edit to this AGENTS.md before you log.

  • Default action: edit this file. Surgical. Add the missing line, table

row, or code example where it belongs. No restructuring.

  • Only LOGGED is allowed when: the fix needs >10 lines, spans multiple

files, or requires a structural rewrite. In that case the state/regen/drain.sh queue picks it up asynchronously.

  • "I didn't have time" / "it's minor" / "the next agent will figure it out"

are NOT valid reasons. Minor gaps compound - that's the whole point of this loop.

  • Concrete example of a valid P-fix: discover agent-browser screenshot

takes path positionally not as --output <path>. One line in a table. Edit it in. Do not just log it.

  • The goal: the next agent never has to leave the loader.

2. Log the result.

echo "[$(date -u +%FT%TZ)] evolve: <what was missing or fixed> [FIXED|LOGGED]" >> state/log/loader-feedback.log
  • FIXED = you patched this loader inline (P-fix).
  • LOGGED = too large for inline; the PostToolUse enqueue + Stop-hook drain

will rewrite the loader from scratch on next session-end.

Do not skip this. Every agent run must leave the system better than it found it. The loader is the setpoint; you are the sensor; the gap is the error signal; closing the gap is the correction.

api.ts- the code it can call

⚠ no api.ts - this skill has no typed action surface

scripts- helper scripts it can run

prose-only skill - 2 inline code blocks live in SKILL.md above (no state/bin/ sidecar yet).

how we check it- the checks, plus the last 10 runs

rubric auto-shape no rubric declared
recent mean 0.90 · 10 runs actor/auditor: unverifiable
deps eval dispatch
timestamp verb score primary_issue artifact
2026-04-26 23:47Z - 0.50 - -
2026-04-25 04:11Z - 1.00 - -
2026-04-21 15:58Z - 1.00 - -
2026-04-21 15:56Z - 1.00 - -
2026-04-21 03:53Z - 1.00 - -
2026-04-26 23:47Z - 0.50 - -
2026-04-25 04:11Z - 1.00 - -
2026-04-21 15:58Z - 1.00 - -
2026-04-21 15:56Z - 1.00 - -
2026-04-21 03:53Z - 1.00 - -