setup-ts-deep-modules

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

Updated Aug 11, 2026
One-click install
npx skills add https://github.com/Kunj-Sharma03/agent-contextify --skill setup-ts-deep-modules-kunj-sharma03
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setup-ts-deep-modules
Source: https://github.com/Kunj-Sharma03/agent-contextify/tree/main/skills-main/skills/in-progress/setup-ts-deep-modules
Command: npx skills add https://github.com/Kunj-Sharma03/agent-contextify --skill setup-ts-deep-modules-kunj-sharma03

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dependency-cruiser.

What problem does it solve? TypeScript monorepos often suffer from leaky package boundaries where code reaches deep into other packages' internals, making refactors risky and interfaces meaningless. This Skill wires dependency-cruiser into a repo so every package becomes a deep module: implementation hidden in subfolders, reachable only through its root entry-point files. ## Core Features & Use Cases - Boundary Rule Enforcement: Installs four error-level dependency-cruiser rules covering entry-point boundaries, intra-package freedom, tests-through-entrypoints, and cycle detection. - Guided Setup Workflow: Detects the package manager and packages root, merges with existing configs, adds a lint:boundaries script, and scaffolds an example package as a copy-me template. - Proof the Rules Bite: Verifies the config by observing a pass, then a deliberate failure on a deep import, then a pass again, and documents the convention in the packages README plus CLAUDE.md/AGENTS.md. - Use Case: A team adopting a packages/ layout wants to stop cross-package deep imports; run this Skill to install the config, prove it fails on violations, and leave documentation for future contributors. ## 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 config, adds a lint:boundaries script, and proves the rules fail on deep imports before finishing.

What is a deep module in TypeScript package design?

A deep module exposes a small public interface hiding a lot of implementation. Here, a package's root files are its entry points, while everything in subfolders like lib/ and tests/ is private and unreachable from outside.

Does dependency-cruiser work with pnpm, yarn, or 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 packages expose multiple entry points instead of one index.ts?

Yes. The public surface is every root file of a 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.

What happens if a .dependency-cruiser config already exists?

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

Why does the boundary check not fail on deep imports?

If a deliberately added deep import does not fail, the rules are not wired correctly. The Skill requires observing a pass, a fail on the violation, then a pass again before it is considered complete.