跪拜 Guibai
← All articles
Claude · Frontend Engineering

Sketch to Vue on Claude Code: Orchestrated Agents, Design IR, and an Auto-Fixing Visual QA Loop

By 星光不问赶路人 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Orchestrated AI design-to-code stops being a one-shot chat and becomes an auditable, resumable engineering process. The 98% pixel gate plus region-based checks forces AI output to match a design before it reaches a browser, which is the difference between a demo and something a team can ship.

Summary

A proposed Sketch-to-Vue pipeline rests on one decision: no single agent tries to do the whole job. An orchestrator splits design restoration into six serial stages, parallelizes inside stages, and hands each phase to a specialist agent. Eight agents cover project analysis, Sketch parsing, layout analysis, component planning, component and page development, integration, and visual QA. Eight reusable Skills keep agent definitions from bloating, and deterministic TypeScript scripts handle JSON parsing, screenshots, and image comparison so the AI doesn't re-derive what code can do reliably.

The pipeline inserts a Design IR between Sketch's raw JSON and Vue generation. That intermediate model preserves layer IDs, parent-child relationships, local coordinates, transforms, styles, and asset references, so later layout analysis and code generation share one stable view of the design. Two human approval gates sit before parallel development and after integration, and a third gates final delivery.

Visual QA closes the loop: Playwright captures the rendered page, a pixel-diff script compares it with the Sketch screenshot, and the AI receives a difference report to fix. Initial quality targets cap critical dimension and position deviations at 2px, require 100% asset mapping, and set pixel similarity at 98% or higher. After at most three auto-fix rounds, unresolved work is marked NEEDS_REVIEW for a human. Task state and intermediate artifacts persist in .design-work/, with commands like /design-start and /design-resume making the whole flow resumable.

Takeaways
— Six stages: project initialization, Sketch package parsing, design understanding, component and parallel page development, integration, visual QA.
— Eight specialist agents, from Project Analyst to Visual QA Agent, with Page Developer spawning one instance per page.
— Eight reusable Skills, including sketch-parser, design-ir, layout-analysis, vant-mapping, vue-generation, screenshot-capture, and visual-regression.
— Design IR stores layer IDs, parent-child relations, local coordinates, transforms, styles, text content, and asset refs to keep Sketch parsing and Vue generation decoupled.
— Visual QA uses Playwright screenshots and pixelmatch-style comparison; similarity score is 100% minus the percentage of differing pixels.
— Initial quality gates: ≤2px key dimension/position deviation, ≥98% pixel similarity, 100% asset mapping, TypeScript and Vite build pass, key interactions pass.
— Up to three auto-fix rounds; failures after that are marked NEEDS_REVIEW and handed to a human.
— Workflow state and artifacts persist under .design-work/ with manifest and state files; resuming checks artifact integrity and input/version drift.
— Four command entry points: /design-start, /design-resume, /design-status, /design-report.
— Roadmap: single-page MVP first, then multi-page parallel development, then dynamic orchestration based on page complexity.
Conclusions

The separation of agent roles from reusable skills is what makes the eight-agent setup maintainable; agent definitions stay small because professional knowledge lives in Skills that can be shared.

Human approval gates placed before parallel development and after integration catch design misreads early, before many page agents waste effort, and again after reality of integration sets in.

The 98% pixel similarity target is bold given anti-aliasing, shadows, and browser rendering differences; the source itself acknowledges pixel similarity isn't a full quality score, so the region-based checks are the real guarantee.

Concepts & terms
Design IR (Design Intermediate Representation)
A normalized data model inserted between Sketch's raw JSON and Vue code generation. It preserves layer IDs, parent-child relations, local coordinates, transforms, styles, and asset references so multiple agents can work from one stable representation instead of re-interpreting Sketch's variable structure.
Orchestrator
The main agent that decomposes a task into stages, schedules specialized agents, manages dependencies and parallel execution, enforces human approval gates, persists state, and resumes after failures.
Skill (in Claude Code)
A reusable package of domain knowledge and execution steps that an agent can invoke. Skills let the same capability be shared across multiple agents without duplicating the instructions in each agent's profile.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗