skills/sync-pencil/SKILL.md
Sync Pencil pen and code
npx skillsauth add laststance/skills sync-pencilInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When running this skill in Codex, translate Claude Code-only primitives before acting: AskUserQuestion -> chat/request_user_input, TodoWrite -> update_plan, Task/TaskCreate/TeamCreate/SendMessage -> spawn_agent/send_input/wait_agent when available and allowed, and EnterPlanMode/ExitPlanMode -> a concise chat plan plus explicit approval.
Resolve Read/Write/Edit/Bash/WebSearch/WebFetch to Codex file/shell/web tools, and map ~/.claude/... paths to ~/.agents/... or ~/.codex/... unless the task explicitly targets Claude Code.
When running this skill in Cursor Agent, translate Claude Code-only primitives before acting: AskUserQuestion -> AskQuestion; TodoWrite -> Cursor TodoWrite or an equivalent checklist; Task/TaskCreate/TeamCreate/SendMessage/multi-agent flows -> Cursor Task (subagents), parallel Tasks, or run_in_background when allowed (TeamCreate/SendMessage may have no exact match); EnterPlanMode/ExitPlanMode -> Plan mode (SwitchMode / CreatePlan) plus explicit user approval.
Resolve Read/Write/Edit/StrReplace/Bash/web/search/MCP via Cursor Composer or Agent equivalents. MCP names written as mcp__server__tool typically map to call_mcp_tool with configured server identifiers. Map ~/.claude/... to ~/.cursor/skills/, .cursor/skills/, and .cursor/rules/ unless the task explicitly targets Claude Code.
Bidirectional synchronization between Pencil .pen designs and implementation code.
<essential_principles>
This skill works across multiple platforms using unified screenshot capture:
| Platform | Tool | Screenshot Command |
|----------|------|--------------------|
| Electron | playwright-cli (attached to Electron CDP) | playwright-cli --s=default screenshot --filename=<name>.png |
| Web | playwright-cli | playwright-cli screenshot --filename=<name>.png |
| iOS Sim | mcp__ios-simulator | mcp__ios-simulator__screenshot |
Before any browser interaction: invoke /dnd to load the drag-and-drop
verification protocol. Required even when DnD is not yet known to be involved —
ref-based drag returns false success on dnd-kit and similar libraries.
Components are matched between .pen and code using:
Button in .pen ↔ Button.tsx in code.pen node id attribute (e.g., id="NavBar").pen frame name attribute| Scenario | Recommended Direction |
|----------|----------------------|
| Design finalized, code outdated | pencil-to-code |
| Code evolved, design stale | code-to-pencil |
| Both have good changes | sync (merge) |
| Initial implementation | pencil-to-code |
</essential_principles>
Wait for response before proceeding. </intake>
<routing> | Response | Workflow | |----------|----------| | 1, "code-to-pencil", "update design", "update pen" | `workflows/code-to-pencil.md` | | 2, "pencil-to-code", "generate code", "export" | `workflows/pencil-to-code.md` | | 3, "sync", "compare", "merge", "diff" | `workflows/sync.md` | | 4, "exhaustive", "full", "audit", "all elements", "roller", "complete" | `workflows/exhaustive-sync.md` |After reading the workflow, follow it exactly. </routing>
<reference_index>
| File | Purpose |
|------|---------|
| references/platform-detection.md | Detect and use correct MCP for platform |
| references/diff-algorithm.md | Visual and structural diff detection |
| references/merge-strategies.md | Conflict resolution strategies |
| references/node-mapping.md | .pen node ↔ React component mapping |
| references/element-extraction.md | Extract all UI elements from .pen (for exhaustive sync) |
</reference_index>
<workflows_index>
| Workflow | Direction | Purpose |
|----------|-----------|---------|
| code-to-pencil.md | Code → .pen | Update design from implementation |
| pencil-to-code.md | .pen → Code | Generate code from design |
| sync.md | Bidirectional | Compare, diff, and merge |
| exhaustive-sync.md | Full audit | Element-by-element roller strategy with progress tracking |
</workflows_index>
<success_criteria>
tools
Inspect video frame-by-frame and capture-then-verify UI motion. Extract frames from any clip (handed to you, screen-recorded, or self-captured) with ffmpeg and read them as images; record an interaction (Playwright / computer-use / iOS simulator) and verify animations, transitions, and motion that static screenshots and getComputedStyle cannot reveal. Use when verifying animations/transitions/motion, analyzing a video or .webm/.mp4, extracting frames, checking how something "looks" in motion, or recording a UI flow to inspect.
testing
Cited research briefs
development
Daily coding habit prompts JP
development
React core deep-dive JP