Implement a Figma design change with before/after screenshot capture. Takes a GitHub issue or Figma URL, fetches the design, captures a "before" screenshot, implements the fix, captures an "after" screenshot, and prepares everything for PR. Usage: /implement-figma <issue-number-or-figma-url>
Instalación
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Implement a Figma design change with before/after screenshot capture. Takes a GitHub issue or Figma URL, fetches the design, captures a "before" screenshot, implements the fix, captures an "after" screenshot, and prepares everything for PR. Usage: /implement-figma <issue-number-or-figma-url>
Implement Figma Design Change
Implements a UI fix based on a Figma design with verified before/after screenshots.
Workflow Overview
1. Parse input (issue# or Figma URL)
2. Fetch Figma design (design reference only — NOT a screenshot substitute)
3. Capture BEFORE screenshot via PreviewActivity + ADB
4. Implement the code changes
5. Rebuild, capture AFTER screenshot via PreviewActivity + ADB
6. Save before/after PNGs for PR attachment
CRITICAL: Screenshot Rules
Before/After screenshots MUST be real Android renders — via PreviewActivity + ADB screencap on the emulator
Figma screenshots are NOT before/after screenshots — Figma is only a design reference to know what the target looks like
Never substitute a Figma screenshot for a before or after image — the whole point is showing the actual Android rendering changed
If real screenshots cannot be captured, the PR MUST clearly state this and request manual visual review on device
Step 1: Parse Input
If GitHub issue number: Read the issue to extract:
Figma node ID and link
Screen/component name
File path and line numbers
Expected vs actual values
gh issue view NUMBER --repo vultisig/vultisig-android
If Figma URL: Extract fileKey and nodeId from URL pattern:
figma.com/design/:fileKey/:fileName?node-id=:nodeId → convert - to : in nodeId
Save the Figma screenshot for PR reference (design target only).
Step 3: Capture BEFORE Screenshot
Primary Method: PreviewActivity + ADB (Preferred)
The project has a debug-only PreviewActivity at app/src/debug/java/com/vultisig/wallet/debug/PreviewActivity.kt that renders composable previews with mock data on a real device/emulator.
3a. Add a preview case for the target screen
Open PreviewActivity.kt and add a new when branch for the screen:
Create a @Composable preview function with realistic mock data:
@Composableprivatefun<ScreenName>Preview() {
// Build mock state with realistic valuesval state = <ScreenName>UiModel(
// ... fill in with representative data
)
<ScreenName>Screen(
state = state,
// ... provide no-op callbacks
)
}
Mock data guidelines:
Use real Coins.* objects (e.g., Coins.Ethereum.ETH, Coins.Bitcoin.BTC) for token data
Use realistic amounts and fiat values (e.g., "1.5 ETH", "$3,847.50")
Fill in all required fields — empty/default data makes screenshots useless for comparison
The inner stateless composable (not the Hilt one) must be internal visibility to be callable from the debug source set
3b. Build and install
./gradlew :app:installDebug
3c. Launch and capture
# Launch the preview
adb shell am start -n com.vultisig.wallet/.debug.PreviewActivity --es screen "<screen_name>"# Wait for render, then capturesleep 2
mkdir -p screenshots/before
adb shell screencap -p /sdcard/screenshot_before.png
adb pull /sdcard/screenshot_before.png screenshots/before/
Fallback: Direct ADB Navigation
If the screen is easy to reach in the running app (e.g., Settings, Home):
# Launch the app
adb shell am start -n com.vultisig.wallet/.app.activity.MainActivity
# Navigate via taps (use `adb shell uiautomator dump` to find element bounds)
adb shell uiautomator dump /sdcard/ui_dump.xml
adb pull /sdcard/ui_dump.xml /tmp/ui_dump.xml
# Parse bounds, then tap
adb shell input tap X Y
# Capturesleep 2
mkdir -p screenshots/before
adb shell screencap -p /sdcard/screenshot_before.png
adb pull /sdcard/screenshot_before.png screenshots/before/
Last Resort: No Emulator Available
If no emulator is running (adb devices shows no devices):
Do NOT use Figma screenshots as before/after — they are design references, not Android renders
Note clearly in the PR that real screenshots could not be captured
Provide a detailed text-based comparison table with exact values from code (before → after)
Add needs-visual-review label to the PR — a human must verify on device
Step 4: Implement the Code Changes
Read the target file and make the changes based on the Figma design context.
Implementation Checklist
Match exact hex colors from Figma (verify against theme tokens)
Match exact dp/sp values for spacing, sizing, typography
Match corner radii, border widths, opacity values
Use existing theme tokens where they map to Figma values (Theme.v2.colors.*, Theme.brockmann.*)
For colors not in theme, define as private val constants at top of file
Follow existing code patterns in the file
Do NOT change unrelated code
If string resources change, update ALL 9 locale files (en, de, es, hr, it, nl, pt, ru, zh-rCN)
Common Theme Token Mappings
// Check these files for token → hex mappings:// app/src/main/java/com/vultisig/wallet/ui/theme/V2Theme.kt// app/src/main/java/com/vultisig/wallet/ui/theme/BrockmannTheme.kt
Step 5: Capture AFTER Screenshot
Rebuild and reinstall:
./gradlew :app:installDebug
Launch PreviewActivity and capture (same screen name as before):