storybook
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-03-27
- Stars
- ★ 3
- Forks
- 1
03 SKILL.md 正文
Storybook Best Practices
Setup (Next.js)
- Use
@storybook/nextjsframework for automatic Next.js config support - Configure
main.ts:framework: { name: '@storybook/nextjs' } - Stories location:
stories: ['../src/**/*.stories.@(ts|tsx)']
Story Structure
// Button.stories.tsx
import type { Meta, StoryObj } from '@storybook/react';
import { Button } from './Button';
const meta = {
component: Button,
tags: ['autodocs'], // auto-generate docs page
argTypes: {
variant: { control: 'select', options: ['primary', 'secondary'] },
},
} satisfies Meta<typeof Button>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Primary: Story = { args: { variant: 'primary', children: 'Click' } };
export const Loading: Story = { args: { loading: true } };
Patterns
- One component per story file:
ComponentName.stories.tsxnext to component - Args over hardcoded props: Use
argsfor all configurable props - Play functions: Simulate user interactions for interaction testing
- Decorators: Wrap stories with providers (theme, router, query client)
- CSF3 format: Use
satisfies Meta<typeof Component>for type safety
Organization
- Group by domain:
sidebar: { order: ['Atoms', 'Molecules', 'Organisms', 'Pages'] } - Use
tags: ['autodocs']for automatic documentation - Add
parameters.designfor Figma link integration (withstorybook-addon-designs)
Testing Integration
- Visual regression: Chromatic or
@storybook/test-runner - Accessibility:
@storybook/addon-a11yfor per-story a11y checks - Interaction tests:
playfunction +@storybook/testing-library
04 同仓库更多 Skills
zustand
Zustand state management guide. Use when working with store code (src/store/**), implementing actions, managing state, or creating slices. Triggers on Zustand store development, state management questions, or action implementation.
web-vitals
暂无简介
vercel-storage
Vercel storage expert guidance — Blob, Edge Config, and Marketplace storage (Neon Postgres, Upstash Redis). Use when choosing, configuring, or using data storage with Vercel applications.
vercel-functions
Vercel Functions expert guidance — Serverless Functions, Edge Functions, Fluid Compute, streaming, Cron Jobs, and runtime configuration. Use when configuring, debugging, or optimizing server-side code running on Vercel.
ui-ux-pro-max
UI/UX design intelligence for web and mobile. Includes 50+ styles, 161 color palettes, 57 font pairings, 161 product types, 99 UX guidelines, and 25 chart types across 10 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind, shadcn/ui, and HTML/CSS). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, and check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, and mobile app. Elements: button, modal, navbar, sidebar, card, table, form, and chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, and flat design. Topics: color systems, accessibility, animation, layout, typography, font pairing, spacing, interaction states, shadow, and gradient. Integrations: shadcn/ui MCP for component search and examples.
turborepo
Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.