.claude/skills/create-component/SKILL.md
Generate React components with Tailwind CSS classes and Storybook stories from a natural language description. Use when user says "create component", "make a component", "build a component", "new component", or describes a UI element they want to create.
npx skillsauth add TETRA2000/figma-web-studio create-componentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
repository or local (default: ask user)When the user provides a reference URL (or mentions a website they want to base the design on):
playwright-cli open {referenceUrl}
playwright-cli screenshot --filename=reference-design.png
playwright-cli snapshot --filename=reference-structure.yaml
playwright-cli screenshot {ref} --filename=reference-element.png
playwright-cli close
Use the captured screenshot and structure as design inspiration — adapt the visual style (colors, spacing, typography, layout patterns) to the project's Tailwind theme tokens rather than copying arbitrary values.
shared/references/component-registry.md for existing componentsshared/references/tailwind-theme.md for available design tokensshared/references/figma-compat-rules.md for validation rulesIf scope not specified, ask the user:
src/components/{Name}/ (committed to Git)src/components/_local/{Name}/ (Git-ignored)Create two files:
{Name}.tsxHTMLAttributes or specific element interface{Name}.stories.tsx@storybook/reactMeta and StoryObj typessatisfies Meta<typeof Component> patternScan the generated TSX for prohibited patterns:
[#...], [url(...)], [13px]absolute, fixed, stickyanimate-, transition- (except transition-colors)before:, after: for layoutsm:, md:, lg:-m-*Report findings as warnings. Do NOT block creation.
docs/components.md (repository) or docs/_local/components.md (local)shared/references/component-registry.mdFormat for component index:
## {Name}
- **Path**: `src/components/{Name}/`
- **Description**: {description}
- **Props**: {prop list}
- **Variants**: {variant list}
- **Figma**: —
playwright-cli to capture a screenshot if availableReport:
User: "Create a Card component with a title, description, image, and optional footer. Support outlined and filled variants."
Creates:
src/components/Card/Card.tsx — React component with Tailwindsrc/components/Card/Card.stories.tsx — Storybook storiesdocs/components.md and component registryUser: "Create a pricing card component like the ones on https://stripe.com/pricing"
Captures the reference website via playwright-cli, then creates:
src/components/PricingCard/PricingCard.tsx — Inspired by Stripe's card design, adapted to project themesrc/components/PricingCard/PricingCard.stories.tsx — Storybook storiesdocs/components.md and component registrydevelopment
Fetch current Figma design state and apply changes back to React code. Use when user says "sync from Figma", "pull Figma changes", "update from Figma", "apply Figma changes", or wants to bring Figma edits into code.
tools
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
testing
Import an exported project archive, placing assets into the correct directories. Use when user says "import project", "import bundle", "import package", "unpack project", or has a .tar.gz archive to import.
tools
Push React components and pages to Figma using the Figma MCP server. Use when user says "export to Figma", "push to Figma", "create Figma design", "send to Figma", or wants to create a Figma design from code.