Borrowing it
Nothing to install: this file belongs to FranRom/pupila. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/FranRom/pupila/main/.agents/skills/react-best-practices/SKILL.mdgit clone --depth 1 https://github.com/FranRom/pupilaWrote 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/franrom/pupila/react-best-practices)<a href="https://agentmods.dev/skills/franrom/pupila/react-best-practices"><img src="https://agentmods.dev/badge/skills/franrom/pupila/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/franrom/pupila/react-best-practices"><img src="https://agentmods.dev/badge/skills/franrom/pupila/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.00067 | $0.01739 |
| Opus 5.5 | $0.00027 | $0.00696 |
| Sonnet 5.5 | $0.00013 | $0.00348 |
| Haiku 4.5 | $0.00007 | $0.00174 |
Grade A, and why
vercel-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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Vercel React Best Practices
Perf optimization guide for React/Next.js, by Vercel. 70 rules across 8 categories, prioritized by impact.
When to Apply
Reference when:
- Writing new React components / Next.js pages
- Implementing data fetching (client or server)
- Reviewing code for perf issues
- Refactoring React/Next.js code
- Optimizing bundle size / load times
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- |
Quick Reference
1. Eliminating Waterfalls (CRITICAL)
async-cheap-condition-before-await- Check cheap sync conditions before awaiting flags/remote valuesasync-defer-await- Move await into branches where usedasync-parallel-Promise.all()for independent opsasync-dependencies- better-all for partial depsasync-api-routes- Start promises early, await late in API routesasync-suspense-boundaries- Suspense to stream content
2. Bundle Size Optimization (CRITICAL)
bundle-barrel-imports- Import directly, avoid barrel filesbundle-analyzable-paths- Statically analyzable import/FS paths — avoid broad bundles/tracesbundle-dynamic-imports-next/dynamicfor heavy componentsbundle-defer-third-party- Load analytics/logging post-hydrationbundle-conditional- Load modules only when feature activatesbundle-preload- Preload on hover/focus for perceived speed
3. Server-Side Performance (HIGH)
server-auth-actions- Authenticate server actions like API routesserver-cache-react-React.cache()for per-request dedupserver-cache-lru- LRU cache for cross-request cachingserver-dedup-props- Avoid duplicate serialization in RSC propsserver-hoist-static-io- Hoist static I/O (fonts, logos) to module levelserver-no-shared-module-state- Avoid module-level mutable request state in RSC/SSRserver-serialization- Minimize data to client componentsserver-parallel-fetching- Restructure components to parallelize fetchesserver-parallel-nested-fetching- Chain nested fetches per item inPromise.allserver-after-nonblocking-after()for non-blocking ops
What ships with it
60 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.
- AGENTS.md 99 KB
- metadata.json 921 B
- README.md 2.7 KB
- rules/_sections.md 1.3 KB
- rules/_template.md 489 B
- rules/advanced-effect-event-deps.md 1.6 KB
- rules/advanced-event-handler-refs.md 1.3 KB
- rules/advanced-init-once.md 888 B
- rules/advanced-use-latest.md 1.0 KB
- rules/async-api-routes.md 1.0 KB
- rules/async-cheap-condition-before-await.md 1.1 KB
- rules/async-defer-await.md 2.0 KB
- rules/async-dependencies.md 1.2 KB
- rules/async-parallel.md 602 B
- rules/async-suspense-boundaries.md 2.3 KB
- rules/bundle-analyzable-paths.md 2.1 KB
- rules/bundle-barrel-imports.md 2.4 KB
- rules/bundle-conditional.md 925 B
- rules/bundle-defer-third-party.md 909 B
- rules/bundle-dynamic-imports.md 789 B
- rules/bundle-preload.md 1.1 KB
- rules/client-event-listeners.md 1.9 KB
- rules/client-localstorage-schema.md 1.9 KB
- rules/client-passive-event-listeners.md 1.5 KB
- rules/client-swr-dedup.md 1.1 KB
- rules/js-batch-dom-css.md 3.1 KB
- rules/js-cache-function-results.md 1.9 KB
- rules/js-cache-property-access.md 532 B
- rules/js-cache-storage.md 1.6 KB
- rules/js-combine-iterations.md 735 B
- rules/js-early-exit.md 1.1 KB
- rules/js-flatmap-filter.md 1.3 KB
- rules/js-hoist-regexp.md 1022 B
- rules/js-index-maps.md 818 B
- rules/js-length-check-first.md 1.4 KB
- rules/js-min-max-loop.md 2.0 KB
- rules/js-request-idle-callback.md 2.5 KB
- rules/js-set-map-lookups.md 532 B
- rules/js-tosorted-immutable.md 1.6 KB
- rules/rendering-activity.md 543 B
- rules/rendering-animate-svg-wrapper.md 1.1 KB
- rules/rendering-conditional-render.md 931 B
- rules/rendering-content-visibility.md 800 B
- rules/rendering-hoist-jsx.md 936 B
- rules/rendering-hydration-no-flicker.md 2.1 KB
- rules/rendering-hydration-suppress-warning.md 800 B
- rules/rendering-resource-hints.md 2.4 KB
- rules/rendering-script-defer-async.md 1.8 KB
- rules/rendering-svg-precision.md 554 B
- rules/rendering-usetransition-loading.md 1.9 KB
- rules/rerender-defer-reads.md 966 B
- rules/rerender-dependencies.md 814 B
- rules/rerender-derived-state-no-effect.md 1.1 KB
- rules/rerender-derived-state.md 713 B
- rules/rerender-functional-setstate.md 2.5 KB
- rules/rerender-lazy-state-init.md 1.9 KB
- rules/rerender-memo-with-default-value.md 1001 B
- rules/rerender-memo.md 1.1 KB
- rules/rerender-move-effect-to-event.md 1.2 KB
- rules/rerender-no-inline-components.md 1.9 KB
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.
- 1mo ago First seen · 150 lines · 67 tokens per session scan A 916b4de00956
vercel-react-best-practices is a skill published in the GitHub repository FranRom/pupila (36 stars, last pushed yesterday), licensed MIT. It adds 67 tokens to every session and 1,739 once invoked, about $0.0003 per session on Opus 5.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-08-30.
Other skills, from other repositories
react-frontend
React, TypeScript, and Next.js patterns for frontend development. Use when building React components, managing state, fetching data, optimizing performance, or working with Next.js App Router. Covers React 18-19, hooks, Server Components, and type-safe patterns.
react-application-structure
Establishes or reviews the directory layout, feature boundaries, state design, routing approach, and data-fetching conventions for a React 18+ TypeScript application. Invoked when the user asks to structure a React app, set up a scalable architecture, or review React project organization.
next-application-structure
Establishes or reviews directory layout, server/client boundaries, routing, data-fetching strategy, and testing structure for Next.js 14+ App Router TypeScript applications. Invoked when the user asks to structure a Next app, set App Router conventions, or review architecture for React parity.
react-component-design
Designs or reviews React component APIs. Handles prop drilling decisions, composition patterns, controlled/uncontrolled contracts, and minimal public API surfaces for React 18+ TypeScript components. Invoked when creating new components, refactoring existing ones, or reviewing component contracts.
react-conventions
React + TypeScript frontend conventions — centralized API client, API services, state management, components, and file organization. Apply whenever writing or editing frontend .ts/.tsx code.
react-hook
Creates a custom React hook with TypeScript types, tests, and usage example.