golden-lock
Skill0 starsChanged 46 days agoMITView on GitHub
Freezes any output (command stdout, file, prompt) as a byte-exact baseline under .golden/; "check" fails with a line diff on drift. Use when: "freeze this output", "golden test", "lock the baseline", "did the output change", "prompt regression".
In this repository34 other files it gives its agents.
- audit-codeSkill
- audit-docsSkill
- auditSkill
- bisect-driverSkill
- coding-conventionsSkill
- commit-gateSkill
- compact-ioSkill
- cron-task-manageSkill
- cve-auditSkill
- data-integrity-auditSkill
- decision-logSkill
- deck-builderSkill
- determinism-guardSkill
- etl-validateSkill
- experiment-logSkill
- fetch-firstSkill
- flaky-test-detectorSkill
- github-repo-polishSkill
- history-leak-scanSkill
- landing-checkSkill
- llm-eval-harnessSkill
- local-secrets-manageSkill
- long-taskSkill
- milestone-trackSkill
- opus-workersSkill
- path-quirk-auditSkill
- reorg-proposalSkill
- research-briefSkill
- seed-controlSkill
- shell-portabilitySkill
- skill-vetSkill
- small-taskSkill
- token-squeezeSkill
- venue-fitSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 59
Do NOT freeze node -e "<quoted code>" on this machine — PS 5.1 mangles quoted -e and leaves 0-byte junk files.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
golden-lock — freeze an output, diff on change
The engine is golden-lock.js (portable Node, zero deps). A golden baseline is
the exact output you declare correct today; check re-produces that output and
fails on any drift. It is a frozen-regression test (an output pinned byte-exact)
generalized to arbitrary outputs: pin a command's
stdout, a fixture file, or a reusable prompt/text asset, commit the baseline, and
every later run either MATCHes or hands you a line-numbered diff. Byte-exact by
default; comparison is deterministic and time-stable (timestamps live only in
meta.json, never in the baseline).
Commands
node golden-lock.js freeze <name> --cmd "<command>" [--normalize-eol] [--strip-ansi]
node golden-lock.js freeze <name> --file <path> [--normalize-eol] [--strip-ansi]
node golden-lock.js check <name> [--update]
node golden-lock.js list
node golden-lock.js --canary- freeze --cmd runs the command through the shell, captures stdout + exit code, and stores both. freeze --file freezes the file's bytes.
- check re-produces the output, re-applies the stored normalization flags,
and compares byte-exact AND on exit code. MATCH → exit 0; drift → exit 1 with
the first ~40 differing lines (
+N more differing linesafter that). - check --update accepts the current output as the new baseline (use after a change is reviewed and intended).
- list prints one line per baseline: name, mode, created date, hash prefix.
Examples
- Pin a frozen regression report (a backtest/report script whose output must
stay byte-exact):
node golden-lock.js freeze factor-report --cmd "python run_backtest.py --report"thencheck factor-reportin the test loop — any drift is a failing diff. - Lock a build's output (a Next.js/webpack frontend build):
node golden-lock.js freeze fe-build --cmd "npm run build" --strip-ansi(--strip-ansidrops the build tool's color codes; a build that prints timings will still drift on every run — freeze a stable artifact file instead when it does). - Prompt regression across a compression pass (a reusable prompt/text asset
that
token-squeezerewrites): freeze the asset before editing —node golden-lock.js freeze sys-prompt --file prompts/system.txt— run token-squeeze, thencheck sys-promptto see the exact diff the compression made.
Windows quoting
- PowerShell 5.1: wrap the whole
--cmdvalue in double quotes:node golden-lock.js freeze x --cmd "python run.py --flag". - Git Bash: single quotes work fine:
--cmd 'python run.py --flag'. - Do NOT freeze
node -e "<quoted code>"on this machine — PS 5.1 mangles quoted-eand leaves 0-byte junk files. Point--cmdat a real script instead.
Storage layout
.golden/<name>/output.txt # the baseline — EXACTLY the (normalized) output
.golden/<name>/meta.json # command/file, exitCode, sha256, createdAt, norm flags, mode.golden/ is meant to be committed — the committed baseline is what makes drift
reviewable in a diff. <name> must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/ and
contain no .. (blocks path traversal; nothing is written outside .golden/).
Exit codes
0 ok / match · 1 mismatch or canary failure · 2 usage error / missing baseline.
Verification (the done-check)
node golden-lock.js --canarySelf-tests both directions in a throwaway temp dir — an unchanged output MATCHes
AND a tampered one is caught (command stdout and file modes, plus name-traversal
rejection). MUST print CANARY PASS 28/28 before you trust a result.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

