React Doctor

作者 brianlovin1a9819ebf3fe无许可证376 个星标收录于 2026年10月8日更新于 2026年10月8日仓库6个月前更新

Diagnose and fix React codebase health issues. Use when reviewing React code, fixing performance problems, auditing security, or improving code quality.

AI 生成的概览

诊断 React 代码库在安全、性能、正确性和架构方面的健康问题,并给出 0-100 分。

功能
扫描 React 代码库中的安全、性能、正确性、架构、Next.js、打包体积、服务端、无障碍和死代码问题。它会输出带文件路径和行号的诊断结果,并给出 0-100 分及严重程度分级。工作流程是先运行扫描,优先修复错误,再重新运行以确认分数提升。
适用场景
适用于审查 React 代码、修复性能问题、审计安全性或提升整体代码质量。也适合在重构前后对项目做一次整体健康检查。
运行要求
需要 Node.js 和 npx,并具备网络访问以获取 react-doctor 包。该技能不包含脚本,仅为说明文档。

React Doctor

Scans your React codebase for security, performance, correctness, and architecture issues. Outputs a 0-100 score with actionable diagnostics.

Usage

bash
npx -y react-doctor@latest . --verbose

Workflow

  1. Run the command above at the project root
  2. Read every diagnostic with file paths and line numbers
  3. Fix issues starting with errors (highest severity)
  4. Re-run to verify the score improved

Rules (47+)

  • Security: hardcoded secrets in client bundle, eval()
  • State & Effects: derived state in useEffect, missing cleanup, useState from props, cascading setState
  • Architecture: components inside components, giant components, inline render functions
  • Performance: layout property animations, transition-all, large blur values
  • Correctness: array index as key, conditional rendering bugs
  • Next.js: missing metadata, client-side fetching for server data, async client components
  • Bundle Size: barrel imports, full lodash, moment.js, missing code splitting
  • Server: missing auth in server actions, blocking without after()
  • Accessibility: missing prefers-reduced-motion
  • Dead Code: unused files, exports, types

Score

  • 75+: Great
  • 50-74: Needs work
  • 0-49: Critical

来源与署名

来源:brianlovin/agent-config位于skills/react-doctor提交1a9819e

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架