@se-studio/skills 1.10.9 → 1.10.12

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @se-studio/skills
2
2
 
3
+ ## 1.10.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 79757c2: Add the `add-cms-type` bin: append component, collection or external component type names to the `componentType` / `collectionType` / `externalComponentType` enum in Contentful. Append-only, idempotent, with `--dry-run`. Documented in the `contentful-cms-content-model` skill.
8
+
9
+ ## 1.10.11
10
+
11
+ ### Patch Changes
12
+
13
+ - 032ea2f: cms-edit: add `delete plan/choose/apply` (drafts are deleted; a published entry needs `--published delete|archive`, asked of the user), `release_plan` / `release_apply` MCP tools, `pageTest` as a publishable root type, person / personType lookups (`--person-slug`, `--person-name`, `--person-type-slug`, `--person-type-name`), and person / personType / tagType session root types. Document which field each kind of content belongs in.
14
+
15
+ ## 1.10.10
16
+
17
+ ### Patch Changes
18
+
19
+ - 08365ca: State that cms-edit edits content only and never the content model. Add the `contentful-cms-content-model` skill (Contentful CLI + numbered migrations, colours, new component/collection types) and cross-link it from the core and sync-schema skills.
20
+
3
21
  ## 1.10.9
4
22
 
5
23
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/skills",
3
- "version": "1.10.9",
3
+ "version": "1.10.12",
4
4
  "description": "SE Studio agent skills for marketing site development with Contentful CMS",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@ Source of truth: `se-core-product` `docs/PHILOSOPHY.md`. Code review: `CODE_REVI
17
17
 
18
18
  ## Contentful
19
19
 
20
- - Do not change content models or run migrations in an app PR. Schema work is numbered migrations (core or `NN-…-<site>.js`), run on Nick's Mac only when Nick asks in chat.
20
+ - Do not change content models or run migrations in an app PR. Schema work is numbered migrations (core or `NN-…-<site>.js`), run with the Contentful CLI from any authenticated environment, and only after a human approves each one.
21
21
  - Fetch only through core helpers with cache tags. No direct Contentful CDA `fetch`.
22
22
 
23
23
  ## Rendering / visual system
@@ -25,7 +25,7 @@ Run a lens only when the diff can touch it.
25
25
  - [ ] If 2+ sites would need this within ~6 months, the change belongs in core — **BLOCKER** if implemented only here.
26
26
  - [ ] Server/client boundaries: `'use client'` does not import `cms-server`, `@se-studio/core-ui/server`, or `contentful-rest-api`.
27
27
  - [ ] Four-layer components / five-layer collections preserved; registrations match CMS types.
28
- - [ ] Contentful model/migrations are **not** in this app PR. Schema work is Nick’s Mac only, triggered via chat.
28
+ - [ ] Contentful model/migrations are **not** in this app PR. Schema work is a numbered migration run with the Contentful CLI from any authenticated environment, approved by a human before it runs.
29
29
 
30
30
  ### 2. Next.js / React / Vercel
31
31
 
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: contentful-cms-content-model
3
+ description: "Change the Contentful content model (content types, fields, validations, enums, colours, new component/collection/external-component types) with the Contentful CLI and numbered migrations. Use when a field, type or enum value is missing. cms-edit never does this."
4
+ ---
5
+
6
+ # Contentful content model changes
7
+
8
+ The content model is a **development** concern. **cms-edit edits content (entries, assets) only.** It never creates or changes content types, fields, validations, enums or editor interfaces, and `schema` commands are read-only inspection. If an editor task needs a field, type or enum value that does not exist, stop and use this skill (or hand it to a developer).
9
+
10
+ ## Preferred route
11
+
12
+ 1. Write a **numbered, idempotent** migration in `scripts/migrations/` (re-running it must be a no-op).
13
+ 2. Run it with the Contentful CLI: `contentful space migration --space-id <id> --environment-id <env> scripts/migrations/NN-name.js`. Any environment works where the CLI is installed and correctly logged in (`contentful login`), but a human must approve the migration before it runs (they need not be the one who asked for it). Try a non-production environment before master.
14
+ 3. In se-core-product only, after a core migration, re-export the golden schema (`docs/schema-export.json`; see `contentful-cms-sync-schema`). Customer-specific migrations do not touch the golden file.
15
+ 4. Regenerate types (`pnpm codegen`) and update `src/lib/registrations.ts` when a new component/collection/external component is added (skill `se-marketing-sites-register-cms-features`).
16
+
17
+ `add-cms-type` and `setup-colours` call the management API directly (they need `CONTENTFUL_MANAGEMENT_TOKEN`) instead of going through the CLI, so they leave no numbered migration behind. Both are safe to re-run. `add-cms-type` prints the target space and environment, refuses a content type that has unpublished changes, and never reorders or removes existing values. They still need the same human approval as a migration, and in se-core-product a core change still needs the golden schema re-exported.
18
+
19
+ Rules:
20
+
21
+ - Append-only for enums: never shrink live `componentType` / `collectionType` / `externalComponentType` lists.
22
+ - Never delete and recreate a field that holds content.
23
+ - Prefer typed named fields over free-form `meta`.
24
+ - Different UI or behaviour means a distinct component/collection/external component type, not a `cmsLabel` switch.
25
+
26
+ ## The common changes
27
+
28
+ Most model changes are one of two kinds, and both have a script.
29
+
30
+ | Change | Route |
31
+ |---|---|
32
+ | Colours (names in the colour validation) | the `setup-colours` bin from `@se-studio/project-build` (sites usually wrap it as `pnpm setup:colours`). Colour values on entries are still set with cms-edit; only the allowed names are model. |
33
+ | New component, collection or external component type | `add-cms-type <kind> "Name" [...] [--dry-run]` where kind is `component`, `collection` or `externalComponent` (`@se-studio/project-build`). These types are enum values on the `component`, `collection` and `externalComponent` content types, so it appends to the enum and publishes. Append-only, idempotent. Then register it in `src/lib/registrations.ts` and run `pnpm codegen`. |
34
+ | Anything else (new field, validation, genuinely new content type) | Hand-written numbered migration. Check `contentful-cms-sync-schema` first for an existing one. Reference migrations that create content types: `12-add-html-component.js`, `32-add-person-type.js`. |
35
+
36
+ ## Related skills
37
+
38
+ - `contentful-cms-sync-schema` — drift vs the golden export and migration runbooks.
39
+ - `contentful-cms-schema-audit` — cross-site audit.
40
+ - `contentful-cms-core` — editing content once the model supports it.
@@ -9,6 +9,8 @@ Use this skill when you need to read or edit content in Contentful using **hoste
9
9
 
10
10
  **Do not** run the local `cms-edit` binary for content. It refuses `open`, `save`, `set`, and other content commands. Local CLI is only for `host`, `editor-pack`, `patterns`, `project`, `schema`, and `guide`.
11
11
 
12
+ **Scope: content only.** cms-edit edits entries and assets. It does **not** change the content model (content types, fields, validations, enums such as `componentType` or colours). `schema` commands are read-only. If a field, type or enum value is missing, stop and use skill **`contentful-cms-content-model`** (Contentful CLI + numbered migrations); do not work around it.
13
+
12
14
  **Page patterns (local):** `cms-edit patterns generate --project-config cms-edit/<site>/project.json` writes live family stacks from the Delivery API. Hosted agents read `cms-edit://customer/page-patterns` after editor-pack generate.
13
15
 
14
16
  **Before editing:** use skill **`contentful-cms-editor-tasks`** to read `tasks-index` and the matching capability playbook for this site (hosted MCP or local `cms-edit/<site>/editor-pack/`).
@@ -25,7 +27,7 @@ Use this skill when you need to read or edit content in Contentful using **hoste
25
27
 
26
28
  ## Safety Rules
27
29
 
28
- `save` writes **drafts**. Publish, unpublish, and archive use `publish plan`, then `publish apply` after an explicit yes, and only when the signed-in Contentful role allows it. AI Editor cannot. Do not publish as part of save.
30
+ `save` writes **drafts**. Publish, unpublish, archive and delete use `<action> plan`, then `<action> apply` after an explicit yes (or the `release_plan` / `release_apply` tools), and only when the signed-in Contentful role allows it. AI Editor cannot. Do not publish as part of save. Draft-only entries can be deleted. For a **published** entry, ask the user whether to unpublish then delete or unpublish then archive, and pass `--published delete|archive`; never choose for them.
29
31
 
30
32
  **Assets:** Upload **is** supported (`asset upload`). Default workflow: **search and reuse** existing assets first (`index sync` → `asset search`). Search by concept (`asset search --concept` / `--concept-all`) finds a subject and a tone, including files no page uses yet. Concepts are not blog tags. When uploading:
31
33
  - **Raster/video:** `cms_edit_request_staged_upload` → curl → `cms_edit_media` prepare → wait → catalog → import with real alt. Video, and an image master over 4MB, is a presigned direct PUT (100MB, `intake: direct`) then prepare with that URL. Smaller images still use `stagedUploadIds`. Never `asset upload --staged/--url/--base64` for jpeg/png/webp/gif/mp4. The stored asset is the processed file.
@@ -7,6 +7,8 @@ description: "Audit Contentful schema drift vs golden export, write descriptive
7
7
 
8
8
  Use when a customer Contentful space should match the **structural** core schema (content types, fields, non-enum validations). Do **not** use for full enum alignment of `componentType` / `collectionType` — each site keeps its own component names.
9
9
 
10
+ For how to make a model change in the first place (Contentful CLI, numbered migrations, colours, new component types), see skill `contentful-cms-content-model`. cms-edit never changes the content model.
11
+
10
12
  ## Golden reference
11
13
 
12
14
  | Artifact | Purpose |