single-responsibility
Single Responsibility — Simplify Components & Methods
Apply these strategies to keep components and methods focused, testable, and readable. Rules are split into component vs 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. |
Simplifying a component
More from lichens-innovation/skills
react-single-responsibility
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.
30generate-pr-description
Generates pull request descriptions by comparing current branch with parent branch. Creates semantic commit-style PR titles and fills PR templates. Use when the user asks to generate PR description, prepare pull request, or create merge request description. The user may include ticket IDs in the request (e.g. tickets: NN-123, TB-456) from the company tracking system; treat those as the related issue IDs for the PR.
28review-staged-changes
Reviews staged git changes for code quality, maintainability, readability, and potential regressions. Verifies changes make sense in context, improve maintainability, enhance readability, and don't introduce side effects. Use when reviewing staged changes, examining git diffs, or when the user asks to review modifications before committing.
25hello-world
This skill welcomes users in ASCII art with OS information. Use when the user says 'hello' or 'hi'.
20react-coding-standards
Enforces internal React and TypeScript coding standards using avoid/prefer rules. Use when reviewing or refactoring React/TS code, applying company standards, or when the user asks to align code with coding standards.
13typescript-and-react-guidelines
|
10