跳到主内容
智客 ZICQ

技能库 智客分类:Agent 工作流 typescript-react-reviewer

Typescript React Reviewer

TypeScript + React 19 应用程序的专家代码审查员. 用于审查反应代码,识别反标,评价国家管理,或评估代码的可维护性. 触发器:代码审查请求,PR审查, 反应架构评价,识别代码有气味,TypeScript类型安全检查,使用效果滥用检测,状态管理审查.

8999 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

TypeScript + React 19 应用程序的专家代码审查员

何时用

审查 反应代码,识别出反标,评价国家管理,或评估代码的可维护性. 触发器:代码审查请求,PR审查, 反应架构评价,识别代码嗅觉,TypeScript类型安全检查,使用效果滥用检测,状态人

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:TypeScript + React 19 Code Review Expert、Review Priority Levels、🚫 Critical (Block Merge)、⚠️ High Priority、📝 Architecture/Style、Quick Detection Patterns。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/react19-patterns.md、references/antipatterns.md、references/checklist.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Expert code reviewer for TypeScript + React 19 applications. Use when reviewing React code, identifying anti-patterns, evaluating state management, or assessing code maintainability. Triggers: code review requests, PR reviews, React architecture evaluation, identifying code smells, TypeScript type safety checks, useEffect abuse detection, state management review.

TypeScript + React 19 Code Review ExpertReview Priority Levels🚫 Critical (Block Merge)⚠️ High Priority📝 Architecture/StyleQuick Detection PatternsuseEffect Abuse (Most Common Anti-Pattern)React 19 Hook MistakesState Mutation DetectionTypeScript Red FlagsReview WorkflowReference Documents

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
typescript-react-reviewer
description
Expert code reviewer for TypeScript + React 19 applications. Use when reviewing React code, identifying anti-patterns, evaluating state management, or assessing code maintainability. Triggers: code review requests, PR reviews, React architecture evaluation, identifying code smells, TypeScript type safety checks, useEffect abuse detection, state management review.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 3
  • references/react19-patterns.md
  • references/antipatterns.md
  • references/checklist.md

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「typescript-react-reviewer」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-ff35794c1d4cd8a9-Typescript-React-Reviewer.html
请存为 .cursor/skills/typescript-react-reviewer/SKILL.md 或 .claude/skills/typescript-react-reviewer/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/dotneet/claude-code-marketplace 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/dotneet/claude-code-marketplace' --list

npx skills add 'https://github.com/dotneet/claude-code-marketplace' --skill 'typescript-react-reviewer'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: typescript-react-reviewer description: "Expert code reviewer for TypeScript + React 19 applications. Use when reviewing React code, identifying anti-patterns, evaluating state management, or assessing code maintainability. Triggers: code review requests, PR reviews, React architecture evaluation, identifying code smells, TypeScript type safety checks, useEffect abuse detection, state management review." --- # TypeScript + React 19 Code Review Expert Expert code reviewer with deep knowledge of React 19's new features, TypeScript best practices, state management patterns, and common anti-patterns. ## Review Priority Levels ### 🚫 Critical (Block Merge) These issues cause bugs, memory leaks, or architectural problems: | Issue | Why It's Critical | |-------|-------------------| | `useEffect` for derived state | Extra render cycle, sync bugs | | Missing cleanup in `useEffect` | Memory leaks | | Direct state mutation (`.push()`, `.splice()`) | Silent update failures | | Conditional hook calls | Breaks Rules of Hooks | | `key={index}` in dynamic lists | State corruption on reorder | | `any` type without justification | Type safety bypass | | `useFormStatus` in same component as `` | Always returns false (React 19 bug) | | Promise created inside render with `use()` | Infinite loop | ### ⚠️ High Priority | Issue | Impact | |-------|--------| | Incomplete dependency arrays | Stale closures, missing updates | | Props typed as `any` | Runtime errors | | Unjustified `useMemo`/`useCallback` | Unnecessary complexity | | Missing Error Boundaries | Poor error UX | | Controlled input initialized with `undefined` | React warning | ### 📝 Architecture/Style | Issue | Recommendation | |-------|----------------| | Component > 300 lines | Split into smaller components | | Prop drilling > 2-3 levels | Use composition or context | | State far from usage | Colocate state | | Custom hooks without `use` prefix | Follow naming convention | ## Quick Detection Patterns ### useEffect Abuse (Most Common Anti-Pattern) ```typescript // ❌ WRONG: Derived state in useEffect const [firstName, setFirstName] = useState(''); const [fullName, setFullName] = useState(''); useEffect(() => { setFullName(firstName + ' ' + lastName); }, [firstName, lastName]); // ✅ CORRECT: Compute during render const fullName = firstName + ' ' + lastName; ``` ```typescript // ❌ WRONG: Event logic in useEffect useEffect(() => { if (product.isInCart) showNotification('Added!'); }, [product]); // ✅ CORRECT: Logic in event handler function handleAddToCart() { addToCart(product); showNotification('Added!'); } ``` ### React 19 Hook Mistakes ```typescript // ❌ WRONG: useFormStatus in form component (always returns false) function Form() { const { pending } = useFormStatus(); return Send; } // ✅ CORRECT: useFormStatus in child component function SubmitButton() { const { pending } = useFormStatus(); return Send; } function Form() { return ; } ``` ```typescript // ❌ WRONG: Promise created in render (infinite loop) function Component() { const data = use(fetch('/api/data')); // New promise every render! } // ✅ CORRECT: Promise from props or state function Component({ dataPromise }: { dataPromise: Promise }) { const data = use(dataPromise); } ``` ### State Mutation Detection ```typescript // ❌ WRONG: Mutations (no re-render) items.push(newItem); setItems(items); arr[i] = newValue; setArr(arr); // ✅ CORRECT: Immutable updates setItems([...items, newItem]); setArr(arr.map((x, idx) => idx === i ? newValue : x)); ``` ### TypeScript Red Flags ```typescript // ❌ Red flags to catch const data: any = response; // Unsafe any const items = arr[10]; // Missing undefined check const App: React.FC = () => {}; // Discouraged pattern // ✅ Preferred patterns const data: ResponseType = response; const items = arr[10]; // with noUncheckedIndexedAccess const App = ({ prop }: Props) => {}; // Explicit props ``` ## Review Workflow 1. **Scan for critical issues first** - Check for the patterns in "Critical (Block Merge)" section 2. **Check React 19 usage** - See [react19-patterns.md](references/react19-patterns.md) for new API patterns 3. **Evaluate state management** - Is state colocated? Server state vs client state separation? 4. **Assess TypeScript safety** - Generic components, discriminated unions, strict config 5. **Review for maintainability** - Component size, hook design, folder structure ## Reference Documents For detailed patterns and examples: - **[react19-patterns.md](references/react19-patterns.md)** - React 19 new hooks (useActionState, useOptimistic, use), Server/Client Component boundaries - **[antipatterns.md](references/antipatterns.md)** - Comprehensive anti-pattern catalog with fixes - **[checklist.md](references/checklist.md)** - Full code review checklist for thorough reviews ## State Management Quick Guide | Data Type | Solution | |-----------|----------| | Server/async data | TanStack Query (never copy to local state) | | Simple global UI state | Zustand (~1KB, no Provider) | | Fine-grained derived state | Jotai (~2.4KB) | | Component-local state | useState/useReducer | | Form state | React 19 useActionState | ### TanStack Query Anti-Pattern ```typescript // ❌ NEVER copy server data to local state const { data } = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }); const [todos, setTodos] = useState([]); useEffect(() => setTodos(data), [data]); // ✅ Query IS the source of truth const { data: todos } = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }); ``` ## TypeScript Config Recommendations ```json { "compilerOptions": { "strict": true, "noUncheckedIndexedAccess": true, "noImplicitReturns": true, "exactOptionalPropertyTypes": true } } ``` `noUncheckedIndexedAccess` is critical - it catches `arr[i]` returning undefined. ## Immediate Red Flags When reviewing, flag these immediately: | Pattern | Problem | Fix | |---------|---------|-----| | `eslint-disable react-hooks/exhaustive-deps` | Hides stale closure bugs | Refactor logic | | Component defined inside component | Remounts every render | Move outside | | `useState(undefined)` for inputs | Uncontrolled warning | Use empty string | | `React.FC` with generics | Generic inference breaks | Use explicit props | | Barrel files (`index.ts`) in app code | Bundle bloat, circular deps | Direct imports |

相关技能

Agent 工作流

Skill Creator

创造有效技能指南。 当用户想创造出新的技能(或更新现有的技能),以专业知识,工作流程,或工具集成来扩展克洛德的能力时,应该使用这种技能.

Agent 工作流

Clawdhub

使用ClawdHub CLI搜索,安装,更新并发布从taladhub.com的代理技能. 需要获取苍蝇上的新技能时使用,将安装的技能同步到最新版本或特定版本,或者发布 npm-instainddhub CLI 的新/更新的技能文件夹.

Agent 工作流

Agent Team Orchestration

管弦乐团多代理团队,任务设定周期,交接协议,审查工作流程. 使用时间: (1)建立2+特派员队伍,具有不同专业,(2)确定任务路线和生命周期(收录框_ spec_建设_审查_完成),(3)在特派员之间制定交接协议,(4)建立审查和质量关口,(5)管理特派员之间的交流和文物共享.

Agent 工作流

Superpowers

Spec-first,TDD,子代理驱动的软件开发工作流程. 当:(1)构建任何新功能或应用——触发脑暴_计划_子代理执行回路,(2)调试出一个bug或测试失败——触发系统性的根起过程,(3)用户说"让我们构建","帮助我计划","我想添加X",或"这个被打破",(4)完成一个功…