react-best-practices

react-best-practices is a skill for Claude Code, Codex from majiayu000/spellbook. It costs 50 tokens per session (884 once invoked), scanned A, original, MIT.

A performance guide for React and Next.js, tools for building web interfaces with JavaScript and server-side features.

In plain words
What is it for?
Use it when building or reviewing React components, improving Next.js performance, reducing bundle size, and fixing data-fetching waterfalls.
Why use it?
It helps find slow data loading, oversized browser code, unnecessary rerenders, and costly page rendering.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when building or reviewing React components, improving Next.js performance, reducing bundle size, and fixing data-fetching waterfalls.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majiayu000/spellbook/react-best-practices
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add majiayu000/spellbook --skill react-best-practices
Clone the repo
git clone --depth 1 https://github.com/majiayu000/spellbook

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for react-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/majiayu000/spellbook/react-best-practices.svg)](https://agentmods.dev/skills/majiayu000/spellbook/react-best-practices)
Your own site
<a href="https://agentmods.dev/skills/majiayu000/spellbook/react-best-practices"><img src="https://agentmods.dev/badge/skills/majiayu000/spellbook/react-best-practices.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 884 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.00884
Opus 5 $0.00025 $0.00442
Sonnet 5 $0.00010 $0.00177
Haiku 4.5 $0.00005 $0.00088

Measured 4d ago against content hash 5d221600c5af, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

react-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/react-best-practices/SKILL.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

React Best Practices

Practical React and Next.js guidance for performance-sensitive product work.

This skill is a self-contained distillation of the Vercel React performance guidance so it can be installed and used directly inside Spellbook.

When To Use

Use this skill when the user asks to:

  • build or refactor React components
  • improve Next.js performance
  • reduce bundle size
  • remove data-fetch waterfalls
  • fix expensive rerenders
  • review frontend code for performance issues

Priority Order

Always check higher-priority categories first.

Priority Category Focus
1 Waterfalls start async work early, await late, parallelize independent fetches
2 Bundle size avoid barrel imports, defer heavy code, split by feature
3 Server-side performance dedupe work, minimize serialization, prefer server execution
4 Client data fetching dedupe requests, avoid redundant listeners and client churn
5 Rerenders reduce subscriptions, stabilize dependencies, move expensive work
6 Rendering avoid hydration flicker, reduce DOM/SVG cost, optimize long lists
7 JavaScript hot paths cache repeated lookups, combine iterations, exit early
8 Advanced patterns stable refs and callback patterns for edge cases

Hard Rules

1. Eliminate Waterfalls First

  • Start independent requests in parallel.
  • Do not serialize async work unless there is a real dependency.
  • In API routes and server components, create promises early and await them as late as possible.
  • Use Suspense boundaries when streaming content helps unblock rendering.

2. Protect Bundle Size

  • Prefer direct imports over barrel files on hot paths.
  • Use dynamic imports for heavy or infrequently used components.
  • Defer analytics, logging, and other non-critical third-party code until after hydration.
  • Load optional modules only when the related feature is activated.

3. Prefer Server Work Over Client Work

  • Keep data fetching and heavy transformation on the server when possible.
  • Minimize data serialized into client components.
  • Cache server-side repeated work when the request model allows it.

Read the full file on GitHub · 106 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 106 lines · 50 tokens per session scan A 5d221600c5af

Subscribe to this mod's changes

react-best-practices is a skill published in the GitHub repository majiayu000/spellbook (276 stars, last pushed 2d ago), licensed MIT. It adds 50 tokens to every session and 884 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.