All skills
sergiodxa avatar

/frontend-react-best-practices

@734526d

React performance optimization guidelines. Use when writing, reviewing, or refactoring React components to ensure optimal rendering and bundle patterns. Triggers on tasks involving React components, hooks, memoization, or bundle optimization.

Use this Skill: https://skilld.dev/gh/sergiodxa/agent-skills/frontend-react-best-practices

This session only. Nothing lands on disk.

rulesfault-tolerant-error-boundaries.md

≈288 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Place Error Boundaries at Feature Boundaries

Add error boundaries around independent features, not just at the top and not around every leaf.

Why

  • A single top-level boundary brings down the whole app on any error
  • Too many boundaries create partially broken UI and confusing states
  • Feature-level boundaries isolate failures while keeping the rest usable

Pattern

// Good: boundaries at feature seams
<ErrorBoundary fallback={<SidebarError />}> 
  <Sidebar />
</ErrorBoundary>

<ErrorBoundary fallback={<FeedError />}> 
  <Feed />
</ErrorBoundary>

<ErrorBoundary fallback={<TrendsError />}>
  <Trends />
</ErrorBoundary>

Heuristic

Ask: “If this component crashes, should its siblings also crash?”

  • If yes, put the boundary higher
  • If no, put the boundary at this feature boundary

Rules

  1. Avoid only a single top-level error boundary
  2. Avoid wrapping every component with a boundary
  3. Place boundaries around independent feature areas
  4. Use feature-specific fallbacks to prevent broken UX

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill is a collection of React performance and composition guidelines. It contains no executable code, scripts, or malicious patterns and is entirely informational.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    37/37 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 734526d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago

README badge

README badge for sergiodxa/agent-skills/frontend-react-best-practices