new-service
Trigger: user asks to scaffold an API service.
Workflow
- Confirm: name (kebab), endpoints, schema (
name:typepairs), with mocks? - Run:
gaia scaffold service <name> --endpoints "..." --schema "..." [--mocks] - Verify:
pnpm typecheckclean; if--mocks, run a single MSW round-trip in a vitest test. - Wire the service into the consuming page/hook (CLI does not do this — manual).
Flags
--endpoints "get,post,put,delete"— required (subset of get/post/put/delete)--schema "id:string,name:string,status:enum(active,archived)"— required--mocks— also emit MSW mock collection--json— emitScaffoldResultJSON
Schema types: string, number, boolean, datetime, enum(a,b,...). Append ? for optional.
See
wiki/concepts/API Service Pattern.md— pattern source of truth.claude/rules/api-service.md— quick pointer