setup-ts-deep-modules

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

Updated Aug 3, 2026
One-click install
npx skills add https://github.com/shaahy/quicknav-desktop --skill setup-ts-deep-modules-shaahy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: setup-ts-deep-modules
Source: https://github.com/shaahy/quicknav-desktop/tree/main/A%20%E6%95%99%E7%A8%8B%E9%9B%86%E5%90%88/Matt%20Pocock%20Skills%20%E6%8A%80%E8%83%BD%E9%80%9F%E6%9F%A5/source-snapshot/skills/in-progress/setup-ts-deep-modules
Command: npx skills add https://github.com/shaahy/quicknav-desktop --skill setup-ts-deep-modules-shaahy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dependency-cruiser.

What problem does it solve? TypeScript monorepos often leak internal implementation details across packages, making refactors risky and coupling code that should stay independent. This Skill wires dependency-cruiser into a repo so every package becomes a deep module: only its root entry-point files are importable from outside, while everything in subfolders stays private. ## 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. - Automated setup workflow: Detects the package manager and packages root, installs dependency-cruiser, writes .dependency-cruiser.cjs, adds a lint:boundaries script, and folds it into the repo's existing check command. - Proof the rules bite: Scaffolds an example package, then deliberately adds and reverts a violating deep import to confirm the config fails and passes as expected. - Use Case: A team adopting a src/packages/<name>/ layout wants to stop other packages from importing lib/ internals directly; this Skill sets up the lint rule, documents the convention in a packages README, and links it from CLAUDE.md or AGENTS.md. ## Quick Start Ask the agent to set up deep-module boundaries with dependency-cruiser for the packages in this TypeScript repo.

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

Use dependency-cruiser with forbidden rules that block imports into package subfolders from outside code. This Skill installs the tool, writes a .dependency-cruiser.cjs config with entry-point boundary rules, and adds a lint:boundaries script to your check command.

What is a deep module in TypeScript package design?▼

A deep module exposes a small public interface hiding substantial implementation. Here, a package's root files are its entry points, while everything in subfolders like lib/ and tests/ is private and unreachable from other packages or app code.

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, falling back to npm when no lock file matches.

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 whole subtrees are explicitly discouraged.

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

The config must use path-depth patterns with group back-references so same-package imports stay allowed while cross-package deep imports fail. The Skill verifies this by temporarily adding a deep import and confirming lint:boundaries fails, then passes after reverting.