nextjs-react-expert

A set of rules for improving React and Next.js applications. React is a JavaScript library for user interfaces, while Next.js is a framework built around React.

In plain words
What is it for?
Reviewing or changing React and Next.js code to reduce request delays, shrink bundles, improve server and client data loading, and limit needless re-rendering.
Why use it?
It helps find slow page loads, serial network requests, oversized browser downloads, slow server work, and unnecessary screen updates.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/misonl/ling/nextjs-react-expert
Any agent
npx skills add MisonL/Ling --skill nextjs-react-expert
Clone the repo
git clone --depth 1 https://github.com/MisonL/Ling

Made for: Claude Code, Codex.

Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,000 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00057 $0.03000
Opus 5 $0.00028 $0.01500
Sonnet 5 $0.00011 $0.00600
Haiku 4.5 $0.00006 $0.00300

Measured 2d ago against content hash a60cf6a51208, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nextjs-react-expert 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 2d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/convert_rules.py, scripts/react_performance_checker.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.agents/skills/nextjs-react-expert/SKILL.md · 287 lines

How it starts

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

Next.js 与 React 性能专家

来自 Vercel Engineering - 按影响优先级整理的 57 条优化规则
哲学: 先消除 waterfall,再优化 bundle,最后再做微优化。


选择性阅读规则(强制)

只阅读与当前任务相关的章节! 先看下面内容地图,再按需加载。

[CRITICAL] 进行性能评审时:先看 CRITICAL(1-2),再看 HIGH/MEDIUM。


内容地图

文件 影响等级 规则数 阅读时机
1-async-eliminating-waterfalls.md [CRITICAL] CRITICAL 5 条 页面加载慢、串行 API 调用、数据获取 waterfall(瀑布式请求)
2-bundle-bundle-size-optimization.md [CRITICAL] CRITICAL 5 条 bundle 体积过大、TTI 慢、首屏加载问题
3-server-server-side-performance.md HIGH 7 条 SSR 缓慢、API Route 优化、服务端 waterfall(瀑布式请求)
4-client-client-side-data-fetching.md [SUGGESTION] MEDIUM-HIGH 4 条 客户端数据管理、SWR 模式、请求去重
5-rerender-re-render-optimization.md [SUGGESTION] MEDIUM 12 条 过度重渲染、React 性能、memoization
6-rendering-rendering-performance.md [SUGGESTION] MEDIUM 9 条 渲染瓶颈、虚拟列表、图像优化
7-js-javascript-performance.md LOW-MEDIUM 12 条 微优化、缓存、循环性能
8-advanced-advanced-patterns.md VARIABLE 3 条 高级 React 模式、useLatest、init-once

总计:8 大类,共 57 条规则


快速决策树

你的性能问题属于哪一类?

 页面加载慢 / 可交互时间(Time to Interactive,TTI)长
  -> 阅读第 1 节:消除瀑布式请求(Eliminating Waterfalls)
  -> 阅读第 2 节:包体积优化(Bundle Size Optimization)

 bundle 体积过大(> 200KB)
  -> 阅读第 2 节:包体积优化(Bundle Size Optimization)
  -> 检查:动态导入(dynamic imports)、桶文件导入(barrel imports)、tree-shaking

 服务端渲染慢(SSR)
  -> 阅读第 3 节:服务端性能(Server-Side Performance)
  -> 检查:并行数据获取、streaming

[RUN]  重渲染过多 / UI 卡顿
  -> 阅读第 5 节:重渲染优化(Re-render Optimization)
  -> 检查:React.memo、useMemo、useCallback

 渲染性能问题
  -> 阅读第 6 节:渲染性能(Rendering Performance)
  -> 检查:虚拟化、layout thrashing

 客户端数据获取问题
  -> 阅读第 4 节:客户端数据获取(Client-Side Data Fetching)
  -> 检查:SWR 去重(deduplication)、localStorage

 需要高级模式
  -> 阅读第 8 节:高级模式(Advanced Patterns)

Read the full file on GitHub · 287 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. 2d ago First seen · 287 lines · 57 tokens per session scan A a60cf6a51208

Subscribe to this mod's changes

nextjs-react-expert is a skill published in the GitHub repository MisonL/Ling (9 stars, last pushed 5mo ago), licensed MIT. It adds 57 tokens to every session and 3,000 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-08-31.

Related

Other skills, from other repositories

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

row-selection

Maintain rowSelection ID state with stable getRowId, single, multi, subrow, and Shift-range rules, selected row models, handler anchors, and manual-pagination semantics. Load when implementing getToggleSelectedHandler, enableRowRangeSelection, selectChildren, deselectParents, or selected IDs that outlive loaded Row…

TanStack/table · 68 tokens

material-ui-tailwind

Integrates Material UI with Tailwind CSS v4 using cascade layers (enableCssLayer, @layer order) and documents Tailwind v3 interoperability (preflight, important, injectFirst, portals). Use when combining MUI with Tailwind utilities, slotProps className, or theme token bridges.

mui/material-ui · 67 tokens

r3f-best-practices

React Three Fiber (R3F) and Poimandres ecosystem best practices. Use when writing, reviewing, or optimizing R3F code. Triggers on tasks involving @react-three/fiber, @react-three/drei, zustand, @react-three/postprocessing, @react-three/rapier, or leva.

zebbern/claude-code-guide · 74 tokens

wrdn-effect-promise-exit

Replace React/effect-atom mutation handlers that use promise-mode plus try/catch with promiseExit and explicit Exit handling. Use when lint or review flags try/catch around useAtomSet mutation calls, especially UI handlers that set error/busy state after a failed mutation.

UsefulSoftwareCo/executor · 63 tokens

assistant-ui-primitives

Guide for assistant-ui UI primitives - ThreadPrimitive, ComposerPrimitive, MessagePrimitive. Use when customizing chat UI components.

compozy/compozy · 28 tokens