WesleySmits/agent-skills / .agent/skills/vue-component-architect
scaffolding-vue-components
VerifiedScaffolds Vue/Nuxt components with Composition API, CSS modules, Vitest tests, and Storybook stories. Use when the user asks to create a Vue component, generate component boilerplate, or mentions Vue 3 architecture.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.6 KB |
| examples/advanced-patterns.md | markdown | 3.9 KB |
| examples/component-templates.md | markdown | 3.6 KB |
| examples/storybook.md | markdown | 3.5 KB |
| examples/testing.md | markdown | 3.2 KB |
examples/storybook.md
View on GitHub# Vue Storybook Examples
## Basic Story (Storybook 7+ CSF3)
```typescript
import type { Meta, StoryObj } from "@storybook/vue3";
import ComponentName from "./ComponentName.vue";
const meta: Meta<typeof ComponentName> = {
title: "Components/ComponentName",
component: ComponentName,
parameters: {
layout: "centered",
},
tags: ["autodocs"],
argTypes: {
variant: {
control: "select",
options: ["primary", "secondary"],
},
disabled: {
control: "boolean",
},
onClick: { action: "click" },
},
};
export default meta;
type Story = StoryObj<typeof meta>;
export const Primary: Story = {
args: {
label: "Primary Button",
variant: "primary",
},
};
export const Secondary: Story = {
args: {
label: "Secondary Button",
variant: "secondary",
},
};
export const Disabled: Story = {
args: {
label: "Disabled Button",
disabled: true,
},
};
```
## Story with Slots
```typescript
import type { Meta, StoryObj } from "@storybook/vue3";
import ComponentName from "./ComponentName.vue";
const meta: Meta<typeof ComponentName> = {
title: "Components/ComponentName",
component: ComponentName,
};
export default meta;
type Story = StoryObj<typeof meta>;
export const WithSlot: Story = {
render: (args) => ({
components: { ComponentName },
setup() {
return { args };
},
template:
'<ComponentName v-bind="args">Custom Slot Content</ComponentName>',
}),
args: {
variant: "primary",
},
};
export const WithNamedSlots: Story = {
render: (args) => ({
components: { ComponentName },
setup() {
return { args };
},
template: `
<ComponentName v-bind="args">
<template #header>Header Content</template>
<template #default>Main Content</template>
<template #footer>Footer Content</template>
</ComponentName>
`,
}),
};
```
## Story with Decorators
```typescript
import type { Meta, StoryObj } from "@storybook/vue3";
import ComponentName from "./ComponentName.vue";
const meta: Meta<typeof ComponentName> = {
title: "Components/ComponentName",
component: ComponentName,
decorators: [
() => ({
template:
'<div style="padding: 2rem; background: #f5f5f5;"><story /></div>',
}),
],
};
export default meta;
type Story = StoryObj<typeof meta>;
```
## Story with Pinia
```typescript
import type { Meta, StoryObj } from "@storybook/vue3";
import { createPinia } from "pinia";
import ComponentName from "./ComponentName.vue";
const pinia = createPinia();
const meta: Meta<typeof ComponentName> = {
title: "Components/ComponentName",
component: ComponentName,
decorators: [
(story) => ({
components: { story },
setup() {
return { pinia };
},
template: "<story />",
}),
],
};
export default meta;
```
## Story with Play Function (Interactions)
```typescript
import type { Meta, StoryObj } from "@storybook/vue3";
import { within, userEvent, expect } from "@storybook/test";
import ComponentName from "./ComponentName.vue";
const meta: Meta<typeof ComponentName> = {
title: "Components/ComponentName",
component: ComponentName,
};
export default meta;
type Story = StoryObj<typeof meta>;
export const WithInteraction: Story = {
args: {
label: "Click me",
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const button = canvas.getByRole("button");
await userEvent.click(button);
await expect(button).toHaveFocus();
},
};
```
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |