.md file to compare - side-by-side diff against snappy-verify
snappy-verify
description: "Triggers on prompt mention of 'snappy-verify'."
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.
For developers how this skill is built, graded, and how it runs
at a glance- the short version
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.
state/skills/snappy-verify/SKILL.md
present
state/skills/snappy-verify/api.ts
present
state/bin/snappy-verify/
not present
state/skills/snappy-verify/AGENTS.md
present
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.
state/log/evals.ndjson 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.
- Loading feedback rows…
how the work flows- who makes it, who checks it
what this step does
what this step does
what this step does
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:
| Outcome | Score |
|---|---|
| Pass on first try | 1.0 |
| Failed first, auto-fix applied, re-check passed | 0.5 |
| Still failing or unrecoverable | 0.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 --quietfor true test. - eval ndjson tail:
tail -n50won't work on NDJSON without line buffering; usegrep -o ".*" | tail -50or jq array slicing. - LaunchAgent daemons:
launchctl list | grep snappyworks, but doesn't distinguish enabled/disabled. Check~/Library/LaunchAgents/for plist existence. - Stale process cwd:
pgrep -af server.tsmay 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
- Scope-only by default. No side effects. Preview findings; require explicit
apply: truebefore any write. (CONSTITUTION invariant #3.) - 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.) - Actor ≠ Auditor. Agent reads state; log tailing / pgrep / git diff are the auditors. Do not self-grade.
git diff --quietfor drift check.git statusshows transient flags mid-write;git diff --quietis the reliable dirty-worktree gate.- Safe NDJSON tail.
tail -n50 evals.ndjsoncan buffer incorrectly; usegrep -o ".*" | tail -50orjq -s '.[-50:]'instead. - LaunchAgent daemons.
launchctl list | grep snappy- also verify plist exists in~/Library/LaunchAgents/to distinguish enabled vs disabled. - Stale process cwd.
pgrep -af server.tsmay show old/tmppaths from previous builds. Verify PID + start time, not path string alone.
Commands
| Operation | Command | ||
|---|---|---|---|
| recent evals (safe) | `grep -o ".*" ~/projects/snappy-os/state/log/evals.ndjson \ | tail -50` | |
| dispatch log tail | tail -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 PID | pgrep -af "server.ts" | ||
| LaunchAgent daemons | `launchctl list \ | grep snappy` | |
| eval log filter | grep '"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, notgit 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
LOGGEDis 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
no recent runs logged - the eval contract is declared but nothing has been graded yet