nestjs-modular-monolith
Fungsinya
Skill ini memandu AI dalam merancang aplikasi backend sebagai monolit modular menggunakan framework NestJS, dengan modul domain dan lapisan yang bersih. Skill ini ditujukan untuk pengembang backend yang menginginkan struktur yang bisa berkembang tanpa menjadi kusut.
Kapan dipakai
- βSaat Anda membangun backend NestJS baru dan menginginkan modul domain yang jelas.
- βKetika Anda perlu menentukan bounded context dan cara modul-modul berkomunikasi.
- βKetika Anda ingin meninjau apakah batas modul di backend Anda sudah baik.
Link skill
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(development)/nestjs-modular-monolith/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βRancang backend NestJS dengan modul terpisah untuk penagihan dan pesanan, dan tunjukkan bagaimana keduanya seharusnya berkomunikasi.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
AI memberi masukan tentang batas domain, menyiapkan modul dengan struktur berlapis, dan memakai event untuk komunikasi, serta menambahkan CQRS hanya jika domainnya memerlukannya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
Pertanyaan umum
Apakah ini untuk API sederhana?
Tidak. API kecil dengan sedikit endpoint lebih cocok memakai default NestJS.
Apakah skill ini menangani microservices?
Skill ini membiarkan jalan ke microservices terbuka di kemudian hari, tetapi dirancang untuk satu aplikasi yang dapat di-deploy.
Apakah skill ini memakai CQRS untuk setiap proyek?
Tidak. CQRS hanya ditambahkan jika domainnya membenarkannya.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 7.1k
- Peringkat
- #13529
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
component-common-domain-detection
7.1kMembantu agent Anda menemukan logika bisnis yang berulang di beberapa bagian basis kode dan menyarankan cara menggabungkannya.
component-flattening-analysis
7.1kMembantu agent Anda menemukan kode yang salah tempat dan meratakan struktur folder komponen yang berantakan, agar setiap bagian berada di tempat yang seharusnya.
component-identification-sizing
7.1kMembantu agent Anda memetakan bagian-bagian basis kode dan mengukur ukurannya, untuk menemukan modul mana yang sebaiknya dipecah lebih dulu.
coupling-analysis
7.1kMembantu agent Anda memeriksa seberapa erat bagian-bagian basis kode saling bergantung, dan koneksi mana yang sebaiknya dilonggarkan lebih dulu.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.