@kvasar/openclaw-storyblok-plugin 0.2.6 → 0.2.8
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/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/storyblok/SKILL.md +47 -29
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "openclaw-storyblok",
|
|
3
3
|
"name": "Storyblok Integration",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.8",
|
|
5
5
|
"description": "Provides tools to interact with Storyblok CMS via Management API and Delivery API. Supports stories, components, and space management.",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": false
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@ description: Comprehensive skill for interacting with Storyblok CMS: query conte
|
|
|
4
4
|
license: Proprietary
|
|
5
5
|
metadata:
|
|
6
6
|
author: Jordi Marti
|
|
7
|
-
version: "2.
|
|
7
|
+
version: "2.6"
|
|
8
8
|
allowed-tools: storyblok_get_space, storyblok_get_story, storyblok_list_stories, storyblok_get_components, storyblok_get_component, storyblok_create_story, storyblok_update_story, storyblok_publish_story, storyblok_unpublish_story, storyblok_create_asset_folder, storyblok_delete_asset_folder, storyblok_get_asset_folder, storyblok_create_component, storyblok_get_content_folders, storyblok_update_component, storyblok_update_component_folder, sessions_spawn, read, write, edit
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -16,14 +16,15 @@ Non-obvious behaviors that cause silent mistakes:
|
|
|
16
16
|
|
|
17
17
|
- **`storyblok_get_story` requires a numeric ID only.** If you have a slug or UUID, first call `storyblok_list_stories` with `with_slug` or `by_uuids` to resolve the numeric ID.
|
|
18
18
|
- **`storyblok_list_stories` does not return `content`.** Use `storyblok_get_story` for full content, or add `with_summary=true` for a lightweight field-type summary.
|
|
19
|
-
- **`storyblok_update_story`
|
|
20
|
-
- **`
|
|
19
|
+
- **`storyblok_update_story` requires the full content object.** Always fetch first with `storyblok_get_story`, merge your changes, then send the complete object. Never send a partial object — it silently overwrites and loses existing fields, blocks, assets, and translations.
|
|
20
|
+
- **`storyblok_update_component` is for schema changes only.** Use it to add/modify field definitions in a component schema. Never use it to write actual translated content into a story.
|
|
21
|
+
- **Never create separate stories per language.** Always use field-level i18n keys inside the same story.
|
|
22
|
+
- **`publish=false` does NOT unpublish.** It saves as draft. To unpublish, use `storyblok_unpublish_story`.
|
|
21
23
|
- **`component_group_uuid` ≠ `component_group_id`.** When assigning a component to a folder, use the UUID field — not the numeric ID.
|
|
22
24
|
- **Schema updates don't touch existing stories.** After `storyblok_update_component`, stories already using that component keep their old field values.
|
|
23
25
|
- **`content` is a reserved component name.** Component `name` must be snake_case and must not be `content` alone.
|
|
24
26
|
- **`force_update=true` causes a content conflict** if another user has the story open. Use only when necessary.
|
|
25
|
-
- **
|
|
26
|
-
- **Never use `storyblok_update_story` to add language translations.** Use `storyblok_update_component` instead: fetch components with `storyblok_get_components`, iterate each relevant one with `storyblok_get_component`, add new `field_i18n_xx` keys, and call `storyblok_update_component`. Never remove existing translation keys unless the user explicitly asks.
|
|
27
|
+
- **Storyblok rich text fields are structured JSON objects, not strings.** Always preserve the complete Storyblok rich text schema (including `_uid`, `type`, `content`, and other properties). Never stringify rich text content before sending it to the Management API. This applies to both standard and translated rich text fields (`field_i18n_xx`).
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
@@ -37,11 +38,10 @@ Non-obvious behaviors that cause silent mistakes:
|
|
|
37
38
|
| Inspect available block types | `storyblok_get_components` |
|
|
38
39
|
| Full schema of one component | `storyblok_get_component` |
|
|
39
40
|
| Create story | `storyblok_create_story` |
|
|
40
|
-
| Update story structure
|
|
41
|
+
| Update story structure or translated content | `storyblok_update_story` (full object required) |
|
|
42
|
+
| Add/modify translatable field definitions in a component schema | `storyblok_update_component` |
|
|
41
43
|
| Publish | `storyblok_publish_story` or `publish=true` on create/update |
|
|
42
44
|
| Unpublish | `storyblok_unpublish_story` only |
|
|
43
|
-
| Create/update component | `storyblok_create_component` |
|
|
44
|
-
| Update the values of a component. |`storyblok_update_component` |
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
|
@@ -50,16 +50,16 @@ Non-obvious behaviors that cause silent mistakes:
|
|
|
50
50
|
### Content Management
|
|
51
51
|
|
|
52
52
|
1. If content type is unknown, run `storyblok_get_components` first.
|
|
53
|
-
2.
|
|
54
|
-
3.
|
|
55
|
-
4.
|
|
53
|
+
2. To update a story (structure or content): fetch with `storyblok_get_story`, merge changes into the full object, send with `storyblok_update_story`. Never send partial content.
|
|
54
|
+
3. To change a component schema (add a field definition, mark a field translatable): use `storyblok_update_component` — it patches only what you pass and does not affect existing story values.
|
|
55
|
+
4. Save as draft unless the user explicitly asks to publish.
|
|
56
56
|
5. To unpublish: `storyblok_unpublish_story` — never `update_story`.
|
|
57
57
|
|
|
58
58
|
### Component Management
|
|
59
59
|
|
|
60
60
|
1. Run `storyblok_get_components` to check if a component with the same name already exists.
|
|
61
61
|
2. Decide type (`is_root`, `is_nestable`) before creating — restructuring after stories use it can break content.
|
|
62
|
-
3.
|
|
62
|
+
3. Use `storyblok_update_component` for partial schema patches only (add a field, rename a label, mark translatable). It does not affect existing story values.
|
|
63
63
|
4. Mark user-facing text fields `"translatable": true`; leave technical fields non-translatable.
|
|
64
64
|
5. Do not create or delete components without user confirmation.
|
|
65
65
|
|
|
@@ -86,29 +86,47 @@ For AI-generated copy, spawn a sub-session via `sessions_spawn` with the same to
|
|
|
86
86
|
|
|
87
87
|
## Multilingual Stories
|
|
88
88
|
|
|
89
|
-
Always use field-level i18n inside the **same** story — never separate stories per language.
|
|
89
|
+
Always use field-level i18n keys inside the **same** story — never create separate stories per language.
|
|
90
90
|
|
|
91
91
|
- Default language: English (unless specified)
|
|
92
|
-
-
|
|
92
|
+
- i18n key format: `field__i18n__xx` (e.g. `headline__i18n__de`, `teaser__i18n__ca`)
|
|
93
93
|
- Use SEO-friendly English slugs
|
|
94
94
|
- Ensure `localized_paths` includes all enabled locales
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
### Two separate cases
|
|
97
97
|
|
|
98
|
-
**
|
|
98
|
+
**A) Translate existing story content** → `storyblok_get_story` + `storyblok_update_story`
|
|
99
99
|
|
|
100
|
-
|
|
101
|
-
2. For each relevant component, call `storyblok_get_component` to inspect its current schema and existing translation fields.
|
|
102
|
-
3. For each component, add the new `field_i18n_xx` keys to the schema — **do not remove existing translation keys** unless the user explicitly asks.
|
|
103
|
-
4. Call `storyblok_update_component` for each component with the merged schema.
|
|
100
|
+
**B) Add translatable field definitions to a component schema** → `storyblok_get_component` + `storyblok_update_component`
|
|
104
101
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"headline_i18n_es": "Por qué fracasan la mayoría de las estrategias",
|
|
109
|
-
"headline_i18n_ca": "Per què fracassen la majoria d'estratègies",
|
|
110
|
-
"headline_i18n_de": "Warum die meisten Strategien scheitern"
|
|
111
|
-
}
|
|
112
|
-
```
|
|
102
|
+
Never mix these up: `storyblok_update_component` writes schema definitions, not story content.
|
|
103
|
+
|
|
104
|
+
---
|
|
113
105
|
|
|
114
|
-
|
|
106
|
+
### A) Adding or updating a translation for an existing story
|
|
107
|
+
|
|
108
|
+
1. Call `storyblok_get_story` with the numeric story ID to get the full current content.
|
|
109
|
+
2. Inspect the content and identify the fields that need translation.
|
|
110
|
+
3. Add the new i18n keys inside the same content object. Examples:
|
|
111
|
+
- `headline__i18n__de`
|
|
112
|
+
- `teaser__i18n__de`
|
|
113
|
+
- `text__i18n__de`
|
|
114
|
+
- `paragraphs__i18n__de`
|
|
115
|
+
4. Preserve the full existing content object including `_uid`, `component`, nav references, nested blocks, assets, and all existing translations. **Do not remove any existing keys** unless the user explicitly asks.
|
|
116
|
+
5. For rich text fields: preserve the full Storyblok rich text JSON structure. Translate only the `text` node values. Never stringify rich text.
|
|
117
|
+
6. Call `storyblok_update_story` with the complete merged content object.
|
|
118
|
+
7. Save as draft unless the user explicitly asks to publish.
|
|
119
|
+
8. After updating, verify:
|
|
120
|
+
- New language fields exist
|
|
121
|
+
- Existing translations are still present
|
|
122
|
+
- Rich text is valid JSON (not a string)
|
|
123
|
+
- No separate story was created
|
|
124
|
+
|
|
125
|
+
### B) Adding translatable field definitions to a component schema
|
|
126
|
+
|
|
127
|
+
1. Call `storyblok_get_component` with the numeric component ID.
|
|
128
|
+
2. Inspect the current schema and identify fields that need to be marked translatable.
|
|
129
|
+
3. Add or update field definitions with `"translatable": true`. Do not remove existing fields unless the user asks.
|
|
130
|
+
4. Call `storyblok_update_component` with the patched schema.
|
|
131
|
+
|
|
132
|
+
After completing multilingual work, confirm: languages added, existing translations preserved, correct tool used (`update_story` for content, `update_component` for schema), no separate stories created.
|