AI Blocks › Build and ship software
TypeScript module guard setter
Point it at a TypeScript repo. Get dependency-cruiser set up so each package is reached only through its front door.
TypeScript module guard setter is a free AI skill for the job "Build and ship software". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · MIT licence · Made by Matt Pocock · Level: advanced
Made by Matt Pocock. See the original on GitHub; we copied it as it is, with its licence.
What it does
A TypeScript repo where each package can only be used through its front door, enforced by lint rules. Nobody can reach into another package's inner files by mistake. The skill sets up dependency-cruiser with four error rules. Code outside a package may import only its root entry files. Files inside a package can import each other freely. Tests go through entry points. Cycles are banned. Packages keep their code in a lib folder and tests in a tests folder. It detects your package manager, finds the packages folder, and merges the rules into any existing config instead of overwriting it. Layering between packages is left as a stub for you to fill.
You give it
- A TypeScript repo
- Your package manager
- Where your packages live (optional)
- Any existing dependency-cruiser config (optional)
You get
- Installed dependency-cruiser
- Four boundary rules in the config
- A merged config if one existed
- A script to run the check
Use it when
- Your packages import each other's inner files and changes keep breaking things.
- You want a simple rule: use the entry file or do not import.
- You are adding dependency-cruiser to an existing TypeScript project.
- You want the check to run in your build.
How to use it
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can run code and read your project files.