# Enforce JavaScript and TypeScript dependency rules before architectural drift spreads with dependency-cruiser

> Scan a JS or TS codebase for forbidden imports, circular dependencies, orphaned modules, and other dependency-rule violations before they turn into structural drift.

- Skill: `agentskillexchange/enforce-javascript-and-typescript-dependency-rules-before-ar` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/enforce-javascript-and-typescript-dependency-rules-before-ar`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/enforce-javascript-and-typescript-dependency-rules-before-ar/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/enforce-javascript-and-typescript-dependency-rules-before-ar

---


# Enforce JavaScript and TypeScript dependency rules before architectural drift spreads with dependency-cruiser

Scan a JS or TS codebase for forbidden imports, circular dependencies, orphaned modules, and other dependency-rule violations before they turn into structural drift.

## Prerequisites

Node.js, npm or pnpm

## Installation

Use the upstream install or setup path that matches your environment:
- npm install --save-dev dependency-cruiser
- yarn add -D dependency-cruiser
- pnpm add -D dependency-cruiser
- npx depcruise --init

Basic usage or getting-started notes:
- shell
- # or
- ### ... and generate a config

- Source: https://github.com/sverweij/dependency-cruiser
- Extracted from upstream docs: https://raw.githubusercontent.com/sverweij/dependency-cruiser/HEAD/README.md

## Documentation

- https://github.com/sverweij/dependency-cruiser

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/enforce-javascript-and-typescript-dependency-rules-before-architectural-drift-spreads-with-dependency-cruiser/)

