Implement React Doctor rules from a validated contract. Use when writing oxlint rules, planning syntax or control-flow detection, designing adversarial tests, r
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-rule-writing-75302b605800 ,按照其中的说明把「rule-writing」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Implement the rule-research contract. If none exists, define a compact contract before editing.
State the diagnostic condition, required syntax and bindings, unsupported cases, and adversarial tests. Keep this plan short when the user already requested implementation.
Before adding a helper, search for one to reuse:
bunx @rayhanadev/truffler "<symbol-or-behavior>" \
packages/oxlint-plugin-react-doctor/src/plugin \
--kind function,interface,type,constant --limit 20
Read docs/HOW_TO_WRITE_A_RULE.md, nearby rules, utilities, and tests.
rde-eval when real-code feedback could expose noise.rule-validate.Account for:
Keep uncertain cases quiet. Match the message to the condition the detector proves.
Use @antfu/ni commands:
nr test
nr lint
nr typecheck
nr format
nr smoke:json-report
Use focused commands while iterating. Record each command that ran.
Report changed rules, tests, registration, reused or added utilities, reported behavior, intentional non-goals, and validation results. End with the rule-validate handoff.