.agents/skills/add-full-slice/SKILL.md
The kit's accelerator: deliver a feature from database to UI in one pass. This skill composes
add-feature (backend) and add-react-page (frontend) — follow each for the detailed code; this file is
the order of operations and the contract that keeps the two halves in sync.
add-feature (and add-entity first if a new entity is needed):
Modules.{X}.Contracts/v1/{Area}/ (+ Contracts/Dtos/).public sealed, injects {X}DbContext), Validator, Endpoint (internal static Map…Endpoint, .RequirePermission(...)).{X}Module.MapEndpoints. Build + test backend green.add-react-page in the chosen app:
useQuery/useMutation), route (RouteGuard for admin / withSuspense for dashboard).lib/permissions.ts and gate the route (add-permission). Dashboard relies on the server 403.| Backend | Frontend must match |
|---|---|
Endpoint route api/v{n}/{module}/{resources} | apiFetch path |
Request: the Command/Query record fields | request body / query-param keys (admin params PascalCase; body JSON camelCase) |
| Response: the DTO record (camelCase JSON) | the hand-written TS type |
.RequirePermission({X}Permissions...) | (admin) RouteGuard perms + the mirrored constant |
Paginated → PagedResponse<T> | PagedResponse<T> (admin: @/lib/api-types; dashboard: inline) |
dotnet build src/FSH.Starter.slnx && dotnet test src/Tests/{X}.Tests
cd clients/{app} && npm run lint && npm run test:e2e
# optional manual check: dotnet run --project src/Host/FSH.Starter.AppHost (brings up API + both apps)
add-feature)add-react-page); admin permission mirrored + gated (add-permission)