elixir-cyclic-dependencies

Detect and remediate cyclic compile-time dependencies in Elixir codebases using mix xref.

6|1|Updated Nov 23, 2023
One-click install
npx skills add https://github.com/gmcabrita/dotfiles --skill elixir-cyclic-dependencies-gmcabrita
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elixir-cyclic-dependencies
Source: https://github.com/gmcabrita/dotfiles/tree/main/.agents/skills/elixir-cyclic-dependencies
Command: npx skills add https://github.com/gmcabrita/dotfiles --skill elixir-cyclic-dependencies-gmcabrita

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detects and removes cyclic compile-time dependencies in Elixir projects using mix xref, enabling reliable builds with minimal code changes.

Core Features & Use Cases

  • Cycle detection and visualization of compile-time dependencies via mix xref graph.
  • Guided workflow from baseline cycle detection to minimal-change fixes that break cycles.
  • Prerequisite checks and safe execution, including ensuring Elixir version is >= 1.19.

Quick Start

First, verify your Elixir version is 1.19 or higher, then run the provided cycle-detection steps from the project root to identify and fix xref cycles.

Frequently Asked Questions about elixir-cyclic-dependencies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix cyclic compile-time dependencies in Elixir?

Use mix xref graph to detect cyclic compile-time dependencies in your Elixir project, then apply minimal-change strategies to break the loops and validate with subsequent builds and tests.

What causes xref cycle failures in Elixir builds?

Xref cycle failures happen when modules reference each other at compile-time, creating circular dependencies that prevent the Elixir compiler from determining a safe compilation order.

Do I need a specific Elixir version to check for xref cycles?

Yes, checking and fixing xref cycles with this workflow requires Elixir version 1.19 or higher, as the prerequisite checks enforce this minimum version before running any cycle detection steps.

What's the best way to visualize compile-time dependencies in an Elixir project?

Run mix xref graph from your project root to visualize compile-time dependencies and highlight cyclic relationships, enabling you to identify exactly where to apply minimal-change fixes to break the loops.

How do I remove cyclic dependencies without breaking my Elixir application?

Detect cycles with mix xref graph, then apply minimal-change refactoring strategies that break the loops with the least code impact, and validate the changes by running subsequent builds and tests.