Sign in
Explore
Skills · SkillEveryday codingReviewed

setup-ts-deep-modules

Wire dependency-cruiser into a TypeScript repo so each package is a deep module, with implementation hidden in subfolders and reachable only through its entry-point files. User-invoked.

Kind
Skill
Works with
Claude Code
Languages
TypeScript / JavaScript
Source
mattpocock/skills @ 24fe0ef7737e
Path
skills/in-progress/setup-ts-deep-modules/SKILL.md
License
MIT
Jobs
Implementation, Guardrails
InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
# Setup TS Deep Modules

Make every package in this repo a **deep module**: a lot of behaviour behind a small interface. A package's public surface is its **entry points** (the files at the package root), and everything in its subfolders is hidden. This skill installs [dependency-cruiser](https://github.com/sverweij/dependency-cruiser) and the rules that make the entry points the only way in, then proves the rules bite.

For the vocabulary (deep module, interface, seam, depth), call the Skill tool with "codebase-design" and use its language throughout.

## The shape this enforces

```
src/packages/
  <name>/
    index.ts        ← an entry point (public). Import this from outside.
    client.ts       ← another entry point. Packages may expose SEVERAL.
    lib/            ← implementation: hidden from outside, free to import each other.
    tests/          ← co-located tests + fixtures (a subfolder, so private).
```
…