Agent Skills › millionco/react-doctor › rule-writing

rule-writing

GitHub

用于编写和实现 oxlint React Doctor 规则。涵盖规划检测逻辑、复用语法树工具、编写对抗性测试、执行仓库检查及验证结果,确保规则符合规范并处理复杂代码场景。

.agents/skills/rule-writing/SKILL.md millionco/react-doctor

Trigger Scenarios

编写 oxlint 规则 设计规则检测逻辑 运行规则相关测试与检查

Install

npx skills add millionco/react-doctor --skill rule-writing -g -y
More Options

Non-standard path

npx skills add https://github.com/millionco/react-doctor/tree/main/.agents/skills/rule-writing -g -y

Use without installing

npx skills use millionco/react-doctor@rule-writing

指定 Agent (Claude Code)

npx skills add millionco/react-doctor --skill rule-writing -a claude-code -g -y

安装 repo 全部 skill

npx skills add millionco/react-doctor --all -g -y

预览 repo 内 skill

npx skills add millionco/react-doctor --list

SKILL.md

Frontmatter
{
    "name": "rule-writing",
    "description": "Implement React Doctor rules from a validated contract. Use when writing oxlint rules, planning syntax or control-flow detection, designing adversarial tests, reusing syntax tree utilities, or updating rule registration."
}

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:

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:

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.

Version History

  • 4fbab2d Current 2026-07-25 11:11

Same Skill Collection

.agents/skills/benchmark-fp-fn-audit/SKILL.md
.agents/skills/deslop/SKILL.md
.agents/skills/find-similar-functions/SKILL.md
.agents/skills/fuzz/SKILL.md
.agents/skills/rde-eval/SKILL.md
.agents/skills/react-doctor/SKILL.md
.agents/skills/rule-research/SKILL.md
.agents/skills/rule-validate/SKILL.md
.agents/skills/run-parity/SKILL.md
.agents/skills/ship/SKILL.md
.agents/skills/writing-guidelines/SKILL.md
skills/improve-threejs/SKILL.md
skills/performance/SKILL.md
skills/react-doctor/SKILL.md
.agents/skills/product-thinking/SKILL.md
skills/improve-react/SKILL.md

Metadata

Files
0
Version
84ad0c8
Hash
c59b6e24
Indexed
2026-07-25 11:11

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-25 07:39
浙ICP备14020137号-1