feature-scaffold
Scaffold a new backend feature mirroring the Features/Bookings pattern (entity, DTOs, mappers, DbSet, controller) plus a starter Next.js page.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Scaffold a new backend feature mirroring the Features/Bookings pattern (entity, DTOs, mappers, DbSet, controller) plus a starter Next.js page.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Launch the full Zach Hair Studio stack locally — the .NET API plus the Next.js frontends — for development and manual verification.
Add and apply EF Core migrations against BookingDbContext, including the one-time switch off EnsureCreated() so migrations own the schema.
Regenerate a typed TypeScript API client for the Next.js frontends from the .NET OpenAPI document, keeping OpenAPI as the source of truth.
| name | feature-scaffold |
| description | Scaffold a new backend feature mirroring the Features/Bookings pattern (entity, DTOs, mappers, DbSet, controller) plus a starter Next.js page. |
Creates a new feature following the established convention. Use the existing Bookings feature as the canonical template — read those files first and mirror their structure, naming, and namespaces.
API/ZachHairStudio.Shared/Features/Bookings/)For a new feature Xyz, create API/ZachHairStudio.Shared/Features/Xyz/:
| File | Mirrors | Purpose |
|---|---|---|
Xyz.cs | Booking.cs | EF entity (the persisted model). |
XyzCreateDto.cs | BookingCreateDto.cs | Inbound create payload. |
XyzResponseDto.cs | BookingResponseDto.cs | Outbound shape. |
XyzStatus.cs | BookingStatus.cs | Enum, only if the feature has states. |
XyzExtensions.cs | BookingExtensions.cs | Entity ⇄ DTO mapping helpers. |
Then:
public DbSet<Xyz> Xyzs => Set<Xyz>(); to BookingDbContext.cs and any
OnModelCreating property config (max lengths, enum-as-string conversion —
follow the Booking config).API/ZachHairStudio.Api/Controllers/XyzsController.cs, mirroring
BookingsController.cs (routing, DI of BookingDbContext, async actions).Add a route under landing-page/app/<xyz>/page.tsx (a Server Component that
lists items). Once the typed client exists, prefer the openapi-client skill
output over hand-written fetches.
dotnet build API/ZachHairStudio.slnx.http://localhost:5236/openapi/v1.json.