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.

AI index

Installation

Add ContractSpec to your existing Next.js or Bun project, or start fresh.

Prerequisites

  • Node.js 20+ (or Bun 1.0+)
  • Existing Next.js app or Bun HTTP server
  • PostgreSQL database (for persistence)

Install Core Libraries

Add the contracts runtime and your choice of adapter:

bun add @contractspec/lib.contracts-spec @contractspec/lib.schema

For Next.js projects

bun add @contractspec/lib.contracts-spec

For database models

bun add @contractspec/app.cli-database prisma @prisma/client

Set up your project

Initialize a new ContractSpec project structure:

installation-init
bunx contractspec init
# Follow the interactive prompts to configure your project

Initialize the database

If using Prisma, set up your schema and generate the client:

installation-prisma
bunx prisma init
# Edit prisma/schema.prisma with your models
bunx prisma generate
bunx prisma migrate dev --name init
OSS docsstartStart with OSS. Adopt Studio when you want the operating layer.

Why ContractSpec

Keep educational and comparison content reachable without letting it define the primary OSS learning path.