nestjs-service-boundary-guard
OfficialKeep NestJS clean: thin controllers, services.
Software Engineering#architecture#transactions#nestjs#dto-validation#module-boundaries#guard-scope#controller-discipline
Authorlgerard314
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Keep NestJS codebases maintainable by ensuring each module owns a coherent domain, controllers stay thin HTTP glue, services hold all business logic, and DTOs validate everything that crosses a boundary. Triggers on any change touching modules, controllers, services, providers, or DTOs.
Core Features & Use Cases
- Thin controllers: validate DTOs, authorize, delegate to services, and shape responses.
- Stateless services: avoid shared mutable state; use modules to define boundaries.
- Module export surface: publish a clear public API while hiding internals.
- Cross-module imports: route through a feature module's exported API to maintain encapsulation.
- Transaction placement: keep transactions in services or use-cases, not in controllers or repositories.
- DTO validation: use class-validator decorators and ValidationPipe with whitelist/forbidNonWhitelisted.
- Guard/interceptor/pipe scope: apply at the most specific level that achieves the goal.
Quick Start
Apply this guard to a NestJS module and refactor controllers to delegate to services while validating DTOs.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: nestjs-service-boundary-guard Download link: https://github.com/lgerard314/global-plugin/archive/main.zip#nestjs-service-boundary-guard Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.