Contentrain
Developer playbook

Implement Git-native content in a modern app

A developer-first path for adding models, content, validation, generated SDK access, and local agent workflows to a Nuxt, Next, Astro, SvelteKit, Vite, or Node project.

Read AI docs

Audience

Developers and platform engineers adding governed content to product codebases.

Outcome

The app consumes content through generated access, validates content in the repo, and can graduate to Studio without changing the content contract.

Operating model

What the workflow needs to prove

Install

Start local and keep the repo understandable

The developer path should work before a SaaS account exists. Initialize the content system, inspect the generated files, and keep scripts for validate and generate in the project.

  • CLI setup
  • Local MCP server
  • Generated query client

Runtime

Use generated access instead of file parsing

Applications should import content through generated SDK access. This keeps runtime code stable and gives frameworks a predictable path for static and server-rendered content.

  • Locale-aware queries
  • Typed generated modules
  • Framework-specific integration skills

CI

Make content validation part of delivery

A content system is not production-ready until invalid content fails before deployment. Use validation and generation as build-time gates.

  • Validate schema and required fields
  • Generate client data
  • Prerender content pages

Implementation steps

Run the workflow in this order

1

Initialize the project

Create .contentrain with config, context, vocabulary, models, and content directories.

npx contentrain init
2

Create models

Define the content shapes your app actually needs: dictionaries, singletons, collections, and documents.

3

Add content entries

Use MCP content save or Studio to create model-valid content instead of editing JSON by hand.

4

Generate runtime client

Generate query modules and import them from application code.

contentrain generate
5

Validate and build

Run validation and the app build together so content and UI fail as one product.

contentrain validate && pnpm build

Checklist

Quality gates before handoff

Repository setup

  • Scripts for generate and validate exist
  • Content files are reviewed like code
  • Agents can read context and model files

Runtime setup

  • No ad hoc JSON parsing in components
  • SEO fields exist on page models
  • Images have meaningful adjacent text

Launch setup

  • Sitemap includes content routes
  • Canonical URLs are set
  • Build prerenders important pages

Common questions

Can this work without Studio?

Yes. Developers can use the MIT packages locally. Studio is the collaboration, review, and delivery layer.

Which frameworks are supported?

The package and skills surface supports Nuxt, Next, Astro, SvelteKit, Vite, Vue, React, React Native, Expo, and Node patterns.

Why generated access?

Generated access makes content consumption explicit, typed, locale-aware, and easier for agents to understand.

Start local. Scale to Studio.

Build a governed content layer before content becomes product debt.

Developers can start with the MIT packages. Teams can move into Studio when review, roles, delivery, and licensing matter.

Open Studio