---
description: Scaffold a backend module (NestJS module or .NET feature folder) with its DI surface.
argument-hint: <module-name> [nest|dotnet]
---

# /create-module

## Purpose

Create a cohesive backend module with controller/service/DTO (Nest) or Domain/Application/Infrastructure slices (.NET), wired into the host's DI.

## Required context

- `CLAUDE.md`, `apps/api-nest/src/modules/`, `dotnet/src/`, `enterprise-modules/README.md`

## Inputs

- `$1` — module name, `$2` — `nest` (default) or `dotnet`

## Execution steps

1. Decide: app-local module vs `enterprise-modules/` package (reused by 2+ apps → enterprise-module).
2. **Nest:** `module.ts` + `service.ts` + `controller.ts` + `dto/`; register in `app.module.ts`.
3. **.NET:** Domain entities + Application handlers + Infrastructure config + controller; register in `DependencyInjection.cs`.
4. Add base tests.

## Validation checklist

- [ ] Builds + DI resolves
- [ ] Respects layer boundaries (`dependency-cruiser` clean)
- [ ] No cross-app imports

## Expected output

A registered, testable module.

## Failure handling

If it should be an enterprise-module, write a one-line ADR justifying the boundary first.
