setup-ts-deep-modules

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

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/MSC72m/DevForge --skill setup-ts-deep-modules-msc72m
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: setup-ts-deep-modules
Source: https://github.com/MSC72m/DevForge/tree/main/skills/setup-ts-deep-modules
Command: npx skills add https://github.com/MSC72m/DevForge --skill setup-ts-deep-modules-msc72m

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 refactors risky. This Skill wires dependency-cruiser into a repo so each package exposes only its root entry-point files while everything in subfolders stays private, and it proves the rules actually fail on violations. ## Core Features & Use Cases - Entry-point boundary enforcement: Installs four dependency-cruiser rules (entry-point boundary, intra-package freedom, tests-through-entrypoints, no cycles) that block imports into package subfolders from outside code. - Scaffolded example package: Creates a copy-me template package with a root index.ts entry point, hidden lib/ implementation, and tests that import only through the entry point. - Verification loop: Runs the boundary lint to confirm it passes on clean code, fails on an injected deep import, then passes again after revert. - Use Case: A team adopting a src/packages/<name>/ layout wants CI to reject any import that bypasses a package's public entry points, without maintaining per-package rules or barrel files. ## Quick Start Ask the agent to set up deep-module boundaries with dependency-cruiser in this TypeScript repo and verify the rules fail on a deep import.

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 package import boundaries in a TypeScript monorepo?▼

Install dependency-cruiser and add forbidden rules that block imports into package subfolders from outside code. This Skill generates a .dependency-cruiser.cjs config with entry-point boundary, tests-through-entrypoints, and no-circular rules, plus a lint:boundaries script.

What is a deep module in TypeScript package design?▼

A deep module exposes a small public interface hiding substantial implementation. In this setup, a package's root files are its entry points and anything in subfolders like lib/ or tests/ is private, enforced by path-depth-based dependency-cruiser rules.

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

Yes, dependency-cruiser is package-manager agnostic. The Skill detects the manager from lock files (pnpm-lock.yaml, yarn.lock, bun.lockb) and uses it for installation and script commands.

Can a package expose multiple entry points instead of one index.ts?▼

Yes, every root file of a package is an entry point, so packages can expose several small entry points like index.ts, client.ts, and server.ts. Barrel files that re-export whole subtrees are explicitly discouraged.

Why does the boundary lint not fail on deep imports?▼

The rules are not wired correctly if a deep import passes. The Skill's verification step injects a temporary deep import into the example test and requires lint:boundaries to fail with tests-through-entrypoints before finishing.

Will this overwrite my existing dependency-cruiser config?▼

No, if a .dependency-cruiser.* file already exists the Skill merges the four rules and options into it instead of overwriting, and reports what was added.