react-component-discipline

Enforce three-layer React architecture separating domain logic, data hooks, and UI components.

2|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/buchananwill/ue-claude-scaffold --skill react-component-discipline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-component-discipline
Source: https://github.com/buchananwill/ue-claude-scaffold/tree/main/skills/react-component-discipline
Command: npx skills add https://github.com/buchananwill/ue-claude-scaffold --skill react-component-discipline

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

React components often mix domain logic with UI, making code hard to test and maintain. This skill enforces a clear separation: domain logic belongs in pure functions or non-UI utilities, while UI components render and handle events.

Core Features & Use Cases

  • Guides teams to apply a three-layer architecture: domain logic, data hooks, and presentational components.
  • Reduces dependency-array bloat and stale closures by encouraging focused hooks and minimal component responsibilities.
  • Provides actionable patterns such as the Finger Rule to keep dependencies readable and ensure render stability.

Quick Start

Audit a component to ensure it handles only UI concerns and move business logic into pure functions or hooks.

Frequently Asked Questions about react-component-discipline

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

FAQPage Schema
How do I separate domain logic from UI in React components?

To separate domain logic from UI in React components, move business logic out of UI code and into pure functions or non-UI utilities. This keeps presentational components focused strictly on rendering and event handling.

What is the best way to reduce dependency array bloat in React hooks?

The best way to reduce dependency array bloat in React hooks is keeping component responsibilities minimal and using focused hooks. Applying actionable patterns like the Finger Rule ensures dependencies remain readable and render stability is maintained.

When do I need a three-layer architecture for my React codebase?

You need a three-layer architecture for your React codebase when components mix domain logic with UI, making code hard to test and maintain. This approach is essential for codebases with hooks, callbacks, modals, and store interactions to reduce high dependencies.

How do I audit a React component to ensure it only handles UI concerns?

To audit a React component to ensure it only handles UI concerns, check that business logic has been moved into pure functions or hooks. The component should strictly handle rendering and events, keeping its file size under a measurable threshold.

Why does mixing business logic in React components make code hard to maintain?

Mixing business logic in React components makes code hard to maintain because it entangles domain rules with UI rendering, causing stale closures and high dependency components. Separating concerns into pure functions and presentational components resolves this.

Can I apply the Finger Rule to manage React hook dependencies and render stability?

Yes, you can apply the Finger Rule to manage React hook dependencies and render stability. This actionable pattern guides developers to keep dependency arrays readable and minimal, preventing stale closures and reducing component complexity.