Ensures deterministic, reproducible output across devices and time zones using a single seeded PRNG, civil-date keys, and versioned cutovers. Useful for shuffles, daily content, share codes, and replays.
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: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Some output must be a pure function of a key: the daily content every user compares, a generated
layout, a shuffle a share code reproduces, a replay. This skill makes that output identical on every
device, in every time zone and on next year's build, with no server: one seeded PRNG the app owns,
civil-date keys, content regenerated from (key, version) instead of stored, shipped generators frozen
behind versioned cutovers, and golden vectors computed by an independent oracle that two checkers and
the test suite verify.
DateKey, id or
sequence number as a parameter; nothing it reaches calls Date.now, new Date, performance.now
or imports the clock service. Why: a clock-reading generator cannot be pinned, replayed from a bug
report or run for tomorrow in a test.'YYYY-MM-DD', computed with integers, from one day definition. Keys
come from clock.today() at the edge and go through src/core/dates/date-key.ts; never an instant,
never the UTC day next to a local-day comparison. Why: an instant makes every read zone-dependent,
and two day definitions disagree for hours every day.src/core/rng/sfc32.ts, threaded as state. No Math.random, crypto,
expo-crypto, uuid or PRNG package on a seeded path; functions take a state and return
{ value, state }. Why: a library PRNG promises no frozen sequence across its versions, and only
exact integer operations (all sfc32 uses) give the same bits in V8 and in Hermes on iOS and Android.seedRng before any draw. seedRng(dailySeed(key, SALT)) or seedRng(hashSeed(text) ^ SALT); never dailySeed(...) % n. One salt per feature and
mode, unique and recorded. Why: FNV seeds of neighbouring days differ by a small multiple of the FNV
prime, so an unmixed seed walks the catalog in a visible step; shared salts make two features move
together.+ - * / %,
bitwise, Math.sqrt/imul/floor/round/abs/min/max/PI; no **, no other Math.*, no Intl,
toLocale* or localeCompare; floats frozen to integers before they are stored or fingerprinted.
Why: ECMA-262 leaves sin, exp, pow and ** implementation-approximated (Hermes uses each
platform's libm) and Hermes takes locale data from iOS and Android separately.localeCompare, never unordered SQL); the core modules never change. Why:
one extra or reordered draw rewrites every output after it.generatorVersion that ran and the user's outcome;
regenerate the content with generate(key, storedVersion). Why: a stored copy is a second source of
truth that the next version contradicts, and history becomes un-migratable."retired" entry).
Salt, catalog, count and draw-order changes are all versions. Why: once users saw a key's output,
that output is what the key means.<feature>.vectors.json of (key, version) → fingerprint + summary rows, asserted exactly by a Jest test, covering every version; for
date-keyed generators also both sides of each cutover, a year-end/new-year pair and a leap day. Why:
a fingerprint catches any change and a summary line shows a reviewer what changed.src/, directly or through a
helper, and carries its own copy of the data. Why: values generated by the implementation under
test enshrine its bugs.sfc32.ts, seeded-draws.ts,
fingerprint.ts, date-key.ts and daily-seed.ts keep the golden values their tests pin as
literals computed by the oracle. Why: a change there changes every seeded output on every installed
copy, and a golden computed by the module under test can never fail.(key, version) whatever ran before. Why: purity is what lets tests, oracles and checkers run
it headlessly, and hidden state makes the second call differ from the first.templates/src/core/: rng/sfc32.ts, rng/seeded-draws.ts,
rng/fingerprint.ts, dates/date-key.ts, dates/daily-seed.ts, dates/generator-versions.ts, each
with its test. Never edit them; read references/seeded-rng-and-seeds.md
and references/civil-date-keys.md for the API, the seeding and the
goldens. If an app already has a date-key.ts from dates-streaks-and-statistics, keep one copy.templates/src/features/__FEATURE__/__FEATURE__-generator.ts (replace
__FEATURE__ kebab, __FEATURE_PASCAL__, __FEATURE_CONST__): pick a new random salt, freeze the
catalog, document the draw order, export generate(key, version?) and summarize(output). Take
"today" from clock.today() in the caller (dates-streaks-and-statistics owns today). The template
salt 0x2f6b4c1d (795560989 in the contract), the item-01 … item-12 catalog in the generator and
the oracle, the generator test's /^item-\d{2}$/ id check and the vectors rows are template values:
replace them all before the first release (step 6 refills the rows). A generator keyed by text (a
share code) imitates examples/starter-pack-share-code/: "keyKind": "text", every version
from: null, and callers always pass the version the code carries.contracts/seeded-generators.json (template; keys in
references/checkers.md): module, exports, salt in decimal, versions,
vectors file, outcome file, regenerate command. An app with no generator keeps "generators": [].templates/scripts/oracles/__FEATURE__-oracle.ts: reimplement the
generator from its spec with BigInt or another language, no import from src/, its own copy of the
catalog and salt. Read references/golden-vectors.md.fingerprint and summary (keep key, version and
note) and set the contract's salt to the new salt in decimal. Add rows { "key", "version", "note" } (first key, a historical key, year end and new year, leap day), run
node scripts/oracles/update-<feature>-vectors.ts from the repo root, and read the diff. A
committed row is never refilled: check-golden-vectors.mjs fails it (rule vectors-frozen; the
template's seven rows are the one exception). Keep the vectors test and the oracle test from the
templates.(key, generatorVersion, outcome) as
examples/daily-focus-outcomes/ shows: the repository port and row mapping in
src/data/<feature>/, the replay in src/features/<feature>/. persistence-and-migrations owns the
table. When the table exists, point the contract's outcome.file at the file that declares the
stored row. Read references/versioning-and-regeneration.md.examples/daily-focus-cutover/: new version, future cutover, new oracle branch, new rows only.
check-golden-vectors.mjs fails a new cutover that starts today or earlier, and any edit of what
is committed (git HEAD): a moved or deleted cutover, a changed salt, a removed generator, a
changed or deleted vectors row. In CI pass the base branch: --committed-ref origin/main.npx jest src/core src/features/<feature> scripts/oracles --ci --selectProjects unit
and npm run typecheck.node ${CLAUDE_SKILL_DIR}/scripts/check-determinism.mjs . and
node ${CLAUDE_SKILL_DIR}/scripts/check-golden-vectors.mjs . (in a workspaces repo, once per app,
with the app folder as the root); fix every FAIL line (file, rule, fix) and rerun until both
print RESULT: PASS.Gate-Change: trailer (git-commits-and-reporting)
naming the generator, the version and why; a changed row is never committed.clock.today() is read once at the edge.template values still in use note no longer prints).null) and regenerate command.vectors-frozen; without git the checker prints a frozen checks: note instead).generatorVersion, never the generated content.npm run typecheck is clean.node ${CLAUDE_SKILL_DIR}/scripts/check-golden-vectors.mjs . prints RESULT: PASS (allowed
while the outcome table does not exist yet:
SKIP src/data/<feature>/<feature>-outcome-repository.ts [outcome-version] not yet created (persistence-and-migrations creates it);
an app without generators prints NOT APPLICABLE: contracts/seeded-generators.json declares no seeded generators).node ${CLAUDE_SKILL_DIR}/scripts/check-determinism.mjs . prints RESULT: PASSnew Date().toISOString().slice(0, 10) inside a generator. The UTC day, read from a clock: not
reproducible and wrong for hours every day. Take the key from clock.today() as an argument.CATALOG[dailySeed(key, SALT) % CATALOG.length]. Neighbouring days step through the catalog by a
fixed amount. drawOne(CATALOG, seedRng(dailySeed(key, SALT))).Math.random() for a harmless tie-break. One call and no two devices agree. Draw it from the
threaded state.localeCompare before drawing. iOS, Android and Jest order differently. Compare ids
with <.const GOLDEN = hashSeed(...) in a test.
The expected value then agrees with every bug. Compute it with the oracle.npm run vectors:update (or pnpm vectors:update, or a script that calls it) in verify, CI, an
EAS Workflow or a hook (simple-git-hooks, lint-staged, husky). The gate passes by
construction. Run it by hand and review the diff."retired" entry.src/utils/ that a generator imports and that reads Date.now() or calls Math.exp.
check-determinism.mjs follows the generator's imports into it and names the chain; a package from
node_modules (a library shuffle) is caught only by the runtime trap. Pass the value in, and use
integer tables instead of inexact maths.| File | What it is | Read/run when |
|---|---|---|
| references/determinism-policy.md | Seeded paths, allowed operations and the spec/Hermes evidence, clocks, randomness, locale, ordering, floats, iOS/Android/Jest table, who enforces what, pitfalls | Workflow step 1, and when a lint or scan rule fires |
| references/seeded-rng-and-seeds.md | sfc32 and its API, hash + salt + mix, the unmixed-seed trap in numbers, salts, threading, seeded draws, per-index hashing, the UI thread, the goldens and the Python oracle that computed them | Workflow steps 2 and 3 |
| references/civil-date-keys.md | DateKey, its integer arithmetic, one day definition, routing by key, the daily seed, pinned facts and their oracle, device behaviour | Workflow steps 2 and 3 |
| references/golden-vectors.md | The vectors file, canonical JSON v1, coverage, the independent oracle, the fill-only update script, replacing the template rows before the first release, CI verifies, reading a diff, labels over metrics, a Python generator oracle | Workflow steps 5 and 6 |
| references/versioning-and-regeneration.md | What to store and where (the outcome layout), replay by version, what counts as a change, the cutover procedure, choosing the date under store releases and OTA, text keys and share codes, retiring a generator | Workflow steps 7 and 8 |
| references/checkers.md | Both checkers' rules, the contract format, the committed baseline (--committed-ref in CI, renames, "retired"), layout options, multi-package use, expected SKIP/NOT APPLICABLE lines and notes, troubleshooting | Workflow steps 4 and 10 |
templates/src/core/rng/ | sfc32.ts, seeded-draws.ts, fingerprint.ts and their tests (synced, canonical) | Workflow step 2 |
templates/src/core/dates/ | date-key.ts, daily-seed.ts, generator-versions.ts and their tests (synced, canonical) | Workflow step 2 |
templates/src/features/__FEATURE__/ | The generator scaffold, its test, its vectors file and the vectors test | Workflow steps 3 and 6 |
templates/scripts/oracles/ | The BigInt oracle, its test (CI checks the committed rows) and the fill-only update script | Workflow steps 5 and 6 |
templates/contracts/seeded-generators.json | The generator register both checkers read | Workflow step 4 |
examples/daily-focus-cutover/ | The Tasks app's daily-focus generator after a version 2 cutover: generator, vectors, oracle, contract | Workflow step 8 |
examples/daily-focus-outcomes/ | Storing (key, generatorVersion, outcome): the repository port, the row schema and mapping (src/data/), and the replay that regenerates what the user saw (src/features/) | Workflow step 7 |
examples/starter-pack-share-code/ | A text-keyed generator (share codes v2:7KQ2): versions without cutover dates, explicit version on every call, a Python oracle with verify and --fill modes, its vectors | Workflow step 3, when the key is not a date |
| examples/reminder-jitter.ts | Stateless per-id randomness with hashU32 (reminder offsets) | When each item needs its own stable random value |
scripts/check-determinism.mjs | Runs the core against an independent implementation and the goldens; scans seeded paths and every local file they import | Workflow step 10, and at the end |
scripts/check-golden-vectors.mjs | Runs every registered generator against its vectors with ambient APIs and inexact maths trapped; checks the register, what is committed (generators, salts, cutovers, vectors rows), coverage, oracle, test, outcome, no auto-bless | Workflow step 10, and at the end |
scripts/lib/determinism-spec.mjs | The checkers' BigInt/Date.UTC implementation of the core, the golden table and the Math allow-list | When a golden, a core rule or the allow-list changes |
scripts/lib/module-graph.mjs | The checkers' import reader: what a file loads (static, import(), require(), type-only), every local file a set of files reaches, and the enclosing workspaces repo of an app folder | When a checker follows imports |
scripts/lib/app-modules.mjs | Shared helper (synced; do not edit here): imports the app's TypeScript for the runtime checks | Never by hand |
scripts/lib/source-scan.mjs | Shared helper (synced; do not edit here): the source scanner (masking, imports, worklet directive) | Never by hand |
scripts/check-lib.mjs | Shared script library (synced; do not edit here) | Never by hand |
scripts/selftest.mjs | Proves both checkers pass the templates and catch every planted bug | After changing a checker, template or example |
assets/shared.json | Declares the synced files (check-lib, helpers, the canonical core) | When adding a shared file |
assets/template-placeholders.json | The placeholder values the template verification uses | When adding a placeholder |
tests/bases/app/ | The minimal app the fixtures lay the templates on | When the fixture base changes |
tests/fixtures/ | Overlay suites: good/, one bad-* per rule, pass-* and error-* cases for both checkers | When adding a checker rule |
dates-streaks-and-statistics - reading today, local midnight, DST, streaks and statistics over date keys.architecture-and-boundaries - the ClockPort and where pure core code lives.persistence-and-migrations - the outcome table and retiring a generator version.golden-and-snapshot-tests - data snapshots and pixel goldens; run-goldens-rebaseline re-blesses those.unit-and-component-tests - the Jest projects, fast-check and the pinned TZ=UTC.typescript-and-lint-rules - the DETERMINISTIC and PURE lint blocks.value-objects-money-and-units - integers instead of floats for stored values.i18n-strings-and-catalogs - Intl formatting at the edge, never on a seeded path.git-commits-and-reporting - the Gate-Change: trailer for vectors and contract changes.ota-updates - runtime versions and rollouts that decide when a cutover is safe.game-rules-engine, level-generation-and-solvers, realtime-game-loop - seeded games built on this core.assets/shared.json (opens in a new tab)assets/template-placeholders.json (opens in a new tab)examples/daily-focus-cutover/daily-focus-generator.ts (opens in a new tab)examples/daily-focus-cutover/daily-focus-oracle.ts (opens in a new tab)examples/daily-focus-cutover/daily-focus.vectors.json (opens in a new tab)examples/daily-focus-cutover/seeded-generators.json (opens in a new tab)examples/daily-focus-outcomes/daily-focus-outcome-repository.ts (opens in a new tab)examples/daily-focus-outcomes/daily-focus-outcome-schema.ts (opens in a new tab)examples/daily-focus-outcomes/daily-focus-replay.ts (opens in a new tab)examples/reminder-jitter.ts (opens in a new tab)examples/starter-pack-share-code/starter-pack-generator.ts (opens in a new tab)examples/starter-pack-share-code/starter-pack-oracle.py (opens in a new tab)examples/starter-pack-share-code/starter-pack.vectors.json (opens in a new tab)references/checkers.md (opens in a new tab)references/civil-date-keys.md (opens in a new tab)references/determinism-policy.md (opens in a new tab)references/golden-vectors.md (opens in a new tab)references/seeded-rng-and-seeds.md (opens in a new tab)references/versioning-and-regeneration.md (opens in a new tab)scripts/check-determinism.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
73 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)./react-native:seeded-determinism-and-golden-vectorsfrom react-native
npx claudepluginhub zakariaf/reactnative-skills --plugin react-nativeOther plugins' skills for the same job