dependency-analyzer

Build import dependency graphs to detect circular dependencies and layer violations.

3|2|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/robotijn/ctoc --skill dependency-analyzer-robotijn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dependency-analyzer
Source: https://github.com/robotijn/ctoc/tree/main/skills/architecture/dependency-analyzer
Command: npx skills add https://github.com/robotijn/ctoc --skill dependency-analyzer-robotijn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unmanaged code dependencies lead to fragile builds, unexpected runtime failures, and high-risk refactors: circular imports cause deadlocks, layer violations break architectural boundaries, and excessive coupling makes modules brittle to upstream changes. This skill eliminates blind spots by automatically mapping your codebase's dependency graph and surfacing hidden anti-patterns before they reach production.

Core Features & Use Cases

  • Full dependency graph generation: Builds import graphs for 7+ languages (TypeScript, Python, Java, C#, C, C++, SQL) with support for runtime, type-only, and test dependencies.
  • Anti-pattern detection: Flags circular dependencies (direct, indirect, type-only), layer violations, high efferent/afferent coupling, instability mismatches, and missing module boundaries.
  • Architecture compliance: Enforces layered architecture rules and calculates standard metrics (instability index, distance from main sequence) to align with 2026 best practices.
  • Use Case: Before refactoring a 50-file Python service, run this skill to identify hidden circular dependencies between modules that would cause runtime import errors after code changes.

Quick Start

Use the dependency-analyzer skill to scan your project's source code for circular dependencies, layer violations, and excessive module coupling.

Frequently Asked Questions about dependency-analyzer

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

FAQPage Schema
How do I detect circular dependencies in a Python or TypeScript project?

To detect circular dependencies, you build the full import graph of your codebase to identify direct, indirect, and type-only circular imports across supported languages like Python and TypeScript. This surfaces hidden anti-patterns that cause runtime deadlocks or import errors before they reach production.

What is the best way to enforce clean architecture and check for layer violations in a multi-language codebase?

The best way to enforce clean architecture is by applying layered architecture rules to your import graph to flag layer violations and cross-module coupling. This calculates instability mismatches and distance from the main sequence metrics to align your codebase with modern architectural compliance standards.

Does dependency analysis work with Java, C#, C++, and SQL files?

Yes, dependency analysis works with Java, C#, C, C++, and SQL files. It generates import graphs for these languages to support runtime, type-only, and test dependencies, allowing you to perform architecture compliance checks across a multi-language software project.

How do I assess refactoring risk by checking module coupling and instability metrics?

You assess refactoring risk by analyzing module coupling and calculating instability, afferent, and efferent coupling metrics from your dependency graph. This identifies excessive coupling and instability mismatches, providing actionable fix recommendations before you modify interconnected modules.

Can I use circular dependency detection for CI pipeline gating?

Yes, you can use circular dependency detection for CI pipeline gating. By scanning your source code during the build process, the analysis produces structured findings with severity tiers that block merges if high-risk architectural violations or circular imports are detected.

Why does unmanaged module coupling lead to fragile builds and how do I fix it?

Unmanaged module coupling leads to fragile builds because excessive coupling makes modules brittle to upstream changes and breaks architectural boundaries. You fix it by mapping the codebase dependency graph, identifying high efferent coupling, and applying actionable fix recommendations to isolate modules.