Agent Skillsmillionco/react-doctor › rule-writing

rule-writing

GitHub

用于编写和实现 React Doctor oxlint 规则。涵盖检测器规划、代码实现、对抗性测试、工具复用及仓库检查,确保规则符合契约并处理复杂语法场景。

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

触发场景

编写新的 oxlint 规则 设计规则检测逻辑 运行 lint 相关测试

安装

npx skills add millionco/react-doctor --skill rule-writing -g -y
更多选项

非标准路径

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

不安装直接使用

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.

版本历史

  • 4fbab2d 当前 2026-07-25 11:11

同 Skill 集合

.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

元信息

文件数
0
版本
3ff37f3
Hash
c59b6e24
收录时间
2026-07-25 11:11

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 23:18
浙ICP备14020137号-1 $访客地图$