storybook-vitest

storybook-vitest is a skill for Claude Code from fubits1/svelte-skills. It costs 66 tokens per session (3,362 once invoked), scanned A, original, MIT.

A Svelte testing setup that treats Storybook stories as Vitest browser tests. Storybook is a tool for developing UI components in isolation, while Vitest runs automated tests; play functions describe user interactions.

In plain words
What is it for?
Writing and debugging .stories.svelte tests, checking interactions, mocking APIs with MSW, handling console errors, and running the tests in Vitest or CI.
Why use it?
It lets you test how Svelte components render and respond to interactions, including in continuous integration, without starting a Storybook server for the test run.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the svelte-5 plugin — 8 skills shipped together

Good fit Writing and debugging .stories.svelte tests, checking interactions, mocking APIs with MSW, handling console errors, and running the tests in Vitest or CI.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fubits1/svelte-skills/storybook-vitest
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add fubits1/svelte-skills --skill storybook-vitest
Clone the repo
git clone --depth 1 https://github.com/fubits1/svelte-skills

Made for: Claude Code.

Or install svelte-5, the plugin that ships this one along with the rest of its 8 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for storybook-vitest

README.md
[![agentmods](https://agentmods.dev/badge/skills/fubits1/svelte-skills/storybook-vitest/github.svg)](https://agentmods.dev/skills/fubits1/svelte-skills/storybook-vitest)
Your own site
<a href="https://agentmods.dev/skills/fubits1/svelte-skills/storybook-vitest"><img src="https://agentmods.dev/badge/skills/fubits1/svelte-skills/storybook-vitest/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for storybook-vitest

Your own site · 80×15
<a href="https://agentmods.dev/skills/fubits1/svelte-skills/storybook-vitest"><img src="https://agentmods.dev/badge/skills/fubits1/svelte-skills/storybook-vitest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,362 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00066 $0.03362
Opus 5.5 $0.00026 $0.01345
Sonnet 5.5 $0.00013 $0.00672
Haiku 4.5 $0.00007 $0.00336

Measured 12d ago against content hash dab7de1cea12, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

storybook-vitest scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/svelte-5/skills/storybook-vitest/SKILL.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Storybook Vitest + Svelte CSF

Stories are .stories.svelte with defineMeta and <Story> from @storybook/addon-svelte-csf; ignore JSX/TSX/CSF3-TS story patterns here. Official reference: Vitest addon, use it for plugin, browser mode, CLI, tags, debugging, CI; ignore non-Svelte story file examples there. Manual setup · Example configuration files · Options

How it works

  • Plugin storybookTest turns stories into Vitest tests via portable stories (Vitest). No Storybook server required for the test run
  • Each <Story>: smoke render; a play function runs as the interaction test (interaction testing, asserting with expect)
  • A component inside the story that throws while the story renders leaves its story green, with or without a decorator, unless a play assertion fails on what did not render. Vitest reports that throw as an "unhandled error", exits non-zero, and names "the last test to run before this error". Find the throwing component in that block's ❯ source frames: its component stack can show it as in <unknown>. Exception: when a decorator returns a bare component (() => Wrapper), the Vitest run renders the defineMeta component without props in its place, and a throw from that instance fails its story and prints under that failed story (references/storybook-decorator.md, "Decorator return form"). A console.error alone does not fail anything. Read the "Unhandled Errors" block, not just the pass count
  • --silent hides the console output of every story. Separately, an AI agent's run with no reporter set in the config or the CLI uses Vitest's minimal reporter, which hides the output of passing stories even without --silent. --silent=false shows it (references/config.md)
  • To make logged errors fail a story, install the spy before the story renders (a spy created inside play misses errors logged during render):
    1. Declare let errorSpy; in <script module> (let errorSpy: ReturnType<typeof spyOn>; in lang="ts")
    2. In defineMeta: beforeEach: () => { errorSpy = spyOn(console, 'error'); return () => errorSpy.mockRestore() } (spyOn from storybook/test)
    3. In play: await expect(errorSpy).not.toHaveBeenCalled(), which fails on an error logged at mount
  • Test coverage: see Storybook's coverage doc; vitest --coverage --project … only covers projects you pass (SETUP.md's test:unit omits storybook; test:storybook runs it)
  • With the addon, snapshot tests are not supported (unlike the test runner; comparison)

Read the full file on GitHub · 111 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago Changed · -165 lines · -4 tokens per session dab7de1cea12
  2. 1mo ago Changed · +15 lines e1b2b11c3507
  3. 2mo ago First seen · 261 lines · 70 tokens per session scan A 50e06be75908

Subscribe to this mod's changes

storybook-vitest is a skill published in the GitHub repository fubits1/svelte-skills (10 stars, last pushed 12d ago), licensed MIT. It adds 66 tokens to every session and 3,362 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

storybook-vitest compared with skills from other repositories

storybook-vitest next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
storybook-vitestfubits1/svelte-skillsSkill1012d agoMITA66Claude Code
web-qualitypstuart/pstuartSkill206d agoMITA42Claude Code
vue-testing-best-practicesNeverSight/learn-skills.devSkill219yesterdaynoneA38Claude Code, Codex
vue-testing-best-practiceshairyf/skillsSkill2623d agoMITA38Claude Code, Codex
verify-omnigentomnigent-ai/omnigentSkill11kyesterdayApache-2.0A100Claude Code, Codex
test-masterJeffallan/claude-skillsSkill12k7d agoMITA104Claude Code
eval-dataset-designbojieli/ai-agent-bookSkill57k29d agoApache-2.0A138Claude Code, Codex