elixir-cyclic-dependencies

Detect and remove compile-time dependency cycles in Elixir projects using mix xref.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/johngrandson/orkestry --skill elixir-cyclic-dependencies-johngrandson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: elixir-cyclic-dependencies
Source: https://github.com/johngrandson/orkestry/tree/main/.claude/skills/elixir-cyclic-dependencies%20copy
Command: npx skills add https://github.com/johngrandson/orkestry --skill elixir-cyclic-dependencies-johngrandson

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

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.

Core Features & Use Cases

  • Cycle detection with mix xref graph for compile-connected and compile graphs.
  • Establish baseline and plan minimal changes to break cycles (extract helper modules, move code, invert dependencies, split modules).
  • Project integration: run optional cyclecheck task after changes to validate cycles are cleared and code compiles.

Quick Start

Run the cycle-detection workflow on your Elixir project by validating the Elixir version, then executing the mix xref graph commands described to identify and break 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 detect cyclic dependencies in an Elixir project?

Use mix xref graph to detect cyclic dependencies in an Elixir project by mapping compile-connected and compile-time cycles. This Skill executes those commands to establish a baseline and plan minimal refactoring changes to break the loops.

What is the best way to fix mix xref cycle failures with minimal code changes?

Fix mix xref cycle failures with minimal code changes by extracting helper modules, moving code, inverting dependencies, or splitting modules. This Skill recommends the least invasive refactoring strategy to break compile-time dependency cycles.

Do I need a specific Elixir version to run mix xref for dependency cycle detection?

You need Elixir 1.19 or higher to run mix xref for accurate dependency cycle detection. This Skill validates your Elixir version before executing the cycle analysis workflow to ensure precise compile-connected graph results.

When should I check for compile-time dependency cycles in my Elixir codebase?

Check for compile-time dependency cycles when you explicitly need to resolve xref cycle failures or verify codebase health. This Skill runs a cyclecheck task after refactoring to validate that cycles are cleared and the Elixir code compiles successfully.

Why does mix xref show compile-connected cycles after refactoring Elixir modules?

Compile-connected cycles persist after refactoring when structural dependencies remain unbroken between modules. This Skill analyzes compile and compile-connected graphs using mix xref to identify remaining loops and plan further minimal changes like inverting dependencies.