Builds shared presentational components (buttons, dialogs, toasts, cards) from design tokens with required testIDs, accessibility, and tests. Use when adding or changing a shared UI component.
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.
Gives an Expo app one shared component library in src/ui/: forty presentational components
listed in a repo-owned catalogue (contracts/component-library.json), each sized from specs
generated from the token file, pressed through the one press surface, showing every state with a
cue beyond colour, named for VoiceOver and TalkBack, addressed by a required testID whose parts it
derives itself, and proven by its own test. Two zero-dependency scripts prove the catalogue, the
specs and the component rules, including the device lessons for iOS and Android.
src/ui component is an entry (component-missing, component-unlisted) and exports
function <Name> and type <Name>Props (component-export). Why: a checker can only hold what
it knows, and a flag (mayShadow, mayRotate ...) allows a look exactly where it is meant.components block is the source; write-component-specs.mjs writes component-specs.json and
components read COMPONENT_SPECS (specs-missing, specs-mismatch, measurement-literal); an
override carries its reason (spec-override-reason). Why: a retyped value drifts by one digit and
nobody notices until a screen looks wrong.PressableSurface; no Pressable, Touchable, core Button or gesture-handler button anywhere
else (press-outside-host; a provider-free crash fallback states why in a
// press-outside-host: <reason> comment), no hand-written pressed look (own-press-look), and
each press host runs the injected feedback, except a switch, whose handler plays its own
(press-feedback). Why:
every control then answers, sounds and announces the same way, and the look is one token.testID, derives its parts from it,
and puts it on the box the design measures (testid-required, part-not-derived,
testid-on-inner-text; the grammar is naming-conventions'). Why: screens never build part ids by
hand, and on iOS a testID inside an accessible element vanishes from the tree E2E tools read.decorative-not-hidden). Why: a screen reader then
reads one element ("Daily reminder, switch, on"), not a list of pieces. Touch targets and
hitSlop are accessibility-as-code's rules.ui-translates), no
stores or services (architecture-and-boundaries), strings arrive translated, numbers formatted,
isReducedMotion from the screen model (motion-and-animation's hooks, once adopted, read it
themselves), icons through an IconSlot. Why: a component stays
testable without the app and works in every language and icon set..check, or toHaveStyle for a width or an edge).
Why: about 1 in 12 men cannot tell the status colours apart, and an untested cue disappears in
the next restyle while a colour-only assertion stays green.shadow-outside-allowed, rotate-outside-allowed). Why: a shadow says "floats" or "press me";
on a card it promises an action that is not there.ReduceMotion.Never
(hold-reduce-motion). Why: under Reduce Motion Reanimated finishes a timing at once, and the hold
would confirm on touch.fixed-text-height,
pair-cell-flex). Why: a fixed height clips at 200 % text, and flex: 1 in a column cell
collapsed a row of keys to 0 pt on a device while every Jest test passed.accessibilityViewIsModal, and closes on Android back (modal-root, modal-back). Why: a modal
card hid the scrim's testID from the tree, and a dialog that ignores back traps Android users.drawn-underline), a hold fill sits in a
track pinned to the face edges (hold-fill-track), a scatter lays out left to right
(scatter-ltr). Why: no platform sets an underline's thickness, Yoga takes an absolute child's
percentage inside the padding, and start offsets mirror in right-to-left.renderWithProviders, asserting role, name,
state and parts, ending with the findInaccessiblePressables audit (component-untested). Why:
a missing role or a renamed part then fails a test, not a person or a flow.mockOnly
(mock-only-built). Why: a stand-in ships as a fake.node ${CLAUDE_SKILL_DIR}/scripts/check-components.mjs ..
NOT APPLICABLE means no library yet; catalogue-missing lists the app's existing src/ui
components and the file rules they break: that is the work list. Read
references/component-catalogue.md.test/render-with-providers.tsx from unit-and-component-tests;
test/a11y/find-inaccessible-pressables.ts from accessibility-as-code. prerequisite-missing
names any that is missing and who creates it.components block of assets/components-block.json into
design/tokens.json (the canonical demo token file may already carry the same block) and replace
the values with the design's
(references/measurements-and-specs.md); then run
node ${CLAUDE_SKILL_DIR}/scripts/write-component-specs.mjs ..templates/ to the same paths: contracts/component-library.json
(and its schema), src/ui/component-specs.ts, icon-slot.ts, variant-paint.ts,
use-hold-to-confirm.ts, and each component the app needs with its test (a component's own
imports name the others it needs). Remove catalogue entries the app does not adopt. Keep the
values; adapt only what the app's design changes, reading
references/actions-and-inputs.md or
references/lists-surfaces-and-overlays.md first.
When the design asks for platform-native controls instead, hand off to Expo's expo-ui skill.files, swap BusyIndicator for
examples/busy-indicator-with-moments.tsx and drop
Confetti for <CelebrationBurst> (building-a-component.md, "With motion-and-animation's moment
catalogue"); then its check-motion.mjs passes on src/ui/.contracts/contrast.json
(accessibility-as-code). Beyond the canonical palette pairs, the templates paint primary on
sunken (the progress and slider fills): add it under shapes, then run accessibility-as-code's
check-contrast.mjs.t(), formats numbers, reads
reduce motion and passes base ids; imitate examples/reminder-settings.tsx
and its test. testIDs and roles: references/testids-and-accessibility.md.PrimaryButton on a raw Pressable): move each caller to the library
component, then delete the old file and say so in the report (building-a-component.md,
"Replacing older primitives").npm run typecheck,
npx eslint . --max-warnings 0, npx jest --ci, then the two scripts below (use --only <Name>
while building a subset, never at the end). Every FAIL line names the file, the rule and the fix;
references/catalogue-contract-and-checks.md
explains each rule and every catalogue key.contracts/component-library.json lists every src/ui component with its parts and flags,
and nothing the app does not have.components block; overrides (if any) each give a reason.COMPONENT_SPECS or a token, and has a test that ends with the pressable audit.contracts/contrast.json and pass.npm run typecheck, npx eslint . --max-warnings 0 and npx jest --ci pass (iOS and Android
projects).node ${CLAUDE_SKILL_DIR}/scripts/write-component-specs.mjs . --check prints RESULT: PASSnode ${CLAUDE_SKILL_DIR}/scripts/check-components.mjs . prints RESULT: PASSTouchableOpacity or a ({ pressed }) => ({ opacity }) style. Compose the press
surface or use Button, ListRow, IconButton; change the look in PRESS, once.'tasks.add-button' + '.label') or an index key
(${testID}.${index}). Pass the base id; key repeated items by data.t() or a store inside src/ui. The screen model builds the strings and reads the stores.component-specs.json to make a layout fit. Fix the layout; change a measurement in the
token file, or add an override with the design's reason.accessible, role and label.flex: 1 on a tile in a grid cell. A zero vertical basis; use { flexGrow: 1 }.alignItems. Its own alignSelf wins; wrap it in a row with
justifyContent: 'center'.accessibilityViewIsModal on the dialog card, or a dialog drawn in the tree with no back
handling. Use the Scrim: Modal, the flag on the scrim, onRequestClose.textDecorationLine for a designed underline. Draw the bar.start: x and no direction: 'ltr'. It mirrors in Arabic or Hebrew.height on a face that holds text. Use minHeight.ReduceMotion.Never; offer the activate action.| File | What it is | Read/run when |
|---|---|---|
| references/component-catalogue.md | The forty components (file, role, parts, flags), support files, prerequisites, other owners, mock-only parts, games, when multi-package | Workflow step 1, every time |
| references/actions-and-inputs.md | The press model; buttons, hold, tiles, cards, checkbox, toggle, segmented control, slider, option card, progress bar: anatomy, states, accessibility | Changing or wiring a pressable or an input |
| references/lists-surfaces-and-overlays.md | Lists and rows, tiles, cards, callouts, badges, chips, app bar, scrim and dialogs, toasts, empty state, stats and charts, drawn marks, confetti | Changing or wiring a flat part or an overlay |
| references/building-a-component.md | File anatomy, specs and paint, the icon slot, composing the press surface, motion, the test, lint limits, the catalogue entry, replacing older primitives, the moment catalogue table | A new component; workflow steps 5, 8 and 9 |
| references/measurements-and-specs.md | The components block, references, the generator, reasoned overrides, browser-rendered borders, turning specs off | Workflow step 3; any measurement question |
| references/testids-and-accessibility.md | Required testIDs and derived parts per component, ids on measured boxes, what E2E tools see on iOS and Android, decorative parts, roles, the pressable checklist | Wiring screens, writing tests |
| references/layout-and-platform-lessons.md | The device traps behind the layout rules, on iOS and Android: pair cells, alignContent, alignSelf, absolute percentages, underlines, scatters, fixed heights, the modal root and back, directions, press looks | Before changing layout code |
| references/catalogue-contract-and-checks.md | Every catalogue key and flag, options and rn-skills.config.json keys, every rule with its fix, passing output, adopting in an existing app | Editing the catalogue; reading a FAIL line |
| references/defaults-and-open-questions.md | Defaults the templates choose and why, states to decide, what to verify on devices | Reporting; before changing a default |
templates/src/ui/ | The forty components, each with its test (scrim.android.test.tsx for Android back); component-specs.json and .ts; icon-slot.ts; variant-paint.ts and use-hold-to-confirm.ts with their tests | Workflow step 4 (copy) |
templates/contracts/ | component-library.json (the catalogue) and component-library.schema.json | Workflow step 4 (copy, then edit) |
| examples/reminder-settings.tsx | A feature's settings group built from ListGroup, ListRow, SubRow and Slider with base ids and props from the model | Workflow step 7 |
| examples/reminder-settings.test.tsx | Its test: switch, adjustable, hidden row, audit | Workflow step 7 |
| examples/busy-indicator-with-moments.tsx | BusyIndicator looping through motion-and-animation's useMotionLoop (same props; the template's test passes on it) | Workflow step 5, when the app has the moment catalogue |
assets/components-block.json | The demo component tier the templates were built from | Workflow step 3 (merge into the token file) |
assets/shared.json | Declares the synced files: check-lib, the source scanner, the canonical demo token file the fixtures use | When adding a shared file |
scripts/check-components.mjs | Checker: catalogue, prerequisites, specs, files, exports, testIDs and parts, tests, one press implementation, the component and device rules | Workflow steps 1 and 10, and at the end |
scripts/write-component-specs.mjs | Generator: component-specs.json from the token file (--check compares and names the first difference and why) | Workflow step 3, and at the end |
scripts/lib/component-source.mjs | Catalogue loading and validation, the spec derivation, StyleSheet and JSX scanners | When a rule needs changing |
scripts/lib/source-scan.mjs | Shared import scanner and resolver (synced, do not edit here) | Never by hand |
scripts/check-lib.mjs | Shared script helper (synced, do not edit here) | Never by hand |
scripts/selftest.mjs | Proves both scripts on the shipped templates and every planted bug | After changing a script, a template or a fixture |
tests/ | The base app (prerequisite stubs, the synced token file) and overlay cases: good, one bad case per rule, pass and error cases | When adding a rule |
design-system-structure - tokens, themes, AppText, PressableSurface and the press look these components build on.accessibility-as-code - touch targets, hitSlop, contrast pairs, reduce motion, overlays and screen-reader checks app-wide.naming-conventions - the testID grammar, file and export names.unit-and-component-tests - renderWithProviders, test forms and the Jest set-up.react-components-and-hooks - component and hook rules, effects, lists.architecture-and-boundaries - why src/ui imports no stores or services.icons-app-icon-and-splash - the icon set the icon slots draw from.forms-and-input - text fields and form controls, which join this catalogue.ui-states-and-feedback - when to show an empty state, a toast, a banner or a dialog.screen-contracts - screens composed from these components and their ids.design-visual-parity - proves a built screen matches its approved design.motion-and-animation - the app's moment catalogue and celebrations.audio-and-haptics-feedback - what the press feedback plays.rtl-and-direction - direction switching, mirroring and bidi.e2e-maestro - flows that select these testIDs on iOS and Android.game-session-host - game parts (level tiles, star ratings, a game's top bar) built to the same rules.expo-ui skill - platform-native SwiftUI and Jetpack Compose controls (@expo/ui).assets/components-block.json (opens in a new tab)assets/shared.json (opens in a new tab)examples/busy-indicator-with-moments.tsx (opens in a new tab)examples/reminder-settings.test.tsx (opens in a new tab)examples/reminder-settings.tsx (opens in a new tab)references/actions-and-inputs.md (opens in a new tab)references/building-a-component.md (opens in a new tab)references/catalogue-contract-and-checks.md (opens in a new tab)references/component-catalogue.md (opens in a new tab)references/defaults-and-open-questions.md (opens in a new tab)references/layout-and-platform-lessons.md (opens in a new tab)references/lists-surfaces-and-overlays.md (opens in a new tab)references/measurements-and-specs.md (opens in a new tab)references/testids-and-accessibility.md (opens in a new tab)scripts/check-components.mjs (opens in a new tab)scripts/check-lib.mjs (opens in a new tab)scripts/lib/component-source.mjs (opens in a new tab)scripts/lib/source-scan.mjs (opens in a new tab)scripts/selftest.mjs (opens in a new tab)scripts/write-component-specs.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ui-components, design-tokens, accessibility, testing, react-native
/react-native:ui-component-libraryfrom 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