error-boundary-creator

$npx mdskill add OneWave-AI/claude-skills/error-boundary-creator

Create resilient error handling for React and Next.js apps

  • Identify areas prone to errors like async operations and third-party integrations.
  • Wrap components in error boundaries using class patterns or `react-error-boundary` library.
  • Handle missed errors with the `useAsync` hook and integrate error reporting.
  • Design fallback UIs with `role="alert"` for user feedback, including a recovery action.

SKILL.md

.github/skills/error-boundary-creatorView on GitHub ↗
---
name: error-boundary-creator
description: Create error boundaries, error handling, and fallback UIs for React applications. Use when implementing error handling, creating fallback components, or setting up error reporting.
---

# Error Boundary Creator

Add resilient error handling to React and Next.js apps: error boundaries, fallback UIs, async error handling, and error reporting.

## Workflow

1. Identify error-prone areas: async operations, third-party integrations, and route-level entry points.
2. Wrap components in an error boundary. Use a class boundary or the `react-error-boundary` library. See references/class-boundaries.md.
3. For Next.js App Router, add the relevant `error.tsx`, `global-error.tsx`, and `not-found.tsx` segment files. See references/nextjs-error-handling.md.
4. Handle errors that boundaries miss (event handlers, promises) and wire up reporting. See references/async-and-reporting.md.
5. Design fallback UIs with `role="alert"` and a recovery action (reset or reload).
6. Route caught errors to a single reporting sink and test error states before shipping.

## Contents

- references/class-boundaries.md — Basic, resettable, and `react-error-boundary` patterns.
- references/nextjs-error-handling.md — App Router `error.tsx`, `global-error.tsx`, `not-found.tsx`.
- references/async-and-reporting.md — `useAsync` hook and the `reportError` integration module.

## Best Practices

1. Wrap at the route level for page-level isolation, and wrap third-party components separately.
2. Provide meaningful fallbacks with a recovery option.
3. Log every caught error to the monitoring service.
4. Do not catch errors the code cannot meaningfully handle.
5. Test error states in development.

More from OneWave-AI/claude-skills

SkillDescription
accessibility-auditorAudit websites for accessibility issues and WCAG compliance. Use when checking accessibility, fixing a11y issues, or ensuring WCAG compliance.
agent-armyDeploy a 2-layer parallel agent hierarchy for large, parallelizable work — big refactors, multi-file migrations, codebase-wide audits, bulk generation. Layer 1 is 3-50+ specialist agents, each with its own full context window; Layer 2 is 2+ sub-agents per member. Includes git safety, tiered sizing, a pre-deploy gate, phantom-completion checks, and multi-wave follow-up.
agent-swarm-deployerDeploys swarms of sub-agents for massive parallel data processing tasks. Unlike agent-army (which is for code changes), this is for DATA tasks -- processing 1000 documents, analyzing datasets, bulk content generation. Configurable swarm size, task distribution, result aggregation, progress tracking, and error recovery.
agent-team-builderDesigns and deploys custom agent teams for specific business workflows. Interactive discovery of business processes, then generates complete team configurations with specialized agent roles, tool access, communication protocols, and handoff rules.
agent-to-agentAgent-to-Agent (A2A) communication protocol. Connect two or more Claude agents that pass messages, share context, delegate tasks, and collaborate. Implements structured handoffs, shared memory, and multi-agent conversations.
ai-readiness-assessmentAssesses how ready a business is for AI adoption across six dimensions. Evaluates data maturity, tech stack, team skills, process documentation, budget, and culture. Generates a comprehensive ai-readiness-report.md with scores, gap analysis, and recommended starting points. Aligned with OneWave AI's audit methodology.
api-documentation-writerGenerate comprehensive API documentation including endpoint descriptions, request/response examples, authentication guides, error codes, and SDKs. Creates OpenAPI/Swagger specs, REST API docs, and developer-friendly reference materials. Use when users need to document APIs, create technical references, or write developer documentation.
api-endpoint-scaffolderGenerate REST API endpoints with proper structure, validation, error handling, and types. Use when creating new API routes, endpoints, or backend services.
api-load-testerLoad tests API endpoints with progressive concurrency. Measures response times, error rates, throughput, and identifies breaking points. Generates a detailed report with latency percentiles, throughput curves, bottleneck analysis, and optimization recommendations.
athlete-social-media-managerCreate brand-safe content for athletes. Personal branding strategy, engagement optimization, crisis communication, sponsor integration.