Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.
ln-722-backend-generator
Type: L3 Worker
Category: 7XX Project Bootstrap
Parent: ln-720-structure-migrator
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
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
1---2name: ln-722-backend-generator3description: Generates .NET Clean Architecture backend structure from entity definitions4license: MIT5---67> **Paths:** File paths (`shared/`, `references/`, `../ln-*`) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.89# ln-722-backend-generator1011**Type:** L3 Worker12**Category:** 7XX Project Bootstrap13**Parent:** ln-720-structure-migrator1415Generates complete .NET backend structure following Clean Architecture principles.1617---1819## Purpose & Scope2021| Aspect | Description |22|--------|-------------|23| **Input** | Project name, entity list, configuration options |24| **Output** | Complete .NET solution with layered architecture |25| **Target** | .NET 10+, ASP.NET Core |2627**Scope boundaries:**28- Generates project structure and boilerplate code29- Creates MockData for initial development30- Does not implement business logic or database connections3132---3334## Workflow3536| Phase | Name | Actions | Output |37|-------|------|---------|--------|38| 1 | Receive Context | Get project name, entities, options from coordinator | Configuration |39| 2 | Create Solution | Create .sln and .csproj files | Empty solution structure |40| 3 | Generate Domain | Create entities, enums, base classes | Domain project files |41| 4 | Generate API | Create controllers, DTOs, middleware | API project files |42| 5 | Verify | Build solution, check references | Build success |4344---4546## Phase 1: Receive Context4748Accept delegation from ln-720-structure-migrator.4950| Input | Type | Required | Description |51|-------|------|----------|-------------|52| `projectName` | string | Yes | Solution and project name prefix |53| `targetPath` | string | Yes | Directory for generated solution |54| `targetFramework` | string | Yes | .NET version (e.g., net10.0) |55| `entities` | list | Yes | Entity names to generate |56| `features` | list | Yes | Feature groupings for MockData |5758**Options:**5960| Option | Default | Effect |61|--------|---------|--------|62| `useSwagger` | true | Add Swashbuckle for API docs |63| `useSerilog` | true | Add structured logging |64| `useHealthChecks` | true | Add health endpoints |65| `createMockData` | true | Generate mock data classes |6667---6869## Phase 2: Create Solution7071Generate solution file and project structure.7273| Step | Action | Reference |74|------|--------|-----------|75| 2.1 | Create solution directory | — |76| 2.2 | Generate .sln file | — |77| 2.3 | Create project directories | `layer_structure.md` |78| 2.4 | Generate .csproj files per layer | `layer_structure.md` |79| 2.5 | Add project references | `layer_structure.md` |8081**Generated projects:**8283| Project | Purpose |84|---------|---------|85| `{Project}.Api` | HTTP endpoints, middleware |86| `{Project}.Domain` | Entities, enums |87| `{Project}.Services` | Business logic interfaces |88| `{Project}.Repositories` | Data access interfaces |89| `{Project}.Shared` | Cross-cutting utilities |9091---9293## Phase 3: Generate Domain9495Create domain layer files.9697| Step | Action | Reference |98|------|--------|-----------|99| 3.1 | Create `BaseEntity` class | `entity_patterns.md` |100| 3.2 | Generate entity classes per input | `entity_patterns.md` |101| 3.3 | Generate status enums | `entity_patterns.md` |102| 3.4 | Create folder structure | `layer_structure.md` |103104**Entity generation rules:**105106| Entity Property | Generated As |107|-----------------|--------------|108| Primary key | `public Guid Id { get; set; }` |109| String field | `public string Name { get; set; } = string.Empty;` |110| Status field | `public {Entity}Status Status { get; set; }` |111| Timestamps | `CreatedAt`, `UpdatedAt` from BaseEntity |112113---114115## Phase 4: Generate API116117Create API layer files.118119| Step | Action | Reference |120|------|--------|-----------|121| 4.1 | Generate Program.cs | `program_sections.md` |122| 4.2 | Generate controllers per entity | `controller_patterns.md` |123| 4.3 | Generate DTOs per entity | `controller_patterns.md` |124| 4.4 | Generate middleware classes | `layer_structure.md` |125| 4.5 | Generate extension methods | `program_sections.md` |126| 4.6 | Generate MockData classes (if enabled) | `layer_structure.md` |127| 4.7 | Add NuGet packages | `nuget_packages.md` |128129**Controller endpoints per entity:**130131| Endpoint | Method | Route |132|----------|--------|-------|133| GetAll | GET | `/api/{entities}` |134| GetById | GET | `/api/{entities}/{id}` |135| Create | POST | `/api/{entities}` |136| Update | PUT | `/api/{entities}/{id}` |137| Delete | DELETE | `/api/{entities}/{id}` |138139---140141## Phase 5: Verify142143Validate generated solution.144145| Check | Command | Expected |146|-------|---------|----------|147| Solution builds | `dotnet build` | Success, no errors |148| Project references | Check .csproj | All references valid |149| Files created | Directory listing | All expected files present |150151---152153## Generated Structure Summary154155| Layer | Folders | Files per Entity |156|-------|---------|------------------|157| Api | Controllers/, DTOs/, Middleware/, MockData/, Extensions/ | Controller, DTO |158| Domain | Entities/, Enums/, Common/ | Entity, Status enum |159| Services | Interfaces/ | Interface (stub) |160| Repositories | Interfaces/ | Interface (stub) |161| Shared | — | Utility classes |162163---164165## Critical Rules166167- **Single Responsibility:** Generate only backend structure, no frontend168- **Idempotent:** Can re-run to regenerate (will overwrite)169- **Build Verification:** Must verify `dotnet build` passes170- **Clean Architecture:** Respect layer dependencies (inner layers independent)171- **No Business Logic:** Generate structure only, not implementation172- **MockData First:** Enable immediate API testing without database173174---175176## Definition of Done177178- [ ] Solution file created with all projects179- [ ] All project references configured correctly180- [ ] Domain entities generated for all input entities181- [ ] Controllers generated with CRUD endpoints182- [ ] DTOs generated for request/response183- [ ] MockData classes generated (if enabled)184- [ ] Program.cs configured with all services185- [ ] `dotnet build` passes successfully186- [ ] Swagger UI accessible (if enabled)187188---189190## Risk Mitigation191192| Risk | Detection | Mitigation |193|------|-----------|------------|194| Build failure | `dotnet build` fails | Check .csproj references, verify SDK version |195| Missing references | CS0246 errors | Add missing project references |196| Invalid entity names | Build or runtime errors | Validate entity names before generation |197| Path conflicts | File exists errors | Check target path, prompt before overwrite |198| Package restore failure | NuGet errors | Verify network, check package names |199200---201202## Reference Files203204| File | Purpose |205|------|---------|206| `references/layer_structure.md` | Project organization, folder structure, dependencies |207| `references/entity_patterns.md` | Entity generation rules, property patterns |208| `references/controller_patterns.md` | Controller and DTO generation rules |209| `references/program_sections.md` | Program.cs structure and service registration |210| `references/nuget_packages.md` | Required and optional NuGet packages |211212---213214**Version:** 2.0.0215**Last Updated:** 2026-01-10