No producer step surfaced in SKILL.md or AGENTS.md — likely a coordination or read-only skill.
.md file to compare — side-by-side diff against os
os
description: "Triggers on prompt mention of 'os'."
at a glance— dimensions parsed from os.md
on-disk anatomy — the four parts a skill can have on disk (stack.md §1e) 2/4 present
Every row below is a file path that either exists in the repo or doesn't. Only Skill is required. The other three are optional — add them as the work demands. This is the physical shape; the harness panel below is the operational shape.
state/skills/os/SKILL.md
present
state/lib/os.ts
not present
state/bin/os/
not present
state/skills/os/AGENTS.md
present
rubric — the analytic "definition of good" (program.md §6.1) 4 criteria · 3 deterministic · 1 judge
Each row is a named criterion in the SKILL.md’s ## Rubric block. deterministic = a script or lint decides; judge = a model reads the run output and grades. An eval row may include criteria.<name> = { score: 0|0.5|1, rationale }; the scalar score is derived from the criterion mean. Single-scalar grading hides where failures are — this is what makes the regen loop’s signal actionable.
harness — the operating frame every snappy-os skill runs inside 3/5 present
Every skill ships with the same five-part frame. An actor produces, a different auditor grades (program.md §5), a loader footer heals loader gaps on every turn, a regen drain rewrites loaders asynchronously, and every run lands a row in the eval log. Cells marked not present carry a one-line teach — absence is load-bearing for os.
No auditor surfaced. Without a separate grader, the producer can rubber-stamp itself — flag in review (program.md §5).
state/log/evals.ndjson ## Critical Rules section in AGENTS.md. Hard-won invariants, if any, live inline in the prose below.
PID feedback — how this loader taught itself mock — real endpoint pending
Rows from state/log/agents-md-feedback.log filtered by os. Every agent run that hits an unhandled case appends one line — FIXED when the loader was edited inline (P-fix), LOGGED when the gap is too big for an inline edit and the state/regen/drain.sh queue will rewrite it asynchronously.
- Loading feedback rows…
pipeline— parsed stages
what this step does
SKILL.md— the prose file
os
snappy-os is an agent operating substrate. Every installation — on any machine, in any runtime — is guaranteed to have the files listed here. This page is the source of truth for "what comes with it." If something appears here but isn't on your disk, your install is broken; run snappy-os pull --force.
The kernel
Two binaries ship in the npm tarball. They are the only executables a fresh machine has before the first pull:
| Binary | Role |
|---|---|
bin/snappy.js | The seed surface every install gets. npx snappy-os and npx snappy both dispatch here. Verbs: init, scaffold, doctor, sync, help. |
bin/install.js | The bootstrapper called by npx snappy-os init. Creates the project tree, wires Claude Code + Codex hooks (idempotent), pulls canonical state. |
Authoritative manifest: package.json:files — 18 paths total (the two bins plus 4 lints, 4 lib files, 2 hooks, 3 regen files, the seed manifest, README, program.md). Anything outside that array is NOT in the tarball.
Robert's local tree also has bin/cli.js, bin/do-spaces.js, and bin/wire-hooks.js — those are dogfood for the seed maintainer (push/pull against his own DO Spaces, the older hook-wire path), not part of the user-facing tarball. If you're reading this on a fresh npx snappy-os init machine, those files do not exist.
Everything beyond the seed arrives on first snappy-os pull from s3://robert-storage/snappy-os/ via https://skills.snappy.ai/_pull.
What pulls in on first install
program.md — the schema
The three-layer contract (human-owned / substrate / agent-owned), the rules (no MCP, every skill declares an eval, actor ≠ auditor), the PID loop. The agent reads this first, every loop.
state/index.md — the catalog
A walking tour of what's in the substrate right now. Agent-maintained. Points at every skill, every library, every lint.
state/lib/ — the standard library (119 files)
The utilities skills and bins import. The load-bearing ones:
env.ts— credential loader; reads.env.cache.log.ts—newRunId(),append(name, row); every ndjson write goes through here.eval.ts—score(),pending(),friction(),fetchEvals(). The thesis metric is computed here.http.ts— uniform fetch with retry + error shaping.voice.ts—checkTone(),requireCitations(). The actor-as-auditor prevention for content.dispatch.ts— fires a subagent with a job file. How PID-loop rewrites happen.- Channel libs (
xano.ts,gemini.ts,openrouter.ts,browse.ts,desktop.ts,skool-fetcher.ts,whatsapp.ts,youtube.ts,image.ts,post.ts,sync.ts) — each wraps one external surface with a typed, auditable shape.
state/bin/ — graduated scripts (16 files)
Scripts that earned their way out of a skill page. These are not on PATH; they run via npx tsx state/bin/<name>.ts:
- Self-maintenance:
auto-regen.sh,pid-detect.ts,pid-drain.ts,pid-aggregate.ts,commit-report.ts,sync-runtimes.ts. - Installation / mirror:
publish-bootstrap.sh,sync.sh,invite-mint.ts. - Substrate eval infrastructure:
setup-eval-endpoint.ts,provision-eval-endpoint.ts,deploy-eval-endpoint.ts,test-independence.ts. - Spec implementation:
implement-spec.ts,implement-spec-audit.ts. - Observability:
run-commit-report-gemini.ts(cross-machine commit digest).
state/lint/ — health checks (21 files)
snappy-os doctor runs every one of these. The names are the contract:
aggregate-schema, audit, check, compare, do-spaces-reachable, eval-endpoint-contract, eval-endpoint-live, eval-row-mandatory, library-shape, manifest-drift, no-github-in-product, no-kernel-refs, runtime-parity, symlink-check, sync-freshness, sync-integrity, sync-rules-coverage, sync-schema-version, three-layer-respect, worker-bundle-size, worker-serves-canonical.
Green doctor = the substrate is self-consistent. Anything else is a defect.
state/skills/ — the cookbook (97 pages at time of writing)
Prose-first skill pages. Each has ## Eval and ## Steps. Skills graduate to a script state/bin/<name>/ only after repeated identical successful runs.
state/docs/ — long-form
Reasoning pages. Architectural notes. Failure-mode post-mortems. Agent-grown.
state/log/ — ndjson trail
evals.ndjson (per-machine, ephemeral), evals.aggregate.ndjson (anonymized, synced), dogfood.ndjson (synced), changelog.ndjson (synced), sync-manifest.json (per-machine), regen-queue/ (synced briefs).
Self-maintenance
Three mechanisms keep the substrate working without a human in the loop:
- Hooks.
bin/install.js(lines 224-413) wires Claude CodeStop: [auto-regen, sync-runtimes, push --auto]andSessionStart: [pull --auto]. Codex usesSessionStart: [pull --auto, codex-session-start-context], emptyUserPromptSubmit, and silentStop: [codex-stop-hook]so context loads once per session and output does not pollute the chat. Gemini CLI + OpenClaw use a 5-min cron wrapper where native session hooks are unavailable. - Cron self-test.
30 */6 * * * snappy-os doctor --silent || snappy-os alert "doctor-failed"is installed by the bootstrapper. Silent success, loud failure via Worker/_alert. - PID loop.
state/regen/enqueue.sh(PostToolUse hook on SKILL.md edits) appends slugs needing loader rewrites tostate/log/regen-pending.txt.state/lint/eval-row-mandatory.tsenqueues touched-but-not-evaled slugs tostate/log/eval-pending.txt. On Stop,state/hooks/snappy-os-auto-regen.shdrains both viastate/regen/drain.sh, dispatching a headless Claude subprocess to consume the briefs (no foreground intervention). The wired Stop hook lives atstate/hooks/snappy-os-auto-regen.sh— olderstate/bin/auto-regen.shandstate/bin/pid-drain.tsare bin-side helpers, not the wired path.
Expansion
The substrate expands itself by the same mechanism that maintains it — there is no separate "add a skill" path:
- A new skill begins as prose in
state/skills/<name>.md. First run logs an eval row. - If successive runs score consistently high, the skill graduates: a script lands in
state/bin/<name>/. - If runs trend down or hit a P0 friction,
pid-detectqueues a rewrite brief.auto-regendispatches a rewrite. The cycle repeats. - A rewritten skill that scores ≥0.85 across ≥5 runs on ≥3 tenants promotes from
s3://robert-storage/snappy-os-staging/<skill>/<rev_id>/to the public canonicals3://robert-storage/snappy-os/skills/<name>.mdvia the Worker's* * * * *scheduled handler. No manual review. - Every tenant's next
snappy-os pullpicks up the promoted skill.
This is how a substrate with one user becomes a substrate with many users whose evals collectively rewrite the substrate for everyone.
Steps
If the user asks "what does snappy-os come with," "what's the kernel," "what self-maintains," or "how does it evolve":
- Point them at this file:
state/skills/os.md. - If they want to verify locally, run
snappy-os doctor— 21/21 green is the contract. - If they want to see the loop running, run
npx tsx state/bin/pid-detect.ts --statsto see eval trends, andls state/log/regen-queue/done/to count completed rewrites.
Eval
eval: auto. Passing conditions:
snappy-os doctorreturns 21/21.npx tsx state/bin/pid-detect.ts --statsprints a trend table without error.ls state/log/regen-queue/done/is non-empty (the loop has produced at least one rewrite).- This file lists every lint, every graduated bin, and every top-level layer named in
program.md.
A run that violates any of these logs friction() and refuses to claim pass.
Rubric
criteria:
- name: kernel_binaries_present
kind: deterministic
check: "The binaries 'bin/snappy.js' and 'bin/install.js' exist in the `snappy-os` installation directory (the only two listed in `package.json:files`)."
- name: core_docs_present
kind: deterministic
check: "The files 'program.md' and 'state/index.md' exist within the installation."
- name: doctor_is_green
kind: deterministic
check: "Running `snappy-os doctor` returns a success exit code, indicating all health checks pass."
- name: self_maintenance_hooks_active
kind: judge
check: "The system has active hooks (e.g., git hooks, cron jobs) for self-maintenance actions like `pull --auto`, `auto-regen`, and `doctor` checks."AGENTS.md— the loader file
os — loader
Per-turn rules for the os skill. Full reference: state/skills/os/SKILL.md. Do not skip these.
Critical Rules
- Every load-bearing data flow has a heartbeat. The lint at
state/lint/loop-heartbeat.tsenumerates every promise-keeping ndjson, log, and txt-queue file with an expected freshness window. If it reports a P0 leak — a missing or dry artery — the system is operating blind. P0 leaks halt the regen drain until resolved. Runnpx tsx state/lint/loop-heartbeat.tsat the start of any diagnostic session. The background: controller-tuning.ndjson stopped writing on 2026-04-27 and the absence went undetected for 5 days because no lint checked freshness. This rule exists so that never happens again. The endpoint/loop-heartbeaton the head-screen server exposes the same check for the snappy-chat self-improvement card.
- Reference / manifest skill — DO NOT "RUN THIS" from drain.
osanswers "what does snappy-os come with / what self-maintains / how does it evolve" by pointing at SKILL.md. There is no verb to invoke. Ifstate/regen/drain.shqueues a "RUN THIS" brief foros, the consumer MUST writeback in the canonical drain-skip format (KIND 2 — noaction_kindfield):[<ISO-ts>] os: run-this skipped — kernel manifest skill, eval is snappy-os doctor + pid-detect, not safe to invoke from drain [SKIPPED]. Do NOT fabricate an eval row. Do NOT tagaction_kind=skill-ran(the skill did NOT run end-to-end). Source incidents: 2026-04-27, 2026-04-28 writebacks. - Eval contract is deterministic, not behavioral. A pass requires ALL of: (a)
snappy-os doctorexits 0 across the load-bearing lints, (b)npx tsx state/bin/pid-detect.ts --statsprints a trend table without error, (c)state/log/regen-queue/done/is non-empty (loop produced ≥1 rewrite), (d) the SKILL.md prose lists every load-bearing lint, every graduated bin, and every layer named inprogram.md. Any miss →friction()and refuse pass. - Tarball ≠ local repo. Only the 18 paths in
package.json:filesship via npm:bin/snappy.js,bin/install.js, 4 lints, 4 lib files, 2 hooks, 3 regen files, the seed manifest, README,program.md. Robert'sbin/cli.js,bin/do-spaces.js,bin/wire-hooks.jsare dogfood for the seed maintainer — do NOT promise them to a freshnpx snappy-os init. Everything else arrives on firstsnappy-os pullfroms3://robert-storage/snappy-os/viahttps://skills.snappy.ai/_pull. - Joe machines never hold DO credentials directly. The Worker is the only ingress. Pulls go through
skills.snappy.ai, never S3 directly. - Three self-maintenance mechanisms must all be live. (a) Hooks — Claude Code
Stop=[auto-regen, sync-runtimes, push --auto]+SessionStart=[pull --auto]; Codex parallel under~/.codex/hooks.json; Gemini CLI / OpenClaw fall back to a 5-min cron wrapper. (b) Cron self-test —30 */6 * * * snappy-os doctor --silent || snappy-os alert "doctor-failed". (c) PID loop —state/regen/enqueue.sh(PostToolUse on SKILL.md edits) →state/log/regen-pending.txt;state/lint/eval-row-mandatory.ts→state/log/eval-pending.txt;state/hooks/snappy-os-auto-regen.sh(Stop) drains both viastate/regen/drain.sh, dispatching headless Claude. The wired Stop hook isstate/hooks/snappy-os-auto-regen.sh—state/bin/auto-regen.shandstate/bin/pid-drain.ts(listed instate/index.md) are bin-side helpers, NOT the wired path. - Expansion is the same loop as maintenance. New skills enter as prose → run logs eval → high scores graduate to
state/bin/<name>/→ low scores or P0 friction triggerspid-detectrewrite brief →auto-regendispatches rewrite. Promotion to public canonical bucket happens automatically (≥0.85 / ≥5 runs / ≥3 tenants) via the Worker's* * * * *scheduled handler. There is no separate "add a skill" path.
Commands
| ui dashboard | state/skills/os/resources/ui.openui |
| step | command |
|---|---|
| invoke | reference skill — point user at state/skills/os/SKILL.md; do not run |
| verify install | snappy-os doctor (zero blocking failures = pass) |
| eval trends | npx tsx state/bin/pid-detect.ts --stats |
| completed regens | ls state/log/regen-queue/done/ |
| pending queues | wc -l state/log/regen-pending.txt state/log/eval-pending.txt state/log/frontmatter-pending.txt |
| inspect drain (no dispatch) | bash state/regen/drain.sh |
| eval log | grep '"skill":"os"' state/log/evals.ndjson |
| feedback writebacks | grep '^\[.*\] os:' state/log/loader-feedback.log |
| force re-pull canonical | snappy-os pull --force |
OpenUI Resource
- Skill-owned OpenUI Lang resource:
state/skills/os/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: brandedin SKILL.md only for deliberate platform or client visuals.
Known Pitfalls
- Load-bearing lints (post-2026-04-20 trim):
check.ts,commit-discipline.ts,do-spaces-reachable.ts,gateway-health.ts,runtime-parity.ts,sync-integrity.ts. Doctor exits 1 only when one of these fails; the 26 lints removed in the trim were substitutes for inline PID discipline or sync-meta nothing read. SeeKERNEL-DIFF.md. bin/wire-hooks.jsis the older path; the wired Stop hook isstate/hooks/snappy-os-auto-regen.sh. Don't re-document the older path as canonical.- Don't list every file by name in pitfalls. That's residue from the deleted fixer-self-write loop. Replace with one-line learnings; do not preserve the manifest.
Self-Test
An agent reading this should correctly:
- [ ] When
osshows up in regen-pending or a "RUN THIS" brief, SKIP execution and emit the canonical KIND-2[SKIPPED]writeback (NOaction_kindfield) — never invoke a verb, never tagaction_kind=skill-ran? - [ ] Verify install integrity via
snappy-os doctor+pid-detect --stats+ls state/log/regen-queue/done/, not by spot-checking individual files? - [ ] Distinguish the 2 tarball-shipped binaries (
bin/snappy.js,bin/install.js) from Robert's local maintainer-only bins (cli.js,do-spaces.js,wire-hooks.js)? - [ ] Identify the wired Stop hook as
state/hooks/snappy-os-auto-regen.sh(not the olderstate/bin/auto-regen.sh/pid-drain.tshelpers)? - [ ] Recognize that expansion = the same PID loop as maintenance (no separate "add a skill" path)?
<!-- 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)] os: <what was missing or fixed> [FIXED|LOGGED] action_kind=<kind>" >> state/log/loader-feedback.log
- The class token between
[ts]and:MUST be the literal folder slug
(os) — producer slug, writeback class, and grade class must be equal so state/lib/controller-tune.ts can pair the brief.
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(added 2026-04-27, task #327) is the SECOND pairing predicate.
Pick what you actually did:
shape-ok— frontmatter-shape verification only (rare from a human)skill-ran— skill ran end-to-end and an eval row landed
in state/log/evals.ndjson. NOTE: for os, the drain SKIPPED case (kernel-manifest skill, eval is doctor + pid-detect) is NOT skill-ran — emit the canonical [SKIPPED] writeback with no action_kind
loader-rewritten— you EDITED this AGENTS.md inline (FIXED case),
OR the regen drain rewrote it
pattern-elevated— promoted recurring failure to a Critical Rule- If you
LOGGED(couldn't fix inline), omitaction_kind— the inferrer
picks it up from your body keywords.
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— typed surface
⚠ no api.ts — this skill has no typed action surface
scripts— sidecar under state/bin/os/
prose-only skill — 1 inline code block live in SKILL.md above (no state/bin/ sidecar yet).
last run— most recent artifact at state/log/artifacts/os/
loading…
eval contract— rubric + last 10 runs + deps
| timestamp | verb | score | primary_issue | artifact |
|---|---|---|---|---|
| 2026-04-27 05:53Z | — | 1.00 | — | — |
| 2026-04-25 04:11Z | — | 1.00 | — | — |
| 2026-04-21 15:59Z | — | 1.00 | — | — |
| 2026-04-21 15:56Z | — | 1.00 | — | — |
| 2026-04-21 03:53Z | — | 1.00 | — | — |
| 2026-04-27 05:53Z | — | 1.00 | — | — |
| 2026-04-25 04:11Z | — | 1.00 | — | — |
| 2026-04-21 15:59Z | — | 1.00 | — | — |
| 2026-04-21 15:56Z | — | 1.00 | — | — |
| 2026-04-21 03:53Z | — | 1.00 | — | — |