Skip to content

charlieviettq/awesome-agent-skill / .claude/skills/cross-platform-error-handling

cross-platform-error-handling

Verified

Design consistent error handling across web, mobile, and React Native—central handlers, user-facing copy, retry, and logging.

FileKindSize
SKILL.mdskill md1.6 KB
---
name: cross-platform-error-handling
description: "Design consistent error handling across web, mobile, and React Native—central handlers, user-facing copy, retry, and logging."
allowed-tools: Read, Glob, Grep
---

# Cross-Platform Error Handling

Patterns for centralized error capture, user-appropriate messaging, and observability across web and mobile clients.

## When to use

- Inconsistent error UX across platforms
- Unhandled promise rejections or crash reports
- Adding global error boundary/handler

## When not to use

- Server-side API error design (use `api-and-interface-design`)
- Single-platform app with existing mature pattern (extend, don't rewrite)

## Architecture

```
Error occurs → classify (network/auth/validation/unknown)
            → log (structured, no PII)
            → user message (actionable, localized)
            → optional retry/report
```

## Platform patterns

| Platform | Mechanism |
|----------|-----------|
| React web | Error boundary + window `unhandledrejection` |
| React Native | Global handler + native crash reporting SDK |
| Next.js | `error.tsx` boundaries + server action error mapping |

## User messaging rules

- **Network** — "Check connection" + retry
- **Auth** — redirect to login; no token details
- **Validation** — field-level hints
- **Unknown** — generic message + support/ref ID; log details server-side

## Checklist

- [ ] Central error type taxonomy (shared package if monorepo)
- [ ] No stack traces shown to end users
- [ ] Correlation ID in user-facing error when support needed
- [ ] Regression test for at least one error path per platform
- [ ] Offline mode handled where applicable
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall