references/controller_patterns.md
# Controller Generation Patterns
<!-- SCOPE: ASP.NET Core controller generation rules ONLY. Contains naming conventions, route patterns, CRUD templates. -->
<!-- DO NOT add here: Generation workflow → ln-722-backend-generator SKILL.md -->
Rules for generating ASP.NET Core Controllers in Clean Architecture.
---
## Controller Structure
| Element | Convention | Purpose |
|---------|------------|---------|
| Class name | `{Entity}Controller` | Naming convention |
| Base class | `ControllerBase` | API controller base |
| Route | `api/[controller]` | RESTful routing |
| Attributes | `[ApiController]`, `[Route]` | API behavior |
---
## Standard CRUD Endpoints
| Operation | HTTP Method | Route | Returns |
|-----------|-------------|-------|---------|
| Get all | `GET` | `/api/{entities}` | `IEnumerable<{Entity}Dto>` |
| Get by ID | `GET` | `/api/{entities}/{id}` | `{Entity}Dto` or 404 |
| Create | `POST` | `/api/{entities}` | `{Entity}Dto` with 201 |
| Update | `PUT` | `/api/{entities}/{id}` | `{Entity}Dto` or 404 |
| Delete | `DELETE` | `/api/{entities}/{id}` | 204 or 404 |
---
## Endpoint Generation Rules
| Endpoint Type | Action Name | Attributes | Response |
|---------------|-------------|------------|----------|
| Get all | `GetAll()` | `[HttpGet]` | `Ok(list)` |
| Get by ID | `GetById(Guid id)` | `[HttpGet("{id}")]` | `Ok(item)` or `NotFound()` |
| Create | `Create({Entity}CreateDto dto)` | `[HttpPost]` | `CreatedAtAction(...)` |
| Update | `Update(Guid id, {Entity}UpdateDto dto)` | `[HttpPut("{id}")]` | `Ok(item)` or `NotFound()` |
| Delete | `Delete(Guid id)` | `[HttpDelete("{id}")]` | `NoContent()` or `NotFound()` |
---
## DTO Patterns
| DTO Type | Purpose | Properties |
|----------|---------|------------|
| `{Entity}Dto` | Response DTO | All readable properties |
| `{Entity}CreateDto` | Create request | Required fields only |
| `{Entity}UpdateDto` | Update request | Updatable fields only |
| `{Entity}ListDto` | List item (summary) | Subset for lists |
---
## Dependency Injection
| Dependency | Purpose | Injection |
|------------|---------|-----------|
| `ILogger<{Entity}Controller>` | Logging | Constructor |
| `I{Entity}Service` | Business logic | Constructor (when services implemented) |
| MockData class | Development data | Static method call |
---
## Response Patterns
| Scenario | Response Method | HTTP Status |
|----------|-----------------|-------------|
| Success with data | `Ok(data)` | 200 |
| Created resource | `CreatedAtAction(...)` | 201 |
| No content | `NoContent()` | 204 |
| Not found | `NotFound()` | 404 |
| Bad request | `BadRequest(errors)` | 400 |
| Validation error | `ValidationProblem()` | 400 |
---
## Route Naming Conventions
| Entity | Controller Route | Example URLs |
|--------|------------------|--------------|
| `Epic` | `api/epics` | `GET /api/epics`, `GET /api/epics/{id}` |
| `Story` | `api/stories` | `GET /api/stories`, `POST /api/stories` |
| `User` | `api/users` | `GET /api/users/{id}`, `PUT /api/users/{id}` |
**Rule:** Pluralize entity name for route.
---
## MockData Integration
For initial development without database:
| Pattern | Usage |
|---------|-------|
| Static data class | `{Feature}MockData` |
| Get all method | `{Feature}MockData.Get{Entities}()` |
| Get by ID method | `{Feature}MockData.Get{Entity}ById(id)` |
---
## Controller Generation Checklist
| Step | Action |
|------|--------|
| 1 | Create controller class with attributes |
| 2 | Add constructor with ILogger |
| 3 | Generate GetAll endpoint |
| 4 | Generate GetById endpoint |
| 5 | Generate Create endpoint (if needed) |
| 6 | Generate Update endpoint (if needed) |
| 7 | Generate Delete endpoint (if needed) |
| 8 | Wire up MockData or Service calls |
---
**Version:** 1.0.0
**Last Updated:** 2026-01-10
references/entity_patterns.md
# Entity Generation Patterns
<!-- SCOPE: .NET entity generation rules ONLY. Contains BaseEntity structure, property conventions, relationship patterns. -->
<!-- DO NOT add here: Generation workflow → ln-722-backend-generator SKILL.md -->
Rules for generating Domain entities in .NET Clean Architecture.
---
## Base Entity Structure
All entities inherit from `BaseEntity` with common properties.
| Property | Type | Purpose | Required |
|----------|------|---------|----------|
| `Id` | `Guid` | Unique identifier | Yes |
| `CreatedAt` | `DateTime` | Creation timestamp | Yes |
| `UpdatedAt` | `DateTime?` | Last modification timestamp | Optional |
| `CreatedBy` | `string?` | Creator identifier | Optional |
| `UpdatedBy` | `string?` | Modifier identifier | Optional |
---
## Property Generation Rules
| Input Type | C# Type | Attributes | Notes |
|------------|---------|------------|-------|
| String (required) | `string` | `required` | Non-nullable string |
| String (optional) | `string?` | None | Nullable string |
| Integer | `int` | None | Default 0 |
| Boolean | `bool` | None | Default false |
| Date/Time | `DateTime` | None | Use UTC convention |
| Decimal | `decimal` | None | For money/precise values |
| Enum reference | `{Entity}Status` | None | Enum type |
| Foreign key | `Guid` | None | Reference to other entity |
| Navigation | `{Related}?` | `virtual` | EF Core navigation property |
---
## Entity Naming Conventions
| Element | Convention | Example |
|---------|------------|---------|
| Class name | PascalCase, singular | `Epic`, `Story`, `User` |
| Property name | PascalCase | `Title`, `CreatedAt` |
| Foreign key | Related entity + "Id" | `EpicId`, `UserId` |
| Navigation property | Related entity name | `Epic`, `Stories` |
| Collection navigation | Plural of related | `Stories`, `Tasks` |
---
## Status Enum Generation
For each entity with status, generate corresponding enum.
| Enum Name | Values Pattern | Notes |
|-----------|----------------|-------|
| `{Entity}Status` | Domain-specific values | e.g., Draft, Active, Completed |
| `Priority` | Urgent, High, Normal, Low | If priority field exists |
**Common status patterns:**
| Entity Type | Typical Statuses |
|-------------|------------------|
| Work item | Draft, Active, InProgress, Done, Cancelled |
| User | Pending, Active, Suspended, Deleted |
| Request | Submitted, Processing, Approved, Rejected |
---
## Relationship Patterns
| Relationship | Parent Entity | Child Entity |
|--------------|---------------|--------------|
| One-to-Many | No FK, has collection | Has FK property |
| Many-to-One | Has FK property | No FK |
| Many-to-Many | Join table | Join table |
**FK naming:** `{ParentEntity}Id` in child entity.
---
## Validation Annotations
| Constraint | Annotation | When to Use |
|------------|------------|-------------|
| Required | `required` keyword | Non-nullable value types, required strings |
| Max length | `[MaxLength(N)]` | String length limits |
| Range | `[Range(min, max)]` | Numeric constraints |
| Regex | `[RegularExpression]` | Format validation |
---
## Default Values
| Type | Default | How to Set |
|------|---------|------------|
| `string` | `string.Empty` | `= string.Empty;` |
| `DateTime` | None (must set) | Set in constructor or service |
| `Guid` | Empty | Generate with `Guid.NewGuid()` |
| `int`, `bool` | 0, false | CLR defaults |
| Collections | Empty list | `= new List<T>();` |
---
## Entity Generation Checklist
| Step | Action |
|------|--------|
| 1 | Create class inheriting `BaseEntity` |
| 2 | Add domain-specific properties |
| 3 | Add foreign key properties (if relationships) |
| 4 | Add navigation properties (if relationships) |
| 5 | Generate status enum (if status field) |
| 6 | Add `required` for non-nullable strings |
| 7 | Initialize collections in declaration |
---
**Version:** 1.0.0
**Last Updated:** 2026-01-10
references/layer_structure.md
# Clean Architecture Layer Structure
<!-- SCOPE: .NET Clean Architecture layer definitions ONLY. Contains layer responsibilities, dependencies, project names. -->
<!-- DO NOT add here: Generation workflow → ln-722-backend-generator SKILL.md -->
Structure and responsibilities for .NET Clean Architecture projects.
---
## Layer Overview
| Layer | Project Name | Purpose | Dependencies |
|-------|--------------|---------|--------------|
| **API** | `{Project}.Api` | HTTP endpoints, request handling | Domain, Services |
| **Domain** | `{Project}.Domain` | Business entities, core logic | None (independent) |
| **Services** | `{Project}.Services` | Business logic, orchestration | Domain, Repositories |
| **Repositories** | `{Project}.Repositories` | Data access abstraction | Domain |
| **Shared** | `{Project}.Shared` | Cross-cutting utilities | None |
---
## Dependency Rules
| Layer | Can Depend On | Cannot Depend On |
|-------|---------------|------------------|
| Api | Domain, Services, Shared | Repositories (direct) |
| Services | Domain, Repositories (interfaces), Shared | Api |
| Repositories | Domain, Shared | Api, Services |
| Domain | Shared | Api, Services, Repositories |
| Shared | Nothing | All other layers |
**Key principle:** Dependencies point inward. Outer layers depend on inner layers, never the reverse.
---
## API Layer Structure
| Folder | Purpose | Contents |
|--------|---------|----------|
| `Controllers/` | HTTP endpoints | One controller per entity/feature |
| `DTOs/` | Data transfer objects | Request/Response classes |
| `Middleware/` | Cross-cutting concerns | Exception handling, logging, correlation |
| `Extensions/` | Service configuration | DI registration, middleware setup |
| `MockData/` | Development data | Static mock data classes |
---
## Domain Layer Structure
| Folder | Purpose | Contents |
|--------|---------|----------|
| `Entities/` | Business entities | Entity classes inheriting BaseEntity |
| `Enums/` | Domain enumerations | Status, Priority, Type enums |
| `Common/` | Shared base classes | BaseEntity, ValueObject |
| `Events/` | Domain events | Event classes (optional) |
| `Exceptions/` | Domain exceptions | Custom exception types (optional) |
---
## Services Layer Structure
| Folder | Purpose | Contents |
|--------|---------|----------|
| `Interfaces/` | Service contracts | I{Entity}Service interfaces |
| Root | Service implementations | {Entity}Service classes |
| `Validators/` | Business validation | FluentValidation classes (optional) |
---
## Repositories Layer Structure
| Folder | Purpose | Contents |
|--------|---------|----------|
| `Interfaces/` | Repository contracts | I{Entity}Repository interfaces |
| Root | Repository implementations | When DB is connected |
---
## Shared Layer Structure
| Folder | Purpose | Contents |
|--------|---------|----------|
| `Constants/` | Application constants | Configuration keys, magic strings |
| `Extensions/` | Extension methods | String, DateTime, etc. extensions |
| `Helpers/` | Utility classes | Static helper methods |
---
## Project References
| Project | References |
|---------|------------|
| `{Project}.Api.csproj` | Domain, Services, Shared |
| `{Project}.Services.csproj` | Domain, Repositories, Shared |
| `{Project}.Repositories.csproj` | Domain, Shared |
| `{Project}.Domain.csproj` | Shared |
| `{Project}.Shared.csproj` | (none) |
---
## Generation Order
Create projects and files in this sequence.
| Order | Project/Action | Rationale |
|-------|----------------|-----------|
| 1 | Create solution file | Container for all projects |
| 2 | `{Project}.Shared` | No dependencies, foundation |
| 3 | `{Project}.Domain` | Depends only on Shared |
| 4 | `{Project}.Repositories` | Depends on Domain |
| 5 | `{Project}.Services` | Depends on Domain, Repositories |
| 6 | `{Project}.Api` | Depends on all above |
| 7 | Add project references | Wire up dependencies |
---
**Version:** 1.0.0
**Last Updated:** 2026-01-10
references/nuget_packages.md
# NuGet Package Dependencies
<!-- SCOPE: NuGet package reference for .NET projects ONLY. Contains package names, versions, target projects. -->
<!-- DO NOT add here: Generation workflow → ln-722-backend-generator SKILL.md -->
Required and optional packages for .NET Clean Architecture projects.
---
## Core Packages (Always Required)
| Package | Version | Purpose | Project |
|---------|---------|---------|---------|
| None (built-in) | — | ASP.NET Core included in SDK | Api |
---
## Documentation Packages
| Package | Version | Purpose | When to Include |
|---------|---------|---------|-----------------|
| `Swashbuckle.AspNetCore` | Latest | Swagger/OpenAPI documentation | When `useSwagger: true` |
---
## Logging Packages
| Package | Version | Purpose | When to Include |
|---------|---------|---------|-----------------|
| `Serilog.AspNetCore` | Latest | Structured logging integration | When `useSerilog: true` |
| `Serilog.Sinks.Console` | Latest | Console output | When `useSerilog: true` |
| `Serilog.Sinks.File` | Latest | File output | Optional with Serilog |
---
## Health Check Packages
| Package | Version | Purpose | When to Include |
|---------|---------|---------|-----------------|
| `AspNetCore.HealthChecks.UI` | Latest | Health check UI | Optional |
| `AspNetCore.HealthChecks.SqlServer` | Latest | SQL Server health | When using SQL Server |
---
## Data Access Packages (Future)
| Package | Version | Purpose | When to Include |
|---------|---------|---------|-----------------|
| `Microsoft.EntityFrameworkCore` | Latest | ORM | When DB connected |
| `Microsoft.EntityFrameworkCore.SqlServer` | Latest | SQL Server provider | When using SQL Server |
| `Npgsql.EntityFrameworkCore.PostgreSQL` | Latest | PostgreSQL provider | When using PostgreSQL |
---
## Validation Packages (Optional)
| Package | Version | Purpose | When to Include |
|---------|---------|---------|-----------------|
| `FluentValidation.AspNetCore` | Latest | Request validation | When validation needed |
---
## Package Installation by Project
| Project | Required Packages | Optional Packages |
|---------|-------------------|-------------------|
| `{Project}.Api` | Swashbuckle (if Swagger) | Serilog, HealthChecks |
| `{Project}.Domain` | None | FluentValidation |
| `{Project}.Services` | None | None |
| `{Project}.Repositories` | None | EF Core (when DB) |
| `{Project}.Shared` | None | None |
---
## Configuration Matrix
| Option | Packages Added |
|--------|----------------|
| `useSwagger: true` | Swashbuckle.AspNetCore |
| `useSerilog: true` | Serilog.AspNetCore, Serilog.Sinks.Console |
| `useHealthChecks: true` | (built-in, no extra packages) |
---
## Version Strategy
| Strategy | Description |
|----------|-------------|
| Latest stable | Use latest stable version for new projects |
| Lock versions | Pin versions in production projects |
| Central management | Use Directory.Packages.props for consistency |
---
## Package Sources
| Source | URL | Purpose |
|--------|-----|---------|
| NuGet.org | https://api.nuget.org/v3/index.json | Public packages |
| Private feed | Company-specific | Internal packages |
---
**Version:** 1.0.0
**Last Updated:** 2026-01-10
references/program_sections.md
# Program.cs Sections
<!-- SCOPE: ASP.NET Core Program.cs structure ONLY. Contains section order, service registration, middleware pipeline. -->
<!-- DO NOT add here: Generation workflow → ln-722-backend-generator SKILL.md -->
Structure and order of sections in ASP.NET Core Program.cs.
---
## Section Order
| Order | Section | Purpose |
|-------|---------|---------|
| 1 | Builder creation | `WebApplication.CreateBuilder(args)` |
| 2 | Service registration | Add services to DI container |
| 3 | App building | `builder.Build()` |
| 4 | Middleware pipeline | Configure HTTP request pipeline |
| 5 | Endpoint mapping | Map controllers, health checks |
| 6 | App run | `app.Run()` |
---
## Service Registration Sections
| Section | Services | Order |
|---------|----------|-------|
| **Core** | Controllers, EndpointsApiExplorer | First |
| **Documentation** | Swagger/OpenAPI | After core |
| **Cross-cutting** | CORS, HealthChecks | After documentation |
| **Logging** | Serilog, other loggers | After cross-cutting |
| **Application** | Custom services, repositories | Last |
---
## Service Registration Order
| Order | Registration | Purpose |
|-------|--------------|---------|
| 1 | `AddControllers()` | MVC controllers |
| 2 | `AddEndpointsApiExplorer()` | API metadata |
| 3 | `AddSwaggerGen()` | Swagger documentation |
| 4 | `AddCors()` | Cross-origin requests |
| 5 | `AddHealthChecks()` | Health monitoring |
| 6 | `UseSerilog()` | Structured logging (on Host) |
| 7 | Custom services | Application-specific |
---
## Middleware Pipeline Order
| Order | Middleware | Purpose | When to Include |
|-------|------------|---------|-----------------|
| 1 | Exception handler | Global exception handling | Always |
| 2 | HTTPS redirection | Force HTTPS | Production |
| 3 | CORS | Cross-origin policy | When CORS needed |
| 4 | Authentication | Verify identity | When auth enabled |
| 5 | Authorization | Check permissions | When auth enabled |
| 6 | Swagger | API documentation | Development |
| 7 | Static files | Serve static content | When needed |
| 8 | Routing | Route resolution | Always |
| 9 | Endpoints | Controller mapping | Always |
---
## Environment-Specific Configuration
| Environment | Configuration |
|-------------|---------------|
| Development | Swagger enabled, detailed errors, CORS permissive |
| Production | Swagger disabled, generic errors, CORS restrictive |
**Pattern:** Use `app.Environment.IsDevelopment()` for conditional middleware.
---
## Extension Method Organization
Break Program.cs into extension methods for clarity.
| Extension | Purpose | Called On |
|-----------|---------|-----------|
| `AddApiServices()` | Register API services | `IServiceCollection` |
| `AddSwaggerServices()` | Configure Swagger | `IServiceCollection` |
| `AddCorsPolicy()` | Configure CORS | `IServiceCollection` |
| `UseApiMiddleware()` | Configure middleware | `WebApplication` |
---
## Health Checks Configuration
| Check | Purpose | Endpoint |
|-------|---------|----------|
| Basic | App is running | `/health` |
| Ready | App is ready to serve | `/health/ready` |
| Live | App is alive | `/health/live` |
---
## Logging Configuration
| Provider | Purpose | Environment |
|----------|---------|-------------|
| Console | Development output | All |
| File | Persistent logs | All |
| Seq/Elasticsearch | Centralized logging | Production |
---
## Program.cs Generation Checklist
| Step | Action |
|------|--------|
| 1 | Create WebApplicationBuilder |
| 2 | Add Controllers and API Explorer |
| 3 | Add Swagger (if enabled) |
| 4 | Add CORS (if enabled) |
| 5 | Add HealthChecks (if enabled) |
| 6 | Configure Serilog (if enabled) |
| 7 | Build application |
| 8 | Configure exception middleware |
| 9 | Configure CORS middleware |
| 10 | Configure Swagger middleware |
| 11 | Map controllers |
| 12 | Map health checks |
| 13 | Run application |
---
**Version:** 1.0.0
**Last Updated:** 2026-01-10
SKILL.md
---
name: ln-722-backend-generator
description: "Generates .NET Clean Architecture backend structure from entity definitions. Use when bootstrapping .NET backend projects."
license: MIT
---
> **Paths:** File paths (`references/`, `../ln-*`) are relative to this skill directory.
# ln-722-backend-generator
**Type:** L3 Worker
**Category:** 7XX Project Bootstrap
Generates complete .NET backend structure following Clean Architecture principles.
---
## Purpose & Scope
| Aspect | Description |
|--------|-------------|
| **Input** | Project name, entity list, configuration options |
| **Output** | Complete .NET solution with layered architecture |
| **Target** | .NET 10+, ASP.NET Core |
**Scope boundaries:**
- Generates project structure and boilerplate code
- Creates MockData for initial development
- Does not implement business logic or database connections
---
## Workflow
| Phase | Name | Actions | Output |
|-------|------|---------|--------|
| 1 | Receive Context | Get project name, entities, options from coordinator | Configuration |
| 2 | Create Solution | Create .sln and .csproj files | Empty solution structure |
| 3 | Generate Domain | Create entities, enums, base classes | Domain project files |
| 4 | Generate API | Create controllers, DTOs, middleware | API project files |
| 5 | Verify | Build solution, check references | Build success |
---
## Phase 1: Receive Context
Accept delegation from ln-720-structure-migrator.
| Input | Type | Required | Description |
|-------|------|----------|-------------|
| `projectName` | string | Yes | Solution and project name prefix |
| `targetPath` | string | Yes | Directory for generated solution |
| `targetFramework` | string | Yes | .NET version (e.g., net10.0) |
| `entities` | list | Yes | Entity names to generate |
| `features` | list | Yes | Feature groupings for MockData |
**Options:**
| Option | Default | Effect |
|--------|---------|--------|
| `useSwagger` | true | Add Swashbuckle for API docs |
| `useSerilog` | true | Add structured logging |
| `useHealthChecks` | true | Add health endpoints |
| `createMockData` | true | Generate mock data classes |
---
## Phase 2: Create Solution
Generate solution file and project structure.
| Step | Action | Reference |
|------|--------|-----------|
| 2.1 | Create solution directory | — |
| 2.2 | Generate .sln file | — |
| 2.3 | Create project directories | `layer_structure.md` |
| 2.4 | Generate .csproj files per layer | `layer_structure.md` |
| 2.5 | Add project references | `layer_structure.md` |
**Generated projects:**
| Project | Purpose |
|---------|---------|
| `{Project}.Api` | HTTP endpoints, middleware |
| `{Project}.Domain` | Entities, enums |
| `{Project}.Services` | Business logic interfaces |
| `{Project}.Repositories` | Data access interfaces |
| `{Project}.Shared` | Cross-cutting utilities |
---
## Phase 3: Generate Domain
Create domain layer files.
| Step | Action | Reference |
|------|--------|-----------|
| 3.1 | Create `BaseEntity` class | `entity_patterns.md` |
| 3.2 | Generate entity classes per input | `entity_patterns.md` |
| 3.3 | Generate status enums | `entity_patterns.md` |
| 3.4 | Create folder structure | `layer_structure.md` |
**Entity generation rules:**
| Entity Property | Generated As |
|-----------------|--------------|
| Primary key | `public Guid Id { get; set; }` |
| String field | `public string Name { get; set; } = string.Empty;` |
| Status field | `public {Entity}Status Status { get; set; }` |
| Timestamps | `CreatedAt`, `UpdatedAt` from BaseEntity |
---
## Phase 4: Generate API
Create API layer files.
| Step | Action | Reference |
|------|--------|-----------|
| 4.1 | Generate Program.cs | `program_sections.md` |
| 4.2 | Generate controllers per entity | `controller_patterns.md` |
| 4.3 | Generate DTOs per entity | `controller_patterns.md` |
| 4.4 | Generate middleware classes | `layer_structure.md` |
| 4.5 | Generate extension methods | `program_sections.md` |
| 4.6 | Generate MockData classes (if enabled) | `layer_structure.md` |
| 4.7 | Add NuGet packages | `nuget_packages.md` |
**Controller endpoints per entity:**
| Endpoint | Method | Route |
|----------|--------|-------|
| GetAll | GET | `/api/{entities}` |
| GetById | GET | `/api/{entities}/{id}` |
| Create | POST | `/api/{entities}` |
| Update | PUT | `/api/{entities}/{id}` |
| Delete | DELETE | `/api/{entities}/{id}` |
---
## Phase 5: Verify
Validate generated solution.
| Check | Command | Expected |
|-------|---------|----------|
| Solution builds | `dotnet build` | Success, no errors |
| Project references | Check .csproj | All references valid |
| Files created | Directory listing | All expected files present |
---
## Generated Structure Summary
| Layer | Folders | Files per Entity |
|-------|---------|------------------|
| Api | Controllers/, DTOs/, Middleware/, MockData/, Extensions/ | Controller, DTO |
| Domain | Entities/, Enums/, Common/ | Entity, Status enum |
| Services | Interfaces/ | Interface (stub) |
| Repositories | Interfaces/ | Interface (stub) |
| Shared | — | Utility classes |
---
## Critical Rules
- **Single Responsibility:** Generate only backend structure, no frontend
- **Idempotent:** Can re-run to regenerate (will overwrite)
- **Build Verification:** Must verify `dotnet build` passes
- **Clean Architecture:** Respect layer dependencies (inner layers independent)
- **No Business Logic:** Generate structure only, not implementation
- **MockData First:** Enable immediate API testing without database
---
## Definition of Done
- [ ] Solution file created with all projects
- [ ] All project references configured correctly
- [ ] Domain entities generated for all input entities
- [ ] Controllers generated with CRUD endpoints
- [ ] DTOs generated for request/response
- [ ] MockData classes generated (if enabled)
- [ ] Program.cs configured with all services
- [ ] `dotnet build` passes successfully
- [ ] Swagger UI accessible (if enabled)
---
## Risk Mitigation
| Risk | Detection | Mitigation |
|------|-----------|------------|
| Build failure | `dotnet build` fails | Check .csproj references, verify SDK version |
| Missing references | CS0246 errors | Add missing project references |
| Invalid entity names | Build or runtime errors | Validate entity names before generation |
| Path conflicts | File exists errors | Check target path, prompt before overwrite |
| Package restore failure | NuGet errors | Verify network, check package names |
---
## Reference Files
| File | Purpose |
|------|---------|
| `references/layer_structure.md` | Project organization, folder structure, dependencies |
| `references/entity_patterns.md` | Entity generation rules, property patterns |
| `references/controller_patterns.md` | Controller and DTO generation rules |
| `references/program_sections.md` | Program.cs structure and service registration |
| `references/nuget_packages.md` | Required and optional NuGet packages |
---
**Version:** 2.0.0
**Last Updated:** 2026-01-10