agentleFS
kdoddy36615kdoddy36615/bug-reviewer/.claude/skills/storyblok-bugfix-story/SKILL.md

storyblok-bugfix-story

Skill0 starsChanged 6 months agoMITView on GitHub

Create, find, or publish a Storyblok story under the configured bug-fix folder for an isolated bug-fix preview, and build the localhost preview URL. Use when the user says "create a bugfix story", "publish to Storyblok", "find the bugfix story for X", or when the orchestrator needs an isolated preview page for screenshot capture.

  • Reads credentials
  • Sends data out

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    SSL note: if your dev server runs HTTPS with a self-signed cert, capture.js already sets ignoreHTTPSErrors: true.

    line 124
  2. Very specific:

    Auth header has no Bearer prefix: Use Authorization: $STORYBLOK_MANAGEMENT_TOKEN directly.

    line 141

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Storyblok — Bug Fix Story

Story management is curl-only against the management API. The Storyblok CLI cannot create, read, or find stories — only push component schemas (see storyblok-component-push).


Auth — the most common failure point

The personal access token uses no Bearer prefix:

# CORRECT
-H "Authorization: $STORYBLOK_MANAGEMENT_TOKEN"

# WRONG — will return 401
-H "Authorization: Bearer $STORYBLOK_MANAGEMENT_TOKEN"

Base URL: pick the region matching your space.

  • US region: https://api-us.storyblok.com/v1
  • EU region: https://api.storyblok.com/v1

This skill assumes US — adjust if your space is in EU.


Folder ID

The bug-fix folder ID is stored in $STORYBLOK_BUGS_FOLDER_ID (set in .env).

To find it once for your space:

curl -s \
  "https://api-us.storyblok.com/v1/spaces/$STORYBLOK_SPACE_ID/stories?starts_with=pages/dev/bugs&folder_only=true" \
  -H "Authorization: $STORYBLOK_MANAGEMENT_TOKEN" \
  | jq '.stories[] | select(.full_slug == "pages/dev/bugs") | .id'

Adjust starts_with= if your team uses a different folder path.


Find existing bug fix stories

curl -s \
  "https://api-us.storyblok.com/v1/spaces/$STORYBLOK_SPACE_ID/stories?starts_with=pages/dev/bugs/&story_only=true" \
  -H "Authorization: $STORYBLOK_MANAGEMENT_TOKEN" \
  | jq '.stories[] | {id, name, full_slug, parent_id}'

Create a bug fix story

The example below uses a general_page content type with title, title_short, description_short (richtext), and meta_tags (bloks). If your space uses a different content type, adjust the JSON shape accordingly.

curl -s -X POST \
  "https://api-us.storyblok.com/v1/spaces/$STORYBLOK_SPACE_ID/stories" \
  -H "Authorization: $STORYBLOK_MANAGEMENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "story": {
      "name": "bugfix-<component>-<bug_id>",
      "slug": "bugfix-<component>-<bug_id>",
      "parent_id": '"$STORYBLOK_BUGS_FOLDER_ID"',
      "content": {
        "component": "general_page",
        "_uid": "'$(uuidgen | tr '[:upper:]' '[:lower:]')'",
        "title": "<Bug title from issue tracker>",
        "title_short": "<Bug title from issue tracker>",
        "description_short": {
          "type": "doc",
          "content": [{ "type": "paragraph", "content": [{ "type": "text", "text": "<one sentence summary>" }] }]
        },
        "meta_tags": [{
          "component": "meta_tags",
          "_uid": "'$(uuidgen | tr '[:upper:]' '[:lower:]')'",
          "meta_description": "<one sentence summary>"
        }]
      }
    }
  }'

Full slug after creation: pages/dev/bugs/bugfix-<component>-<bug_id> (or whatever your folder path is).


Publish the story

curl -s -X GET \
  "https://api-us.storyblok.com/v1/spaces/$STORYBLOK_SPACE_ID/stories/<STORY_ID>/publish" \
  -H "Authorization: $STORYBLOK_MANAGEMENT_TOKEN"

Preview URL pattern

$PREVIEW_BASE_URL/{full_slug minus "pages/"}?secret=$DRAFT_SECRET_TOKEN&slug={full_slug URL-encoded}

Example for pages/dev/bugs/bugfix-tabs-99001:

https://localhost:3000/dev/bugs/bugfix-tabs-99001?secret=$DRAFT_SECRET_TOKEN&slug=pages%2Fdev%2Fbugs%2Fbugfix-tabs-99001

Do NOT include _storyblok=<id> in screenshot URLs — that activates the visual editor overlay and pollutes the screenshot. Use secret + slug only.

The dev server must be running at $PREVIEW_BASE_URL before any preview is fetched.

SSL note: if your dev server runs HTTPS with a self-signed cert, capture.js already sets ignoreHTTPSErrors: true. For Playwright MCP, navigate then call page.keyboard.type('thisisunsafe') to bypass the interstitial (Chromium).


Naming convention

ThingFormatExample
Componentbugfix_<component_name>_<bug_id> (underscores)bugfix_tabs_99001
Story slugbugfix-<component-name>-<bug_id> (hyphens)bugfix-tabs-99001
Story locationconfigured in $STORYBLOK_BUGS_FOLDER_IDpages/dev/bugs/bugfix-tabs-99001

Hard rules

  • Never delete or modify existing stories outside the bug-fix folder. Treat the rest of the space as read-only.
  • Auth header has no Bearer prefix. Use Authorization: $STORYBLOK_MANAGEMENT_TOKEN directly.
  • Use the API region matching your space (api-us for US, api for EU). Not mapi.storyblok.com.
  • Do not include _storyblok= in preview URLs for screenshots.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.