/storyblok:storyblok-build-pluginfrom storyblok
Guides building Storyblok plugins — field, tool, or space — including choosing the right type, checking existing apps, and deploying.
Ships in storyblok. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Decide what to use before building anything: a built-in field, an existing app, or one of three plugin types. Build only what neither covers, with the official tooling.
Load storyblok-use-storyblok first, even when no Storyblok call is planned
— its token rules decide the deploy hand-over in §4. Deciding what to use needs
no space; do not ask for one before the answer depends on it.
Before building anything, check both, in this order:
curl -s https://www.storyblok.com/docs/apps.md and read the
whole output; it is short and grouped by category.Before recommending an app, read its page
(curl -s https://www.storyblok.com/docs/apps/<app>.md) so setup details are
facts, not guesses. If an app comes close but falls short, say which and why.
When the user asked to build a specific plugin and something already covers it,
say so.
Decide by where it runs and what it can reach:
| Type | Runs | Reaches | Use for |
|---|---|---|---|
| Field plugin | inside one field of a block, in the editor form | its own value and options; reads the open story | custom inputs: pickers, external references, structured values |
| Tool plugin | a panel in the Visual Editor, beside the story | the story being edited, live; Management API via OAuth | per-story helpers while editing: analysis, checks, actions |
| Space plugin | a full page in the space's sidebar | the whole space via the Management API (OAuth) | space-wide views: dashboards, reports, bulk work |
Field plugins: any user can build and deploy them; Storyblok hosts the bundle.
Tool and space plugins: self-hosted apps, registered by a user with Partner
Portal or Organization access, authenticated with OAuth via
@storyblok/app-extension-auth, and a premium feature. Docs:
https://www.storyblok.com/docs/plugins.md.
Scaffold with the CLI, never by hand. The template produces the single
bundle Storyblok loads (dist/index.js), mounts into an element it creates
(the editor's document is empty — there is no index.html in production),
and wires the SDK. Run it non-interactively:
npx @storyblok/field-plugin-cli@latest create --dir . --pluginName <name> \
--template <vue3|react|js> --structure standalone --packageManager npm
It creates ./<name>/. Replace src/components/FieldPluginExample/
(component, CSS, test) with your own and point App at it. Keep main,
vite.config, tsconfig*, index.html, and field-plugin.config.json. The
template's main ends by throwing an error on purpose (legacy API); leave
it.
For a modal that browses or searches an external catalog (e-commerce, DAM, PIM), start from https://github.com/storyblok/pluginsblok/tree/main/apps/field-plugins/picker-starter instead.
Implement with the SDK: useFieldPlugin (Vue 3, React) or
createFieldPlugin (js). Render only when type === 'loaded'. Read the
stored value from data.content, normalize it in validateContent, save
with actions.setContent(value). Options arrive as strings in
data.options. validateContent never sees them, so derive any default that
depends on an option (e.g. a preselected choice) from data.options, and a
new, empty field must offer only what the options allow.
What else the SDK offers, and when to use it:
enablePortalModal: true, actions.setModalOpen(true), a visible close
button while data.isModalOpen, Escape closes, a pick closes.actions.selectAsset() opens Storyblok's asset picker; no URL
input.data.story is the story as the editor loaded it, not the
unsaved one. Read siblings with actions.requestContext() on load and
again when the field regains focus (no event fires on change). It resolves
to the unsaved story; find this field's block in it by data.blockUid.
Every call gets its own reply: never skip or drop a read, or a click like
Retry, because one is pending.data.storyLang, 'default' for the default language.actions.promptAI only when data.isAIEnabled.Declare every option in field-plugin.config.json:
{ "options": [{ "name": "currencies", "value": "EUR,USD" }] }. The sandbox
and the deploy command read it.
Look native to the editor: follow "Style the field plugin" in https://www.storyblok.com/docs/plugins/field-plugins.md.
Test and build: npm test && npm run build; the build must produce
dist/index.js. Write tests like the example spec, with setupFieldPlugin
from @storyblok/field-plugin/test. Its container has no options and no
stored value, so test option and content handling as plain functions.
Rewrite the template README: each option with its default, and the stored value as a JSON example.
SDK and CLI reference: https://www.storyblok.com/docs/plugins/field-plugins.md and https://www.storyblok.com/docs/libraries/js/field-plugin-sdk.md.
Deploying publishes the plugin to an account — personal, partner portal, or organization — not to a space. Never run it unasked.
Plugin names are unique across Storyblok: pick a personal prefix yourself
(<prefix>-<name>, e.g. acme-price-field), never the bare package name, and
state the deployed name.
npm run deploy (runs
field-plugin-cli deploy); it reads STORYBLOK_PERSONAL_ACCESS_TOKEN and
asks for the scope and name.type: "custom", field_type set
to the deployed name, and options with their values. The deployed values
serve development only: a field gets just the option keys, so each field needs
its own values. Offer to add the field for them: it changes the schema, so
confirm first, then follow storyblok-model-content.Start from the starters in https://github.com/storyblok/pluginsblok
(apps/space-tool-plugins), not from scratch. Keep the client id and secret in
environment variables, never in the repo. A tool plugin reads the open story
with postMessage (getContext). Both types call the Management API with the
OAuth token; App Bridge is an optional extra auth flow, not a data channel.
Docs: https://www.storyblok.com/docs/plugins/tool-plugins.md,
https://www.storyblok.com/docs/plugins/space-plugins.md,
https://www.storyblok.com/docs/plugins/app-bridge.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub storyblok/agent-plugin --plugin storyblok7 skills in this plugin
/storyblok-build-frontendUse when generating frontend components for Storyblok blocks — writing, registering and validating the framework code that renders a space's content. E.g. "generate components for my blocks", "build an Astro + Storyblok landing page"./storyblok-implement-figmaUse when turning a Figma design into frontend components backed by Storyblok blocks. E.g. "figma to storyblok", "build this Figma design"./storyblok-model-contentUse when creating or modifying Storyblok components/blocks, content types, or fields, or modeling a content schema from multi-modal input. E.g. "model content for a blog", "add an image field to the teaser", "set up blocks for this landing page design"./storyblok-use-cliUse when driving Storyblok through the Storyblok CLI — code-driven schema, content migrations, bulk pull/push of stories, components, assets or datasources, or scaffolding a project./storyblok-use-mcpUse when interacting with Storyblok through the MCP server — the tool model, operation names and payload shapes for stories, assets, components, datasources and every other resource. Load it before calling `mcp__storyblok__` tools, alongside the skill that owns the task./storyblok-use-storyblokUse when a request touches Storyblok at all, including advice or a plan that changes nothing yet. You MUST load it first — before any other Storyblok skill and before any `mcp__storyblok__` tool — to pick the right skill and the right tool for the job. E.g. "add an FAQ section to the pricing page", "model content for a blog", "set up Storyblok in this project".