Enforces performance budgets for Expo apps on iOS and Android: cold start, hitch rate, draw calls, storage writes, bundle size, and memory. Use when adding animations, Skia, lists, packages, or startup work.
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.
Keeps an Expo app inside budgets that live in one checked-in file: cold start measured from process start, hitch rate and p95 frame time, draw calls per frame, canvases per screen, the per-change storage write, bundle size per platform and memory. The numbers come from Release builds on real iPhones and Android phones, from simulators and emulators (regressions only) and from Jest (fast guards); four zero-dependency checkers judge the code, the budgets, the device reports and the bundles.
quality-gates.json "perf", and tests and checkers read it from there.
The ten keys start at the values in assets/perf-budgets.json (cold start < 1,000 ms, hitch rate
≤ 10 ms/s, p95 frame ≤ 17 ms, storage write p95 < 5 ms, ≤ 1,000 draw calls, ≤ 8 canvases per screen,
≤ 6,000,000 bytes of JS per platform and ≤ ×1.1 growth, ≤ 150 MB). Tighten them after the first
device report; loosening needs that report, the reviewer's approval and the Gate-Change: trailer,
plus check-budgets --allow <key> above the starting value (the checker knows only the starting
values; loosening an already-tightened value is caught by the trailer and the review). Why: one
reviewed source, and a budget raised to pass a check is no budget (budget-missing,
budget-looser, budget-unknown).cold-start, frame-data vs --sim-baseline).modules/process-start (iOS sysctl, Android
the process start elapsed time) gives the start; markJsEntry() runs once inside the startup
function (never at module scope); useColdStartMark({ perf, perfLog, label, isReady }) marks the
first screen one frame after isReady turns true (real data, not a spinner). A prewarmed (iOS) or
background-started (Android push, broadcast, job) process, or one started over 10 s before the JS
entry, is flagged prewarmed and left out. Why: React Native's own marks start at bundle load and
missed about 90 % of a launch (iOS simulator, 66 launches: 539 ms median, 484 ms before JS), and a
stale process start adds hours (perf-layer, cold-start-runs).onFrameTime, a loop's runner) calls sampleFrame; the report
picks 120, 90 or 60 Hz from the shortest interval. Why: an extra display link keeps an idle screen
rendering and changes what it measures; a 90 Hz phone judged as 120 Hz shows a false hitch on every
frame (recorder-callback, hitch-rate, frame-p95).useFrameCallback. Why: a render per frame cannot fit an 8.3 ms frame at 120 Hz.
scheduleOnRN per frame is motion-and-animation's no-js-per-frame (react-state-per-frame).w × h × 4 bytes) are disposed on a theme change. Why: each Skia.Paint() per frame is
a native allocation. Frame-hook callbacks and the canvas folders are skia-canvas-rendering's
frame-alloc and draw-pure (skia-alloc-per-frame).useFrameCallback(cb, false)) and
setActive(false) runs when the animation ends, on background, on blur and under a full-screen
interruption (modal, ad, video). Why: an idle screen must render no frames (frame-callback-stop
sees the autostart argument and a stop call in the file, not every path; the rules reference says
what to review by hand).perf.drawCallsPerFrameMax). Why: counting canvas calls on the busiest frame is the headless
stand-in for GPU cost; skia-canvas-rendering's draw-budget requires the test itself
(draw-call-budget).perf.skiaCanvasesPerScreenMax canvases per screen file, never a canvas per list item
(.map(...), renderItem). Lists: FlatList by default, FlashList only after a measurement, a
ScrollView only for a short bounded list. Why: each canvas cost about 0.18 MB and 2.8 ms to mount
(iOS); one per tile made a 90-tile grid ten times slower (canvases-per-screen, canvas-per-item;
react-components-and-hooks owns scrollview-list).bundle-cap,
bundle-growth, intl-locale-data).eval, new Function and string timers defeat it (hermes-engine, runtime-codegen).node:sqlite, timed with
node:perf_hooks; a test build's benchmark writes it 300 times into a scratch database. Why: the
React Native Jest preset mocks performance.now at 1 ms, and only the device measures real I/O
(perf-clock-in-tests, storage-write-p95, storage-write-runs).debug-perf-wired). Production performance monitoring (Sentry
tracing, MetricKit) is a separate, consent-gated concern of crash-reporting-and-observability.perf.memoryFootprintMbMax: iOS phys_footprint,
Android TOTAL PSS. Why: the OS kills a backgrounded app that holds too much first.assets/perf-budgets.json into quality-gates.json "perf" (quality-gates
owns the file; its Gate-Change: trailer applies) and run check-budgets.mjs. Read
references/budgets-and-gates.md before changing a value; stop
and ask the reviewer before loosening one.src/core/perf/, src/services/perf/, src/services/perf-log/, src/hooks/use-cold-start-mark.ts,
test/perf/storage-write.perf.test.ts, modules/process-start/, contracts/perf.json), then wire
it as examples/wiring-the-measurement-layer.md shows:
perf: createExpoPerfAdapter() in the composition root (architecture-and-boundaries), the JS entry
mark in the root layout's startup decision (app-startup-and-bootstrap), useColdStartMark in the
first screen's model hook, and the perf log plus createPerfDebugActions in the test-only entry
(debug-menu-and-test-hooks). Pass isReady from the screen's data (query.isSuccess). The adapter
needs npx expo install expo-application (the native build number). Fill contracts/perf.json
with those files. The native module needs a native rebuild (EAS or npx expo prebuild --clean).
Replace the seed and write in src/data/perf/tasks-benchmark.ts (shared by the storage guard and
the device benchmark) with the app's heaviest per-change write.check-perf-code.mjs.
Feed a new frame runner to the recorder (sampleFrame) and stop it with its lifecycle.npx expo export --platform ios --no-bytecode, then --platform android) and run
check-bundle-size.mjs for each (it reads perf-baselines/bundle-<platform>.json under the repo
root; the first run adds --write-baseline); explain any growth to the reviewer.check-perf-report.mjs <log.json> . --sim-baseline-file perf-baselines/cold-start-sim-ios.json --memory <reading> (the first accepted run adds
--write-sim-baseline), after e2e-maestro's smoke flows (its runner hosts no perf step). references/measuring.md has every command
for iOS (simctl, footprint) and Android (adb -s, dumpsys meminfo, am start -W).reports/perf/, run check-perf-report.mjs <report.json> . on each and report the numbers as
examples/reading-a-perf-report.md does.
After the release, read the field metrics (measuring reference, "Field metrics") and tighten from
them as references/budgets-and-gates.md describes.FAIL line until each prints RESULT: PASS.quality-gates.json holds all ten perf budgets, none looser than its starting value without
an approved --allow.contracts/perf.json and wired: native module rebuilt, JS
entry mark, first-screen mark, perf log and Performance actions in the test-only entry.npx jest src/core/perf src/services/perf src/services/perf-log src/hooks test/perf test/sqlite/tasks-benchmark.test.ts --ci).check-bundle-size.mjs on both platforms against the committed
perf-baselines/bundle-<platform>.json.check-perf-report.mjs <log> . --sim-baseline-file perf-baselines/cold-start-sim-ios.json (and
cold-start-emu-android.json; the first accepted run adds --write-sim-baseline), and the
memory reading passes --memory <footprint.json | meminfo.txt> (memory-footprint).check-perf-report.mjs, and the numbers are in the report to the reviewer.node ${CLAUDE_SKILL_DIR}/scripts/check-budgets.mjs . prints RESULT: PASS.node ${CLAUDE_SKILL_DIR}/scripts/check-perf-code.mjs . prints RESULT: PASS. Expected
non-problem lines: SKIP src/test-only-entry.ts [debug-perf-wired] not yet created (debug-menu-and-test-hooks creates it) until that entry exists, and the perf-layer: ... note
while contracts/perf.json declares no layer (an app that measures nothing on devices yet).setProgress(x) inside useFrameCallback. A React render per frame; keep it in a shared value
and cross to JS once, when the animation ends.Skia.Paint() inside a worklet. Build paints and paths once and pass them in.<Canvas> per row or per icon. Use the Icon primitive, or draw the group on one canvas.useFrameCallback. It keeps idle screens rendering; sample from
the runner that already exists.totalMs then stops before the work the
budget is about; pass isReady from the data (query.isSuccess).performance.now() in a Jest perf test. It is a 1 ms mock there; import it from
node:perf_hooks.| File | What it is | Read/run when |
|---|---|---|
| references/budgets-and-gates.md | The ten budgets, where each is measured, quality-gates.json, how a budget changes, the measured reference points | Workflow step 1, and whenever a budget is in question |
| references/measuring.md | Recorder, perf log, cold start, prewarmed and background starts, storage benchmark, draw calls, bundle, memory, list measurement, simulator/emulator and device steps, field metrics (Organizer, MetricKit, Play vitals) | Workflow steps 2, 5 and 6 |
| references/performance-rules.md | Per-frame work, Skia cost, frame callbacks and textures, lists, bundle, Hermes and start-up, who owns which rule | Workflow step 3 |
| examples/reading-a-perf-report.md | A device report, the checker's output and how to read and report it | Workflow step 6 |
| examples/wiring-the-measurement-layer.md | The composition-root member, the JS entry mark, the first-screen mark and the test-only entry, as shapes | Workflow step 2 |
templates/src/core/perf/ | Frame histogram and report (120/90/60 Hz), perf entries and the ring buffer, write-time summary and benchmark, cold-start report, with tests | Workflow step 2 |
templates/src/services/perf/ | PerfPort, the Expo adapter (clocks, process start, build header, share sheet), fake, cold-start marks, frame recorder, the debug menu's Performance actions, with tests | Workflow step 2 |
templates/src/services/perf-log/ | PerfLogPort, the expo-sqlite/kv-store adapter (its own perf-log.db), fake (+ test) | Workflow step 2 |
templates/src/hooks/ | use-cold-start-mark.ts (+ test): the first-screen mark, waiting for isReady | Workflow step 2 |
templates/src/data/perf/ | tasks-benchmark.ts: the storage benchmark's opener and seed (largest realistic data, the per-change write, scratch file deleted on close), shared by the device benchmark and the Jest guard | Workflow step 2 |
templates/test/perf/ | storage-write.perf.test.ts: the Jest guard, per-change write p95 under the budget on node:sqlite | Workflow step 2 |
templates/test/sqlite/ | tasks-benchmark.test.ts: the opener on real SQLite (seed, write, delete on close) | Workflow step 2 |
templates/modules/process-start/ | Local Expo module: expo-module.config.json; iOS ProcessStartInfo.swift (start, prewarm, model) + module + podspec; Android ProcessStartInfo.kt (start, background start, model) + module + Gradle + manifest | Workflow step 2 |
templates/contracts/ | perf.json and perf.schema.json: the app's performance contract (layer files, canvas exemptions) | Workflow step 2 |
assets/perf-budgets.json | The perf block with its starting values | Workflow step 1 |
assets/shared.json | The shared files this skill copies in | When adding a shared file |
scripts/check-perf-code.mjs | Code rules: Skia and React state per frame, stoppable callbacks, the recorder, draw-call ceiling, canvases, codegen, Hermes, locale data, Jest clocks, the declared layer and its debug wiring | Workflow steps 3 and 7 |
scripts/check-budgets.mjs | quality-gates.json perf: present, positive, known, not looser | Workflow steps 1 and 7 |
scripts/check-perf-report.mjs | Judges a device report (this build's entries only), or a simulator/emulator log against --sim-baseline-file, plus --memory | Workflow steps 5 and 6 |
scripts/check-bundle-size.mjs | Checks one platform's export against the cap and its baseline (--platform, --write-baseline) | Workflow step 4 |
scripts/lib/budgets.mjs | The budget table, its starting values and the loader | When changing a budget rule |
scripts/lib/source-scan.mjs | Shared source scanner (synced, do not edit) | When changing a checker |
scripts/check-lib.mjs | Shared checker library (synced, do not edit) | Never by hand |
scripts/selftest.mjs | Proves every checker against its fixtures | After changing a script or fixture |
tests/bases/app/ | A small Tasks app the code checker's fixtures start from | When adding a rule |
tests/fixtures/ | Good, pass, bad and error cases per checker (overlay format) | When adding a rule |
skia-canvas-rendering - canvas surfaces, onFrameTime, per-frame allocation in canvas code, draw tests.motion-and-animation - per-frame JS crossings, loops that stop.react-components-and-hooks - re-render boundaries, list choice and keys.app-startup-and-bootstrap - the startup order this skill measures.architecture-and-boundaries - the composition root that creates the perf adapter.debug-menu-and-test-hooks - the test-only entry and the debug menu.app-variants-and-environment - proving test-only code leaves store bundles.dependency-management - adding packages (with the bundle delta from here).i18n-strings-and-catalogs - the polyfill module and its locale list.quality-gates - quality-gates.json and the Gate-Change: trailer.crash-reporting-and-observability - production performance monitoring (consent-gated tracing).ios-simulator-build, android-emulator-build - Release builds on named devices.e2e-maestro - the smoke flows that run before the cold-start and memory runs.assets/perf-budgets.json (opens in a new tab)assets/shared.json (opens in a new tab)examples/reading-a-perf-report.md (opens in a new tab)examples/wiring-the-measurement-layer.md (opens in a new tab)references/budgets-and-gates.md (opens in a new tab)references/measuring.md (opens in a new tab)references/performance-rules.md (opens in a new tab)scripts/check-budgets.mjs (opens in a new tab)scripts/check-bundle-size.mjs (opens in a new tab)scripts/check-lib.mjs (opens in a new tab)scripts/check-perf-code.mjs (opens in a new tab)scripts/check-perf-report.mjs (opens in a new tab)scripts/lib/budgets.mjs (opens in a new tab)scripts/lib/source-scan.mjs (opens in a new tab)scripts/selftest.mjs (opens in a new tab)templates/contracts/perf.json (opens in a new tab)templates/contracts/perf.schema.json (opens in a new tab)templates/modules/process-start/android/build.gradle (opens in a new tab)templates/modules/process-start/android/src/main/AndroidManifest.xml (opens in a new tab)templates/modules/process-start/android/src/main/java/expo/modules/processstart/ProcessStartInfo.kt (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/react-native:performance-budgetsfrom 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).Other plugins' skills for the same job