Agent skill
react-patterns
React and Next.js performance optimization guidelines from Vercel Engineering, tuned for local/offline or docker-deployed apps.
Install this agent skill to your Project
npx add-skill https://github.com/srbhr/Resume-Matcher/tree/main/.claude/skills/react-patterns
Metadata
Additional technical details for this skill
- focus
- local-offline-docker
- author
- vercel
- version
- 1.0.0
SKILL.md
Vercel React Best Practices (Local/Docker)
Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. This version highlights the most important patterns for local installs or dockerized deployments.
Purpose
Provide a high-signal checklist to avoid async waterfalls, reduce client payloads, and keep UI responsive without relying on hosted or edge-specific optimizations.
When to Apply
- Building or refactoring React components or Next.js pages
- Implementing Server Actions, Route Handlers, or data fetching
- Reducing startup time or memory footprint for local installs
- Debugging sluggish UI or long hydration times
- Reviewing code for performance regressions
Offline and Docker Focus
- Optimize for cold-start and steady-state responsiveness over SEO.
- Use in-process caches because the server process persists.
- Avoid sequential awaits even for local APIs or databases.
- Defer non-critical work until after render or after responses are sent.
- Minimize RSC props to reduce hydration and memory overhead.
Top Findings
- Eliminate async waterfalls by starting work early and awaiting late with
Promise.allorbetter-all. - Use Suspense boundaries to stream UI instead of blocking the whole page on data.
- Reduce initial load and memory via dynamic imports, conditional loading, and direct imports.
- Minimize RSC payloads; pass only fields used and avoid duplicating serialized data.
- Cache hot server work:
React.cacheper request and LRU for cross-request reuse. - Reduce client work with memoized subtrees, lazy state init, transitions, and
content-visibilityfor large lists.
Core Patterns
async-parallelandasync-api-routesto eliminate waterfallsasync-suspense-boundariesto stream slow sectionsbundle-barrel-importsandbundle-dynamic-importsto reduce startup costserver-serializationandserver-dedup-propsto shrink RSC payloadsserver-cache-reactandserver-cache-lruto reuse hot workrerender-lazy-state-initandrerender-transitionsfor responsive UIrendering-content-visibilityfor long listsclient-swr-dedupfor fetch deduplication
Outputs
REACT_PATTERNS.mdfor a condensed, offline-focused guideAGENT.mdfor the full compiled reference
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Eliminating Waterfalls | CRITICAL | async- |
| 2 | Bundle Size Optimization | CRITICAL | bundle- |
| 3 | Server-Side Performance | HIGH | server- |
| 4 | Client-Side Data Fetching | MEDIUM-HIGH | client- |
| 5 | Re-render Optimization | MEDIUM | rerender- |
| 6 | Rendering Performance | MEDIUM | rendering- |
| 7 | JavaScript Performance | LOW-MEDIUM | js- |
| 8 | Advanced Patterns | LOW | advanced- |
How to Use
Start with REACT_PATTERNS.md for the condensed guidance.
Full Compiled Document
For the complete guide with all rules expanded: AGENT.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
ui-review
Review UI changes against Swiss International Style design system. Checks colors, typography, borders, shadows, spacing, and anti-patterns. Use before committing any frontend UI changes.
codebase-navigator
Navigate, search, and understand the Resume Matcher codebase using ripgrep, ack, or grep. Find functions, classes, components, API endpoints, trace data flows, and understand architecture. Use FIRST when exploring code, finding files, or understanding project structure.
fastapi
Build Python APIs with FastAPI, Pydantic v2, and async patterns. Covers project structure, JWT auth, validation, database integration, and 7 documented error preventions. Use when creating Python APIs, implementing auth, or troubleshooting 422 validation, CORS, async blocking, or schema errors.
tailwind-patterns
Production-ready Tailwind CSS patterns for responsive layouts, cards, navigation, forms, buttons, and typography. Includes spacing scale, breakpoints, mobile-first patterns, dark mode, and Swiss International Style overrides for Resume Matcher.
full-stack
Full-stack development skill that coordinates backend and frontend changes together. Use for features that span both layers: new API endpoint + UI, data model changes, end-to-end flows.
code-review
Review code for correctness, security, performance, and Resume Matcher conventions. Use when receiving code review feedback or before submitting PRs. Requires technical rigor, not performative agreement.
Didn't find tool you were looking for?