scaffold
codewithmukesh/dotnet-claude-kit
Architecture-aware feature scaffolding for .NET 10 projects with complete layer generation.
What is scaffold?
Generates complete feature slices for .NET projects by detecting architecture (VSA, Clean Architecture, DDD, Modular Monolith) and creating all required files: endpoints, handlers, validators, DTOs, EF configuration, and integration tests. Use when starting a new feature or adding entities to ensure every scaffold includes all nine mandatory components.
- Detects project architecture automatically (Vertical Slice, Clean Architecture, DDD, Modular Monolith)
- Generates complete feature slices with endpoint, handler, validator, DTOs, EF configuration, and tests as a single unit
- Learns and matches existing code conventions (naming, folder structure, validation approach)
- Enforces completeness checklist: all nine required components including OpenAPI metadata and CancellationToken handling
- Generates modern C# 14 code with primary constructors, collection expressions, sealed handlers, and TypedResults
- Verifies scaffolds with build and test execution before reporting completion
How to install scaffold
npx skills add https://github.com/codewithmukesh/dotnet-claude-kit --skill scaffold- A .NET 10 project with established architecture (VSA, Clean Architecture, DDD, or Modular Monolith)
- Existing project structure and conventions to learn from (naming patterns, folder organization)
- dotnet-init skill should be run first to initialize the project and CLAUDE.md
How to use scaffold
- 1.Run the skill with a feature request: 'scaffold a Product Catalog feature with CRUD operations'
- 2.Confirm the detected architecture or specify it if ambiguous
- 3.Provide feature name, operations needed (full CRUD or subset), and key entity fields
- 4.Review the generated files across all required layers (endpoint, handler, validator, DTOs, EF config, tests)
- 5.Run 'dotnet build --no-restore' and 'dotnet test --no-build' to verify the scaffold compiles and passes tests
Use cases
- Scaffold a new CRUD feature with all layers after architecture detection
- Generate an endpoint with handler, validator, and integration tests in one operation
- Create a new module in a Modular Monolith with its own DbContext and integration events
- Add an entity with EF configuration and complete feature slice matching project conventions
- Generate bounded pagination list endpoints with proper validation and OpenAPI documentation
- Backend developers building .NET 10 applications with layered architectures
- Teams using Vertical Slice Architecture, Clean Architecture, DDD, or Modular Monolith patterns
- Developers who want consistent, complete feature generation without manual boilerplate
- Architects defining and enforcing feature completeness standards across a codebase
scaffold FAQ
The skill asks you to clarify rather than guessing. Use the architecture-advisor skill to examine folder structure and project references, then specify the architecture explicitly.
Yes. The skill references architecture-patterns.md which contains file placement maps and code shape templates for each architecture. You can customize these templates to match your project's specific conventions.
The skill supports Vertical Slice Architecture, Clean Architecture, DDD, and Modular Monolith. If your project uses a different pattern, you should define your conventions and templates before scaffolding.
The scaffold includes EF Core configuration (IEntityTypeConfiguration<T>) but does not generate migrations. You run 'dotnet ef migrations add' separately after scaffolding.
Every scaffold must include nine components: endpoint, handler, validator, DTOs, EF configuration, integration tests, OpenAPI metadata, CancellationToken handling, and Result pattern. This ensures no half-features and consistent quality across the codebase.
Full instructions (SKILL.md)
Source of truth, from codewithmukesh/dotnet-claude-kit.
name: scaffold description: > Architecture-aware feature scaffolding for .NET 10 projects. Detects the project's architecture (VSA, Clean Architecture, DDD, Modular Monolith) and generates complete feature slices with all required layers: endpoint, handler, validator, DTOs, EF configuration, and integration tests — with the completeness checklist and per-architecture code templates every generated feature must satisfy. Use when: "scaffold", "create feature", "add feature", "new endpoint", "generate", "add entity", "scaffold a module", "add module", or when customizing generation templates or defining what a complete feature slice includes.
/scaffold — Architecture-Aware Feature Scaffolding
What
Generates a complete feature with all required files based on the project's architecture. Never generates half a feature — every scaffold includes the endpoint, handler, validation, DTOs, EF configuration, and at least one integration test as a single unit, written in modern C# 14 (primary constructors, collection expressions, records, sealed handlers, TypedResults).
Supported architectures (file placement maps and code shape templates live in
references/architecture-patterns.md):
- Vertical Slice Architecture (VSA) — single-file features in
Features/ - Clean Architecture (CA) — files split across Domain, Application, Infrastructure, Api
- DDD + Clean Architecture — aggregate roots, value objects, domain events, plus CA layers
- Modular Monolith — self-contained modules with their own DbContext and integration events
When
- "Scaffold a [feature name]", "create an endpoint for", "add a feature"
- "Generate CRUD for", "add entity", "new module", "scaffold a module"
- Starting a new feature after
/planhas produced an approved plan - Customizing generation templates or defining what a complete slice includes
- Any time the user wants a complete, working feature skeleton
How
Step 1: Detect Architecture
Use the architecture-advisor skill to determine the project's architecture:
- Examine folder structure, project references, and existing patterns
- If architecture is ambiguous, ask the user rather than guessing
- Load the matching architecture skill (vertical-slice, clean-architecture, ddd)
Step 2: Clarify Scope
Confirm with the user before generating (skip anything the plan already answers):
- Feature/entity name and operations needed — full CRUD or a subset?
- Key fields and invariants for any new entity
- Module placement (Modular Monolith only) — existing module or new one?
Step 3: Learn Conventions
Use the convention-learner skill and MCP tools to check:
- Naming patterns (
*Handler,*Service,*Endpoint,*Command,*Query) - Folder structure, file organization, access modifiers, sealed conventions
- Existing validation approach (FluentValidation, data annotations, manual)
- Test project structure and naming (
*Tests,*IntegrationTests)
Match what exists. Do not impose new conventions on an established codebase.
Step 4: Generate All Layers
Generate every file the architecture requires, following the templates in
references/architecture-patterns.md:
- VSA — read the VSA section: single-file feature + endpoint group + EF config + tests
- Clean Architecture — read the CA section: Mediator command/handler in Application, endpoint in Api
- DDD — read the DDD section: aggregate with invariants and domain events, thin handler
- Modular Monolith — read the Modular Monolith section: module DbContext, DI registration, integration events
The reference also covers the shared shapes every architecture reuses
(endpoint group, validator, entity + IEntityTypeConfiguration<T> pair,
test fixture) and the anti-patterns to avoid.
Step 5: Completeness Checklist (MANDATORY)
Every scaffolded feature MUST include ALL nine items. Do not skip any:
- Endpoint —
IEndpointGroupfile with a route group; never wired in Program.cs - Handler —
sealed, primary constructor, one per operation - Validator — FluentValidation rules with meaning (ranges, required, max lengths), wired via
.AddEndpointFilter<ValidationFilter<T>>()on mutating endpoints - DTOs — records shaped for the consumer, never 1:1 entity mirrors
- EF configuration —
IEntityTypeConfiguration<T>; no data annotations on entities - Integration tests —
WebApplicationFactory+ Testcontainers, DI replacement viaservices.RemoveAll<DbContextOptions<T>>() - OpenAPI metadata —
.WithName(),.WithSummary(),.Produces<T>(),.ProducesValidationProblem(),.ProducesProblem(404) - CancellationToken — on every async method and passed to every async call
- Result pattern — handlers return
Result<T>; endpoints map success → TypedResults, failure →ToProblemDetails()
Also verify supporting infrastructure — scaffold it if missing: list endpoints
get bounded pagination (page/pageSize, max 50), Program.cs has
app.UseExceptionHandler(), and appsettings.json has a connection string.
Step 6: Verify
Prove the scaffold works before reporting done:
dotnet build --no-restore
dotnet test --no-build --filter "FullyQualifiedName~{FeatureName}"
If the build or tests fail, fix and re-run before presenting results.
Example
User: /scaffold a Product Catalog feature with CRUD operations
Claude: Detected architecture: Vertical Slice Architecture
Created files:
src/Features/Products/CreateProduct.cs -- Command + handler + validator
src/Features/Products/GetProduct.cs -- Query by ID + handler
src/Features/Products/ListProducts.cs -- Paginated list + handler
src/Features/Products/UpdateProduct.cs -- Command + handler + validator
src/Features/Products/DeleteProduct.cs -- Command + handler
src/Features/Products/ProductEndpoints.cs -- IEndpointGroup, OpenAPI metadata
src/Features/Products/ProductConfig.cs -- EF Core configuration
tests/Features/Products/CreateProductTests.cs
tests/Features/Products/GetProductTests.cs
tests/Features/Products/ListProductsTests.cs
Checklist: 9/9 | Build: PASS | Tests: PASS
All files follow your existing conventions (sealed handlers,
primary constructors, TypedResults return types).
Related
dotnet-init— Initialize the project and CLAUDE.md before scaffolding featuresvertical-slice— The VSA patterns the VSA scaffold followsclean-architecture— Layering rules behind the CA scaffoldddd— Aggregate and domain-event patterns behind the DDD scaffoldproject-structure— Where files belong in each architecture
Related skills
More from codewithmukesh/dotnet-claude-kit and the wider catalog.

scalar
Modern API documentation UI for .NET 10, replacing Swagger with faster rendering and built-in dark mode.

security-scan
Deep static security scan for .NET apps across 6 layers: packages, secrets, OWASP patterns, auth, CORS, and data protection.

serilog
Structured logging for .NET 10 with configuration, enrichers, sinks, and request logging.

spec
Turn vague ideas into agreed, persisted specifications through relentless structured questioning.

tdd
Guided red-green-refactor test-driven development for .NET 10 with xUnit, WebApplicationFactory, and Testcontainers.

testing
xUnit v3, WebApplicationFactory, and Testcontainers testing patterns for .NET 10 applications.