Audits and refactors codebase to eliminate duplication in UI components, database schemas, and workflow logic. Use for quick scans after changes or deep audits on bloated codebases.
npx claudepluginhub whawkinsiv/solo-founder-superpowers --plugin solo-founder-superpowersThis skill uses the workspace's default tool permissions.
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.
Provides Ktor server patterns for routing DSL, plugins (auth, CORS, serialization), Koin DI, WebSockets, services, and testApplication testing.
Conducts multi-source web research with firecrawl and exa MCPs: searches, scrapes pages, synthesizes cited reports. For deep dives, competitive analysis, tech evaluations, or due diligence.
Provides demand forecasting, safety stock optimization, replenishment planning, and promotional lift estimation for multi-location retailers managing 300-800 SKUs.
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.
| 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.
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
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 for detailed search patterns and refactoring recipes per domain.
UserList and MemberList that do essentially the same thing with different prop names| 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.
users table and orders table instead of joiningcreated_at, updated_at, created_by defined inconsistently across tables'active', 'inactive' repeated instead of using a lookup tableAI tools often create self-contained tables per feature. Watch for:
projects table with owner_name and owner_email instead of owner_id referencing usersinvoices table with customer_name, customer_email, customer_address instead of customer_idstatus VARCHAR column using the same string valuesTell 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.
formatDate() functions in different filesutils/ or lib/ directory, update all importslib/validators.ts)lib/pricing.ts)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.
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.
| 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 |
After a DRY audit, you should see:
lib/ or utils/