@kvasar/openclaw-storyblok-plugin 0.1.1 → 0.1.3
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 +2 -2
- package/package.json +1 -1
- package/skills/README.md +54 -0
- package/skills/SKILL.md +218 -0
- package/skills/examples/management.md +33 -0
- package/skills/examples/page-generation.md +46 -0
- package/skills/examples/query.md +35 -0
- package/skills/examples/sync.md +30 -0
- package/skills/prompts/content-management.md +48 -0
- package/skills/prompts/content-query.md +36 -0
- package/skills/prompts/page-generation.md +61 -0
- package/skills/prompts/sync-workflow.md +68 -0
- package/skills/workflows/content-management.md +19 -0
- package/skills/workflows/content-query.md +12 -0
- package/skills/workflows/page-generation.md +14 -0
- package/skills/workflows/sync-workflow.md +18 -0
package/openclaw.plugin.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "openclaw-storyblok",
|
|
3
|
-
"kind": "tool",
|
|
4
3
|
"name": "Storyblok Integration",
|
|
5
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
6
5
|
"description": "Provides tools to interact with Storyblok CMS via Management API and Delivery API. Supports stories, components, and space management.",
|
|
6
|
+
"skills": ["skills"],
|
|
7
7
|
"configSchema": {
|
|
8
8
|
"type": "object",
|
|
9
9
|
"additionalProperties": false,
|
package/package.json
CHANGED
package/skills/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Storyblok Skill Package
|
|
2
|
+
|
|
3
|
+
This package provides a comprehensive set of skills for working with Storyblok CMS from OpenClaw agents.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
1. Ensure the `openclaw-storyblok` plugin is installed and configured.
|
|
8
|
+
2. In a session, activate this skill: `skill storyblok`
|
|
9
|
+
3. Use the appropriate prompt for your workflow:
|
|
10
|
+
- Content Query: `use prompt content-query`
|
|
11
|
+
- Content Management: `use prompt content-management`
|
|
12
|
+
- Page Generation: `use prompt page-generation`
|
|
13
|
+
- Sync Workflow: `use prompt sync-workflow`
|
|
14
|
+
|
|
15
|
+
Or invoke the skill directly and follow the guidance in `SKILL.md`.
|
|
16
|
+
|
|
17
|
+
## Contents
|
|
18
|
+
|
|
19
|
+
- `SKILL.md` – Full skill definition, tool reference, and workflow guides.
|
|
20
|
+
- `prompts/` – Prompt templates for each workflow.
|
|
21
|
+
- `workflows/` – Step-by-step workflow descriptions.
|
|
22
|
+
- `examples/` – Concrete usage examples.
|
|
23
|
+
|
|
24
|
+
## Tools Provided by the Plugin
|
|
25
|
+
|
|
26
|
+
- `storyblok_get_space`
|
|
27
|
+
- `storyblok_get_story`
|
|
28
|
+
- `storyblok_list_stories`
|
|
29
|
+
- `storyblok_get_components`
|
|
30
|
+
- `storyblok_create_story`
|
|
31
|
+
- `storyblok_update_story`
|
|
32
|
+
- `storyblok_publish_story`
|
|
33
|
+
- `storyblok_unpublish_story`
|
|
34
|
+
|
|
35
|
+
## Additional Tools (used by skill)
|
|
36
|
+
|
|
37
|
+
- `sessions_spawn`
|
|
38
|
+
- `read`, `write`, `edit`
|
|
39
|
+
- `git_status`, `git_add`, `git_commit`, `git_push`
|
|
40
|
+
|
|
41
|
+
## Example Session
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
> skill storyblok
|
|
45
|
+
Using skill: storyblok
|
|
46
|
+
|
|
47
|
+
> what stories are in folder 123?
|
|
48
|
+
Use storyblok_list_stories with folder_id=123
|
|
49
|
+
storyblok_list_stories folder_id=123
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## License
|
|
53
|
+
|
|
54
|
+
Part of the OpenClaw plugin ecosystem.
|
package/skills/SKILL.md
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: storyblok
|
|
3
|
+
description: Comprehensive skill for interacting with Storyblok CMS: query content, manage stories, generate pages, and sync with frontend repositories.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- storyblok_get_space
|
|
6
|
+
- storyblok_get_story
|
|
7
|
+
- storyblok_list_stories
|
|
8
|
+
- storyblok_get_components
|
|
9
|
+
- storyblok_create_story
|
|
10
|
+
- storyblok_update_story
|
|
11
|
+
- storyblok_publish_story
|
|
12
|
+
- storyblok_unpublish_story
|
|
13
|
+
- sessions_spawn
|
|
14
|
+
- read
|
|
15
|
+
- write
|
|
16
|
+
- edit
|
|
17
|
+
- git_status
|
|
18
|
+
- git_add
|
|
19
|
+
- git_commit
|
|
20
|
+
- git_push
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Storyblok Integration Skill
|
|
24
|
+
|
|
25
|
+
This skill package provides agents with the ability to work with **Storyblok CMS** using the `openclaw-storyblok` plugin. It covers four main workflows:
|
|
26
|
+
|
|
27
|
+
1. **Content Query** – Retrieve spaces, stories, components, and listings.
|
|
28
|
+
2. **Content Management** – Create, update, publish, and unpublish stories.
|
|
29
|
+
3. **Page Generation** – Use AI-assisted reasoning to create new landing pages.
|
|
30
|
+
4. **Sync Workflow** – Synchronize content or schemas between Storyblok and a frontend repository.
|
|
31
|
+
|
|
32
|
+
## Prerequisites
|
|
33
|
+
|
|
34
|
+
The Storyblok plugin must be configured with valid credentials:
|
|
35
|
+
|
|
36
|
+
- `baseUrl` (default: https://api.storyblok.com)
|
|
37
|
+
- `spaceId`
|
|
38
|
+
- `managementToken` (required for write operations)
|
|
39
|
+
- `previewToken` (optional for read-only operations)
|
|
40
|
+
|
|
41
|
+
These are set when installing the plugin. Inside a session, the plugin config will be used automatically.
|
|
42
|
+
|
|
43
|
+
## Core Concepts
|
|
44
|
+
|
|
45
|
+
### Tools
|
|
46
|
+
|
|
47
|
+
All tools are provided by the `openclaw-storyblok` plugin:
|
|
48
|
+
|
|
49
|
+
| Tool | Purpose |
|
|
50
|
+
|------|---------|
|
|
51
|
+
| `storyblok_get_space` | Get space details |
|
|
52
|
+
| `storyblok_get_story` | Fetch a story by ID/UUID/slug |
|
|
53
|
+
| `storyblok_list_stories` | List stories with optional filters |
|
|
54
|
+
| `storyblok_get_components` | Retrieve component schemas (blok types) |
|
|
55
|
+
| `storyblok_create_story` | Create a new story or folder |
|
|
56
|
+
| `storyblok_update_story` | Update an existing story |
|
|
57
|
+
| `storyblok_publish_story` | Publish a draft story |
|
|
58
|
+
| `storyblok_unpublish_story` | Unpublish a published story |
|
|
59
|
+
|
|
60
|
+
### Parameter Notes
|
|
61
|
+
|
|
62
|
+
- Most tools accept optional parameters; only required fields are mandatory.
|
|
63
|
+
- For `storyblok_get_story`, you can specify `version` (draft/published) and `language`.
|
|
64
|
+
- For `storyblok_list_stories`, you can filter by `folder_id`, `parent_id`, `status`, `tag`, `per_page`, `page`, `sort_by`, `direction`.
|
|
65
|
+
- For management tools, `story_id` can be numeric ID or UUID.
|
|
66
|
+
|
|
67
|
+
### Error Handling
|
|
68
|
+
|
|
69
|
+
All tools return a standardized response:
|
|
70
|
+
- Success: `{ content: [{type: "text", text: JSON}], metadata: {...} }`
|
|
71
|
+
- Error: `{ content: [{type: "text", text: "❌ Storyblok: ..."}], isError: true }`
|
|
72
|
+
|
|
73
|
+
Agents should check `isError` and display the error message to the user.
|
|
74
|
+
|
|
75
|
+
## Workflow Guides
|
|
76
|
+
|
|
77
|
+
### 1. Content Query
|
|
78
|
+
|
|
79
|
+
Use the query tools to explore and retrieve data.
|
|
80
|
+
|
|
81
|
+
**When to use what:**
|
|
82
|
+
|
|
83
|
+
- Need space info? → `storyblok_get_space`
|
|
84
|
+
- Need a specific story? → `storyblok_get_story` (provide `identifier`)
|
|
85
|
+
- Need a list of stories with filters? → `storyblok_list_stories` (set filters)
|
|
86
|
+
- Need to know available content block types? → `storyblok_get_components`
|
|
87
|
+
|
|
88
|
+
**Example: List all published stories in the last week**
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
storyblok_list_stories status="published" per_page=100
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Example: Get a story by slug**
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
storyblok_get_story identifier="my-landing-page" version="published"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### 2. Content Management
|
|
101
|
+
|
|
102
|
+
Use the management tools to create, modify, and publish content.
|
|
103
|
+
|
|
104
|
+
**Workflow:**
|
|
105
|
+
|
|
106
|
+
- To create a new story: `storyblok_create_story` with `title` and optional `content`, `folder_id`, etc.
|
|
107
|
+
- The content is a JSON object matching your component structure.
|
|
108
|
+
- You can use `storyblok_get_components` first to see available block types.
|
|
109
|
+
- To edit a story: `storyblok_update_story` with `story_id` and fields to update.
|
|
110
|
+
- Specify `version="draft"` (default) or `"published"` to update a published version (use with caution).
|
|
111
|
+
- To publish: `storyblok_publish_story` with `story_id`.
|
|
112
|
+
- To unpublish: `storyblok_unpublish_story` with `story_id`.
|
|
113
|
+
|
|
114
|
+
**Example: Create a draft story**
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
storyblok_create_story title="New Homepage" content={"title":"Welcome","body":"<p>Hello</p>"}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Example: Publish a story**
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
storyblok_publish_story story_id="12345" publish_notes="Initial release"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 3. Page Generation
|
|
127
|
+
|
|
128
|
+
This workflow combines AI reasoning with Storyblok tools to produce complete pages.
|
|
129
|
+
|
|
130
|
+
**Steps:**
|
|
131
|
+
|
|
132
|
+
1. Clarify the page goal with the user (topic, tone, key messages).
|
|
133
|
+
2. Fetch component schemas via `storyblok_get_components` to understand available block types.
|
|
134
|
+
3. Use reasoning to design a JSON content structure that uses those components.
|
|
135
|
+
4. Create the story with `storyblok_create_story`.
|
|
136
|
+
5. Optionally publish immediately with `storyblok_publish_story`.
|
|
137
|
+
|
|
138
|
+
The agent may also spawn a sub-session (using `sessions_spawn`) to generate the content with an AI model if needed.
|
|
139
|
+
|
|
140
|
+
### 4. Sync Workflow
|
|
141
|
+
|
|
142
|
+
Synchronize Storyblok content with a frontend repository. This workflow uses file operations and git.
|
|
143
|
+
|
|
144
|
+
**Schema Sync:**
|
|
145
|
+
|
|
146
|
+
- Fetch component schemas from Storyblok (`storyblok_get_components`).
|
|
147
|
+
- Compare with local component definitions (e.g., in a frontend project's component library).
|
|
148
|
+
- If schemas are out of date, update local files to match (or notify user).
|
|
149
|
+
- Commit and push changes (`git_add`, `git_commit`, `git_push`).
|
|
150
|
+
|
|
151
|
+
**Content Sync:**
|
|
152
|
+
|
|
153
|
+
- Iterate through stories (`storyblok_list_stories`, `storyblok_get_story`).
|
|
154
|
+
- Export each story to a file (e.g., JSON or Markdown) in the repository.
|
|
155
|
+
- Commit changes.
|
|
156
|
+
|
|
157
|
+
**Considerations:**
|
|
158
|
+
|
|
159
|
+
- Always operate within the designated repository directory (use `workdir` context).
|
|
160
|
+
- Use `git_status` to see changes before committing.
|
|
161
|
+
- Write clear commit messages.
|
|
162
|
+
- Do not push without user approval (for safety, the skill could be configured to require explicit confirmation).
|
|
163
|
+
|
|
164
|
+
## Session Awareness
|
|
165
|
+
|
|
166
|
+
This skill is designed to work in both main and sub-agent sessions. It can be used directly or spawned via `sessions_spawn` for parallel or isolated execution. When spawning, pass the same tool permissions to ensure access to Storyblok tools.
|
|
167
|
+
|
|
168
|
+
## README Usage Examples
|
|
169
|
+
|
|
170
|
+
### Quick Query
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
User: What stories are in folder 123?
|
|
174
|
+
Agent: storyblok_list_stories folder_id=123
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Create and Publish
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
User: Create a blog post titled "Latest Updates" with body "We've improved performance."
|
|
181
|
+
Agent: storyblok_create_story title="Latest Updates" content={"post_content":"We've improved performance."}
|
|
182
|
+
Agent: storyblok_publish_story story_id="<new_id>"
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Generate a Landing Page
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
User: Generate a landing page for our summer sale.
|
|
189
|
+
Agent: (fetches components, designs structure, creates story)
|
|
190
|
+
storyblok_get_components
|
|
191
|
+
storyblok_create_story title="Summer Sale 2026" content={...}
|
|
192
|
+
storyblok_publish_story story_id="..."
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Sync Schemas
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
User: Sync Storyblok component schemas with our UI library.
|
|
199
|
+
Agent: git_status
|
|
200
|
+
Agent: storyblok_get_components > components.json
|
|
201
|
+
Agent: (compare, update local files)
|
|
202
|
+
Agent: git_add src/components/storyblok/
|
|
203
|
+
Agent: git_commit -m "chore: update Storyblok component schemas"
|
|
204
|
+
Agent: git_push
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
## Notes
|
|
208
|
+
|
|
209
|
+
- Always handle errors gracefully and report to the user.
|
|
210
|
+
- Avoid publishing without explicit user consent.
|
|
211
|
+
- For large exports, use pagination (`per_page`, `page`) to stay within response limits.
|
|
212
|
+
- Respect rate limits: Storyblok API may have limits; consider adding delays if many requests.
|
|
213
|
+
|
|
214
|
+
## Troubleshooting
|
|
215
|
+
|
|
216
|
+
- **Authentication errors**: Check plugin configuration (tokens, space ID).
|
|
217
|
+
- **Tool not found**: Ensure the `openclaw-storyblok` plugin is installed and loaded in the OpenClaw environment.
|
|
218
|
+
- **Permission errors**: The management token must have write permissions; preview token only for reads.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Content Management Examples
|
|
2
|
+
|
|
3
|
+
## Example 1: Create a simple story
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
User: Create a new story titled "Q2 Results" with a single paragraph.
|
|
7
|
+
Agent:
|
|
8
|
+
storyblok_create_story title="Q2 Results" content={"body":"<p>Our quarterly results are strong...</p>"}
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Example 2: Update a story's title
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
User: Change the title of story 555 to "2026 Annual Report"
|
|
15
|
+
Agent:
|
|
16
|
+
storyblok_update_story story_id=555 title="2026 Annual Report"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Example 3: Publish a draft
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
User: Publish story 777 with release notes "Final version"
|
|
23
|
+
Agent:
|
|
24
|
+
storyblok_publish_story story_id=777 publish_notes="Final version"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Example 4: Unpublish a page
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
User: Remove the 'maintenance' page from the live site.
|
|
31
|
+
Agent:
|
|
32
|
+
storyblok_unpublish_story story_id=999
|
|
33
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Page Generation Example
|
|
2
|
+
|
|
3
|
+
## Example: Generate a product landing page
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
User: Generate a landing page for our new product "SuperWidget".
|
|
7
|
+
Agent:
|
|
8
|
+
1. storyblok_get_components
|
|
9
|
+
→ Available: hero, feature_grid, testimonial, cta
|
|
10
|
+
2. Designs content JSON:
|
|
11
|
+
{
|
|
12
|
+
"title": "SuperWidget",
|
|
13
|
+
"slug": "superwidget",
|
|
14
|
+
"content": [
|
|
15
|
+
{
|
|
16
|
+
"component": "hero",
|
|
17
|
+
"title": "Introducing SuperWidget",
|
|
18
|
+
"subtitle": "The future of widgets.",
|
|
19
|
+
"image": "https://..."
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"component": "feature_grid",
|
|
23
|
+
"features": [
|
|
24
|
+
{"title": "Fast", "text": "Blazing speed"},
|
|
25
|
+
{"title": "Secure", "text": "Enterprise-grade security"}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"component": "testimonial",
|
|
30
|
+
"quote": "Amazing product!",
|
|
31
|
+
"author": "Happy Customer"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"component": "cta",
|
|
35
|
+
"text": "Buy now",
|
|
36
|
+
"url": "/buy"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
3. storyblok_create_story title="SuperWidget Launch" content={...}
|
|
41
|
+
4. (story ID 202 returned)
|
|
42
|
+
5. User: Publish it.
|
|
43
|
+
Agent: storyblok_publish_story story_id=202
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Result: Live landing page at `https://<space>.storyblok.com/superwidget`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Content Query Example
|
|
2
|
+
|
|
3
|
+
## Example 1: Get space information
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
User: What is the name of my Storyblok space?
|
|
7
|
+
Agent:
|
|
8
|
+
storyblok_get_space
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Output:** Space details including name, ID, and region.
|
|
12
|
+
|
|
13
|
+
## Example 2: Find a story by its slug
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
User: Show me the content of the 'about-us' page.
|
|
17
|
+
Agent:
|
|
18
|
+
storyblok_get_story identifier="about-us" version="published"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Example 3: List stories in a specific folder
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
User: List all draft stories in folder 123.
|
|
25
|
+
Agent:
|
|
26
|
+
storyblok_list_stories folder_id=123 status=draft
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Example 4: List available component types
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
User: What blocks can I use in my stories?
|
|
33
|
+
Agent:
|
|
34
|
+
storyblok_get_components
|
|
35
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Sync Workflow Example
|
|
2
|
+
|
|
3
|
+
## Schema Sync Example
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
User: Ensure our UI library's StoryblokFeature component matches the Storyblok schema.
|
|
7
|
+
Agent:
|
|
8
|
+
1. storyblok_get_components > components.json
|
|
9
|
+
2. read src/components/StoryblokFeature.tsx
|
|
10
|
+
3. Compare: Storyblok now has a new optional field `accentColor`.
|
|
11
|
+
4. edit src/components/StoryblokFeature.tsx to accept `accentColor?: string`.
|
|
12
|
+
5. git_add src/components/StoryblokFeature.tsx
|
|
13
|
+
6. git_commit -m "feat(ui): add accentColor to StoryblokFeature per latest schema"
|
|
14
|
+
7. git_push
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Content Export Example
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
User: Export all published stories tagged 'blog' to our repo.
|
|
21
|
+
Agent:
|
|
22
|
+
1. storyblok_list_stories tag=blog status=published per_page=100
|
|
23
|
+
2. For each story:
|
|
24
|
+
- storyblok_get_story identifier=... version=published
|
|
25
|
+
- write content/blog/{slug}.json (the full story JSON)
|
|
26
|
+
3. git_status
|
|
27
|
+
4. git_add content/blog/
|
|
28
|
+
5. git_commit -m "content: sync blog stories from Storyblok"
|
|
29
|
+
6. git_push
|
|
30
|
+
```
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Content Management Prompt
|
|
2
|
+
|
|
3
|
+
You are a Storyblok content manager. You handle the lifecycle of stories: creation, updates, publication, and removal from publication.
|
|
4
|
+
|
|
5
|
+
## Available Tools
|
|
6
|
+
|
|
7
|
+
- `storyblok_create_story`
|
|
8
|
+
- `storyblok_update_story`
|
|
9
|
+
- `storyblok_publish_story`
|
|
10
|
+
- `storyblok_unpublish_story`
|
|
11
|
+
|
|
12
|
+
## Guidelines
|
|
13
|
+
|
|
14
|
+
1. **Creation**
|
|
15
|
+
- Use `storyblok_create_story` with at least `title`.
|
|
16
|
+
- The `content` parameter is a JSON object representing the story's body using component blocks. If the user provides plain text, help them structure it into components, or ask for clarification.
|
|
17
|
+
- Optional: `slug`, `folder_id`, `parent_id`, `tags`, `is_folder`, `language`.
|
|
18
|
+
- After creation, you can optionally publish immediately or later.
|
|
19
|
+
|
|
20
|
+
2. **Updates**
|
|
21
|
+
- Use `storyblok_update_story` with `story_id` and fields to update.
|
|
22
|
+
- Be cautious when updating `published` versions; default targets `draft`.
|
|
23
|
+
- You can update `title`, `slug`, `content`, `parent_id`, `tags`, `language`.
|
|
24
|
+
|
|
25
|
+
3. **Publishing**
|
|
26
|
+
- Use `storyblok_publish_story` with `story_id`.
|
|
27
|
+
- Optional `publish_notes` to document changes.
|
|
28
|
+
- Consider whether the story is ready; avoid accidental publishes.
|
|
29
|
+
|
|
30
|
+
4. **Unpublishing**
|
|
31
|
+
- Use `storyblok_unpublish_story` with `story_id`.
|
|
32
|
+
- This makes the story inaccessible on the frontend.
|
|
33
|
+
|
|
34
|
+
5. **Confirmation**
|
|
35
|
+
- For destructive actions (publish, unpublish, update of published story), confirm with the user unless explicitly instructed.
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
### User: "Create a new story titled 'Product Launch'"
|
|
40
|
+
Agent: `storyblok_create_story title="Product Launch"`
|
|
41
|
+
|
|
42
|
+
### User: "Update story 789 with a new body and publish it"
|
|
43
|
+
Agent:
|
|
44
|
+
1. `storyblok_update_story story_id=789 content={...}`
|
|
45
|
+
2. `storyblok_publish_story story_id=789`
|
|
46
|
+
|
|
47
|
+
### User: "Unpublish the 'maintenance' page"
|
|
48
|
+
Agent: `storyblok_unpublish_story story_id=123` (after confirmation)
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Content Query Prompt
|
|
2
|
+
|
|
3
|
+
You are a Storyblok content query specialist. Your goal is to retrieve information from Storyblok based on the user's request.
|
|
4
|
+
|
|
5
|
+
## Available Tools
|
|
6
|
+
|
|
7
|
+
- `storyblok_get_space`
|
|
8
|
+
- `storyblok_get_story`
|
|
9
|
+
- `storyblok_list_stories`
|
|
10
|
+
- `storyblok_get_components`
|
|
11
|
+
|
|
12
|
+
## Guidelines
|
|
13
|
+
|
|
14
|
+
1. Determine what information is needed:
|
|
15
|
+
- Space details? → `storyblok_get_space`
|
|
16
|
+
- A specific story? → `storyblok_get_story` with `identifier`
|
|
17
|
+
- A list of stories with filters? → `storyblok_list_stories`
|
|
18
|
+
- Component schemas? → `storyblok_get_components`
|
|
19
|
+
2. Use the appropriate tool with provided parameters.
|
|
20
|
+
3. If parameters are missing, ask the user for them.
|
|
21
|
+
4. Present results clearly, summarizing key information.
|
|
22
|
+
5. Handle pagination for list tools if many results: use `per_page` and `page` to retrieve all if needed.
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
### User: "What is my space ID and name?"
|
|
27
|
+
Agent: `storyblok_get_space` → returns space details.
|
|
28
|
+
|
|
29
|
+
### User: "Get the story with slug 'about-us'"
|
|
30
|
+
Agent: `storyblok_get_story identifier="about-us"`
|
|
31
|
+
|
|
32
|
+
### User: "List all published stories in folder 45, most recent first"
|
|
33
|
+
Agent: `storyblok_list_stories folder_id=45 status=published sort_by=published_at direction=desc`
|
|
34
|
+
|
|
35
|
+
### User: "What component types are available?"
|
|
36
|
+
Agent: `storyblok_get_components`
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Page Generation Prompt
|
|
2
|
+
|
|
3
|
+
You are a Storyblok page generation assistant. You create new landing pages or content pages in Storyblok, leveraging your reasoning to design content structures that match available component schemas.
|
|
4
|
+
|
|
5
|
+
## Available Tools
|
|
6
|
+
|
|
7
|
+
- `storyblok_get_components`
|
|
8
|
+
- `storyblok_create_story`
|
|
9
|
+
- `storyblok_publish_story` (optional)
|
|
10
|
+
- (Optionally) `storyblok_list_stories` to check for duplicates
|
|
11
|
+
|
|
12
|
+
You may also use `sessions_spawn` to delegate content creation to an AI sub-session if needed.
|
|
13
|
+
|
|
14
|
+
## Workflow
|
|
15
|
+
|
|
16
|
+
1. **Clarify Requirements**
|
|
17
|
+
- Ask for the page title, purpose, target audience, and any specific content sections.
|
|
18
|
+
- Determine if it should be a draft or published immediately.
|
|
19
|
+
|
|
20
|
+
2. **Inspect Available Components**
|
|
21
|
+
- Call `storyblok_get_components` to retrieve the list of block types (components) defined in the space.
|
|
22
|
+
- Note the component names and their expected schema.
|
|
23
|
+
|
|
24
|
+
3. **Design Content Structure**
|
|
25
|
+
- Based on the components, design a JSON object that represents the page.
|
|
26
|
+
- Typically, the root might be a `page` component with nested `blocks` array, or use specific block types.
|
|
27
|
+
- Use reasoning to allocate appropriate blocks for hero, body, features, testimonials, etc.
|
|
28
|
+
- If unsure, ask the user for clarification or propose a structure for approval.
|
|
29
|
+
|
|
30
|
+
4. **Create Story**
|
|
31
|
+
- Execute `storyblok_create_story` with:
|
|
32
|
+
- `title`: page title
|
|
33
|
+
- `content`: the designed JSON structure
|
|
34
|
+
- optional `slug`, `tags`, `folder_id`
|
|
35
|
+
- Capture the returned story ID.
|
|
36
|
+
|
|
37
|
+
5. **Publish (Optional)**
|
|
38
|
+
- If the user wants the page live, call `storyblok_publish_story` with the story ID.
|
|
39
|
+
- Add a `publish_notes` if desired.
|
|
40
|
+
|
|
41
|
+
6. **Report**
|
|
42
|
+
- Provide a summary: story ID, URL (if constructible), and current status.
|
|
43
|
+
|
|
44
|
+
## Example Interaction
|
|
45
|
+
|
|
46
|
+
User: Generate a landing page for our summer campaign.
|
|
47
|
+
Agent:
|
|
48
|
+
- "Sure! What's the headline and key sections? (hero, features, call-to-action)"
|
|
49
|
+
- `storyblok_get_components`
|
|
50
|
+
- "Based on your components (hero, feature_grid, testimonial, cta), I'll structure a page."
|
|
51
|
+
- (creates JSON)
|
|
52
|
+
- `storyblok_create_story title="Summer Campaign 2026" content={...}`
|
|
53
|
+
- "Story created with ID 456. Publish now?"
|
|
54
|
+
User: Yes.
|
|
55
|
+
Agent: `storyblok_publish_story story_id=456`
|
|
56
|
+
- "Published! The page is live at https://your-space.storyblok.com/summer-campaign-2026."
|
|
57
|
+
|
|
58
|
+
## Notes
|
|
59
|
+
|
|
60
|
+
- The content JSON must match the component schemas exactly; refer to `storyblok_get_components` for field definitions.
|
|
61
|
+
- If the AI sub-session is used (`sessions_spawn`), ensure it returns a valid content JSON.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Sync Workflow Prompt
|
|
2
|
+
|
|
3
|
+
You are a Storyblok synchronization assistant. You keep content and schemas aligned between Storyblok CMS and a frontend repository.
|
|
4
|
+
|
|
5
|
+
## Available Tools
|
|
6
|
+
|
|
7
|
+
- `storyblok_get_components`
|
|
8
|
+
- `storyblok_list_stories`
|
|
9
|
+
- `storyblok_get_story`
|
|
10
|
+
- `read`, `write`, `edit` (file operations)
|
|
11
|
+
- `git_status`, `git_add`, `git_commit`, `git_push` (version control)
|
|
12
|
+
|
|
13
|
+
## Sync Types
|
|
14
|
+
|
|
15
|
+
### Schema Sync
|
|
16
|
+
|
|
17
|
+
Ensure local component definitions (e.g., in a frontend UI library) match Storyblok component schemas.
|
|
18
|
+
|
|
19
|
+
**Steps:**
|
|
20
|
+
1. Fetch current schemas: `storyblok_get_components`.
|
|
21
|
+
2. Locate local component definition files (e.g., `src/components/storyblok/*.ts` or `.json`).
|
|
22
|
+
3. Compare fields and update local files to reflect any changes in Storyblok.
|
|
23
|
+
4. Commit and push changes.
|
|
24
|
+
|
|
25
|
+
### Content Sync (Export)
|
|
26
|
+
|
|
27
|
+
Export stories from Storyblok to the repository as static files (e.g., for static site generation).
|
|
28
|
+
|
|
29
|
+
**Steps:**
|
|
30
|
+
1. List stories: `storyblok_list_stories` (maybe by tag or folder).
|
|
31
|
+
2. For each story, `storyblok_get_story` with `version="published"` to get live content.
|
|
32
|
+
3. Write the story JSON to a file in the repo (e.g., `content/stories/{slug}.json`).
|
|
33
|
+
4. Commit and push.
|
|
34
|
+
|
|
35
|
+
## Detailed Procedure
|
|
36
|
+
|
|
37
|
+
1. **Identify the repository directory** – Ensure all file operations occur within the correct project path.
|
|
38
|
+
2. **Fetch Storyblok data** – Use appropriate tools to obtain schemas or content.
|
|
39
|
+
3. **Read local files** – Use `read` to inspect existing component definitions or content files.
|
|
40
|
+
4. **Determine differences** – Compare structures. For schemas, check if fields added/removed. For content, detect changed stories (use `updated_at` if available).
|
|
41
|
+
5. **Apply changes**:
|
|
42
|
+
- For schemas: modify local files using `edit` or `write`.
|
|
43
|
+
- For content: write new files or update existing ones.
|
|
44
|
+
6. **Git operations**:
|
|
45
|
+
- `git_status` to review changes.
|
|
46
|
+
- `git_add` to stage relevant files.
|
|
47
|
+
- `git_commit` with a clear message like "chore: sync Storyblok schemas" or "content: update story X".
|
|
48
|
+
- `git_push` to publish (optionally ask for confirmation before pushing).
|
|
49
|
+
7. **Report** – Summarize what was synchronized and any conflicts or errors.
|
|
50
|
+
|
|
51
|
+
## Safety
|
|
52
|
+
|
|
53
|
+
- Ask for confirmation before pushing changes to remote.
|
|
54
|
+
- Avoid overwriting local customizations unless the user explicitly wants to force sync.
|
|
55
|
+
- Back up local files by committing before making large changes (e.g., `git commit -a -m "pre-sync backup"`).
|
|
56
|
+
|
|
57
|
+
## Example
|
|
58
|
+
|
|
59
|
+
User: Sync Storyblok component schemas with our UI library.
|
|
60
|
+
Agent:
|
|
61
|
+
- `storyblok_get_components`
|
|
62
|
+
- `read src/components/storyblok/FeatureBlock.ts`
|
|
63
|
+
- (detects missing new optional field `highlight_color`)
|
|
64
|
+
- `edit src/components/storyblok/FeatureBlock.ts` to add field definition.
|
|
65
|
+
- `git_add src/components/storyblok/FeatureBlock.ts`
|
|
66
|
+
- `git_commit -m "feat(ui): update FeatureBlock per new Storyblok schema"`
|
|
67
|
+
- `git_push`
|
|
68
|
+
- "Sync complete."
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Content Management Workflow
|
|
2
|
+
|
|
3
|
+
1. Determine action: create, update, publish, unpublish.
|
|
4
|
+
2. For creation:
|
|
5
|
+
a. Gather `title`, optional `content` (as JSON), `slug`, `folder_id`, etc.
|
|
6
|
+
b. Optionally fetch component schemas first to guide content structure.
|
|
7
|
+
c. `storyblok_create_story`
|
|
8
|
+
d. Store the returned story ID.
|
|
9
|
+
3. For update:
|
|
10
|
+
a. Identify `story_id` and fields to change.
|
|
11
|
+
b. Use `storyblok_update_story` (draft by default; specify `version="published"` for published).
|
|
12
|
+
c. Confirm with user if updating a published version.
|
|
13
|
+
4. For publish:
|
|
14
|
+
a. Confirm intent.
|
|
15
|
+
b. `storyblok_publish_story` with `story_id` and optional `publish_notes`.
|
|
16
|
+
5. For unpublish:
|
|
17
|
+
a. Confirm intent.
|
|
18
|
+
b. `storyblok_unpublish_story` with `story_id`.
|
|
19
|
+
6. Report outcome and IDs.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Content Query Workflow
|
|
2
|
+
|
|
3
|
+
1. Identify the target: space info, specific story, list of stories, or component schemas.
|
|
4
|
+
2. Choose tool:
|
|
5
|
+
- Space → `storyblok_get_space`
|
|
6
|
+
- Specific story → `storyblok_get_story` (need identifier)
|
|
7
|
+
- List → `storyblok_list_stories` (set filters as needed)
|
|
8
|
+
- Components → `storyblok_get_components`
|
|
9
|
+
3. Execute the tool with appropriate parameters.
|
|
10
|
+
4. If result set is large (list), handle pagination: increase `page` until all retrieved.
|
|
11
|
+
5. Format and present results to the user.
|
|
12
|
+
6. On error, display the error message and suggest checks (config, permissions).
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Page Generation Workflow
|
|
2
|
+
|
|
3
|
+
1. Clarify page topic, title, and key sections with the user.
|
|
4
|
+
2. `storyblok_get_components` to learn available block types.
|
|
5
|
+
3. Using reasoning (or a spawned AI session), design a content JSON that composes these blocks.
|
|
6
|
+
- Propose a slug (or let Storyblok autogenerate).
|
|
7
|
+
- Consider SEO-friendly title and slug.
|
|
8
|
+
4. `storyblok_create_story` with title and content.
|
|
9
|
+
5. Ask user whether to publish immediately.
|
|
10
|
+
- If yes: `storyblok_publish_story`.
|
|
11
|
+
- If no: leave as draft.
|
|
12
|
+
6. Provide the story URL (constructed from space and slug) and status.
|
|
13
|
+
|
|
14
|
+
Advanced: For multi-language, specify `language` in both creation and publish steps.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Sync Workflow
|
|
2
|
+
|
|
3
|
+
1. Determine sync direction: schemas (from Storyblok to local) or content (export stories to files).
|
|
4
|
+
2. **Schema Sync**:
|
|
5
|
+
a. `storyblok_get_components` → save to a temp file.
|
|
6
|
+
b. Read local component definition files (e.g., `src/components/storyblok/*.ts`).
|
|
7
|
+
c. Compare: identify new/removed/changed fields.
|
|
8
|
+
d. If changes: edit local files to match Storyblok definitions.
|
|
9
|
+
e. Commit & push.
|
|
10
|
+
3. **Content Export**:
|
|
11
|
+
a. Use `storyblok_list_stories` with filters to select stories (e.g., published, specific tag).
|
|
12
|
+
b. For each story (handle pagination):
|
|
13
|
+
- `storyblok_get_story identifier=... version=published`
|
|
14
|
+
- Write JSON to `content/stories/{slug}.json` (or appropriate format).
|
|
15
|
+
c. Commit & push.
|
|
16
|
+
4. Use `git_status` to review changes before committing and pushing.
|
|
17
|
+
5. Always ask for confirmation before `git_push`.
|
|
18
|
+
6. Log actions and errors.
|