Skip to content
Business
Skill

/dry

Use this skill to find and eliminate duplication across your codebase — UI components, database schema, and workflow logic. Also use when the codebase feels bloated, features take longer to build, changes break in unexpected places, or after significant AI-assisted development.

From plugin
solo-founder-superpowers
23259 skills1 command
Install
$ npx -y skills add whawkinsiv/claude-code-superpowers --skill dry --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/dry

Context preview

The summary Claude sees to decide when to auto-load this skill.

Use this skill to find and eliminate duplication across your codebase — UI components, database schema, and workflow logic. Also use when the codebase feels bloated, features take longer to build, changes break in unexpected places, or after significant AI-assisted development.

SKILL.md

dry.SKILL.md
name: dry
description: "Use this skill to find and eliminate duplication across your codebase — UI components, database schema, and workflow logic. Also use when the codebase feels bloated, features take longer to build, changes break in unexpected places, or after significant AI-assisted development. Covers code deduplication, component reuse, database normalization, and modular architecture."

Don't Repeat Yourself

Find and eliminate duplication across your codebase. Every duplicate is a future bug — when you fix something in one place but forget the copy, users hit the unfixed version.

**This skill audits and refactors.** For building features, use **build**. For general performance optimization, use **optimize**. For database schema design from scratch, use **database**. For UI component selection, use **ui-patterns**.

Two Modes

| Mode | When | Scope | Time | |------|------|-------|------| | **Quick scan** | After building a feature, or on request | Recent changes vs. existing codebase | 2-5 minutes | | **Deep audit** | Codebase feels bloated, periodic cleanup | Entire codebase, all three domains | 15-30 minutes |

**Choose quick scan** after implementing features, adding new pages, or building new API endpoints. **Choose deep audit** when the codebase has grown through many rounds of AI-assisted iteration, or quarterly as hygiene.

---

Quick Scan Workflow

Run this after building or modifying a feature.

Quick DRY scan:
- [ ] Identify what was just built or changed
- [ ] Search for similar patterns in existing codebase
- [ ] Flag any duplication with specific file locations
- [ ] Refactor: extract shared code, reuse existing components
- [ ] Verify nothing broke after refactoring

Process

1. **Identify the change** — What files were just created or modified? 2. **Search for siblings** — For each new component, function, or query: does something similar already exist? 3. **Decide: reuse or extract** — If a near-duplicate exists, reuse it. If two things are now similar, extract a shared version. 4. **Refactor** — Make the change, run build and tests.

What to Search For

  • New component created → search for components with similar props, layout, or purpose
  • New utility function → search for functions with similar signatures or logic
  • New API endpoint → search for endpoints with similar query patterns or response shapes
  • New database query → search for queries hitting the same tables with similar conditions

---

Deep Audit Workflow

Run this for comprehensive deduplication across the full codebase.

Deep DRY audit:
- [ ] Audit UI components for duplication
- [ ] Audit database schema for normalization issues
- [ ] Audit workflow logic for duplicate functions and patterns
- [ ] Generate findings with specific refactoring actions
- [ ] Apply fixes domain by domain, testing after each

See [AUDIT-CHECKLIST.md](AUDIT-CHECKLIST.md) for detailed search patterns and refactoring recipes per domain.

---

Domain 1: UI Components

What to Find

  • **Near-duplicate components** — Two card components, two modal wrappers, two form layouts with slight differences
  • **Repeated inline styles** — Same padding, colors, or layout CSS copied across components instead of using shared tokens or classes
  • **Same-purpose components** — `UserList` and `MemberList` that do essentially the same thing with different prop names
  • **Reimplemented patterns** — Custom dropdown when the component library already has one

How to Fix

1. **Identical components** → Delete one, update imports to point to the survivor 2. **Near-duplicates** → Extract a shared component with props for the differences 3. **Repeated styles** → Extract into shared CSS classes, design tokens, or a utility class 4. **Reimplemented patterns** → Replace with the component library version

AI-Tool-Specific Patterns

| Tool | Common Duplication | Why | |------|-------------------|-----| | Lovable | Each prompt creates new Card/Button/Modal variants | Lovable doesn't reference existing components by default | | Replit | Inline styles duplicated across pages | Fast iteration favors copy-paste | | Cursor | Similar components in different feature folders | File-scoped context misses cross-feature reuse | | Claude Code | Utility components recreated in new feature branches | Context window doesn't always include existing shared components |

**Tell AI (for other tools):**

Search my codebase for duplicate UI components:
- Find components with similar JSX structure or props
- Find repeated inline styles or CSS classes
- Find components that render the same kind of data differently
For each duplicate: show both versions side-by-side and propose a single shared component.

---

Domain 2: Database Schema

What to Find

  • **Denormalized data** — User's email stored in both `users` table and `orders` table instead of joining
  • **Missing foreign keys** — IDs stored as plain integers/strings without proper references
  • **Repeated column groups** — `created_at`, `updated_at`, `created_by` defined inconsistently across tables
  • **Enum values in columns** — Status strings like `'active'`, `'inactive'` repeated instead of using a lookup table
  • **Duplicate lookup data** — Category names stored as strings in every row instead of referencing a categories table

How to Fix

1. **Denormalized data** → Remove the duplicate column, add a JOIN where needed 2. **Missing foreign keys** → Add proper FK constraints with ON DELETE behavior 3. **Repeated column groups** → Standardize naming and types across all tables 4. **String enums** → Create a lookup table or use a database enum type (for values that won't change) 5. **Duplicate lookup data** → Extract into a reference table, replace with foreign key

Red Flags in AI-Generated Schemas

AI tools often create self-contained tables per feature. Watch for:

  • A `projects` table with `owner_name` and `owner_email` instead of `owner_id` refere
Read more
Ships withsolo-founder-superpowers

43 expert skills for non-technical founders building SaaS with AI tools (Claude Code, Lovable, Replit, Cursor). Covers the full lifecycle of planning, building, launching, and growing a software business — actionable guides, checklists, and copy-paste prompts.

Get the whole plugin
Stats
235
Stars
44
Forks
Active
Maintenance
MIT
License
21d ago
Last commit
7mo ago
Created

Repo: whawkinsiv/claude-code-superpowers

Other skills on solo-founder-superpowers.