One system, many surfaces
Define explicit contracts once, then keep APIs, UI, data, events, and agent-facing surfaces aligned.
ContractSpec docs
Build on the OSS foundation first. Use Studio when you want the operating layer on top.
Primary docs
OSS-first documentation for ContractSpec, the open spec system for AI-native software.
Secondary reading
Philosophy, comparisons, and educational pages that support the main OSS path without replacing it.
OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
OSS documentation
These docs are optimized for OSS adopters first. Learn the contract model, generate and govern surfaces safely, wire integrations, and run the system in production without giving up ownership of your code.
Define explicit contracts once, then keep APIs, UI, data, events, and agent-facing surfaces aligned.
Start with one endpoint, one workflow, or one unsafe module. You do not need a rewrite to begin.
Carry policy, auditability, migrations, tracing, and integration boundaries forward with the same system model.
Quick start
Use the CLI and core libraries to define one explicit capability, generate the surface, and validate the contract boundary before you expand.
bun add -D contractspec
bun add @contractspec/lib.contracts-spec @contractspec/lib.schema
contractspec init
contractspec create --type operation
contractspec build src/contracts/mySpec.ts
contractspec validate src/contracts/mySpec.tsPrimary path
Start with onboarding, then learn the model, then build and operate with confidence. The primary docs path is intentionally shorter than the full route inventory.
Start
Install ContractSpec, wire a first contract, and adopt it into an existing codebase.
Core Model
Learn how contracts, generated surfaces, policies, overlays, and safe regeneration fit together.
Understand the spec model that drives generated surfaces, validation, policy, and safe regeneration.
Model commands, queries, presentations, and events as explicit contract surfaces.
Define queryable, presentable views that stay aligned with the rest of the system.
Build
Use practical guides, libraries, architecture patterns, and examples to ship real surfaces.
Follow concrete adoption paths for existing apps, generated docs, CI gating, and typed surfaces.
Start with one endpoint, one contract, and one generated surface in an existing Next.js app.
Stabilize a live codebase incrementally instead of rewriting it from scratch.
Operate
Run the system safely with governance, auditability, tracing, and operator-grade controls.
Add auditability, migrations, policy controls, and trustworthy release behavior from the start.
Use deterministic checks to block drift and risky changes before they reach production.
Understand the trust model, artifact validation expectations, and operational boundaries.
Integrations
Connect models, messaging, storage, payments, search, and external systems through typed bindings.
Understand the binding model for external services, providers, and tenant-owned connections.
Define what an integration provides before wiring it into an app or runtime.
Connect OpenAI through typed capabilities, explicit provider config, and governed runtime usage.
Reference
Search generated contract docs, inspect example packages, and navigate the system as source of truth.
Studio
Understand what Studio adds on top of the open system and when to adopt it.
Reference and evidence
The reference index and example catalog stay close to the repo truth. Use them when you need exact public surfaces, not just the explanatory layer.
Secondary reading
Positioning, comparisons, and philosophy remain available, but they no longer define the main docs path.
Why ContractSpec
Keep educational and comparison content reachable without letting it define the primary OSS learning path.