Template · api-service
API service (Node / TypeScript backend)
Health checks, typed contracts, error envelopes, and operational guardrails from day one.
Spine's api-service template compiles the operating layer for a production-minded HTTP API: request/response contracts, health and readiness probes, structured logging, rate-limit posture, and a single error-envelope convention agents can follow consistently.
Who this template is for
Backend teams and full-stack builders starting a Node API that needs real operational shape before framework details take over. Works as a planning layer for Fastify, Express, Hono, or plain node:http.
Get started
~ — spine init --template api-service
$ npm install -g project-spine@beta $ spine init --template api-service $ spine compile --brief ./brief.md --repo . --template api-service ✓ wrote spine.json ✓ wrote AGENTS.md, CLAUDE.md, copilot-instructions.md, project-spine.mdc ✓ wrote scaffold-plan, qa-guardrails, sprint-1-backlog
Routes this template plans for
- /health - Liveness probe for process-level uptime
- /ready - Readiness probe for dependencies and deploy gates
- /v1/* - Versioned API surface with typed request/response contracts
What spine compile emits
- ErrorEnvelope contract for consistent client-facing errors
- RequestContext guidance for auth, tracing, and correlation IDs
- RateLimiter rules with explicit bypass and failure behavior
- QA guardrails covering status codes, schema validation, and logging
- sprint-1-backlog.md focused on the first operationally safe API slice
Good fit if
- Teams starting a service before choosing every framework detail
- Existing APIs that need consistent agent instructions and QA gates
- Client projects where health/readiness and error behavior are part of the handoff
Pairs well with
- monorepoWorkspace-aware context for packages, apps, build graphs, and affected-only checks.
- docs-portalTechnical docs your agents can read, update, and keep honest.