← ClaudeAtlas

dry-principlelisted

Enforces DRY (Don't Repeat Yourself) thinking across all programming tasks — writing new code, reviewing code, fixing bugs, refactoring, editing config, schemas, tests, and documentation. Use this skill for ANY coding or programming-related task: feature implementation, bug fixes, code review, refactoring, writing tests, editing configuration, database schema changes, build system modifications, or documentation updates. This skill should trigger whenever Claude is about to write, modify, or review code or code-adjacent files. Even if the user doesn't mention "DRY" or "duplication", this skill applies to all software engineering work.
Stoica-Mihai/claude-skills · ★ 0 · AI & Automation · score 70
Install: claude install-skill Stoica-Mihai/claude-skills
# DRY Principle Apply DRY thinking to every programming task — not as a pedantic rule, but as a design instinct. DRY means every piece of **knowledge** has a single, authoritative representation in the system. The key word is knowledge, not code. Two identical-looking code blocks might represent different knowledge (and should stay separate). Two different-looking blocks might encode the same business rule (and should be unified). The test: "If this knowledge changes, how many places do I need to update?" If the answer is more than one, that's a DRY violation worth examining. ## What to look for Before writing or modifying code, scan the relevant context for these patterns: ### Knowledge duplication (the real target) - **Repeated business rules** — the same policy, validation, or calculation encoded in multiple places (frontend + backend, service + report, handler + test fixture). Unify into one authoritative implementation that others reference. - **Parallel data structures** — two arrays/objects that must be kept in sync (a list of names and a separate list of IDs at matching indices). Merge into a single structure. - **Redundant or un-derived state** — a stored value, cache, observer, or effect that restates knowledge already held elsewhere. If `total` is kept alongside `items`, both encode the same fact and will drift. If a `useEffect` mirrors one field of a store into local state, the local copy is duplicated knowledge. If a watcher fires every tick to