agentleFS
primerprimer/react/.agents/skills/storybook/SKILL.md

storybook

Skill3.9k starsChanged 3 days agoMITView on GitHub

Use when: starting, checking, or using the Storybook dev server; looking up Primer React component stories, props, or documentation; previewing component variants; writing or verifying Storybook stories; using the primer-storybook MCP to explore components. Covers starting Storybook, checking if it is running, and using MCP tools (list-all-documentation, get-documentation, get-storybook-story-instructions, preview-stories) to look up components.

We split this skill into the rules it gives an agent

10 rules. 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

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

    Run from the workspace root (not packages/react):

    line 32
  2. Distinctive:

    Run as a background process so the agent continues working.

    line 39
  3. Very specific:

    Always list first: Call list-all-documentation to get the full list of valid IDs.

    line 73
  4. Very specific:

    Get by ID: Call get-documentation with the exact id from the list (use storybookId to scope to one source when multiple are configured).

    line 75
  5. Distinctive:

    Verify props: Never invent props or variants not present in the documentation.

    line 76
  6. Very specific:

    Before writing stories: Always call get-storybook-story-instructions first — treat its output as the source of truth.

    line 77
  7. Very specific:

    After changing stories: Call preview-stories and include every returned URL in your response.

    line 78
  8. Distinctive:

    Do not call MCP tools before Storybook is running — they will fail silently.

    line 84
  9. Very specific:

    Always: call list-all-documentation before get-documentation — never guess or derive an ID from a component name.

    line 85
  10. Very specific:

    Before writing or editing stories, always call get-storybook-story-instructions — treat its output as the source of truth.

    line 87

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “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

Storybook — Start Server & Use MCP

When to Use

  • You need to look up a component's stories, props, or usage examples
  • You are writing or editing a Storybook story
  • You want to preview a component variant at a URL
  • Any task that benefits from live Storybook documentation

Step 1 — Ensure Storybook Is Running

Storybook must be running before any MCP tool calls. The MCP server is served by Storybook at http://localhost:6006/mcp.

Check if it is already running

curl -s -o /dev/null -w "%{http_code}" http://localhost:6006
  • 200 / 3xx → Storybook is already up. Skip to Step 2.
  • 000 / connection refused → Start it now.

Start Storybook

Run from the workspace root (not packages/react):

npm start

This starts the Storybook dev server on http://localhost:6006. It takes ~3–10 seconds. Run as a background process so the agent continues working.

Verify it is ready

Poll until the server responds:

until curl -s -o /dev/null -w "%{http_code}" http://localhost:6006 | grep -q "200\|301\|302"; do sleep 1; done

Step 2 — Use the primer-storybook MCP

The primer-storybook MCP is configured in .vscode/mcp.json as an HTTP server at http://localhost:6006/mcp.

Load deferred tools before calling them:

tool_search_tool_regex pattern: "mcp_primer-storyb"

Available Tools

ToolWhen to Use
mcp_primer-storyb_list-all-documentationDiscover all available component and documentation IDs — call once per task
mcp_primer-storyb_get-documentationRetrieve full docs, props, and examples for a component by id
mcp_primer-storyb_get-documentation-for-storyGet docs for a specific story variant not covered by get-documentation
mcp_primer-storyb_get-storybook-story-instructionsGet framework-specific imports and story patterns — always call before writing/editing stories
mcp_primer-storyb_preview-storiesGet live preview URLs for stories — always include returned URLs in your response

Workflow

  1. Always list first: Call list-all-documentation to get the full list of valid IDs. Never call get-documentation without first obtaining an ID from this list. Do not guess or infer IDs from component names (e.g. "button" is wrong — the correct ID is "components-button").
  2. Match the ID: Find the entry in the list that corresponds to the component you need. IDs follow the pattern components-<componentname> (e.g. components-button, components-actionmenu).
  3. Get by ID: Call get-documentation with the exact id from the list (use storybookId to scope to one source when multiple are configured).
  4. Verify props: Never invent props or variants not present in the documentation.
  5. Before writing stories: Always call get-storybook-story-instructions first — treat its output as the source of truth.
  6. After changing stories: Call preview-stories and include every returned URL in your response.

Rules

  • Do not call MCP tools before Storybook is running — they will fail silently.
  • Always call list-all-documentation before get-documentation — never guess or derive an ID from a component name. Only use id values returned by this list.
  • Never invent props or variants not present in the documentation. Only use properties explicitly documented or shown in example stories — do not assume properties based on naming conventions or patterns from other libraries. If a property isn't documented, report it as not found and check back with the user.
  • Before writing or editing stories, always call get-storybook-story-instructions — treat its output as the source of truth.

Download now (ZIP)

Trending

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Aug 30: 0 new projectsWeek of Sep 6: 0 new projectsWeek of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projects
Aug 2026Sep 2026Oct 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about primer/react

The biggest 5 of 36 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 36

Talked about on GitHub (36 times).

On GitHub · 36

31 more on GitHub

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.