Runs the golden rebaseline ritual for re-accepting many goldens at once after renderer, font, token, or Jest upgrades. Enforces assertions-green-first, one-file-per-update, and full diff inspection.
Ships in react-native. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The only sanctioned way to re-accept many goldens at once (after a renderer, font, token or Jest
upgrade, or an intended redesign): the real assertions are green first, a triage names the affected
set, each file is re-accepted alone, every changed golden is looked at and recorded, orphans go, and
the whole golden project passes twice without -u. rebaseline.mjs runs each step and writes the
evidence; check-rebaseline.mjs proves it. The developer approves twice.
--start --reason "<cause>", then the
whole golden project without -u (triage-first); every failure must be what that cause predicts.
Two unrelated causes are two rebaselines. Why: a golden that moved for another reason is a bug, and
the triage is the only plan.assertions-first). Why: a golden asserts nothing about
correctness; re-accepting over a red unit suite freezes the bug.--start recorded
(source-changed); node_modules equals package-lock.json (install-matches-lock). Why: a fix
made mid-way hides inside the re-accepted output, and a stale install writes goldens CI cannot
reproduce.-u run, path first, previewed, by hand. jest <file> --selectProjects golden --ci -u after --listTests lists only that file (update-one-file). Never -u in package.json
scripts, git or agent hooks, or CI; only this skill's runner, invoked by hand once per planned file,
runs it. Why: after --selectProjects a path is read as a project name and every golden is
rewritten (verified).update-unplanned).
Why: updating anything else is how unrelated drift slips in under the cause..snap* or PNG; only
orphans are deleted by hand (golden-changed-unlogged). A header-only rewrite after a Jest major is
the one exception the checker recognises. Why: a hand edit records output the code does not produce..snap diff line by line; open each
triage diff composite and each new PNG; one inspection.json entry per changed path with verdict
intended or orphan and a note of at least 15 characters (inspection-record). Anything less
than a clear yes means stop. Why: the look is the whole review; an unread golden freezes a bug.[contract] assertion stops the ritual:
stop and ask the reviewer; the runner refuses to update such a file and the checker compares every
contract entry with its recorded hash (contract-entry-changed). Why: installed versions and kept
files still expect the old output.contracts/goldens.json stay byte for byte
(tolerance-changed); a raise goes through the reviewer in its own commit (golden-and-snapshot-tests).
Why: a raised tolerance silently accepts every future regression below it.orphan-golden). Why: Jest never reports a
.snap.ios orphan, and jest-image-snapshot only deletes unused images through its opt-in
outdated-snapshot reporter, which deletes without a record and, on a one-file run, deletes other
tests' live baselines (verified); so JEST_IMAGE_SNAPSHOT_TRACK_OBSOLETE stays unset for the whole
ritual (--update refuses while it is set).proof-without-flag): --ci,
no -u, green, nothing written, no obsolete entry, every golden test ran, and no golden changed
after it (proof-goldens.json). Why: the first run proves the new goldens reproduce, the second
catches output that changes between runs.Gate-Change: trailer (rebaseline-message). Why: the agent that wrote the change should not be
the only reviewer of its goldens, and the history must say what moved and why.npm ci, JEST_IMAGE_SNAPSHOT_TRACK_OBSOLETE unset.node ${CLAUDE_SKILL_DIR}/scripts/rebaseline.mjs . --start --reason "<cause>" (add
--dry-run first to see the checks without writing). It refuses a stale install, uncommitted
goldens or an orphan snapshot holding [contract] entries (settle that with the reviewer first),
and lists orphans already present; fix and rerun.node ${CLAUDE_SKILL_DIR}/scripts/rebaseline.mjs . --assertions --max-workers 2.
Red means stop: fix the code, then --start --restart.node ${CLAUDE_SKILL_DIR}/scripts/rebaseline.mjs . --triage. Read every failure and
open every composite it lists under reports/rebaseline/triage-diffs/ (left baseline, red
differences, right new render). Decide each with the triage table in the ritual reference.node ${CLAUDE_SKILL_DIR}/scripts/rebaseline.mjs . --update <file>. It previews with --listTests, runs --ci -u on that file and lists what changed.git diff -- <snapshot> line by line; open each new PNG next to its
composite; fill each todo entry in reports/rebaseline/inspection.json
(examples/inspection.json). Not a clear yes: revert that path, stop, fix.git rm each snapshot whose test is gone and each PNG no test claims; record
them with verdict orphan.node ${CLAUDE_SKILL_DIR}/scripts/rebaseline.mjs . --proof (two runs; it records the
goldens it ran against, so any golden touched afterwards means another --proof).node ${CLAUDE_SKILL_DIR}/scripts/check-rebaseline.mjs .; fix every FAIL (file, rule,
fix) and rerun until RESULT: PASS. Rules, options and limits:
references/evidence-and-checker.md; the Jest behaviour behind
them: references/jest-facts.md.reports/rebaseline/commit-message.txt
(examples/rebaseline-commit.txt), run
node ${CLAUDE_SKILL_DIR}/scripts/check-rebaseline.mjs . --message reports/rebaseline/commit-message.txt,
then git commit -F reports/rebaseline/commit-message.txt; delete reports/rebaseline/.before.json and every re-accepted golden is explained by it.[contract] entry, pixel matcher or contracts/goldens.json changed; no tolerance moved.intended or orphan entry with a real note; orphans are deleted.Gate-Change:.node ${CLAUDE_SKILL_DIR}/scripts/check-rebaseline.mjs . --message reports/rebaseline/commit-message.txt prints RESULT: PASS (no SKIP lines are expected)npx jest -u to make a red suite green. It rewrites every differing golden, bugs included. Read
the failures, fix the code, re-accept only the planned files.npx jest --selectProjects golden <file> -u. The path becomes a project name and every golden is
rewritten. Put the path first; let --update preview it.npm test -- -u". That updates the whole project. Use
--update <file> on the file with the obsolete entry.--start --restart.failureThreshold because the upgrade is noisy. CanvasKit renders are deterministic;
a tolerance raise needs the reviewer and its own commit.jest --ci and only proves.reports/ is git-ignored; the record lives in the
commit message and the pull request.| File | What it is | Read/run when |
|---|---|---|
| references/rebaseline-ritual.md | When to rebaseline, preparation, every step and why, reading data and pixel diffs, triage table, the two stop-and-ask moments, the commit, Jest majors, renamed tests, Skia upgrades, screenshot baselines, iOS and Android, multi-package | Workflow steps 1, 2, 5 and 13 |
| references/jest-facts.md | Verified Jest 29.7 / jest-expo 57 / jest-image-snapshot 6.5.2 behaviour: path order, --ci -u, obsolete entries, orphans, image updates, the --json result, Jest majors, with re-verify commands | When a Jest fact matters or after a Jest upgrade |
| references/evidence-and-checker.md | The evidence folder, before.json and inspection.json formats, the runner's modes and refusals, the checker's rules, config keys, expected output, limits, troubleshooting | Workflow steps 3 to 11 |
| examples/inspection.json | A filled inspection record for one cause, a Skia upgrade (pixel goldens, an orphan) | Workflow step 8 |
| examples/approval-requests.md | What to show the developer before the first update and before the commit (the same Skia upgrade) | Workflow steps 6 and 12 |
| examples/rebaseline-commit.txt | Rebaseline commit messages (the same Skia upgrade, a Jest-major header rewrite) | Workflow step 13 |
scripts/rebaseline.mjs | Runs one step (--start, --assertions, --triage, --update <file>, --proof) and writes its evidence; refuses out-of-order or unsafe steps | Workflow steps 3 to 10 |
scripts/check-rebaseline.mjs | Proves the ritual from the evidence and the tree (13 rules), and with --message the commit message | Workflow steps 11 and 13, the definition of done |
scripts/lib/rebaseline-lib.mjs | Shared logic: layout and config, inventory and hashes, snapshot parsing, image claims, Jest results, lockfile comparison | When a script changes |
scripts/selftest.mjs | Proves both scripts against the fixtures (the bases are built with the real --start) | After changing a script or a fixture |
scripts/check-lib.mjs | Shared script library (synced; do not edit here) | Never by hand |
assets/shared.json | Declares the synced check-lib | When adding a shared file |
tests/bases/ | before/ (a small Tasks app with data and pixel goldens), after/ (the re-accepted state), evidence/ (Jest results and the record), runner/ (a fake Jest for the runner suite) | When the fixture base changes |
tests/fixtures/ | Overlay suites for both scripts: good/, one or more bad-* per rule, pass-* and error-* cases; a case's ENV.txt sets an environment variable for that case only | When adding a rule or a refusal |
golden-and-snapshot-tests - the golden policy, the one-file flow, contracts, tolerances and the history checker for the commit.unit-and-component-tests - the Jest projects and the assertions that must be green first.e2e-maestro - simulator and emulator screenshot baselines and their compare run.skia-canvas-rendering - the drawn surfaces whose pixel goldens move with a renderer upgrade.design-system-structure - token changes that move drawn surfaces.dependency-management - the dependency bump that is often the cause, and npm ci.expo-sdk-upgrade - SDK moves that bring Jest majors and renderer upgrades.seeded-determinism-and-golden-vectors - golden vectors, which are never re-accepted.git-commits-and-reporting - the commit format and the Gate-Change trailer.quality-gates - gated paths and the commit-msg hook that asks for the trailer.ci-pipeline-and-gates - CI runs jest --ci and only proves goldens.assets/shared.json (opens in a new tab)examples/approval-requests.md (opens in a new tab)examples/inspection.json (opens in a new tab)examples/rebaseline-commit.txt (opens in a new tab)references/evidence-and-checker.md (opens in a new tab)references/jest-facts.md (opens in a new tab)references/rebaseline-ritual.md (opens in a new tab)scripts/check-lib.mjs (opens in a new tab)scripts/check-rebaseline.mjs (opens in a new tab)scripts/lib/rebaseline-lib.mjs (opens in a new tab)scripts/rebaseline.mjs (opens in a new tab)scripts/selftest.mjs (opens in a new tab)tests/bases/after/removed.txt (opens in a new tab)tests/bases/after/src/features/tasks/tasks-digest.golden.test.ts.snap.ios (opens in a new tab)tests/bases/before/contracts/goldens.json (opens in a new tab)tests/bases/before/package-lock.json (opens in a new tab)tests/bases/before/package.json (opens in a new tab)tests/bases/before/src/core/rng/daily-pick.vectors.json (opens in a new tab)tests/bases/before/src/features/tasks/task-list.test.ts (opens in a new tab)tests/bases/before/src/features/tasks/task-list.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/react-native:run-goldens-rebaselinefrom react-native
npx claudepluginhub zakariaf/reactnative-skills --plugin react-native73 skills in this plugin
/accessibility-as-codeEnforces a11y labels, 44pt targets, 200% text, VoiceOver, TalkBack. Use when adding a pressable, swipe or a11y label, text clips when large, contrast fails or Reduce Motion is missed. Not for RTL (rtl-and-direction)./adaptive-layoutLays screens out by window, not device: breakpoints, master-detail panes, readable widths, grids. Use when making screens responsive or for tablets, iPad, foldables, rotation, split screen, orientation lock. Not for tab bars (navigation-and-routing)./admob-ads-and-consentBuilds AdMob ads behind a port - banners, interstitials, rewarded, UMP consent then ATT, pacing, ADS_MODE test IDs. Use when touching ads, consent, ATT, ad IDs or rewarded perks. Not for purchases (in-app-purchases)./analytics-and-consentGates analytics on opt-in consent: no SDK before a yes, typed events without personal data, ATT. Use when adding analytics, events, screen views or a usage-data toggle. Not for crashes (crash-reporting-and-observability)./android-emulator-buildAssembles Release APKs with Gradle on an AVD started by name (pinned JDK and SDK) and inspects them. Use when trying the app on the Android emulator, or Gradle, adb, an AVD or the SDK fails. Not for Play uploads (android-release-play)./android-release-playShips Android App Bundles to Google Play: upload key, Play App Signing, AAB gate, versionCode, tracks, rollout. Use when releasing or signing for Play, or an upload, rollout or version code fails. Not for eas.json (eas-build-and-submit).Other plugins' skills for the same job