Skip to main content
command

dependency-mapper — Claude Code command: map project dependencies

Builds a dependency graph for code and tasks, detects cycles and calculates the critical path. Useful before sprint planning or a refactor.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --command team/dependency-mapper
Open on GitHub

What dependency-mapper does

The command reads imports across .js, .ts and .py files, maps module relationships and estimates coupling levels. It also looks at tasks: it queries Linear task dependencies through an MCP server, pulls task mentions and maps epic structure. You get a dependency graph, an execution order from a topological sort, and a list of bottlenecks.

Cycle detection is its own step. The command runs a cycle-finding algorithm, rates how bad each loop is and suggests where to cut it. It also walks the critical path and flags chains where one delay pushes the whole plan.

Scope comes from the argument: --tasks, --code, --circular or --critical-path. Task analysis needs a connected Linear MCP server; without it you still get the code side. Tools are limited to Read, Glob, Grep and Bash, so nothing in your files gets rewritten — safe to run mid-project.

What it helps with

  • map imports between modules
  • find circular dependencies and decide where to break them
  • calculate the critical path across project tasks
  • order tasks with a topological sort
  • check file coupling before a refactor

Example prompts for the agent

  • /dependency-mapper --circular
  • /dependency-mapper --critical-path
  • /dependency-mapper src/ --tasks

How to install dependency-mapper

1claude-code-templates

npx claude-code-templates@latest --command team/dependency-mapper

2Manually: put the files in place

.claude/commands/dependency-mapper.md

Call it with /dependency-mapper. For all projects use ~/.claude/commands/

Questions about dependency-mapper

How do I install dependency-mapper in Claude?

Through the templates package: npx claude-code-templates@latest --command team/dependency-mapper. The file lands at .claude/commands/dependency-mapper.md.

What does dependency-mapper do?

It merges code and task dependencies into one graph, detects cycles and calculates the critical path. The output includes an execution order and mitigation steps for bottlenecks.

Do I need Linear for it to work?

Only for task analysis. Without a connected Linear MCP server the command still maps imports and cycles in code, but task relationship data stays out of reach.

Source text

dependency-mapper.md · MIT
---
allowed-tools: Read, Glob, Grep, Bash
argument-hint: "[scope] | --tasks | --code | --circular | --critical-path"
description: Map project and task dependencies with critical path analysis and circular dependency detection
---

# Dependency Mapper

Map and analyze project dependencies with task ordering optimization: **$ARGUMENTS**

## Current Dependency Context

- Repository: !`gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null || echo "No repo context"`
- Project files: !`find . -name "*.js" -o -name "*.ts" -o -name "*.py" | wc -l` code files analyzed
- Task tracking: Linear MCP server connectivity and task relationship data
- Import analysis: Code dependency structure and circular dependency detection

## Task

Execute comprehensive dependency analysis with optimization recommendations:

**Analysis Scope**: Use $ARGUMENTS to focus on task dependencies, code dependencies, circular dependency detection, or critical path analysis

**Dependency Analysis Framework**:
1. **Code Dependency Mapping** - Extract import statements, analyze module relationships, identify coupling levels, map file interdependencies
2. **Task Relationship Analysis** - Query Linear task dependencies, extract task mentions, analyze project relationships, map epic structures
3. **Dependency Graph Construction** - Build comprehensive graph structure, identify dependency chains, calculate critical paths, detect bottlenecks
4. **Circular Dependency Detection** - Implement cycle detection algorithms, identify problematic loops, assess impact severity, recommend resolution strategies
5. **Execution Order Optimization** - Calculate topological sort, optimize task sequence, balance team capacity, minimize blocking dependencies
6. **Risk Assessment** - Identify high-risk chains, assess single points of failure, evaluate dependency complexity, recommend mitigation strategies

**Advanced Features**: Visual dependency graphs, ASCII tree representations, impact analysis, sprint planning optimization, real-time dependency tracking.

**Quality Insights**: Dependency health metrics, coupling analysis, maintainability assessment, team workload distribution.

**Output**: Complete dependency analysis with visual representations, execution order recommendations, risk mitigation strategies, and optimization roadmap.

© davila7 · MIT · davila7/claude-code-templates

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set205

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor