simplifying-code-best-practices
Installation
SKILL.md
Simplifying Code Best Practices
Workflow
- Identify duplication, complexity hot spots, and confusing flows.
- Apply DRY/KISS/YAGNI/Separation of Concerns to guide refactors.
- Extract reusable modules or functions with clear interfaces.
- Replace complex conditionals with patterns when appropriate.
- Validate behavior with tests and update docs.
Preflight (Avoid Accidental Complexity)
- Confirm what must not change (public API, performance constraints, side effects).
- Prefer small, reversible refactors with tests between steps.
- Do not DRY "similar-looking" code unless the invariants are truly shared.
Core Principles
- DRY: Single source of truth for logic.
- KISS: Prefer the simplest solution that works.
- YAGNI: Avoid speculative features and over-generalization.
- Separation of Concerns: Keep responsibilities isolated.