AI Agent Hub
Back to skills
💻

Vercel React Best Practices

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @org-02qudk26/vercel-react-best-practices into your AI assistant.

About this skill

Problem to Solve

Performance issues in React and Next.js applications are usually systemic rather than caused by one slow algorithm: serialized requests, third-party scripts loading too early, duplicated server-side computation, overly broad client state subscriptions, and unnecessary re-renders. Code generation without these constraints can produce code that runs but is hard to ship.

How the Skill Works

The skill organizes Vercel guidance into 8 priority categories and 45 rules, each with a name, impact scope, and actionable pattern:
- Critical path: address async- and bundle- rules first, such as using Promise.all() for independent requests, next/dynamic for heavy components, and avoiding barrel imports.
- Server and client: use React.cache(), SWR, minimized serialization, and event-listener deduplication to reduce duplicate computation and repeated requests.
- Rendering and JS details: use startTransition, functional setState, Set/Map lookups, and loop merging to lower re-render and hot-path cost.
In practice, classify the issue first, then select rules by prefixes such as async-, bundle-, server-, client-, and rerender-, and compare incorrect and correct examples during review or generation.

Boundaries

It is focused on React/Next.js web performance optimization and does not replace testing, accessibility, business modeling, or operational monitoring. Some rules depend on Next.js APIs such as after() and next/dynamic, so pure React or other SSR setups should adapt them to the available runtime.

Use Cases

  • When reviewing new component code, check async and bundle rules for serialized requests and oversized bundle size.
  • When refactoring old pages, convert independent API calls to Promise.all to reduce load latency.
  • When writing client logic, use SWR to deduplicate requests and stabilize callbacks to cut re-renders.
  • When optimizing bundle size, replace heavy components with next/dynamic and defer third-party scripts.

Best For

  • Frontend engineers delivering Next.js projects who want performance constraints during AI code generation.
  • Tech leads running code reviews who need to spot serialized requests, bundle issues, and re-renders.
  • Engineers maintaining data-heavy web apps who want to reduce duplicate requests and unnecessary rendering.
  • Independent developers using AI to write React components who need incorrect and correct examples to compare.