Analyze Elixir/Phoenix technical debt - duplicates, refactoring opportunities, credo issues. Use when asked about code quality, cleanup, or what to improve.
---
name: phx:techdebt
description: Analyze Elixir/Phoenix technical debt — duplicates, refactoring opportunities, credo issues. Use when asked about code quality, cleanup, or what to improve.
effort: medium
---
# Technical Debt Detection
Find and eliminate duplicate code patterns, anti-patterns, and refactoring opportunities in Elixir/Phoenix projects.
## Iron Laws - Never Violate These
1. **Search before refactoring** - Understand full scope of duplication before extracting
2. **Three strikes rule** - Extract shared code only after 3+ duplications
3. **Prefer composition** - Use behaviours and protocols over inheritance-style abstractions
4. **Test coverage first** - Ensure tests exist before refactoring duplicated code
## Analysis Checklist
### 1. Run Credo for Automated Detection
Run `mix credo --strict`.
Focus on:
… install to load the full skill