agentleFS
MicrosoftKnown publishermicrosoft/scope/.agents/skills/storybook/SKILL.md

storybook

Skill7 starsChanged 2 months agoMITView on GitHub

Maintain the Storybook component catalog for the portal app. Use this skill when: (1) adding new stories for components, (2) updating existing stories after component changes, (3) running a full Storybook refresh/sync with AI assistance.

8 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Import Meta and StoryObj from @storybook/react-vite

    line 53
  2. Very specific:

    Use play functions for interaction testing

    line 55
  3. Very specific:

    Create a fresh QueryClient inside decorators (not at module scope)

    line 57

“Common” is measured: kept by at least 6 in 10 of the 5 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 Maintenance

This project uses Storybook 10 as a component catalog for the portal app (apps/portal/).

Updating the Storybook

To regenerate or update stories across the project, run the following command from the apps/portal/ directory:

cd apps/portal && npx storybook ai setup

Follow its instructions precisely. The command analyzes the project's runtime providers, CSS setup, data-fetching patterns, and components, then produces updated stories with proper decorators, MSW handlers, and play functions.

Key Files

FilePurpose
apps/portal/.storybook/main.tsStorybook config (framework, stories glob, Vite overrides)
apps/portal/.storybook/preview.tsxShared decorators (QueryClient, MemoryRouter), mswLoader, CSS
apps/portal/.storybook/msw-handlers.tsDefault MSW network handlers
apps/portal/public/mockServiceWorker.jsMSW service worker (generated by npx msw init)

Running Storybook

# From repo root (uses worktree port offset)
pnpm storybook

# From apps/portal directly
pnpm storybook

The dev server uses port ${STORYBOOK_PORT:-6100} and does not auto-open a browser.

Writing Stories Manually

Stories are co-located next to their components as <Component>.stories.tsx. Follow these conventions:

  1. Import Meta and StoryObj from @storybook/react-vite
  2. Tag AI-generated stories with tags: ['ai-generated', 'needs-work']
  3. Use play functions for interaction testing
  4. Mock API calls with MSW handlers in parameters.msw.handlers
  5. Create a fresh QueryClient inside decorators (not at module scope)

Building for CI

cd apps/portal && pnpm build-storybook

This produces a static build in storybook-static/ (git-ignored).

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.