setup-ts-deep-modules

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

2|Updated May 12, 2026
One-click install
npx skills add https://github.com/tajo9128/BioDockify-Pharma-AI --skill setup-ts-deep-modules-tajo9128
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: setup-ts-deep-modules
Source: https://github.com/tajo9128/BioDockify-Pharma-AI/tree/main/.agents/skills/setup-ts-deep-modules
Command: npx skills add https://github.com/tajo9128/BioDockify-Pharma-AI --skill setup-ts-deep-modules-tajo9128

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dependency-cruiser.

What problem does it solve? TypeScript monorepos often leak implementation details across packages, letting any file import any other file and eroding module boundaries. This Skill wires dependency-cruiser into a repo so each package becomes a deep module: implementation hidden in subfolders, reachable only through its root entry-point files. ## 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 fail the build on deep imports. - Multiple entry points per package: Supports several small root entry files (index.ts, client.ts, server.ts) instead of one giant barrel index. - Verified setup: Scaffolds an example package 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/ monorepo layout wants CI to reject imports like packages/billing/lib/stripe from other packages, forcing all access through public entry points. ## Quick Start Ask the agent to set up deep-module boundaries with dependency-cruiser for 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 module boundaries in a TypeScript monorepo?▼

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

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

Use path-depth based forbidden rules: a package's root files are public entry points, while anything in a subfolder is private. The config uses $1 back-references so a package can import its own internals freely while other packages and app code can only reach its entry points.

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

Yes. The setup detects the package manager from lock files (pnpm-lock.yaml, yarn.lock, bun.lockb) and uses it for installation and scripts. The config itself is package-manager agnostic and resolves .ts, .tsx, .js, .jsx, and .json extensions.

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

Yes. The public surface is every root file of the package, so you can expose several small entry points like index.ts, client.ts, and server.ts. Barrel files that re-export a whole subtree are discouraged; adding an entry point is just adding a root file.

Why does dependency-cruiser not fail on deep imports after setup?▼

The rules are not wired correctly if a deliberate deep import passes. Verify PACKAGES_ROOT matches your packages directory, the four forbidden rules are present, and lint:boundaries actually runs depcruise against the packages root. The setup requires observing a pass, a fail, then a pass.