Recipe Repos
Recipe Repos
Section titled “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.
Why a recipe repo?
Section titled “Why a recipe repo?”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 diffreports 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
Creating a Repo
Section titled “Creating a Repo”# Create a recipe repo for your projectctxbrew 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).
Core Operations
Section titled “Core Operations”Commits
Section titled “Commits”Push the current state of a recipe (with its model snapshots) as a commit:
# Commit recipe state to mainctxbrew recipe push \ --repo-id <id> \ --recipe-id recipe-001 \ --message "Add Order aggregate with status invariant"
# View commit historyctxbrew recipe log --repo-id <id>
# Compact historyctxbrew recipe log --repo-id <id> --oneline --limit 50
# Show what changed between two commitsctxbrew 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
Section titled “Branches”Branches let you experiment with spec changes without affecting the main line:
# Create a branch from a commitctxbrew recipe branch create <repo-id> --name feature/payment-refunds --commit <hash>
# Push work to the branchctxbrew recipe push \ --repo-id <id> \ --branch feature/payment-refunds \ --recipe-id recipe-003 \ --message "Add Refund aggregate for payment refunds"
# List branchesctxbrew recipe branch list <repo-id>Tags are immutable pointers to specific spec states:
# Create a tagctxbrew recipe tag create <repo-id> --name v1.0 --commit <hash> --message "MVP specification complete"
# List tagsctxbrew 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.
Merging
Section titled “Merging”Merge a branch back into main:
# Fast-forward when history allows itctxbrew recipe merge <repo-id> --source feature/payment-refunds --target main
# Always create a merge commitctxbrew recipe merge <repo-id> --source feature/payment-refunds --target main --no-ff
# Pick a conflict-resolution strategy up frontctxbrew recipe merge <repo-id> --source feature/payment-refunds --target main --strategy keep-bothStrategies: 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.
Syncing With Your Local Project
Section titled “Syncing With Your Local Project”The bridge between your local .contextbrew/recipes/ directory and the remote repo is sync:
# See what would move before anything is writtenctxbrew recipe sync --repo-id <id> --dry-run
# Push and pullctxbrew recipe sync --repo-id <id> --direction both
# One-wayctxbrew recipe sync --repo-id <id> --direction pull --branch mainSemantic Diffing
Section titled “Semantic Diffing”Compare any two commits:
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.
CLI Reference
Section titled “CLI Reference”ctxbrew recipe init --project-id <uuid> --name <name> # Create a repoctxbrew recipe push --repo-id <id> --message <msg> # Commit recipe statectxbrew recipe log --repo-id <id> [--branch] [--oneline] # Commit historyctxbrew recipe diff --repo-id <id> --from --to # Semantic diffctxbrew recipe branch list|create|delete <repo-id> # Branchesctxbrew recipe tag list|create|delete <repo-id> # Tagsctxbrew recipe merge <repo-id> --source --target # Merge branchesctxbrew recipe sync --repo-id <id> [--direction] # Sync local recipesNext Steps
Section titled “Next Steps”- Creating Recipes to create the recipes you push
- Execution Engine for automated generation from recipes
- CLI Reference for the complete command reference
