analytics-metrics
Build data visualization and analytics dashboards. Use when creating charts, KPI displays, metrics dashboards, or data…
Integrate with Figma API for design automation and code generation. Use when extracting design tokens, generating React/CSS code from Figma components, syncing design systems, building Figma plugins, or automating design-to-code workflows. Triggers on Figma API, design tokens,
Claude Code
$ npx -y skills add hoodini/ai-agents-skills --skill figma --agent claude-code
Codex
$ npx skills add hoodini/ai-agents-skills --skill figma -a codex -y
Cursor
$ npx skills add hoodini/ai-agents-skills --skill figma -a cursor -y
Gemini CLI
$ npx skills add hoodini/ai-agents-skills --skill figma -a gemini-cli -y
GitHub Copilot
$ npx skills add hoodini/ai-agents-skills --skill figma -a github-copilot -y
OpenCode
$ npx skills add hoodini/ai-agents-skills --skill figma -a opencode -y
Windsurf
$ npx skills add hoodini/ai-agents-skills --skill figma -a windsurf -y
name: figma description: Integrate with Figma API for design automation and code generation. Use when extracting design tokens, generating React/CSS code from Figma components, syncing design systems, building Figma plugins, or automating design-to-code workflows. Triggers on Figma API, design tokens, Figma plugin, design-to-code, Figma export, Figma component, Dev Mode.
Extract design data, generate code from components, and automate design workflows with Figma's API.
const FIGMA_TOKEN = process.env.FIGMA_TOKEN;
const headers = {
'X-Figma-Token': FIGMA_TOKEN
};
// Get file
const response = await fetch(
`https://api.figma.com/v1/files/${FILE_KEY}`,
{ headers }
);// Extract from Figma URL: figma.com/file/FILE_KEY/Name?node-id=NODE_ID
const figmaUrl = 'https://www.figma.com/file/abc123/MyDesign?node-id=1%3A2';
const fileKey = figmaUrl.match(/file\/([^/]+)/)?.[1]; // abc123
const nodeId = new URL(figmaUrl).searchParams.get('node-id'); // 1:2// Full file GET https://api.figma.com/v1/files/:file_key // Specific nodes (components) GET https://api.figma.com/v1/files/:file_key/nodes?ids=1:2,1:3 // With geometry for SVG paths GET https://api.figma.com/v1/files/:file_key?geometry=paths // With plugin data GET https://api.figma.com/v1/files/:file_key?plugin_data=shared
// Get all components in a file GET https://api.figma.com/v1/files/:file_key/components // Get component sets (variants) GET https://api.figma.com/v1/files/:file_key/component_sets // Get team's published components GET https://api.figma.com/v1/teams/:team_id/components
// Export nodes as images
GET https://api.figma.com/v1/images/:file_key?ids=1:2,1:3&format=png&scale=2
// Export as SVG
GET https://api.figma.com/v1/images/:file_key?ids=1:2&format=svg
// Response
{
"images": {
"1:2": "https://s3.amazonaws.com/...",
"1:3": "https://s3.amazonaws.com/..."
}
}interface FigmaNode {
id: string;
name: string;
type: string;
children?: FigmaNode[];
absoluteBoundingBox?: { x: number; y: number; width: number; height: number };
fills?: Fill[];
strokes?: Stroke[];
effects?: Effect[];
cornerRadius?: number;
paddingLeft?: number;
paddingRight?: number;
paddingTop?: number;
paddingBottom?: number;
itemSpacing?: number;
layoutMode?: 'HORIZONTAL' | 'VERTICAL' | 'NONE';
primaryAxisAlignItems?: string;
counterAxisAlignItems?: string;
characters?: string;
style?: TextStyle;
}
async function getComponentCode(fileKey: string, nodeId: string): Promise<string> {
const response = await fetch(
`https://api.figma.com/v1/files/${fileKey}/nodes?ids=${nodeId}`,
{ headers: { 'X-Figma-Token': process.env.FIGMA_TOKEN! } }
);
const data = await response.json();
const node = data.nodes[nodeId].document;
return generateReactComponent(node);
}
function generateReactComponent(node: FigmaNode): string {
const componentName = toPascalCase(node.name);
const styles = extractStyles(node);
const children = node.children?.map(child => generateJSX(child)).join('\n') || '';
return `
import React from 'react';
export function ${componentName}() {
return (
<div style={${JSON.stringify(styles, null, 2)}}>
${children}
</div>
);
}
`;
}
function extractStyles(node: FigmaNode): React.CSSProperties {
const styles: React.CSSProperties = {};
// Dimensions
if (node.absoluteBoundingBox) {
styles.width = node.absoluteBoundingBox.width;
styles.height = node.absoluteBoundingBox.height;
}
// Background
if (node.fills?.length) {
const fill = node.fills.find(f => f.visible !== false && f.type === 'SOLID');
if (fill?.color) {
styles.backgroundColor = rgbaToHex(fill.color);
}
}
// Border radius
if (node.cornerRadius) {
styles.borderRadius = node.cornerRadius;
}
// Padding
if (node.paddingLeft) styles.paddingLeft = node.paddingLeft;
if (node.paddingRight) styles.paddingRight = node.paddingRight;
if (node.paddingTop) styles.paddingTop = node.paddingTop;
if (node.paddingBottom) styles.paddingBottom = node.paddingBottom;
// Flexbox (Auto Layout)
if (node.layoutMode && node.layoutMode !== 'NONE') {
styles.display = 'flex';
styles.flexDirection = node.layoutMode === 'HORIZONTAL' ? 'row' : 'column';
styles.gap = node.itemSpacing;
// Alignment
const alignMap: Record<string, string> = {
'MIN': 'flex-start',
'CENTER': 'center',
'MAX': 'flex-end',
'SPACE_BETWEEN': 'space-between',
};
if (node.primaryAxisAlignItems) {
styles.justifyContent = alignMap[node.primaryAxisAlignItems] || 'flex-start';
}
if (node.counterAxisAlignItems) {
styles.alignItems = alignMap[node.counterAxisAlignItems] || 'flex-start';
}
}
return styles;
}
function generateJSX(node: FigmaNode): string {
const styles = extractStyles(node);
if (node.type === 'TEXT') {
return `<span style={${JSON.stringify(styles)}}>${node.characters || ''}</span>`;
}
if (node.type === 'VECTOR' || node.type === 'BOOLEAN_OPERATION') {
return `{/* Vector: ${node.name} - export as SVG */}`;
}
const children = node.children?.map(child => generateJSX(child)).join('\n') || '';
return `<div style={${JSON.stringify(styles)}}>${children}</div>`;
}function figmaToTailwind(node: FigmaNode): string {
const classes: string[] = [];
// Dimensions
if (node.absoluteBoundingBox) {
const { width, height } = node.absoluteBoundingBox;
classes.push(`w-[${Math.round(width)}px]`, `h-[${Math.round(height)}px]`);
}
// Background color
if (node.fills?.length)🧠 AI Agent Skills Repository - A curated collection of specialized skills for AI coding agents (Claude Code, GitHub Copilot, Cursor, Windsurf). Created by Yuval Avidani using GitHub Copilot via VS Code Insiders.
Build data visualization and analytics dashboards. Use when creating charts, KPI displays, metrics dashboards, or data…
Manage AWS accounts, organizations, IAM, and billing. Use when setting up AWS Organizations, managing IAM policies, controlling…
Build a new AI agent on AWS and deploy it easily, OR wrap and deploy an agent you already have, using the Amazon Bedrock…
Build AI agents with the Strands Agents SDK - the open-source framework (the agent "brain") for writing agent logic, tools, and…
Build fast applications with Bun JavaScript runtime. Use when creating Bun projects, using Bun APIs, bundling, testing, or…
Build a premium cinematic landing page with mouse-scrub video hero and brand-driven narrative-arc sections. Use whenever the user…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.