elixir-cyclic-deps

Solid

Detects and removes cyclic compile-time dependencies in Elixir codebases using mix xref, with minimal code changes. Use when the user explicitly asks to check for cycles, remove cyclic dependencies, or fix xref cycle failures. Requires Elixir 1.19 or higher for accurate results.

AI & Automation 45 stars 2 forks Updated 2 months ago MIT

Install

View on GitHub

Quality Score: 77/100

Stars 20%
55
Recency 20%
75
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Elixir Cyclic Dependencies ## When to Use Apply this skill only when the user **explicitly asks** to check or remove cyclic dependencies (e.g. "check for cycles", "remove cyclic dependencies", "fix xref cycles"). ## Prerequisite: Elixir Version Cycle detection is correct only on **Elixir 1.19 or higher**. Before running any cycle checks: 1. Verify version: `elixir -v` or inside the project run `mix run -e 'IO.inspect(System.version())'`. 2. If the version is below 1.19, stop and inform the user that upgrading to Elixir 1.19+ is required for reliable cycle detection. ## Detecting Cycles Run both commands from the project root. Start with a relaxed threshold, then tighten: ```bash mix xref graph --format cycles --label compile-connected --fail-above 3 mix xref graph --format cycles --label compile --fail-above 3 ``` - **compile-connected**: cycles in the compile-time dependency graph (modules that compile in a cycle). - **compile**: same graph, different label; both should be run. - **--fail-above N**: exit code fails when cycle count is above N. Use `3` initially, goal is **0**. To list cycles without failing (for inspection), omit `--fail-above` or set it high: ```bash mix xref graph --format cycles --label compile-connected mix xref graph --format cycles --label compile ``` **Goal**: reach `--fail-above 0` for both commands (no cycles). ## Workflow 1. **Check Elixir version** (must be ≥ 1.19). 2. **Establish baseline**: run both xref commands with `--fail-abo...

Details

Author
matteing
Repository
matteing/opal
Created
3 months ago
Last Updated
2 months ago
Language
Elixir
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category