storybook-vitest

storybook-vitest is a skill for Claude Code from fubits1/svelte-skills. It costs 70 tokens per session (4,680 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 — 7 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 7 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 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,680 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.00070 $0.04680
Opus 5 $0.00035 $0.02340
Sonnet 5 $0.00014 $0.00936
Haiku 4.5 $0.00007 $0.00468

Measured 12d ago against content hash 50e06be75908, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 · 261 lines

How it starts

The opening of the file, as written. The whole thing — 261 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. 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).
  • Console errors fail the test. MSW in .storybook/preview applies when configured (v2+ if you use MSW).
  • Test coverage: see Storybook’s coverage doc; vitest --coverage --project … only covers projects you pass (many pipelines omit storybook on purpose).
  • With the addon, snapshot tests are not supported (unlike the test runner; comparison).

.stories.svelte + play

Use storybook/test (expect, within, userEvent, waitFor) in play. Scope queries with canvasElement to within(canvasElement).

EVERY story MUST have meaningful interaction tests. A smoke render (<Story name="Default" />) proves the component mounts without crashing, nothing else. For every story that involves user-interactive elements (inputs, autocompletes, buttons, forms):

Read the full file on GitHub · 261 lines

Files

What ships with it

1 file 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 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 1mo ago), licensed MIT. It adds 70 tokens to every session and 4,680 once invoked, about $0.0003 per session on Opus 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

Other skills, from other repositories

web-quality

Use when setting up or running ESLint, Prettier, Vitest, or Playwright for Nuxt/Vue projects, deciding what to test, or enforcing pre-deploy quality gates.

pstuart/pstuart · 42 tokens

vue-testing-best-practices

Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.

NeverSight/learn-skills.dev · 38 tokens

vue-testing-best-practices

Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.

hairyf/skills · 38 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

playwright-component-testing

Set up component testing with Playwright using a story gallery — scaffold stories and a gallery dev page driven by the built-in mount fixture, no dedicated component-testing runtime. Use when asked to test React or Vue components in isolation with Playwright, or to migrate off @playwright/experimental-ct-react / -vue.

microsoft/playwright · 69 tokens

next-partial-prefetching-optimizer

Optimize what selected Next.js client navigations include before the click under Partial Prefetching. Use after Cache Components and Partial Prefetching are adopted when the user wants selected URL-specific UI to be instant, wants reusable content to wait for navigation, or needs to choose between default, viewport…

vercel/next.js · 82 tokens