| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| Invoke | /pixel-loop:compare |
| Category | cocode-flutter |
| Complexity | moderate |
| MCP Servers | figma |
/pixel-loop compare โ ๋์์ธ vs ์ค์ ํ๋ฉด "๋ค๋ฅธ ์ ์ฐพ๊ธฐ"#
ํ๋ง๋๋ก#
๋์์ธ ์์(Figma)๊ณผ ์ค์ ๋ก ๋ง๋ ํ๋ฉด(์คํฌ๋ฆฐ์ท)์ ๋๋ํ ๊ฒน์ณ ๋๊ณ "์ด๋๊ฐ ๋ค๋ฅธ์ง" ์ฐพ์์ฃผ๋ ๊ฒ์ฌ๊ธฐ์ ๋๋ค. ํ๋ฆฐ ๊ทธ๋ฆผ ์ฐพ๊ธฐ์ฒ๋ผ, ๋ฒํผ ์์น๊ฐ 8px ๋ด๋ ค๊ฐ๋ค๊ฑฐ๋ ๊ธ์จ ๊ตต๊ธฐ๊ฐ ๋ค๋ฅด๋ค๊ฑฐ๋ ํ๋ ์ฐจ์ด๋ฅผ ๊ณจ๋ผ๋ ๋๋ค. ๋จ, ๊ณ ์น์ง๋ ์๊ณ ๋ณด๊ณ ๋ง ํฉ๋๋ค.
๋๊ฐยท์ธ์ ์ฐ๋์#
- ์ฝ๋ ๋ฆฌ๋ทฐ๋ ๋์์ธ QA๋ฅผ ํ ๋ โ "์์๋๋ก ์ ๋์๋?"๋ฅผ ๋น ๋ฅด๊ฒ ํ์ธํ๊ณ ์ถ์ ๊ฒฝ์ฐ
- ์ง์ ํ๋ฉด์ ์์ ํ๋ ์์ ๊น์ง๋ ํ์ ์๊ณ , ์ฐจ์ด๋ง ์ ๊ฒ(์ฝ๊ธฐ ์ ์ฉ) ํ๊ณ ์ถ์ ๋
๋ฌด์์ ํด์ฃผ๋์#
๊ฒ์ฌ ๊ฒฐ๊ณผ๋ฅผ ๋ ๊ฐ์ง ํํ๋ก ๋จ๊ฒจ ์ค๋๋ค.
-
๊ตฌ์กฐํ๋ ๋ฆฌํฌํธ ํ์ผ โ
.claude/docs/pixel-loop/compare_<์๊ฐ>.yaml(์์๋ณ๋ก ๋ฌด์์ด ์ผ๋ง๋ ๋ค๋ฅธ์ง ๊ธฐ๋ก) - ์ฌ๋์ด ์ฝ๊ธฐ ์ฌ์ด ์์ฝ โ ์ผ์นํ ํญ๋ชฉ / ์ด๊ธ๋ ํญ๋ชฉ / ํ์ฉ ์ค์ฐจ ์์ ๋ ํญ๋ชฉ์ ๊ฐ์
์๋ฅผ ๋ค์ด "PrimaryButton์ด ์์๋ณด๋ค 8px ์๋๋ก ๋ด๋ ค๊ฐ(์ฃผ์ ๋ฌธ์ )", "TitleText ๊ธ์จ ๊ตต๊ธฐ๊ฐ 600์ด์ด์ผ ํ๋๋ฐ 500์(์ฌ์ํ ๋ฌธ์ )" ์ฒ๋ผ ์ฝ ์ง์ด ์๋ ค ์ค๋๋ค.
์ด๋ป๊ฒ ์ฐ๋์#
# ๊ธฐ๋ณธ ์ฌ์ฉ (์์ URL + ๋น๊ตํ ์คํฌ๋ฆฐ์ท)
/pixel-loop compare --figma " < Figma ํ๋ ์ URL(node-id ํฌํจ) > " --screenshot " < PNG ๊ฒฝ๋ก > "
# ํ์ฉ ์ค์ฐจ๋ฅผ ์ง์ ์ง์ (์ด ์ ๋ ์ฐจ์ด๋ ๊ฐ์ ๊ฒ์ผ๋ก ๋ด)
/pixel-loop compare --figma " ... " --screenshot " ... " --tolerance pixel=1,color_delta_e=2
# ๋ฆฌํฌํธ๋ฅผ ์ ์ฅํ ์์น๋ฅผ ์ง์ ์ง์
/pixel-loop compare --figma " ... " --screenshot " ... " --output " .claude/docs/pixel-loop/my_report.yaml "
--figma(ํ์): ๋น๊ตํ ๋์์ธ ์์์ Figma ํ๋ ์ ์ฃผ์ (node-idํฌํจ)--screenshot(ํ์): ๋น๊ตํ ์ค์ ํ๋ฉด PNG ๊ฒฝ๋ก (์ ๋๊ฒฝ๋ก ๋๋.claude/docs/์๋)--tolerance(์ ํ): ํฝ์ ยท์์ ํ์ฉ ์ค์ฐจ. ๊ธฐ๋ณธ๊ฐ์pixel=1,color_delta_e=2-
--output(์ ํ): ๋ฆฌํฌํธ ์ ์ฅ ์์น. ๊ธฐ๋ณธ๊ฐ์.claude/docs/pixel-loop/compare_<์๊ฐ>.yaml
์์์ ๋ฌด์จ ์ผ์ด ๋ฒ์ด์ง๋์#
- Figma์์ ๋น๊ต ๋์ ๋์์ธ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์ต๋๋ค.
- ์์ ๊ธฐ์ค์ผ๋ก "์ด๋ ๊ฒ ๋์์ผ ํ๋ค"๋ ๋ ์ด์์ยท๊ธ๊ผดยท์์ ๊ธฐ์คํ๋ฅผ ๋ง๋ญ๋๋ค.
- ์ค์ ์คํฌ๋ฆฐ์ท์ ๋ถ๋ฌ์, ์์ ํ๋ํ๋์ ์์นยทํฌ๊ธฐ๋ฅผ ๊ธฐ์คํ์ ๋์กฐํฉ๋๋ค.
- ์ฐจ์ด์ ์ ์ ๋ฆฌํ YAML ๋ฆฌํฌํธ์ ์ฌ๋์ด ์ฝ๊ธฐ ์ฌ์ด ์์ฝ์ ์์ฑํฉ๋๋ค.
์ฐธ๊ณ : ์ฐจ์ด๋ฅผ ์ง์ ๊ณ ์ณ ์ฃผ๊ธธ ์ํ๋ค๋ฉด
/pixel-loop loop --mode=repair๋ฅผ, ๋น๊ต ์ ์ ์ ์คํฌ๋ฆฐ์ท๋ถํฐ ์ฐ์ด์ผ ํ๋ค๋ฉด/pixel-loop capture๋ฅผ ์ฌ์ฉํ์ธ์.
โ๏ธ ์์ธ ์ต์ ยท์คํ ๋ช ์ธ (๊ฐ๋ฐ์ / AI ์์ด์ ํธ์ฉ)
Parameters#
| Parameter | Required | Description |
|---|---|---|
--figma | โ | Figma frame URL (with node-id) |
--screenshot | โ | Path to a PNG (absolute, or under .claude/docs/) |
--tolerance | โ | pixel=N,color_delta_e=N (default pixel=1,color_delta_e=2) |
--output | โ | Where to write the diff report (default .claude/docs/pixel-loop/compare_<ts>.yaml) |
Behavior#
- Resolve Figma node via
figma.getNode. - Build the expected layout/typography/color spec.
- Load the screenshot, do per-element diff (using the design spec for element bounding boxes).
- Write a structured YAML report and a human-readable summary.
Output Schema#
file: .claude/docs/pixel-loop/compare_ < ts > .yaml
summary:
matched: 27
mismatched: 3
within_tolerance: 1
diff:
- element: PrimaryButton
kind: layout
expected: { x: 24, y: 312, width: 327, height: 48 }
actual: { x: 24, y: 320, width: 327, height: 48 }
delta: { y: +8 }
severity: major
- element: TitleText
kind: typography
expected: { weight: 600, size: 22 }
actual: { weight: 500, size: 22 }
severity: minorWhen Not to Use#
- Use
/pixel-loop loop --mode=repairinstead if you want the agent to actually fix the deltas. - Use
/pixel-loop captureif you need a fresh screenshot before diffing.