@se-studio/contentful-cms 1.0.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.
Files changed (173) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +519 -0
  3. package/dist/bin/cms-edit.d.ts +4 -0
  4. package/dist/bin/cms-edit.d.ts.map +1 -0
  5. package/dist/bin/cms-edit.js +101 -0
  6. package/dist/bin/cms-edit.js.map +1 -0
  7. package/dist/commands/add.d.ts +4 -0
  8. package/dist/commands/add.d.ts.map +1 -0
  9. package/dist/commands/add.js +166 -0
  10. package/dist/commands/add.js.map +1 -0
  11. package/dist/commands/asset.d.ts +4 -0
  12. package/dist/commands/asset.d.ts.map +1 -0
  13. package/dist/commands/asset.js +110 -0
  14. package/dist/commands/asset.js.map +1 -0
  15. package/dist/commands/colours.d.ts +4 -0
  16. package/dist/commands/colours.d.ts.map +1 -0
  17. package/dist/commands/colours.js +91 -0
  18. package/dist/commands/colours.js.map +1 -0
  19. package/dist/commands/create.d.ts +4 -0
  20. package/dist/commands/create.d.ts.map +1 -0
  21. package/dist/commands/create.js +223 -0
  22. package/dist/commands/create.js.map +1 -0
  23. package/dist/commands/diff.d.ts +4 -0
  24. package/dist/commands/diff.d.ts.map +1 -0
  25. package/dist/commands/diff.js +141 -0
  26. package/dist/commands/diff.js.map +1 -0
  27. package/dist/commands/discard.d.ts +4 -0
  28. package/dist/commands/discard.d.ts.map +1 -0
  29. package/dist/commands/discard.js +36 -0
  30. package/dist/commands/discard.js.map +1 -0
  31. package/dist/commands/entry-search.d.ts +4 -0
  32. package/dist/commands/entry-search.d.ts.map +1 -0
  33. package/dist/commands/entry-search.js +81 -0
  34. package/dist/commands/entry-search.js.map +1 -0
  35. package/dist/commands/export-converted.d.ts +8 -0
  36. package/dist/commands/export-converted.d.ts.map +1 -0
  37. package/dist/commands/export-converted.js +62 -0
  38. package/dist/commands/export-converted.js.map +1 -0
  39. package/dist/commands/links.d.ts +4 -0
  40. package/dist/commands/links.d.ts.map +1 -0
  41. package/dist/commands/links.js +255 -0
  42. package/dist/commands/links.js.map +1 -0
  43. package/dist/commands/list.d.ts +4 -0
  44. package/dist/commands/list.d.ts.map +1 -0
  45. package/dist/commands/list.js +91 -0
  46. package/dist/commands/list.js.map +1 -0
  47. package/dist/commands/move.d.ts +3 -0
  48. package/dist/commands/move.d.ts.map +1 -0
  49. package/dist/commands/move.js +84 -0
  50. package/dist/commands/move.js.map +1 -0
  51. package/dist/commands/nav.d.ts +4 -0
  52. package/dist/commands/nav.d.ts.map +1 -0
  53. package/dist/commands/nav.js +196 -0
  54. package/dist/commands/nav.js.map +1 -0
  55. package/dist/commands/open.d.ts +4 -0
  56. package/dist/commands/open.d.ts.map +1 -0
  57. package/dist/commands/open.js +74 -0
  58. package/dist/commands/open.js.map +1 -0
  59. package/dist/commands/read.d.ts +4 -0
  60. package/dist/commands/read.d.ts.map +1 -0
  61. package/dist/commands/read.js +102 -0
  62. package/dist/commands/read.js.map +1 -0
  63. package/dist/commands/remove.d.ts +4 -0
  64. package/dist/commands/remove.d.ts.map +1 -0
  65. package/dist/commands/remove.js +98 -0
  66. package/dist/commands/remove.js.map +1 -0
  67. package/dist/commands/rtf.d.ts +3 -0
  68. package/dist/commands/rtf.d.ts.map +1 -0
  69. package/dist/commands/rtf.js +131 -0
  70. package/dist/commands/rtf.js.map +1 -0
  71. package/dist/commands/save.d.ts +4 -0
  72. package/dist/commands/save.d.ts.map +1 -0
  73. package/dist/commands/save.js +59 -0
  74. package/dist/commands/save.js.map +1 -0
  75. package/dist/commands/screenshot.d.ts +4 -0
  76. package/dist/commands/screenshot.d.ts.map +1 -0
  77. package/dist/commands/screenshot.js +246 -0
  78. package/dist/commands/screenshot.js.map +1 -0
  79. package/dist/commands/set.d.ts +3 -0
  80. package/dist/commands/set.d.ts.map +1 -0
  81. package/dist/commands/set.js +152 -0
  82. package/dist/commands/set.js.map +1 -0
  83. package/dist/commands/skill.d.ts +4 -0
  84. package/dist/commands/skill.d.ts.map +1 -0
  85. package/dist/commands/skill.js +73 -0
  86. package/dist/commands/skill.js.map +1 -0
  87. package/dist/commands/snapshot.d.ts +3 -0
  88. package/dist/commands/snapshot.d.ts.map +1 -0
  89. package/dist/commands/snapshot.js +21 -0
  90. package/dist/commands/snapshot.js.map +1 -0
  91. package/dist/commands/types.d.ts +4 -0
  92. package/dist/commands/types.d.ts.map +1 -0
  93. package/dist/commands/types.js +78 -0
  94. package/dist/commands/types.js.map +1 -0
  95. package/dist/config/load.d.ts +14 -0
  96. package/dist/config/load.d.ts.map +1 -0
  97. package/dist/config/load.js +79 -0
  98. package/dist/config/load.js.map +1 -0
  99. package/dist/config/types.d.ts +13 -0
  100. package/dist/config/types.d.ts.map +1 -0
  101. package/dist/config/types.js +2 -0
  102. package/dist/config/types.js.map +1 -0
  103. package/dist/contentful/assets.d.ts +20 -0
  104. package/dist/contentful/assets.d.ts.map +1 -0
  105. package/dist/contentful/assets.js +36 -0
  106. package/dist/contentful/assets.js.map +1 -0
  107. package/dist/contentful/client.d.ts +28 -0
  108. package/dist/contentful/client.d.ts.map +1 -0
  109. package/dist/contentful/client.js +30 -0
  110. package/dist/contentful/client.js.map +1 -0
  111. package/dist/contentful/fetch.d.ts +20 -0
  112. package/dist/contentful/fetch.d.ts.map +1 -0
  113. package/dist/contentful/fetch.js +154 -0
  114. package/dist/contentful/fetch.js.map +1 -0
  115. package/dist/contentful/references.d.ts +7 -0
  116. package/dist/contentful/references.d.ts.map +1 -0
  117. package/dist/contentful/references.js +12 -0
  118. package/dist/contentful/references.js.map +1 -0
  119. package/dist/contentful/write.d.ts +16 -0
  120. package/dist/contentful/write.d.ts.map +1 -0
  121. package/dist/contentful/write.js +75 -0
  122. package/dist/contentful/write.js.map +1 -0
  123. package/dist/index.d.ts +3 -0
  124. package/dist/index.d.ts.map +1 -0
  125. package/dist/index.js +2 -0
  126. package/dist/index.js.map +1 -0
  127. package/dist/output/json.d.ts +47 -0
  128. package/dist/output/json.d.ts.map +1 -0
  129. package/dist/output/json.js +87 -0
  130. package/dist/output/json.js.map +1 -0
  131. package/dist/output/mode.d.ts +3 -0
  132. package/dist/output/mode.d.ts.map +1 -0
  133. package/dist/output/mode.js +16 -0
  134. package/dist/output/mode.js.map +1 -0
  135. package/dist/output/print.d.ts +14 -0
  136. package/dist/output/print.d.ts.map +1 -0
  137. package/dist/output/print.js +61 -0
  138. package/dist/output/print.js.map +1 -0
  139. package/dist/rtf/fromMarkdown.d.ts +19 -0
  140. package/dist/rtf/fromMarkdown.d.ts.map +1 -0
  141. package/dist/rtf/fromMarkdown.js +230 -0
  142. package/dist/rtf/fromMarkdown.js.map +1 -0
  143. package/dist/rtf/toMarkdown.d.ts +6 -0
  144. package/dist/rtf/toMarkdown.d.ts.map +1 -0
  145. package/dist/rtf/toMarkdown.js +105 -0
  146. package/dist/rtf/toMarkdown.js.map +1 -0
  147. package/dist/session/refs.d.ts +35 -0
  148. package/dist/session/refs.d.ts.map +1 -0
  149. package/dist/session/refs.js +128 -0
  150. package/dist/session/refs.js.map +1 -0
  151. package/dist/session/state.d.ts +91 -0
  152. package/dist/session/state.d.ts.map +1 -0
  153. package/dist/session/state.js +61 -0
  154. package/dist/session/state.js.map +1 -0
  155. package/dist/session/store.d.ts +10 -0
  156. package/dist/session/store.d.ts.map +1 -0
  157. package/dist/session/store.js +62 -0
  158. package/dist/session/store.js.map +1 -0
  159. package/dist/snapshot/render.d.ts +15 -0
  160. package/dist/snapshot/render.d.ts.map +1 -0
  161. package/dist/snapshot/render.js +166 -0
  162. package/dist/snapshot/render.js.map +1 -0
  163. package/dist/validation/allowed-types.d.ts +7 -0
  164. package/dist/validation/allowed-types.d.ts.map +1 -0
  165. package/dist/validation/allowed-types.js +16 -0
  166. package/dist/validation/allowed-types.js.map +1 -0
  167. package/package.json +61 -0
  168. package/skills/core/SKILL.md +483 -0
  169. package/skills/manifest.json +7 -0
  170. package/skills/navigation/SKILL.md +18 -0
  171. package/skills/rich-text/SKILL.md +23 -0
  172. package/skills/screenshots/SKILL.md +32 -0
  173. package/skills/templates/SKILL.md +16 -0
@@ -0,0 +1,483 @@
1
+ # Skill: contentful-cms CLI
2
+
3
+ Use this skill when you need to read or edit content in Contentful CMS using the `cms-edit` CLI tool.
4
+
5
+ ## Overview
6
+
7
+ `cms-edit` lets you read and edit Contentful draft content without publishing. It uses a **snapshot → ref → edit → save** workflow:
8
+
9
+ 1. `open` a page to load the content tree into a session
10
+ 2. `snapshot` to see the tree with `@ref` labels
11
+ 3. `read` an entry to inspect its fields
12
+ 4. `set` / `rtf` to modify fields
13
+ 5. `diff` to review changes
14
+ 6. `save` to write drafts to Contentful (NEVER publishes)
15
+
16
+ ## Safety Rules
17
+
18
+ **This tool CANNOT and WILL NOT:**
19
+ - Publish any entry
20
+ - Unpublish any entry
21
+ - Archive or delete published entries
22
+ - Upload new assets
23
+
24
+ All `save` operations create **draft** versions. A human must review and publish in Contentful.
25
+
26
+ ## Prerequisites
27
+
28
+ - `.contentful-cms.json` must exist in the project root (or ancestor directory)
29
+ - A Contentful Management Token with editor-only permissions (no publish rights) must be set as an env var and referenced in the config
30
+
31
+ To get the path to the full README (e.g. for an LLM to read): `cms-edit --docs`
32
+
33
+ ## Core Workflow
34
+
35
+ ### Step 1: Open a page
36
+
37
+ ```bash
38
+ # By slug
39
+ cms-edit open /pricing
40
+
41
+ # By slug with explicit space
42
+ cms-edit --space om1 open /pricing
43
+
44
+ # By Contentful entry ID
45
+ cms-edit open 4xKj2abcDef --id
46
+
47
+ # Home page (slug is 'index')
48
+ cms-edit open /
49
+ ```
50
+
51
+ ### Step 2: Read the snapshot
52
+
53
+ ```bash
54
+ cms-edit snapshot
55
+ ```
56
+
57
+ Output:
58
+ ```
59
+ Page: /pricing [4xKj2abc | published] · om1
60
+
61
+ @c0 Component[HeroSimple] "Transparent Pricing" [published]
62
+ @c1 Component[RichText] "How it works" [published]
63
+ @c2 Collection[CardGrid] "Plans" [published]
64
+ @c3 Component[Card] "Starter" [published]
65
+ @c4 Component[Card] "Pro" [draft]
66
+ @c5 Component[CTA] "Get started today" [published]
67
+ ```
68
+
69
+ Use `snapshot -c` for compact output (types only, no labels).
70
+
71
+ ### Step 3: Read entry fields
72
+
73
+ ```bash
74
+ # All fields summary
75
+ cms-edit read @c0
76
+
77
+ # Specific field (shows plain text for scalars, Markdown for rich text)
78
+ cms-edit read @c0 heading
79
+ cms-edit read @c1 body
80
+ ```
81
+
82
+ ### Step 4: Edit fields
83
+
84
+ **Scalar fields** (heading, title, slug, showHeading, etc.):
85
+ ```bash
86
+ cms-edit set @c0 heading "New heading text"
87
+ cms-edit set @c0 showHeading true
88
+ cms-edit set @c0 preHeading "Featured"
89
+ cms-edit set @c0 anchor "hero-section"
90
+ ```
91
+
92
+ **Entry link fields** (template, articleType, etc. — value is the linked entry ID):
93
+ ```bash
94
+ cms-edit set @c0 template 3I0HxGKbUd173wIpFCsbVr --link
95
+ ```
96
+
97
+ **Content arrays** (topContent, content, bottomContent, contents — replace or append entry links):
98
+ ```bash
99
+ cms-edit set @p0 content @c1,@c2,@c3 --links
100
+ cms-edit set @p0 bottomContent @c4 --links --append
101
+ ```
102
+
103
+ **Rich text fields** (body, additionalCopy):
104
+ ```bash
105
+ cms-edit rtf @c1 body "## Why it matters\n\nOur platform helps teams **move faster** with [confidence](https://example.com).\n\n- Instant setup\n- No code required\n- 99.9% uptime"
106
+ ```
107
+
108
+ Markdown support:
109
+ - `# Heading 1` through `###### Heading 6`
110
+ - `**bold**`, `_italic_`, `***bold italic***`
111
+ - `[link text](https://url)`
112
+ - `- item` for unordered lists, `1. item` for ordered
113
+ - `> blockquote`
114
+ - `` `inline code` ``
115
+ - `---` for horizontal rule
116
+
117
+ Use `\n` for newlines when passing multiline Markdown as a shell argument. For long content, use a file or stdin:
118
+
119
+ ```bash
120
+ cms-edit rtf @c1 body --file path/to/file.md
121
+ cms-edit rtf @c1 body - < path/to/file.md
122
+ ```
123
+
124
+ ### Step 5: Review changes
125
+
126
+ ```bash
127
+ cms-edit diff
128
+ ```
129
+
130
+ Shows a diff of all modified fields across all changed entries.
131
+
132
+ ### Step 6: Save
133
+
134
+ ```bash
135
+ cms-edit save
136
+ ```
137
+
138
+ Writes all changes to Contentful as **drafts**. The changes are visible in Contentful's web app but NOT live until a human publishes them.
139
+
140
+ After saving, the session is cleared automatically if all changes were saved.
141
+
142
+ ### Discard
143
+
144
+ ```bash
145
+ cms-edit discard
146
+ ```
147
+
148
+ Throws away all unsaved local changes without writing to Contentful.
149
+
150
+ ## Content Field Names
151
+
152
+ Based on the SE Studio content model:
153
+
154
+ ### Component fields
155
+ | Field | Type | Notes |
156
+ |-------|------|-------|
157
+ | `cmsLabel` | string | Internal name (required) |
158
+ | `componentType` | string | Type discriminator (e.g. `HeroSimple`) |
159
+ | `heading` | string | Main heading (only shown when `showHeading` is true) |
160
+ | `showHeading` | boolean | Whether to display the heading |
161
+ | `preHeading` | string | Text above the heading |
162
+ | `postHeading` | string | Text below the heading |
163
+ | `body` | rich text | Main body copy |
164
+ | `additionalCopy` | rich text | Secondary body copy |
165
+ | `anchor` | string | Section anchor ID |
166
+ | `backgroundColour` | string | Background colour name |
167
+ | `textColour` | string | Text colour name |
168
+
169
+ ### Collection fields
170
+ Same as Component plus:
171
+ | Field | Type | Notes |
172
+ |-------|------|-------|
173
+ | `collectionType` | string | Type discriminator (e.g. `CardGrid`) |
174
+
175
+ ### Page fields
176
+ | Field | Type | Notes |
177
+ |-------|------|-------|
178
+ | `slug` | string | URL slug (no leading slash in CMS) |
179
+ | `title` | string | SEO/display title |
180
+ | `description` | string | Meta description |
181
+ | `indexed` | boolean | Whether to index in search engines |
182
+
183
+ ## Order of operations: article + CTA
184
+
185
+ When adding body content and a CTA (e.g. PDF download) to an article:
186
+
187
+ 1. `cms-edit open <article-slug>` (or `open <id> --id`)
188
+ 2. Set body: `cms-edit rtf @<ref> body "..."` or `--file path/to.md`. If you need to add a body component first, use `add` then `rtf`.
189
+ 3. `cms-edit add CTA --target bottomContent`
190
+ 4. Set CTA links: use `--type external --label "Download PDF" --href <url>` for an external PDF URL, or `--type download --label "Download PDF" --asset-id <asset-id>` for a Contentful asset (get the ID from `cms-edit asset search "..."` or `asset info <id>`).
191
+ 5. `cms-edit save`
192
+
193
+ ## Structure Commands
194
+
195
+ ### Add a new component
196
+
197
+ ```bash
198
+ # Add at the end of page content
199
+ cms-edit add HeroSimple
200
+
201
+ # Add to article/page bottomContent (when session is an article or page)
202
+ cms-edit add CTA --target bottomContent
203
+
204
+ # Add after a specific component
205
+ cms-edit add HeroSimple --after @c1
206
+
207
+ # Add inside a collection
208
+ cms-edit add Card --parent @c2
209
+
210
+ # Add an explicit collection type
211
+ cms-edit add CardGrid --content-type collection
212
+ ```
213
+
214
+ Discover available types first:
215
+ ```bash
216
+ cms-edit types component
217
+ cms-edit types collection
218
+ ```
219
+
220
+ ### Remove a component
221
+
222
+ ```bash
223
+ cms-edit remove @c3
224
+ ```
225
+
226
+ If the entry is a draft and unreferenced elsewhere, it will be deleted on save. If it's published, it's unlinked only.
227
+
228
+ ### Move/reorder
229
+
230
+ ```bash
231
+ # Move @c3 to after @c1
232
+ cms-edit move @c3 --after @c1
233
+
234
+ # Move to before @c1
235
+ cms-edit move @c3 --before @c1
236
+
237
+ # Move to first position
238
+ cms-edit move @c3
239
+ ```
240
+
241
+ ## Links (CTAs)
242
+
243
+ Put the ref **after the subcommand** (e.g. `links add @c5`). The `links add` command creates the link entry and attaches it to the CTA in one step.
244
+
245
+ - **External:** `--type external --label "..." --href <url>` (required: `--href`)
246
+ - **Internal:** use `--slug /page` to look up by slug, or `--id <entry-id>` to reference by Contentful entry ID (required: `--slug` or `--id`)
247
+ - **Download:** `--type download --label "..." --asset-id <asset-id>` (required: `--asset-id`; get the ID from `asset search` or `asset info`)
248
+
249
+ ```bash
250
+ # List current links
251
+ cms-edit links list @c5
252
+
253
+ # Add an external link
254
+ cms-edit links add @c5 --type external --label "Learn more" --href https://example.com
255
+
256
+ # Add an external PDF CTA (URL to the file)
257
+ cms-edit links add @c5 --type external --label "Download PDF" --href "https://www.example.com/whitepaper.pdf"
258
+
259
+ # Add an internal link by slug
260
+ cms-edit links add @c5 --type internal --label "Pricing" --slug /pricing
261
+
262
+ # Add an internal link by entry ID
263
+ cms-edit links add @c5 --type internal --label "About" --id 4xKj2abcDef
264
+
265
+ # Add a download link (Contentful asset)
266
+ cms-edit links add @c5 --type download --label "Download PDF" --asset-id 5xKj2abcDef
267
+
268
+ # Remove link at index 1
269
+ cms-edit links remove @c5 1
270
+
271
+ # Move link from index 2 to index 0
272
+ cms-edit links move @c5 2 0
273
+ ```
274
+
275
+ ## Assets
276
+
277
+ ```bash
278
+ # Search for an asset
279
+ cms-edit asset search "hero background"
280
+
281
+ # Get asset details
282
+ cms-edit asset info 5xKj2abcDef
283
+
284
+ # Set a visual field
285
+ cms-edit asset set @c0 visual 5xKj2abcDef
286
+ ```
287
+
288
+ ## Navigation
289
+
290
+ ```bash
291
+ # Open a navigation entry
292
+ cms-edit nav open main-navigation
293
+
294
+ # Add an item
295
+ cms-edit nav add --label "Pricing" --slug /pricing
296
+ cms-edit nav add --label "Docs" --href https://docs.example.com --after @c1
297
+ ```
298
+
299
+ ## Create New Entries
300
+
301
+ ```bash
302
+ # Create a new page (session opens on the new entry)
303
+ cms-edit create page --slug /about-us --title "About Us" --description "Learn about our team"
304
+
305
+ # Create a new article (requires articleType entry ID)
306
+ cms-edit create article --slug /blog/my-post --title "My Post" --article-type-id 3abcDef456
307
+ ```
308
+
309
+ ## Search and Discovery
310
+
311
+ ```bash
312
+ # Search entries full-text
313
+ cms-edit search "pricing page"
314
+ cms-edit search "hero" --type component
315
+
316
+ # List valid type values
317
+ cms-edit types component
318
+ cms-edit types collection
319
+ ```
320
+
321
+ ## Multi-space
322
+
323
+ ```bash
324
+ # Specify space explicitly
325
+ cms-edit --space brightline open /home
326
+ cms-edit --space om1 open /pricing
327
+ ```
328
+
329
+ Or set `CMS_EDIT_SPACE=om1` environment variable.
330
+
331
+ ## Complete Example: Update a Hero Section
332
+
333
+ ```bash
334
+ # 1. Open the page
335
+ cms-edit open /about-us
336
+
337
+ # 2. Find the hero component
338
+ cms-edit snapshot
339
+
340
+ # 3. Read it to understand current state
341
+ cms-edit read @c0
342
+
343
+ # 4. Update the heading
344
+ cms-edit set @c0 heading "We build for the future"
345
+
346
+ # 5. Update the body copy
347
+ cms-edit rtf @c0 body "## Our mission\n\nWe help companies **ship faster** and _smarter_.\n\n- Founded in 2018\n- 500+ clients\n- [Join us](/careers)"
348
+
349
+ # 6. Review
350
+ cms-edit diff
351
+
352
+ # 7. Save as draft
353
+ cms-edit save
354
+ # → "Saved 1 entry as draft. A human must publish for changes to go live."
355
+ ```
356
+
357
+ ## Common Patterns
358
+
359
+ ### Update an existing article
360
+ ```bash
361
+ cms-edit open /blog/old-title --id # or by slug
362
+ cms-edit set @p0 title "New Article Title"
363
+ cms-edit set @p0 slug new-article-slug
364
+ cms-edit set @p0 description "Updated description"
365
+ cms-edit save
366
+ ```
367
+
368
+ ### Add a new section to a page
369
+ ```bash
370
+ cms-edit open /products
371
+ cms-edit types component # discover what's available
372
+ cms-edit add CTA --after @c3
373
+ cms-edit set @c4 heading "Ready to get started?"
374
+ cms-edit rtf @c4 body "Join thousands of teams who trust us."
375
+ cms-edit links add @c4 --type external --label "Start free trial" --href https://app.example.com
376
+ cms-edit save
377
+ ```
378
+
379
+ ### Reorder page sections
380
+ ```bash
381
+ cms-edit open /home
382
+ cms-edit snapshot # see current order
383
+ cms-edit move @c3 --after @c1 # move section 3 to position 2
384
+ cms-edit save
385
+ ```
386
+
387
+ ## Screenshots
388
+
389
+ The `screenshot` command captures a PNG of a component, collection, external component, person, or page using [agent-browser](https://github.com/vercel-labs/agent-browser).
390
+
391
+ **Prerequisites:** `npm install -g agent-browser && agent-browser install`. For `@ref` and `--json-file`, the app must be running at `devBaseUrl`.
392
+
393
+ **Config:** Add `devBaseUrl` to the space in `.contentful-cms.json` so the CLI knows where your dev server runs:
394
+ ```json
395
+ {
396
+ "spaces": {
397
+ "om1": {
398
+ "devBaseUrl": "http://localhost:3013"
399
+ }
400
+ }
401
+ }
402
+ ```
403
+ If omitted, defaults to `http://localhost:3000` with a warning.
404
+
405
+ ### From session ref (full-fidelity)
406
+
407
+ `cms-edit screenshot @c0` uses the app's convert API and `/cms-preview/render-json` so **all** entry types render with real converted data: component, collection, externalComponent, person. No separate "mock vs live" for refs.
408
+
409
+ ```bash
410
+ # Any entry type (component, collection, externalComponent, person)
411
+ cms-edit screenshot @c0
412
+
413
+ # Full-page capture (auto-applied for component/collection)
414
+ cms-edit screenshot @c0 --full
415
+
416
+ # Just print URL
417
+ cms-edit screenshot @c0 --url-only
418
+ ```
419
+
420
+ ### From JSON file (no Contentful)
421
+
422
+ Screenshot an IBase* JSON file (e.g. exported from `cms-edit read @c0 --json` or a fixture). App must be running.
423
+
424
+ ```bash
425
+ cms-edit screenshot --json-file path/to/component.json
426
+ ```
427
+
428
+ ### By type (showcase mock, no session)
429
+
430
+ Uses `/cms-showcase/render` with mock data. Fast, no preview token.
431
+
432
+ ```bash
433
+ cms-edit screenshot --component HeroSimple
434
+ cms-edit screenshot --collection CardGrid
435
+ cms-edit screenshot @c0 --embedded --full # when using ref with showcase-style capture
436
+ ```
437
+
438
+ ### Page screenshots
439
+
440
+ ```bash
441
+ # Current open page (uses session root slug)
442
+ cms-edit screenshot
443
+
444
+ # Explicit page slug
445
+ cms-edit screenshot /pricing
446
+ cms-edit screenshot /about-us --full
447
+ ```
448
+
449
+ ### Options
450
+
451
+ | Flag | Description |
452
+ |------|-------------|
453
+ | `--json-file <path>` | Read IBase* JSON from file and screenshot via render-json (no Contentful) |
454
+ | `--live` | Legacy: use `/cms-preview/render?id=...` for ref (optional; @ref is already full-fidelity) |
455
+ | `--out <path>` | Output file path (default: `./screenshot-<type>-<timestamp>.png`) |
456
+ | `--full` | Full-page capture (passed to `agent-browser screenshot --full`) |
457
+ | `--embedded` | Append `&embedded=true` to showcase URL (suppresses IframeHeightReporter) |
458
+ | `--wait <ms>` | Wait milliseconds after page load before capturing (default: 500) |
459
+ | `--url-only` | Print URL only, do not invoke agent-browser |
460
+ | `--json` | Output `{ ok, url, file }` as JSON |
461
+
462
+ ### Visual diffing
463
+
464
+ Use `agent-browser diff screenshot` to compare before/after a content change:
465
+
466
+ ```bash
467
+ # 1. Capture baseline before editing
468
+ cms-edit screenshot @c0 --out before.png
469
+
470
+ # 2. Edit content
471
+ cms-edit set @c0 heading "New heading"
472
+ cms-edit save
473
+
474
+ # 3. Capture after
475
+ cms-edit screenshot @c0 --out after.png
476
+
477
+ # 4. Diff
478
+ agent-browser diff screenshot --baseline before.png after.png
479
+ ```
480
+
481
+ ## Related skills
482
+
483
+ For templates see the **templates** skill; for navigation see the **navigation** skill; for rich text and embeds see the **rich-text** skill; for screenshots see the **screenshots** skill.
@@ -0,0 +1,7 @@
1
+ {
2
+ "core": "Main workflow, refs, session, and all cms-edit commands",
3
+ "templates": "Create and edit templates (preContent, postContent, menu, footer, colours)",
4
+ "navigation": "Create navigation, nav open/add, set nav item fields, remove",
5
+ "rich-text": "Rich text (rtf) and embeds (append/insert); Markdown support",
6
+ "screenshots": "Screenshot command, agent-browser requirement, mock vs live, --url-only"
7
+ }
@@ -0,0 +1,18 @@
1
+ # Skill: contentful-cms — Navigation
2
+
3
+ Use this skill when creating or editing **navigation** entries and their items in Contentful via `cms-edit`.
4
+
5
+ ## Workflow
6
+
7
+ 1. **Create** a navigation: `cms-edit create navigation --label 'Main menu'`
8
+ 2. **Open** the nav: `cms-edit nav open <slug-or-id>` (or after create, use the printed open command)
9
+ 3. **Add** items: `cms-edit nav add --label "Pricing" --slug /pricing` or `--label "Docs" --href https://docs.example.com`; use `--after @cN` to insert after a ref.
10
+ 4. **Set** nav item fields (use snapshot refs): `cms-edit set @c1 label "New label"`, `cms-edit set @c1 page <entry-id> --link`, `cms-edit set @c1 externalUrl "https://..."`.
11
+ 5. **Remove** an item: `cms-edit remove @cN`
12
+ 6. **Save**: `cms-edit save`
13
+
14
+ Navigation entries are often linked from templates as **menu** or **footer**; set those with `set ... menu <nav-id> --link` from a template session.
15
+
16
+ ## Related skills
17
+
18
+ See the **core** skill for session, refs, and all commands. For templates that use menu/footer see the **templates** skill.
@@ -0,0 +1,23 @@
1
+ # Skill: contentful-cms — Rich text and embeds
2
+
3
+ Use this skill when editing **rich text** fields (body, additionalCopy) and inserting **embedded entries/assets** via `cms-edit`.
4
+
5
+ ## Rich text (rtf)
6
+
7
+ - **Replace** body with Markdown: `cms-edit rtf @c1 body "## Heading\n\nParagraph with **bold** and [link](https://example.com)."`
8
+ - Use `--file path/to/file.md` or stdin (`-`) for long content.
9
+ - Markdown supported: headings, bold/italic, links, lists, blockquote, inline code, `---`.
10
+
11
+ Use **set** for scalar and link fields; use **rtf** only for rich text fields.
12
+
13
+ ## Embeds (v1: append/insert only)
14
+
15
+ - **Append** an embedded entry: `cms-edit rtf embed @c1 body <entry-id>`
16
+ - **Insert** at position: `cms-edit rtf embed @c1 body <entry-id> --at 0`
17
+ - **Asset** embed: `cms-edit rtf embed @c1 body <asset-id> --asset`
18
+
19
+ Editing or moving existing embeds is **not supported in v1**.
20
+
21
+ ## Related skills
22
+
23
+ See the **core** skill for workflow, refs, and all commands.
@@ -0,0 +1,32 @@
1
+ # Skill: contentful-cms — Screenshots
2
+
3
+ Use this skill when capturing **screenshots** of components, collections, pages, or persons with `cms-edit`. **Requires agent-browser** to be installed.
4
+
5
+ ## Prerequisites
6
+
7
+ - `npm install -g agent-browser && agent-browser install`
8
+ - Without agent-browser, the command exits with install instructions (use `--url-only` to only print the URL).
9
+ - For `@ref` and `--json-file`: the app must be running at `devBaseUrl` (see `.contentful-cms.json`).
10
+
11
+ ## Commands
12
+
13
+ - **From session ref** (full-fidelity): `cms-edit screenshot @c0` — uses the convert API and `/cms-preview/render-json` so **all** entry types render with real data: component, collection, externalComponent, person. Add `--full` for full-page capture (auto-applied for component/collection).
14
+ - **From JSON file** (no Contentful): `cms-edit screenshot --json-file path/to/entry.json` — reads an IBase* JSON (e.g. from `read @c0 --json` or an export), base64-encodes it, and opens `/cms-preview/render-json?data=...`. Use to validate or screenshot without a session or preview token.
15
+ - **By type** (no session, mock): `cms-edit screenshot --component HeroSimple`, `cms-edit screenshot --collection CardGrid` — uses `/cms-showcase/render` with mock data.
16
+ - **Page**: `cms-edit screenshot` (current open page) or `cms-edit screenshot /pricing`
17
+ - **URL only** (no agent-browser needed): `cms-edit screenshot @c0 --url-only`
18
+
19
+ ## Mock vs live (type-only mode only)
20
+
21
+ When using `--component <type>` or `--collection <type>` (no session), the default is **mock** (showcase). Use `--live` with a ref to prefer the legacy direct preview URL; for `@ref`, full-fidelity is already the default via convert → render-json.
22
+
23
+ - **Mock:** `/cms-showcase/render` with mock data; fast, no preview token.
24
+ - **Live** (with ref): `cms-edit screenshot @c0 --live` — uses `/cms-preview/render?id=...`; equivalent for component/collection/externalComponent to the default @ref path.
25
+
26
+ ## Checking your work
27
+
28
+ After editing content, run `cms-edit screenshot @ref` or `cms-edit screenshot /slug` to capture and verify. Use `--out before.png` / `--out after.png` and `agent-browser diff screenshot` for visual diffing. To validate a component from exported JSON, use `cms-edit screenshot --json-file <path>`.
29
+
30
+ ## Related skills
31
+
32
+ See the **core** skill for session, open, and snapshot.
@@ -0,0 +1,16 @@
1
+ # Skill: contentful-cms — Templates
2
+
3
+ Use this skill when creating or editing **templates** (layout shells with preContent, postContent, menu, footer) in Contentful via `cms-edit`.
4
+
5
+ ## Workflow
6
+
7
+ 1. **Create** a template: `cms-edit create template --label 'Campaign Landing'`
8
+ 2. **List** templates: `cms-edit list --type template`
9
+ 3. **Open** by ID: `cms-edit open <template-id> --id`
10
+ 4. Edit content: set **preContent** and **postContent** (content arrays) via session snapshot refs; use `add`, `set`, `remove`, `move` as for pages. Set **menu** and **footer** (single navigation links) with `cms-edit set @ref menu <nav-entry-id> --link` and same for `footer`.
11
+ 5. Set **colours**: `cms-edit set @ref backgroundColour Navy`, `cms-edit set @ref textColour White` (or project colour names).
12
+ 6. **Save**: `cms-edit save`
13
+
14
+ ## Related skills
15
+
16
+ See the **core** skill for the full workflow (open, snapshot, set, save). For menu/footer navigation entries use the **navigation** skill.