figma-to-flutter
This skill should be used when converting Figma designs to Flutter code. Trigger this skill when users say "convert this Figma design to Flutter", "run Figma workflow", "implement this Figma screen", or provide Figma links requesting Flutter UI implementation. The skill handles the complete workflow from extracting Figma metadata to implementing pixel-perfect Flutter UIs with iterative testing.
What this skill does
# Figma to Flutter Workflow
## Overview
Convert Figma designs into Flutter code through an automated workflow that extracts design metadata, generates reference code, exports assets, implements the UI, and iteratively tests until the implementation matches the design pixel-perfectly.
## When to Use This Skill
Trigger this workflow when users:
- Provide Figma design links and request Flutter implementation
- Say "convert this Figma design to Flutter code"
- Say "run Figma workflow" or "trigger flutter ui workflow"
- Say "implement this Figma screen"
- Request UI implementation from Figma designs
## Workflow Process
### Step 1: Preparation
#### Determine Feature Name
If not provided by the user, infer the feature name from:
- Branch name
- Conversation context
- Design content
- User's working directory
Ask the user if unclear.
#### Set Up Workspace Directory
Create the workspace structure at git repository root:
```bash
mkdir -p .ui-workspace/$FEATURE/{figma_screenshots,figma_images,figma_code,app_screenshots}
```
Ensure `.ui-workspace/` is in `.git/info/exclude`:
```bash
grep -q "^\.ui-workspace/$" .git/info/exclude || echo ".ui-workspace/" >> .git/info/exclude
```
#### Verify API Server
Check if the Figma API server is running:
```bash
curl -s http://localhost:3001/health
```
If server is not running, set it up (one-time):
```bash
# Check if already cloned
if [ ! -d ~/Documents/figma-api ]; then
mkdir -p ~/Documents
git clone https://github.com/prateekmedia/FigmaToCode-RestApi ~/Documents/figma-api
echo "API server cloned. Please follow ~/Documents/figma-api/README to install dependencies and start the server."
else
echo "API server exists but not running. Please start it: cd ~/Documents/figma-api && [start command from README]"
fi
```
Wait for user to start the server before proceeding.
### Step 2: Extract Figma Metadata
#### Analyze Asset Requirements First
Before making API calls, analyze the app's asset structure to determine which scales to download:
1. Check `assets/` directory structure
2. Search for `Image.asset` calls to identify scale parameters
3. Determine which scales are actually needed
See **Step 3: Asset Management** for detailed analysis instructions.
#### Run API Calls
Execute both API calls **in parallel** to extract all metadata from the Figma design.
**Screenshot API**:
```bash
curl -X POST http://localhost:3001/api/screenshot \
-H "Content-Type: application/json" \
-d "{
\"url\": \"$FIGMA_URL\",
\"format\": \"png\",
\"scale\": 2,
\"saveToFile\": true,
\"directory\": \".ui-workspace/$FEATURE/figma_screenshots\"
}"
```
**Convert API** (customize `scales` based on asset analysis):
```bash
# Default: Download all scales
curl -X POST http://localhost:3001/api/convert \
-H "Content-Type: application/json" \
-d "{
\"url\": \"$FIGMA_URL\",
\"settings\": {
\"framework\": \"Flutter\"
},
\"exportImages\": true,
\"exportImagesOptions\": {
\"scales\": [\"1x\", \"2x\", \"3x\", \"4x\"],
\"directory\": \".ui-workspace/$FEATURE/figma_images\"
},
\"output\": {
\"saveToFile\": true,
\"directory\": \".ui-workspace/$FEATURE/figma_code\"
}
}"
```
**Customize scales**: Modify the `scales` array based on your analysis (e.g., `[\"2x\", \"3x\"]` if app only uses those).
**Results**:
- Design screenshot: `.ui-workspace/$FEATURE/figma_screenshots/`
- Generated Flutter code: `.ui-workspace/$FEATURE/figma_code/`
- Exported assets: `.ui-workspace/$FEATURE/figma_images/{requested_scales}/`
### Step 3: Implementation
#### Review Reference Materials
Examine the extracted materials:
1. **Figma screenshot**: Visual reference for the design
2. **Generated code**: Reference for text styles, dimensions, colors, layout
3. **Assets**: Images to integrate into the app
#### Implement Flutter UI
Using the reference materials:
**Text Styles**: Extract font families, sizes, weights, and colors from generated code
**Layout**: Reference container dimensions, padding, margins, and widget hierarchy
**Colors**: Use exact hex values from the design
**Spacing**: Match padding, margin, and gap values
**Important**: Write proper Flutter code following app conventions. Do not copy generated code directly—use it as a reference.
#### Asset Management
**1. Analyze Existing Asset Structure**
Before downloading or copying assets, examine the app's current asset organization:
- Check if `assets/` directory exists and how it's structured
- Identify the scaling strategy used in the codebase:
- **Multi-directory approach**: Separate directories for each scale (e.g., `assets/`, `assets/2x/`, `assets/3x/`, `assets/4x/`)
- **Single directory with scale parameter**: Single `assets/` directory with explicit `scale` parameter in `Image.asset()` calls
- **No standard structure**: May need to establish one
**2. Determine Required Asset Scales**
Based on the analysis:
- **If multi-directory structure exists**: Check which scale directories are present (e.g., only `assets/2x/` and `assets/3x/`)
- **If using scale parameter**: Search for `Image.asset` calls to identify what scale values are used (e.g., `scale: 4`)
- **If no standard exists**: Default to downloading 3x scale assets
Only download the scales actually needed by the app to avoid unnecessary files.
**3. Download Required Scales from API**
Modify the Convert API call to download only necessary scales:
```bash
# Example: If app uses only 2x and 3x
curl -X POST http://localhost:3001/api/convert \
-H "Content-Type: application/json" \
-d "{
\"url\": \"$FIGMA_URL\",
\"settings\": {\"framework\": \"Flutter\"},
\"exportImages\": true,
\"exportImagesOptions\": {
\"scales\": [\"2x\", \"3x\"],
\"directory\": \".ui-workspace/$FEATURE/figma_images\"
},
\"output\": {
\"saveToFile\": true,
\"directory\": \".ui-workspace/$FEATURE/figma_code\"
}
}"
```
**4. Identify Required Assets**
Review generated code to find referenced image assets.
**5. Copy and Rename Assets**
Copy assets from `.ui-workspace/$FEATURE/figma_images/` following the app's existing structure:
**Multi-directory structure**:
```bash
# Copy to matching scale directories
cp .ui-workspace/$FEATURE/figma_images/2x/asset.png assets/2x/new_name.png
cp .ui-workspace/$FEATURE/figma_images/3x/asset.png assets/3x/new_name.png
```
**Single directory with scale parameter**:
```bash
# Copy only the required scale (e.g., 4x)
cp .ui-workspace/$FEATURE/figma_images/4x/asset.png assets/new_name.png
# Then use: Image.asset('assets/new_name.png', scale: 4)
```
**No standard structure**:
```bash
# Default to 3x scale in single directory
cp .ui-workspace/$FEATURE/figma_images/3x/asset.png assets/new_name.png
# Use with explicit scale: Image.asset('assets/new_name.png', scale: 3)
```
Rename assets to meaningful names using snake_case (e.g., `profile_avatar.png`, `feed_background.png`).
**6. Create Asset Mapping**
Maintain `.ui-workspace/$FEATURE/figma_images/mapping.json`:
```json
{
"123:456_user_avatar.png": "assets/profile_avatar.png",
"789:012_background.png": "assets/feed_background.png"
}
```
**7. Update pubspec.yaml**
Ensure assets are declared according to the app's structure:
**Multi-directory**:
```yaml
flutter:
assets:
- assets/
- assets/2x/
- assets/3x/
```
**Single directory**:
```yaml
flutter:
assets:
- assets/
```
### Step 4: Testing
#### Create Golden Tests
Write golden tests to capture widget screenshots:
```dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('FeatureName screen golden test', (WidgetTester tester) async {
// Set device size to match Figma design
await tester.binding.setSurfaceSize(Size(375, 812)); // Example: iPhone X
await tester.pumpWidget(
MaterialApp(
home: YourImplementedScreen(),
),
);
await expectLater(
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.