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.
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 /plan has 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:
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 — IEndpointGroup file 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 via services.RemoveAll<DbContextOptions<T>>()
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 features
vertical-slice — The VSA patterns the VSA scaffold follows
clean-architecture — Layering rules behind the CA scaffold
ddd — Aggregate and domain-event patterns behind the DDD scaffold
project-structure — Where files belong in each architecture
1---
2name: scaffold
3description: >
4 Architecture-aware feature scaffolding for .NET 10 projects. Detects the
5 project's architecture (VSA, Clean Architecture, DDD, Modular Monolith) and
6 generates complete feature slices with all required layers: endpoint,
7 handler, validator, DTOs, EF configuration, and integration tests — with
8 the completeness checklist and per-architecture code templates every
9 generated feature must satisfy.
10 Use when: "scaffold", "create feature", "add feature", "new endpoint",
11 "generate", "add entity", "scaffold a module", "add module", or when
12 customizing generation templates or defining what a complete feature slice
13 includes.
14---
1516# /scaffold — Architecture-Aware Feature Scaffolding
1718## What
1920Generates a complete feature with all required files based on the project's
21architecture. Never generates half a feature — every scaffold includes the
22endpoint, handler, validation, DTOs, EF configuration, and at least one
23integration test as a single unit, written in modern C# 14 (primary
24constructors, collection expressions, records, sealed handlers, TypedResults).
2526Supported architectures (file placement maps and code shape templates live in
27`references/architecture-patterns.md`):
2829- **Vertical Slice Architecture (VSA)** — single-file features in `Features/`
30- **Clean Architecture (CA)** — files split across Domain, Application, Infrastructure, Api
31- **DDD + Clean Architecture** — aggregate roots, value objects, domain events, plus CA layers
32- **Modular Monolith** — self-contained modules with their own DbContext and integration events
3334## When
3536- "Scaffold a [feature name]", "create an endpoint for", "add a feature"
37- "Generate CRUD for", "add entity", "new module", "scaffold a module"
38- Starting a new feature after `/plan` has produced an approved plan
39- Customizing generation templates or defining what a complete slice includes
40- Any time the user wants a complete, working feature skeleton
4142## How
4344### Step 1: Detect Architecture
4546Use the `architecture-advisor` skill to determine the project's architecture:
47- Examine folder structure, project references, and existing patterns
48- If architecture is ambiguous, ask the user rather than guessing
49- Load the matching architecture skill (vertical-slice, clean-architecture, ddd)
5051### Step 2: Clarify Scope
5253Confirm with the user before generating (skip anything the plan already answers):
541. Feature/entity name and operations needed — full CRUD or a subset?
552. Key fields and invariants for any new entity
563. Module placement (Modular Monolith only) — existing module or new one?
5758### Step 3: Learn Conventions
5960Use the `convention-learner` skill and MCP tools to check:
61- Naming patterns (`*Handler`, `*Service`, `*Endpoint`, `*Command`, `*Query`)
62- Folder structure, file organization, access modifiers, sealed conventions
63- Existing validation approach (FluentValidation, data annotations, manual)
64- Test project structure and naming (`*Tests`, `*IntegrationTests`)
6566Match what exists. Do not impose new conventions on an established codebase.
6768### Step 4: Generate All Layers
6970Generate every file the architecture requires, following the templates in
71`references/architecture-patterns.md`:
7273- **VSA** — read the VSA section: single-file feature + endpoint group + EF config + tests
74- **Clean Architecture** — read the CA section: Mediator command/handler in Application, endpoint in Api
75- **DDD** — read the DDD section: aggregate with invariants and domain events, thin handler
76- **Modular Monolith** — read the Modular Monolith section: module DbContext, DI registration, integration events
7778The reference also covers the shared shapes every architecture reuses
79(endpoint group, validator, entity + `IEntityTypeConfiguration<T>` pair,
80test fixture) and the anti-patterns to avoid.
8182### Step 5: Completeness Checklist (MANDATORY)
8384Every scaffolded feature MUST include ALL nine items. Do not skip any:
8586- [ ] **Endpoint** — `IEndpointGroup` file with a route group; never wired in Program.cs
87- [ ] **Handler** — `sealed`, primary constructor, one per operation
88- [ ] **Validator** — FluentValidation rules with meaning (ranges, required, max lengths), wired via `.AddEndpointFilter<ValidationFilter<T>>()` on mutating endpoints
89- [ ] **DTOs** — records shaped for the consumer, never 1:1 entity mirrors
90- [ ] **EF configuration** — `IEntityTypeConfiguration<T>`; no data annotations on entities
91- [ ] **Integration tests** — `WebApplicationFactory` + Testcontainers, DI replacement via `services.RemoveAll<DbContextOptions<T>>()`
92- [ ] **OpenAPI metadata** — `.WithName()`, `.WithSummary()`, `.Produces<T>()`, `.ProducesValidationProblem()`, `.ProducesProblem(404)`
93- [ ] **CancellationToken** — on every async method and passed to every async call
94- [ ] **Result pattern** — handlers return `Result<T>`; endpoints map success → TypedResults, failure → `ToProblemDetails()`
9596Also verify supporting infrastructure — scaffold it if missing: list endpoints
97get bounded pagination (`page`/`pageSize`, max 50), Program.cs has
98`app.UseExceptionHandler()`, and appsettings.json has a connection string.
99100### Step 6: Verify
101102Prove the scaffold works before reporting done:
103104```bash
105dotnet build --no-restore
106dotnet test --no-build --filter "FullyQualifiedName~{FeatureName}"
107```
108109If the build or tests fail, fix and re-run before presenting results.
110111## Example
112113```
114User: /scaffold a Product Catalog feature with CRUD operations
115116Claude: Detected architecture: Vertical Slice Architecture
117118Created files:
119 src/Features/Products/CreateProduct.cs -- Command + handler + validator
120 src/Features/Products/GetProduct.cs -- Query by ID + handler
121 src/Features/Products/ListProducts.cs -- Paginated list + handler
122 src/Features/Products/UpdateProduct.cs -- Command + handler + validator
123 src/Features/Products/DeleteProduct.cs -- Command + handler
124 src/Features/Products/ProductEndpoints.cs -- IEndpointGroup, OpenAPI metadata
125 src/Features/Products/ProductConfig.cs -- EF Core configuration
126 tests/Features/Products/CreateProductTests.cs
127 tests/Features/Products/GetProductTests.cs
128 tests/Features/Products/ListProductsTests.cs
129130Checklist: 9/9 | Build: PASS | Tests: PASS
131132All files follow your existing conventions (sealed handlers,
133primary constructors, TypedResults return types).
134```
135136## Related
137138- `dotnet-init` — Initialize the project and CLAUDE.md before scaffolding features
139- `vertical-slice` — The VSA patterns the VSA scaffold follows
140- `clean-architecture` — Layering rules behind the CA scaffold
141- `ddd` — Aggregate and domain-event patterns behind the DDD scaffold
142- `project-structure` — Where files belong in each architecture
Run npx skillmds@latest add codewithmukesh/scaffold in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
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. It is listed under Integrations & APIs on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
codewithmukesh (@codewithmukesh) published this skill. Their other Agent Skills are listed on their SkillMD profile.