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.
What you’re about to do
Section titled “What you’re about to do”- Install the CLI
- Create a project
- Define one DDD aggregate (the Order) — as a plain text file
- Generate the failing tests + the recipe
- Hand the recipe to an AI agent
- 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.
Prerequisites
Section titled “Prerequisites”- A terminal
- Bun (recommended) or Node.js 20+
- An AI coding agent (Claude Code, Cursor, Copilot, or any other — recipes are agent-agnostic)
Install the CLI
Section titled “Install the CLI”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):
git clone <repository-url> contextbrewcd contextbrew && bun installcd apps/cli && bun run build && bun linkctxbrew --versionctxbrew is the brand alias, ctx the power shortcut — both work, pick one
and stick with it. (The docs use ctxbrew.)
Create a project
Section titled “Create a project”mkdir my-project && cd my-projectctxbrew init --name my-projectThis 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)Define your first aggregate
Section titled “Define your first aggregate”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.
Generate the failing tests + the recipe
Section titled “Generate the failing tests + the recipe”ctxbrew generate --target vitestctxbrew recipe create --aggregate OrderThe 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.
Hand the recipe to an AI agent
Section titled “Hand the recipe to an AI agent”# Print the recipe prompt to your terminalctxbrew recipe export --recipe recipe-001
# Or write it to a file to attach/pastectxbrew recipe export --recipe recipe-001 --format markdown --output recipe-001.mdYou’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:
ctxbrew mcp setup --agent claude-code # or: cursor | windsurf | codex | orca | genericThe agent gets ~62 spec-aware tools and can read the requirement, its neighbourhood, and its rationale by itself.
Watch the tests pass
Section titled “Watch the tests pass”# 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:
ctxbrew check --gateWhat just happened
Section titled “What just happened”In five minutes:
- You defined what your system is (the
Orderaggregate + invariants), in a plain text file you own forever. - ContextBrew compiled that into failing-first tests and a recipe — deterministically.
- An AI agent implemented against the spec.
- 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.
Next steps
Section titled “Next steps”| 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.
