vercel-react-best-practices
Skill119 starsChanged 5 months agoMITView on GitHub
Apply Vercel React performance guidance when implementing, reviewing, or optimizing the React chat widget, including data fetching, rendering, effects, and bundle size.
176 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- linx-systems/clamuitheir own version, first seen Nov 9, 2026
- CherryHQ/cherry-studiotheir own version, first seen Nov 8, 2026
- open-slide/open-slidetheir own version, first seen Nov 8, 2026
- JustinWangJP/cc-agent-teams-action-monitortheir own version, first seen Nov 8, 2026
- figueroaignacio/ignaciofigueroa.devtheir own version, first seen Nov 8, 2026
- dazeb/ClaudePlaybooktheir own version, first seen Nov 8, 2026
Used with
Projects with it also use dep-refs, feature-boundary-planner and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
betacatslingSkilldep-refs
Use when needs to inspect TypeScript export references in the z-code workspace, list exports from a file, verify whether an export is unused before deletion, investigate who imports a symbol during refactors, or combine pnpm knip unused-export results with pnpm dep:refs symbol-level reference tracing.
Also in 5 projects that use this
betacatslingSkillfeature-boundary-planner
Map a ZCode behavior change to current UI surfaces, state owners, protocol commands, persistence, and validation. Use for impact analysis, product-boundary planning, or an implementation handoff grounded in the checked-out source.
Also in 5 projects that use this
VercelSkillnext-upgrade
Upgrade Next.js to the latest version following official migration guides and codemods
Also in 12 projects that use this
SentrySkillvercel-composition-patterns
Also in 124 projects that use this
Cartograf666Skillarchitecture-governance
Bootstrap, document, enforce, and review a project's architecture through layer responsibilities, dependency direction, architecture manifests, legacy baselines, Change Envelopes, cross-layer approval policy, and deterministic architecture checks. Use when starting a project, auditing an existing codebase, planning cross-layer work, preventing architecture erosion, reviewing structural changes, or deciding whether implementation may expand into another layer.
Also in 5 projects that use this
VercelSkillnext-cache-components
Next.js 16 Cache Components - PPR, use cache directive, cacheLife, cacheTag, updateTag
Also in 17 projects that use this
- +3 more from vercel-labs
Other versions176 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- quran/quran.com-frontend-next★ 1.9k25% same
Wrote their own version · 175
- Significant-Gravitas/AutoGPT★ 188ksame name
- calesthio/OpenMontage★ 78ksame name
- OpenMontageInc/OpenMontage★ 78ksame name
- CherryHQ/cherry-studio★ 53ksame name
- QuantumNous/new-api★ 52ksame name
- vercel-labs/agent-skills★ 33ksame name
- udecode/plate★ 17ksame name
- open-metadata/OpenMetadata★ 16ksame name
- Arize-ai/phoenix★ 12ksame name
- trycompai/crm★ 12ksame name
165 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architecture-reviewSkill
- code-reviewSkill
- documentationSkill
- git-workflowSkill
- mcp-toolsSkill
- project-architectureSkill
- prompt-renderingSkill
- refactoringSkill
- runtime-engineSkill
- senior-python-engineeringSkill
- sidecar-auth-contextSkill
- skill-authoringSkill
- testingSkill
- yaml-schemaSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 172 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Do not edit this file directly.
- Distinctive: line 23
All paths in this playbook are relative to the repository root, including when reading a generated Codex or Claude adapter.
- Distinctive: line 61
Keep request-specific identity and credentials out of shared caches.
- Distinctive: line 62
Treat upstream examples as guidance.
- Distinctive: line 68
Read the relevant local rule files and existing widget implementation.
- Very specific: line 70
Run npm run typecheck:widget and npm run test:widget for widget changes.
- Very specific: line 71
Run npm run test:widget:e2e when changing browser interactions such as scrolling, focus, streaming, cancellation, or approvals.
- Distinctive: line 93
Use the AGENTS.md report format.
“Common” is measured: kept by at least 6 in 10 of the 172 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
This file is generated by tools/skills.
Do not edit this file directly.
Edit .ai/skills/vercel-react-best-practices.md and run `make generate-ai`.
-->Skill: Vercel React Best Practices
Purpose
Apply Vercel's performance guidance to Extra's React chat widget. The 70
upstream rules and examples are available locally under
.ai/references/vercel-react-best-practices/rules/; read the rules relevant
to the change rather than loading the entire collection.
All paths in this playbook are relative to the repository root, including when reading a generated Codex or Claude adapter.
When to Use This Skill
- Implementing or reviewing components under
src/agent_manager/api/static/widget/react/. - Changing widget effects, event listeners, state, or data fetching.
- Investigating slow rendering, unnecessary requests, or bundle growth.
Files to Read First
AGENTS.mdand.ai/skills/project-architecture.md.docs/WIDGET_ARCHITECTURE.mdanddocs/WIDGET.md.package.json, the components being changed, and their existing tests.- Relevant rules from the local reference directory, using this routing table:
| Concern | Rule prefix | Starting point |
| Sequential independent requests | async- | async-parallel.md |
| Unnecessary module loading | bundle- | bundle-conditional.md |
| Duplicate browser subscriptions | client- | client-event-listeners.md |
| Stale state or unnecessary renders | rerender- | rerender-functional-setstate.md, rerender-dependencies.md |
| Expensive rendering | rendering- | rendering-hoist-jsx.md, rendering-content-visibility.md |
| Repeated JavaScript work | js- | js-set-map-lookups.md, js-combine-iterations.md |
| Callback and initialization patterns | advanced- | advanced-event-handler-refs.md |
| Server rendering, if introduced separately | server- | server-no-shared-module-state.md |
Core Principles
- The shipped widget is React inside a custom element and Shadow DOM, bundled
with esbuild. Select rules that fit that environment; Next.js routing, RSC,
SSR caching, and
next/dynamicexamples do not justify adding Next.js. - Prioritize observable request waterfalls, bundle growth, and rendering costs
over speculative micro-optimizations. Match APIs to the installed React
version and esbuild browser target in
package.json. - Preserve custom-element attributes/events, Shadow DOM styling, stream ownership, cancellation, and approval behavior while optimizing components.
- Keep request-specific identity and credentials out of shared caches.
- Treat upstream examples as guidance. Add dependencies or abstractions only when the concrete change benefits from them.
Process
- Identify the affected interaction and its performance or correctness issue.
- Read the relevant local rule files and existing widget implementation.
- Make a focused change that preserves the widget's public behavior.
- Run
npm run typecheck:widgetandnpm run test:widgetfor widget changes. Runnpm run test:widget:e2ewhen changing browser interactions such as scrolling, focus, streaming, cancellation, or approvals. - Rebuild changed widget sources with
npm run build:widget, include the generatedsrc/agent_manager/api/static/widget.js, and runmake check.
Checklist Before Finishing
- Applied rules match Extra's React/custom-element architecture.
- The change fixes an observed problem or has a clear performance rationale.
- Effect cleanup, callback state, and active stream behavior remain correct.
- Relevant widget checks pass and the bundle is rebuilt when sources change.
make checkpasses.
Common Mistakes to Avoid
- Applying Next.js-specific examples directly to this browser-only widget.
- Adding blanket memoization or caching without identifying the expensive work.
- Optimizing rendering by removing lifecycle, ownership, or approval checks.
- Editing the built bundle directly or changing generated skill adapters by hand.
Expected Final Report
Use the AGENTS.md report format. State the affected interaction, relevant
rules, why the change helps, checks run, and any remaining performance limits.
Upstream Source
Adapted from Vercel React Best Practices,
by Vercel Engineering, version 1.0.0, at commit
063bee94c3f4df8453406c830b0a7df0f2860278. Upstream declares the MIT license
in its SKILL.md. The 70 local rule files are copies from that revision; the
entrypoint above supplies Extra's project context and commands.
Eleven rules carry local correctness and security corrections from review:
rendering-usetransition-loading (stale responses are ignored, since a
transition does not cancel requests), js-cache-function-results (pure,
bounded caches only), bundle-conditional and bundle-preload (a
typeof window guard does not affect bundling), server-cache-lru
(unambiguous scope-complete keys, and authorization before any cached value is
returned),
rendering-hydration-no-flicker (the class change is still a hydration
mismatch), async-api-routes (handled early starts and an authentication
exit), advanced-event-handler-refs and advanced-use-latest (Effect Events
are not stable),
js-cache-storage (cookie caches are reset, and cookie changes raise no
event), and server-after-nonblocking (work in after() is awaited, and
session cookies are not logged). Trailing whitespace was also removed from the
copied rules. Reapply these changes when updating from upstream.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

