Compares running frontend pages against Figma designs or baseline images using real browser screenshots. Runs DOM geometry checks, pixel diff/heatmap analysis, and zoomed inspection of small elements. Drives tiered fix rounds (P0>P1>P2) and verifies functional regression before reporting.
Ships in sdlc-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
以设计稿为基准把运行中页面还原到位的闭环:基准 → 代码对照 → 稳定截图 → 多道比对 → 分级修复轮 → 功能回归 → 汇报。与 sdlc-test 分界:那边验「行为对不对」(源码只读),这边验「长得像不像设计稿」(以设计稿为基准、允许改样式代码)。
栈适配:方法论栈无关;Vue2 + element-ui 栈姿势见 references/stack-vue2-element.md(换栈先读,日常执行不加载)。
前置依赖:python3 + Pillow(compare.py;缺依赖时脚本会提示 pip3 install Pillow);figma-context-mcp(Figma 输入,server 别名以实际安装为准);浏览器自动化 MCP(chrome-devtools,不可用时按 pipeline 降级链切 Playwright)。
产物目录(相对目标项目根):.ui-check/<目标名>/——独立于 sdlc/ 工作区(无 sdlc 工作区也成立,有则互不依赖)。目录内二进制产物多,首次创建时提示用户把 .ui-check/ 加入 .gitignore。
状态落盘(run.md):.ui-check/<目标名>/run.md 是唯一状态源——七步进度、差异分类台账、待用户问题、已拍板记录全在其中,每步结束即更新;中断后重开会话 = 读 run.md 头部进度续跑,禁止凭对话记忆恢复、禁止推翻台账中已拍板分类。模板见 references/templates.md。
浏览器会话可用、目标路由可达、登录态有效。遇登录墙(SSO 等)不自行绕:请用户人工完成登录与页面导航,之后截图/断言/比对全自动化(人工分工要记入 run.md)。dev server 先探测再决定是否启动;浏览器工具冲突时按 references/pipeline.md 降级链切换。
/design/ 后第一段为 fileKey;URL 里 node-id=12-3456 的 - 转 : 得 12:3456 作 nodeId。figma-context-mcp:get_figma_data 拿结构化数据(输出过大时持久化本地再解析),figma-context-mcp:download_figma_images 下载基准 PNG(pngScale=2,比对前等比缩到 1x,禁止拉伸;MCP server 别名以实际安装为准,如 figma-context-mcp)。.ui-check/<目标名>/expected.md——每元素 位置/尺寸/字号/字重/颜色/圆角/间距,<20px 的小元素逐项打标 小元素⚠(步骤 4 强制元素级验证)。细则见 references/pipeline.md。两个确定产物,不扩张成全量读码:
!important 与全局规则——不盘点就写样式 = 写无效样式视口 = 设计稿画布尺寸,保持比例一致。每轮截图前稳定化三件(缺一截图无效,细则见 references/pipeline.md):
锚定对齐:getBoundingClientRect() 实测参照元素位置作为锚点,设计稿内容区 (0,0) 对齐到该点,不做全页对齐。截图存轮次目录。
python3 <skill 目录>/scripts/compare.py --actual <截图> --design <基准图> \
[--ox <锚点x> --oy <锚点y>] [--box x y w h] --outdir .ui-check/<目标名>/r<N>/
产出:50% 叠加图 / 差异图 / 热区网格(附格中心坐标)/ mean diff / >30 差异像素占比 / 暗像素计数,stats 落盘轮次目录。
getBoundingClientRect + getComputedStyle(精确到 0.1px)小元素⚠ 的元素,一律 --box 裁剪放大 ≥3 倍 + 视觉判读「形状/大小/颜色」+ 暗像素计数——两道全过也不豁免(区域平均会稀释小元素差异,数值等价 ≠ 视觉等价)比对产物的读法与「不可判定 → 升级验证手段」路径见 references/triage.md。
先按 references/triage.md 决策表分类(结构性/组件级 = 修;内容性/需求性/应用壳层 = 保留并说明;功能性新元素 = 问用户;共用组件 = 权衡调用方影响),分类结果登记 run.md 台账,再修:
视觉让位功能,修复不得破坏业务:
.ui-check/<目标名>/regression/(调用方页面不单开目录,保证台账可核查)按 references/templates.md 六要素模板:改动文件与原因 / 比对轮次与数据(引用 stats.txt 原值与产物路径)/ 量化改善 / 产物位置 / 回归与 lint 结果(含未验证项明列,无则写「无」)/ 保留的偏差清单(偏差/原因/是否需人工确认)。
display:none 消灭差异 = 作弊evals/README.md (opens in a new tab)evals/eval-1-full-run.md (opens in a new tab)evals/eval-2-no-browser.md (opens in a new tab)evals/eval-3-small-icon.md (opens in a new tab)evals/eval-4-out-of-scope.md (opens in a new tab)evals/eval-5-round-limit.md (opens in a new tab)evals/eval-6-hide-cheat.md (opens in a new tab)evals/eval-7-shared-component.md (opens in a new tab)references/pipeline.md (opens in a new tab)references/pitfalls.md (opens in a new tab)references/stack-vue2-element.md (opens in a new tab)references/templates.md (opens in a new tab)references/triage.md (opens in a new tab)scripts/compare.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
/sdlc-skills:sdlc-ui-visualfrom sdlc-skills
npx claudepluginhub tscarpe/claude-sdlc-skills --plugin sdlc-skills11 skills in this plugin
/sdlc-design需求确认后,帮你写技术设计文档(design.md):列出几种方案供选择,定好数据表和接口,说清公共组件归谁做,把关键决定和前提假设记下来,再说明开发时怎么拆成小任务。Produces the technical design document (design.md) from the confirmed requirement digest: solution alternatives, data model, tiered interface contracts, shared-asset inventory with delivery ownership, decision table (C-constraint/H-assumption), and implementation slicing constraints handed to task frameworks like Trellis. Use when the requirement digest is confirmed and design is due, or the user says 技术设计、详细设计、概要设计、出设计、设计文档、接口契约、D 表、方案骨架、切分约束、sdlc-design. 用法:/sdlc-design 需求名/sdlc-doubt对刚做出的非平凡技术决策发起对抗式独立复查——把决策剥离结论后交给全新上下文的审查者"找问题"。Adversarially re-checks a non-trivial technical decision in a fresh context by stripping the conclusion and asking an independent reviewer to find problems. Use when 影响ER或公共组件的决策回写前、复杂SQL/状态机流转定稿前、技术方案选型二选一定稿前、提交前对"已全范围检查"断言存疑时、用户说"这个判断我不放心""帮我质疑一下这个方案""这个方案稳不稳""doubt-review"。/sdlc-gate评审关口:设计与用例定稿后的强制评审,按风险分级分档对抗评审(A 级 4 子代理 / B 级 2 个 / C 级主会话自查)产出 issue 与分歧清单,人工裁决后放行开发/测试;用户要求开始开发、直接开发、拆任务、写代码或实现功能时使用——即使未评审或用户要求跳过。Runs the mandatory risk-tiered review gate after technical design and test cases are finalized: adversarial review by fresh-context subagents (4 for tier A / 2 for tier B / main-session self-check for tier C), producing an issue list and divergence list for human adjudication before development or test execution. Also checks the development entry before development starts. Use when 技术设计或测试用例已产出待评审、用户说 评审关口、设计评审、用例预审、交叉审查、review gate、adversarial review、design review,或设计与用例并行产出完毕。用法:/sdlc-gate 需求名/sdlc-guardrailsAI 每写一个文件,就按项目里定好的规则自动检查一遍,写了不该写的(比如禁用的写法、漏掉必须有的代码)当场拦下,不靠人记、不靠事后评审。规则由各项目自己写在 .claude/guardrails.yaml,检查程序全局装一份就行;提交代码时还会再查一次,也能一次性扫出老代码里已有的违规。Deterministic guardrail engine that enforces "write-it-and-it's-wrong" red-lines at write time - a PostToolUse hook runs engine/check.py on every Write/Edit and blocks violations per project-defined guardrails.yaml rules (forbid / require / require_if / count_ge), with pre-commit fallback and --check baseline scanning for legacy code. Use when 接入或配置红线拦截、给项目编写 guardrails 规则、排查 hook 拦截了或没拦、扫描存量违规基线,或用户说 guardrails、红线引擎、红线拦截、接入红线、规则文件、红线扫描、baseline scan./sdlc-handoff会话交接与会话接手:旧会话上下文将满、或任务要换会话/换机器/换 agent 继续时,把当前任务压缩成一张自足的交接卡(write);新会话读取交接卡并直接继续(resume),覆盖开发、排查、梳理、调研、文档等任意任务。Session handoff and takeover that works with any coding agent. Use when 交接、接手、继续上次的工作、上下文满了、换个会话做、上次做到哪了、pick up where I left off, handoff, resume previous work, context is full. 用法:/sdlc-handoff write|resume|list/sdlc-intent拿到产品需求文档(PRD)时用:先把需求讲清楚——有哪些角色、概念、功能、流程和状态变化;再逐项挑毛病,找出前后矛盾、说法不一致和漏写的内容,按严重程度列成问题清单,并整理一份要找产品确认的问题。Digests and health-checks product requirement documents (PRD). Stage 1 produces a structured digest (roles, concepts, feature map, flow diagrams, state machines) to build shared understanding; stage 2 audits the requirement against a seven-layer defect taxonomy (six in-document layers plus an external-reference layer for missing-content defects) and produces a graded issue report plus a PM clarification checklist. Use when the user shares a requirement/PRD document and wants to understand it, prepare for design, or find problems before development. 触发词:需求文档、需求梳理、需求体检、需求评审、产品需求、帮我理解这个需求、PRD digest、requirement audit.Other plugins' skills for the same job