monorepo-dependency-checker

Analyze monorepo dependency graphs for version conflicts, circular imports, unnecessary coupling, and optimal package boundaries using Nx, Turborepo, Lerna, or pnpm workspaces.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "monorepo-dependency-checker" with this command: npx skills add charlie-morrison/monorepo-dependency-checker

Monorepo Dependency Checker

Analyze monorepo dependency graphs for version conflicts, circular imports, unnecessary coupling, and package boundary violations. Works with Nx, Turborepo, Lerna, pnpm workspaces, and npm workspaces.

Usage

"Check my monorepo for dependency issues"
"Find circular dependencies between packages"
"Audit version consistency across workspaces"
"Analyze package boundaries in my monorepo"

How It Works

1. Workspace Discovery

# Detect monorepo tool
cat nx.json 2>/dev/null && echo "Nx workspace"
cat turbo.json 2>/dev/null && echo "Turborepo"
cat lerna.json 2>/dev/null && echo "Lerna"
cat pnpm-workspace.yaml 2>/dev/null && echo "pnpm workspace"

# List all packages
find . -name "package.json" -not -path "*/node_modules/*" -maxdepth 3

2. Dependency Graph

Build the internal dependency graph:

  • Which packages depend on which
  • Direct vs transitive dependencies
  • Shared dependencies across packages
  • External dependency versions

3. Issue Detection

Circular dependencies:

  • Package A → B → C → A (cycle)
  • Impact: build ordering issues, bundle size, testing complexity
  • Fix: extract shared code into new package or restructure

Version conflicts:

  • Different versions of same external dep across packages
  • Peer dependency mismatches
  • Lockfile inconsistencies

Unnecessary coupling:

  • Packages importing from other packages' internals
  • Shared state between packages that should be independent
  • Test utilities leaking into production bundles

Boundary violations:

  • UI packages importing from backend packages
  • Feature packages depending on other features (should go through shared)
  • Missing package.json exports field

4. Architecture Recommendations

  • Layered architecture: shared → domain → feature → app
  • Proper barrel exports (index.ts) in each package
  • Build order optimization
  • Affected/changed package detection for CI
  • Package extraction candidates (frequently co-changed files)

Output

## Monorepo Dependency Analysis

**Tool:** Turborepo | **Packages:** 12 | **Workspace:** pnpm

### Dependency Graph

app-web → ui, api-client, config, types app-mobile → ui, api-client, config, types api-server → database, config, types, utils ui → types, config api-client → types database → types, config


### 🔴 Circular Dependencies (1)
- utils → database → utils
  utils/logger imports database/connection for query logging
  → Extract logging config to `config` package

### 🟡 Version Conflicts (3)
| Package | Versions | Location |
|---------|----------|----------|
| react | 18.2, 18.3 | app-web vs ui |
| zod | 3.22, 3.23 | api-server vs types |
| typescript | 5.3, 5.4, 5.5 | various |

### 📊 Package Health
| Package | Internal Deps | External Deps | Build Order | Issues |
|---------|--------------|---------------|-------------|--------|
| types | 0 | 1 | 1 | ✅ |
| config | 1 | 3 | 2 | ✅ |
| utils | 2 | 5 | 3 | 🔴 circular |
| ui | 2 | 12 | 4 | 🟡 version |
| database | 2 | 4 | 3 | 🔴 circular |

### ✅ Good Practices
- Clean layered architecture (types → config → domain → app)
- Proper exports field in all package.json files
- Shared tsconfig.base.json with package-level extends
- Turborepo pipeline configured for incremental builds

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Arch Video Cut

自动合并建筑视频,生成字幕和背景音乐,输出横屏与竖屏双版本,支持自学习优化剪辑偏好。

Registry SourceRecently Updated
3290Profile unavailable
General

Teamgram Server Architecture

Teamgram Server architecture guide for building Telegram-compatible backends. Use when designing service topology, implementing MTProto services, or self-hos...

Registry SourceRecently Updated
2290Profile unavailable
General

flutter-architecture

Flutter 四层组件化 + MVVM 项目架构规范。适用于 Flutter 项目开发、新模块创建、目录结构设计、代码评审、架构对齐。支持在项目中直接创建/搭建整套 MVVM+组件化目录结构。

Registry SourceRecently Updated
4040Profile unavailable
General

Tech Solution Generator

技术方案文档自动生成器。根据需求自动生成完整的技术方案文档,包含架构设计、技术选型、风险评估、排期估算。

Registry SourceRecently Updated
4320Profile unavailable