.md file to compare - side-by-side diff against snappy-migrate
snappy-migrate
description: "Triggers on prompt mention of 'snappy-migrate'."
What it does for you
Safely renames things across your setup without breaking what works.
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 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.
state/skills/snappy-migrate/SKILL.md
present
state/lib/snappy-migrate.ts
not present
state/bin/snappy-migrate/
not present
state/skills/snappy-migrate/AGENTS.md
present
how it's graded - what counts as a good run 4 criteria · 3 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.
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 - Sweep ACTIVE code first (.{ts,sh,js,jsx,mjs}), comments/docstrings second.
- Long-lived npx tsx daemons (head-screen server, autopilot, byline) do NOT
- Generators emit on first scaffold; existing copies are NOT rewritten by
- HTTP 200 with a tiny body (/skills-catalog: 24 bytes) = walker missed the
- HTTP 500 with ReferenceError: <var> is not defined = the migration renamed
- Every gap discovered that wasn't in this loader → P-fix it (see footer).
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
npx tsx state/lint/check.ts && npx tsx state/lint/skill-shape.ts
SKILL.md- the skill, written out in plain English
snappy-migrate
A "convention rename" - renaming a frontmatter field, switching a file-naming convention (e.g. <slug>.md → <slug>/SKILL.md), retiring a feature column - hits dozens of code paths across lints, libs, server endpoints, JSX UI, and generated sidecars. Doing it ad-hoc leaves silent breakage. This skill is the runbook AND the self-correcting loop: each run records what was missed last time so the next run is shorter. Pitfalls compress into the loader.
When to invoke
- Renaming a file-layout convention across
state/ - Retiring a frontmatter field (
graduation:,maturity:, etc.) - Changing a directory shape that lints + libs + server + UI all walk
- Anything where a single
find/replacewould miss a generator output
Steps
- Scope. State the rename in one sentence: "From X to Y." If you can't,
stop - split into smaller migrations.
- Sweep active code first. Grep across
*.{ts,sh,js,mjs,jsx}:
grep -rn 'old-pattern' state/ bin/ --include='*.ts' --include='*.sh' --include='*.js' --include='*.jsx' --include='*.mjs' Skip backfill scripts (backfill-*.ts) - they walk historical git paths and rewriting them breaks replay semantics.
- Fix block-comment hazards. A literal
*/inside a/* ... */block
comment closes the block. state/skills/*/SKILL.md inside JSDoc ends the comment at */SKILL. Reword to "per-slug SKILL.md" or use line comments. JSX is parsed by Babel-standalone in-browser - one bad block comment kills the page silently. Always parse-check JSX with @babel/core after edits.
- Inline-content sweep. If the convention is referenced inside generated
files (loaders, scaffolds, AGENTS.md), grep those too. Generators that create them once won't fix existing copies - you have to rewrite each. Example: loaders-sync.ts only emits NEW loaders; existing 135 AGENTS.md files keep stale path text inside their bodies.
- Sidecar regen. If a generator (loaders-sync, sync-runtimes, icons)
reads the old shape, update its source list. Re-run the generator. Diff to verify downstream artifacts are clean.
- Lint pass.
npx tsx state/lint/check.ts+npx tsx state/lint/skill-shape.ts
(or whichever shape lint matches the migration). Fix until green.
- Dogfood the frontend. Restart long-lived
npx tsxdaemons FIRST -
they don't hot-reload. Then curl every GET endpoint in state/bin/head-screen/server.ts. Look for HTTP 200 with suspiciously small bodies (/skills-catalog returning 24 bytes = empty array). Empty payload from an endpoint that should have data = stale walker.
- Commit.
SNAPPY_POD_DISPATCH_BYPASS=1for mechanical-reversible ops.
Single commit if the renames are coupled.
Eval
Actor: the playbook above (executed by an agent or sub-agent). Auditor: lint suite + dogfood probe. Independent from the actor.
Pass criteria:
npx tsx state/lint/check.tsexits 0npx tsx state/lint/skill-shape.tsexits 0- Every GET endpoint in head-screen/server.ts returns a non-empty payload
(or a documented empty case like /match-loaders requiring a query param)
| Outcome | Score |
|---|---|
| Lints + dogfood pass first try | 1.0 |
| Failed first, fixed via P-edit to AGENTS.md, re-check passed | 0.5 |
| Still failing | 0.0 |
Log to state/log/evals.ndjson with skill: "snappy-migrate".
Gotchas
The compressible distillation lives in AGENTS.md (Known Pitfalls). Each run that hits a new gap MUST P-edit that section before logging. SKILL.md holds the full runbook; AGENTS.md holds the tight rules.
Rubric
criteria:
- name: lint_check_green
kind: deterministic
check: "The command 'npx tsx state/lint/check.ts' must exit with a status code of 0."
- name: lint_skill_shape_green
kind: deterministic
check: "The command 'npx tsx state/lint/skill-shape.ts' must exit with a status code of 0."
- name: endpoints_dogfooded
kind: deterministic
check: "Every GET endpoint listed in 'state/bin/head-screen/server.ts' must return an HTTP 200 status code and a non-empty payload, unless explicitly documented for empty cases."
- name: agents_md_updated_on_failure
kind: judge
check: "If any lint or dogfood check failed on the first attempt, the 'Known Pitfalls' section in AGENTS.md must have been updated to reflect the new gap."AGENTS.md- what the AI loads when this skill comes up
snappy-migrate - loader
Per-turn rules for running a convention/shape migration. Full reference: state/skills/snappy-migrate/SKILL.md. Do not skip these.
Critical Rules
- Sweep ACTIVE code first (
*.{ts,sh,js,jsx,mjs}), comments/docstrings second.
Backfill scripts (backfill-*.ts) are historical replay - leave them alone.
- Long-lived
npx tsxdaemons (head-screen server, autopilot, byline) do NOT
hot-reload. Kill + relaunch after code changes or you'll dogfood stale bytes.
- Generators emit on first scaffold; existing copies are NOT rewritten by
re-running the generator. Inline-content sweep is a separate pass.
- HTTP 200 with a tiny body (
/skills-catalog: 24 bytes) = walker missed the
migration. Inspect the JSON, find the lib, fix the walker.
- HTTP 500 with
ReferenceError: <var> is not defined= the migration renamed
a local (e.g. files → loaderEntries in listSkills refactor) but left a stale reference in the response body. Same fix posture: re-derive from the new walker shape (listSkills(skillsDir).filter(...)) or remove the stat. Caught skill-authority on the SKILL/AGENTS folder migration.
- Every gap discovered that wasn't in this loader → P-fix it (see footer).
Commands
| ui dashboard | state/skills/snappy-migrate/resources/ui.openui | |grep refs: grep -rn 'old-pattern' state/ bin/ --include='*.ts' --include='*.sh' --include='*.js' --include='*.jsx' --include='*.mjs' |lint: npx tsx state/lint/check.ts && npx tsx state/lint/skill-shape.ts |restart head-screen: pkill -f 'tsx state/bin/head-screen/server.ts'; sleep 2; nohup bash state/bin/head-screen/launch.sh >/tmp/head.log 2>&1 & disown |parse-check JSX: NODE_PATH=/tmp/jsxcheck/node_modules node -e "require('@babel/core').parseSync(require('fs').readFileSync(F,'utf8'),{presets:['@babel/preset-react'],filename:F})" |dogfood probe: curl every GET in state/bin/head-screen/server.ts (grep pathname ===) |commit: SNAPPY_POD_DISPATCH_BYPASS=1 git commit -m '...' |eval log: state/log/evals.ndjson (skill: "snappy-migrate")
OpenUI Resource
- Skill-owned OpenUI Lang resource:
state/skills/snappy-migrate/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
*/inside block comments closes the comment.state/skills/*/SKILL.md
inside /* ... */ ends the JSDoc at */SKILL, breaking the file. Reword to "per-slug SKILL.md" or use // line comments. JSX is parsed by Babel-standalone in-browser - one bad block comment kills the page silently with no error in head-screen.log.
- AGENTS.md inline content sweep is separate from generator regen.
loaders-sync.ts only emits NEW loaders; existing AGENTS.md files keep stale state/skills/<slug>.md text in their bodies. Walk + rewrite each.
- head-screen daemon is sticky. Server holds old
listSkillsin memory.
Symptom: /skills-catalog, /skills, /never-do return tiny payloads despite full disk state. Cure: kill + relaunch via launch.sh.
- Babel parse hazard in JSX. Block comment containing
*/<anything>will
silently break the page. Always parse-check after edits to JSX.
- Single-touchpoint rule. Every walker over the skill catalog goes through
listSkills() from state/lib/skill-paths.ts. Direct readdirSync on state/skills/ is a code smell - it'll miss the next migration.
Self-Test
An agent reading this should correctly:
- [ ] Sweep active code first, comments second, skip backfill scripts?
- [ ] Reword
*/patterns inside block comments? - [ ] Restart head-screen / other tsx daemons after code changes?
- [ ] Probe every GET endpoint for empty-payload regressions?
- [ ] P-fix this loader before logging FIXED to feedback.log?
Self-report
If this loader fell short, append a line:
echo "[$(date -u +%FT%TZ)] snappy-migrate: <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
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-migrate: <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 - 1 inline code block live in SKILL.md above (no state/bin/ sidecar yet).
how we check it- the checks, plus the last 8 runs
| timestamp | verb | score | primary_issue | artifact |
|---|---|---|---|---|
| 2026-04-25 04:11Z | - | 1.00 | - | - |
| 2026-04-25 03:22Z | - | 0.50 | - | - |
| 2026-04-25 04:11Z | - | 1.00 | - | - |
| 2026-04-25 03:22Z | - | 0.50 | - | - |
| 2026-04-25 04:11Z | - | 1.00 | - | - |
| 2026-04-25 03:22Z | - | 0.50 | - | - |
| 2026-04-25 04:11Z | - | 1.00 | - | - |
| 2026-04-25 03:22Z | - | 0.50 | - | - |