@contentrain/skills 0.2.0 → 0.2.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.
package/package.json
CHANGED
|
@@ -145,11 +145,14 @@ contentrain_submit # Push (always review mode)
|
|
|
145
145
|
|
|
146
146
|
### Rule 6: Branch and Worktree
|
|
147
147
|
|
|
148
|
-
-
|
|
148
|
+
- A dedicated `contentrain` branch is the single source of truth for content state, created at init and protected from deletion
|
|
149
|
+
- Every write operation creates a temporary worktree on a new feature branch forked from `contentrain`
|
|
149
150
|
- Branch naming: `contentrain/{operation}/{model}/{timestamp}` (locale included when applicable)
|
|
150
151
|
- Do not create branches manually. MCP handles Git transactions
|
|
151
|
-
-
|
|
152
|
-
-
|
|
152
|
+
- Developer's working tree is never mutated during MCP operations (no stash, no checkout, no merge on the developer's tree)
|
|
153
|
+
- context.json is committed together with content changes, not as a separate commit
|
|
154
|
+
- `auto-merge` mode: feature branch merged into `contentrain`, baseBranch advanced via update-ref, `.contentrain/` files selectively synced to developer's working tree (dirty files skipped with warning)
|
|
155
|
+
- `review` mode: feature branch pushed to remote by `contentrain_submit`
|
|
153
156
|
|
|
154
157
|
### Rule 7: Branch Health
|
|
155
158
|
|
|
@@ -19,7 +19,7 @@ Contentrain supports two workflow modes, configured in `.contentrain/config.json
|
|
|
19
19
|
{ "workflow": "auto-merge" }
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
-
|
|
22
|
+
- Feature branch is created from the `contentrain` branch, changes are committed, feature branch is **merged into `contentrain`**, then baseBranch is advanced via **update-ref** (fast-forward), and `.contentrain/` files are **selectively synced** to the developer's working tree.
|
|
23
23
|
- No review step -- changes go live immediately.
|
|
24
24
|
- Best for: solo developers, rapid iteration, prototyping, vibe coding.
|
|
25
25
|
- Status flow: `draft` --> `published` (skips `in_review`).
|
|
@@ -72,37 +72,55 @@ contentrain/{operation}/{model}/{locale}/{timestamp}
|
|
|
72
72
|
|
|
73
73
|
## 3. Git Workflow
|
|
74
74
|
|
|
75
|
-
### 3.1
|
|
75
|
+
### 3.1 Dedicated `contentrain` Branch
|
|
76
|
+
|
|
77
|
+
The `contentrain` branch is the **single source of truth** for content state:
|
|
78
|
+
|
|
79
|
+
- Created automatically at `contentrain_init`.
|
|
80
|
+
- All content writes happen on feature branches forked from `contentrain`.
|
|
81
|
+
- The `contentrain` branch is **protected from deletion**.
|
|
82
|
+
- context.json is committed together with content changes, not as a separate commit.
|
|
83
|
+
|
|
84
|
+
### 3.2 Worktree-Based Transactions
|
|
76
85
|
|
|
77
86
|
Every write operation follows this flow:
|
|
78
87
|
|
|
79
|
-
1. MCP creates a **Git worktree** on a new branch
|
|
80
|
-
2. Changes are made in the worktree (content files, model files).
|
|
81
|
-
3. Changes are committed to the branch.
|
|
82
|
-
4. **auto-merge mode:**
|
|
83
|
-
5. **review mode:**
|
|
88
|
+
1. MCP creates a **temporary Git worktree** on a new feature branch forked from `contentrain`.
|
|
89
|
+
2. Changes are made in the worktree (content files, model files, context.json).
|
|
90
|
+
3. Changes are committed to the feature branch.
|
|
91
|
+
4. **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. Worktree is cleaned up.
|
|
92
|
+
5. **review mode:** Feature branch is pushed to remote for team review. Worktree is cleaned up. Studio notifies reviewers.
|
|
93
|
+
|
|
94
|
+
Developer's working tree is **never mutated** during MCP git operations. There is no stash, no checkout, and no merge on the developer's tree.
|
|
95
|
+
|
|
96
|
+
### 3.3 Developer Manual Editing
|
|
97
|
+
|
|
98
|
+
If the developer manually edits `.contentrain/` files in their working tree, MCP selective sync skips those dirty files and issues a warning. The developer must commit or discard their local changes before MCP can sync those files.
|
|
84
99
|
|
|
85
|
-
### 3.
|
|
100
|
+
### 3.4 Critical Rules
|
|
86
101
|
|
|
87
|
-
- **NEVER commit directly to main.** All changes go through branches.
|
|
102
|
+
- **NEVER commit directly to main or the `contentrain` branch.** All changes go through feature branches.
|
|
88
103
|
- **NEVER create branches manually.** MCP tools handle all Git operations.
|
|
89
104
|
- **NEVER force-push or rebase** Contentrain branches.
|
|
105
|
+
- **NEVER delete the `contentrain` branch.** It is the content state SSOT.
|
|
90
106
|
- Worktrees are temporary. They are created for the operation and cleaned up afterward.
|
|
91
107
|
- Each branch contains a cohesive set of changes (e.g., all entries for one model update).
|
|
92
108
|
|
|
93
|
-
### 3.
|
|
109
|
+
### 3.5 Branch Lifecycle
|
|
94
110
|
|
|
95
111
|
```
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
112
|
+
Feature branch created (worktree on contentrain)
|
|
113
|
+
--> Changes committed
|
|
114
|
+
--> auto-merge: feature merged into contentrain
|
|
115
|
+
--> update-ref advances baseBranch
|
|
116
|
+
--> selective sync .contentrain/ to developer's tree
|
|
117
|
+
--> review: feature pushed to remote, awaiting review
|
|
118
|
+
--> Worktree cleaned up
|
|
101
119
|
```
|
|
102
120
|
|
|
103
|
-
|
|
121
|
+
The `contentrain` branch is permanent and protected. Feature branches are retained for `branchRetention` days (default: 30) for audit trail, then pruned.
|
|
104
122
|
|
|
105
|
-
### 3.
|
|
123
|
+
### 3.6 Branch Health
|
|
106
124
|
|
|
107
125
|
MCP enforces branch health limits to prevent branch accumulation:
|
|
108
126
|
|
|
@@ -160,7 +178,7 @@ published --> archived
|
|
|
160
178
|
|-------|-----------|---------|
|
|
161
179
|
| `draft` | Branch exists, not yet reviewed/merged | Content created or updated |
|
|
162
180
|
| `in_review` | PR/branch open, labeled `contentrain-content` | `contentrain_submit` in review mode |
|
|
163
|
-
| `published` | Content is on
|
|
181
|
+
| `published` | Content is on `contentrain` branch and synced to baseBranch | Auto-merge, or PR merged after review |
|
|
164
182
|
| `rejected` | PR closed without merge | Studio reviewer rejects changes |
|
|
165
183
|
| `archived` | Metadata-only state | Manual action -- content hidden but retained |
|
|
166
184
|
|
|
@@ -208,8 +226,9 @@ published --> archived
|
|
|
208
226
|
|
|
209
227
|
```
|
|
210
228
|
contentrain_submit
|
|
211
|
-
--> Merge branch
|
|
212
|
-
-->
|
|
229
|
+
--> Merge feature branch into contentrain
|
|
230
|
+
--> Advance baseBranch via update-ref (fast-forward)
|
|
231
|
+
--> Selectively sync .contentrain/ files to developer's working tree
|
|
213
232
|
--> Clean up worktree
|
|
214
233
|
--> Status: published
|
|
215
234
|
```
|
|
@@ -218,8 +237,7 @@ contentrain_submit
|
|
|
218
237
|
|
|
219
238
|
```
|
|
220
239
|
contentrain_submit
|
|
221
|
-
--> Push branch to remote
|
|
222
|
-
--> Update context.json
|
|
240
|
+
--> Push feature branch to remote
|
|
223
241
|
--> Clean up worktree
|
|
224
242
|
--> Status: in_review
|
|
225
243
|
--> Studio notifies reviewers
|