# Error handling typed results

> Error handling typed results is an open-source agent skill for developer tools. Makes the agent model expected failures as typed Result values in React Native apps. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/zakariaf/ReactNative-Skills/tree/main/skills/error-handling-typed-results
- **Repository:** https://github.com/zakariaf/reactnative-skills
- **GitHub stars:** 16
- **License:** MIT
- **Skill name:** error-handling-typed-results
- **Collection:** https://github.com/zakariaf/ReactNative-Skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill sets up a typed error-handling spine for React Native and Expo apps. Expected failures such as missing records, offline state, full storage or invalid input are returned as a Result value with a kebab-case kind and typed parameters, while true bugs still throw. It explains where to convert vendor errors at each boundary, how every catch must record, map or rethrow, and how to keep Results from being silently dropped.

The workflow walks the agent through a shared Result module, one failure family per boundary, message tables keyed by kind for translated UI, and a global error net that catches unhandled rejections and render errors with a recording root error boundary. It also covers rules that stop error paths from deleting or resetting user data and keep form input after a failed save.

The skill ships two zero-dependency checkers that scan the code for these rules, and it expects a TypeScript codebase with Jest, ESLint and an i18n catalog setup. Its companion skills cover the surrounding app structure, persistence and crash reporting.

## When your agent uses it

> Builds a typed Result spine - failures converted at boundaries, exhaustive handling. Use when writing try/catch, .catch or a Result, or fixing swallowed errors or unhandled rejections. Not for error UI (ui-states-and-feedback).

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs JavaScript and TypeScript scripts](https://github.com/zakariaf/ReactNative-Skills/tree/HEAD/skills/error-handling-typed-results)
- [Network calls found in its scripts](https://github.com/zakariaf/ReactNative-Skills/tree/HEAD/skills/error-handling-typed-results)
- [License: MIT](https://github.com/zakariaf/ReactNative-Skills/tree/HEAD/skills/error-handling-typed-results)

## Features

- **Typed Result module:** Provides one Result type with ok, err, attempt and attemptAsync helpers shared from the core layer.
- **Kind-based failure design:** Guides designing failure families as kebab-case kinds with typed parameters rather than strings or Error objects.
- **Boundary conversion rules:** Explains converting vendor errors such as SQLite or fetch failures once at adapters and repositories.
- **Exhaustive failure handling:** Covers switch statements and typed record tables so new failure kinds fail compilation where handled.
- **Global error net:** Installs a single handler for unhandled rejections and render errors that records unexpected failures.
- **Data-safe error paths:** Rules against deleting or resetting data in catch blocks and for keeping user input after a failed write.

## Good for

- Convert SQLite errors into typed storage failures in a React Native app
- Replace try/catch blocks that swallow errors with typed Result returns
- Map failure kinds to translated messages for the UI
- Install a global error handler that records unhandled promise rejections
- Add a root error boundary with a single restart button
- Keep a form's input when saving fails

## Install

### Claude Code

This skill ships in the `react-native` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add zakariaf/ReactNative-Skills
/plugin install react-native@react-native-skills
```

Or copy only this skill to `~/.claude/skills/error-handling-typed-results`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/error-handling-typed-results &&
cp -R "$tmp/skills/error-handling-typed-results" ~/.claude/skills/error-handling-typed-results &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/error-handling-typed-results` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/error-handling-typed-results` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/error-handling-typed-results &&
cp -R "$tmp/skills/error-handling-typed-results" ~/.agents/skills/error-handling-typed-results &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/error-handling-typed-results` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/error-handling-typed-results` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/error-handling-typed-results &&
cp -R "$tmp/skills/error-handling-typed-results" ~/.cursor/skills/error-handling-typed-results &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/error-handling-typed-results` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/zakariaf/ReactNative-Skills.git --path skills/error-handling-typed-results
```

Or copy the folder to `~/.gemini/skills/error-handling-typed-results` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/error-handling-typed-results`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/error-handling-typed-results &&
cp -R "$tmp/skills/error-handling-typed-results" ~/.copilot/skills/error-handling-typed-results &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/error-handling-typed-results` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git
```

Then copy `ReactNative-Skills/skills/error-handling-typed-results` into your agent's skills folder as `error-handling-typed-results`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Error handling typed results need before it can be used?

It assumes a React Native or Expo TypeScript project with Jest, ESLint and an i18n catalog, and it relies on companion skills for app startup, persistence and the error log port.

### Does Error handling typed results add a new Result library?

No. It copies a small in-repo Result module at src/core/result.ts and forbids a second Result type or any result library.

### Which AI clients does Error handling typed results work with?

It follows the shared agent skills format, so it works with all supported clients listed on the page.

### Does Error handling typed results include automated checks?

Yes. It ships two zero-dependency checker scripts that scan for the rules and print a PASS or FAIL result.

### How do I install Error handling typed results in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/error-handling-typed-results to use it in all your projects, or to .claude/skills/error-handling-typed-results in one project. Or install the react-native plugin, which includes it: /plugin marketplace add zakariaf/ReactNative-Skills, then /plugin install react-native@react-native-skills.

### Does Error handling typed results run scripts?

Yes. It runs JavaScript and TypeScript scripts. Its scripts contain network calls. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Error handling typed results?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Error handling typed results?

The closest alternatives to Error handling typed results are Error handling, Game session host, TypeScript best practices, Async safety and Debugging and error recovery.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Error handling](https://ai-powered.com/skills/error-handling): Error handling is an open-source agent skill for developer tools.
- [Game session host](https://ai-powered.com/skills/game-session-host): Game session host is an open-source agent skill for developer tools.
- [TypeScript best practices](https://ai-powered.com/skills/typescript-best-practices): TypeScript best practices is an open-source agent skill for developer tools.
- [Async safety](https://ai-powered.com/skills/async-safety): Async safety is an open-source agent skill for developer tools.
- [Debugging and error recovery](https://ai-powered.com/skills/debugging-and-error-recovery): Debugging and error recovery is an open-source agent skill for developer tools.
- [React frontend](https://ai-powered.com/skills/react-frontend): React frontend is an open-source agent skill for developer tools.
- [Vercel react native skills](https://ai-powered.com/skills/vercel-react-native-skills): Vercel react native skills is an open-source agent skill for cloud and infrastructure.
- [M06 error handling](https://ai-powered.com/skills/m06-error-handling): M06 error handling is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/error-handling-typed-results
