Builds loading, empty, failed, offline, and filtered-empty states with delayed skeletons, toasts, banners, confirms, and Undo. Use when a screen loads data, shows a spinner, toast, retry, or delete prompt.
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.
Every data screen in an Expo app shows exactly one of loading, offline, failed, empty, filtered-empty or its content, decided once in its model hook; loading waits 300 ms and then shows a placeholder shaped like the content; a refresh never blanks the screen; and every message takes the lowest rung of one ladder (inline, notice, banner, dialog), with Undo instead of a confirmation for anything reversible. A zero-dependency checker and a screen states contract prove it.
listScreenStateOf turns
the facts (items or undefined, fetching, paused, the failure's key, a filter) into one
ListScreenState; the view switches over kind; never a loading/error flag pair, never query
data defaulted to [], and the union's kinds equal the contract's states (state-flags,
empty-default, state-kinds). Why: separate flags make "loading and failed" writable, and
?? [] shows "No tasks yet" during the first load and after a failed one.<id>.state.<state> (states-required, state-action, state-testid). Failure text
comes from the failure's kind, never error.message (error-handling-typed-results'
ui-error-message). Why: "No items" for a failed load tells people their data is gone, and a
state without a next step is a dead end.DelayedPlaceholder,
PLACEHOLDER_TIMING); no screen spinner (bare-spinner, loading-delayed); a Suspense
fallback is wrapped the same way, because React shows a fresh fallback at once. Why: below 300 ms
a load reads as instant, so a placeholder there is only a flash, and a reflow costs nothing to
avoid.isFetching never returns one; a background refetch shows at most a quiet line, the pull-to-refresh
spinner turns only for the person's own pull, and a list that may be out of date says so above
itself (refresh-blanks). Why: replacing a list loses the reader's place and reads as data loss,
and a spinner after every write that nobody pulled reads as a glitch.useBusyAction disables
the control, shows its busy state and ignores a second press; the work wraps its mutation in
attemptAsync and shows a failure inline or as a notice, never only in the error log; never a
modal spinner over the app (busy-overlay). Why: a blocking overlay over a 200 ms write is the
classic "the app froze", and a button that just re-enables after a failed save is a silent one.Alert.alert
(offline-notice, native-alert). Why: each rung up takes control away, and a notice can be
missed entirely.getRecommendedTimeoutMillis); a notice with an action stays with Dismiss while a screen reader
runs. Why: a queue shows old news late, and a timed Undo a screen-reader user cannot reach breaks
WCAG 2.2.1.runUndoable); a confirm() exists only for what cannot be undone and is declared
in the contract with whyNotUndo (confirm-undeclared). Why: people tap through questions, so a
question protects nobody while it slows everybody; Undo protects the slip.'confirmed' runs it. Title with the count
("Delete 3 done tasks?"), a verb on the button, Cancel first; confirm() resolves
'confirmed' | 'cancelled' | 'dismissed' and code returns on anything but 'confirmed'
(confirm-vague, confirm-outcome). Why: "Are you sure? OK" is read by nobody, and returning
only on 'cancelled' deletes when Android's back gesture answered 'dismissed'.useAnnounce() on
iOS, where VoiceOver reads no live region; a pure view's model hook may announce for it
(announce-ios). On iOS the notice and the confirmation render in an overlay window
(AboveModalScreens). Why: otherwise a VoiceOver user never learns the delete happened, and on
iOS a notice from a modal or form-sheet screen sits invisible behind it while a root Modal
cannot be presented at all.contracts/screen-states.json
lists each screen's view, test, states and flags; a feature folder that reads server state with
no screen there fails; its test renders every declared state (contract-missing,
screen-undeclared, contract-invalid, contract-file, state-tested). Why: a state nobody
renders in a test is the one that ships broken.node ${CLAUDE_SKILL_DIR}/scripts/check-ui-states.mjs . to see where the app stands.templates/src/ui/feedback/ (with tests), templates/src/hooks/use-reachability.ts (and
test) and the catalog keys of templates/src/i18n/catalogs/ into every locale
(i18n-strings-and-catalogs). src/services/connectivity/ comes from networking-and-server-state:
copy templates/src/services/connectivity/ only if the app lacks it, and have its query
managers wire TanStack's onlineManager to the port, or the offline state never appears.
ui-component-library excludes src/ui/feedback/ by default; a catalogue that sets its own
exclude keeps "feedback/**" in it (feedback-ladder.md section 10).FeedbackProvider around the root Stack, below MotionConfig and the
i18n provider, as examples/app-feedback.tsx shows (app-startup-and-bootstrap owns the order).
Screens read it with useFeedback() (use-feedback.ts). Notices and confirmations reach modal
screens on iOS through react-native-screens (installed with Expo Router; feedback-ladder.md
section 9).listScreenStateOf
(examples/use-tasks-model.ts), translate its copy in one pure function
(templates/src/features/tasks/tasks-state-copy.ts), and render one switch with a delayed
placeholder (templates/src/features/tasks/components/tasks-state-switch.tsx, examples/tasks-screen.tsx).
Pull to refresh reads a refresh-by-user flag (useBusyAction around refetch()), never
isRefreshing. Loading details: references/loading-and-busy.md.notify(), reversible changes through runUndoable, irreversible ones through confirm(),
in-flight actions through useBusyAction, and the offline banner reads useReachability.templates/contracts/screen-states.json and its schema, list every screen that
loads, lists or filters data and every confirmation with whyNotUndo.npx jest src/ui/feedback src/features --ci and npm run typecheck.node ${CLAUDE_SKILL_DIR}/scripts/check-ui-states.mjs .; fix each FAIL line (rule ids in
references/checker-rules.md) and rerun until RESULT: PASS.ListScreenState (or its own union) once in its model hook; no
loading/error flag pair; no query data defaulted to [].DelayedPlaceholder with a content-shaped placeholder; refreshes keep content;
RefreshControl spins only for the person's own pull.useBusyAction; no modal spinner; no Alert.alert.FeedbackProvider is mounted; offline shows in OfflineBanner, never in a notice; a
notice and a confirmation from a modal screen show on iOS (device check, or the report says it
is owed).runUndoable over a real restore; each confirm() names the
consequence, runs only on 'confirmed' and is declared with whyNotUndo.npx jest src/ui/feedback src/features --ci passes and npm run typecheck is clean.node ${CLAUDE_SKILL_DIR}/scripts/check-ui-states.mjs . prints RESULT: PASS. Before any
data screen exists it notes contracts/screen-states.json: none yet (...) and passes; an app
without React Native prints NOT APPLICABLE: react-native is not in package.json. It prints
no SKIP lines.const [isLoading, setIsLoading] = useState(true) next to const [error, setError] = ....
Impossible states become writable and render. Derive one union.const tasks = query.data ?? [] feeding the empty check. The first load and a failed load
say "No tasks yet". Keep undefined until the first success.if (isFetching) return <Spinner />. Every refresh wipes the list. Placeholders only when
nothing is loaded.ActivityIndicator shown at once. Flashes on fast loads and reflows the screen.
Delay it and shape it like the content.Alert.alert for a delete. A dialog to report a result blocks for
nothing; Alert ignores destructive styles on Android and cannot be tested.if (outcome === 'cancelled') return; deleteAll();. Android back answers 'dismissed' and
deletes everything. Return on anything but 'confirmed'.refreshing={state.isRefreshing} on a RefreshControl. Every focus refetch and every write's
invalidation spins the pull indicator nobody pulled. Track the person's pull on its own.Modal for the confirmation. On
iOS a modal or form-sheet screen covers the first and blocks the second; render both through
AboveModalScreens on iOS.| File | What it is | Read/run when |
|---|---|---|
| references/states-and-the-switch.md | The six states, the decision order, TanStack status/fetchStatus mapping, local reads, empty vs filtered-empty, failed vs offline, refresh, retry, row states, copy, the contract, testing states, verified facts | Workflow steps 1, 4 and 6 |
| references/loading-and-busy.md | Thresholds, the delayed flag, placeholders, no shimmer or screen spinner, busy controls, no modal spinner, pull to refresh on iOS and Android, accessibility, timing tests | Workflow step 4 |
| references/feedback-ladder.md | The ladder, the one notice, lifetimes and accessibility timeouts, reading on iOS and Android, the offline banner, confirmations, Undo over confirm, why not Alert, mounting the host, modal screens on iOS (the overlay window), ui-component-library parts and its catalogue, tests, device checks | Workflow steps 3 and 5 |
| references/checker-rules.md | Every rule id, its scope and fix, passing outputs, configuration, multi-package, known limits | Workflow step 8, on a FAIL |
templates/src/ui/feedback/ | screen-state.ts, feedback-timing.ts, delayed-flag.ts, use-delayed-visibility.ts, delayed-placeholder.tsx, skeleton-block.tsx, state-message.tsx, notice.ts, notice-timer.ts, notice-host.tsx, above-modal-screens.tsx (the iOS overlay window), confirm.ts, confirm-dialog.tsx, feedback-context.ts, feedback-provider.tsx, use-feedback.ts, feedback-copy.ts, undoable.ts, use-busy-action.ts, offline-banner.tsx, with their tests (*.android.test.tsx for TalkBack and Android) | Workflow step 2 |
templates/src/hooks/use-reachability.ts | The ConnectivityPort's reachability for the banner | Workflow step 2 |
templates/src/hooks/use-reachability.test.ts | Its test with the fake connectivity | Workflow step 2 |
templates/src/features/tasks/ | tasks-state-copy.ts (one pure copy step) and components/tasks-state-switch.tsx (the one switch), with tests: the Tasks example of a declared screen | Workflow step 4 |
templates/src/i18n/catalogs/ | en.json and ar.json: the feedback and Tasks state keys to merge into every locale | Workflow step 2 |
templates/contracts/ | screen-states.json (the Tasks screen and one declared confirmation) and its schema | Workflow step 6 |
templates/src/services/connectivity/ | The ConnectivityPort, adapter, hub and fake with tests, synced from networking-and-server-state (do not edit here) | Workflow step 2, only if the app lacks them |
examples/use-tasks-model.ts | A model hook: query to state (previous list kept across filters), copy, Undo delete, a confirmed clear with a busy button, pull to refresh by the person, retry | Workflow step 4 |
examples/tasks-screen.tsx | The view: banner, switch, list notice, a quiet updating line and pull to refresh | Workflow step 4 |
examples/app-feedback.tsx | Mounting FeedbackProvider around the root Stack | Workflow step 3 |
scripts/check-ui-states.mjs | The checker (21 rules; options --src-dir, --contract, --json) | Workflow steps 1 and 8 |
scripts/lib/ui-states-source.mjs | The ten source rules | When a source rule needs changing |
scripts/lib/ui-states-contract.mjs | The contract reader and the eleven contract rules | When a contract rule needs changing |
scripts/lib/source-scan.mjs | The shared source scanner, synced from the library (do not edit here) | Never by hand |
scripts/check-lib.mjs | Shared script helper, synced from the library (do not edit here) | Never by hand |
scripts/selftest.mjs | Proves the checker passes the templates and examples and catches every planted bug | After changing the checker, a template or an example |
assets/shared.json | Declares the synced files | When adding a shared file |
tests/ | The base app and one fixture per rule, plus pass (installed skills silent, also with the whole repo in scope; allowed patterns; announced by the model; query plumbing only; config; no contract yet; not React Native) and error cases | When adding a rule |
error-handling-typed-results - failure values, message tables per kind, the raw-error rule.networking-and-server-state - queries, the ConnectivityPort, failure kinds of the ApiClient.ui-component-library - Toast, DialogCard, Scrim, EmptyState, Button and the hold-to-confirm.accessibility-as-code - useAnnounce(), modal overlays, touch targets, the pressable audit.motion-and-animation - entrances of notices and any shimmer loop as a declared moment.async-safety - timers, listeners and promises in handlers.forms-and-input - inline field errors and keeping notices above the keyboard.persistence-and-migrations - the soft delete and purge behind Undo.i18n-strings-and-catalogs - every state, notice and dialog string in every locale.app-startup-and-bootstrap - the root order the feedback host joins; the splash before first data.screen-contracts - the screen's layout contract that names the same state testIDs.e2e-maestro - flows that assert the empty and offline states on devices.assets/shared.json (opens in a new tab)examples/app-feedback.tsx (opens in a new tab)examples/tasks-screen.tsx (opens in a new tab)examples/use-tasks-model.ts (opens in a new tab)references/checker-rules.md (opens in a new tab)references/feedback-ladder.md (opens in a new tab)references/loading-and-busy.md (opens in a new tab)references/states-and-the-switch.md (opens in a new tab)scripts/check-lib.mjs (opens in a new tab)scripts/check-ui-states.mjs (opens in a new tab)scripts/lib/source-scan.mjs (opens in a new tab)scripts/lib/ui-states-contract.mjs (opens in a new tab)scripts/lib/ui-states-source.mjs (opens in a new tab)scripts/selftest.mjs (opens in a new tab)templates/contracts/screen-states.json (opens in a new tab)templates/contracts/screen-states.schema.json (opens in a new tab)templates/src/features/tasks/components/tasks-state-switch.test.tsx (opens in a new tab)templates/src/features/tasks/components/tasks-state-switch.tsx (opens in a new tab)templates/src/features/tasks/tasks-state-copy.test.ts (opens in a new tab)templates/src/features/tasks/tasks-state-copy.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ui-states, loading, empty-state, error-state, offline, toast, undo
/react-native:ui-states-and-feedbackfrom 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