react-architecture-enforcer

Enforce React architecture rules with pre-flight checks and extraction workflows.

Updated Nov 27, 2025
One-click install
npx skills add https://github.com/DrSatsuma1/catherine-claude-skills --skill react-architecture-enforcer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-architecture-enforcer
Source: https://github.com/DrSatsuma1/catherine-claude-skills/tree/main/react-architecture-enforcer
Command: npx skills add https://github.com/DrSatsuma1/catherine-claude-skills --skill react-architecture-enforcer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams enforce clean, consistent React architectures during bug fixes and feature additions. It codifies common patterns (e.g., no logic in UI, single-source of truth) and guides rapid, low-risk changes.

Core Features & Use Cases

  • Pattern enforcement: Prevents common anti-patterns by codifying rules like "No logic in UI" and "One canonical source for credits/eligibility".
  • Pre-Flight checks: Checks file size thresholds and ensures changes follow existing patterns before edits are accepted.
  • Rationalization & Escalation: Provides an extraction plan when violations occur to keep code maintainable.

Quick Start

Run the React Architecture Enforcer on the current project or commit to receive a plan for extracting logic and aligning with existing patterns.

Frequently Asked Questions about react-architecture-enforcer

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

FAQPage Schema
How do I enforce React architecture patterns to prevent logic in UI components?

React architecture enforcement involves codifying rules like keeping logic out of UI, maintaining single sources of truth, and limiting component file size. Pre-flight checks validate these patterns before changes are accepted, catching violations early and providing extraction plans to move logic into domain or service layers.

What are the Five Laws of React architecture and how do I apply them?

The Five Laws enforce clean React patterns: no UI logic, no mutating singletons, files under 300 lines, no duplicated logic, and examined effects only. Apply them by running pre-flight checks on modified components, especially files over 200 lines, to identify violations and extract logic into pure functions and services before merging.

How do I refactor oversized React components to follow architecture best practices?

Refactoring large React components starts with identifying logic violations through architecture checks. Extract business logic, state management, and side effects into separate domain, services, and config layers with pure functions. Conduct dependency audits to ensure UI components only handle rendering while maintaining single responsibility.

Can I use architecture enforcement on existing React projects with large component files?

Yes, architecture enforcement works on existing projects and is especially valuable for files exceeding 200 lines. It applies mandatory pre-flight checks to new features and bug fixes, providing extraction workflows to gradually refactor oversized components into organized domain and service layers without disrupting current code.

What does a pre-flight check catch before I commit React changes?

Pre-flight checks validate file size thresholds, detect logic in UI components, identify duplicated logic, flag mutating singletons, and examine side effects. They ensure changes align with existing patterns and provide rationalization plans when violations occur, keeping refactors low-risk and maintainable.

How does code-quality linting improve React refactoring workflows?

Architecture-focused linting rules automate pattern enforcement during refactoring by flagging anti-patterns in real time. Combined with pre-flight checks and extraction guidance, linting reduces review friction, prevents regressions, and ensures all changes follow the same architectural principles across the codebase.