Borrowing it
Nothing to install: this file belongs to boshi-xixixi/TraeSkill. 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/boshi-xixixi/TraeSkill/main/.trae/Skills/03_Developer_ReactBestPractices/SKILL.mdgit clone --depth 1 https://github.com/boshi-xixixi/TraeSkillWrote 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/boshi-xixixi/traeskill/03_developer_reactbestpractices)<a href="https://agentmods.dev/skills/boshi-xixixi/traeskill/03_developer_reactbestpractices"><img src="https://agentmods.dev/badge/skills/boshi-xixixi/traeskill/03_developer_reactbestpractices/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/boshi-xixixi/traeskill/03_developer_reactbestpractices"><img src="https://agentmods.dev/badge/skills/boshi-xixixi/traeskill/03_developer_reactbestpractices.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.00092 | $0.02836 |
| Opus 5.5 | $0.00037 | $0.01134 |
| Sonnet 5.5 | $0.00018 | $0.00567 |
| Haiku 4.5 | $0.00009 | $0.00284 |
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 8d 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.
This is a copy
78% identical to react-performance — 319 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 404 lines — stays where its author put it; the contents beside it link to each section on GitHub.
⚠️ 性能提示: 此 Skill 包含 45 个 rules 文件(L1 ~50KB),专注于 React 性能优化。请根据实际场景选择性应用规则,优先处理 CRITICAL 和 HIGH 优先级的规则。
Vercel React Best Practices
Comprehensive performance optimization guide for React and Next.js applications, maintained by Vercel. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
动画性能规范(Animation Performance)
在 React 应用中实现高性能动画,遵循 compositor-only 原则。
核心原则
浏览器可以在 compositor thread 上独立于主线程处理两种属性:
- ✅
transform - ✅
opacity
所有其他属性(width, height, top, left, background 等)必须在主线程上计算,可能导致卡顿。
只允许的属性
/* ✅ 允许:transform */
transform: translateX(100px);
transform: scale(1.1);
transform: rotate(45deg);
transform: skewX(10deg);
/* ✅ 允许:opacity */
opacity: 0;
opacity: 1;
禁止的属性
/* ❌ 禁止:布局属性 */
width: 100%;
height: 200px;
top: 0;
left: 0;
margin: 10px;
padding: 20px;
/* ❌ 禁止:可能触发布局的属性 */
background-color: red;
border: 1px solid black;
color: blue;
动画实现示例
// ❌ 不合规:使用 height 动画
function ExpandingBox() {
const [isExpanded, setIsExpanded] = useState(false);
return (
<div
style={{
height: isExpanded ? '200px' : '50px',
transition: 'height 0.3s ease'
}}
>
内容
</div>
);
}
// ✅ 合规:使用 transform 和 max-height
function ExpandingBox() {
const [isExpanded, setIsExpanded] = useState(false);
return (
<div
style={{
maxHeight: isExpanded ? '200px' : '50px',
overflow: 'hidden',
transition: 'max-height 0.3s ease'
}}
>
内容
</div>
);
}
// ✅ 最佳:纯 transform
function ExpandingBox() {
const [isExpanded, setIsExpanded] = useState(false);
return (
<button onClick={() => setIsExpanded(!isExpanded)}>
<span style={{
transform: isExpanded ? 'rotate(180deg)' : 'rotate(0)',
transition: 'transform 0.3s ease'
}}>
▼
</span>
内容
</button>
);
}
React 动画库使用规范
Framer Motion / Motion
// ✅ 合规:使用 motion.div
import { motion } from 'framer-motion';
function AnimatedComponent() {
return (
<motion.div
initial={{ opacity: 0, x: -100 }}
animate={{ opacity: 1, x: 0 }}
transition={{ duration: 0.5, ease: 'easeOut' }}
>
内容
</motion.div>
);
}
// ✅ 合规:使用 useTransform 限制属性
import { motion, useTransform } from 'framer-motion';
function ParallaxHeader() {
const scrollY = useScroll();
const y = useTransform(scrollY, [0, 500], [0, -200]);
return (
<motion.header style={{ y }}>
内容
</motion.header>
);
}
What ships with it
50 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 59 KB
- metadata.json 860 B
- README.md 3.3 KB
- rules/_sections.md 1.5 KB
- rules/_template.md 631 B
- rules/advanced-event-handler-refs.md 1.4 KB
- rules/advanced-use-latest.md 1.2 KB
- rules/async-api-routes.md 1.1 KB
- rules/async-defer-await.md 2.0 KB
- rules/async-dependencies.md 942 B
- rules/async-parallel.md 654 B
- rules/async-suspense-boundaries.md 2.5 KB
- rules/bundle-barrel-imports.md 2.3 KB
- rules/bundle-conditional.md 866 B
- rules/bundle-defer-third-party.md 920 B
- rules/bundle-dynamic-imports.md 791 B
- rules/bundle-preload.md 1.1 KB
- rules/client-event-listeners.md 1.9 KB
- rules/client-swr-dedup.md 1.1 KB
- rules/js-batch-dom-css.md 1.9 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 753 B
- rules/js-early-exit.md 1.1 KB
- rules/js-hoist-regexp.md 1.0 KB
- rules/js-index-maps.md 837 B
- rules/js-length-check-first.md 1.7 KB
- rules/js-min-max-loop.md 2.1 KB
- rules/js-set-map-lookups.md 532 B
- rules/js-tosorted-immutable.md 1.7 KB
- rules/rendering-activity.md 564 B
- rules/rendering-animate-svg-wrapper.md 1.2 KB
- rules/rendering-conditional-render.md 980 B
- rules/rendering-content-visibility.md 815 B
- rules/rendering-hoist-jsx.md 1.0 KB
- rules/rendering-hydration-no-flicker.md 2.3 KB
- rules/rendering-svg-precision.md 588 B
- rules/rerender-defer-reads.md 973 B
- rules/rerender-dependencies.md 824 B
- rules/rerender-derived-state.md 724 B
- rules/rerender-functional-setstate.md 2.9 KB
- rules/rerender-lazy-state-init.md 2.0 KB
- rules/rerender-memo.md 1.1 KB
- rules/rerender-transitions.md 1.0 KB
- rules/server-after-nonblocking.md 2.0 KB
- rules/server-cache-lru.md 1.3 KB
- rules/server-cache-react.md 681 B
- rules/server-parallel-fetching.md 1.5 KB
- rules/server-serialization.md 996 B
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.
- 8d ago First seen · 404 lines · 92 tokens per session scan A c354ab2c9e85
vercel-react-best-practices is a skill published in the GitHub repository boshi-xixixi/TraeSkill (288 stars, last pushed 9d ago), licensed MIT. It adds 92 tokens to every session and 2,836 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 78% identical to react-performance, differing in 319 lines, and is treated as a copy.
vercel-react-best-practices compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| vercel-react-best-practicesboshi-xixixi/TraeSkill | Skill | 288 | 9d ago | MIT | A | 92 | Claude Code, Codex |
| expo-app-initializerichkuo/rk-skills | Skill | 50 | today | MIT | A | 70 | Claude Code, Codex |
| android_ui_verificationranbot-ai/awesome-skills | Skill | 15 | yesterday | none | A | 22 | Claude Code, Codex |
| frontend-best-practicesWade-DevCode/awesome-coding-skills-cn | Skill | 7 | 5mo ago | MIT | A | 29 | Claude Code, Codex |
| ant-design-chartsIbook000/ibook-skill | Skill | 7 | 3d ago | none | A | 154 | Claude Code, Codex |
| frontend-architectSarthib7/agentsmith | Skill | 11 | 1mo ago | none | A | 81 | Claude Code, Codex |
| <skill-name>Lion-1209/Lion-Skills | Skill | 5 | 5mo ago | MIT | A | 82 | Claude Code |