Skip to content
Back to skills

Design Sync

ASecurity

Use when a doan app screen is implemented for the first time from a design draft canvas in this repo's .doan/canvases/. Measures the draft and the implementation as computed styles in the real app, fixes the implementation until they match, has it reviewed, pins regressions with tests, and records measured values in docs/design/<group>.md (indexed in docs/DESIGN.md). Does not push.

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 11, 2026
ai-agentspythonawscode-review

Works with

  • claude code
  • cli

Security analysis

A100/100

Scanned November 20, 2026

npx -y skills add SinhyeokKang/doan-design --skill design-sync --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Design Sync?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Design Sync
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sinhyeokkang-design-sync/badge)](https://www.skillsdirectory.com/skills/sinhyeokkang-design-sync)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: design-sync
description: Use when a doan app screen is implemented for the first time from a design draft canvas in this repo's .doan/canvases/. Measures the draft and the implementation as computed styles in the real app, fixes the implementation until they match, has it reviewed, pins regressions with tests, and records measured values in docs/design/<group>.md (indexed in docs/DESIGN.md). Does not push.
---

Dogfooding loop (PRODUCT §5 'Dogfooding'): doan's own UI drafts are canvases in this repo's `.doan/canvases/`, and this skill compares a screen's implementation with its draft by computed style. Ported from malmoi `.claude/commands/design-sync.md`; the DesignSync / Codex input split and the BugShot step were dropped because the drafts are local files in this repo.

> **The draft is the source of truth only for a screen's initial implementation**. Once that implementation is integrated on develop (not when it is released), the code and `docs/DESIGN.md` and `docs/design/` are the source of truth. A new draft for an implemented screen is a change request (`/feature` or ordinary work), not a rerun of this loop.
>
> **Exception — redesign features**: when a redesign feature (AGENTS.md 'Workflow' `/design-draft`: a child of a parent feature, or a standalone follow-up) draws a new draft file for a screen already on develop, that new draft is the source of truth for the redesigned screen until the feature's branch is merged, and this loop runs against it. The old draft stays untouched as history.

Why the loop exists: in malmoi (2026-09-13) a modal fixed to the pixel in its draft was implemented with 29 deviations while 3,000 unit tests were green. Values that are right but rendered wrong are invisible to unit tests.

**Language**: the report to the user is in Korean. The design docs (`docs/DESIGN.md`, `docs/design/`), code comments and commits are English.

## Usage

- `/design-sync <canvas path> [frame id...]` — one round for the screen that canvas (or those frames) draws.
- `/design-sync <canvas path> --audit` — measure and report only (steps 1–3); no fixes.

## When to use

- A screen is being implemented for the first time and its draft canvas is in `.doan/canvases/`: build the comparison table before or during the implementation and loop until the first implementation reaches develop.
- The draft changed during that initial implementation.
- A redesign feature is implementing its new draft for a screen already on develop (see the exception above).

**Not for**: screens without a draft, and screens already on develop (even if a draft remains) unless a redesign feature drew a new draft for them. For those, `docs/DESIGN.md` and `docs/design/` and the code are the reference; check the window with `/runtime-test`.

## Prerequisites (stop if any fails)

1. The working tree is clean and `npm --prefix app test` is green. Measuring on top of mixed changes hides the cause of a mismatch.
2. You are on a `<type>/<slug>` branch (from `/ship` or `/orchestrate`), not develop or main. This skill commits but never pushes.
3. This repo has `.doan/config.json`, the canvas is listed by `doan ls --json --repo .`, and `doan check --json --repo .` reports no error for it (a missing `doan:width` makes the app refuse to draw it).
4. Every frame the screen needs is in the canvas — default, loading, empty, error and other states. A state with no frame is not compared; say so in the report.
5. You can reach every state in the implementation with temp repos and fixtures (using `app/runtime/` isolation and cleanup support). **A state you could not reach is not "verified".**

## Steps

### 1. Read the draft

- Read the canvas HTML and list its frames (`data-doan-frame`, `data-doan-title`). Frames that point to the implementing file use `data-doan-implements` (ARCHITECTURE §1); use it to find the code, and treat a missing one as a question for the canvas author, not a guess.
- Do not edit the canvas. A draft problem is a question to the user that names the frame or element (its frame id or `data-doan-id`).

### 2. Comparison table — pair the elements

Pair each draft element with its implementation element per run, as selector pairs in a table (no new convention and no test-only attributes in product code). One row per property:

| frame / state | draft selector | implementation selector + how to reach the state | property | draft | implementation |

Properties to cover: size, padding, gap, border and radius, colors (text, background, border, divider rules), font family / size / weight / line-height / letter-spacing, and hover, focus, selected and disabled states.

- **Pair children, not only containers**: a child that carries its own text style, background or spacing (`<code>`, `<b>`, chips, glyphs) gets its own row, and every row records `textContent` on both sides. In app-ui a styled `<code>` inside a paired `<p>` passed a 0-mismatch table (POSTMORTEM). Grep `docs/postmortem/` (`grep -rn design-sync docs/postmortem/`) before step 2.

- **A documented deviation is not a deviation.** When a feature document or the design docs (`docs/DESIGN.md`, `docs/design/`) record why the implementation differs on purpose, mark the row "documented" with the source. Without such a record, it is a real deviation.
- **A shared primitive beats one screen.** If one screen's draft differs from a shared component, keep the component, unless the drafts draw every screen with the same new value; then change the component and list the other screens it moves in the report.

### 3. Measure — computed style on both sides, in the real app

Both sides are read with `getComputedStyle` in the same Electron/Chromium build, so units, fonts and token variables resolve the same way.

- Write the script at `.scratch/design-sync/<screen>/measure.mjs` with the `app/runtime/` helpers (`app/runtime/README.md`): build the app and a temporary CLI, launch Playwright `_electron` with a temporary `--user-data-dir`, `DOAN_CLI` and `isolatedEnv` (isolated environment, pre-written onboarding completion record), replace the folder dialog through `electronApp.evaluate`, then add this repo with Add Projects… and open the canvas. Wrap the whole script in `realState()` / `assertRealState()` from `app/runtime/real-state.ts` (needs `python3.12`), not only the Playwright launches, and treat any `electron-vite dev` run as an app launch with the same isolation (POSTMORTEM 2026-10-30).
- Keep the app window out of the user's way as [/runtime-test](../runtime-test/SKILL.md) 'Stay out of the user's way' says: computed-style reads work on the hidden window; take focus only for a row that needs it in front.
- **Draft side**: the canvas iframe is a Playwright `Frame`; read styles and `getBoundingClientRect()` inside it. Do not use `boundingBox()` for elements inside the iframe — it ignores the board scale. Computed styles do not depend on the zoom.
- **Implementation side**: the app window's renderer page, brought to the state of each row.
- Create the states for real (hover, focus, scroll, selection) before reading. Read values that load asynchronously at the same moment as the rest, after they settle.
- **Do not judge from screenshots.** `#f5f5f5` and `#fff` look alike in a PNG; colors and sizes are read as values. Screenshots only show structure.
- Accessible names and roles are read from the real renderer through CDP (`Accessibility.getPartialAXTree`), not from jsdom.
- Fill the table with both values. `--audit` stops here and reports the table.

### 4. Fix

- Before changing UI, check Doan's own design presets as AGENTS.md 'Design presets in development skills' says, and name the presets read in the report.
- Bulk replacements assert that they matched; a replacement that silently matched nothing must not be reported as fixed.
- Comments say why the value matters (what breaks without it), not which draft it came from.
- Do not change how screens you did not measure look. If a shared primitive must change, prefer the call site, and record it in the screen's `docs/design/<group>.md` section.

### 5. Re-measure

Run the script again. Any mismatch → back to step 4. Loop until every row matches or is documented.

### 6. Review

Run this repo's `/code-review` as an independent reviewer (same runtime as this session, AGENTS.md 'Runtime differences') with the full table (draft value, measured value) in its prompt and the states you could not reach listed explicitly. Continue the same reviewer for follow-up rounds (Claude Code: `SendMessage`); a new reviewer loses its earlier judgments. Findings → back to step 4.

### 7. Pin it

Pin logic regressions with focused unit tests where practical. Keep geometry, input and native checks as short affected-state probes under `.scratch/`; do not add screen-specific e2e scripts or a full-flow gate. Record the failing observation and corrected measurement. Do not add test-only paths or attributes to product code.

### 8. Record and commit

- The screen's section in `docs/design/<group>.md` (English; AGENTS.md 'Documents'): the measured values the screen relies on and why, and every documented deviation. A new screen gets a `## <screen>` section in the group file it belongs to and a row in the 'Screen sections' table of `docs/DESIGN.md`. Write only what is true in the code now.
- Gates: `npm --prefix app test`, `npm --prefix app run typecheck`, `npm --prefix app run lint` (oxlint), `npm --prefix app run build`, then `/runtime-test`.
- Commits: code first, then one commit per document. No push.

## Report

```
🎨 design-sync: <canvas path> [frames]  (audit | fix)
Not verified (first): <states not reachable, frames missing from the draft>
Table: <rows: frame/state · property · draft · implementation · match / fixed / documented>
Fixes: <commits>
Review: <rounds, findings resolved>
Pinned: <tests added, red confirmed>
DESIGN: <docs/design/<group>.md sections added>
Commands: <each with result>
```

## Prohibited

- Do not edit the draft canvas to match the implementation.
- Do not run this loop on a screen that is already on develop, except against a redesign feature's new draft.
- Do not report a row as matching from a screenshot.
- Do not push or merge.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.