makepad-screenshot
npx skills add https://github.com/zhanghandong/makepad-component --skill makepad-screenshot
Agent 安装分布
Skill 文档
Makepad Screenshot Skill
Automated screenshot debugging for Makepad GUI applications
Trigger Words
/screenshot– Capture current running Makepad app/screenshot <app-name>– Capture specific app/run-and-capture <package>– Build, run and capture- “æªå¾”, “ççUI”, “æ¥çç颔, “capture makepad”
Features
Automates visual debugging workflow for Makepad apps:
- Bring app window to front
- Capture screenshot
- Analyze screenshot with Read tool
- Report UI issues or confirm correct rendering
Usage
1. Capture Current Running App
/screenshot
Auto-detects and captures windows containing “makepad” or current project name.
2. Capture Specific App
/screenshot a2ui-demo
Captures app with window name containing “a2ui”.
3. Build, Run and Capture
/run-and-capture a2ui-demo
Full workflow: cargo build â cargo run â wait for startup â capture.
Implementation Steps
Step 1: Detect Running App
# Find Makepad-related processes
ps aux | grep -E "(makepad|cargo.*run)" | grep -v grep
Step 2: Bring Window to Front (macOS)
# Generic pattern - match by process name
osascript -e 'tell application "System Events" to set frontmost of (first process whose name contains "APP_NAME") to true'
# Example
osascript -e 'tell application "System Events" to set frontmost of (first process whose name contains "a2ui") to true'
Step 3: Capture to Scratchpad
# Silent capture (-x suppresses shutter sound)
screencapture -x $SCRATCHPAD/screenshot.png
Step 4: View with Read Tool
Read $SCRATCHPAD/screenshot.png
Claude’s Read tool supports image files and can directly analyze screenshot content.
Complete Automation Script
Capture Current App
APP_NAME="${1:-makepad}"
SCRATCHPAD="${SCRATCHPAD_DIR:-/tmp}"
SCREENSHOT="$SCRATCHPAD/makepad_screenshot_$(date +%H%M%S).png"
# Bring to front
osascript -e "tell application \"System Events\" to set frontmost of (first process whose name contains \"$APP_NAME\") to true" 2>/dev/null
sleep 0.5
# Capture
screencapture -x "$SCREENSHOT"
echo "$SCREENSHOT"
Build, Run and Capture
PACKAGE="$1"
SCRATCHPAD="${SCRATCHPAD_DIR:-/tmp}"
SCREENSHOT="$SCRATCHPAD/${PACKAGE}_$(date +%H%M%S).png"
# Kill old process
pkill -f "$PACKAGE" 2>/dev/null
# Build and run
cargo build -p "$PACKAGE" && \
(cargo run -p "$PACKAGE" 2>&1 &) && \
sleep 5 && \
osascript -e "tell application \"System Events\" to set frontmost of (first process whose name contains \"$PACKAGE\") to true" && \
sleep 1 && \
screencapture -x "$SCREENSHOT"
echo "$SCREENSHOT"
Claude Execution Flow
When user says “æªå¾” or “/screenshot”:
-
Detect App
ps aux | grep -E "cargo.*run|makepad" | grep -v grep | head -1 -
Determine App Name
- Extract from process list
- Or use current project’s package name
-
Execute Screenshot
osascript -e 'tell application "System Events" to set frontmost of (first process whose name contains "APP") to true' sleep 0.5 screencapture -x /path/to/scratchpad/screenshot.png -
Read and Analyze
Read /path/to/scratchpad/screenshot.png -
Report Results
- Describe visible UI elements
- Point out any issues (layout, colors, missing components)
- Confirm functionality
Notes
- macOS Only – Uses
screencaptureandosascript - Permission Required – osascript needs accessibility permission
- Window Occlusion – Must bring to front first
- Startup Time – Need to sleep after cargo run to wait for window
- Scratchpad – Use session-specific scratchpad directory for screenshots
Example Interactions
Example 1: Quick Screenshot
User: æªå¾ççç°å¨ç UI
Claude:
1. Detected running a2ui-demo
2. Execute screenshot command
3. Read screenshot file
4. Analysis: "UI displays normally, TextField shows input 'ä½ å¥½', product list rendered 3 cards..."
Example 2: Build Run and Capture
User: /run-and-capture a2ui-demo
Claude:
1. pkill old process
2. cargo build -p a2ui-demo
3. cargo run -p a2ui-demo &
4. sleep 5 wait for startup
5. Capture and analyze
Example 3: Verify Two-way Binding
User: I entered "Helloð" in TextField, help me verify two-way binding with screenshot
Claude:
1. Execute screenshot, save to scratchpad
2. Read screenshot, analyze UI
3. Output verification report:
ââââââââââââââââââââââââââââââââââââââââââ
â A2UI Demo - Product Catalog â
ââââââââââââââââââââââââââââââââââââââââââ¤
â [Search Products] â
â ââââââââââââââââââââââââââââââââââââ â
â â Helloð â â â TextField shows input
â ââââââââââââââââââââââââââââââââââââ â
â Helloð â â Text (caption) synced
â â
â Products (Template Rendering) â
â ââââââââââââââââââââââââââââââââââââ â
â â Premium Headphones | $99.99 | + â â
â ââââââââââââââââââââââââââââââââââââ â
ââââââââââââââââââââââââââââââââââââââââââ
â
Two-way binding verification successful:
| Component | Binding Path | Display Content |
|-----------|--------------|-----------------|
| TextField | /search/query | Helloð |
| Text (caption) | /search/query | Helloð |
UI Analysis Report Format
After screenshot, Claude should provide structured analysis:
Basic Report
## Screenshot Analysis
**Application**: a2ui-demo
**Time**: 2026-02-01 14:30:00
**Window State**: Normal display
### UI Elements
| Element | Type | Content/State |
|---------|------|---------------|
| Title | Label | "A2UI Demo - Product Catalog" |
| Search Box | TextField | Empty/Has input |
| Product List | PortalList | 3 cards |
### Issue Detection
- â
Layout normal
- â
Text rendering normal
- â ï¸ Image not loaded (network image)
Function Verification Report
## Function Verification: TextField Two-way Binding
**Test Scenario**: User enters content in TextField, verify data model sync
### Verification Result
| Component | Binding Path | Expected | Actual | Status |
|-----------|--------------|----------|--------|--------|
| TextField | /search/query | Helloð | Helloð | â
|
| Text (caption) | /search/query | Helloð | Helloð | â
|
### Conclusion
â
**Two-way binding works correctly**
- Unicode Chinese characters: â
- Emoji characters: â
- Real-time sync: â
Common Issue Troubleshooting
Window Cannot Be Brought to Front
# Check if process is running
ps aux | grep -E "a2ui|makepad" | grep -v grep
# Try using process ID
osascript -e 'tell application "System Events" to set frontmost of (first process whose unix id is PID) to true'
Screenshot is Black Screen
Possible causes:
- Window occluded by other windows – bring to front first
- App still starting – increase sleep time
- GPU rendering delay – wait 1-2 seconds before capture
App Name Matching Issues
Makepad compiled app names are usually package names (underscores to hyphens):
a2ui-demoâ process name containsa2uiora2ui-demomy_appâ process name containsmy_appormy-app
Related Skills
makepad-basics– Makepad fundamentalsmakepad-widgets– Widget usagememory-skills– Memory system
Context: For automated visual debugging of Makepad GUI applications Tags: makepad, screenshot, debugging, gui, automation, macos