rule-writing

Implement custom linting rules for React Doctor with diagnostic contracts and adversarial tests.

14.3k|455|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/millionco/react-doctor --skill rule-writing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rule-writing
Source: https://github.com/millionco/react-doctor/tree/main/.agents/skills/rule-writing
Command: npx skills add https://github.com/millionco/react-doctor --skill rule-writing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the complex process of authoring, testing, and registering new React Doctor rules, ensuring consistency and adherence to the project's strict diagnostic contracts.

Core Features & Use Cases

  • Contract-Driven Development: Enforces the implementation of validated rule contracts to prevent logic drift.
  • Adversarial Testing: Guides the creation of both valid and invalid test cases to ensure detector accuracy.
  • Use Case: When a developer needs to add a new performance linting rule, this Skill provides the exact workflow to plan the detector, reuse existing syntax utilities, and register the rule within the repository.

Quick Start

Use the rule-writing skill to generate a new detector for the identified React performance issue by following the established contract and testing protocols.

Frequently Asked Questions about rule-writing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create custom linting rules for React performance issues?

You create custom linting rules for React performance by implementing syntax-aware detectors for state and effect issues, guided by validated diagnostic contracts and adversarial testing. This enforces strict detector accuracy and prevents logic drift.

What is the best way to ensure my custom linting rules match existing repository patterns?

The best way to match existing repository patterns is by strictly adhering to the framework's established registration patterns and reusing existing syntax utilities. This maintains repository integrity while standardizing your new linting rule detectors.

Does this rule creation workflow support both JavaScript and TypeScript codebases?

Yes, the rule creation workflow supports both JavaScript and TypeScript codebases. It facilitates the development of syntax-aware detectors designed to identify state, effect, and performance issues across these environments.

How do I test custom static analysis rules to prevent false positives?

You test custom static analysis rules to prevent false positives by using adversarial testing. This approach guides the creation of both valid and invalid test cases, ensuring your linting detectors are highly accurate for the targeted React issues.

When do I need to use contract-driven development for linting rule creation?

You need contract-driven development for linting rule creation when authoring new rules to prevent logic drift. It enforces the implementation of validated diagnostic contracts, ensuring consistent behavior when detecting state, effect, and performance issues.