$npx -y skills add gaia-react/gaia --skill new-serviceScaffold a new API service with request functions, Zod schemas, URL constants, and optional MSW mock handlers. Use this skill whenever the user asks to "add a service", "create the projects API", "scaffold a new GAIA service", "wire up CRUD for users", or anything implying a new
| 1 | # new-service |
| 2 | |
| 3 | Trigger: user asks to scaffold an API service. |
| 4 | |
| 5 | ## Workflow |
| 6 | |
| 7 | 1. Confirm: name (kebab), endpoints, schema (`name:type` pairs), with mocks? |
| 8 | 2. Run: `.gaia/cli/gaia scaffold service <name> --endpoints "..." --schema "..." [--mocks]` |
| 9 | 3. Verify: `pnpm typecheck` clean; if `--mocks`, run a single MSW round-trip in a vitest test. |
| 10 | 4. Wire the service into the consuming page/hook (CLI does not do this, manual). |
| 11 | |
| 12 | ## Flags |
| 13 | |
| 14 | - `--endpoints "get,post,put,delete"`, required (subset of get/post/put/delete) |
| 15 | - `--schema "id:string,name:string,status:enum(active,archived)"`, required |
| 16 | - `--mocks`, also emit MSW mock collection |
| 17 | - `--json`, emit `ScaffoldResult` JSON |
| 18 | |
| 19 | Schema types: `string`, `number`, `boolean`, `datetime`, `enum(a,b,...)`. Append `?` for optional. |
| 20 | |
| 21 | ## See |
| 22 | |
| 23 | - `wiki/concepts/API Service Pattern.md`, pattern source of truth |
| 24 | - `.claude/rules/api-service.md`, quick pointer |