dependency-cruiser

Enforce architectural dependency rules and detect cycles in TypeScript/JavaScript projects.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/sizukutamago/dev-tools-plugin --skill dependency-cruiser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dependency-cruiser
Source: https://github.com/sizukutamago/dev-tools-plugin/tree/main/skills/dependency-cruiser
Command: npx skills add https://github.com/sizukutamago/dev-tools-plugin --skill dependency-cruiser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps development teams ensure their TypeScript/JavaScript code respects architectural boundaries by validating dependencies against defined rules and detecting cycles.

Core Features & Use Cases

  • Clean Architecture/DDD oriented dependency validation to prevent structural violations.
  • Circular dependency detection and enforced layering across routes, services, repositories, and usecases.
  • CI-ready templates and presets (base, ddd, frontend) to quickly bootstrap architectural rules.

Quick Start

Copy and adapt the provided templates to your project and run the dependency-cruiser checks to validate your codebase.

Frequently Asked Questions about dependency-cruiser

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

FAQPage Schema
How do I enforce Clean Architecture layering rules in a TypeScript project?

Enforce Clean Architecture layering in a TypeScript project by validating directional dependencies across routes, usecases, services, and repositories. This skill uses dependency-cruiser to check structural rules and flag architectural violations.

How do I detect circular dependencies in a JavaScript codebase?

Detect circular dependencies in a JavaScript codebase by running dependency-cruiser checks against your configuration. This skill identifies cyclic imports and enforces layer boundaries to prevent structural violations.

Can I validate DDD architectural boundaries in a Node.js application?

Validate DDD architectural boundaries in a Node.js application by applying the provided ddd preset. This skill checks dependencies against domain-driven design rules to ensure layer separation and prevent cycles.

Do I need a configuration file to run dependency-cruiser architecture checks?

You need a configuration file, such as .dependency-cruiser.cjs, to run dependency-cruiser checks. This skill supports base, ddd, and frontend presets that can be merged into a single configuration file for your project.

What's the best way to prevent dependency violations in a frontend TypeScript application?

Prevent dependency violations in a frontend TypeScript application by applying the frontend preset and running validation checks. This skill flags cycles and enforces architectural bounds across your codebase layers.

How do I integrate architecture validation into CI for TypeScript projects?

Integrate architecture validation into CI for TypeScript projects by copying and adapting the provided CI-ready templates. Run dependency-cruiser checks to validate your codebase against defined architectural rules during the pipeline.