一键导入
figma2compose
Converts Figma MCP design data into production-ready Jetpack Compose UI components for Android with strict spec fidelity and no guesswork.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Converts Figma MCP design data into production-ready Jetpack Compose UI components for Android with strict spec fidelity and no guesswork.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | figma2compose |
| description | Converts Figma MCP design data into production-ready Jetpack Compose UI components for Android with strict spec fidelity and no guesswork. |
| model | inherit |
Generate Jetpack Compose UI from Figma by reading exact design data from the Figma MCP server, then converting that data into Android-ready composables without inventing missing values.
Use this skill when:
Do not use this skill for:
This skill exists to produce Compose code that is traceable to Figma data.
Non-negotiable rules:
If a value is missing from Figma MCP output, state that it is missing and ask for clarification instead of inventing it.
Read these files only as needed:
references/figma-api-patterns.md for MCP tool calling and URL parsing rules.references/compose-conversion-rules.md for token-to-Compose mapping.references/compliance-checklist.md for validation criteria.scripts/compliance-calculator.py after generation to score the result.Before touching Figma:
Minimum audit targets:
ui/, designsystem/, components/, theme/, feature/*/ui/TopAppBar, Scaffold, status bar handling, image loaders, button variants, and typography definitionsExtract:
fileKeynode-idCritical rule:
node-id=29434-39340129434:393401get_variable_defs(node_url)
get_design_context(node_url, framework="Android/Compose")
get_metadata(node_url)
get_screenshot(node_url)
get_code_connect_map(node_url)
If MCP fails, fall back to direct API only when the environment and task allow it. Follow references/figma-api-patterns.md.
Before writing Compose code, summarize the verified design inputs in a compact markdown block or file:
## Figma Design Spec
Component: PaymentSummaryCard
Node ID: 29434:393401
Colors
- surface: rgba(245, 245, 245, 1.0) -> Color(0xFFF5F5F5)
- title: rgba(51, 51, 51, 1.0) -> Color(0xFF333333)
Typography
- title: 17px / 700 / 22.95px
- body: 15px / 500 / 21px
Layout
- padding: 20px
- gap: 10px
- cornerRadius: 4px
This step prevents silent drift between fetched design data and generated code.
Preferred structure:
ComponentNameColorsComponentNameTypographyComponentNameDimensionsImplementation rules:
Color(0xAARRGGBB).sp and FontWeight values from Figma.statusBarsPadding(), navigationBarsPadding(), or safeDrawingPadding() over brittle hardcoded spacer heights.Example:
private object PaymentSummaryCardDimensions {
val contentPadding = 20.dp
val rowGap = 10.dp
val cornerRadius = 4.dp
}
Run the compliance script when you have:
Example:
python figma2compose/scripts/compliance-calculator.py \
--figma-spec payment-summary-card.json \
--compose-impl PaymentSummaryCard.kt \
--output payment-summary-card-compliance.md
Expected outcome:
>= 95%rgba(0, 116, 196, 1.0) -> Color(0xFF0074C4)
TextStyle(
fontSize = 17.sp,
fontWeight = FontWeight.Bold,
lineHeight = 22.95.sp
)
private object CardDimensions {
val imagePadding = 10.dp
val imageWidth = 72.dp
val imageGap = 10.dp
val dividerStartPadding = imagePadding + imageWidth + imageGap
}
Column(
modifier = Modifier
.fillMaxSize()
.statusBarsPadding()
)
Avoid this:
Spacer(modifier = Modifier.height(52.dp))
node-id was normalized from - to :.The final result should give the user:
If exact parity cannot be achieved because data is missing from Figma or the target app has architectural constraints, state that explicitly and isolate the unresolved fields.
Analyzes existing project architecture, detects technology stack, identifies structural strengths and gaps, and produces a structured report with actionable recommendations. Use when asked to review architecture, audit a codebase, evaluate design decisions, or onboard to an unfamiliar project. Triggers on "review architecture", "audit codebase", "analyze project structure", "what's wrong with this project", "architecture report".
Expert in code design standards including SOLID principles, Clean Code patterns (KISS, YAGNI, DRY, TDA), and pragmatic software design. **ALWAYS use when designing ANY classes/modules, implementing features, fixing bugs, refactoring code, or writing functions.** Use proactively to ensure proper design, separation of concerns, simplicity, and maintainability. Examples - "create class", "design module", "implement feature", "refactor code", "fix bug", "is this too complex", "apply SOLID", "keep it simple", "avoid over-engineering".
Expert SQL query writing, optimization, and database schema design with support for PostgreSQL, MySQL, SQLite, and SQL Server. Use when working with databases for: (1) Writing complex SQL queries with joins, subqueries, and window functions, (2) Optimizing slow queries and analyzing execution plans, (3) Designing database schemas with proper normalization, (4) Creating indexes and improving query performance, (5) Writing migrations and handling schema changes, (6) Debugging SQL errors and query issues
Kotlin modern patterns, coroutines, Clean Architecture, Compose, Hilt, and Material Design 3 for Android and KMP. Use when building, reviewing, or auditing Android/KMP apps. Triggers on "Kotlin", "Android", "Compose", "coroutine", "Hilt", "Room", "MVVM", "MVI", "Clean Architecture".
Kotlin testing patterns for Android and KMP — JUnit 5, Kotest, MockK, Coroutines Test, Turbine, Espresso, Compose Testing, and UIAutomator. Use when authoring, refactoring, or debugging tests. Triggers on "test", "MockK", "Espresso", "Compose test", "runTest", "Turbine", "Kotest", "coverage".
SwiftUI modern patterns, Swift 6.3+ concurrency, SwiftData, security, and HIG-compliant design. Use when building, reviewing, or auditing iOS/macOS apps. Triggers on "SwiftUI", "SwiftData", "View", "async/await", "actor", "@Observable", "iOS app", "Figma to SwiftUI".