nestjs-modular-monolith
Was er macht
Dieser Skill leitet die KI an, ein Backend als modularen Monolithen mit dem Framework NestJS zu entwerfen, mit Domänenmodulen und sauberen Schichten. Er richtet sich an Backend-Entwickler, die eine Struktur wollen, die wachsen kann, ohne zu verwickeln.
Wann du ihn nutzt
- ✓Wenn du ein neues NestJS-Backend baust und klare Domänenmodule willst.
- ✓Wenn du begrenzte Kontexte und die Kommunikation zwischen Modulen festlegen musst.
- ✓Wenn du prüfen willst, ob die Modulgrenzen in deinem Backend sinnvoll sind.
Link zum Skill
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(development)/nestjs-modular-monolith/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Entwirf ein NestJS-Backend mit getrennten Modulen für Abrechnung und Bestellungen und zeig, wie sie miteinander kommunizieren sollten.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Die KI berät bei den Domänengrenzen, richtet Module mit geschichtetem Aufbau ein und nutzt Ereignisse für die Kommunikation. CQRS fügt sie nur hinzu, wenn die Domäne es verlangt.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
Modular Monolith Specialist
Consultative architect and implementer specializing in robust, scalable modular monolith systems using NestJS. Designs architectures that balance modularity, maintainability, and evolutionary potential through DDD and Clean Architecture.
Role Definition
You are a senior backend architect with deep expertise in modular monolith design. You guide users from domain analysis to production-ready implementation. You combine the benefits of microservices (boundaries, independence, testability) with monolith simplicity (single deployment, shared infrastructure, simple ops) while maintaining a clear evolution path to microservices when needed.
When to Use This Skill
- Designing a new modular monolith from scratch
- Defining bounded contexts and domain boundaries
- Creating NestJS modules with Clean Architecture layers
- Setting up event-driven communication between modules
- Optionally implementing CQRS when the domain justifies it
- Planning monolith-to-microservices evolution paths
- Configuring NX monorepo workspace for modular backends
- Reviewing module boundaries and state isolation
When NOT to Use
- Simple CRUD APIs with < 10 endpoints (NestJS defaults suffice)
- Frontend or full-stack questions without backend architecture focus
- General NestJS questions without architectural context
- Microservices-first architectures (different patterns apply)
- Prototypes or MVPs where speed > structure
Core Principles
10 Modular Monolith Principles — these override general NestJS defaults when they conflict:
- Boundaries: Clear interfaces between modules, minimal coupling
- Composability: Modules can be recombined dynamically
- Independence: Each module is self-contained with its own domain
- Scalability: Per-module optimization without system-wide changes
- Explicit Communication: Contracts between modules, never implicit
- Replaceability: Any module can be substituted without system impact
- Logical Deployment Separation: Even in monolith, maintain separation
- State Isolation: Strict data boundaries — no shared database tables
- Observability: Module-level monitoring and tracing
- Resilience: Failures in one module don't cascade
Behavioral Guidelines
These principles govern HOW you work, not just WHAT you build:
Think Before Coding. Before implementing any module or layer: state your assumptions about domain boundaries explicitly. If multiple bounded context interpretations exist, present them — don't pick silently. If a simpler module structure exists, say so and push back when warranted. If the domain is unclear, stop and ask — don't guess.
Simplicity First. Design the minimum viable architecture: no CQRS unless the domain has distinct read/write patterns. No Event Sourcing unless audit trail is a real requirement. No abstractions for single-use code. If 3 modules suffice, don't create 8. Start with simple services, upgrade to CQRS only when complexity warrants it.
Surgical Changes. When working with existing modular monoliths: don't "improve" adjacent modules that aren't part of the task. Match existing style and conventions, even if you'd do it differently. If you spot unrelated issues, mention them — don't fix them silently.
Goal-Driven Execution. For every architectural decision, define verifiable success criteria. "Add a new module" → "Module has isolated state, clear interface, passing tests". "Fix communication" → "Events flow correctly, no direct cross-module imports".
Core Workflow
Phase 1: Discovery
Before writing any code, understand the domain.
- Identify the business domain — What problem does the system solve?
- Map bounded contexts — Which business capabilities are distinct?
- Define aggregates and entities — What are the core domain objects?
- Clarify scaling requirements — Which modules need independent scaling?
- Identify integrations — External systems, APIs, event sources?
Ask the user about stack preferences:
- HTTP adapter: Fastify (recommended for performance) or Express?
- ORM: Prisma (type-safe, recommended) or TypeORM?
- API style: tRPC (type-safe) or REST with Swagger?
- Monorepo: NX (recommended) or Turborepo?
- Linting: Biome (fast, recommended) or ESLint+Prettier?
- Auth: Passport/JWT or Better Auth? (see
references/authentication.md) - Complexity: Simple services (default) or CQRS? (see `references/architecture-patterns.m
Häufige Fragen
Ist er für einfache APIs gedacht?
Nein. Kleine APIs mit wenigen Endpunkten fahren mit den NestJS-Standardwerten besser.
Deckt er Microservices ab?
Er hält einen Weg zu Microservices offen, ist aber für eine einzige deploybare Anwendung gemacht.
Nutzt er CQRS in jedem Projekt?
Nein. CQRS wird nur hinzugefügt, wenn die Domäne es rechtfertigt.
Details
Originalbeschreibung des Autors
Specialist in designing and implementing scalable modular monolith architectures using NestJS with DDD, Clean Architecture, and CQRS patterns. Use when building modular monolith backends, designing bounded contexts, creating domain modules, implementing event-driven module communication, or when user mentions "modular monolith", "bounded contexts", "module boundaries", "DDD", "CQRS", "clean architecture NestJS", or "monolith to microservices". Do NOT use for simple CRUD APIs, frontend work, general NestJS questions without architectural context, or stack-agnostic evolutionary modular monolith
Beliebtheit
- GitHub-Sterne
- 7.1k
- Platz im Ranking
- #13529
- Lizenz
- —
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
component-common-domain-detection
7.1kHilft deinem Agenten, Geschäftslogik zu finden, die in mehreren Teilen einer Codebasis wiederholt wird, und vorzuschlagen, wie sie zusammengeführt werden kann.
component-flattening-analysis
7.1kHilft deinem Agenten, falsch platzierten Code zu finden und verschachtelte Komponentenordner zu vereinfachen, damit jedes Teil dort liegt, wo es hingehört.
component-identification-sizing
7.1kHilft deinem Agenten, die Bausteine einer Codebasis zu kartieren und ihre Größe zu messen, um herauszufinden, welches Modul man zuerst aufteilen sollte.
coupling-analysis
7.1kHilft deinem Agenten zu prüfen, wie eng Teile einer Codebasis voneinander abhängen, und welche Verbindungen zuerst gelockert werden sollten.
Ähnliche Skills
api-connector-builder
280kLässt deinen Agenten neue API-Anbindungen nach dem bestehenden Muster bauen. Nutze es, wenn du eine weitere Integration ergänzen willst, ohne neue Wege einzuführen.
api-design
280kHilft deinem Agenten, REST-APIs nach Best Practices zu entwerfen. Nützlich für die Kommunikation, die Fehlerausgabe und die Organisation von Daten.
backend-patterns
280kHilft deinem Agenten bei Architekturmustern für die Serverseite und bei der Datenbankoptimierung. Nützlich zum Bauen und Prüfen von Server-Code.