← ClaudeAtlas

react-single-responsibilitylisted

Strategies to simplify components, hooks, and methods: decomposition order (utilities, hooks, sub-components), early returns, control flow, parameter design, and code smell fixes. Use when the user says: ungodify this method/function/component, simplify this method/function/component, make this method/function/component less complex; or when refactoring a large component, hook, or function, reducing complexity, applying single responsibility, or asking how to simplify a component, hook, or method.
Lichens-Innovation/ai-dev-tools · ★ 0 · Web & Frontend · score 71
Install: claude install-skill Lichens-Innovation/ai-dev-tools
# Single Responsibility — Simplify Components & Methods Apply these strategies to keep components, hooks, and methods focused, testable, and readable. Rules are split into **component**, **hook**, and **method** simplification. --- ## Principles | Principle | Rule | | ------------------------- | --------------------------------------------------------------------------------------------- | | **KISS** | Simplest solution that works. Avoid over-engineering. | | **Single responsibility** | One clear responsibility per component or function; extract utilities, hooks, sub-components. | | **DRY** | Extract common logic; create reusable functions or components. | | **YAGNI** | Don't build features before they're needed. | | **Composition** | Prefer composing small components and utilities over large, multi-purpose blocks. | --- ## Which rules apply Use the **file** where the function lives: **`*.tsx`** → components ("Simplifying a component"); **`use*.ts`** → hooks ("Simplifying a hook"); **`*.ts`** → plain functions ("Simplifying a method"). Plain TypeScript functions are always in `*.ts`, never in `*.tsx`. --- ## Simplifying a component (filename pattern \*.tsx) Rules that appl