setup-ts-deep-modules

Configures dependency-cruiser to enforce deep-module boundaries in TypeScript package repositories.

Updated Sep 19, 2026
One-click install
npx skills add https://github.com/Ab0umar/selrs.cc.BU --skill setup-ts-deep-modules-ab0umar
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: setup-ts-deep-modules
Source: https://github.com/Ab0umar/selrs.cc.BU/tree/main/.agents/skills/setup-ts-deep-modules
Command: npx skills add https://github.com/Ab0umar/selrs.cc.BU --skill setup-ts-deep-modules-ab0umar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dependency-cruiser.

What problem does it solve? TypeScript monorepos often leak implementation details through deep imports, making packages tightly coupled and hard to refactor. This Skill wires dependency-cruiser into a repo so each package exposes only its root entry-point files while everything in subfolders stays private. ## Core Features & Use Cases - Boundary Enforcement: Installs four dependency-cruiser rules (entry-point boundary, intra-package freedom, tests-through-entrypoints, no cycles) that fail the build on deep imports. - Environment Detection: Detects the package manager (pnpm, yarn, bun, npm), the packages root (src/packages or packages), and merges rules into any existing dependency-cruiser config without overwriting it. - Verified Setup: Scaffolds an example package with a hidden lib/ implementation and proves the rules bite by observing a pass, a forced failure on a deep import, then a pass again. - Use Case: A team adopting a packages/ layout wants to stop other packages from importing internal files like packages/billing/lib/stripe.ts directly; this Skill sets up the lint:boundaries check, folds it into the existing typecheck command, and documents the convention in CLAUDE.md or AGENTS.md. ## Quick Start Ask the AI to set up deep-module boundary enforcement with dependency-cruiser for the packages in this TypeScript repository.

Frequently Asked Questions about setup-ts-deep-modules

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

FAQPage Schema
How do I enforce module boundaries in a TypeScript monorepo?▼

Use dependency-cruiser with forbidden rules that block imports into package subfolders, allowing only root entry-point files. This Skill installs the tool, writes the config, and adds a lint:boundaries script that runs alongside typecheck.

How to prevent deep imports between packages with dependency-cruiser?▼

Define a forbidden rule matching package internals (paths nested inside a package subfolder) so outsiders can import only root files. Group back-references like $1 let a package reach its own internals while blocking other packages.

Does dependency-cruiser work with pnpm, yarn, and bun?▼

Yes, dependency-cruiser is package-manager agnostic. The Skill detects pnpm-lock.yaml, yarn.lock, or bun.lockb and uses the matching tool for installation and script execution, falling back to npm otherwise.

Can dependency-cruiser rules merge with an existing config?▼

Yes. If a .dependency-cruiser.* file already exists, the four boundary rules and options are merged in rather than overwriting the file, and the user is told exactly what was added.

Why does my dependency-cruiser boundary rule not fail on violations?▼

A config that passes on a known violation is miswired. Verify by temporarily adding a deep import in a test file and running lint:boundaries; it must fail with the tests-through-entrypoints rule before the setup is complete.

Should packages use a single index.ts barrel file?▼

No. The convention discourages barrels that re-export whole subtrees. Expose several small root entry points (index.ts, client.ts, server.ts) and keep implementation hidden in subfolders like lib/.