Token导航 LogoToken导航TokenDH.com
前端设计操作浏览器github未标认证来源可访问许可证需确认审计通过

react-code-reviewerReact 代码 reviewer

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

321

周安装

13

GitHub Stars

2

下载量

101
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:react-code-reviewer(React 代码 reviewer)
来源仓库:https://github.com/masanao-ohba/claude-manifests
仓库路径:skills/react-code-reviewer
安装命令:
npx skills add https://github.com/masanao-ohba/claude-manifests --skill react-code-reviewer
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/masanao-ohba/claude-manifests --skill react-code-reviewer

简介

专注于 React 代码审查,帮助发现潜在问题和改进点。

  • 适合审查组件实现、交互逻辑及样式一致性。
  • 可集成到 Next.js、Vue 等框架项目中辅助开发。
  • 建议结合 Tailwind CSS 等工具链进行完整验证。
  • 输出结果需人工复核以确保符合业务需求。react-code-reviewer 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

React Code Review Guidelines

Review Categories

Component Architecture

Server vs Client

Red Flags:

  • 'use client' on component that doesn't use hooks or browser APIs
  • Server Component trying to use hooks
  • Client Component doing data fetching that should be on server

Good Practices:

  • Server Components for data fetching and static content
  • 'use client' only when necessary (hooks, events, browser APIs)
  • Client Components receive data as props from Server Components

Component Structure

Issues:

  • Component exceeds 300 lines (consider splitting)
  • Multiple responsibilities in one component
  • Deeply nested component tree (> 5 levels)
  • Repeated code that could be extracted to hook

Look For:

  • Single responsibility principle
  • Proper component composition
  • Extracted custom hooks for reusable logic

TypeScript Usage

Type Safety

Issues:

  • Use of 'any' without explanation comment
  • Type assertions (as Type) without justification
  • Non-null assertions (!) without null checks
  • Missing prop types (implicit any)
  • Missing return type on exported functions

Best Practices:

  • All props have interface definitions
  • Generic types for reusable components
  • Discriminated unions for complex state
  • Proper utility type usage (Partial, Pick, Omit)

Naming

Check:

  • PascalCase for components and types
  • camelCase for variables and functions
  • Descriptive names (avoid single letters except in maps)
  • Hooks prefixed with 'use'

State Management

React State

Issues:

  • Using state for derived values (should use useMemo)
  • Prop drilling more than 2 levels (consider Context)
  • State that could be computed from props
  • Missing useCallback for functions passed to children

Patterns:

  • useState for local UI state
  • useReducer for complex state logic
  • Context for deeply nested props
  • Zustand for global client state
  • React Query for server state

Side Effects

Common Issues:

  • useEffect with missing dependencies
  • useEffect without cleanup function (subscriptions)
  • Infinite loops from state updates in useEffect
  • Side effects in render (should be in useEffect)

Verify:

  • All useEffect dependencies listed correctly
  • Cleanup functions for subscriptions/timers
  • No state updates during render

Performance

Optimization

Unnecessary Optimization:

  • React.memo on simple components
  • useMemo for cheap calculations
  • useCallback everywhere (premature optimization)

Missing Optimization:

  • Expensive calculations without useMemo
  • Functions recreated on every render passed to children
  • Large lists without virtualization
  • No code splitting for large components

Re-renders

Check:

  • Inline object creation in props ({} in JSX)
  • Inline array creation in props ([] in JSX)
  • Inline function definitions in JSX
  • Context value not memoized

Error Handling

Coverage

Missing:

  • No error handling for async operations
  • No loading states for data fetching
  • Missing error boundaries
  • Silent error catching (empty catch blocks)

Good Practices:

  • Loading, error, and success states all handled
  • Error boundaries around route segments
  • User-friendly error messages
  • Retry mechanisms for failed requests

Accessibility

Requirements

Critical Issues:

  • Interactive elements without keyboard support
  • Missing alt text on images
  • Poor color contrast ratios
  • Missing ARIA labels on custom controls
  • Improper heading hierarchy

Verify:

  • All buttons/links keyboard accessible
  • Form inputs have labels
  • Semantic HTML used appropriately
  • Focus management in modals/dialogs

Styling

Tailwind

Issues:

  • Extremely long className strings (extract to component)
  • Repeated utility combinations (create component)
  • Hard-coded colors not from theme
  • Magic numbers in spacing (use spacing scale)

Best Practices:

  • Use theme colors and spacing
  • Responsive classes for mobile-first design
  • Conditional classes with clsx/classnames

CSS Modules

Check:

  • Scoped styles don't leak globally
  • No!important flags (indicates specificity issue)
  • Consistent naming convention

Data Fetching

React Query

Issues:

  • Fetching in useEffect instead of React Query
  • Query keys not unique or not arrays
  • Missing error handling in queries
  • Not using mutation for state-changing operations

Verify:

  • Proper query key structure
  • Mutations for POST/PUT/DELETE
  • Query invalidation after mutations
  • Loading and error states handled

Server Components

Check:

  • Direct data fetching (no useEffect)
  • Async function declaration
  • Proper error handling with try-catch
  • Loading states via Suspense boundaries

Testing

Coverage

Missing:

  • No tests for components with logic
  • Only happy path tested
  • Implementation details tested instead of behavior
  • Missing edge case tests

Verify:

  • User interactions tested
  • Loading and error states tested
  • Accessibility in tests (query by role/label)
  • Integration over unit tests

Security

Common Issues:

  • Dangerously setting innerHTML without sanitization
  • Unvalidated user input in URLs
  • Sensitive data in client components (should be server)
  • API keys/secrets exposed in client code

Verify:

  • User input sanitized before rendering
  • Authentication checks in appropriate places
  • Secrets kept on server side

Code Quality

Readability

Issues:

  • Unclear variable names
  • Complex nested ternaries
  • Large boolean expressions without extraction
  • No comments for complex logic

Improvements:

  • Extract complex conditions to variables
  • Use early returns to reduce nesting
  • Add JSDoc for public APIs

Consistency

Verify:

  • Consistent component declaration style (function vs const)
  • Consistent import order
  • Consistent naming conventions
  • Follows project conventions in CLAUDE.md

Review Process

Checklist

  • Component uses correct Server/Client designation
  • TypeScript types complete and accurate
  • State management appropriate for use case
  • Performance optimizations justified
  • Error handling comprehensive
  • Accessibility requirements met
  • Tests cover main user flows
  • Code follows project conventions

Severity Levels

Critical:

  • Security vulnerabilities
  • Accessibility blocking issues
  • Data loss possibilities

Major:

  • Type safety violations
  • Performance problems
  • Missing error handling

Minor:

  • Code style inconsistencies
  • Missing comments
  • Minor optimization opportunities

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.15%
按下载量换算37

Claude

28.33%
按下载量换算29

Cursor

18.68%
按下载量换算19

Gemini CLI

10.74%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills