/storyblok:storyblok-implement-figmafrom storyblok
Turns a Figma design into frontend components backed by Storyblok blocks. Walks through reading the design, building a content inventory, modeling blocks, uploading images, and generating frontend code.
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; scripts run unread.
fileKey + nodeId pair.Uploading cms assets in step 5 needs a Storyblok personal access token: the
environment variable or secret-manager command the user names for it. When they
have not named one, ask which to use then, not up front. Never ask for the token
itself, and never use one only because it is set in the environment.
Do not finish with a step unaccounted for; if you skip one, say so and why.
- [ ] 1. Load storyblok-build-frontend and detect the project
- [ ] 2. Read the design
- [ ] 3. Build the content inventory
- [ ] 4. Apply storyblok-model-content
- [ ] 5. Upload the design's images
- [ ] 6. Offer to create a story
- [ ] 7. Generate the frontend with storyblok-build-frontend
- [ ] 8. Report
Load storyblok-use-storyblok before the first Storyblok call of the run — it
covers whether the MCP server or the CLI fits the job — and
storyblok-model-content for step 4's modeling.
Upload the design's images with the bundled script in step 5 rather than the MCP
upload tools, and read resources/error-recovery.md when Figma itself fails.
storyblok-build-frontend and detect the projectLoad storyblok-build-frontend for any work touching frontend code, and run its
step 1 to detect the project. It gives you:
clientFrameworks;Extract fileKey and nodeId from the URL — in
figma.com/design/:fileKey/:fileName?node-id=:nodeId. Pass the node-id value
through as it stands; the API takes hyphens and colons alike (1-234 and
1:234 both resolve). Percent-decode it first — a link that carries an
encoded %3A is rejected outright.
Start with get_metadata on that node. It returns the whole page as a compact
tree — ids, names, sizes, absolute coordinates — with each <text> node's copy
in its name, which is most of step 3's inventory for a fraction of a full-page
get_design_context; the coordinates it carries, never the order it lists nodes
in, are where step 3's design order comes from.
Then call get_design_context once per section frame, taking ids from that
tree:
fileKey: <extracted>
nodeId: <section frame id from that tree>
clientLanguages: "html,css,typescript"
clientFrameworks: "<framework detected in step 1>"
The reference code in the response is React + Tailwind by default — adapt it to this project; it is written for neither this stack nor Storyblok.
Reusable components appear as childless <instance> elements — fetch code for
the section frame that contains them, never one call per instance inside it.
Every call also renders the node as an image, so cost scales with what you ask
for; excludeScreenshot: true drops that render on a call you want only the
values from. Repeated cards differing only in their icon are still one call:
take each card's asset from the section result, and fetch a single instance only
when that result genuinely omits it.
Large results commonly spill to a file. When that happens:
get_design_context on narrower nodes or ask the user for one
— this does not forbid step 5's own per-node get_screenshot export.The design's variables and styles (type scale, colours, spacing, radii, breakpoints) are the values step 7 expresses using the project's own styling mechanism.
Freeze the section inventory before modeling. Two passes: classify subtrees first, then inventory what is left.
Pass 1 — find the artwork. Artwork is a self-contained graphic that becomes one image: a diagram, a product screenshot, an annotated wireframe, an illustration. The test is editorial ownership, never the presence of text:
Would an editor ever want to change this text on its own, and would the result still make sense without redrawing the graphic? If no, the whole subtree is one image.
Precedence: any never-flatten condition below wins outright over any number of flatten signals, and the flatten default (including "when undecided, flatten") applies only when no never-flatten condition holds.
Two or more of these mean flatten: a photo or raster fill blended with vector
shapes; children absolutely positioned, overlapping or rotated, with no
auto-layout for the DOM to carry; it depicts another interface (product
screenshot, wireframe, editor panel, code filename), whose text is that
interface's chrome and not this page's copy; connectors, arrows, halos or
callout pins tying text to shapes; every text node inside is a short label or
badge; node names read as artwork (Group 13998, Bitmap) while the section's
real copy sits in siblings named Heading, Frame 316.
Never flatten, however graphic-heavy: a heading + body pair, or any link or button, is inside it; repeated siblings with one shape and differing copy (a card grid, logo strip, testimonial row — that is a repeatable block); the text is the section's own message (eyebrow, headline, subline, a stat with its caption); a photo with a caption or credit beside it; the subtree is the whole section — sections are never one image, so flatten the artwork inside them. Proximity to a graphic does not make copy decorative.
When undecided, flatten: swapping an image is easy, unpicking a dozen junk fields is not. State the split in your plan — which subtrees you are flattening, which you are modeling as copy — and continue without waiting for an answer.
Pass 2 — inventory the rest. Record each section's role, editable copy/images/links, repeated groups, reuse candidates, and design order.
y gives the
stacked order of page sections; ascending x (respecting reading direction)
orders items within a row. Freeze that order in this inventory — order noted
anywhere else does not reach step 4.storyblok-model-content owns
those decisions.storyblok-model-contentDo not download, inspect, rename, upload, or clean each asset with separate tool
calls. Read resources/assets.md, write one manifest, and run
scripts/sync-assets.sh once.
One manifest means every image the implementation needs, not the artwork alone:
the logos and marks in step 3's code-owned chrome list are code entries in
this same run. If step 7 needs an image this step did not upload, come back here
rather than fetching it inline.
Each artwork subtree from step 3 is one cms asset in that manifest, with alt
written from the labels inside the graphic so its meaning survives for screen
readers and search, or a plain description of what it depicts when it carries no
labels at all. Where design context gives no asset URL for the subtree — the
usual case, since it returns shapes and text — call get_screenshot with that
node's fileKey and node id, contentsOnly: true, and a maxDimension at or
above the node's longer dimension from step 2, then use the URL it returns.
maxDimension only caps: it downscales anything larger — the 1024 default
silently shrinks a wide node — and never renders above 1x, so there is no point
asking for more. Exporting a subtree this way is neither a substitute for
get_design_context nor a validation step; it is how artwork becomes an asset.
contentsOnly can exclude floating content parented to the page rather than the
subtree (e.g. a connector or callout drawn above a section). The response's
dimensions cannot show that, so view every render. View them as one image rather
than one call each: write the manifest first and render it with
"<skill-directory>/scripts/preview-assets.sh" <manifest> preview.png. A piece
missing means re-export without contentsOnly; the whole node coming back as a
solid block means an ancestor backdrop was baked in, so export the graphic's own
layer instead. An SVG from download_assets bakes that backdrop in the same
way; take the node's PNG render when it does.
"<skill-directory>/scripts/inspect-image.sh" <path-or-url>... reports
dimensions, opaque share and dominant colours — an opaque share of 1 on a mark
that should be transparent is that backdrop.
resources/story.md and follow it.The story comes before the code: without one there is nothing for a frontend to render.
storyblok-build-frontendContinue in that skill from its step 2, carrying:
storyblok-build-frontend's report step covers the code — files, registration
changes, colour tokens, and any check skipped. Add the design-side facts:
Report a divergence instead of quietly leaving it unmentioned.
resources/assets.md — load before processing Figma assets.resources/story.md — load only when a story should be created.resources/error-recovery.md — load only after an actual workflow error.scripts/sync-assets.sh — process one asset manifest.scripts/upload-asset.sh — upload one prepared file.scripts/inspect-image.sh — report an image's size, transparency and colours.scripts/preview-assets.sh — render a manifest's images as one labelled
image.agents/openai.yaml (opens in a new tab)resources/assets.md (opens in a new tab)resources/error-recovery.md (opens in a new tab)resources/story.md (opens in a new tab)scripts/inspect-image.sh (opens in a new tab)scripts/preview-assets.sh (opens in a new tab)scripts/sync-assets.sh (opens in a new tab)scripts/upload-asset.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
7 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-build-pluginUse when extending Storyblok with plugins to enhance what editors can do — custom field inputs, Visual Editor panels, pages inside a space, integrations with external systems — including choosing, building, or deploying one. E.g. "editors need a map location picker", "build a field plugin", "deploy our plugin"./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".Other plugins' skills for the same job
npx claudepluginhub storyblok/agent-plugin --plugin storyblok