# Dependency cycle audit

> Dependency cycle audit is an open-source agent skill for developer tools. Finds and breaks dependency cycles in modules, packages and build targets. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mtarcure/claude-vibe-squad/tree/main/.agents/skills/dependency-cycle-audit
- **Repository:** https://github.com/mtarcure/claude-vibe-squad
- **GitHub stars:** 227
- **License:** MIT
- **Skill name:** dependency-cycle-audit
- **Collection:** https://github.com/mtarcure/claude-vibe-squad
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-02

## About

This skill guides an agent through auditing a codebase for circular dependencies at the level the build or loader enforces, whether that is package, module, file or build target. It asks the agent to derive the real edge list from import statements, build-file declarations or manifests rather than from diagrams, then compute strongly connected components and enumerate every multi-node cluster instead of stopping at the first one.

After mapping the clusters, the workflow ranks them by blast radius, combining the fan-in of their members with how often their files change in git history. For each cycle it weighs the closing edges by how many symbols cross them and whether they sit on a core call path, then picks the cheapest break: deleting incidental imports, re-homing a misplaced type or function, extracting a shared leaf module, or inverting a mutual dependency behind an interface. After each change the graph is re-extracted to confirm the cluster dissolved without a new one forming.

The skill expects a checkout at a fixed revision and access to the codebase's import or build graph. It recommends an import-graph or build-graph extractor for the ecosystem, or direct grep of import forms when none is available, and it ends by adding an acyclicity check to CI at the audited granularity.

## When your agent uses it

> Use when module, package, or build dependencies may contain cycles, especially load-order failures, broad rebuilds, or a planned extraction: derive the real graph, compute strongly connected components, rank cycle clusters, choose the minimal feedback-edge cut, and add an acyclicity guard.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/dependency-cycle-audit)
- [License: MIT](https://github.com/mtarcure/claude-vibe-squad/tree/HEAD/.agents/skills/dependency-cycle-audit)

## Features

- **Real graph extraction:** Builds the dependency edge list from imports and build files rather than from documentation or diagrams.
- **Cycle cluster enumeration:** Finds every strongly connected component with more than one node using Tarjan or Kosaraju.
- **Blast radius ranking:** Orders cycles by member fan-in multiplied by git churn to prioritize the costliest ones.
- **Minimal cut selection:** Chooses the lightest set of edges to remove, such as deleting unused imports or extracting a shared kernel.
- **Post-break verification:** Re-extracts the graph after each change to confirm the cycle dissolved and none was introduced.
- **CI acyclicity guard:** Adds an assertion at the audited level so cycles cannot quietly return.

## Good for

- Find all circular imports in a Python service before splitting out a module
- Diagnose load-order import failures caused by mutual dependencies
- Work out why a small change rebuilds the whole project and break the cycle responsible
- Check a planned library extraction for cycles before approving it
- Add an import-linter contract that keeps a package graph acyclic

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/dependency-cycle-audit` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/dependency-cycle-audit &&
cp -R "$tmp/.agents/skills/dependency-cycle-audit" ~/.claude/skills/dependency-cycle-audit &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/dependency-cycle-audit` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/dependency-cycle-audit` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/dependency-cycle-audit &&
cp -R "$tmp/.agents/skills/dependency-cycle-audit" ~/.agents/skills/dependency-cycle-audit &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/dependency-cycle-audit` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/dependency-cycle-audit` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/dependency-cycle-audit &&
cp -R "$tmp/.agents/skills/dependency-cycle-audit" ~/.cursor/skills/dependency-cycle-audit &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/dependency-cycle-audit` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/mtarcure/claude-vibe-squad.git --path .agents/skills/dependency-cycle-audit
```

Or copy the folder to `~/.gemini/skills/dependency-cycle-audit` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/dependency-cycle-audit`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/dependency-cycle-audit &&
cp -R "$tmp/.agents/skills/dependency-cycle-audit" ~/.copilot/skills/dependency-cycle-audit &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/dependency-cycle-audit` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/mtarcure/claude-vibe-squad.git
```

Then copy `claude-vibe-squad/.agents/skills/dependency-cycle-audit` into your agent's skills folder as `dependency-cycle-audit`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

A checkout of the codebase at a fixed revision and its import or build graph. It recommends an import-graph or build-graph extractor for the ecosystem, or grepping import statements directly when none is available.

### Does Dependency cycle audit change code automatically?

Its steps describe removing or inverting edges, extracting shared modules, and adding a CI check, so the agent performs those changes as part of the audit. The skill itself does not include scripts.

### Which granularity does Dependency cycle audit audit at?

It tells the agent to choose the level the toolchain enforces, such as package, module, file or build target, and to state which level was chosen.

### Are scripts or reference files included?

No. The folder contains only the SKILL.md file and no scripts.

### How do I install Dependency cycle audit in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/dependency-cycle-audit to use it in all your projects, or to .claude/skills/dependency-cycle-audit in one project.

### Does Dependency cycle audit run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Dependency cycle audit?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Dependency cycle audit?

The closest alternatives to Dependency cycle audit are Skill flow, Cross file relationship synthesis, Improve codebase architecture, Code reachability audit and Go dependency audit.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Skill flow](https://ai-powered.com/skills/skill-flow): Skill flow is an open-source agent skill for developer tools.
- [Cross file relationship synthesis](https://ai-powered.com/skills/cross-file-relationship-synthesis): Cross file relationship synthesis is an open-source agent skill for developer tools.
- [Improve codebase architecture](https://ai-powered.com/skills/improve-codebase-architecture): Improve codebase architecture is an open-source agent skill for developer tools.
- [Code reachability audit](https://ai-powered.com/skills/code-reachability-audit): Code reachability audit is an open-source agent skill for developer tools.
- [Go dependency audit](https://ai-powered.com/skills/go-dependency-audit): Go dependency audit is an open-source agent skill for security.
- [Ci cd](https://ai-powered.com/skills/ci-cd): Ci cd is an open-source agent skill for developer tools.
- [Ci](https://ai-powered.com/skills/ci-chachamaru127): Ci is an open-source agent skill for developer tools.
- [Dead code cleanup edho ferdian](https://ai-powered.com/skills/dead-code-cleanup-edho-ferdian): Dead code cleanup edho ferdian is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/dependency-cycle-audit
