Guides
Hands-on guides with commands, expected output, and CI-verified example packages.
Contract types overview
Learn about the different contract types and when to use each one.
Target time: 15 min
Next.js: one endpoint
Add ContractSpec to an existing Next.js app by wiring one operation end-to-end.
Target time: 25 min
Import existing codebases
Convert your existing API endpoints into ContractSpec contracts for fast onboarding.
Target time: 20 min
Spec-driven validation + typing
Define operations with SchemaModel, generate types, and enforce validation without rewrites.
Target time: 20 min
Generate docs + client schemas
Export docs and OpenAPI for client SDKs and tooling from your specs.
Target time: 20 min
Docs pipeline
Wire generated docs into a reference site with a chunked index.
Target time: 20 min
CI gating with deterministic diffs
Add ContractSpec CI checks to gate breaking changes and drift.
Target time: 15 min
How to use the guides
- Run each guide in a fresh branch or sandbox workspace.
- Use the linked example package to validate end-to-end.
- Keep the commands as written to match CI expectations.
guides-quickstart
# list all examples
contractspec examples list
# validate example packages in this repo
contractspec examples validate --repo-root .