做什么
在读取或写入 React 组件(.tsx, 有 React 导入的.jsx 文件)时使用.
技能库 智客分类:写作与研究 react-best-practices
在读取或写入 React 组件(.tsx, 有 React 导入的.jsx 文件)时使用.
官方网址:skills.sh
先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。
在读取或写入 React 组件(.tsx, 有 React 导入的.jsx 文件)时使用.
效果
按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:React Best Practices、Pair with TypeScript、Core Principle: Effects Are Escape Hatches、Decision Tree、When to Use Effects、When NOT to Use Effects。
文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。
Use when reading or writing React components (.tsx, .jsx files with React imports).
React Best PracticesPair with TypeScriptCore Principle: Effects Are Escape HatchesDecision TreeWhen to Use EffectsWhen NOT to Use EffectsRefsCustom HooksComponent Patterns
来源分类:skills.sh agent-skill
namereact-best-practicesdescription具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗
先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。
复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。
把 Agent Skill「react-best-practices」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-b385fdb760eac3fe-%E5%8F%8D%E5%BA%94%E6%9C%80%E4%BD%B3%E5%81%9A%E6%B3%95.html 请存为 .cursor/skills/react-best-practices/SKILL.md 或 .claude/skills/react-best-practices/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。
npx skills add 'https://github.com/alleneubank/claude-code' --list
npx skills add 'https://github.com/alleneubank/claude-code' --skill 'react-best-practices'
CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。
When working with React, always load both this skill and typescript-best-practices together. TypeScript patterns (type-first development, discriminated unions, Zod validation) apply to React code.
Effects let you "step outside" React to synchronize with external systems. Most component logic should NOT use Effects. Before writing an Effect, ask: "Is there a way to do this without an Effect?"
useMemokey propuseEffectEventSynchronizing with external systems: browser APIs (WebSocket, IntersectionObserver), third-party non-React libraries, window/document event listeners, non-React DOM elements (video, maps).
useMemokey propref.current during render; only in event handlers and effectsuseRef in loops) for dynamic listsuseImperativeHandle to limit what parent can accessuseXxx only if it actually calls other hooks; otherwise use a regular functionuseMount, useEffectOnce) — use useEffect directly so the linter catches missing depschildren over prop drillingisEditing, isThread, hideAttachments) as a composition smell; prefer separate composed components for distinct use casesflushSync when you need to read the DOM synchronously after a state updateSee react-patterns.md for code examples and detailed patterns.
写作与研究
从文本中删除 AI 生成的写入标记 。 编辑或审查文本时使用,使其声音更自然和人文写作. 基于维基百科的全面"AI写作的标志"指南. 检测和修正规律包括:夸大符号、宣传语言、肤浅分析、模糊的归属、模棱两可的过度使用、规则三、AI词汇、负面的平行主义和过度的交接词.
写作与研究
OpenClaw 的默认网络搜索 。 搜索网络跨越了10个引擎——Google,Reddit,GitHub,arXiv,Hacker News等——使用Prismfy. 包括免费等级,不需要信用卡。 包括用于网络搜索、配额检查和引擎/时间/域过滤器的捆绑 " search.sh …
写作与研究
监控博客和RSS/Atom的种子.
写作与研究
AI-优化了使用Tavily Search API的网络搜索. 需要全面网络研究,时事搜索,域名特定搜索,或AI生成的回答摘要时使用. Tavily是LLM消费的优化型,具有清洁的结构化结果,答案生成,以及原始内容提取. 最适合研究任务、新闻查询、实况调查和收集权威来源.