@contentrain/rules 0.5.0 → 0.5.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 (committed together with content changes in the same branch, not as a separate commit)
7
+ - **Written by:** MCP tools (regenerated on the `contentrain` branch after each merge — feature branches never carry it, so parallel writes cannot conflict on it)
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` as part of each write operation, committed together with the content changes in the same branch (not as a separate commit):
209
+ MCP tools update `context.json` after each write operation lands. The file is never committed on `cr/*` feature branches (its timestamps would make parallel branches conflict); it is regenerated deterministically on the `contentrain` branch after merge:
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
@@ -77,7 +77,7 @@ MCP is **deterministic infrastructure**. The agent (you) is the **intelligence l
77
77
  - Developer's working tree is never mutated during MCP git operations (no stash, no checkout, no merge on the developer's tree)
78
78
  - If the developer manually edits `.contentrain/` files, MCP sync skips dirty files and warns
79
79
  - The `contentrain` branch is protected from deletion
80
- - context.json is committed together with content changes, not as a separate commit
80
+ - context.json is never committed on feature branches — it is regenerated on the `contentrain` branch after merge
81
81
  - Never create branches manually, never commit directly to main or the `contentrain` branch
82
82
  - 50+ active `cr/*` branches = warning, 80+ = blocked
83
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentrain/rules",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "license": "MIT",
5
5
  "description": "AI agent rules for Contentrain — quality standards, architecture conventions, IDE integration",
6
6
  "type": "module",
@@ -55,7 +55,7 @@
55
55
  "tsdown": "^0.21.0",
56
56
  "typescript": "^5.7.0",
57
57
  "vitest": "^3.0.0",
58
- "@contentrain/mcp": "1.5.0"
58
+ "@contentrain/mcp": "1.5.1"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsdown src/index.ts --format esm,cjs --dts",
@@ -297,7 +297,7 @@ contentrain_apply(mode: "reuse", scope: {model: "model-id"}, dry_run: true) (pre
297
297
  - Branch naming: `cr/{operation}/{model}[/{locale}]/{timestamp}-{suffix}` (locale included when applicable; legacy `contentrain/*` branches are auto-migrated on first init).
298
298
  - You do not create branches manually. MCP handles Git transactions.
299
299
  - Developer's working tree is never mutated during MCP operations (no stash, no checkout, no merge on the developer's tree).
300
- - context.json is committed together with content changes, not as a separate commit.
300
+ - context.json is never committed on feature branches — it is regenerated on the `contentrain` branch after merge.
301
301
  - In `auto-merge` mode: feature branch is merged into `contentrain`, then baseBranch is advanced via update-ref (fast-forward), then `.contentrain/` files are selectively synced to the developer's working tree. Dirty files are skipped with a warning.
302
302
  - In `review` mode: feature branch stays local until `contentrain_submit` pushes it to remote.
303
303
 
@@ -75,7 +75,7 @@ The `contentrain` branch is the **single source of truth** for content state:
75
75
  - Created automatically at `contentrain_init`.
76
76
  - All content writes happen on feature branches forked from `contentrain`.
77
77
  - The `contentrain` branch is **protected from deletion**.
78
- - context.json is committed together with content changes, not as a separate commit.
78
+ - context.json is never committed on feature branches — it is regenerated on the `contentrain` branch after merge.
79
79
 
80
80
  ### 3.2 Worktree-Based Transactions
81
81