techdebt
Analyze Elixir/Phoenix technical debt — duplicates, refactoring opportunities, credo issues. Use when asked about code quality, cleanup, or what to improve.
Unsigned, install at your own risk
UnverifiedThis skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install elixir-phoenix-techdebtManual setup by platform
Claude Code
~/.claude/skills/elixir-phoenix-techdebt/SKILL.md
Instructions
Technical Debt Detection
Find and eliminate duplicate code patterns, anti-patterns, and refactoring opportunities in Elixir/Phoenix projects.
Iron Laws - Never Violate These
- Search before refactoring - Understand full scope of duplication before extracting
- Three strikes rule - Extract shared code only after 3+ duplications
- Prefer composition - Use behaviours and protocols over inheritance-style abstractions
- Test coverage first - Ensure tests exist before refactoring duplicated code
Analysis Checklist
1. Run Credo for Automated Detection
Run mix credo --strict.
Focus on:
- Design issues (duplication, complexity)
- Consistency issues (naming, patterns)
- Refactoring opportunities
2. Find Duplicate Ecto Query Patterns
Use Grep to search for repeated Repo calls (Repo.get!, Repo.get, Repo.one) in lib/**/*.ex.
Use Grep to find duplicate query patterns (from.*in.*where) in lib/**/*.ex.
3. Find Duplicate Validation Logic
Use Grep with output_mode: "count" to count def changeset occurrences in lib/**/*.ex.
Use Grep to find repeated validations (validate_required, validate_format) in lib/**/*.ex.
4. Find Copy-Pasted Controller Actions
Use Grep to find similar action patterns (def create, def update, def delete) in lib/*_web/**/*.ex.
Common Duplication Patterns
| Pattern | Symptom | Solution |
|---|---|---|
| Repeated queries | Same Repo.get in multiple contexts | Create shared query module |
| Duplicate validations | Same validate_* calls | Extract to shared changeset |
| Similar controllers | Copy-pasted CRUD actions | Use Phoenix generators consistently |
| Repeated transforms | Same Enum.map patterns | Extract to domain module |
Reporting Format
For each duplication found, report:
- Location: File paths and line numbers
- Pattern: What code is duplicated
- Extraction: Suggested shared function/module
- Effort: Low/Medium/High to fix
Usage
Run /phx:techdebt to analyze the codebase and generate a prioritized report of technical debt with specific remediation steps.
Security
Reviews (0)
Related skills
Browse all →More from Elixir & Phoenix
View source →More Build skills
Browse category →Frequently asked questions about techdebt
What does the techdebt skill do?
Analyze Elixir/Phoenix technical debt — duplicates, refactoring opportunities, credo issues. Use when asked about code quality, cleanup, or what to improve. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the techdebt skill?
Run `npx @skills-hub-ai/cli install elixir-phoenix-techdebt` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/elixir-phoenix-techdebt/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does techdebt work with?
techdebt runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the techdebt skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use techdebt after installing it?
In Claude Code, type `/elixir-phoenix-techdebt` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the techdebt skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.