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

snappy-verify

Checks that everything is healthy and flags anything stuck.
description: "Triggers on prompt mention of 'snappy-verify'."
personal 2 files

What it does for you

Checks that everything is healthy and flags anything stuck.

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

actorThing that
auditorThing that judges (must be different - see CONSTITUTION
eval modeauto
categoryObservability
stages4
dependslog, eval, dispatch

what's inside - the parts that make up a skill 3/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/snappy-verify/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/skills/snappy-verify/api.ts present
code the skill can run
Reusable code this skill can call when it needs to.
Scripts
state/bin/snappy-verify/ not present
helper scripts
Optional. Added when a skill has a few commands to run.
Loader
state/skills/snappy-verify/AGENTS.md present
what the AI loads on the fly
Loaded automatically the moment this skill is needed. Kept short on purpose.

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
Thing that the worker
Does the actual work. Whatever it produces is what gets checked next.
checks the work The reviewer
present
Thing that judges (must be different - see CONSTITUTION 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 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
No must-not-break rules called out for this skill. Anything important lives in the writeup below.

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 logevaldispatch
actor Thing that
auditor Thing that judges (must be different - see CONSTITUTION
1 auditor
Audit — structured report
Parse logs for patterns:
what this step does
Parse logs for patterns: - **Errors:** RUN_FINISHED.error entries, backend spawn failures, TDZ crashes, unhandledRejection - **Staleness:** evals.ndjson last entry >1h old, threads >3d old, server.ts PID stale - **Completeness:** recent dispatch runs with toolCalls vs empty, artifact count vs recent saves - **Drift:** server.ts newer than server.mjs (AOT stale), git status "modified" flags (unsaved work)
2 auditor
Emit report + eval
Structure: {ok: boolean, errors: [], warnings: [], recommendations: [], timestamp}. Score = 1.0 if ok + no warnings, 0.5
what this step does
Structure: {ok: boolean, errors: [], warnings: [], recommendations: [], timestamp}. Score = 1.0 if ok + no warnings, 0.5 if warnings, 0.0 if errors.
3 data
Read system state (scope-only, no side effects)
Read evals.ndjson (last 50 rows), dispatch-chat.ndjson (last 30 rows), state/agents/.json (all), state/log/threads/.json
what this step does
Read evals.ndjson (last 50 rows), dispatch-chat.ndjson (last 30 rows), state/agents/*.json (all), state/log/threads/*.json (count), git status (clean?), running procs (server.ts PID, LaunchAgent daemons).
4 data
Gate
All log files readable? Git repo accessible? No permissions failures. If gate fails, emit error code with specific path.

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

snappy-verify

Audit the live system state and report health. Reads evals, dispatch log, recent threads, running agents, artifact count, git status. Returns structured findings: errors, stale processes, incomplete runs, configuration drift. Failure mode: silent degradation (agents running fine but audit is broken, changes ship unverified).

Observed user requests

These are the prompts that triggered this skill being scaffolded:

  • "verify that the system is working correctly"
  • "verify the state of all components"
  • "verify that changes were applied successfully"

The Steps section below is a first-draft response to this cluster - refine as eval scores accumulate.

Steps

1. Read system state (scope-only, no side effects)

Read evals.ndjson (last 50 rows), dispatch-chat.ndjson (last 30 rows), state/agents/.json (all), state/log/threads/.json (count), git status (clean?), running procs (server.ts PID, LaunchAgent daemons).

2. Gate

All log files readable? Git repo accessible? No permissions failures. If gate fails, emit error code with specific path.

3. Audit - structured report

Parse logs for patterns:

  • Errors: RUN_FINISHED.error entries, backend spawn failures, TDZ crashes, unhandledRejection
  • Staleness: evals.ndjson last entry >1h old, threads >3d old, server.ts PID stale
  • Completeness: recent dispatch runs with toolCalls vs empty, artifact count vs recent saves
  • Drift: server.ts newer than server.mjs (AOT stale), git status "modified" flags (unsaved work)

4. Emit report + eval

Structure: {ok: boolean, errors: [], warnings: [], recommendations: [], timestamp}. Score = 1.0 if ok + no warnings, 0.5 if warnings, 0.0 if errors.

import { score } from "../../lib/eval";
score("snappy-verify", run_id, { score: report.ok ? 1.0 : 0.0, primary_issue: report.errors[0] || null });

Eval

Actor: the thing that produces the output (a dispatch model, a CLI, or the state/lib/snappy-verify.ts library if one exists). Auditor: the thing that judges (must be different - see CONSTITUTION invariant #3). Name both explicitly.

Score convention:

OutcomeScore
Pass on first try1.0
Failed first, auto-fix applied, re-check passed0.5
Still failing or unrecoverable0.0

If you cannot name a deterministic auditor, switch the frontmatter to eval: manual and log to state/log/pending-eval.ndjson - but fight to avoid manual. Manual is the escape hatch that leaks the thesis.

Gotchas

  • mtime check fragile: git status "modified" can appear transiently (file write still in flight). Use git diff --quiet for true test.
  • eval ndjson tail: tail -n50 won't work on NDJSON without line buffering; use grep -o ".*" | tail -50 or jq array slicing.
  • LaunchAgent daemons: launchctl list | grep snappy works, but doesn't distinguish enabled/disabled. Check ~/Library/LaunchAgents/ for plist existence.
  • Stale process cwd: pgrep -af server.ts may show old /tmp build paths even if new process exists at /Applications. Verify PIDs and start times, not paths.

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

snappy-verify - loader

Per-turn rules for snappy-verify. Full reference: state/skills/snappy-verify/SKILL.md.

Critical Rules

  1. Scope-only by default. No side effects. Preview findings; require explicit apply: true before any write. (CONSTITUTION invariant #3.)
  2. One eval row per run. score("snappy-verify", run_id, {score, primary_issue}). Score: 1.0 = ok+no warnings, 0.5 = warnings only, 0.0 = errors found. (CONSTITUTION invariant #4.)
  3. Actor ≠ Auditor. Agent reads state; log tailing / pgrep / git diff are the auditors. Do not self-grade.
  4. git diff --quiet for drift check. git status shows transient flags mid-write; git diff --quiet is the reliable dirty-worktree gate.
  5. Safe NDJSON tail. tail -n50 evals.ndjson can buffer incorrectly; use grep -o ".*" | tail -50 or jq -s '.[-50:]' instead.
  6. LaunchAgent daemons. launchctl list | grep snappy - also verify plist exists in ~/Library/LaunchAgents/ to distinguish enabled vs disabled.
  7. Stale process cwd. pgrep -af server.ts may show old /tmp paths from previous builds. Verify PID + start time, not path string alone.

Commands

OperationCommand
recent evals (safe)`grep -o ".*" ~/projects/snappy-os/state/log/evals.ndjson \tail -50`
dispatch log tailtail -30 ~/projects/snappy-os/state/log/dispatch-chat.ndjson
agents count`ls ~/projects/snappy-os/state/agents/*.json \wc -l`
threads count`ls ~/projects/snappy-os/state/log/threads/*.json 2>/dev/null \wc -l`
git drift check`git -C ~/projects/snappy-os diff --quiet && echo clean \\echo dirty`
server PIDpgrep -af "server.ts"
LaunchAgent daemons`launchctl list \grep snappy`
eval log filtergrep '"skill":"snappy-verify"' ~/projects/snappy-os/state/log/evals.ndjson

Report Structure

{
  ok: boolean;
  errors: string[];   // RUN_FINISHED.error, spawn failures, TDZ crashes, unhandledRejection
  warnings: string[]; // evals.ndjson last entry >1h, threads >3d old, stale server PID
  recommendations: string[];
  timestamp: string;
}

Self-Test

  • [ ] Scope-only by default (no writes without apply: true)?
  • [ ] One eval row per run, correct score (1.0/0.5/0.0)?
  • [ ] Use git diff --quiet, not git status, for dirty-tree check?
  • [ ] Use safe NDJSON tail (not raw tail -n)?
  • [ ] Report shape: {ok, errors[], warnings[], recommendations[], timestamp}?

<!-- 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)] snappy-verify: <what was missing or fixed> [FIXED|LOGGED] action_kind=<kind>" >> 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.

  • action_kind: shape-ok | skill-ran | loader-rewritten | pattern-elevated

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

#!/usr/bin/env npx tsx
/**
 * state/skills/snappy-verify/api.ts — sidecar stub for the snappy-verify skill.
 *
 * This file is created by the scaffolder so a fresh skill folder is
 * structurally valid. Replace the placeholder with the real implementation
 * the moment the skill needs executable logic, OR move the implementation
 * to `state/lib/snappy-verify.ts` (preferred — the lib path is what
 * `eval: shape` validates against).
 *
 * If this skill has no backing code (prose-only slash command), delete this
 * file and rely on `eval: auto-shape` in SKILL.md.
 */
export const SKILL_NAME = "snappy-verify" as const;

export function describe(): string {
  return "The verify skill — purpose TBD.";
}

if ((() => { try { return import.meta.url === `file://${process.argv[1]}`; } catch { return false; } })()) {
  console.log(JSON.stringify({ skill: SKILL_NAME, describe: describe() }, null, 2));
}

scripts- helper scripts it can run

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

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

rubric auto no rubric declared
recent no runs actor/auditor: unverifiable
deps log eval dispatch

no recent runs logged - the eval contract is declared but nothing has been graded yet