Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

scaffold

БесплатноБез исполняемых скриптовНе проверен

Architecture-aware scaffolding (/scaffold) for .NET 10: generates a Features/<VerbPhrase>/ slice (IEndpoint, IHandler, validator, integration tests) or a new…

codewithmukeshот codewithmukesh★ 858 звёзд на GitHub

Об этом скилле

/scaffold: Architecture-Aware Feature Scaffolding

What

Generates a complete feature, or a new module, with every file it needs. It never generates half a feature: the endpoint, handler, request, validator, response, EF configuration and integration tests come as one unit, in modern C# 14 (primary constructors, collection expressions, records, sealed internal classes, TypedResults).

The default shape is modular slices (ADR-008, modular-slices skill). Other architectures are supported when the codebase already uses them. File placement maps and code templates live in references/architecture-patterns.md:

  • Modular slices (default): src/Modules/<Module>/<Module>/Features/<VerbPhrase>/, one class per file
  • Single-project VSA: the same slice files in Features/, without modules
  • Clean Architecture: files across Domain, Application, Infrastructure, Api
  • DDD: aggregate methods and domain events, with a thin handler

When

  • "Scaffold a [feature]", "create an endpoint for", "add a feature"
  • "Generate CRUD for", "add entity", "new module", "scaffold a module"
  • Starting a new feature after /spec has produced an approved plan
  • Customizing generation templates or defining what a complete slice includes

How

Step 1: Detect the architecture

  • src/Modules/<Name>/<Name> and <Name>.Contracts projects, IModule classes: modular slices
  • A single API project with Features/ folders and no modules: single-project VSA
  • Domain / Application / Infrastructure / Api projects: Clean Architecture (plus DDD if aggregates raise domain events)
  • An empty or new solution: modular slices, unless the architecture-advisor recommended something else

If it is ambiguous, ask rather than guess. Load the matching skill (modular-slices, or architecture-advisor for single-project VSA, Clean Architecture, DDD).

Step 2: Clarify scope

Confirm before generating (skip what the plan already answers):

  1. Operations needed, named as verb phrases (PlaceOrder, CancelOrder, ListOrders)
  2. Key fields and invariants for any new entity
  3. Which module owns it, or whether it needs a new module (decide by who owns the data)
  4. The permission each endpoint needs, and whether the data is tenant-owned
  5. Events other modules need from this change, if any

Step 3: Learn conventions

Use the instinct-system skill and Roslyn MCP tools (find_symbol, get_file_outline) on one existing feature folder:

  • Naming (*Endpoint, *Handler, *Request, *RequestValidator, *Response)
  • How handlers report errors (Problems.* codes, or an existing Result<T>)
  • Permission constants and test helper style ({Module}Api.cs)

Match what exists. Do not bring the default conventions into a codebase that uses different ones.

Step 4: Generate

A feature (default): in Features/<VerbPhrase>/ create

  • <VerbPhrase>Endpoint.cs: internal sealed, implements IEndpoint, relative route, .RequirePermission(...), .WithName(), .WithSummary(), injects the handler
  • <VerbPhrase>Handler.cs: internal sealed, implements IHandler, primary constructor with the module DbContext and TimeProvider, HandleAsync returning a Results<...> union
  • <VerbPhrase>Request.cs and <Noun>Response.cs: public sealed record (shared responses go in Features/Common/)
  • <VerbPhrase>RequestValidator.cs: internal sealed, rules with meaning
  • tests/<Module>.Tests/Features/<VerbPhrase>/<VerbPhrase>Tests.cs

A new module: create <Module> and <Module>.Contracts projects, <Module>Module : IModule, <Module>Permissions, <Module>DbContext : ModuleDbContext, add builder.AddModule<<Module>Module>() to the Api, Worker and Migrator hosts, add the projects to the .slnx, add a test project, and create the first migration.

If the Modularity building blocks are missing, scaffold them first from skills/modular-slices/references/building-blocks.md.

Step 5: Completeness checklist (mandatory)

Every scaffolded feature must satisfy all of these:

  • Endpoint: one IEndpoint per feature, discovered automatically; nothing added to Program.cs or the module class
  • Permission: .RequirePermission(...) or an explicit .AllowAnonymous() on every endpoint
  • Handler: internal sealed, implements IHandler, returns a TypedResults union; no mediator, no repository
  • Errors: Problems.NotFound() / Conflict(code, ...) / RuleBroken(code, ...) with <module>.<reason> codes; never bare strings
  • Validator: FluentValidation with real rules, run by the shared endpoint filter
  • Contracts: request/response records public; everything else internal; anything other modules need goes in <Module>.Contracts
  • Data: entities paired with IEntityTypeConfiguration<T>; reads use AsNoTracking() and projections; lists are paged (page size capped at 50)
  • Events: cross-module side effects published with
Полный SKILL.md на GitHub

Установить scaffold в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/architecture-patterns.md

FAQ

Что делает скилл scaffold?

Architecture-aware scaffolding (/scaffold) for .NET 10: generates a Features/<VerbPhrase>/ slice (IEndpoint, IHandler, validator, integration tests) or a new module (implementation + Contracts, ModuleDbContext), matching existing conventions. Use for "scaffold", "add feature", "new endpoint", "add entity", "new module". Do NOT use for deciding architecture (use modular-slices or architecture-advisor) or project setup (use dotnet-init).

Как установить скилл scaffold?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл scaffold запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить scaffold с