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.
npx skills add koolamusic/claudefiles --skill react-best-practicesgit clone --depth 1 https://github.com/koolamusic/claudefilesWrote 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.
[](https://agentmods.dev/skills/koolamusic/claudefiles/react-best-practices)<a href="https://agentmods.dev/skills/koolamusic/claudefiles/react-best-practices"><img src="https://agentmods.dev/badge/skills/koolamusic/claudefiles/react-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/koolamusic/claudefiles/react-best-practices"><img src="https://agentmods.dev/badge/skills/koolamusic/claudefiles/react-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00065 | $0.00795 |
| Opus 5.5 | $0.00026 | $0.00318 |
| Sonnet 5.5 | $0.00013 | $0.00159 |
| Haiku 4.5 | $0.00006 | $0.00080 |
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 2mo 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.
This is a copy
100% identical to react-best-practices — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.
React Best Practices
Overview
Comprehensive performance optimization guide for React and Next.js applications, containing 40+ rules across 8 categories. Rules are prioritized by impact to guide automated refactoring and code generation.
When to Apply
Reference these guidelines when:
- Writing new React components or Next.js pages
- Implementing data fetching (client or server-side)
- Reviewing code for performance issues
- Refactoring existing React/Next.js code
- Optimizing bundle size or load times
Priority-Ordered Guidelines
Rules are prioritized by impact:
| Priority | Category | Impact |
|---|---|---|
| 1 | Eliminating Waterfalls | CRITICAL |
| 2 | Bundle Size Optimization | CRITICAL |
| 3 | Server-Side Performance | HIGH |
| 4 | Client-Side Data Fetching | MEDIUM-HIGH |
| 5 | Re-render Optimization | MEDIUM |
| 6 | Rendering Performance | MEDIUM |
| 7 | JavaScript Performance | LOW-MEDIUM |
| 8 | Advanced Patterns | LOW |
Quick Reference
Critical Patterns (Apply First)
Eliminate Waterfalls:
- Defer await until needed (move into branches)
- Use
Promise.all()for independent async operations - Start promises early, await late
- Use
better-allfor partial dependencies - Use Suspense boundaries to stream content
Reduce Bundle Size:
- Avoid barrel file imports (import directly from source)
- Use
next/dynamicfor heavy components - Defer non-critical third-party libraries
- Preload based on user intent
High-Impact Server Patterns
- Use
React.cache()for per-request deduplication - Use LRU cache for cross-request caching
- Minimize serialization at RSC boundaries
- Parallelize data fetching with component composition
Medium-Impact Client Patterns
- Use SWR for automatic request deduplication
- Defer state reads to usage point
- Use lazy state initialization for expensive values
- Use derived state subscriptions
- Apply
startTransitionfor non-urgent updates
Rendering Patterns
- Animate SVG wrappers, not SVG elements directly
- Use
content-visibility: autofor long lists - Prevent hydration mismatch with inline scripts
- Use explicit conditional rendering (
? :not&&)
What ships with it
46 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/react-performance-guidelines.md 48 KB
- references/rules/_sections.md 1.5 KB
- references/rules/_template.md 631 B
- references/rules/advanced-event-handler-refs.md 960 B
- references/rules/advanced-use-latest.md 1.2 KB
- references/rules/async-api-routes.md 1.1 KB
- references/rules/async-defer-await.md 2.0 KB
- references/rules/async-dependencies.md 942 B
- references/rules/async-parallel.md 654 B
- references/rules/async-suspense-boundaries.md 1.6 KB
- references/rules/bundle-barrel-imports.md 2.3 KB
- references/rules/bundle-conditional.md 870 B
- references/rules/bundle-defer-third-party.md 922 B
- references/rules/bundle-dynamic-imports.md 791 B
- references/rules/bundle-preload.md 1.1 KB
- references/rules/client-event-listeners.md 1.9 KB
- references/rules/client-swr-dedup.md 1.1 KB
- references/rules/js-batch-dom-css.md 1.9 KB
- references/rules/js-cache-function-results.md 1.9 KB
- references/rules/js-cache-property-access.md 532 B
- references/rules/js-cache-storage.md 1.6 KB
- references/rules/js-combine-iterations.md 753 B
- references/rules/js-early-exit.md 1.1 KB
- references/rules/js-hoist-regexp.md 994 B
- references/rules/js-index-maps.md 837 B
- references/rules/js-length-check-first.md 1.7 KB
- references/rules/js-min-max-loop.md 2.1 KB
- references/rules/js-set-map-lookups.md 532 B
- references/rules/js-tosorted-immutable.md 1.7 KB
- references/rules/rendering-activity.md 564 B
- references/rules/rendering-animate-svg-wrapper.md 1.2 KB
- references/rules/rendering-conditional-render.md 983 B
- references/rules/rendering-content-visibility.md 822 B
- references/rules/rendering-hoist-jsx.md 819 B
- references/rules/rendering-hydration-no-flicker.md 2.3 KB
- references/rules/rendering-svg-precision.md 591 B
- references/rules/rerender-defer-reads.md 973 B
- references/rules/rerender-dependencies.md 827 B
- references/rules/rerender-derived-state.md 724 B
- references/rules/rerender-lazy-state-init.md 2.0 KB
- references/rules/rerender-memo.md 935 B
- references/rules/rerender-transitions.md 1.0 KB
- references/rules/server-cache-lru.md 1011 B
- references/rules/server-cache-react.md 679 B
- references/rules/server-parallel-fetching.md 1.5 KB
- references/rules/server-serialization.md 826 B
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.
- 2mo ago First seen · 107 lines · 65 tokens per session scan A f6e6e80abc3c
react-best-practices is a skill published in the GitHub repository koolamusic/claudefiles (118 stars, last pushed yesterday), licensed MIT. It adds 65 tokens to every session and 795 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to react-best-practices, differing in 0 lines, and is treated as a copy.
react-best-practices compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| react-best-practiceskoolamusic/claudefiles | Skill | 118 | yesterday | MIT | A | 65 | Claude Code, Codex |
| build-ghost-appTryGhost/Ghost | Skill | 56k | today | MIT | A | 44 | Claude Code, Codex |
| material-ui-tailwindmui/material-ui | Skill | 99k | yesterday | MIT | A | 67 | Claude Code, Codex |
| fuzzy-rankingTanStack/table | Skill | 29k | 8d ago | MIT | A | 62 | Claude Code, Codex |
| r3f-best-practiceszebbern/claude-code-guide | Skill | 4.7k | today | MIT | A | 74 | Claude Code, Codex |
| git-safetytamagui/tamagui | Skill | 14k | yesterday | MIT | A | 42 | Claude Code |
| onchainkitalsk1992/CloddsBot | Skill | 3.1k | 19d ago | MIT | A | 24 | Claude Code, Codex |