@se-studio/skills 1.0.37 → 1.0.39

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,27 @@
1
1
  # @se-studio/skills
2
2
 
3
+ ## 1.0.39
4
+
5
+ ### Patch Changes
6
+
7
+ - Bulk version bump: patch for all packages
8
+
9
+ ## 1.0.38
10
+
11
+ ### Patch Changes
12
+
13
+ - Extend the local content index with a reference catalog, automatic sync, and bundled skills for cms-edit.
14
+
15
+ - **Content index (schema v2)** — index `template`, `articleType`, `tagType`, and `tag` in SQLite alongside assets and media
16
+ - **Automatic index sync** — index-backed commands call `ensureContentIndex`; full rebuild when missing or schema-outdated, incremental upsert when stale (>24h). Manual `index sync` always full rebuilds
17
+ - **`list --type template|articleType|tagType|tag`** — index-preferred listing with `--force-cma` escape hatch; template `--slug` filters by cmsLabel
18
+ - **`resolve --type template --label`** — resolve templates by cmsLabel; reference types use index with CMA fallback
19
+ - **`index dump --reference-only` / `--reference-type`** — browse the reference catalog
20
+ - **Duplicate detection** — ambiguous slug/label matches throw `ReferenceCatalogAmbiguityError`
21
+ - **File lock** — single writer per index database during sync
22
+ - **`requireMediaIndex` removed** — replaced by async `ensureContentIndex`
23
+ - **Bundled skills** — `sync:skills` copies cms-edit skills from `@se-studio/skills`; setup wizard can install into `.agents/skills`
24
+
3
25
  ## 1.0.37
4
26
 
5
27
  ### Patch Changes
package/README.md CHANGED
@@ -57,6 +57,26 @@ Claude Code uses a naive frontmatter parser; violations cause descriptions to si
57
57
  3. Sync: `pnpm skills:sync`
58
58
  4. Add a changeset if publishing `@se-studio/skills`
59
59
 
60
+ ### cms-edit bundled skills (`@se-studio/contentful-cms`)
61
+
62
+ The CLI ships a **subset** of skills under `packages/contentful-cms/skills/` for `cms-edit skill install`. Those files are **generated** from this package:
63
+
64
+ | Canonical source (`packages/skills/skills/`) | Bundled name (`packages/contentful-cms/skills/`) |
65
+ |---------------------------------------------|--------------------------------------------------|
66
+ | `contentful-cms-core` | `core` |
67
+ | `contentful-cms-templates` | `templates` |
68
+ | `contentful-cms-setup` | `setup` |
69
+
70
+ After editing any `contentful-cms-*` skill here, run:
71
+
72
+ ```bash
73
+ pnpm --filter @se-studio/contentful-cms sync:skills
74
+ ```
75
+
76
+ Do not edit `packages/contentful-cms/skills/` directly. See `packages/contentful-cms/docs/SKILLS.md`.
77
+
78
+ **Do not use `.claude/skills/` in the repo** as a skill source — it is untracked and local. Use `.agents/skills/` (via `pnpm skills:sync`) or `cms-edit skill install`.
79
+
60
80
  ## References
61
81
 
62
82
  - [Anthropic skill authoring best practices](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@se-studio/skills",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
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 @@ If no brand context is available, ask the user about any brand-specific terms be
17
17
 
18
18
  1. **Get all pages**: `cms-edit sitemap`
19
19
  2. **For each page** (or a specific page if the user specified one):
20
- a. `cms-edit open /<slug>`
20
+ a. `cms-edit open --page-slug /<slug>` (or `--article-slug` for articles)
21
21
  b. `cms-edit snapshot` — identify components with visual/image/media fields
22
22
  c. For each image-bearing component:
23
23
  - `cms-edit read @ref` to inspect fields
@@ -40,20 +40,23 @@ To get the path to the full README (e.g. for an LLM to read): `cms-edit --docs`
40
40
  ### Step 1: Open a page
41
41
 
42
42
  ```bash
43
- # By slug
44
- cms-edit open /pricing
43
+ # By page slug (trailing slash OK)
44
+ cms-edit open --page-slug /pricing
45
+
46
+ # By page cmsLabel (when editors use cmsLabel heavily)
47
+ cms-edit open --page-cms-label "Pricing page"
45
48
 
46
49
  # By slug with explicit space
47
- cms-edit --space om1 open /pricing
50
+ cms-edit --space om1 open --page-slug /pricing
48
51
 
49
52
  # By Contentful entry ID
50
- cms-edit open 4xKj2abcDef --id
53
+ cms-edit open --id 4xKj2abcDef
51
54
 
52
55
  # Home page (slug is 'index')
53
- cms-edit open /
56
+ cms-edit open --page-slug /
54
57
  ```
55
58
 
56
- **Slug `open`:** matches **page**, **article**, **articleType**, and **tag** by `fields.slug` (in that order; first match wins). For **template** or **navigation**, use `open <id> --id` or `cms-edit nav open`.
59
+ **Flat lookup flags:** provide **exactly one** primary flag per `open` / `resolve` / `nav open`. See `cms-edit help lookup`. Run `cms-edit index sync` so catalog types resolve from the local index.
57
60
 
58
61
  ### Step 2: Read the snapshot
59
62
 
@@ -236,7 +239,7 @@ Same as Component plus:
236
239
 
237
240
  When adding body content and a CTA (e.g. PDF download) to an article:
238
241
 
239
- 1. `cms-edit open <article-slug>` (or `open <id> --id`)
242
+ 1. `cms-edit open --article-slug <slug>` (or `open --id <id>`)
240
243
  2. Set body: `cms-edit rtf @<ref> body --markdown "..."` or `--markdown --file path/to.md`. If you need to add a body component first, use `add` then `rtf`.
241
244
  3. `cms-edit add CTA --target bottomContent`
242
245
  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>`).
@@ -341,10 +344,33 @@ cms-edit set @c5 links linkId4 --links --append
341
344
 
342
345
  ## Assets
343
346
 
347
+ **Content index:** Run `cms-edit index sync` once per space before asset search, media-by-filename list, asset audit, or `--if-exists-by-filename`. The same sync indexes the full **content catalog** (pages, articles, taxonomy, navigation, templates) for fast `list`, `open`, and `resolve`. Default sync uses the **Preview API** (draft content). See `cms-edit help index-sync` and `cms-edit help lookup`.
348
+
344
349
  ```bash
345
- # Search for an asset
350
+ cms-edit index sync
351
+ cms-edit index status
352
+ cms-edit list --type page
353
+ cms-edit list --type template
354
+ cms-edit resolve --tag-type-slug topic
355
+
356
+ # Published-only index (optional)
357
+ cms-edit index sync --published
358
+
359
+ # Search for an asset by title (requires index)
346
360
  cms-edit asset search "hero background"
347
361
 
362
+ # Search by fileName
363
+ cms-edit asset search --filename istockphoto-123.jpg
364
+ cms-edit asset search --filename-match 'istockphoto-.*'
365
+
366
+ # Upload from local file, URL, or base64
367
+ cms-edit asset upload ./poster.jpg --title "Poster"
368
+ cms-edit asset upload --url https://example.com/image.jpg --if-exists-by-filename
369
+ cms-edit asset upload --base64 "$B64" --mime image/png --file-name poster.png
370
+
371
+ # Upload and create a Media wrapper in one step
372
+ cms-edit asset upload ./figure.png --with-media --media-name "Figure 1" --media-position Middle
373
+
348
374
  # Get asset details
349
375
  cms-edit asset info 5xKj2abcDef
350
376
 
@@ -352,11 +378,15 @@ cms-edit asset info 5xKj2abcDef
352
378
  cms-edit asset set @c0 visual 5xKj2abcDef
353
379
  ```
354
380
 
381
+ JSON output for upload (`CMS_EDIT_JSON=1`): `{ ok, id, fileName, url, mediaId?, mediaIds? }`. Max upload size is **10MB** per file.
382
+
383
+ **Idempotent upload:** `--if-exists-by-filename` is check-then-create. Do not upload the same `fileName` in parallel — serialize per fileName or re-run to converge.
384
+
355
385
  ## Navigation
356
386
 
357
387
  ```bash
358
- # Open a navigation entry
359
- cms-edit nav open main-navigation
388
+ # Open a navigation entry (navigation uses `name`, not slug)
389
+ cms-edit nav open --nav-name "Main navigation"
360
390
 
361
391
  # Add a new item
362
392
  cms-edit nav add --label "Pricing" --slug /pricing
@@ -384,8 +414,39 @@ cms-edit create page --slug /about-us --title "About Us" \
384
414
 
385
415
  # Create a new article (requires articleType entry ID)
386
416
  cms-edit create article --slug /blog/my-post --title "My Post" --article-type-id 3abcDef456
417
+
418
+ # Create taxonomy entries (draft only)
419
+ cms-edit create tag-type --slug conference-venue --name "Conference Venue"
420
+ cms-edit create article-type --slug resources/publications --name "Publications"
421
+ cms-edit create tag --slug poster-presentation --name "Poster Presentation" --tag-type-slug presentation-type
422
+ # cmsLabel defaults to "<tagType name> — <tag name>" when --cms-label omitted
423
+ cms-edit create tag --slug easl-congress-2026 --name "EASL Congress 2026" --tag-type publication-source \
424
+ --description "Research presented at EASL Congress 2026." --featured-image <logoAssetId>
425
+
426
+ # Full fields via JSON
427
+ cms-edit create tag --json-file tag.json --tag-type presentation-type --if-not-exists
428
+
429
+ # Batch bootstrap
430
+ cms-edit create taxonomy-from-json --file taxonomy.json --if-not-exists
431
+
432
+ # Idempotent single-entry creates
433
+ cms-edit ensure tag-type --slug conference-venue --name "Conference Venue"
434
+ cms-edit ensure tag --slug asco-2025 --name "ASCO 2025" --tag-type conference-venue \
435
+ --description "Annual ASCO conference." --featured-image <logoAssetId>
436
+ ```
437
+
438
+ See `cms-edit help fields-taxonomy` and `cms-edit help taxonomy-from-json` for field reference and batch schema.
439
+
440
+ **Idempotent taxonomy:** `--if-not-exists` / `ensure` are check-then-create — safe for sequential imports, not for parallel creates on the same slug.
441
+
442
+ ```bash
443
+ # Resolve taxonomy IDs without a session
444
+ cms-edit resolve --tag-type-slug presentation-type
445
+ cms-edit resolve --tag-name "ASCO 2025" --tag-type-name "Conference Venue"
387
446
  ```
388
447
 
448
+ Use flat flags: `--page-slug`, `--article-cms-label`, `--tag-slug`, `--template-label`, etc. (`cms-edit help lookup`).
449
+
389
450
  ## Search and Discovery
390
451
 
391
452
  ```bash
@@ -403,9 +464,16 @@ cms-edit list --type article --slug my-article # article with a specific slug
403
464
  cms-edit list --type article --has-field tags # articles where tags field is non-empty
404
465
 
405
466
  # Resolve any entry or asset by ID (no open session required)
406
- cms-edit resolve 4xKj2abcDefGhijK # entry: shows type, title, slug, status
407
- cms-edit resolve 7pQrStuvWxyzAbc # asset: shows title, fileName, URL
408
- cms-edit resolve <id> --json # full Contentful object
467
+ cms-edit resolve --id 4xKj2abcDefGhijK # entry: shows type, title, slug, status
468
+ cms-edit resolve --id 7pQrStuvWxyzAbc # asset: shows title, fileName, URL
469
+ cms-edit resolve --tag-type-slug presentation-type
470
+ cms-edit resolve --tag-slug asco-2025 --tag-type-slug conference-venue
471
+ cms-edit resolve --tag-type-slug presentation-type --json
472
+
473
+ # Find Media entries by asset
474
+ cms-edit list --type media --asset-id 7pQrStuvWxyzAbc
475
+ cms-edit list --type media --asset-filename istockphoto-123.jpg
476
+ cms-edit list --type media --asset-filename-match 'istockphoto-.*'
409
477
  ```
410
478
 
411
479
  To resolve a **tag entry ID** to its slug or label (e.g. for constructing article URLs such as `/resources/publications/<tag>/<slug>`):
@@ -420,8 +488,8 @@ cms-edit resolve <tag-entry-id>
420
488
 
421
489
  ```bash
422
490
  # Specify space explicitly
423
- cms-edit --space brightline open /home
424
- cms-edit --space om1 open /pricing
491
+ cms-edit --space brightline open --page-slug /home
492
+ cms-edit --space om1 open --page-slug /pricing
425
493
  ```
426
494
 
427
495
  Or set `CMS_EDIT_SPACE=om1` environment variable.
@@ -430,7 +498,7 @@ Or set `CMS_EDIT_SPACE=om1` environment variable.
430
498
 
431
499
  ```bash
432
500
  # 1. Open the page
433
- cms-edit open /about-us
501
+ cms-edit open --page-slug /about-us
434
502
 
435
503
  # 2. Find the hero component
436
504
  cms-edit snapshot
@@ -456,7 +524,7 @@ cms-edit save
456
524
 
457
525
  ### Update an existing article
458
526
  ```bash
459
- cms-edit open /blog/old-title --id # or by slug
527
+ cms-edit open --article-slug /blog/old-title # or cms-edit open --id <id>
460
528
  cms-edit set @p0 title "New Article Title" # @p0 works in article sessions too
461
529
  cms-edit set @p0 slug new-article-slug
462
530
  cms-edit set @p0 description "Updated description"
@@ -465,7 +533,7 @@ cms-edit save
465
533
 
466
534
  ### Add a new section to a page
467
535
  ```bash
468
- cms-edit open /products
536
+ cms-edit open --page-slug /products
469
537
  cms-edit types component # discover what's available
470
538
  cms-edit add CTA --after @c3
471
539
  cms-edit set @c4 heading "Ready to get started?"
@@ -476,7 +544,7 @@ cms-edit save
476
544
 
477
545
  ### Reorder page sections
478
546
  ```bash
479
- cms-edit open /home
547
+ cms-edit open --page-slug /home
480
548
  cms-edit snapshot # see current order
481
549
  cms-edit move @c3 --after @c1 # move section 3 to position 2
482
550
  cms-edit save
@@ -623,8 +691,8 @@ cms-edit sitemap --include page,article # Include articles too
623
691
  Inspect a page without affecting your active session.
624
692
 
625
693
  ```bash
626
- cms-edit peek /pricing # Show snapshot of /pricing; your active session is unchanged
627
- cms-edit peek <id> --id # Look up by entry ID
694
+ cms-edit peek --page-slug /pricing # Show snapshot of /pricing; your active session is unchanged
695
+ cms-edit peek --id <entryId> # Look up by entry ID
628
696
  ```
629
697
 
630
698
  ## Batch Operations (run)
@@ -805,8 +873,8 @@ cms-edit sitemap --include page,article # Include articles
805
873
  Use `--session <name>` or `CONTENTFUL_CMS_SESSION=<name>` to isolate parallel workflows.
806
874
 
807
875
  ```bash
808
- cms-edit --session agent-1 open /pricing
809
- cms-edit --session agent-2 open /blog
876
+ cms-edit --session agent-1 open --page-slug /pricing
877
+ cms-edit --session agent-2 open --article-slug /blog
810
878
  ```
811
879
 
812
880
  ## Related skills
@@ -10,7 +10,7 @@ Use this skill when creating or editing **navigation** entries and their items i
10
10
  ## Workflow
11
11
 
12
12
  1. **Create** a navigation: `cms-edit create navigation --label 'Main menu'`
13
- 2. **Open** the nav: `cms-edit nav open <slug-or-id>` (or after create, use the printed open command)
13
+ 2. **Open** the nav: `cms-edit nav open --nav-name "Main menu"` or `cms-edit nav open --nav-id <id>` (printed after create/clone)
14
14
  3. **Add items** (new or existing):
15
15
  ```bash
16
16
  # Create a new nav item with a page link
@@ -48,7 +48,7 @@ This creates new copies of every NavigationItem and links them into the new navi
48
48
  In a navigation session, the root navigation entry is **`@c0`** (or the universal alias **`@root`**). The `@p0` alias only works in page/article sessions.
49
49
 
50
50
  ```bash
51
- cms-edit nav open main-navigation
51
+ cms-edit nav open --nav-name "Main menu"
52
52
  cms-edit snapshot # root is @c0; items are @c1, @c2, …
53
53
  cms-edit read @root # same as @c0
54
54
  ```
@@ -73,7 +73,7 @@ cms-edit set @c0 visual <media-entry-id> --link
73
73
  Navigation entries are often linked from templates as **menu** or **footer**:
74
74
 
75
75
  ```bash
76
- cms-edit open <template-id> --id
76
+ cms-edit open --id <template-id>
77
77
  cms-edit set @root menu <nav-entry-id> --link
78
78
  cms-edit set @root footer <footer-nav-id> --link
79
79
  cms-edit save
@@ -19,7 +19,7 @@ If no brand context is available, ask the user about their brand voice and targe
19
19
  2. **For each page** (or a specific page):
20
20
  a. **Read page content** using `fetch_page_markdown` (from the site-workflows MCP server) to understand what the page covers
21
21
  b. **Check current SEO**:
22
- - `cms-edit open /<slug>`
22
+ - `cms-edit open --page-slug /<slug>` (or `--article-slug` for articles)
23
23
  - `cms-edit read @page seoDescription` (or `read @page` for all fields)
24
24
  c. **Analyse** the page — primary purpose, problem it solves, desired user action
25
25
  d. **Generate** a meta description following the guidelines below
@@ -11,7 +11,7 @@ Use this skill when creating or editing **templates** (layout shells with preCon
11
11
 
12
12
  1. **Create** a template: `cms-edit create template --label 'Campaign Landing'`
13
13
  2. **List** templates: `cms-edit list --type template`
14
- 3. **Open** by ID: `cms-edit open <template-id> --id`
14
+ 3. **Open** by cmsLabel or ID: `cms-edit open --template-label "Default"` or `cms-edit open --id <template-id>`
15
15
  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`.
16
16
  5. Set **colours**: `cms-edit set @ref backgroundColour Navy`, `cms-edit set @ref textColour White` (or project colour names).
17
17
  6. **Save**: `cms-edit save`