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. Covers code deduplication, component reuse, database normalization, and modular architecture.

157 stars

Best use case

dry is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using dry should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/dry/SKILL.md --create-dirs "https://raw.githubusercontent.com/whawkinsiv/solo-founder-superpowers/main/skills/dry/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/dry/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How dry Compares

Feature / AgentdryStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 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` referencing `users`
- An `invoices` table with `customer_name`, `customer_email`, `customer_address` instead of `customer_id`
- Multiple tables with their own `status` VARCHAR column using the same string values

**Tell AI (for other tools):**
```
Audit my database schema for normalization issues:
- Find columns that store data already available in another table
- Find ID columns without foreign key constraints
- Find string columns that should be lookup tables
- Find inconsistent column naming across tables
For each: explain the problem and write the migration to fix it.
```

---

## Domain 3: Workflow Logic

### What to Find

- **Duplicate utility functions** — Two `formatDate()` functions in different files
- **Repeated API patterns** — Same fetch-try-catch-error-handle boilerplate across endpoints
- **Copy-pasted validation** — Email validation logic in signup, settings, and invite flows
- **Duplicate business logic** — Price calculation in checkout, invoice generation, and dashboard
- **Repeated data transforms** — Same array mapping/filtering logic in multiple components

### How to Fix

1. **Duplicate utilities** → Keep one, move to a shared `utils/` or `lib/` directory, update all imports
2. **API boilerplate** → Extract a shared API client or wrapper function
3. **Repeated validation** → Create a shared validation module (e.g., `lib/validators.ts`)
4. **Business logic** → Extract into a service or domain module (e.g., `lib/pricing.ts`)
5. **Data transforms** → Extract into named functions near the data type they operate on

### Search Strategy

```
Find duplicate logic:
1. Search for functions with identical or near-identical bodies
2. Search for repeated import patterns (same 3+ imports in multiple files)
3. Search for similar try/catch blocks around API calls
4. Search for the same regex or validation pattern in multiple files
5. Search for string literals used in more than 2 files (often config that should be a constant)
```

**Tell AI (for other tools):**
```
Audit my codebase for duplicate workflow logic:
- Find functions with similar names or identical logic in different files
- Find repeated error handling patterns
- Find validation logic that appears in more than one place
- Find business calculations done in more than one place
For each: show all locations and propose a single shared implementation.
```

---

## What NOT to Deduplicate

Not all duplication is bad. Don't over-abstract.

| Leave It Alone | Why |
|---------------|-----|
| Two functions that look similar but serve different business purposes | They'll diverge. Premature abstraction creates coupling. |
| Test setup code that repeats across test files | Test readability matters more than test DRYness. |
| Simple one-liners used twice | Extracting adds indirection without meaningful reuse. |
| Code that's similar today but will evolve differently | Shared abstractions should reflect stable, shared concepts. |
| Configuration that's the same across environments by coincidence | Config should be explicit per environment, not shared. |

**Rule of three:** If something appears in 3+ places, extract it. If it's only in 2 places, wait until the third occurrence to confirm it's a real pattern, not coincidence.

---

## Common Mistakes

| Mistake | Fix |
|---------|-----|
| Creating a `utils.ts` mega-file | Group by domain: `lib/pricing.ts`, `lib/validation.ts`, `lib/formatting.ts` |
| Abstracting before the pattern stabilizes | Wait for 3+ occurrences. Two similar things might diverge. |
| Breaking working code to "clean it up" | Run build and tests after every refactoring step |
| Over-parameterizing a shared component | If a component needs 10 props to handle all cases, it's doing too much |
| Deduplicating across feature boundaries prematurely | Features that share code today might need to diverge tomorrow |

---

## Success Looks Like

After a DRY audit, you should see:

- Each UI component exists once with clear props for variation
- Database tables reference each other via foreign keys instead of duplicating data
- Shared logic lives in clearly named modules under `lib/` or `utils/`
- No function body is copy-pasted across files
- New features can reuse existing components and utilities instead of recreating them

---

## Related Skills

- **optimize** — Performance and cleanup (speed, dependencies, dead code)
- **database** — Schema design, RLS, migrations, query patterns
- **ui-patterns** — Component selection, state matrix, page composition
- **build** — Feature development workflow and AI tool prompting
- **debug** — When deduplication breaks something

Related Skills

validate

157
from whawkinsiv/solo-founder-superpowers

Use this skill when the user needs to validate a business idea, test demand before building, run a smoke test, create an MVP experiment, or decide whether an idea is worth pursuing. Covers demand validation, smoke tests, fake-door tests, landing page experiments, and go/no-go decision frameworks for bootstrapped founders.

ux-design

157
from whawkinsiv/solo-founder-superpowers

Use this skill when flows feel clunky, users are confused, navigation needs planning, onboarding needs design, or accessibility needs implementation. Covers information architecture, user flows, interaction patterns, progressive disclosure, and error handling UX.

ui-patterns

157
from whawkinsiv/solo-founder-superpowers

Use this skill when the user needs to build a dashboard, settings page, data table, or any page layout. Also use when choosing component libraries, implementing responsive design, dark mode, or handling UI states (loading, empty, error). Covers component selection, page composition, and responsive implementation.

translate

157
from whawkinsiv/solo-founder-superpowers

Use this skill when the user is a domain expert (lawyer, doctor, contractor, accountant, etc.) who wants to turn their professional knowledge into a software product. Also use when the user says 'I have an idea for my industry,' 'I know this problem exists,' 'I want to build something for [profession],' or is struggling to describe what they want the software to do. Helps identify which professional pain is worth building for, then translates it into requirements AI tools can execute.

test

157
from whawkinsiv/solo-founder-superpowers

Use this skill when the user needs to test features before deployment, create test scenarios, find edge cases, or verify bug fixes. Covers manual testing workflows, cross-browser testing, edge case identification, and testing checklists for non-technical founders.

technical-seo

157
from whawkinsiv/solo-founder-superpowers

Use this skill to implement technical SEO optimizations in code — meta tags, schema markup, Core Web Vitals, crawlability, robots.txt, sitemaps, and GEO (Generative Engine Optimization) for AI search engines. This is the implementation skill — for strategy see seo, for content writing see seo-content, for auditing see seo-audit.

support

157
from whawkinsiv/solo-founder-superpowers

Use this skill when the user needs to create help docs, build a knowledge base, set up self-serve support, or reduce support tickets. Covers documentation strategy, help center structure, support tone, and scaling support without hiring.

social-media

157
from whawkinsiv/solo-founder-superpowers

Use this skill when the user needs to grow a social media presence, create content for Twitter/X, LinkedIn, or other platforms, build a founder brand, or use social media as a distribution channel. Covers platform strategy, content frameworks, posting cadence, and audience building for bootstrapped SaaS founders.

seo

157
from whawkinsiv/solo-founder-superpowers

Use this skill when the user needs to plan SEO content, do keyword research, build a content calendar, map search intent to page types, or create an internal linking strategy. Also use when the user says 'how do I rank higher,' 'what should I write about for SEO,' 'SEO plan,' 'what keywords should I target,' or 'how to get organic traffic.' This is the strategy and planning skill — for writing content see seo-content, for technical implementation see technical-seo, for auditing see seo-audit.

seo-content

157
from whawkinsiv/solo-founder-superpowers

Use this skill when the user needs to write SEO content — blog posts, landing pages, feature pages, comparison pages, how-to guides, or any content meant to rank in search and get cited by AI. Covers content briefs, humanized writing that avoids AI detection, SERP feature targeting, entity optimization, content refresh, and quality self-checks. This is the writing skill — for strategy see seo, for technical implementation see technical-seo, for auditing see seo-audit.

seo-audit

157
from whawkinsiv/solo-founder-superpowers

Audit a codebase for SEO and AI-answer visibility, then produce a prioritized fix-it plan. Use this skill whenever a user says things like "audit my SEO", "check my site for search visibility", "how do I rank better", "optimize for Google", "optimize for AI answers", "SEO review", "GEO audit", "run the SEO agent", or anything about improving organic traffic or search rankings. Also trigger when someone mentions wanting visibility in AI-generated answers (ChatGPT, Gemini, Perplexity, Claude). Works on any web project — static sites, Next.js, Astro, Hugo, WordPress themes, or anything that outputs HTML.

secure

157
from whawkinsiv/solo-founder-superpowers

Use this skill when the user needs to secure their SaaS app, implement authentication, protect user data, secure APIs, or check for vulnerabilities. Also use when the user says 'is my app secure,' 'security check,' 'I'm worried about hackers,' 'how do I protect user data,' or 'security before launch.' Covers OWASP Top 10, auth best practices, data protection, and security checklists for apps built with AI tools.