/prototyping:storybook-bridgefrom Prototyping
Converts component-playground demo pages to Storybook 7+ CSF3 stories. Includes a converter script for data.json and Storybook setup instructions.
Ships in Prototyping. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
component-playground — самописный demo-pageset. Storybook — стандарт. Этот скилл — мост: компоненты → CSF3 stories.
// Button.stories.js
import { Button } from './Button';
export default {
title: 'Inputs/Button',
component: Button,
argTypes: {
variant: { control: 'select', options: ['primary', 'secondary', 'ghost'] },
size: { control: 'select', options: ['sm', 'md', 'lg'] },
disabled:{ control: 'boolean' },
},
};
export const Primary = { args: { variant: 'primary', label: 'Click me' } };
export const Secondary = { args: { variant: 'secondary', label: 'Secondary' } };
export const Loading = { args: { variant: 'primary', loading: true, label: 'Loading...' } };
component-playground хранит описание в data.json. Скрипт:
import fs from 'node:fs/promises';
import path from 'node:path';
const data = JSON.parse(await fs.readFile('data.json', 'utf8'));
const outDir = 'stories';
await fs.mkdir(outDir, { recursive: true });
for (const [group, items] of Object.entries(data.groups)) {
for (const it of items) {
if (!it.props) continue;
const argTypes = {};
const args = {};
for (const [name, spec] of Object.entries(it.props)) {
if (spec.type === 'select') {
argTypes[name] = { control: 'select', options: spec.options };
args[name] = spec.options[0];
} else if (spec.type === 'bool') {
argTypes[name] = { control: 'boolean' };
args[name] = false;
} else {
argTypes[name] = { control: 'text' };
args[name] = spec.default || '';
}
}
const componentName = it.name.replace(/\s+/g, '');
const file = `${outDir}/${componentName}.stories.js`;
const code = `
import { ${componentName} } from '../components/${componentName}';
export default {
title: '${group}/${it.name}',
component: ${componentName},
argTypes: ${JSON.stringify(argTypes, null, 2)},
};
export const Default = { args: ${JSON.stringify(args, null, 2)} };
${(it.variants || []).map(v => `
export const ${v.name.replace(/\s+/g,'')} = { args: ${JSON.stringify({ ...args, ...v.args }, null, 2)} };
`).join('')}
`;
await fs.writeFile(file, code.trim());
console.log('✓', file);
}
}
npx storybook@latest init
Storybook сам определит React/Vue/Web Components, подсунет нужный builder.
src/
components/
Button.jsx
Card.jsx
stories/
Button.stories.js
Card.stories.js
index.css ← твои tokens.css
.storybook/
main.js
preview.js ← импорт tokens.css
preview.js:
import '../src/index.css';
export default {
parameters: {
backgrounds: {
values: [
{ name: 'light', value: '#fff' },
{ name: 'dark', value: '#0d0d0d' },
],
default: 'light',
},
},
};
real-data скилл) — Storybook isolated, тащить туда настоящие fetch'и обычно нельзя. Замени на mock'и через MSW.controls). Используй её, не свою.Если у вас нет компонентов в JS, но есть design tokens — Storybook может показывать их как documentation. Используй @storybook/addon-themes или собственный story:
// Tokens.stories.mdx
# Color tokens
<div style="display:grid; grid-template-columns: repeat(5, 1fr); gap: 8px;">
<div style="background: var(--primary-500); padding: 16px; color: white">primary 500</div>
...
</div>
Иначе — component-playground достаточно.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
12 skills in this plugin
/canvas-designОригинальный визуальный арт в PNG/PDF: постеры, обложки, композиции. Триггеры: «сделай постер», «нарисуй обложку». НЕ сравнение макетов → design-canvas./claude-in-htmlВызов LLM прямо из HTML-артефакта — прототипы с живой AI-фичей: чат, саммари, классификация. Триггеры: «встрой Claude в HTML», «AI inside prototype»./component-playgroundStorybook-подобная страница: все компоненты дизайн-системы во всех вариантах, контролы пропсов. Триггеры: «storybook страница», «all states UI».npx claudepluginhub jhamidun/claude-code-config-pack --plugin prototypingOther plugins' skills for the same job