setup-ts-deep-modules

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

10|3|Updated Jul 18, 2019
One-click install
npx skills add https://github.com/tanqimin/MyFavsORM --skill setup-ts-deep-modules-tanqimin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-ts-deep-modules
Source: https://github.com/tanqimin/MyFavsORM/tree/main/.agents/skills/setup-ts-deep-modules
Command: npx skills add https://github.com/tanqimin/MyFavsORM --skill setup-ts-deep-modules-tanqimin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dependency-cruiser.

What problem does it solve? TypeScript monorepos often suffer from leaky package boundaries where code imports deep into other packages' internals, making refactoring risky and coupling modules together. This Skill wires dependency-cruiser into a repo so each package is a deep module: implementation hidden in subfolders and 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 make a package's root files its only public surface. - 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. - Proof the rules bite: Scaffolds an example package, then verifies the lint passes, fails on a deliberately added deep import, and passes again after revert. - Use Case: A team adopting a packages-based monorepo wants to stop cross-package deep imports; the Skill installs the config, adds a lint:boundaries script to the CI check command, and documents the convention in the packages README and CLAUDE.md/AGENTS.md. ## Quick Start Ask the agent to set up deep module boundaries 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 package boundaries in a TypeScript monorepo?

Use dependency-cruiser with forbidden rules that restrict imports to each package's root entry-point files. This Skill installs the config, adds a lint:boundaries script, and folds it into the repo's existing check command alongside typecheck.

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 such as lib/ and tests/ is private and unreachable from outside the package.

Does dependency-cruiser work with pnpm, yarn, or bun?

Yes. The setup detects the package manager from lock files: pnpm-lock.yaml for pnpm, yarn.lock for yarn, bun.lockb for bun, and npm otherwise. dependency-cruiser is installed as a devDependency using whichever manager is detected.

Can packages expose multiple entry points instead of one index.ts?

Yes. The public surface is every root file of a package, so it can expose several small entry points like index.ts, client.ts, and server.ts. Barrel files that re-export entire subtrees are explicitly discouraged.

What happens if the repo already has a dependency-cruiser config?

The existing config is not overwritten. The four boundary rules and options are merged into the existing .dependency-cruiser file, and the user is told exactly what was added.

Why does the boundary lint not fail on deep imports?

The rules only bite if PACKAGES_ROOT matches the actual packages directory and the config uses group back-references correctly. The Skill verifies this by adding a temporary deep import, confirming lint:boundaries fails, then reverting it.