Skip to main content
ClaudeWave
Skill58 repo starsupdated 2mo ago

figma-design

Figma design-to-code workflows, design token extraction, component inspection, and asset export. Use when translating Figma designs into code, extracting design tokens, or referencing component specs.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/monkilabs/opencastle /tmp/figma-design && cp -r /tmp/figma-design/src/orchestrator/plugins/figma ~/.claude/skills/figma-design
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

<!-- ⚠️ This file is managed by OpenCastle. Edits will be overwritten on update. Customize in the .opencastle/ directory instead. -->

# Figma Design

For project-specific design system details, see the **frontend-design** skill.

## MCP Tools

| Tool | Purpose |
|------|---------|
| `figma/get_file` | Retrieve full Figma file structure |
| `figma/get_file_nodes` | Get specific nodes/frames |
| `figma/get_images` | Export nodes as images |
| `figma/get_comments` | Read design review comments |
| `figma/get_styles` | Extract color/text/effect styles |
| `figma/get_components` | List reusable components |

### Example MCP invocations

```json
// figma/get_file — full file structure
{ "file_key": "a1b2C3d4E5", "depth": 2 }
// figma/get_file_nodes — specific frames
{ "file_key": "a1b2C3d4E5", "node_ids": ["123:45"] }
// figma/get_images — export as PNG at 2x
{ "file_key": "a1b2C3d4E5", "ids": ["123:45"], "format": "png", "scale": 2 }
```

## Design-to-Code Workflow

1. **Identify the frame** — obtain the Figma file key or node ID from the task input.
2. **Inspect nodes** — call `figma/get_file_nodes` for the target node IDs and extract bounding boxes, fills, text styles, and auto-layout info.
3. **Extract tokens** — map returned styles to token files (colors, typography, spacing) and commit tokens to `src/styles/tokens.css` or a token JSON.
4. **Implement component** — scaffold a framework component that consumes tokens and matches layout properties (gap, padding, width). Import tokens (CSS variables or JSON) and attach a `data-testid` for programmatic verification.

```tsx
// src/components/ui/Card.tsx — consumes tokens, matches Figma layout
import '../styles/tokens.css';
interface CardProps { title: string; description?: string }
export function Card({ title, description }: CardProps) {
  return (
    <div data-testid="card" className="card">
      <span className="card-title">{title}</span>
      {description && <p>{description}</p>}
    </div>
  );
}
```
5. **Verify programmatically** — run a visual diff or DOM-attribute check:
  - Render in Storybook and compare DOM bounding boxes against Figma node metrics.
  - Acceptance: differences <= 4px for spacing and matching token colors; fonts must match family and weight.
6. **Feedback loop** — if implementation deviates beyond thresholds, update token mapping or request design clarification and repeat from step 2.

See REFERENCE.md for a verification script and Figma→CSS translation rules.
astro-frameworkSkill

Creates pages/layouts, defines content collections, configures hydration directives, and wires integrations. Use when adding or modifying Astro pages, layouts, components, or content collections. Trigger terms: Astro, content collection, client:load, client:visible, astro:content

browser-testingSkill

Drive real browsers via Chrome DevTools MCP: navigate pages, capture snapshots, run responsive checks, and collect console/perf traces. Use when the user mentions: 'validate UI change in Chrome', 'capture a screenshot', 'run responsive checks', or 'collect console logs'. Trigger terms: browser testing, DevTools, console logs, screenshot, responsive testing

cloudflare-platformSkill

Creates and deploys Cloudflare Workers, configures wrangler.toml bindings, sets up KV/D1/R2 storage and Durable Objects, manages Pages deployments, and implements edge function patterns. Use when building or deploying Cloudflare Workers, setting up Pages, working with KV/D1/R2 storage, configuring wrangler.toml, or deploying edge applications.

contentful-cmsSkill

Creates Contentful content types, queries entries via GraphQL/REST, runs CLI migrations, and manages assets and locales. Use when building or modifying Contentful content models, writing queries, or migrating content.

convex-databaseSkill

Convex reactive database patterns, schema design, real-time queries, mutations, actions, authentication, migrations, performance optimization, and component creation. Use when designing Convex schemas, writing queries/mutations, managing the Convex backend, setting up auth, migrating data, optimizing performance, or building Convex components.

coolify-deploymentSkill

Deploys applications, databases, and services on self-hosted Coolify instances, manages environments and env vars, runs infrastructure diagnostics, and performs batch operations. Use when deploying apps to Coolify, managing Coolify servers, debugging deployment issues, setting up databases, or managing Coolify infrastructure.

cypress-testingSkill

Writes Cypress E2E/component tests, configures `cy.intercept()` and `cy.session()`, authors custom commands, and wires CI artifacts. Use when creating E2E specs, component tests, or CI test pipelines. Trigger terms: cypress, e2e, component test, cy.intercept, cy.session

drizzle-ormSkill

Drizzle ORM schema definition, type-safe queries, relational queries, CRUD operations, transactions, migrations with drizzle-kit, and database setup for PostgreSQL, MySQL, and SQLite. Use when defining database schemas, writing queries or joins, managing migrations, setting up a new Drizzle project, or working with drizzle-kit.