[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F28DXECCF3MAAZS3XCMP7E":3,"skill-same:01M7F28DXECCF3MAAZS3XCMP7E":274},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7F28DXECCF3MAAZS3XCMP7E","error-handling-typed-results",null,"Builds a typed Result spine - failures converted at boundaries, exhaustive handling. Use when writing try\u002Fcatch, .catch or a Result, or fixing swallowed errors or unhandled rejections. Not for error UI (ui-states-and-feedback).","zakariaf\u002FReactNative-Skills","zakariaf","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2259803?v=4","01M7DEF0YMPS6Y6RQ4WGA0JH9R","Zakaria Fatahi","01M7F1VKYEK96M7SYJE1EPGD0A",13,"MIT","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: error-handling-typed-results\ndescription: Builds a typed Result spine - failures converted at boundaries, exhaustive handling. Use when writing try\u002Fcatch, .catch or a Result, or fixing swallowed errors or unhandled rejections. Not for error UI (ui-states-and-feedback).\n---\n\n# Error handling with typed results\n\nExpected failures travel as typed values (`Result\u003CT, F>` with a `kind` union) that every caller must\nhandle; only bugs throw, and those land in one global error net and a recording error boundary. No error\npath ever destroys the user's data. Two zero-dependency checkers prove what ESLint and `tsc` cannot see.\n\n## Rules that must hold\n\n1. **Expected failures are values; only bugs throw.** Anything that can happen in a correct program (not\n   found, offline, storage full, invalid input, cancelled, a corrupt row) returns `Result\u003CT, F>`; a broken\n   invariant throws `new Error(message, { cause })`. Why: the type system then forces every caller to handle\n   every expected case, and a thrown expected failure crashes a handler or is swallowed by a caller.\n2. **One Result type, from `src\u002Fcore\u002Fresult.ts`.** `{ ok: true, value } | { ok: false, error }` with `ok`,\n   `err`, `attempt`, `attemptAsync`; no second Result\u002FEither and no result library. Why: one vocabulary\n   from core to screen; two shapes need adapter code everywhere they meet.\n3. **A failure is a kebab-case `kind` with typed params, never text or an Error.** `err({ kind:\n   'task-title-taken', title })`; never `err('...')`, `err(new Error())`, `Result\u003CT, string | Error |\n   unknown>`, nor a `message` in a failure. Why: a string cannot be switched on exhaustively or translated,\n   and baked-in English breaks an Arabic UI.\n4. **Convert at the boundary, once.** Adapters, repositories, the ApiClient and parsers catch the vendor's\n   error and return the boundary's failure family; no `await` in an adapter escapes outside try\u002Fcatch or\n   `attemptAsync`. Why: above the boundary nobody knows SQLite or StoreKit error shapes, and an escaped\n   rejection is dropped silently in release builds.\n5. **Every catch maps, records with a fallback, or rethrows with `{ cause }`.** Console-only, comment-only\n   and `.catch(() => undefined)` handlers fail; a cosmetic effect may ignore its failure only inside its\n   adapter with a `\u002F\u002F best-effort: \u003Creason>` comment. Why: nobody reads the console on a user's phone, so\n   a swallowed error leaves no trace, and a rethrow without `cause` loses the original stack.\n6. **Record the unexpected, with the original error, before returning the failure.** The error log gets\n   the raw error; expected failures (user input, offline) are not recorded. Why: after the conversion only\n   `{ kind, params }` exists, and a log full of expected failures hides real defects.\n7. **Handle every failure exhaustively and never drop a Result.** Branch on `error.kind` with a `switch`\n   or a `Record\u003CF['kind'], ...>` table, never an `if\u002Felse` whose `else` absorbs future kinds; a call that\n   returns a Result is never a bare statement (`if (x) save(t);` included), a `forEach` callback's body or\n   an `on*` arrow body. Why: a new kind becomes a compile error everywhere it must be handled, and\n   `no-floating-promises` cannot see a dropped `Result`.\n8. **The UI shows a message chosen by kind, never `error.message`.** One table per failure family maps\n   each kind to a catalog key (params become ICU values) and every key exists in every locale. Why:\n   `error.message` is English, technical and can hold user data; a missing key renders a raw id.\n9. **One global error net, installed by the root layout's first app import and connected by the\n   composition root.** It forwards to the handler it replaced, enables Hermes rejection tracking in every\n   build (nothing in the net tests `__DEV__`), buffers until the composition root connects the error log\n   (before any provider renders), and calls its sink inside try\u002Fcatch. Why: React Native 0.86 tracks\n   unhandled rejections only in `__DEV__`,\n   a module that throws while loading runs before any install call in a module body, and a net nobody\n   connects keeps every report in memory until the process ends.\n10. **The root route exports an `ErrorBoundary` that records the error and offers one way out.** It never\n    retries or navigates away from an effect or a timer, and its fallback stays trivial and reads no\n    context that lacks a default. Why: render errors never reach the net (React Native reports them\n    straight to its ExceptionsManager) and Expo Router's boundary records nothing, so its `record` is the\n    only record; an automatic retry of a repeating render error is a crash loop; and the fallback renders\n    outside every provider, where an error it throws is a fatal crash nobody records.\n11. **No error path destroys data.** No delete, drop, clear, truncate or reset inside a catch, a `.catch`\n    handler or a failure branch; a bad record is quarantined and the rest loads; data newer than the app\n    is left untouched. Why: \"reset on error\" turns a recoverable failure into permanent loss.\n12. **A failed user write keeps the input and says so.** The model clears a form only after `ok`; a\n    failure becomes a message with a retry; user writes are never fire-and-forget. Why: a silent failed\n    save is data loss the user discovers days later.\n\n## Workflow\n\n1. **Choose the mechanism** for each failure with the table in\n   [references\u002Fresult-and-failures.md](references\u002Fresult-and-failures.md) (section 1): Result, `T | null`,\n   throw, boundary or net.\n2. **Add the Result module** when `src\u002Fcore\u002Fresult.ts` is missing: copy `templates\u002Fsrc\u002Fcore\u002Fresult.ts`\n   and its test (line 1 names the path). Other skills cite this file; extend it in place (a helper earns\n   its place at three call sites, with a test), never with a second Result module.\n3. **Design one failure family per boundary**, imitating\n   [examples\u002Ftasks\u002Ftask-failure.ts](examples\u002Ftasks\u002Ftask-failure.ts) (sections 4 and 5 of the result\n   reference: kinds, params, layering).\n4. **Convert at the boundary**: read [references\u002Fboundaries-and-catches.md](references\u002Fboundaries-and-catches.md),\n   imitate [examples\u002Ftasks\u002Fto-storage-failure.ts](examples\u002Ftasks\u002Fto-storage-failure.ts) (and its test on\n   real `node:sqlite` errors) and [examples\u002Ftasks\u002Ftask-repository.ts](examples\u002Ftasks\u002Ftask-repository.ts) (and its test);\n   wrap adapter calls with `attemptAsync`, and a call that can hang with async-safety's\n   `withTimeout((signal) => Promise\u003CResult>, afterMs, signal?)` (section 7); a cosmetic adapter follows\n   [examples\u002Fhaptics-adapter.ts](examples\u002Fhaptics-adapter.ts).\n5. **Handle and present**: switch or table on `kind`; add a message table like\n   [examples\u002Ftasks\u002Ftask-failure-message.ts](examples\u002Ftasks\u002Ftask-failure-message.ts), put its keys in every\n   catalog, and add the per-locale test from [references\u002Ftest-recipes.md](references\u002Ftest-recipes.md)\n   (section 2). Screens call a void intent of the model hook, never a Result function.\n6. **Protect the user's data**: follow [references\u002Fnever-lose-data.md](references\u002Fnever-lose-data.md);\n   the model keeps input until `ok`, as [examples\u002Ftasks\u002Fuse-add-task-model.ts](examples\u002Ftasks\u002Fuse-add-task-model.ts)\n   and its test show.\n7. **Install the global net** (once per app): copy `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002F` (`error-net.ts`,\n   `app-error-net.ts`, `install-error-net.ts`, each with its test); make\n   `import '@\u002Fservices\u002Ferror-net\u002Finstall-error-net';` the first app import of `src\u002Fapp\u002F_layout.tsx`\n   (or the line after the Intl polyfills in `index.ts`); connect the error log right after the composition\n   root creates the services, in the root layout's `useState` initializer, before any provider renders\n   ([examples\u002Froot-layout.tsx](examples\u002Froot-layout.tsx), [examples\u002Fconnect-error-log.ts](examples\u002Fconnect-error-log.ts)).\n   Read [references\u002Fglobal-error-net.md](references\u002Fglobal-error-net.md) (section 5 for connecting and\n   durability) before changing the net, and section 8 there when the app ships a crash reporter.\n8. **Add the root error boundary**: copy `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002F`\n   (`create-route-error-boundary.tsx`, `crash-screen.tsx`, `crash-fallback.tsx`, their tests). The\n   fallback reads no provider: the background from `useTheme()` (its context defaults to the light\n   theme) and copy from `createTranslateNow(onError)` in `src\u002Fi18n\u002Ftranslate-now.ts`\n   (i18n-strings-and-catalogs owns it; it keeps the language the app showed last), wrapped in\n   `TextLocaleProvider` with that same `languageNow()` language and `directionOf(language)`, so an RTL\n   crash text is laid out right to left (rtl-and-direction's `root-direction-provider`). Put `crash.title`,\n   `crash.body` and `crash.restart` in every catalog (`tsc` fails on a missing source key). Export\n   `ErrorBoundary` from the root layout with `record` reaching `appErrorNet.report` and\n   `restart: () => reloadAppAsync(...)`. The tests import unit-and-component-tests' router helper\n   (`test\u002Frender-router-with-providers.tsx`) and accessibility-as-code's audit\n   (`test\u002Fa11y\u002Ffind-inaccessible-pressables.ts`); when either is missing, set it up with that skill\n   first. They render the boundary and the fallback with no provider on purpose, under the documented\n   `\u002F\u002F no-providers: \u003Cwhy>` marker (section 5 of the test recipes).\n9. **Test**: the recipes in [references\u002Ftest-recipes.md](references\u002Ftest-recipes.md); then `npm run\n   typecheck`, `npx eslint . --max-warnings 0` and `npx jest --ci`.\n10. **Run the checkers** from the repo root; look up any rule in\n    [references\u002Fchecker-rules.md](references\u002Fchecker-rules.md); fix and rerun until both print\n    `RESULT: PASS`.\n11. **On a device** (once per release candidate, by hand): prove a rejection, a render error and a\n    handler error each reach the error log in a release build on a named simulator or emulator (recipe in\n    section 10 of the net reference).\n\n## Definition of done\n\n- [ ] `src\u002Fcore\u002Fresult.ts` comes from the template (any helper added there, with a test); no other Result\u002FEither type and no result library.\n- [ ] Every expected failure is a `kind` union with typed params; no `err('...')`, `err(new Error())`, `Result\u003CT, string | Error | unknown>` or `message` field.\n- [ ] Each boundary converts once, records unexpected failures with the original error, and no adapter `await` escapes.\n- [ ] Every catch maps, records with a fallback, or rethrows with `{ cause }`; `\u002F\u002F best-effort:` appears only in adapters.\n- [ ] Failures are handled with a `switch` or a `Record\u003CF['kind'], ...>`; no Result is dropped; handlers call void intents.\n- [ ] Every failure family a screen shows has a message table; its keys exist in every locale (per-locale test); no `error.message` in UI.\n- [ ] No destructive call on an error path; input survives a failed write (test); quarantine and newer-version outcomes are typed.\n- [ ] The net is the root layout's first app import; the composition root connects the error log before any provider renders; the root `ErrorBoundary` records and offers one way out.\n- [ ] `npm run typecheck`, `npx eslint . --max-warnings 0` and `npx jest --ci` pass.\n- [ ] `node ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcheck-error-net.mjs .` prints `RESULT: PASS`. Allowed only while the root layout is not yet created:\n  - `SKIP src\u002Fapp\u002F_layout.tsx [net-installed] not yet created (app-startup-and-bootstrap creates it)`\n  - `SKIP src\u002Fapp\u002F_layout.tsx [root-boundary] not yet created (app-startup-and-bootstrap creates it)`\n  - `SKIP src\u002Fapp\u002F_layout.tsx [net-connected] not yet created (app-startup-and-bootstrap creates it)`\n- [ ] `node ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcheck-error-spine.mjs .` prints `RESULT: PASS` (allowed: `SKIP src\u002Fi18n\u002Fcatalogs\u002Fen.json [failure-message-key] not yet created (i18n-strings-and-catalogs creates it)`).\n\n## Anti-patterns\n\n- **`catch (error) { console.warn(error); return []; }`** - nobody reads the console on a user's phone.\n  Map it, record it with a fallback, or rethrow with `{ cause }`.\n- **`catch { return null; }`** - a failure turns into \"not found\" and the error is gone. Return\n  `err({ kind })`, or bind the error and record it before the fallback.\n- **`err('Could not save')` or `{ kind, message }`** - untranslatable and impossible to switch on.\n  Carry the kind and params; the screen picks the message key.\n- **`\u003CAppText>{error.message}\u003C\u002FAppText>`** - shows English internals (and sometimes user data). Show the\n  failure's message key; send the error to the log.\n- **Wrapping a whole function in try\u002Fcatch** - turns typos into \"storage unavailable\". Wrap the vendor\n  call only, with `attempt`\u002F`attemptAsync`.\n- **`onPress={() => repository.add(draft)}`** - the Result vanishes into a void handler. Call\n  `model.add()`, which handles it.\n- **`titles.forEach((title) => repository.add({ id: title, title }))`** - every failed write vanishes.\n  Loop with `for...of` and branch on each Result.\n- **`if (failure.kind === 'a') ... else ...`** - a kind added later silently lands in the `else`. Use a\n  `switch` (lint demands every case) or a `Record\u003CF['kind'], ...>` table.\n- **`catch { deleteDatabaseSync(name); }` \"to start fresh\"** - permanent loss. Keep the file, show the\n  failure, open read-only.\n- **Resetting the form on submit** - a failed save erases the input. Clear after `ok`.\n- **`appErrorNet.install()` in the layout's body** - every import already ran. Use the side-effect\n  import first.\n- **`if (__DEV__)` anywhere in the net** (around the tracker, the install call or `previous(error,\n  isFatal)`) - release builds, the only ones nobody watches, lose rejections or stop crashing on fatal\n  errors. The net is the same in every build.\n- **`catch { return false; }` around `new URL(raw)` or a feature probe** - looks like a swallowed defect.\n  The throw is the answer: `attempt(() => new URL(raw), () => ({ kind: 'invalid-url' }) as const).ok`.\n- **A fallback that calls `retry()` in an effect, `setTimeout(onRestart, 3000)` or\n  `router.replace('\u002F')` after a delay** - a crash loop when the error repeats. One button, the user decides.\n- **A net nobody connects** - every report waits in its buffer until the process ends. Connect the error\n  log right after the composition root creates the services.\n- **A fallback that calls `useT()` or a store hook** - the providers sit inside the crashed layout, so\n  the fallback itself throws, and that crash is never recorded. Read no context that lacks a default\n  (`useTheme()` has one); take copy from `createTranslateNow` (`src\u002Fi18n\u002Ftranslate-now.ts`).\n- **`APP_THEMES` imported for a \"static\" crash background** - design-system-structure forbids palette\n  imports, and the theme context's default already is the light theme. Use `useTheme()`.\n- **`record: (error) => { console.warn(error); }`** - the boundary's `record` is the only record of a\n  render error; send it to `appErrorNet.report`.\n- **A second `ErrorUtils.setGlobalHandler`** - it replaces the net. Report through `appErrorNet`.\n\n## Files in this skill\n\n| File | What it is | Read\u002Frun when |\n|---|---|---|\n| [references\u002Fresult-and-failures.md](references\u002Fresult-and-failures.md) | Mechanism table, the Result type and why, attempt\u002FattemptAsync, failure design and layering, exhaustive handling, dropped Results, messages, pitfalls | Workflow steps 1-3 and 5 |\n| [references\u002Fboundaries-and-catches.md](references\u002Fboundaries-and-catches.md) | Where boundaries are, the conversion pattern, verified vendor error shapes (expo-sqlite per platform, node:sqlite, CodedError, fetch), recording, the three catch outcomes, best-effort, timeouts, adapters | Workflow step 4 |\n| [references\u002Fglobal-error-net.md](references\u002Fglobal-error-net.md) | What reaches the net (render errors do not), React Native 0.86 dev\u002Frelease behaviour on iOS and Android, the template net, install order, connecting the log, Expo Router's ErrorBoundary, crash loops, Sentry, web, device proof | Workflow steps 7, 8 and 11 |\n| [references\u002Fnever-lose-data.md](references\u002Fnever-lose-data.md) | The four data-loss paths, no destructive recovery, keeping input, quarantine, read-only newer data, visible failures, tests | Workflow step 6 |\n| [references\u002Ftest-recipes.md](references\u002Ftest-recipes.md) | Asserting Results, per-locale message test, mappers on real errors, net and boundary tests, input survival, test-first order | Workflow steps 5 and 9 |\n| [references\u002Fchecker-rules.md](references\u002Fchecker-rules.md) | Every rule of both checkers, limits, configuration keys (`sourceCatalog`, `resultModule`), multi-package runs, SKIP and NOT APPLICABLE lines | Workflow step 10, on any FAIL line |\n| `templates\u002Fsrc\u002Fcore\u002Fresult.ts` | The canonical Result module (synced from the library; do not edit here) | Workflow step 2 |\n| `templates\u002Fsrc\u002Fcore\u002Fresult.test.ts` | Its tests (synced from the library) | Workflow step 2 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Ferror-net.ts` | `createErrorNet` and `readGlobalErrorHooks`: chain, rejection tracking, buffer, guarded sink | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Ferror-net.test.ts` | Its tests with fake hooks | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Fapp-error-net.ts` | The app's one net instance | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Fapp-error-net.test.ts` | Its test against jest-expo's real ErrorUtils | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Finstall-error-net.ts` | The side-effect installer the root layout imports first | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Finstall-error-net.test.ts` | Its test: installs once, restores | Workflow step 7 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcreate-route-error-boundary.tsx` | Factory for a route's `ErrorBoundary`: records once, one way out | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcreate-route-error-boundary.test.tsx` | Unit tests without providers and `renderRouterWithProviders` tests through Expo Router (a throwing route, a throwing root layout) | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-screen.tsx` | The crash fallback view (translated strings and the theme background as props; React Native's `Button`, marked `\u002F\u002F press-outside-host:` for ui-component-library) | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-screen.test.tsx` | Its tests: copy, one way out by role and name, no press no call, the accessibility audit | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-fallback.tsx` | The app's root fallback: crash screen with `createTranslateNow` copy, its own `TextLocaleProvider` (language and direction from `languageNow()`) and the `useTheme()` background, no app provider needed | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-fallback.test.tsx` | Its test, rendered with no provider at all (the only proof it survives outside the layout), plus the writing direction per language | Workflow step 8 |\n| [examples\u002Ftasks\u002Ftask-failure.ts](examples\u002Ftasks\u002Ftask-failure.ts) | Shape: a failure family and its kinds as data | Workflow step 3 |\n| [examples\u002Ftasks\u002Fto-storage-failure.ts](examples\u002Ftasks\u002Fto-storage-failure.ts) | Shape: a total mapper from SQLite errors (both expo-sqlite device forms) | Workflow step 4 |\n| [examples\u002Ftasks\u002Fto-storage-failure.test.ts](examples\u002Ftasks\u002Fto-storage-failure.test.ts) | Shape: the mapper tested on real node:sqlite errors and the iOS and Android message forms | Workflow step 4 |\n| [examples\u002Ftasks\u002Ftask-repository.ts](examples\u002Ftasks\u002Ftask-repository.ts) | Shape: a boundary converting once and recording the unexpected (only `tasks.title` is the user's duplicate; a reused id is a recorded defect) | Workflow step 4 |\n| [examples\u002Ftasks\u002Ftask-repository.test.ts](examples\u002Ftasks\u002Ftask-repository.test.ts) | Shape: the repository on real SQL: a duplicate title is expected and unrecorded, an id clash is recorded | Workflow step 4 |\n| [examples\u002Fhaptics-adapter.ts](examples\u002Fhaptics-adapter.ts) | Shape: the one licensed best-effort swallow | Workflow step 4 |\n| [examples\u002Ftasks\u002Ftask-failure-message.ts](examples\u002Ftasks\u002Ftask-failure-message.ts) | Shape: kind to message key table with ICU values | Workflow step 5 |\n| [examples\u002Ftasks\u002Fuse-add-task-model.ts](examples\u002Ftasks\u002Fuse-add-task-model.ts) | Shape: a model hook that keeps input until `ok` | Workflow step 6 |\n| [examples\u002Ftasks\u002Fuse-add-task-model.test.ts](examples\u002Ftasks\u002Fuse-add-task-model.test.ts) | Shape: the input-survives test | Workflow step 6 |\n| [examples\u002Froot-layout.tsx](examples\u002Froot-layout.tsx) | Shape: the root layout's net import, the composition root connecting the log, the `ErrorBoundary` export | Workflow steps 7-8 |\n| [examples\u002Fconnect-error-log.ts](examples\u002Fconnect-error-log.ts) | Shape: connecting the error log to the net | Workflow step 7 |\n| `scripts\u002Fcheck-error-spine.mjs` | Checker: Result module, failure shape and text, catches, causes, adapters, dropped Results, UI messages, catalog keys, destructive recovery | Workflow step 10, definition of done |\n| `scripts\u002Fcheck-error-net.mjs` | Checker: one net that forwards, tracks rejections, guards its sink, is installed first and connected; a recording root boundary without auto-retry | Workflow step 10, definition of done |\n| `scripts\u002Flib\u002Ferror-scan.mjs` | Shared scans of both checkers (catch blocks, handlers, failure branches) | Never by hand |\n| `scripts\u002Flib\u002Fsource-scan.mjs` | Lexer and import resolution (synced from the library; do not edit here) | Never by hand |\n| `scripts\u002Fcheck-lib.mjs` | Shared checker library (synced from the library; do not edit here) | Never by hand |\n| `scripts\u002Fselftest.mjs` | Proves both checkers against the fixtures (`node scripts\u002Fselftest.mjs`) | After changing a checker |\n| `assets\u002Fshared.json` | The shared files this skill copies in | When adding a shared file |\n| `tests\u002Fbases\u002F` | The base app the fixtures assemble with the templates and examples; the canonical error-log port, memory adapter and `src\u002Fi18n\u002Ftranslate-now.ts` are synced in (do not edit those copies) | When a fixture needs a new base file |\n| `tests\u002Ffixtures\u002F` | Overlay cases: good, pass-*, one bad-* per rule, error-* | When adding a rule |\n\n## Related skills\n\n- `typescript-and-lint-rules` - the lint rules this builds on (`switch-exhaustiveness-check`, `only-throw-error`, `no-empty`, `kindValue`); it cites `src\u002Fcore\u002Fresult.ts`.\n- `architecture-and-boundaries` - ports and adapters, the composition root, the `ErrorLogPort` the net's sink writes to.\n- `async-safety` - floating promises, synchronous handlers, `.catch(reportError)`, cancellation.\n- `persistence-and-migrations` - the `SqlDriver`, transactions, quarantine in the save-document appendix, and newer-file handling (never touch a file the build cannot use); `run-migration` to ship a schema step.\n- `networking-and-server-state` - the ApiClient's HTTP failure family and retries.\n- `ui-states-and-feedback` - how a failure message is shown: inline, banner, dialog, retry, Undo.\n- `i18n-strings-and-catalogs` - the catalogs the failure-message keys live in, and `src\u002Fi18n\u002Ftranslate-now.ts` (`createTranslateNow`), the fallback's t() without a provider.\n- `design-system-structure` - `AppText`, `useTheme()` and the theme context's light default the crash screen's background comes from.\n- `app-startup-and-bootstrap` - the full startup order around the net import.\n- `crash-reporting-and-observability` - Sentry behind `CrashReporterPort`, fed from the net's sink.\n- `react-components-and-hooks` - component rules for the fallback and model hooks.\n- `forms-and-input` - drafts and field errors that keep input.\n- `debug-menu-and-test-hooks` - the test-only triggers for the device proof.\n- `unit-and-component-tests` - Jest projects, the render helpers (`renderRouterWithProviders`) and the `no-providers` marker the recipes use.\n- `accessibility-as-code` - `findInaccessiblePressables`, the audit the crash screen's test ends with.\n- `rtl-and-direction` - the crash fallback's own `TextLocaleProvider` (`languageNow()`, `directionOf`) and its `root-direction-provider` rule.\n- `ui-component-library` - why the crash screen's core `Button` carries the `press-outside-host` marker.\n- `data-export-and-restore` - backups and all-or-nothing restore.\n","# Error handling with typed results\n\nExpected failures travel as typed values (`Result\u003CT, F>` with a `kind` union) that every caller must\nhandle; only bugs throw, and those land in one global error net and a recording error boundary. No error\npath ever destroys the user's data. Two zero-dependency checkers prove what ESLint and `tsc` cannot see.\n\n## Rules that must hold\n\n1. **Expected failures are values; only bugs throw.** Anything that can happen in a correct program (not\n   found, offline, storage full, invalid input, cancelled, a corrupt row) returns `Result\u003CT, F>`; a broken\n   invariant throws `new Error(message, { cause })`. Why: the type system then forces every caller to handle\n   every expected case, and a thrown expected failure crashes a handler or is swallowed by a caller.\n2. **One Result type, from `src\u002Fcore\u002Fresult.ts`.** `{ ok: true, value } | { ok: false, error }` with `ok`,\n   `err`, `attempt`, `attemptAsync`; no second Result\u002FEither and no result library. Why: one vocabulary\n   from core to screen; two shapes need adapter code everywhere they meet.\n3. **A failure is a kebab-case `kind` with typed params, never text or an Error.** `err({ kind:\n   'task-title-taken', title })`; never `err('...')`, `err(new Error())`, `Result\u003CT, string | Error |\n   unknown>`, nor a `message` in a failure. Why: a string cannot be switched on exhaustively or translated,\n   and baked-in English breaks an Arabic UI.\n4. **Convert at the boundary, once.** Adapters, repositories, the ApiClient and parsers catch the vendor's\n   error and return the boundary's failure family; no `await` in an adapter escapes outside try\u002Fcatch or\n   `attemptAsync`. Why: above the boundary nobody knows SQLite or StoreKit error shapes, and an escaped\n   rejection is dropped silently in release builds.\n5. **Every catch maps, records with a fallback, or rethrows with `{ cause }`.** Console-only, comment-only\n   and `.catch(() => undefined)` handlers fail; a cosmetic effect may ignore its failure only inside its\n   adapter with a `\u002F\u002F best-effort: \u003Creason>` comment. Why: nobody reads the console on a user's phone, so\n   a swallowed error leaves no trace, and a rethrow without `cause` loses the original stack.\n6. **Record the unexpected, with the original error, before returning the failure.** The error log gets\n   the raw error; expected failures (user input, offline) are not recorded. Why: after the conversion only\n   `{ kind, params }` exists, and a log full of expected failures hides real defects.\n7. **Handle every failure exhaustively and never drop a Result.** Branch on `error.kind` with a `switch`\n   or a `Record\u003CF['kind'], ...>` table, never an `if\u002Felse` whose `else` absorbs future kinds; a call that\n   returns a Result is never a bare statement (`if (x) save(t);` included), a `forEach` callback's body or\n   an `on*` arrow body. Why: a new kind becomes a compile error everywhere it must be handled, and\n   `no-floating-promises` cannot see a dropped `Result`.\n8. **The UI shows a message chosen by kind, never `error.message`.** One table per failure family maps\n   each kind to a catalog key (params become ICU values) and every key exists in every locale. Why:\n   `error.message` is English, technical and can hold user data; a missing key renders a raw id.\n9. **One global error net, installed by the root layout's first app import and connected by the\n   composition root.** It forwards to the handler it replaced, enables Hermes rejection tracking in every\n   build (nothing in the net tests `__DEV__`), buffers until the composition root connects the error log\n   (before any provider renders), and calls its sink inside try\u002Fcatch. Why: React Native 0.86 tracks\n   unhandled rejections only in `__DEV__`,\n   a module that throws while loading runs before any install call in a module body, and a net nobody\n   connects keeps every report in memory until the process ends.\n10. **The root route exports an `ErrorBoundary` that records the error and offers one way out.** It never\n    retries or navigates away from an effect or a timer, and its fallback stays trivial and reads no\n    context that lacks a default. Why: render errors never reach the net (React Native reports them\n    straight to its ExceptionsManager) and Expo Router's boundary records nothing, so its `record` is the\n    only record; an automatic retry of a repeating render error is a crash loop; and the fallback renders\n    outside every provider, where an error it throws is a fatal crash nobody records.\n11. **No error path destroys data.** No delete, drop, clear, truncate or reset inside a catch, a `.catch`\n    handler or a failure branch; a bad record is quarantined and the rest loads; data newer than the app\n    is left untouched. Why: \"reset on error\" turns a recoverable failure into permanent loss.\n12. **A failed user write keeps the input and says so.** The model clears a form only after `ok`; a\n    failure becomes a message with a retry; user writes are never fire-and-forget. Why: a silent failed\n    save is data loss the user discovers days later.\n\n## Workflow\n\n1. **Choose the mechanism** for each failure with the table in\n   [references\u002Fresult-and-failures.md](references\u002Fresult-and-failures.md) (section 1): Result, `T | null`,\n   throw, boundary or net.\n2. **Add the Result module** when `src\u002Fcore\u002Fresult.ts` is missing: copy `templates\u002Fsrc\u002Fcore\u002Fresult.ts`\n   and its test (line 1 names the path). Other skills cite this file; extend it in place (a helper earns\n   its place at three call sites, with a test), never with a second Result module.\n3. **Design one failure family per boundary**, imitating\n   [examples\u002Ftasks\u002Ftask-failure.ts](examples\u002Ftasks\u002Ftask-failure.ts) (sections 4 and 5 of the result\n   reference: kinds, params, layering).\n4. **Convert at the boundary**: read [references\u002Fboundaries-and-catches.md](references\u002Fboundaries-and-catches.md),\n   imitate [examples\u002Ftasks\u002Fto-storage-failure.ts](examples\u002Ftasks\u002Fto-storage-failure.ts) (and its test on\n   real `node:sqlite` errors) and [examples\u002Ftasks\u002Ftask-repository.ts](examples\u002Ftasks\u002Ftask-repository.ts) (and its test);\n   wrap adapter calls with `attemptAsync`, and a call that can hang with async-safety's\n   `withTimeout((signal) => Promise\u003CResult>, afterMs, signal?)` (section 7); a cosmetic adapter follows\n   [examples\u002Fhaptics-adapter.ts](examples\u002Fhaptics-adapter.ts).\n5. **Handle and present**: switch or table on `kind`; add a message table like\n   [examples\u002Ftasks\u002Ftask-failure-message.ts](examples\u002Ftasks\u002Ftask-failure-message.ts), put its keys in every\n   catalog, and add the per-locale test from [references\u002Ftest-recipes.md](references\u002Ftest-recipes.md)\n   (section 2). Screens call a void intent of the model hook, never a Result function.\n6. **Protect the user's data**: follow [references\u002Fnever-lose-data.md](references\u002Fnever-lose-data.md);\n   the model keeps input until `ok`, as [examples\u002Ftasks\u002Fuse-add-task-model.ts](examples\u002Ftasks\u002Fuse-add-task-model.ts)\n   and its test show.\n7. **Install the global net** (once per app): copy `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002F` (`error-net.ts`,\n   `app-error-net.ts`, `install-error-net.ts`, each with its test); make\n   `import '@\u002Fservices\u002Ferror-net\u002Finstall-error-net';` the first app import of `src\u002Fapp\u002F_layout.tsx`\n   (or the line after the Intl polyfills in `index.ts`); connect the error log right after the composition\n   root creates the services, in the root layout's `useState` initializer, before any provider renders\n   ([examples\u002Froot-layout.tsx](examples\u002Froot-layout.tsx), [examples\u002Fconnect-error-log.ts](examples\u002Fconnect-error-log.ts)).\n   Read [references\u002Fglobal-error-net.md](references\u002Fglobal-error-net.md) (section 5 for connecting and\n   durability) before changing the net, and section 8 there when the app ships a crash reporter.\n8. **Add the root error boundary**: copy `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002F`\n   (`create-route-error-boundary.tsx`, `crash-screen.tsx`, `crash-fallback.tsx`, their tests). The\n   fallback reads no provider: the background from `useTheme()` (its context defaults to the light\n   theme) and copy from `createTranslateNow(onError)` in `src\u002Fi18n\u002Ftranslate-now.ts`\n   (i18n-strings-and-catalogs owns it; it keeps the language the app showed last), wrapped in\n   `TextLocaleProvider` with that same `languageNow()` language and `directionOf(language)`, so an RTL\n   crash text is laid out right to left (rtl-and-direction's `root-direction-provider`). Put `crash.title`,\n   `crash.body` and `crash.restart` in every catalog (`tsc` fails on a missing source key). Export\n   `ErrorBoundary` from the root layout with `record` reaching `appErrorNet.report` and\n   `restart: () => reloadAppAsync(...)`. The tests import unit-and-component-tests' router helper\n   (`test\u002Frender-router-with-providers.tsx`) and accessibility-as-code's audit\n   (`test\u002Fa11y\u002Ffind-inaccessible-pressables.ts`); when either is missing, set it up with that skill\n   first. They render the boundary and the fallback with no provider on purpose, under the documented\n   `\u002F\u002F no-providers: \u003Cwhy>` marker (section 5 of the test recipes).\n9. **Test**: the recipes in [references\u002Ftest-recipes.md](references\u002Ftest-recipes.md); then `npm run\n   typecheck`, `npx eslint . --max-warnings 0` and `npx jest --ci`.\n10. **Run the checkers** from the repo root; look up any rule in\n    [references\u002Fchecker-rules.md](references\u002Fchecker-rules.md); fix and rerun until both print\n    `RESULT: PASS`.\n11. **On a device** (once per release candidate, by hand): prove a rejection, a render error and a\n    handler error each reach the error log in a release build on a named simulator or emulator (recipe in\n    section 10 of the net reference).\n\n## Definition of done\n\n- [ ] `src\u002Fcore\u002Fresult.ts` comes from the template (any helper added there, with a test); no other Result\u002FEither type and no result library.\n- [ ] Every expected failure is a `kind` union with typed params; no `err('...')`, `err(new Error())`, `Result\u003CT, string | Error | unknown>` or `message` field.\n- [ ] Each boundary converts once, records unexpected failures with the original error, and no adapter `await` escapes.\n- [ ] Every catch maps, records with a fallback, or rethrows with `{ cause }`; `\u002F\u002F best-effort:` appears only in adapters.\n- [ ] Failures are handled with a `switch` or a `Record\u003CF['kind'], ...>`; no Result is dropped; handlers call void intents.\n- [ ] Every failure family a screen shows has a message table; its keys exist in every locale (per-locale test); no `error.message` in UI.\n- [ ] No destructive call on an error path; input survives a failed write (test); quarantine and newer-version outcomes are typed.\n- [ ] The net is the root layout's first app import; the composition root connects the error log before any provider renders; the root `ErrorBoundary` records and offers one way out.\n- [ ] `npm run typecheck`, `npx eslint . --max-warnings 0` and `npx jest --ci` pass.\n- [ ] `node ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcheck-error-net.mjs .` prints `RESULT: PASS`. Allowed only while the root layout is not yet created:\n  - `SKIP src\u002Fapp\u002F_layout.tsx [net-installed] not yet created (app-startup-and-bootstrap creates it)`\n  - `SKIP src\u002Fapp\u002F_layout.tsx [root-boundary] not yet created (app-startup-and-bootstrap creates it)`\n  - `SKIP src\u002Fapp\u002F_layout.tsx [net-connected] not yet created (app-startup-and-bootstrap creates it)`\n- [ ] `node ${CLAUDE_SKILL_DIR}\u002Fscripts\u002Fcheck-error-spine.mjs .` prints `RESULT: PASS` (allowed: `SKIP src\u002Fi18n\u002Fcatalogs\u002Fen.json [failure-message-key] not yet created (i18n-strings-and-catalogs creates it)`).\n\n## Anti-patterns\n\n- **`catch (error) { console.warn(error); return []; }`** - nobody reads the console on a user's phone.\n  Map it, record it with a fallback, or rethrow with `{ cause }`.\n- **`catch { return null; }`** - a failure turns into \"not found\" and the error is gone. Return\n  `err({ kind })`, or bind the error and record it before the fallback.\n- **`err('Could not save')` or `{ kind, message }`** - untranslatable and impossible to switch on.\n  Carry the kind and params; the screen picks the message key.\n- **`\u003CAppText>{error.message}\u003C\u002FAppText>`** - shows English internals (and sometimes user data). Show the\n  failure's message key; send the error to the log.\n- **Wrapping a whole function in try\u002Fcatch** - turns typos into \"storage unavailable\". Wrap the vendor\n  call only, with `attempt`\u002F`attemptAsync`.\n- **`onPress={() => repository.add(draft)}`** - the Result vanishes into a void handler. Call\n  `model.add()`, which handles it.\n- **`titles.forEach((title) => repository.add({ id: title, title }))`** - every failed write vanishes.\n  Loop with `for...of` and branch on each Result.\n- **`if (failure.kind === 'a') ... else ...`** - a kind added later silently lands in the `else`. Use a\n  `switch` (lint demands every case) or a `Record\u003CF['kind'], ...>` table.\n- **`catch { deleteDatabaseSync(name); }` \"to start fresh\"** - permanent loss. Keep the file, show the\n  failure, open read-only.\n- **Resetting the form on submit** - a failed save erases the input. Clear after `ok`.\n- **`appErrorNet.install()` in the layout's body** - every import already ran. Use the side-effect\n  import first.\n- **`if (__DEV__)` anywhere in the net** (around the tracker, the install call or `previous(error,\n  isFatal)`) - release builds, the only ones nobody watches, lose rejections or stop crashing on fatal\n  errors. The net is the same in every build.\n- **`catch { return false; }` around `new URL(raw)` or a feature probe** - looks like a swallowed defect.\n  The throw is the answer: `attempt(() => new URL(raw), () => ({ kind: 'invalid-url' }) as const).ok`.\n- **A fallback that calls `retry()` in an effect, `setTimeout(onRestart, 3000)` or\n  `router.replace('\u002F')` after a delay** - a crash loop when the error repeats. One button, the user decides.\n- **A net nobody connects** - every report waits in its buffer until the process ends. Connect the error\n  log right after the composition root creates the services.\n- **A fallback that calls `useT()` or a store hook** - the providers sit inside the crashed layout, so\n  the fallback itself throws, and that crash is never recorded. Read no context that lacks a default\n  (`useTheme()` has one); take copy from `createTranslateNow` (`src\u002Fi18n\u002Ftranslate-now.ts`).\n- **`APP_THEMES` imported for a \"static\" crash background** - design-system-structure forbids palette\n  imports, and the theme context's default already is the light theme. Use `useTheme()`.\n- **`record: (error) => { console.warn(error); }`** - the boundary's `record` is the only record of a\n  render error; send it to `appErrorNet.report`.\n- **A second `ErrorUtils.setGlobalHandler`** - it replaces the net. Report through `appErrorNet`.\n\n## Files in this skill\n\n| File | What it is | Read\u002Frun when |\n|---|---|---|\n| [references\u002Fresult-and-failures.md](references\u002Fresult-and-failures.md) | Mechanism table, the Result type and why, attempt\u002FattemptAsync, failure design and layering, exhaustive handling, dropped Results, messages, pitfalls | Workflow steps 1-3 and 5 |\n| [references\u002Fboundaries-and-catches.md](references\u002Fboundaries-and-catches.md) | Where boundaries are, the conversion pattern, verified vendor error shapes (expo-sqlite per platform, node:sqlite, CodedError, fetch), recording, the three catch outcomes, best-effort, timeouts, adapters | Workflow step 4 |\n| [references\u002Fglobal-error-net.md](references\u002Fglobal-error-net.md) | What reaches the net (render errors do not), React Native 0.86 dev\u002Frelease behaviour on iOS and Android, the template net, install order, connecting the log, Expo Router's ErrorBoundary, crash loops, Sentry, web, device proof | Workflow steps 7, 8 and 11 |\n| [references\u002Fnever-lose-data.md](references\u002Fnever-lose-data.md) | The four data-loss paths, no destructive recovery, keeping input, quarantine, read-only newer data, visible failures, tests | Workflow step 6 |\n| [references\u002Ftest-recipes.md](references\u002Ftest-recipes.md) | Asserting Results, per-locale message test, mappers on real errors, net and boundary tests, input survival, test-first order | Workflow steps 5 and 9 |\n| [references\u002Fchecker-rules.md](references\u002Fchecker-rules.md) | Every rule of both checkers, limits, configuration keys (`sourceCatalog`, `resultModule`), multi-package runs, SKIP and NOT APPLICABLE lines | Workflow step 10, on any FAIL line |\n| `templates\u002Fsrc\u002Fcore\u002Fresult.ts` | The canonical Result module (synced from the library; do not edit here) | Workflow step 2 |\n| `templates\u002Fsrc\u002Fcore\u002Fresult.test.ts` | Its tests (synced from the library) | Workflow step 2 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Ferror-net.ts` | `createErrorNet` and `readGlobalErrorHooks`: chain, rejection tracking, buffer, guarded sink | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Ferror-net.test.ts` | Its tests with fake hooks | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Fapp-error-net.ts` | The app's one net instance | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Fapp-error-net.test.ts` | Its test against jest-expo's real ErrorUtils | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Finstall-error-net.ts` | The side-effect installer the root layout imports first | Workflow step 7 |\n| `templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Finstall-error-net.test.ts` | Its test: installs once, restores | Workflow step 7 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcreate-route-error-boundary.tsx` | Factory for a route's `ErrorBoundary`: records once, one way out | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcreate-route-error-boundary.test.tsx` | Unit tests without providers and `renderRouterWithProviders` tests through Expo Router (a throwing route, a throwing root layout) | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-screen.tsx` | The crash fallback view (translated strings and the theme background as props; React Native's `Button`, marked `\u002F\u002F press-outside-host:` for ui-component-library) | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-screen.test.tsx` | Its tests: copy, one way out by role and name, no press no call, the accessibility audit | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-fallback.tsx` | The app's root fallback: crash screen with `createTranslateNow` copy, its own `TextLocaleProvider` (language and direction from `languageNow()`) and the `useTheme()` background, no app provider needed | Workflow step 8 |\n| `templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-fallback.test.tsx` | Its test, rendered with no provider at all (the only proof it survives outside the layout), plus the writing direction per language | Workflow step 8 |\n| [examples\u002Ftasks\u002Ftask-failure.ts](examples\u002Ftasks\u002Ftask-failure.ts) | Shape: a failure family and its kinds as data | Workflow step 3 |\n| [examples\u002Ftasks\u002Fto-storage-failure.ts](examples\u002Ftasks\u002Fto-storage-failure.ts) | Shape: a total mapper from SQLite errors (both expo-sqlite device forms) | Workflow step 4 |\n| [examples\u002Ftasks\u002Fto-storage-failure.test.ts](examples\u002Ftasks\u002Fto-storage-failure.test.ts) | Shape: the mapper tested on real node:sqlite errors and the iOS and Android message forms | Workflow step 4 |\n| [examples\u002Ftasks\u002Ftask-repository.ts](examples\u002Ftasks\u002Ftask-repository.ts) | Shape: a boundary converting once and recording the unexpected (only `tasks.title` is the user's duplicate; a reused id is a recorded defect) | Workflow step 4 |\n| [examples\u002Ftasks\u002Ftask-repository.test.ts](examples\u002Ftasks\u002Ftask-repository.test.ts) | Shape: the repository on real SQL: a duplicate title is expected and unrecorded, an id clash is recorded | Workflow step 4 |\n| [examples\u002Fhaptics-adapter.ts](examples\u002Fhaptics-adapter.ts) | Shape: the one licensed best-effort swallow | Workflow step 4 |\n| [examples\u002Ftasks\u002Ftask-failure-message.ts](examples\u002Ftasks\u002Ftask-failure-message.ts) | Shape: kind to message key table with ICU values | Workflow step 5 |\n| [examples\u002Ftasks\u002Fuse-add-task-model.ts](examples\u002Ftasks\u002Fuse-add-task-model.ts) | Shape: a model hook that keeps input until `ok` | Workflow step 6 |\n| [examples\u002Ftasks\u002Fuse-add-task-model.test.ts](examples\u002Ftasks\u002Fuse-add-task-model.test.ts) | Shape: the input-survives test | Workflow step 6 |\n| [examples\u002Froot-layout.tsx](examples\u002Froot-layout.tsx) | Shape: the root layout's net import, the composition root connecting the log, the `ErrorBoundary` export | Workflow steps 7-8 |\n| [examples\u002Fconnect-error-log.ts](examples\u002Fconnect-error-log.ts) | Shape: connecting the error log to the net | Workflow step 7 |\n| `scripts\u002Fcheck-error-spine.mjs` | Checker: Result module, failure shape and text, catches, causes, adapters, dropped Results, UI messages, catalog keys, destructive recovery | Workflow step 10, definition of done |\n| `scripts\u002Fcheck-error-net.mjs` | Checker: one net that forwards, tracks rejections, guards its sink, is installed first and connected; a recording root boundary without auto-retry | Workflow step 10, definition of done |\n| `scripts\u002Flib\u002Ferror-scan.mjs` | Shared scans of both checkers (catch blocks, handlers, failure branches) | Never by hand |\n| `scripts\u002Flib\u002Fsource-scan.mjs` | Lexer and import resolution (synced from the library; do not edit here) | Never by hand |\n| `scripts\u002Fcheck-lib.mjs` | Shared checker library (synced from the library; do not edit here) | Never by hand |\n| `scripts\u002Fselftest.mjs` | Proves both checkers against the fixtures (`node scripts\u002Fselftest.mjs`) | After changing a checker |\n| `assets\u002Fshared.json` | The shared files this skill copies in | When adding a shared file |\n| `tests\u002Fbases\u002F` | The base app the fixtures assemble with the templates and examples; the canonical error-log port, memory adapter and `src\u002Fi18n\u002Ftranslate-now.ts` are synced in (do not edit those copies) | When a fixture needs a new base file |\n| `tests\u002Ffixtures\u002F` | Overlay cases: good, pass-*, one bad-* per rule, error-* | When adding a rule |\n\n## Related skills\n\n- `typescript-and-lint-rules` - the lint rules this builds on (`switch-exhaustiveness-check`, `only-throw-error`, `no-empty`, `kindValue`); it cites `src\u002Fcore\u002Fresult.ts`.\n- `architecture-and-boundaries` - ports and adapters, the composition root, the `ErrorLogPort` the net's sink writes to.\n- `async-safety` - floating promises, synchronous handlers, `.catch(reportError)`, cancellation.\n- `persistence-and-migrations` - the `SqlDriver`, transactions, quarantine in the save-document appendix, and newer-file handling (never touch a file the build cannot use); `run-migration` to ship a schema step.\n- `networking-and-server-state` - the ApiClient's HTTP failure family and retries.\n- `ui-states-and-feedback` - how a failure message is shown: inline, banner, dialog, retry, Undo.\n- `i18n-strings-and-catalogs` - the catalogs the failure-message keys live in, and `src\u002Fi18n\u002Ftranslate-now.ts` (`createTranslateNow`), the fallback's t() without a provider.\n- `design-system-structure` - `AppText`, `useTheme()` and the theme context's light default the crash screen's background comes from.\n- `app-startup-and-bootstrap` - the full startup order around the net import.\n- `crash-reporting-and-observability` - Sentry behind `CrashReporterPort`, fed from the net's sink.\n- `react-components-and-hooks` - component rules for the fallback and model hooks.\n- `forms-and-input` - drafts and field errors that keep input.\n- `debug-menu-and-test-hooks` - the test-only triggers for the device proof.\n- `unit-and-component-tests` - Jest projects, the render helpers (`renderRouterWithProviders`) and the `no-providers` marker the recipes use.\n- `accessibility-as-code` - `findInaccessiblePressables`, the audit the crash screen's test ends with.\n- `rtl-and-direction` - the crash fallback's own `TextLocaleProvider` (`languageNow()`, `directionOf`) and its `root-direction-provider` rule.\n- `ui-component-library` - why the crash screen's core `Button` carries the `press-outside-host` marker.\n- `data-export-and-restore` - backups and all-or-nothing restore.\n",{"name":5,"description":7},"main","41a0e66d4d09de5b46e6537f59a97c7192473486","skills\u002Ferror-handling-typed-results",2,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills","https:\u002F\u002Fzakaria.dev\u002FReactNative-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fzakariaf","https:\u002F\u002Fzakaria.dev","Seniore Software Engineer","2026-10-22 07:05:00",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add zakariaf\u002FReactNative-Skills --skill error-handling-typed-results",{"tool":40,"command":41},"bunx","bunx skills add zakariaf\u002FReactNative-Skills --skill error-handling-typed-results",{"tool":43,"command":44},"pnpm","pnpm dlx skills add zakariaf\u002FReactNative-Skills --skill error-handling-typed-results","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002FSKILL.md",true,[48,54,60,64,70,74,78,82,86,90,94,98,102,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,247,251,255,259,263,267,271],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"assets\u002Fshared.json","ASSET","资产文件",766,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fassets\u002Fshared.json",{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"examples\u002Fconnect-error-log.ts","SCRIPT","脚本",1107,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Fconnect-error-log.ts",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"examples\u002Fhaptics-adapter.ts",1050,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Fhaptics-adapter.ts",{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"examples\u002Froot-layout.tsx","OTHER","其他",2473,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Froot-layout.tsx",{"path":71,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":72,"sourceHtmlUrl":73},"examples\u002Ftasks\u002Ftask-failure-message.ts",1533,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Ftasks\u002Ftask-failure-message.ts",{"path":75,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":76,"sourceHtmlUrl":77},"examples\u002Ftasks\u002Ftask-failure.ts",1102,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Ftasks\u002Ftask-failure.ts",{"path":79,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":80,"sourceHtmlUrl":81},"examples\u002Ftasks\u002Ftask-repository.test.ts",2317,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Ftasks\u002Ftask-repository.test.ts",{"path":83,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":84,"sourceHtmlUrl":85},"examples\u002Ftasks\u002Ftask-repository.ts",4088,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Ftasks\u002Ftask-repository.ts",{"path":87,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":88,"sourceHtmlUrl":89},"examples\u002Ftasks\u002Fto-storage-failure.test.ts",7209,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Ftasks\u002Fto-storage-failure.test.ts",{"path":91,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":92,"sourceHtmlUrl":93},"examples\u002Ftasks\u002Fto-storage-failure.ts",5340,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Ftasks\u002Fto-storage-failure.ts",{"path":95,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":96,"sourceHtmlUrl":97},"examples\u002Ftasks\u002Fuse-add-task-model.test.ts",2788,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Ftasks\u002Fuse-add-task-model.test.ts",{"path":99,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":100,"sourceHtmlUrl":101},"examples\u002Ftasks\u002Fuse-add-task-model.ts",1459,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fexamples\u002Ftasks\u002Fuse-add-task-model.ts",{"path":103,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Fboundaries-and-catches.md","REFERENCE","参考文档",15948,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Freferences\u002Fboundaries-and-catches.md",{"path":109,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":110,"sourceHtmlUrl":111},"references\u002Fchecker-rules.md",19075,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Freferences\u002Fchecker-rules.md",{"path":113,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":114,"sourceHtmlUrl":115},"references\u002Fglobal-error-net.md",25186,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Freferences\u002Fglobal-error-net.md",{"path":117,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":118,"sourceHtmlUrl":119},"references\u002Fnever-lose-data.md",6645,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Freferences\u002Fnever-lose-data.md",{"path":121,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":122,"sourceHtmlUrl":123},"references\u002Fresult-and-failures.md",15793,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Freferences\u002Fresult-and-failures.md",{"path":125,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":126,"sourceHtmlUrl":127},"references\u002Ftest-recipes.md",10012,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Freferences\u002Ftest-recipes.md",{"path":129,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":130,"sourceHtmlUrl":131},"scripts\u002Fcheck-error-net.mjs",50248,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fscripts\u002Fcheck-error-net.mjs",{"path":133,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":134,"sourceHtmlUrl":135},"scripts\u002Fcheck-error-spine.mjs",45686,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fscripts\u002Fcheck-error-spine.mjs",{"path":137,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":138,"sourceHtmlUrl":139},"scripts\u002Fcheck-lib.mjs",119923,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fscripts\u002Fcheck-lib.mjs",{"path":141,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":142,"sourceHtmlUrl":143},"scripts\u002Flib\u002Ferror-scan.mjs",13743,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fscripts\u002Flib\u002Ferror-scan.mjs",{"path":145,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":146,"sourceHtmlUrl":147},"scripts\u002Flib\u002Fsource-scan.mjs",35908,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fscripts\u002Flib\u002Fsource-scan.mjs",{"path":149,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":150,"sourceHtmlUrl":151},"scripts\u002Fselftest.mjs",762,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Fscripts\u002Fselftest.mjs",{"path":153,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":154,"sourceHtmlUrl":155},"templates\u002Fsrc\u002Fcore\u002Fresult.test.ts",2722,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Fcore\u002Fresult.test.ts",{"path":157,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":158,"sourceHtmlUrl":159},"templates\u002Fsrc\u002Fcore\u002Fresult.ts",1831,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Fcore\u002Fresult.ts",{"path":161,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":162,"sourceHtmlUrl":163},"templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-fallback.test.tsx",2452,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-fallback.test.tsx",{"path":165,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":166,"sourceHtmlUrl":167},"templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-fallback.tsx",2326,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-fallback.tsx",{"path":169,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":170,"sourceHtmlUrl":171},"templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-screen.test.tsx",2043,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-screen.test.tsx",{"path":173,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":174,"sourceHtmlUrl":175},"templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-screen.tsx",2249,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcrash-screen.tsx",{"path":177,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":178,"sourceHtmlUrl":179},"templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcreate-route-error-boundary.test.tsx",4563,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcreate-route-error-boundary.test.tsx",{"path":181,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":182,"sourceHtmlUrl":183},"templates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcreate-route-error-boundary.tsx",2130,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Ffeatures\u002Fcrash-recovery\u002Fcreate-route-error-boundary.tsx",{"path":185,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":186,"sourceHtmlUrl":187},"templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Fapp-error-net.test.ts",896,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Fservices\u002Ferror-net\u002Fapp-error-net.test.ts",{"path":189,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":190,"sourceHtmlUrl":191},"templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Fapp-error-net.ts",806,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Fservices\u002Ferror-net\u002Fapp-error-net.ts",{"path":193,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":194,"sourceHtmlUrl":195},"templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Ferror-net.test.ts",6986,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Fservices\u002Ferror-net\u002Ferror-net.test.ts",{"path":197,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":198,"sourceHtmlUrl":199},"templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Ferror-net.ts",6863,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Fservices\u002Ferror-net\u002Ferror-net.ts",{"path":201,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":202,"sourceHtmlUrl":203},"templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Finstall-error-net.test.ts",825,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Fservices\u002Ferror-net\u002Finstall-error-net.test.ts",{"path":205,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":206,"sourceHtmlUrl":207},"templates\u002Fsrc\u002Fservices\u002Ferror-net\u002Finstall-error-net.ts",421,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftemplates\u002Fsrc\u002Fservices\u002Ferror-net\u002Finstall-error-net.ts",{"path":209,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":210,"sourceHtmlUrl":211},"tests\u002Fbases\u002Fapp\u002Fpackage.json",208,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Fpackage.json",{"path":213,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":214,"sourceHtmlUrl":215},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Fapp\u002Findex.tsx",180,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Fapp\u002Findex.tsx",{"path":217,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":218,"sourceHtmlUrl":219},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Fcore\u002Ftasks\u002Ftask.ts",137,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Fcore\u002Ftasks\u002Ftask.ts",{"path":221,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":222,"sourceHtmlUrl":223},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Fdata\u002Fsql-driver.ts",243,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Fdata\u002Fsql-driver.ts",{"path":225,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":226,"sourceHtmlUrl":227},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Fi18n\u002Fcatalogs\u002Fen.json",558,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Fi18n\u002Fcatalogs\u002Fen.json",{"path":229,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":230,"sourceHtmlUrl":231},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Fi18n\u002Ftranslate-now.ts",2566,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Fi18n\u002Ftranslate-now.ts",{"path":233,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":234,"sourceHtmlUrl":235},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Fservices\u002Ferror-log\u002Ferror-log-port.ts",941,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Fservices\u002Ferror-log\u002Ferror-log-port.ts",{"path":237,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":238,"sourceHtmlUrl":239},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Fservices\u002Fhaptics\u002Fhaptics-port.ts",133,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Fservices\u002Fhaptics\u002Fhaptics-port.ts",{"path":241,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":242,"sourceHtmlUrl":243},"tests\u002Fbases\u002Fapp\u002Fsrc\u002Fui\u002Fapp-text.tsx",233,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Fsrc\u002Fui\u002Fapp-text.tsx",{"path":245,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":218,"sourceHtmlUrl":246},"tests\u002Fbases\u002Fapp\u002Ftsconfig.json","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fapp\u002Ftsconfig.json",{"path":248,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":249,"sourceHtmlUrl":250},"tests\u002Fbases\u002Fcanonical-error-log\u002Fsrc\u002Fservices\u002Ferror-log\u002Fmemory-error-log-adapter.ts",1553,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Fbases\u002Fcanonical-error-log\u002Fsrc\u002Fservices\u002Ferror-log\u002Fmemory-error-log-adapter.ts",{"path":252,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":253,"sourceHtmlUrl":254},"tests\u002Ffixtures\u002Fcheck-error-net\u002FCASES.json",28201,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Ffixtures\u002Fcheck-error-net\u002FCASES.json",{"path":256,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":257,"sourceHtmlUrl":258},"tests\u002Ffixtures\u002Fcheck-error-net\u002Fgood\u002FEXPECT.txt",30,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Ffixtures\u002Fcheck-error-net\u002Fgood\u002FEXPECT.txt",{"path":260,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":261,"sourceHtmlUrl":262},"tests\u002Ffixtures\u002Fcheck-error-net\u002FSUITE.json",183,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Ffixtures\u002Fcheck-error-net\u002FSUITE.json",{"path":264,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":265,"sourceHtmlUrl":266},"tests\u002Ffixtures\u002Fcheck-error-spine\u002FCASES.json",45534,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Ffixtures\u002Fcheck-error-spine\u002FCASES.json",{"path":268,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":269,"sourceHtmlUrl":270},"tests\u002Ffixtures\u002Fcheck-error-spine\u002Fgood\u002FEXPECT.txt",32,"https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Ffixtures\u002Fcheck-error-spine\u002Fgood\u002FEXPECT.txt",{"path":272,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":261,"sourceHtmlUrl":273},"tests\u002Ffixtures\u002Fcheck-error-spine\u002FSUITE.json","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ferror-handling-typed-results\u002Ftests\u002Ffixtures\u002Fcheck-error-spine\u002FSUITE.json",[275,282,288,295,302,309],{"skillNo":276,"name":277,"nameZh":6,"description":278,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":279,"categories":280,"keywords":281,"publishedAt":19},"01M7F2S4KZG97D21GEJ2GKKYK1","demo","Planted skill folder (never scanned).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-support\u002Ftests\u002Fbases\u002Fapp\u002Fskills\u002Fdemo\u002FSKILL.md",[],[],{"skillNo":283,"name":277,"nameZh":6,"description":284,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":285,"categories":286,"keywords":287,"publishedAt":19},"01M7F2S1F4ATZ49909EDKWA9E6","Planted installed skill (its files must never be scanned).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-support\u002Ftests\u002Fbases\u002Fapp\u002F.agents\u002Fskills\u002Fdemo\u002FSKILL.md",[],[],{"skillNo":289,"name":290,"nameZh":6,"description":291,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":292,"categories":293,"keywords":294,"publishedAt":19},"01M7F2RXGPZJ5Q1FV2HQ1PJ6AX","web-support","Ships the web build of an Expo app: platform files, APIs missing in react-native-web, expo-sqlite headers. Use when adding web, a .web.tsx file or expo export --platform web. Not for responsive layout (adaptive-layout).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fweb-support\u002FSKILL.md",[],[],{"skillNo":296,"name":297,"nameZh":6,"description":298,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":299,"categories":300,"keywords":301,"publishedAt":19},"01M7F2RQ43JFA4QFWQEHBET08G","value-objects-money-and-units","Stores money as ISO 4217 minor units, quantities in canonical units, instants as epoch ms. Use when adding a price, currency, tax, split, unit or timestamp, or a total is a cent off. Not for calendar days (dates-streaks-and-statistics).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalue-objects-money-and-units\u002FSKILL.md",[],[],{"skillNo":303,"name":304,"nameZh":6,"description":305,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":306,"categories":307,"keywords":308,"publishedAt":19},"01M7F2RHR7H8VVZDP16FJNJV11","unit-and-component-tests","Sets up Jest, checks unit, component and route tests (RNTL 14, renderWithProviders, SDK mocks, fakes, fast-check, Stryker). Use when writing a test or mock, or Jest fails or flakes. Not for goldens (golden-and-snapshot-tests).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Funit-and-component-tests\u002FSKILL.md",[],[],{"skillNo":310,"name":311,"nameZh":6,"description":312,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":313,"categories":314,"keywords":315,"publishedAt":19},"01M7F2RAEDWQ6H4514HFRWJAE6","ui-states-and-feedback","Builds loading, empty, failed and offline states, delayed skeletons, toasts, banners, confirms, Undo. Use when a screen loads data, shows a spinner, toast, retry or delete prompt. Not for failure values (error-handling-typed-results).","https:\u002F\u002Fgithub.com\u002Fzakariaf\u002FReactNative-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fui-states-and-feedback\u002FSKILL.md",[],[]]