phx:techdebt

Technical Debt Detection

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "phx:techdebt" with this command: npx skills add oliver-kriska/claude-elixir-phoenix/oliver-kriska-claude-elixir-phoenix-phx-techdebt

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

mix credo --strict

Focus on:

  • Design issues (duplication, complexity)

  • Consistency issues (naming, patterns)

  • Refactoring opportunities

  1. Find Duplicate Ecto Query Patterns

Repeated Repo calls

grep -r "Repo.get!|Repo.get|Repo.one" lib/ --include="*.ex"

Duplicate query patterns

grep -r "from.*in.where" lib/ --include=".ex"

  1. Find Duplicate Validation Logic

Changeset patterns

grep -r "def changeset" lib/ --include="*.ex" | wc -l

Repeated validations

grep -r "validate_required|validate_format" lib/ --include="*.ex"

  1. Find Copy-Pasted Controller Actions

Similar action patterns

grep -r "def create|def update|def delete" lib/_web/ --include=".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.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

oban

No summary provided by upstream source.

Repository SourceNeeds Review
General

phx:full

No summary provided by upstream source.

Repository SourceNeeds Review
General

tidewave-integration

No summary provided by upstream source.

Repository SourceNeeds Review
General

phoenix-contexts

No summary provided by upstream source.

Repository SourceNeeds Review