Cursor rule
.cursor/rules/frontend-storybook.mdcFrontend Storybook stories for Vue components, story format, story variants, makeMe builders, Storybook aliases
Cursor rules
Quality
69/100
Scores the file, not the repository.Length
379 words
8 headings · 5 code blocksRepository
49
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.123456# Frontend Storybook Rules78Use this rule when creating or updating frontend Storybook stories. Component-level naming, styling, icon, and derived-state conventions live in `frontend-component.mdc`.910## Running Storybook1112Start Storybook locally for component development and debugging:1314```bash15CURSOR_DEV=true nix develop -c pnpm storybook16```1718Storybook starts on `http://localhost:6006` by default.1920## Shared Test Data Builders2122Storybook stories reuse the same `makeMe` builders as unit tests. Source code lives in `packages/doughnut-test-fixtures`.2324```typescript25import makeMe from "doughnut-test-fixtures/makeMe"26```2728The `makeMe` object provides access to test data builders:2930- `makeMe.anAnsweredQuestion` creates recall prompts with answers.31- `makeMe.aPredefinedQuestion` creates predefined question data.32- `makeMe.aNote` creates note data.33- `makeMe.aNoteRealm` creates note realm data.34- Many other API-shaped builders are available.3536```typescript37const correctQuestion = makeMe.anAnsweredQuestion38 .answerCorrect(true)39 .withChoiceIndex(0)40 .please()4142const questionWithNote = makeMe.anAnsweredQuestion43 .withNote(makeMe.aNote.topicConstructor("TypeScript").please())44 .answerCorrect(true)45 .please()46```4748## Writing A Story49501. Create a file named `ComponentName.stories.ts` in the same directory as the component.512. Import the component and necessary builders.523. Define the story meta and stories.5354```typescript55import type { Meta, StoryObj } from "@storybook/vue3"56import makeMe from "doughnut-test-fixtures/makeMe"57import MyComponent from "./MyComponent.vue"5859const meta = {60 title: "Category/MyComponent",61 component: MyComponent,62 tags: ["autodocs"],63} satisfies Meta<typeof MyComponent>6465export default meta66type Story = StoryObj<typeof meta>6768export const Default: Story = {69 args: {70 prop1: makeMe.someBuilder.please(),71 },72}73```7475## Story Variants7677Create multiple story variants to showcase different component states:7879```typescript80export const Variant1: Story = {81 args: {82 // props for variant 183 },84}8586export const Variant2: Story = {87 args: {88 // props for variant 289 },90}91```9293## Module Aliases9495Storybook supports the same module aliases as the main application:9697- `@/` points to `src/`.98- `@tests/*` points to `tests/`, for example `@tests/helpers`.99- `@generated/` points to `generated/`.100101For API-shaped fixtures, import `makeMe` from `doughnut-test-fixtures/makeMe`; do not use an `@tests/fixtures` alias.102103## Global Styles104105Storybook automatically loads global styles from `src/assets/daisyui.css`, including Tailwind CSS base styles, DaisyUI component styles, and custom application styles.106107## Best Practices1081091. Reuse builders: always use `makeMe` instead of ad-hoc mock objects that duplicate API shapes.1102. Avoid duplication: use builders for consistency.1113. Add multiple variants to showcase different component states.1124. Use the `autodocs` tag to automatically generate documentation.1135. Keep builders framework-neutral so they work in both tests and Storybook.114
Also in nerds-odd-e/doughnut
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| nerds-odd-e/doughnut.cursor/rules/general.mdc · 49 | Cursor rules | styledo-not | 49/100 | 3 days ago | |
| nerds-odd-e/doughnut.clinerules/daisyui.md · 49 | Cline rules | setuplint-formatstyleui+1 | 57/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/architecture-decisions.mdc · 49 | Cursor rules | no sections | 16/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/backend-code.mdc · 49 | Cursor rules | styletypesdatabasedo-not | 61/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/backend-testing.mdc · 49 | Cursor rules | buildteststyletesting-strategy+2 | 73/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49 | Cursor rules | setupbuildteststyle+4 | 96/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/db-migration.mdc · 49 | Cursor rules | stylearchdatabasedeployment | 64/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/e2e-authoring.mdc · 49 | Cursor rules | setupteststylearch+3 | 80/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/e2e-ocr.mdc · 49 | Cursor rules | setuptesting-strategydo-not | 46/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-api.mdc · 49 | Cursor rules | styletesting-strategyapido-not | 57/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-component.mdc · 49 | Cursor rules | testlint-formatstylearch+2 | 76/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/frontend-testing.mdc · 49 | Cursor rules | buildteststyletesting-strategy+2 | 89/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/gsd-coexistence.mdc · 49 | Cursor rules | style | 60/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/linting_formating.mdc · 49 | Cursor rules | testlint-formatstylearch+6 | 88/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/mcp-server.mdc · 49 | Cursor rules | buildtestlint-formatarch+2 | 85/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/planning.mdc · 49 | Cursor rules | teststylearchdo-not+1 | 75/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/script.mdc · 49 | Cursor rules | testarch | 58/100 | 3 days ago | |
| nerds-odd-e/doughnutAGENTS.md · 49 | AGENTS.md | no sections | 47/100 | 3 days ago | |
| nerds-odd-e/doughnutCLAUDE.md · 49 | CLAUDE.md | agent-behaviour | 47/100 | 3 days ago |
Diff against .cursor/rules/general.mdc Diff against .clinerules/daisyui.md Diff against .cursor/rules/architecture-decisions.mdc Diff against .cursor/rules/backend-code.mdc Diff against .cursor/rules/backend-testing.mdc Diff against .cursor/rules/cli.mdc Diff against .cursor/rules/db-migration.mdc Diff against .cursor/rules/e2e-authoring.mdc Diff against .cursor/rules/e2e-ocr.mdc Diff against .cursor/rules/frontend-api.mdc Diff against .cursor/rules/frontend-component.mdc Diff against .cursor/rules/frontend-testing.mdc Diff against .cursor/rules/gsd-coexistence.mdc Diff against .cursor/rules/linting_formating.mdc Diff against .cursor/rules/mcp-server.mdc Diff against .cursor/rules/planning.mdc Diff against .cursor/rules/script.mdc Diff against AGENTS.md Diff against CLAUDE.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
