vercel-labs/agent-skills

vercel-react-best-practicesvercel-labs/agent-skills

先消除请求瀑布和包体积问题,再处理局部重渲染

  • SKILL.md 已保存
  • 中文用法已整理
  • 安装与运行未实测
先判断是否解决你的问题

vercel-react-best-practices 是什么?

vercel-react-best-practices 是 Vercel 的 React/Next.js 性能规则入口,按影响优先覆盖请求瀑布、包体积、服务端和客户端数据读取,再处理重渲染、渲染与 JavaScript 开销。它适合代码审查和定向重构,而非给所有组件机械添加 memo。

中文说明由本站依据来源整理;英文原文保留在页面下方。

适合用在

  • 页面初次加载慢、独立请求串行等待、重组件进入首包,或交互被重复渲染拖慢。
按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 vercel-react-best-practices,然后按本页使用示例提供材料。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 vercel-react-best-practices

请在 Codex 的当前工作环境中安装并检查 vercel-react-best-practices 这个 Skill。

项目身份:vercel-labs/agent-skills / vercel-react-best-practices
来源:https://github.com/vercel-labs/agent-skills/blob/1a2c79d4e6c4a2283dc2c614b6538cbe1ed5ca62/skills/react-best-practices/SKILL.md
已定位的源文件:skills/react-best-practices/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
准备输入,再按步骤执行

装好以后,具体怎么用?

准备哪些材料

  • 提供目标页面、相关取数和组件代码、框架版本及可复现性能现象;具体规则反例和正确代码在 rules 与 AGENTS.md。

会得到什么

  • 对应实际性能问题的代码建议或改动,以及验证范围明确的前后证据。

实际使用顺序

  1. 先看数据依赖:独立操作可并行,真正依赖前一步的请求不能为凑并行而改变顺序。阅读 async-parallel、defer-await 或 suspense 对应规则。
  2. 检查入口与重依赖:直接导入、可静态分析的路径、按需动态加载和推迟第三方脚本分别依据 bundle 规则实施。
  3. 服务端关注认证、请求级去重、跨请求缓存范围、序列化与共享可变状态;客户端再检查重复监听、状态订阅与副作用。
  4. 以同一页面和任务比较修改前后的构建或浏览器证据,优先保留能解释收益的改动,不把低影响 JavaScript 微优化置于高影响问题之前。
使用示例

从一个具体任务开始

本站根据源文件编写的使用示例,未在本站实际运行。示例中的文件由你提供。

安装并识别 Skill 后发送

复制一个具体任务

教学示例:请用 vercel-react-best-practices 审查当前 Next.js 商品详情页。首屏需要商品与独立推荐数据,现有代码顺序 await;先核对真实依赖,阅读相关 async 规则,提出并行读取方案并检查异常处理,不改变用户权限或缓存语义。
预期结果

预期只将独立读取并行化,说明剩余依赖和实际验证方式;本站未测性能。

使用前先看这些限制

使用条件与边界

  • 入口中的优先级不等于每个项目都会获得同样收益。
  • React/Next.js版本、Server/Client边界和认证语义需要保留;缓存或并行修改不能以性能为由改变正确性。
针对这个 Skill 的疑问

常见问题

全部加 useMemo 能解决卡顿吗?

不能。源文件本身也提醒简单原始值不必 memo。先定位请求瀑布、包体积或实际昂贵渲染,再读对应规则。

需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-16T12:36:35.145Z
中文使用说明
已针对下方源文件版本整理用途、用法和常见问题
安装与任务测试
本站未执行安装或任务测试
来源复核
本页中文用法已对照保存版本的完整 SKILL.md 阅读整理
展开 SKILL.md 原文、章节与历史收录资料

skills/react-best-practices/SKILL.md · 抓取时间 2026-11-16T12:36:35.145Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

查看源文件章节 / Source sections
  • 原文:Vercel React Best Practices
  • 原文:When to Apply
  • 原文:Rule Categories by Priority
  • 原文:Quick Reference
  • 原文: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)
  • 原文:How to Use
  • 原文:Full Compiled Document
原文:Vercel React Best Practices

Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 70 rules across 8 categories, 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

原文: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-` |

原文:1. Eliminating Waterfalls (CRITICAL)

- `async-cheap-condition-before-await` - Check cheap sync conditions before awaiting flags or remote values - `async-defer-await` - Move await into branches where actually used - `async-parallel` - Use Promise.all() for independent operations - `async-dependencies` - Use better-all for partial dependencies - `async-api-routes` - Start promises early, await late in API routes - `async-suspense-boundaries` - Use Suspense to stream content

原文:2. Bundle Size Optimization (CRITICAL)

- `bundle-barrel-imports` - Import directly, avoid barrel files - `bundle-analyzable-paths` - Prefer statically analyzable import and file-system paths to avoid broad bundles and traces - `bundle-dynamic-imports` - Use next/dynamic for heavy components - `bundle-defer-third-party` - Load analytics/logging after hydration - `bundle-conditional` - Load modules only when feature is activated - `bundle-preload` - Preload on hover/focus for perceived speed

原文:3. Server-Side Performance (HIGH)

- `server-auth-actions` - Authenticate server actions like API routes - `server-cache-react` - Use React.cache() for per-request deduplication - `server-cache-lru` - Use LRU cache for cross-request caching - `server-dedup-props` - Avoid duplicate serialization in RSC props - `server-hoist-static-io` - Hoist static I/O (fonts, logos) to module level - `server-no-shared-module-state` - Avoid module-level mutable request state in RSC/SSR - `server-serialization` - Minimize data passed to client components - `server-parallel-fetching` - Restructure components to parallelize fetches - `server-parallel-nested-fetching` - Chain nested fetches per item in Promise.all - `server-after-nonblocking` - Use after() for non-blocking operations

文件 SHA256:71ed7794962fa6e803ee83030517b5b93a9f70fbfeb431ec4535c5480a8d8355

仓库许可证记录:未提供;skill-declaration-captured-not-interpreted,查看来源。

Skills.sh收录简介 · 2026-07-28

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js…

查看历史简介来源

这份历史简介在采集时已截断;完整用途和触发条件需打开来源核对。

历史收录数据

Skill标识vercel-react-best-practices
来源仓库vercel-labs/agent-skills
榜单快照2026-07-28
榜单口径Skills.sh累计安装量
快照名次5
快照累计安装量585177

历史资料说明

  • 所保留的来源简介在采集时已截断;完整触发条件、依赖及排除项须阅读源文件,本站不补写缺失部分。
  • 安装量用于说明当时的收录次序,不是效果、可信度或当前可用性的证明。

此页用于识别项目与来源。安装入口可在该Skill的Skills.sh页面查看;当前目录是否仍存在、附带脚本和账户依赖尚需按具体版本确认。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源