code-quality
Installation
SKILL.md
Code Quality Automation
Automated detection of code quality issues in Elixir projects. These checks run automatically via hooks when files are written, and can be run on-demand for full project analysis.
RULES — Follow these with no exceptions
- Duplicated functions must be extracted — when 2+ modules share >70% identical function implementations, create a shared module
- Functions must stay below ABC complexity 30 — break complex functions into smaller helpers with single responsibilities
- Unused private functions must be removed — dead code increases maintenance burden and confusion
- Duplicated templates must become components — when 2+ HEEx files share >40% identical markup, extract to a function component
- Run full analysis before major refactors — use
run_analysis.shto establish a baseline before and after - Address duplication before complexity — extracting shared code often reduces complexity as a side effect
- Prefer composition over inheritance — extract shared functions into modules imported/used where needed, not into base modules
What Gets Detected
Code Duplication
Related skills
More from j-morgan6/elixir-phoenix-guide
oban-essentials
MANDATORY for ALL Oban work. Invoke before writing workers or enqueuing jobs.
1phoenix-json-api
MANDATORY for ALL JSON API work. Invoke before writing API controllers, pipelines, or JSON responses.
1ecto-essentials
MANDATORY for ALL database work. Invoke before modifying schemas, queries, or migrations.
1otp-essentials
MANDATORY for ALL OTP work. Invoke before writing GenServer, Supervisor, Task, or Agent modules.
1phoenix-uploads
MANDATORY for file upload features. Invoke before implementing upload or file serving functionality.
1testing-essentials
MANDATORY for ALL test files. Invoke before writing any _test.exs file.
1