agentleFS
BothSannBothSann/agent-nestjs-skills/skills/nestjs-modular-monolith/SKILL.md

nestjs-modular-monolith

Skill0 starsChanged 8 days agoMITView on GitHub

Set up or prepare a NestJS modular monolith with DDD layers, module contracts, and dependency-cruiser checks proven by a self-test. Use to scaffold, add a module, check boundaries, or assess an existing app.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read structure.md for module code, rules.md before settings/reporting, existing-project.md for existing apps, options.md for requested …

    line 14
  2. Very specific:

    New: only after nest new <name> --package-manager <pm> --strict in this session or layout.freshNestProject: true (untouched starters).

    line 18
  3. Very specific:

    Verify with the project's commands: build/typecheck, lint, unit, e2e, arch, arch:selftest, formatter if any.

    line 25
  4. Distinctive:

    Never weaken or delete a rule, add an ignore, or grow the baseline to pass checks.

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

NestJS modular monolith

Sets up structure and checks. Never designs business boundaries or moves existing code unasked.

Read structure.md for module code, rules.md before settings/reporting, existing-project.md for existing apps, options.md for requested opt-ins. For DDD code, follow installed nestjs-best-practices ddd-* rules.

Steps

  1. node <skill-dir>/scripts/inspect.mjs <root> --no-cruise (read only). Stop/report blockers. Use packageManager.commands. For nest.monorepo, ask which app and set its paths.
  2. New only after nest new <name> --package-manager <pm> --strict in this session or layout.freshNestProject: true (untouched starters). Otherwise existing: follow existing-project.md; report migration preparation.
  3. Install dependency-cruiser with addDev.
  4. Copy assets/dependency-cruiser.cjs to <root>/.dependency-cruiser.cjs. Read it only through the ---- Rules below line; edit only settings, listing generated clients (Prisma) in generatedDirs. Keep the hidden settings export.
  5. Copy scripts/arch-selftest.mjs to <root>/tools/arch-selftest.mjs.
  6. Scripts: arch = depcruise <sourceRoot> [test] --config .dependency-cruiser.cjs (existing: add --ignore-known .dependency-cruiser-known-violations.json); arch:selftest = node tools/arch-selftest.mjs .. Include both in existing check/CI scripts; create CI files only if asked.
  7. New mode: delete AppController, AppService, and their spec only when layout.starterFiles marks them untouched. Remove their AppModule wiring; preserve CLI-added imports (e.g. ObserveModule). Add src/app.module.spec.ts compiling AppModule and an e2e boot test (GET / → 404). Match import suffixes.
  8. User-named modules: node <skill-dir>/scripts/add-module.mjs <root> <kebab-name> creates domain/, application/, infrastructure/, api/, contracts/ with .gitkeep, <name>.module.ts, and index.ts; registers in the root module, preserving import style. Add application/commands/, application/queries/, and shared layers on first use. Never invent business modules; no example module.
  9. Verify with the project's commands: build/typecheck, lint, unit, e2e, arch, arch:selftest, formatter if any. All must pass.

Defaults: directly injected use cases with execute() (no CQRS bus); api/ calls application/ only; domain/ uses no packages; new projects use relative imports, existing aliases stay; base classes/shared files only when needed. Configure through settings or options.md.

Report

Report mode, changes, counts (arch violations/known ones, self-test cases, tests), and rules.md limits: passing arch is not a DDD review. Existing mode: outside files and suggested first module.

Never weaken or delete a rule, add an ignore, or grow the baseline to pass checks. If a rule seems wrong, explain it and let the user choose the setting.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.