@se-studio/skills 1.0.4 → 1.0.6
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
package/package.json
CHANGED
|
@@ -75,6 +75,16 @@ Page: /pricing [4xKj2abc | published] · om1
|
|
|
75
75
|
|
|
76
76
|
Use `snapshot -c` for compact output (types only, no labels).
|
|
77
77
|
|
|
78
|
+
**Ref cheat sheet:**
|
|
79
|
+
| Ref | Resolves to |
|
|
80
|
+
|-----|-------------|
|
|
81
|
+
| `@root` | Root entry of the current session (works in any session type) |
|
|
82
|
+
| `@p0` | Root entry — alias for `@root` in **page** and **article** sessions only |
|
|
83
|
+
| `@c0` | Same as `@root` (first entry in depth-first traversal order) |
|
|
84
|
+
| `@c1`, `@c2`, … | Child entries in depth-first traversal order |
|
|
85
|
+
|
|
86
|
+
In **navigation sessions**, use `@root` or `@c0` for the nav root — `@p0` is not valid.
|
|
87
|
+
|
|
78
88
|
### Step 3: Read entry fields
|
|
79
89
|
|
|
80
90
|
```bash
|
|
@@ -108,10 +118,14 @@ Each token is `@ref:fieldName=value`. All values are scalar (string, boolean, nu
|
|
|
108
118
|
cms-edit set @c0 template 3I0HxGKbUd173wIpFCsbVr --link
|
|
109
119
|
```
|
|
110
120
|
|
|
111
|
-
**
|
|
121
|
+
**Entry link arrays** (`--links` works on any field that is an array of entry links — not just the standard page content fields):
|
|
112
122
|
```bash
|
|
123
|
+
# Standard page content arrays
|
|
113
124
|
cms-edit set @p0 content @c1,@c2,@c3 --links
|
|
114
125
|
cms-edit set @p0 bottomContent @c4 --links --append
|
|
126
|
+
|
|
127
|
+
# Navigation items array (use @root or @c0 in a nav session)
|
|
128
|
+
cms-edit set @root items <id1>,<id2>,<id3> --links
|
|
115
129
|
```
|
|
116
130
|
|
|
117
131
|
**Rich text fields** (body, additionalCopy):
|
|
@@ -344,9 +358,16 @@ cms-edit asset set @c0 visual 5xKj2abcDef
|
|
|
344
358
|
# Open a navigation entry
|
|
345
359
|
cms-edit nav open main-navigation
|
|
346
360
|
|
|
347
|
-
# Add
|
|
361
|
+
# Add a new item
|
|
348
362
|
cms-edit nav add --label "Pricing" --slug /pricing
|
|
349
363
|
cms-edit nav add --label "Docs" --href https://docs.example.com --after @c1
|
|
364
|
+
|
|
365
|
+
# Link an existing NavigationItem (share items across navigations)
|
|
366
|
+
cms-edit nav add --existing-id <navigationItem-entry-id>
|
|
367
|
+
|
|
368
|
+
# Clone a navigation (duplicates all items)
|
|
369
|
+
cms-edit nav clone <source-nav-id>
|
|
370
|
+
cms-edit nav clone <source-nav-id> --label "LP Nav" --slug lp-nav
|
|
350
371
|
```
|
|
351
372
|
|
|
352
373
|
## Create New Entries
|
|
@@ -436,7 +457,7 @@ cms-edit save
|
|
|
436
457
|
### Update an existing article
|
|
437
458
|
```bash
|
|
438
459
|
cms-edit open /blog/old-title --id # or by slug
|
|
439
|
-
cms-edit set @p0 title "New Article Title"
|
|
460
|
+
cms-edit set @p0 title "New Article Title" # @p0 works in article sessions too
|
|
440
461
|
cms-edit set @p0 slug new-article-slug
|
|
441
462
|
cms-edit set @p0 description "Updated description"
|
|
442
463
|
cms-edit save
|
|
@@ -11,12 +11,73 @@ Use this skill when creating or editing **navigation** entries and their items i
|
|
|
11
11
|
|
|
12
12
|
1. **Create** a navigation: `cms-edit create navigation --label 'Main menu'`
|
|
13
13
|
2. **Open** the nav: `cms-edit nav open <slug-or-id>` (or after create, use the printed open command)
|
|
14
|
-
3. **Add
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
3. **Add items** (new or existing):
|
|
15
|
+
```bash
|
|
16
|
+
# Create a new nav item with a page link
|
|
17
|
+
cms-edit nav add --label "Pricing" --slug /pricing
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
# Create a new nav item with an external URL
|
|
20
|
+
cms-edit nav add --label "Docs" --href https://docs.example.com --after @c1
|
|
21
|
+
|
|
22
|
+
# Link an EXISTING NavigationItem entry (e.g. to share items across navigations)
|
|
23
|
+
cms-edit nav add --existing-id <navigationItem-entry-id>
|
|
24
|
+
cms-edit nav add --existing-id <id> --after @c1
|
|
25
|
+
```
|
|
26
|
+
4. **Set** nav item fields (use snapshot refs): `cms-edit set @c1 title "New label"`, `cms-edit set @c1 internal <page-entry-id> --link`, `cms-edit set @c1 link "https://..."`.
|
|
27
|
+
5. **Set the items array directly** (e.g. to replace all items at once):
|
|
28
|
+
```bash
|
|
29
|
+
cms-edit set @root items <id1>,<id2>,<id3> --links
|
|
30
|
+
```
|
|
31
|
+
6. **Remove** an item: `cms-edit remove @cN`
|
|
32
|
+
7. **Save**: `cms-edit save`
|
|
33
|
+
|
|
34
|
+
## Cloning a navigation
|
|
35
|
+
|
|
36
|
+
To duplicate a navigation and all its items (e.g. for a landing page variant):
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
cms-edit nav clone <source-nav-id>
|
|
40
|
+
# Optional: provide a custom label/slug for the clone
|
|
41
|
+
cms-edit nav clone <source-nav-id> --label "LP Navigation" --slug lp-nav
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This creates new copies of every NavigationItem and links them into the new navigation. Prints the new navigation ID and an `open` command.
|
|
45
|
+
|
|
46
|
+
## Session refs
|
|
47
|
+
|
|
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
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cms-edit nav open main-navigation
|
|
52
|
+
cms-edit snapshot # root is @c0; items are @c1, @c2, …
|
|
53
|
+
cms-edit read @root # same as @c0
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Visual fields (media wrapper)
|
|
57
|
+
|
|
58
|
+
Visual fields expect a **`media` Entry link**, not a direct Asset ID. `cms-edit asset set` now auto-creates the wrapper:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
cms-edit asset set @c0 visual <asset-id>
|
|
62
|
+
# → auto-creates a media entry wrapping the asset, then sets visual to that entry
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
If you need to create the media wrapper manually:
|
|
66
|
+
```bash
|
|
67
|
+
cms-edit create media <asset-id> # prints the media entry ID
|
|
68
|
+
cms-edit set @c0 visual <media-entry-id> --link
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Linking navigation from a template
|
|
72
|
+
|
|
73
|
+
Navigation entries are often linked from templates as **menu** or **footer**:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
cms-edit open <template-id> --id
|
|
77
|
+
cms-edit set @root menu <nav-entry-id> --link
|
|
78
|
+
cms-edit set @root footer <footer-nav-id> --link
|
|
79
|
+
cms-edit save
|
|
80
|
+
```
|
|
20
81
|
|
|
21
82
|
## Related skills
|
|
22
83
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "contentful-cms:setup"
|
|
3
|
+
description: "Guide a user through installing and configuring the cms-edit MCP server for Claude Desktop."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: cms-edit Setup
|
|
7
|
+
|
|
8
|
+
Use this skill when the user wants to install or configure the `cms-edit` MCP server so Claude Desktop can read and edit Contentful content.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
The setup wizard handles everything automatically:
|
|
13
|
+
- Collects the Contentful Management Token
|
|
14
|
+
- Discovers spaces and environments via the Contentful API
|
|
15
|
+
- Writes `~/.contentful-cms.json`
|
|
16
|
+
- Updates the Claude Desktop config to register the `cms-edit` MCP server
|
|
17
|
+
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
The user needs:
|
|
21
|
+
1. **Node.js** installed (LTS version from [nodejs.org](https://nodejs.org))
|
|
22
|
+
2. **A Contentful Management Token** — see Step 1 below
|
|
23
|
+
|
|
24
|
+
## Step 1: Get a Management Token
|
|
25
|
+
|
|
26
|
+
Tell the user:
|
|
27
|
+
|
|
28
|
+
> To get your Contentful Management Token:
|
|
29
|
+
> 1. Log in to [contentful.com](https://app.contentful.com)
|
|
30
|
+
> 2. Go to **Settings → API keys**
|
|
31
|
+
> 3. Click the **Content management tokens** tab
|
|
32
|
+
> 4. Click **Generate personal token**, name it `Claude Desktop`, and click **Generate**
|
|
33
|
+
> 5. Copy the token — you won't see it again
|
|
34
|
+
|
|
35
|
+
Ask them to confirm they have the token before continuing.
|
|
36
|
+
|
|
37
|
+
## Step 2: Run the Setup Wizard
|
|
38
|
+
|
|
39
|
+
Tell the user to open a terminal and run:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx @se-studio/contentful-cms@latest setup
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Walk them through what each prompt means:
|
|
46
|
+
|
|
47
|
+
| Prompt | What to enter |
|
|
48
|
+
|--------|--------------|
|
|
49
|
+
| **Contentful Management Token** | The token they just copied (input will be hidden) |
|
|
50
|
+
| **Which Contentful space?** | Only appears if the token has multiple spaces — pick the one they want to connect |
|
|
51
|
+
| **Which environment?** | Auto-selects `master`; only asks if no `master` environment exists |
|
|
52
|
+
| **Short name for this project** | A slug like `my-project` or `om1` — used as the key in the config file |
|
|
53
|
+
| **Staging site URL** | Optional — their Vercel preview URL (e.g. `https://my-project.vercel.app`) |
|
|
54
|
+
| **Vercel bypass token** | Optional — only if their staging site has deployment protection |
|
|
55
|
+
|
|
56
|
+
## Step 3: Restart Claude Desktop
|
|
57
|
+
|
|
58
|
+
After the wizard completes, tell the user:
|
|
59
|
+
|
|
60
|
+
> Fully quit Claude Desktop and reopen it.
|
|
61
|
+
> - **Mac:** Right-click the Dock icon → **Quit** (closing the window isn't enough)
|
|
62
|
+
> - **Windows/Linux:** Close and reopen from the Start menu
|
|
63
|
+
|
|
64
|
+
## Step 4: Verify
|
|
65
|
+
|
|
66
|
+
Once they've reopened Claude Desktop, verify the setup worked by using the `cms_edit` tool:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
cms_edit ["open", "/"]
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If it returns a page structure, setup is complete. If it errors, see Troubleshooting below.
|
|
73
|
+
|
|
74
|
+
## Troubleshooting
|
|
75
|
+
|
|
76
|
+
**"Invalid management token"**
|
|
77
|
+
→ The token may have been copied incorrectly or already expired. Generate a new one in Contentful and run the wizard again.
|
|
78
|
+
|
|
79
|
+
**"No spaces found"**
|
|
80
|
+
→ The token doesn't have access to any spaces. Check Contentful's token permissions — it needs at least read access to one space.
|
|
81
|
+
|
|
82
|
+
**`cms_edit` tool not available after restart**
|
|
83
|
+
→ Check the Claude Desktop config was written correctly:
|
|
84
|
+
- Mac: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
85
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
86
|
+
- Linux: `~/.config/Claude/claude_desktop_config.json`
|
|
87
|
+
|
|
88
|
+
It should contain an `mcpServers.cms-edit` entry. If missing, run the wizard again.
|
|
89
|
+
|
|
90
|
+
**Adding another space**
|
|
91
|
+
→ Run `npx @se-studio/contentful-cms@latest setup` again — it merges the new space into the existing config.
|