Get the FREE Ultimate OpenClaw Setup Guide →

ln-722-backend-generator

Scanned
npx machina-cli add skill levnikolaevich/claude-code-skills/ln-722-backend-generator --openclaw
Files (1)
SKILL.md
6.9 KB

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

AspectDescription
InputProject name, entity list, configuration options
OutputComplete .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

PhaseNameActionsOutput
1Receive ContextGet project name, entities, options from coordinatorConfiguration
2Create SolutionCreate .sln and .csproj filesEmpty solution structure
3Generate DomainCreate entities, enums, base classesDomain project files
4Generate APICreate controllers, DTOs, middlewareAPI project files
5VerifyBuild solution, check referencesBuild success

Phase 1: Receive Context

Accept delegation from ln-720-structure-migrator.

InputTypeRequiredDescription
projectNamestringYesSolution and project name prefix
targetPathstringYesDirectory for generated solution
targetFrameworkstringYes.NET version (e.g., net10.0)
entitieslistYesEntity names to generate
featureslistYesFeature groupings for MockData

Options:

OptionDefaultEffect
useSwaggertrueAdd Swashbuckle for API docs
useSerilogtrueAdd structured logging
useHealthCheckstrueAdd health endpoints
createMockDatatrueGenerate mock data classes

Phase 2: Create Solution

Generate solution file and project structure.

StepActionReference
2.1Create solution directory
2.2Generate .sln file
2.3Create project directorieslayer_structure.md
2.4Generate .csproj files per layerlayer_structure.md
2.5Add project referenceslayer_structure.md

Generated projects:

ProjectPurpose
{Project}.ApiHTTP endpoints, middleware
{Project}.DomainEntities, enums
{Project}.ServicesBusiness logic interfaces
{Project}.RepositoriesData access interfaces
{Project}.SharedCross-cutting utilities

Phase 3: Generate Domain

Create domain layer files.

StepActionReference
3.1Create BaseEntity classentity_patterns.md
3.2Generate entity classes per inputentity_patterns.md
3.3Generate status enumsentity_patterns.md
3.4Create folder structurelayer_structure.md

Entity generation rules:

Entity PropertyGenerated As
Primary keypublic Guid Id { get; set; }
String fieldpublic string Name { get; set; } = string.Empty;
Status fieldpublic {Entity}Status Status { get; set; }
TimestampsCreatedAt, UpdatedAt from BaseEntity

Phase 4: Generate API

Create API layer files.

StepActionReference
4.1Generate Program.csprogram_sections.md
4.2Generate controllers per entitycontroller_patterns.md
4.3Generate DTOs per entitycontroller_patterns.md
4.4Generate middleware classeslayer_structure.md
4.5Generate extension methodsprogram_sections.md
4.6Generate MockData classes (if enabled)layer_structure.md
4.7Add NuGet packagesnuget_packages.md

Controller endpoints per entity:

EndpointMethodRoute
GetAllGET/api/{entities}
GetByIdGET/api/{entities}/{id}
CreatePOST/api/{entities}
UpdatePUT/api/{entities}/{id}
DeleteDELETE/api/{entities}/{id}

Phase 5: Verify

Validate generated solution.

CheckCommandExpected
Solution buildsdotnet buildSuccess, no errors
Project referencesCheck .csprojAll references valid
Files createdDirectory listingAll expected files present

Generated Structure Summary

LayerFoldersFiles per Entity
ApiControllers/, DTOs/, Middleware/, MockData/, Extensions/Controller, DTO
DomainEntities/, Enums/, Common/Entity, Status enum
ServicesInterfaces/Interface (stub)
RepositoriesInterfaces/Interface (stub)
SharedUtility 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

RiskDetectionMitigation
Build failuredotnet build failsCheck .csproj references, verify SDK version
Missing referencesCS0246 errorsAdd missing project references
Invalid entity namesBuild or runtime errorsValidate entity names before generation
Path conflictsFile exists errorsCheck target path, prompt before overwrite
Package restore failureNuGet errorsVerify network, check package names

Reference Files

FilePurpose
references/layer_structure.mdProject organization, folder structure, dependencies
references/entity_patterns.mdEntity generation rules, property patterns
references/controller_patterns.mdController and DTO generation rules
references/program_sections.mdProgram.cs structure and service registration
references/nuget_packages.mdRequired and optional NuGet packages

Version: 2.0.0 Last Updated: 2026-01-10

Source

git clone https://github.com/levnikolaevich/claude-code-skills/blob/master/ln-722-backend-generator/SKILL.mdView on GitHub

Overview

Generates a complete .NET backend structure following Clean Architecture from entity definitions. It outputs a multi-project solution with Api, Domain, Services, Repositories, and Shared layers, plus optional mock data, Swagger, Serilog, and health checks.

How This Skill Works

The skill ingests projectName, targetPath, targetFramework, entities, and features, then scaffolds the solution, creates the .sln and per-layer projects, and generates domain models, enums, and base classes. It then creates API controllers, DTOs, and middleware, and optionally wires mock data and health endpoints, validating the build at the end.

When to Use It

  • Starting a new .NET service with a defined domain model to bootstrap a consistent architecture
  • Bootstrapping a multi-project Clean Architecture solution from an entity list
  • Prototyping APIs with standard domain patterns before implementing business logic
  • Generating mock data scaffolding for early development and UI integration
  • Preparing a ready-to-run solution with optional Swagger, Serilog, and health checks for CI/CD

Quick Start

  1. Step 1: Provide projectName, targetPath, targetFramework, entities, and features as inputs
  2. Step 2: Enable options like useSwagger, useSerilog, useHealthChecks, and createMockData as needed
  3. Step 3: Run the generator, then open the produced {Project}.Api solution, build, and extend with business logic

Best Practices

  • Define a complete entity set before generation and let the tool create domain models and enums
  • Enable optional features (Swagger, Serilog, HealthChecks, MockData) to accelerate initial development
  • Review generated Domain and API layers; add business logic in Services after scaffolding
  • Use the provided mock data to test API controllers and DTO mappings before DB integration
  • Follow the generated naming conventions (e.g., Id as Guid, Status enums) for consistency

Example Use Cases

  • Bootstrap an Inventory service with Product and Stock entities and API controllers
  • Create a User management microservice with User, Role, and Permission entities
  • Set up a Ticketing system backend with Ticket and TicketStatus and associated DTOs
  • Launch a Blog platform skeleton with Post and Comment entities and DTO mappings
  • Build an Order processing service with Order, OrderLine, and Payment entities

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers