millionco/react-doctor

rule-writing

Implement React Doctor rules from a validated contract.

查看源码
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Write a rule

Implement the rule-research contract. If none exists, define a compact contract before editing.

Plan the detector

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:

sh
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.

Implement and test

  1. Write detector pseudocode.
  2. Add adversarial valid and invalid tests.
  3. Implement only the contract's supported behavior.
  4. Reuse utilities before creating new ones.
  5. Update generated registration with repository commands.
  6. Run focused tests and package checks.
  7. Use rde-eval when real-code feedback could expose noise.
  8. Hand the finished change to rule-validate.

Account for:

  • import aliases and shadowed bindings
  • nested functions that do not execute immediately
  • transparent JavaScript and TypeScript wrappers
  • dynamic computed properties
  • imported or unresolved values
  • framework escape hatches
  • control-flow paths required by the diagnostic claim
  • regressions found by reviews or evals

Keep uncertain cases quiet. Match the message to the condition the detector proves.

Run repository checks

Use @antfu/ni commands:

sh
nr test
nr lint
nr typecheck
nr format
nr smoke:json-report

Use focused commands while iterating. Record each command that ran.

Report the implementation

Report changed rules, tests, registration, reused or added utilities, reported behavior, intentional non-goals, and validation results. End with the rule-validate handoff.

来自同一仓库

更多 Skills

全部 Skills
millionco
社区

improve-react

Survey a whole React codebase as a senior React engineer, using React Doctor's scan as evidence, then produce a prioritized audit and self-contained implementation plans for other agents (or cheaper models) to execute. Read-only on source code — it plans improvements, it does not apply them. Use when the user asks to "improve the React code", "audit this codebase", "make this app faster / more robust", or wants a roadmap of fixes rather than a review of a single diff. For a regression check or a fix-it-now pass, use the react-doctor skill instead.

安装量
2
GitHub Stars
1.5万
最近更新
9月3日
millionco
社区

react-doctor

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.

安装量
2
GitHub Stars
1.5万
最近更新
9月2日
millionco
社区

benchmark-fp-fn-audit

Audit React Doctor against ReactBench or similar diagnostic benchmark corpora for confirmed false positives, false negatives, taxonomy gaps, and verifier artifacts. Use when analyzing rd.log, rd-before.json, rd-after.json, model.patch, result.json, reward/test logs, rule distributions, or when asked to perform a second adversarial pass over React Doctor benchmark findings.

安装量
2
GitHub Stars
1.5万
最近更新
9月2日
millionco
社区

deslop

Simplify and refine recently modified code while preserving functionality. Use when asked to "deslop", "clean up code", "simplify code", or after making changes that could benefit from refinement.

安装量
2
GitHub Stars
1.5万
最近更新
9月2日