react-doctor
它能做什么
它运行一个扫描器,检查 React 代码中的安全、性能、正确性和结构问题。适用于希望在提交更改前保持 React 应用健康的开发者。
适用场景
- ✓当你完成一个 React 功能或错误修复,想在提交前检查时。
- ✓当你想彻底清理 React 项目中的警告时。
- ✓当你输入 /doctor 以开始对 React 问题进行完整分诊时。
技能链接
https://github.com/humanlayer/humanlayer/blob/main/.claude/skills/react-doctor/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请扫描我的 React 应用,并优先修复最严重的问题。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会运行 react-doctor 扫描器,它会给出 0 到 100 的健康评分,然后按严重程度从高到低处理问题。对于完整的分诊,它会遵循该工具的在线操作手册。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
React Doctor
Scans React codebases for security, performance, correctness, and architecture issues. Outputs a 0–100 health score.
After making React code changes:
Run npx react-doctor@latest --verbose --scope changed and check the score did not regress.
If the score dropped, fix the regressions before committing.
For general cleanup or code improvement:
Run npx react-doctor@latest --verbose (the default --scope full) to scan the full codebase. Fix issues by severity — errors first, then warnings.
/doctor — full local triage workflow
When the user types /doctor, says "run react doctor", or asks for a full triage / cleanup pass (not just a regression check), fetch the canonical local-triage playbook and follow every step in it:
curl --fail --silent --show-error \
--header 'Cache-Control: no-cache' \
https://www.react.doctor/prompts/react-doctor-agent.md
The playbook is the single source of truth — a scan → filter → triage → fix → validate loop that edits the working tree directly (never commits, never opens PRs). Updating the prompt at its source updates every agent on its next fetch — no skill reinstall needed.
Pair it with the matching per-rule prompts at https://www.react.doctor/prompts/rules/<plugin>/<rule>.md (fetched on demand inside the playbook) so each fix uses the canonical, reviewer-tested recipe.
Configuring or explaining rules
When the user wants to understand a rule, disagrees with one, or wants to disable / tune which rules run (not fix code), read references/explain.md and follow it. Start with npx react-doctor@latest rules explain <rule>, then apply the narrowest control via npx react-doctor@latest rules disable|set|category|ignore-tag …, which edits your doctor.config.* (or package.json#reactDoctor).
Command
npx react-doctor@latest --verbose --scope changed
| Flag | Purpose |
|---|---|
. |
Scan current directory |
--verbose |
Show affected files and line numbers per rule |
--scope changed |
Only report issues introduced vs the base branch (default: full) |
--scope lines |
Only report issues on the changed lines |
--score |
Output only the numeric score |
常见问题
它需要先安装吗?
不需要。它通过 npx 运行,所以智能体在运行时才会获取扫描器。
它会把更改提交到 git 吗?
不会。完整分诊流程只编辑工作文件,从不提交或发起拉取请求。
这个评分是什么意思?
它是一个 0 到 100 的健康评分。修改后,智能体会检查评分没有下降。
详情
作者的原始描述
Use when finishing a feature, fixing a bug, before committing React code, or when the user types `/doctor`, asks to scan, triage, or clean up React diagnostics. Covers lint, accessibility, bundle size, architecture. Includes a regression check and a full local-triage workflow that fetches the canonical playbook.
repo: humanlayer/humanlayer
热度
- GitHub 星标
- 13k
- 排名
- #11390
- 许可证
- Apache-2.0
- 更新时间
- 2026/10/31
评论
- …
同一仓库的更多技能
asd-ste100
13k教你的智能体把难懂的英文改写成短句、每句只有一个意思,方便人和其他软件阅读。
better-github-skill
13k帮你的智能体查看拉取请求的状态、阅读其审查评论,并借助现成的 GitHub 脚本找出 CI 构建失败的原因。
calldiff
13k帮你的智能体比较代码库中两个 git 版本之间的函数调用链,让代码审查能看出行为发生了什么变化。
chrome-devtools-cli
13k帮你的智能体通过终端控制 Chrome,打开页面、点击、填写表单,并截取页面快照,用于浏览器自动化和测试。