Skip to content

Quick Start

The fastest path from “what is this” to “my AI agent just implemented something against my spec.” Five minutes, give or take. No account required — everything below runs locally with the free CLI.

  1. Install the CLI
  2. Create a project
  3. Define one DDD aggregate (the Order) — as a plain text file
  4. Generate the failing tests + the recipe
  5. Hand the recipe to an AI agent
  6. Watch the tests pass

By the end you’ll have a working project and one recipe that an AI agent can implement against. Then you decide how far you want to take it.

  • A terminal
  • Bun (recommended) or Node.js 20+
  • An AI coding agent (Claude Code, Cursor, Copilot, or any other — recipes are agent-agnostic)

The CLI is not yet on npm — the public package-name claim and first publish ship with the public release. Until then, install from source (full walkthrough: Installation):

Terminal window
git clone <repository-url> contextbrew
cd contextbrew && bun install
cd apps/cli && bun run build && bun link
ctxbrew --version

ctxbrew is the brand alias, ctx the power shortcut — both work, pick one and stick with it. (The docs use ctxbrew.)

Terminal window
mkdir my-project && cd my-project
ctxbrew init --name my-project

This creates the canonical structure:

my-project/
└── .contextbrew/
├── project.yaml # project settings (name, type, models)
├── state.json # generator + recipe state
├── ddd/ # domain models (this quick start's next step)
├── cbrl/ # requirements
├── usm/ scm/ dsm/ esdm/ # other model families (empty for now)
├── generated/ # generator output (tests, prompts, …)
├── recipes/ # recipe files
└── knowledge/ # topic maps & digests (brownfield import)

Models are plain text files — there is no model command, and you don’t need one. Create .contextbrew/ddd/order.domain with an Order aggregate. The aggregate is the unit of consistency in DDD — the rules that always hold for the business:

AGGREGATE Order {
PROPERTY id: UUID [pk]
PROPERTY customerId: UUID [required]
PROPERTY status: string [default="pending"]
PROPERTY total: number [default="0"]
INVARIANT "total-non-negative"
EXPRESSION "total >= 0"
INVARIANT "status-transition"
EXPRESSION "status != 'cancelled' OR total == 0"
}

You’ve just written your first spec. Every format has a normative JSON Schema (ctxbrew schema ddd prints it) and a deterministic parser — the file either validates or it doesn’t, no AI judgment involved.

Terminal window
ctxbrew generate --target vitest
ctxbrew recipe create --aggregate Order

The generator writes under .contextbrew/generated/vitest/ — failing test scaffolds, by design. Every stub ends in an explicit expect.fail(...) marker. If a generated test passes against an empty implementation, the spec is decorative — tighten it.

The recipe command writes .contextbrew/recipes/recipe-001.{json,md}: the context + tests + work items bundle your agent will implement against.

Terminal window
# Print the recipe prompt to your terminal
ctxbrew recipe export --recipe recipe-001
# Or write it to a file to attach/paste
ctxbrew recipe export --recipe recipe-001 --format markdown --output recipe-001.md

You’ll see a prompt that bundles the spec context, the failing tests, and the work items. Paste it into Claude Code, Cursor, or any other agent — or skip the copy-paste entirely by wiring the MCP server:

Terminal window
ctxbrew mcp setup --agent claude-code # or: cursor | windsurf | codex | orca | generic

The agent gets ~62 spec-aware tools and can read the requirement, its neighbourhood, and its rationale by itself.

Terminal window
# The agent implements src/order.ts (or wherever your runtime lives); then:
bun test .contextbrew/generated/vitest/

The implementation passes on the first try — or not, in which case you either iterate (run the agent again) or tighten the spec (the agent is only as good as the spec). When you’re done, close the loop with the drift gate:

Terminal window
ctxbrew check --gate

In five minutes:

  1. You defined what your system is (the Order aggregate + invariants), in a plain text file you own forever.
  2. ContextBrew compiled that into failing-first tests and a recipe — deterministically.
  3. An AI agent implemented against the spec.
  4. The implementation passed because the spec was precise enough.

That’s the value proposition. Everything else ContextBrew does — traceability, recipe versioning, aspect tags, the Execution Engine — is a refinement of this loop.

You want to… Go to
See the whole loop in detail First Project
Understand the philosophy Core Concepts
Point it at an existing repo Playbook: Brownfield Onboarding
Run the Execution Engine (no copy-paste) Recipes Overview
See questions answered FAQ

Welcome. The hard part was the spec; the rest is mechanical.