@contentrain/rules 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
 
5
5
  `context.json` is the project intelligence file. It provides AI agents and Contentrain Studio with structured knowledge about the project: its tech stack, content patterns, conventions, and normalize configuration.
6
6
 
7
- - **Written by:** MCP tools (updated after every write operation)
7
+ - **Written by:** MCP tools (committed together with content changes in the same branch, not as a separate commit)
8
8
  - **Read by:** AI agents (at the start of every session) and Studio (for UI configuration)
9
9
  - **Location:** `.contentrain/context.json`
10
10
 
@@ -206,7 +206,7 @@ When creating `context.json` for the first time, use stack-appropriate defaults.
206
206
 
207
207
  ## Update Behavior
208
208
 
209
- MCP tools update `context.json` after every write operation:
209
+ MCP tools update `context.json` as part of each write operation, committed together with the content changes in the same branch (not as a separate commit):
210
210
  - `contentrain_init` creates the initial file
211
211
  - `contentrain_model_save` updates the domains list if a new domain is used
212
212
  - `contentrain_content_save` updates content stats
@@ -7,7 +7,7 @@ This project uses Contentrain for AI-driven content management. These rules are
7
7
  MCP is **deterministic infrastructure**. The agent (you) is the **intelligence layer**.
8
8
 
9
9
  - **Agent decides:** what is content vs code, domain grouping, model structure, replacement expressions (stack-aware), content quality
10
- - **MCP handles:** file I/O, validation, Git transactions (worktree/branch/commit/merge), project scanning
10
+ - **MCP handles:** file I/O, validation, Git transactions (dedicated contentrain branch/worktree/commit/update-ref), project scanning
11
11
  - MCP does NOT make content decisions. It is framework-agnostic.
12
12
 
13
13
  ## Four Model Kinds
@@ -65,11 +65,16 @@ MCP is **deterministic infrastructure**. The agent (you) is the **intelligence l
65
65
 
66
66
  ## Git Workflow
67
67
 
68
- - Every write operation creates a worktree + branch automatically
69
- - **auto-merge** mode: branch merges to main after commit
70
- - **review** mode: branch pushed to remote for team review
71
- - Branch naming: `contentrain/{operation}/{model}/{locale}/{timestamp}`
72
- - Never create branches manually, never commit directly to main
68
+ - A dedicated `contentrain` branch is the single source of truth for content state, created at init
69
+ - Every write operation creates a temporary worktree on the `contentrain` branch automatically
70
+ - Feature branches (`contentrain/{operation}/{model}/{locale}/{timestamp}`) are created from `contentrain` for each operation
71
+ - **auto-merge** mode: feature branch merges into `contentrain`, then `contentrain` advances baseBranch via update-ref (fast-forward), then `.contentrain/` files are selectively synced to the developer's working tree
72
+ - **review** mode: feature branch pushed to remote for team review
73
+ - Developer's working tree is never mutated during MCP git operations (no stash, no checkout, no merge on the developer's tree)
74
+ - If the developer manually edits `.contentrain/` files, MCP sync skips dirty files and warns
75
+ - The `contentrain` branch is protected from deletion
76
+ - context.json is committed together with content changes, not as a separate commit
77
+ - Never create branches manually, never commit directly to main or the `contentrain` branch
73
78
  - 50+ active branches = warning, 80+ = blocked
74
79
 
75
80
  ## Localization
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentrain/rules",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "license": "MIT",
5
5
  "description": "AI agent rules for Contentrain — quality standards, architecture conventions, IDE integration",
6
6
  "type": "module",
@@ -173,7 +173,7 @@ Call `contentrain_validate` after all content is created.
173
173
 
174
174
  Call `contentrain_submit` to finalize.
175
175
 
176
- - In `auto-merge` mode: branch is merged to main, content is published.
176
+ - In `auto-merge` mode: feature branch is merged into `contentrain`, baseBranch is advanced via update-ref, `.contentrain/` files are selectively synced to the developer's working tree, content is published.
177
177
  - In `review` mode: branch is pushed to remote for team review.
178
178
  - Normalize operations always use review mode regardless of config.
179
179