home / skills / harborgrid-justin / lexiflow-premium / react-error-boundary-analytics
/frontend/.github-skills/react-error-boundary-analytics
This skill helps you capture and report runtime errors in React apps with component stack traces and user context for faster debugging.
npx playbooks add skill harborgrid-justin/lexiflow-premium --skill react-error-boundary-analyticsReview the files below or copy the command above to add this skill to your agents.
---
name: react-error-boundary-analytics
description: Capture and report runtime errors with component stack traces and user context.
---
# React Error Boundary Analytics
## Summary
Capture and report runtime errors with component stack traces and user context.
## Key Capabilities
- Catch render-phase errors.
- Send reports to logging service.
- Display fallback UI.
## PhD-Level Challenges
- Recover from errors gracefully.
- Group similar errors.
- Avoid infinite error loops.
## Acceptance Criteria
- Demonstrate catching a throw.
- Show the report payload.
- Reset the boundary successfully.
This skill captures and reports React runtime errors with component stack traces and user context to aid debugging and compliance reporting. It renders a configurable fallback UI and supports resetting error boundaries to allow recovery. The implementation is tuned for production workflows in legal and premium platforms where auditability and graceful degradation are critical.
The error boundary wraps React component trees and catches render-phase exceptions, extracting componentStack, error message, and optional user/session context. It assembles a structured payload and sends it to a logging or analytics endpoint, while rendering a fallback UI to the user. The boundary exposes reset controls and guards to prevent infinite error loops and supports grouping similar errors in the payload.
How is sensitive user data handled in reports?
Only include non-identifying context by default; make PII optional and gated behind explicit consent and secure transport.
How do you avoid infinite error loops from the logger itself?
Use fail-safe guards: local storage flags, exponential backoff, batching, and a circuit breaker that halts reporting if the logger repeatedly fails.