用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/theyoungastronauts/polaris --skill react命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | react |
| description | React and Next.js performance best-practices reference — 57 rules across 8 categories, prioritized by impact. |
| disable-model-invocation | true |
Adapted from vercel-labs/agent-skills
Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. 57 rules across 8 categories, prioritized by impact.
| 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- |
await into branches where actually usedPromise.all() for independent operationsbetter-all for partial dependenciesKey pattern: If two fetches don't depend on each other, run them in parallel:
// BAD: Sequential
const user = await getUser(id)
const posts = await getPosts(id)
// GOOD: Parallel
const [user, posts] = await Promise.all([getUser(id), getPosts(id)])
import { X } from './X' not from './index')next/dynamic for heavy componentsReact.cache() for per-request deduplicationafter() for non-blocking operationsKey pattern: Only send what the client needs:
// BAD: Passing entire object
<ClientComponent data={fullUserObject} />
// GOOD: Pick only needed fields
<ClientComponent name={user.name} avatar={user.avatar} />
setState for stable callbacksuseState for expensive valuesstartTransition for non-urgent updatesKey pattern: Derive state during render, not in effects:
// BAD: Effect to derive state
const [items, setItems] = useState([])
const [filteredItems, setFilteredItems] = useState([])
useEffect(() => { setFilteredItems(items.filter(i => i.active)) }, [items])
// GOOD: Derive during render
const [items, setItems] = useState([])
const filteredItems = items.filter(i => i.active)
content-visibility for long lists&& for conditionalsuseTransition for loading statecssTextMap for repeated lookupsfilter/map into one loopSet/Map for O(1) lookupstoSorted() for immutabilityuseLatest for stable callback refsFor full rule explanations with detailed code examples, install the original skill:
npx skills add https://github.com/vercel-labs/agent-skills --skill vercel-react-best-practices
Individual rule files are available at rules/<rule-name>.md in the original repo.