JohnWayneeee/ai-agent-skills / skills/figma-pencil-fsd-tailwind4
figma-pencil-fsd-tailwind4
VerifiedConvert Figma or Pencil designs into production-ready frontend code using Feature-Sliced Design and Tailwind CSS v4. Use when translating designs into code, extracting tokens, mapping UI to FSD layers (shared / entities / features / widgets / pages / app-shell / app), enforcing Server vs Client boundaries when applicable, or validating design-to-code fidelity.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.1 KB |
| references/accessibility-checklist.md | markdown | 2.8 KB |
| references/example-mapping.md | markdown | 4.2 KB |
| references/figma-mcp-workflow.md | markdown | 3.4 KB |
| references/fsd-mapping.md | markdown | 4.5 KB |
| references/pencil-workflow.md | markdown | 2.8 KB |
| references/project-contracts.md | markdown | 3.4 KB |
| references/rsc-boundaries.md | markdown | 2.9 KB |
| references/tailwind-tokens.md | markdown | 3.8 KB |
references/figma-mcp-workflow.md
View on GitHub# Figma MCP Workflow
Use Figma MCP to pull design context before generating code. Do not screenshot-translate: extract structure, variables, and components from the source.
## When this path applies
- The design lives in Figma and the project has Figma MCP configured.
- The user has selected a frame, component, or page in Figma.
- Code Connect mappings may or may not exist; both flows are supported.
## What to extract
In this order:
1. Selected node tree (frame, component, instance). Always work from a selection, not the whole file.
2. Local variables (color, number, string, boolean) and variable collections — these are the design tokens.
3. Component definitions and instances. Resolve instances back to the source component.
4. Code Connect mappings, if available. They override any inferred code mapping.
5. Layout primitives: auto layout direction, gap, padding, alignment, sizing rules (hug/fill/fixed).
6. Local assets exposed by MCP (image URLs, SVG payloads). Use them directly; do not invent placeholders.
## Before generating code
- Confirm scope: which frame, which screen, which component. Refuse to "translate the whole file".
- Produce a short plan: tokens to register, primitives to reuse, FSD layer for each block, states to cover.
- Reconcile variables with project tokens. Each Figma variable should map to an existing semantic token (see `tailwind-tokens.md`) or be flagged for design review. Do not silently add new tokens.
- Identify which Figma components correspond to existing primitives in the project's component library. Reuse them.
## Generation rules
- Auto layout → Flexbox utilities (`flex`, `gap-*`, `p-*`). Do not translate auto layout into absolute positioning.
- Constraints (fill/hug/fixed) → width/height utilities (`w-full`, `w-fit`, `w-[Npx]` only when truly fixed).
- Variable references → semantic Tailwind utilities (`bg-surface`, `text-foreground`), never the raw hex/oklch from the variable's current value.
- Text styles → typography utilities tied to tokens (`text-sm font-medium leading-tight`), not raw `font-size` literals.
- Effects (shadow, blur) → token-backed utilities when the design system defines them; arbitrary values only as last resort.
- Local image assets → consume the MCP-provided URL or import path. Never invent placeholder URLs.
## Responsive intent
Figma frames are usually a single breakpoint. Before coding:
- Ask which breakpoints the design covers (mobile / tablet / desktop, or named breakpoints).
- If only one breakpoint is provided, code that breakpoint and stub responsive behavior with documented assumptions (e.g. "stack on `<md`, side-by-side on `md+`"). Do not invent unverified responsive rules.
## What the generated code should reflect
- Layer structure that mirrors the Figma component hierarchy where reasonable.
- Spacing, sizing, and alignment driven by auto layout values.
- Colors, radii, typography sourced from variables → tokens.
- Reuse of project components in place of re-implemented primitives.
- Documented assumptions where the design is ambiguous.
## Anti-patterns
- Translating one Figma frame into a single monolithic component without FSD decomposition.
- Copying raw hex values when a variable was attached to the layer.
- Producing placeholder images when MCP returned the real asset.
- Marking the entire generated tree as a client component because one button is interactive.
- Inventing tokens from one-off Figma layer styles.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |