Backend Scaffolder
Description
This skill automates the creation of backend "vertical slices". It generates the necessary files for a new resource (Route, Service, Test) and registers the route in the main application file.
Usage
To scaffold a new resource (e.g., "Reward"):
bash
node .gemini/skills/backend-scaffolder/scripts/scaffold_backend.cjs reward
Parameters:
- •
resourceName: The singular name of the resource (e.g., "reward", "chore").
What it does
- •Creates
server/src/services/<resource>Service.tswith CRUD boilerplate. - •Creates
server/src/routes/<resource>s.ts(pluralized) with Fastify routes. - •Creates
server/test/routes/<resource>s.test.ts(pluralized) with a basic test. - •Injects the route registration into
server/src/app.ts.
Post-Scaffold Checklist
After running the script, you MUST:
- •Define the model in
server/prisma/schema.prisma. - •Run migration:
cd server && npx prisma migrate dev --name add_<resource>. - •Update the generated service file if the model fields require specific validation or logic.