Skip to content

Recipe Repos

A recipe repo is version control for your specification models. It provides Git-like workflows (commit, branch, tag, merge) operating at the model layer rather than the source code layer. Think of it as “Git for specs,” hosted by the Recipe Server.

Source code version control (Git) tracks changes to files. But specification models – DDD aggregates, USM stories, CBRL requirements – are structured data, not text files. Line-based diffing does not capture the semantic meaning of spec changes.

Recipe repos provide:

  • Semantic diffing – recipe diff reports per-model change classes and breaking shapes, not line diffs
  • Zero-copy branching – branches are lightweight pointer rows, not full copies
  • Tagging – immutable version markers for stable spec snapshots
  • Merge – fast-forward or merge-commit, with conflict-resolution strategies when two branches touch the same models
Terminal window
# Create a recipe repo for your project
ctxbrew recipe init --project-id <uuid> --name main --description "Travel booking specs"

The command returns the repository ID. Every other command takes that --repo-id <id> (or <repo-id> argument).

Push the current state of a recipe (with its model snapshots) as a commit:

Terminal window
# Commit recipe state to main
ctxbrew recipe push \
--repo-id <id> \
--recipe-id recipe-001 \
--message "Add Order aggregate with status invariant"
# View commit history
ctxbrew recipe log --repo-id <id>
# Compact history
ctxbrew recipe log --repo-id <id> --oneline --limit 50
# Show what changed between two commits
ctxbrew recipe diff --repo-id <id> --from <hashA> --to <hashB>

Each commit records:

  • Hash of the spec state
  • Parent commit hash (forming a history chain)
  • Author and timestamp
  • The recipe manifest and model snapshots
  • A brewer’s note – the commit intent (“why”)

Branches let you experiment with spec changes without affecting the main line:

Terminal window
# Create a branch from a commit
ctxbrew recipe branch create <repo-id> --name feature/payment-refunds --commit <hash>
# Push work to the branch
ctxbrew recipe push \
--repo-id <id> \
--branch feature/payment-refunds \
--recipe-id recipe-003 \
--message "Add Refund aggregate for payment refunds"
# List branches
ctxbrew recipe branch list <repo-id>

Tags are immutable pointers to specific spec states:

Terminal window
# Create a tag
ctxbrew recipe tag create <repo-id> --name v1.0 --commit <hash> --message "MVP specification complete"
# List tags
ctxbrew recipe tag list <repo-id>

Tags serve as stable version markers. Once created, a tag always points to the exact spec state at the time of tagging.

Merge a branch back into main:

Terminal window
# Fast-forward when history allows it
ctxbrew recipe merge <repo-id> --source feature/payment-refunds --target main
# Always create a merge commit
ctxbrew recipe merge <repo-id> --source feature/payment-refunds --target main --no-ff
# Pick a conflict-resolution strategy up front
ctxbrew recipe merge <repo-id> --source feature/payment-refunds --target main --strategy keep-both

Strategies: local-wins, cloud-wins, ask (default), keep-both. When both branches modify the same model, the merge engine identifies the conflict at the model level and applies the chosen strategy instead of guessing.

The bridge between your local .contextbrew/recipes/ directory and the remote repo is sync:

Terminal window
# See what would move before anything is written
ctxbrew recipe sync --repo-id <id> --dry-run
# Push and pull
ctxbrew recipe sync --repo-id <id> --direction both
# One-way
ctxbrew recipe sync --repo-id <id> --direction pull --branch main

Compare any two commits:

Terminal window
ctxbrew recipe diff --repo-id <id> --from <hashA> --to <hashB>

The diff output is semantic, not line-based: added/removed/modified models, changed invariants, breaking shapes, and renames – the same change classes the merge engine reasons over.

Terminal window
ctxbrew recipe init --project-id <uuid> --name <name> # Create a repo
ctxbrew recipe push --repo-id <id> --message <msg> # Commit recipe state
ctxbrew recipe log --repo-id <id> [--branch] [--oneline] # Commit history
ctxbrew recipe diff --repo-id <id> --from --to # Semantic diff
ctxbrew recipe branch list|create|delete <repo-id> # Branches
ctxbrew recipe tag list|create|delete <repo-id> # Tags
ctxbrew recipe merge <repo-id> --source --target # Merge branches
ctxbrew recipe sync --repo-id <id> [--direction] # Sync local recipes