PlugWiki

setup-ts-deep-modules Skill for Claude: Enforce Package Boundaries

setup-ts-deep-modules wires dependency-cruiser into a TypeScript repo so each package can only be used through its entry-point files.

Installs
392.5K
on skills.sh
Stars
309.2K
on GitHub
Files
2
besides SKILL.md
Updated
Nov 2026
last repo commit

setup-ts-deep-modules is a skill you invoke yourself. It installs dependency-cruiser, copies a config with four rules, adds a lint:boundaries script, creates an example package, and then proves the rules work by adding a bad import, watching the check fail and removing it. The rules: outsiders import only a package's root files, packages import their own internals freely, tests go through entry points, and no dependency cycles.

It is in the in-progress folder of the mattpocock/skills repo, which the repo calls beta. It uses the codebase-design skill for vocabulary, so install both. It edits package.json, adds files and updates CLAUDE.md or AGENTS.md.

Good for

  • TypeScript developers who want enforced package boundaries in a monorepo
  • Teams whose AI agents keep importing internal files
  • Maintainers who want a copy-me example package and README

Install setup-ts-deep-modules

Claude Code

  1. 1

    Copy this prompt.

    Install the setup-ts-deep-modules skill in Claude Code. Run this command:
    
    npx skills@latest add mattpocock/skills --skill=setup-ts-deep-modules --skill=codebase-design
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

The repo's in-progress README says these skills are left out of the plugin and installed one by one with --skill. codebase-design is the vocabulary skill that SKILL.md tells Claude to call.

From the project README. Source.

What's in the skill

When it loads

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.

Sections in SKILL.md

  1. The shape this enforces
  2. Steps
  3. 1. Detect the environment
  4. 2. Install dependency-cruiser
  5. 3. Write the config
  6. 4. Wire it into the checks
  7. 5. Scaffold the example package
  8. 6. Prove the rules bite
  9. 7. Document the convention
  10. Notes

Key facts

License
MIT
Installs on skills.sh
392,521 as of 2026-11-02
Last commit to the repo
2026-11-01

What it includes

  • Finds package manager, packages root, existing config

    Uses lockfiles to pick pnpm, yarn, bun or npm and src/packages or packages. An existing .dependency-cruiser file is merged into, not overwritten.

    Try: “/setup-ts-deep-modules”

    Files · 1. Detect the environment

  • Adds it as a devDependency

    Runs your package manager's install command.

    Runs code · 2. Install dependency-cruiser

  • Copies dependency-cruiser.config.cjs to .dependency-cruiser.cjs

    Sets PACKAGES_ROOT. Four rules, all errors: entry-point boundary, intra-package freedom, tests through entry points, no cycles.

    Write · 3. Write the config

  • Adds a lint:boundaries script

    Runs depcruise on the packages root and folds it into your typecheck or CI script when one exists.

    Write · 4. Wire it into checks

  • Creates <packages-root>/example/

    An index.ts entry point, a hidden lib/impl.ts and a test that imports only the entry point.

    Write · 5. Scaffold an example package

  • Pass, then fail on a deep import, then pass

    Temporarily adds a deep import to the example test and expects a tests-through-entrypoints failure, then reverts it.

    Runs code · 6. Prove the rules bite

  • Writes a packages README and an agent pointer

    Adds <packages-root>/README.md that discourages barrel files, and one line in CLAUDE.md or AGENTS.md linking to it.

    Write · 7. Document the convention

From the official docs

Permissions

Medium risk

It installs a package and edits several files in your repo, including a temporary change to a test. Run it on a clean branch and review the diff.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It installs a package and edits project files

    Commit or stash first. It changes package.json, adds config and an example package, and edits CLAUDE.md or AGENTS.md.

  • It briefly breaks a test on purpose

    Step 6 adds a deep import to prove the check fails, then reverts it. If a run stops halfway, remove the import from the example test.

Technical details
Talks toPackage registry through your package manager's install
Scopes
  • Installs a dev dependency with your package manager

  • Writes .dependency-cruiser.cjs, an example package, a README and package.json scripts

  • Edits CLAUDE.md or AGENTS.md; temporarily edits a test to prove the rule fails

Questions

What does setup-ts-deep-modules do?

It sets up dependency-cruiser in a TypeScript repo so each package is a deep module: a small public surface of root files and hidden implementation in subfolders. It then checks the rules actually fail on a violation.

How do I install it?

Use the install box at the top of this page. Install it with codebase-design, which it calls for vocabulary. The repo says the in-progress skills are not in its plugin and must be installed one by one.

How do I run it?

SKILL.md says it is user-invoked, with the model's own invocation turned off. Type /setup-ts-deep-modules in a TypeScript repo.

Will it change my project files?

Yes. It adds dependency-cruiser to devDependencies, writes .dependency-cruiser.cjs, edits package.json scripts, creates an example package and README, and adds a line to CLAUDE.md or AGENTS.md. Commit first so you can review the diff.

Does it overwrite an existing dependency-cruiser config?

No. SKILL.md says to merge its four rules and options into an existing config and tell you what was added.

Is it stable?

The repo's in-progress README calls these skills beta: they can change or disappear without warning, and they are left out of the plugin and top-level README.

Is setup-ts-deep-modules safe?

It installs a package and edits your repo, so run it on a clean branch. On skills.sh the audits read Gen Agent Trust Hub pass, Socket pass and Snyk pass.

Information

updated Nov 2, 2026

Folder
skills/in-progress/setup-ts-deep-modules

mattpocock/skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 4
  1. mattpocock/skills in-progress README · github.com
  2. setup-ts-deep-modules SKILL.md · github.com
  3. mattpocock/skills in-progress README · github.com
  4. skills.sh listing and audits · skills.sh

Updated Nov 2, 2026.