nestjs-oop-design-patterns
NestJS OOP and Design Patterns
Improve changeability and correctness through clear responsibilities, encapsulated invariants, and deliberate collaboration. Use patterns to solve observed forces, never as decoration.
Pre-execution conflict guard
Run this guard after identifying every applicable skill and before editing files, installing packages, generating code, running migrations, or executing any other state-changing command. Read-only inspection is allowed while resolving the guard.
Prerequisites
- Read the relevant code, callers, tests, Nest module wiring, repository instructions, and the coordination contract of every other active skill.
- Identify the observed design pressure, behavior that must be preserved, and the files and commands likely to be affected.
- Do not select a pattern until architecture and runtime constraints that shape it are known.
Primary ownership
This skill leads decisions about object responsibilities, invariant placement, encapsulation, collaborator contracts, SOLID trade-offs, design-pattern selection, and behavior-preserving class-level refactoring.
It shares provider/module placement with nestjs-architecture-principles and shares Nest lifecycle placement and test seams with nestjs-features-performance. It yields capability, data, transaction, dependency, and deployment boundaries to the architecture skill. It yields framework lifecycle mechanisms, transport/error contracts, security controls, operational testing, performance, and delivery mechanics to the features skill.