react-compiler-rules

Enforce React render-purity rules and side-channel separation in dean-stack projects.

1|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/matthewharwood/dean-stack --skill react-compiler-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-compiler-rules
Source: https://github.com/matthewharwood/dean-stack/tree/main/.claude/skills/react-compiler-rules
Command: npx skills add https://github.com/matthewharwood/dean-stack --skill react-compiler-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The React Compiler purity rules require that render functions remain pure and free of side effects. They prevent manual memoization tricks and ensure side-channel code runs only in effects, preserving predictable rendering in dean-stack apps.

Core Features & Use Cases

  • Enforce no manual memoization via useMemo/useCallback/React.memo; allow the Compiler to handle performance optimizations.
  • Separate side channels (anime.js, PixiJS) from render; use useAnime/usePixiApp hooks in useEffect.
  • Clarify Jotai usage: hooks in render are treated as pure subscribers; avoid using them to drive render mutations.
  • Provide alignment with the CLI-gate linting rules; fail gates on render purity violations.

Quick Start

Run the code audit with React Compiler enabled and remove manual memoization to rely on compiler-driven memoization.

Frequently Asked Questions about react-compiler-rules

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

FAQPage Schema
How do I enforce React Compiler render purity rules in my codebase?

To enforce React Compiler render purity rules, remove manual memoization via useMemo, useCallback, or React.memo and let the compiler handle optimizations. You must also separate side-channel code into useEffect to pass CLI-gate lint checks.

Why does manual memoization break React Compiler purity?

Manual memoization breaks React Compiler purity because render functions must remain free of side effects. The compiler automatically handles performance optimizations, making useMemo, useCallback, and React.memo unnecessary and prohibited under strict lint rules.

How do I separate side-channel animations like anime.js and PixiJS from React render?

To separate side-channel animations from React render, move anime.js and PixiJS logic into useEffect using useAnime or usePixiApp hooks. This keeps render functions pure and ensures side-channel code only runs within effects.

Does React Compiler work with Jotai for state management?

Yes, React Compiler works with Jotai by treating hooks used in render as pure subscribers. You must avoid using Jotai hooks to drive render mutations, ensuring render functions remain pure and predictable under compiler optimization.

What happens when lint gates detect render purity violations?

When lint gates detect render purity violations, they fail the code audit. This prevents merging improper memoization or unsafe side-channel render patterns, enforcing strict alignment with React Compiler rules across dean-stack projects.

Can I use React.memo to optimize components when the React Compiler is enabled?

No, you cannot use React.memo when the React Compiler is enabled. Manual memoization is prohibited because the compiler automatically handles performance optimizations, requiring you to remove React.memo to maintain render purity.