error-boundary-creator
Installation
SKILL.md
Error Boundary Creator
Add resilient error handling to React and Next.js apps: error boundaries, fallback UIs, async error handling, and error reporting.
Workflow
- Identify error-prone areas: async operations, third-party integrations, and route-level entry points.
- Wrap components in an error boundary. Use a class boundary or the
react-error-boundarylibrary. See references/class-boundaries.md. - For Next.js App Router, add the relevant
error.tsx,global-error.tsx, andnot-found.tsxsegment files. See references/nextjs-error-handling.md. - Handle errors that boundaries miss (event handlers, promises) and wire up reporting. See references/async-and-reporting.md.
- Design fallback UIs with
role="alert"and a recovery action (reset or reload). - Route caught errors to a single reporting sink and test error states before shipping.
Contents
- references/class-boundaries.md — Basic, resettable, and
react-error-boundarypatterns. - references/nextjs-error-handling.md — App Router
error.tsx,global-error.tsx,not-found.tsx. - references/async-and-reporting.md —
useAsynchook and thereportErrorintegration module.