ui-verification
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUI Verification
UI验证
Owns the browser session. Every other UI skill in this repo reasons about source and infers what the user will see; this one loads the page and measures it.
- IS: booting the app, driving it with a browser, and running the probes that decide a rule at runtime: computed boxes, injected failures, observed layout shift, a scripted Tab walk, an axe scan per theme. Output is findings keyed to rule ids with reproducible evidence, plus the clearing re-run after a fix.
- IS NOT: finding defects by reading source or deciding their tier and ship verdict (Audit mode owns both); building or restyling UI (
ui-designBuild); authoring a durable test suite (write Playwright tests); pixel-diff regression against a baseline (Chromatic, Percy); field performance (RUM or CrUX; Lighthouse is a lab tool).ui-design
The division of labour is the point. A static audit reports what the code will probably do; it cannot see a 40px control whose hit area a pseudo-element already expands to 44, or a retry button wired to nothing. This skill reproduces or kills each of those, so a finding arrives with a measurement instead of a confidence.
掌控浏览器会话。此仓库中的其他UI技能均基于源代码进行分析并推断用户所见内容;而本技能会加载页面并进行实际测量。
- 负责: 启动应用、通过浏览器驱动应用运行、执行可在运行时判定规则的探针:计算盒子模型、注入故障、观测布局偏移、脚本化Tab遍历、按主题执行axe扫描。输出结果为关联规则ID的可复现问题证据,以及修复后的验证重跑结果。
- 不负责: 通过读取源代码发现缺陷或判定缺陷等级与发布结论(审计模式负责这两项);构建或重新设计UI(
ui-design构建功能);编写持久化测试套件(编写Playwright测试);与基线进行像素差异回归测试(Chromatic、Percy);现场性能数据(RUM或CrUX;Lighthouse是实验室工具)。ui-design
明确分工是关键。静态审计报告代码可能产生的行为;但它无法发现某个40px控件的点击区域已被伪元素扩展至44px,或者重试按钮未绑定任何功能。本技能可复现或排除这些问题,让问题结果附带实际测量数据而非置信度。
Contents
目录
When to run
运行时机
| Situation | What this skill does |
|---|---|
A | Run only the probes those rule ids map to, in |
| No audit ran; the user points at a route or a running app | Detect features, run the full battery on the resolved routes |
| A fix just landed for a previously reproduced finding | Run the clearing re-run only (step 5) |
| The user asks for captures across themes or widths | |
A | Read the claimed values off computed styles on a real page; a theme value the build overrides never reaches the browser |
Nothing here assigns a tier or a ship verdict. Hand reproduced findings back with their evidence and let 's tier them; two skills tiering the same finding is how the tiers drift apart.
ui-designreferences/ship-readiness.md| 场景 | 本技能的操作 |
|---|---|
| 仅运行 |
| 未执行审计;用户指定了某个路由或正在运行的应用 | 检测功能,对解析后的路由运行全套探针 |
| 针对之前复现的问题的修复已完成 | 仅运行验证重跑(步骤5) |
| 用户需要跨主题或不同宽度的捕获结果 | 仅运行 |
| 从真实页面的计算样式中读取声明的值;构建过程中被覆盖的主题值永远不会到达浏览器 |
本技能不负责分配缺陷等级或发布结论。将附带证据的复现问题结果返回,由的来判定等级;若两个技能同时判定同一问题的等级,会导致等级标准出现偏差。
ui-designreferences/ship-readiness.mdProbe catalogue
探针目录
Each file is one probe: what it measures, the driver calls, the false positives it must guard, and the shape of the evidence it returns.
| Probe | Measures | Primary for |
|---|---|---|
| probes/axe-scan.md | axe-core violations per route and theme, including computed contrast | contrast, accessible names, landmarks, document language |
| probes/target-size.md | Bounding box and effective hit area of every visible interactive element | |
| probes/focus-walk.md | Scripted Tab traversal, focus-ring pixel delta, dialog trap and restoration | |
| probes/layout-shift.md | Attributed | |
| probes/viewport-stress.md | Horizontal overflow and clipped text at 320px and up, and under tripled strings | |
| probes/failure-injection.md | What renders when the data request returns 500, | |
| probes/theme-locale-matrix.md | The same route captured across viewport, theme, pseudo-locale, and direction | |
| probes/console-network.md | Console errors, page errors, failed requests, hydration mismatch warnings | hydration mismatch, silent runtime failures |
| probes/web-vitals.md | LCP with its attributed element, CLS, INP on a scripted interaction | perf attribution, never a budget verdict |
每个文件对应一个探针:包含测量内容、驱动调用、需要防范的误报情况,以及返回证据的格式。
| 探针 | 测量内容 | 主要针对规则 |
|---|---|---|
| probes/axe-scan.md | 每个路由和主题下的axe-core违规情况,包括计算得出的对比度 | 对比度、可访问名称、地标、文档语言 |
| probes/target-size.md | 每个可见交互元素的边界框和有效点击区域 | |
| probes/focus-walk.md | 脚本化Tab遍历、焦点环像素变化、对话框陷阱与恢复 | |
| probes/layout-shift.md | 关联数据响应的 | |
| probes/viewport-stress.md | 320px及以上宽度下的水平溢出和文本截断情况,以及三倍长度字符串下的表现 | |
| probes/failure-injection.md | 数据请求返回500、 | |
| probes/theme-locale-matrix.md | 同一路由在不同视口、主题、伪区域设置和方向下的捕获结果 | |
| probes/console-network.md | 控制台错误、页面错误、请求失败、 hydration 不匹配警告 | hydration不匹配、静默运行时故障 |
| probes/web-vitals.md | 关联元素的LCP、CLS、脚本化交互下的INP | 性能归因,不做预算判定 |
Progress checklist
进度检查清单
text
Verification progress:
- [ ] Step 1: Establish the session (references/session-setup.md): driver, build mode, base URL, auth, resolved routes
- [ ] Step 2: Select the probe set from handed-over rule ids (references/rule-coverage.md) or from the routes
- [ ] Step 3: Run each probe; record evidence artifacts before interpreting any of them
- [ ] Step 4: Decide each finding reproduced / not-reproduced / unknown; repeat timing-sensitive or inconsistent results when needed
- [ ] Step 5: For each fix applied, re-run the identical probe and record clearedBy
- [ ] Step 6: Emit the verification block per finding (references/evidence-output.md), then render
- [ ] Step 7: List probes skipped and why. A probe that could not run is never a passtext
Verification progress:
- [ ] Step 1: Establish the session (references/session-setup.md): driver, build mode, base URL, auth, resolved routes
- [ ] Step 2: Select the probe set from handed-over rule ids (references/rule-coverage.md) or from the routes
- [ ] Step 3: Run each probe; record evidence artifacts before interpreting any of them
- [ ] Step 4: Decide each finding reproduced / not-reproduced / unknown; repeat timing-sensitive or inconsistent results when needed
- [ ] Step 5: For each fix applied, re-run the identical probe and record clearedBy
- [ ] Step 6: Emit the verification block per finding (references/evidence-output.md), then render
- [ ] Step 7: List probes skipped and why. A probe that could not run is never a pass1. Establish the session
1. 建立会话
Read references/session-setup.md. It resolves four things, and getting any of them wrong invalidates every probe downstream:
- Driver. Playwright when the repo can run it, the Chrome DevTools browser tools when it cannot. Four probes need request interception and network control, so they do not exist under a driver without them.
- Build mode. Perf and layout-shift probes run against a production build; dev-mode numbers measure the bundler. Failure injection and focus probes run fine in dev.
- Auth and seeded data. A route behind a login with no seeded session returns , never a pass.
unknown - Routes. Map the diff to URLs. A component with no reachable route falls back to the repo's Storybook, and to if there is none.
unknown
Stop here if the app will not boot. A verification run with no session produces no findings, which is a reportable outcome and not a clean bill of health.
阅读references/session-setup.md。它会解决四个问题,任何一个出错都会使后续所有探针的结果失效:
- 驱动程序:仓库支持时使用Playwright,不支持时使用Chrome DevTools浏览器工具。有四个探针需要请求拦截和网络控制,因此不支持这些功能的驱动无法运行它们。
- 构建模式:性能和布局偏移探针针对生产构建运行;开发模式下的数值测量的是打包工具的性能。故障注入和焦点探针在开发模式下可正常运行。
- 认证和预置数据:需要登录但无预置会话的路由会返回,永远不会判定为通过。
unknown - 路由:将差异映射到URL。无法访问的组件会回退到仓库的Storybook,若没有Storybook则返回。
unknown
如果应用无法启动,请在此停止。未建立会话的验证运行不会生成任何问题结果,这是可报告的结果,而非无问题的证明。
2. Select the probe set
2. 选择探针集
Handed a list of rule ids (the normal case, from a audit): open , take the probe each id maps to, and run only those. Ids with no probe stay source-only findings and pass through untouched, marked as such.
ui-designreferences/rule-coverage.mdGiven only routes: detect features the way 's feature playbooks do (form, list, modal, dashboard, checkout), then run the battery that surface earns. , , and run on every route regardless: they are cheap, and they are the three that find things nobody suspected.
ui-designprobes/axe-scan.mdprobes/console-network.mdprobes/viewport-stress.mdBudget the matrix before running it. Routes multiplied by viewports multiplied by themes grows fast, and a run that takes twenty minutes gets skipped next time. Two viewports (360 and 1280) and two themes cover the ground; add widths only where a probe already found an edge.
收到规则ID列表(常规情况,来自审计):打开,选择每个ID对应的探针,仅运行这些探针。无对应探针的ID仍为仅基于源代码的问题结果,保持原样并标记。
ui-designreferences/rule-coverage.md仅提供路由:按照的功能手册检测功能(表单、列表、模态框、仪表盘、结账页),然后运行该功能对应的全套探针。、和会在所有路由上运行:它们成本低,且能发现无人预料的问题。
ui-designprobes/axe-scan.mdprobes/console-network.mdprobes/viewport-stress.md运行前估算矩阵规模。路由数乘以视口数乘以主题数会快速增长,耗时20分钟的运行下次会被跳过。两个视口(360px和1280px)和两个主题即可覆盖主要场景;仅在探针已发现边缘情况时增加宽度。
3. Run the probes
3. 运行探针
Each probe file carries its own recipe. Three rules hold across all of them:
- Capture evidence before interpreting it. Write the screenshot, the JSON measurement, and the console log to disk first. A finding whose evidence was never written is unverifiable by the person reading the report, which puts it back where the static audit left it.
- One probe, one route, one viewport, one theme. Never fold two conditions into one run: when the result surprises you, you need to know which axis produced it.
- Repeat uncertain measurements. Retry timing-sensitive or inconsistent results under controlled conditions. A deterministic failure with a captured trigger needs no duplicate run. A result that flips remains inconclusive until its conditions are understood.
每个探针文件都有自己的操作步骤。所有探针需遵循三条规则:
- 先捕获证据再解读:先将截图、JSON测量数据和控制台日志写入磁盘。未写入证据的问题结果无法被阅读报告的人验证,这会使其回到静态审计的状态。
- 一次探针、一个路由、一个视口、一个主题:切勿将两种条件合并到一次运行中:当结果出乎意料时,你需要知道是哪个维度导致的。
- 重复不确定的测量:在受控条件下重试对时间敏感或结果不一致的测量。具有可捕获触发条件的确定性故障无需重复运行。结果反复变化的情况在明确其条件前仍为不确定。
4. Decide each finding
4. 判定每个问题结果
Three outcomes, and the middle one is the one that earns this skill its keep.
| Outcome | Meaning | What it does to the handed-over finding |
|---|---|---|
| The probe measured the defect | Stays a |
| The tested conditions did not exhibit the defect | Withdraw only if the probe exercised the alleged trigger; otherwise retain the candidate with the remaining coverage gap |
| The probe could not run or could not decide | Finding survives as |
A result is a real deliverable, not a wasted run. It is what removes the false positives a large rule corpus asserts with confidence, and it feeds the rejection section already requires.
not-reproducedfile:lineui-designWhere a probe finds something no static rule predicted, emit it as a new finding against the rule id the probe is primary for. Where no rule covers it (an axe violation with no ui-design counterpart, a console error), emit it under or and say plainly that it came from the browser and not the corpus.
axe:<violation-id>runtime:<signature>三种结果,其中中间的结果是本技能的核心价值所在。
| 结果 | 含义 | 对传入问题结果的处理 |
|---|---|---|
| 探针测量到了缺陷 | 保持 |
| 测试条件下未出现该缺陷 | 仅当探针已验证了所谓的触发条件时才撤回该结果;否则保留候选结果并标记剩余的覆盖缺口 |
| 探针无法运行或无法判定 | 结果保持 |
not-reproducedfile:lineui-design若探针发现了静态规则未预测到的问题,将其作为新的问题结果关联到该探针主要针对的规则ID。若没有规则覆盖该问题(无对应ui-design规则的axe违规、控制台错误),则以或为标识输出,并明确说明它来自浏览器而非规则库。
axe:<violation-id>runtime:<signature>5. Clearing re-run
5. 验证重跑
A fix is not verified by reading the diff. Re-run the identical probe: same route, same viewport, same theme, same seed, same injected failure. Record it as on the finding, keep the before-artifact, and never overwrite it with the after.
clearedByThree outcomes worth naming:
- The probe now passes: the finding is and cleared.
applied - The probe still fails: the fix did not work. Report it as applied-unverified and say so; do not report the fix and stay silent about the re-run.
- The probe passes but a different probe on the same route now fails: the fix caused a regression, which is a new finding, not a footnote on the old one.
不能通过阅读代码差异来验证修复效果。重新运行完全相同的探针:相同路由、相同视口、相同主题、相同预置数据、相同注入故障。在问题结果上记录,保留修复前的证据,切勿用修复后的证据覆盖它。
clearedBy三种值得注意的结果:
- 探针现在通过:问题结果标记为并已清除。
applied - 探针仍失败:修复未生效。将其报告为已应用但未验证,并明确说明;切勿仅报告修复而对重跑结果保持沉默。
- 探针通过,但同一路由上的另一个探针现在失败:修复导致了回归,这是一个新的问题结果,而非旧结果的脚注。
6. Report
6. 生成报告
references/evidence-output.md owns the shape: a block appended to each finding, a top-level block, and artifact paths. It defines only the delta on 's schema, which stays the single owner of the finding object, the three counts, and the verdict.
verificationsessionui-designreferences/output-adapters.mdWhere this skill runs standalone, render the same terminal adapter with omitted: the verdict is a property of a tiered audit, and printing one from probe results alone invents a tier assignment nobody made.
SHIP VERDICTreferences/evidence-output.md定义了报告格式:每个问题结果后附加块、顶层块,以及证据文件路径。它仅定义了对的 schema的增量部分,后者仍是问题结果对象、三个计数和结论的唯一所有者。
verificationsessionui-designreferences/output-adapters.md当本技能独立运行时,使用相同的终端适配器但省略:结论是分级审计的属性,仅根据探针结果生成结论相当于自行分配了无人认可的等级。
SHIP VERDICTHonesty rules
诚信规则
- A skipped probe is not a passed probe. Report every probe that did not run, with the reason (no route, auth required, driver lacks interception, app would not build). A report that silently omits them reads as coverage it does not have.
- A screenshot is evidence, not a verdict. Probes decide on measurements. Captures exist so a human can check the measurement, and for the two questions no measurement settles: whether the dark theme looks right, and whether the pseudo-locale broke the layout or merely the prose.
- Do not widen into a redesign. This skill reports what it measured. A finding that needs a new type scale names the mode to run next, exactly as an audit does.
- The app is the subject, not the harness. A failure caused by the probe itself (a selector that never resolved, a route interception that swallowed the wrong request) is a harness bug. Fix the probe and re-run; never report it as a defect in the app.
- Numbers carry their units and their conditions. is a measurement.
44x44px at 360px width with touch emulation onis the inference this skill exists to replace.too small
- 跳过的探针不等于通过的探针:报告所有未运行的探针及其原因(无路由、需要认证、驱动不支持拦截、应用无法构建)。若报告中静默省略这些探针,会被误认为具备相应的覆盖范围。
- 截图是证据,而非结论:探针基于测量结果做出判定。捕获内容的作用是让人工检查测量结果,以及解决两个测量无法回答的问题:深色主题是否显示正常,伪区域设置是破坏了布局还是仅影响了文本。
- 不要扩展为重新设计:本技能仅报告测量结果。需要新尺寸规范的问题结果应指明下一步运行的模式,就像审计一样。
- 应用是检测对象,而非工具本身:由探针自身导致的失败(选择器从未解析、路由拦截错误吞噬了请求)属于工具bug。修复探针后重新运行;切勿将其报告为应用缺陷。
- 数值需附带单位和条件:是测量结果。
44x44px,360px宽度,开启触摸模拟是本技能要替代的推断。太小
Gotchas
注意事项
The ones that cut across probes. Each probe file carries its own false positives.
- does nothing for an app that themes with a
page.emulateMedia({ colorScheme: 'dark' })orclass="dark"attribute, which is most Tailwind apps. The probe reports a clean dark pass while never having left light mode. Drive the app's own toggle, and assert the attribute landed before capturing.data-theme - Running perf or layout-shift probes against measures on-demand compilation. The first navigation to a route can spend seconds in the bundler, which lands in LCP and dwarfs anything real.
next dev - Animations that never settle keep a screenshot probe waiting until timeout. Set for captures, then run motion-sensitive checks in a separate pass with it off, because reduced motion is also a code path that can be broken.
prefers-reduced-motion: reduce
这些是跨探针的常见问题。每个探针文件都有自己的误报情况。
- 对使用
page.emulateMedia({ colorScheme: 'dark' })或class="dark"属性设置主题的应用无效,大多数Tailwind应用都是如此。探针会报告深色模式通过,但实际上从未离开浅色模式。应驱动应用自身的切换按钮,并在捕获前确认属性已设置。data-theme - 针对运行性能或布局偏移探针测量的是按需编译性能。首次导航到路由可能需要数秒的打包时间,这会被计入LCP并掩盖真实性能。
next dev - 永不停止的动画会导致截图探针等待至超时。捕获时设置,然后在单独的运行中关闭该设置以检查对动画敏感的内容,因为减少动画也是可能出现故障的代码路径。
prefers-reduced-motion: reduce
Related skills
相关技能
- : reads source, produces the findings this skill reproduces, and owns tiering, the ship verdict, and the finding schema.
ui-design - : type findings that need a rendered measure or leading value can be handed here for the measurement.
typography-audit - : agentic surfaces. Its runtime questions use the same session and probes.
ax-audit - : motion craft. This skill can capture the timing, but judging the curve is that skill's.
ui-animation
Maintenance only: holds the behavioural scenarios and routing prompts for anyone changing this skill. It never loads during a verification run.
evals/evals.json- :读取源代码,生成本技能需复现的问题结果,并负责分级、发布结论和问题结果schema。
ui-design - :需要渲染测量值或行高值的排版问题结果可提交至本技能进行测量。
typography-audit - :智能界面。其运行时问题使用相同的会话和探针。
ax-audit - :动画设计。本技能可捕获时间,但判断动画曲线属于该技能的职责。
ui-animation
仅维护用途:包含行为场景和路由提示,供修改本技能的人员使用。它不会在验证运行期间加载。
evals/evals.json