coding-guidelines

Enforce props-driven state and separation of concerns in React components.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/imaimai17468/custom-asmr --skill coding-guidelines-imaimai17468
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coding-guidelines
Source: https://github.com/imaimai17468/custom-asmr/tree/main/.claude/skills/coding-guidelines
Command: npx skills add https://github.com/imaimai17468/custom-asmr --skill coding-guidelines-imaimai17468

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Guiding patterns and practices to ensure React components are easy to test, reason about, and maintain, by reducing internal state and clarifying responsibilities.

Core Features & Use Cases

  • Enforces props-driven rendering and state control to improve test coverage and predictability.
  • Advocates extracting conditional UI into separate components to simplify testing and reuse.
  • Promotes data flow discipline: separation of concerns, logic extraction, and the use of a presenter pattern for display logic.
  • Provides a practical checklist for Phase 2 refactoring and architectural decisions.

Quick Start

Apply these guidelines to a target component by auditing for internal state, moving logic to utilities, and refactoring conditionals into dedicated components.

Frequently Asked Questions about coding-guidelines

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

FAQPage Schema
How do I make React components testable and maintainable?

To make React components testable and maintainable, enforce props-driven state control, extract conditional UI into separate components, and apply a presenter pattern to separate display logic from business logic for predictable rendering.

What is the best way to refactor React components for better state control?

The best way to refactor React components for state control is auditing for internal state, moving logic to utility functions, and refactoring conditionals into dedicated reusable components to ensure props-driven rendering.

How does a presenter pattern work for React component design?

A presenter pattern for React component design works by extracting display logic into a dedicated layer, enforcing separation of concerns so that components receive props predictably and remain easy to test without complex internal state.

Can I use these refactoring guidelines for React server components?

Yes, these refactoring guidelines apply to React server components by enforcing props-driven state and clear separation of concerns, aligning component architecture and conditional rendering with server-component requirements.

When do I need to extract conditional UI in React?

You need to extract conditional UI in React when complex conditional rendering makes components hard to test and reuse, so moving these conditionals into dedicated separate components simplifies testing and improves maintainability.

Why does my React component fail test coverage due to internal state?

React components fail test coverage due to internal state because unpredictable state mutations make rendering hard to control, so enforcing props-driven state and extracting logic improves testability and predictability.