| name | create-module |
| description | Create a new feature module following Clean Architecture structure. Use when adding a new business domain or feature module to the project. |
| argument-hint | ["module-name"] |
| disable-model-invocation | true |
Create a new feature module named "$0" following the Clean Architecture pattern.
Create the following directory structure in src/modules/$0/:
$0/
โโโ domain/
โ โโโ $0.ts # Main aggregate
โ โโโ events/ # Domain events
โ โโโ .gitkeep
โโโ application/
โ โโโ ports/ # Interface definitions
โ โ โโโ $0.port.ts
โ โโโ events/ # Event handlers
โ โ โโโ handlers/
โ โ โโโ .gitkeep
โ โโโ useCases/ # Use cases
โ โ โโโ .gitkeep
โ โโโ ms/ # Microservice entry points
โ โโโ http/
โ โ โโโ .gitkeep
โ โโโ websocket/
โ โ โโโ .gitkeep
โ โโโ tcp/
โ โโโ .gitkeep
โโโ adapters/ # Port implementations
โ โโโ repository/
โ โโโ $0.service.ts
โ โโโ $0.adapter.ts
โ โโโ $0.schema.ts
โ โโโ $0.module.ts
โโโ infrastructure/ # NestJS wiring
โโโ $0.module.ts
Follow these requirements:
- Domain layer: Pure business logic, NO framework dependencies
- Application layer: Use cases and orchestration
- Adapters layer: Repository and external service implementations
- Infrastructure layer: NestJS module wiring with DI configuration
- Import only from allowed layers (respect dependency rule: Infrastructure โ Adapters โ Application โ Domain)
- Follow naming conventions from CLAUDE.md
Create all files with proper imports and basic structure based on the Order module example.