[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758B2JHMBB6YJTGYSJR65S4":3,"skill-same:01M758B2JHMBB6YJTGYSJR65S4":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":31,"ownerHtmlUrl":32,"ownerBlogUrl":31,"ownerDescription":33,"updatedAt":34,"install":35,"resources":47},"01M758B2JHMBB6YJTGYSJR65S4","visual-review",null,"Verify UI\u002Flayout\u002Fstyling changes are correct by computing occlusion, clipping, and alignment from the browser's resolved paint order via the chrome-devtools MCP `evaluate_script` tool — instead of eyeballing a flat screenshot. Invoke BEFORE declaring any UI, site, or styling\u002Flayout change correct. Screenshots have no depth buffer, so z-index\u002Focclusion\u002Fclip bugs are exactly where \"just look at it\" fails; the `evaluate_script` routines below turn those fuzzy visual judgments into deterministic measurements — including optical center-of-mass, which measures the glyph ink's true visual center so differently-sized labels can be aligned by more than eye.","nubjs\u002Fnub","nubjs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6785695?v=4","01M7583N3EYYHSNB6FJQXCDMQH","Nub","01M7583N44MVMSN8385QEF3C8V",4440,"MIT","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fvisual-review\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: visual-review\ndescription: >-\n  Verify UI\u002Flayout\u002Fstyling changes are correct by computing occlusion,\n  clipping, and alignment from the browser's resolved paint order via the\n  chrome-devtools MCP `evaluate_script` tool — instead of eyeballing a flat\n  screenshot. Invoke BEFORE declaring any UI, site, or styling\u002Flayout change\n  correct. Screenshots have no depth buffer, so z-index\u002Focclusion\u002Fclip bugs are\n  exactly where \"just look at it\" fails; the `evaluate_script` routines below\n  turn those fuzzy visual judgments into deterministic measurements — including\n  optical center-of-mass, which measures the glyph ink's true visual center so\n  differently-sized labels can be aligned by more than eye.\nmetadata:\n  internal: true\n---\n\n# Visual review — compute occlusion, don't perceive it\n\nA flat PNG has no depth buffer and no stacking-context model, so layering and clipping bugs (z-index, `overflow: hidden`, fixed\u002Fsticky overlays) are exactly where eyeballing fails. The browser already resolved the paint order; query it with `evaluate_script` (chrome-devtools MCP).\n\n**Run both passes.** Geometry catches occlusion the eye misses; the eye catches font-metric and color issues geometry misses.\n\n## Optical ≠ mathematical\n\nA layout can be geometrically consistent and still look wrong. Never declare a spacing\u002Falignment\u002Fcentering change correct from measurements alone — change it, screenshot it, look, and adjust by eye. Expect to nudge *against* the math when:\n\n- **Rounded caps (pills, `rounded-full`) eat edge space** — content at `px-3.5` from a rounded end looks tighter than against a square edge, so a pill with symmetric padding and a leading icon looks lopsided; the text-adjacent cap needs *more* padding (keep symmetric `px` on the pill, add `pr-*`\u002F`pl-*` per button on its text side).\n- **Icon ink ≠ icon box** — a `w-4` icon whose glyph is 14px and visually light leaves dead space, inflating the perceived gap beyond the measured flex `gap`.\n- **Optical ≠ geometric centering** — a glyph can be box-centered and ride visually high\u002Flow because the font's ink sits asymmetrically in the em.\n\nGeometry decides occlusion\u002Fclipping; the eye decides balance\u002Fscale\u002Fcentering.\n\n---\n\n## The `evaluate_script` routines\n\nReplace `'SELECTOR'` with a real CSS selector before running.\n\n### 1 — Occlusion (the non-negotiable check)\n\nReports what fraction of the element is actually visible, and names anything covering it.\n\n```js\n(selector => {\n  const el = document.querySelector(selector);\n  if (!el) return { error: 'not found' };\n  const r = el.getBoundingClientRect();\n  if (r.width === 0 || r.height === 0) return { error: 'zero-size box' };\n  const N = 5;                       \u002F\u002F 5×5 = 25 sample points across the box\n  let visible = 0; const coveredBy = new Set();\n  for (let i = 0; i \u003C N; i++) for (let j = 0; j \u003C N; j++) {\n    const x = r.left + (i + 0.5) \u002F N * r.width;\n    const y = r.top  + (j + 0.5) \u002F N * r.height;\n    const top = document.elementFromPoint(x, y);   \u002F\u002F topmost painted element here\n    if (top === el || el.contains(top)) visible++;\n    else if (top) coveredBy.add(top.tagName.toLowerCase() +\n                                (top.id ? '#' + top.id : '') +\n                                (top.className ? '.' + String(top.className).split(' ')[0] : ''));\n  }\n  return { coverage: visible \u002F (N * N), coveredBy: [...coveredBy] };\n})('SELECTOR')\n```\n\n`coverage === 1` → no occlusion. `coverage \u003C 1` with a `coveredBy` entry that is not an ancestor\u002Fdescendant → occlusion bug; the array names the covering element. No z-index reasoning required — `elementFromPoint` returns the browser's resolved paint order.\n\n### 2 — Ancestor overflow \u002F clip\n\n```js\n(selector => {\n  const el = document.querySelector(selector);\n  const r = el.getBoundingClientRect();\n  for (let p = el.parentElement; p; p = p.parentElement) {\n    const o = getComputedStyle(p).overflow;\n    if (o === 'visible') continue;\n    const pr = p.getBoundingClientRect();\n    if (r.left \u003C pr.left || r.top \u003C pr.top || r.right > pr.right || r.bottom > pr.bottom)\n      return { clippedBy: p.tagName + (p.id ? '#' + p.id : ''),\n               overflow: o, target: r, clip: pr };\n  }\n  return { clipped: false };\n})('SELECTOR')\n```\n\n`clipped: false` is clean. Anything else → the element is cropped by that ancestor.\n\n### 3 — Alignment and spacing\n\n```js\n([a, b] => {\n  const A = document.querySelector(a).getBoundingClientRect();\n  const B = document.querySelector(b).getBoundingClientRect();\n  return {\n    leftAligned: Math.abs(A.left - B.left),       \u002F\u002F px delta; ~0 = aligned\n    centerXdelta: Math.abs((A.left+A.right)\u002F2 - (B.left+B.right)\u002F2),\n    gap: B.top - A.bottom,                          \u002F\u002F vertical spacing between them\n  };\n})(['SEL_A', 'SEL_B'])\n```\n\nState verdicts in px: \"left-edge delta 2px (clean)\", \"gap 28px vs expected 24px.\"\n\n> `getBoundingClientRect` centers the **line box**, not the visible ink. Fine at the same font-size; for\n> elements at **different** font-sizes that must look centered together, use §5.\n\n### 4 — Viewport and off-screen\n\n```js\n(selector => {\n  const r = document.querySelector(selector).getBoundingClientRect();\n  return {\n    inViewport: r.top >= 0 && r.left >= 0 && r.bottom \u003C= innerHeight && r.right \u003C= innerWidth,\n    rect: r,\n    viewport: { w: innerWidth, h: innerHeight },\n  };\n})('SELECTOR')\n```\n\n### 5 — Optical center of mass (different font-sizes)\n\nMeasures the alpha-weighted centroid of the actual glyph ink by rasterizing each label's computed font to a canvas. Implementation lives beside this skill in [`optical-center.js`](optical-center.js); inline it into one `evaluate_script` call.\n\n```js\n\u002F\u002F after inlining optical-center.js in the same evaluate_script:\nopticalCenter(['.wordmark', 'a[href=\"\u002Fdocs\"]', 'a[href=\"\u002Fblog\"]'])\n\u002F\u002F  → results:[{selector, comY, deltaFromAnchor}],  cssHint:[{selector, nudge}]\n\u002F\u002F    deltaFromAnchor ~0 = optically aligned; cssHint gives the ready-to-paste translate.\n```\n\n- **One call does measure + fix + verify.** `{ apply: true }` nudges each non-anchor toward the anchor, re-measures the post-nudge DOM, and iterates until converged, returning `{ before, after, appliedTranslateY }`. Don't hand-derive nudges — transcribe `appliedTranslateY` to CSS.\n- **`{ overlay: true }` paints the analysis onto the page** (anchor solid-green, others dashed-red, px deltas labelled) so the next screenshot self-documents.\n- **Anchor choice matters** — a *filled* pill\u002Fbadge is optically centered by its BOX, not its caps ink; anchor to a bare-glyph sibling.\n- **Auto-handled:** the baseline probe uses `vertical-align:baseline`, which flex\u002Fgrid ignore, so the tool descends from a flex `\u003Ca>` to the inline element hosting the text.\n- **Scope:** exact for a single line of plain text. Letter-spacing, `text-shadow`, `-webkit-text-stroke`, gradient text, and raster content aren't in the font render — screenshot the element's clip box and centroid the real pixels instead, or trust the eye.\n\n**Keep it to ONE tool call.** To avoid re-inlining ~6KB, define it once via `navigate_page`'s `initScript` so `window.opticalCenter` exists in every later `evaluate_script`.\n\n### Portability\n\n`optical-center.js` is dependency-free, JSON-in\u002FJSON-out, no closure over outer scope, so it rides on any evaluate primitive. Pattern is always: **inject once (defines `window.opticalCenter`) → call it.**\n\n```js\n\u002F\u002F chrome-devtools MCP — inline in one evaluate_script, or persist via initScript:\nnavigate_page({ url, initScript: \u003Ccontents of optical-center.js> })\nevaluate_script(`() => window.opticalCenter(['.wm','a[href=\"\u002Fdocs\"]'], { overlay:true })`)\n\n\u002F\u002F Playwright (Node):\nawait page.addInitScript({ path: 'optical-center.js' });     \u002F\u002F window.opticalCenter on every doc\nconst r = await page.evaluate(([t,o]) => window.opticalCenter(t,o),\n                              [['.wm','a[href=\"\u002Fdocs\"]'], { apply:true }]);\n\n\u002F\u002F Puppeteer:\nawait page.evaluateOnNewDocument(fs.readFileSync('optical-center.js','utf8'));\nconst r = await page.evaluate((t,o) => window.opticalCenter(t,o),\n                              ['.wm','a[href=\"\u002Fdocs\"]'], { overlay:true });\n\n\u002F\u002F Selenium \u002F WebDriver (any language):\ndriver.execute_script(open('optical-center.js').read())       \u002F\u002F define it once\nr = driver.execute_script(\"return window.opticalCenter(arguments[0], arguments[1])\",\n                          ['.wm', 'a[href=\"\u002Fdocs\"]'], { 'apply': True })\n\n\u002F\u002F DevTools console \u002F bookmarklet: paste the file, then call opticalCenter([...]).\n```\n\n**Don't break these invariants when editing the file:** no `import`\u002F`export`\u002F`require` in the injected source, args stay plain JSON, the return stays JSON-serializable (never a DOM node), and it keeps defining a single global.\n\n---\n\n## Icon-beside-text alignment — measure each glyph's INK\n\nThe most-repeated visual defect: an icon, glyph, emoji, badge, or counter beside text, riding high or low. `items-center` centers the glyph's **BOX** on the flex line; the eye aligns **INK**, and those never coincide — a digit has no descender so its ink rides high, an SVG's ink sits wherever its path falls in its viewBox, and an emoji is a bitmap whose metrics ignore your font size.\n\nOne shared nudge cannot fix a cluster. Measure each glyph, correct each glyph. Illustrative divergence for a real count-badge cluster (11.5px text, 12px icons):\n\n| glyph | ink height | offset from the digit's ink center | correction |\n| --- | --- | --- | --- |\n| filled octicon | 10.8px | 1.16px low | `translateY(-0.1em)` |\n| lucide stroke glyph | 9.0px | 1.29px low | `translateY(-0.112em)` |\n| emoji | 16.0px | 0.26px — sub-pixel | none; a nudge only blurs the bitmap |\n\n- **Express the correction in `em`, never `px`,** then prove it by doubling the cluster's font size and re-measuring; the residual must stay near zero.\n- **Leave sub-pixel offsets alone.** Below ~0.3px you are under the device grid.\n- **Re-measure after correcting.** The residual should read ~0.01px.\n\n```js\n\u002F\u002F Baseline: an empty zero-size inline-block's bottom margin edge IS the baseline of the INLINE context\n\u002F\u002F it sits in. THE TRAP: a badge holder is usually inline-FLEX, so a probe appended there becomes a FLEX\n\u002F\u002F ITEM and reports the flex line's center — inflating a real 1.2px error into a plausible 3.5px one.\n\u002F\u002F Wrap the text node in its OWN inline span, probe INSIDE.\nconst baselineOfTextNode = (node) => {\n  const span = document.createElement(\"span\")\n  node.parentNode.insertBefore(span, node); span.appendChild(node)\n  const probe = document.createElement(\"span\")\n  probe.style.cssText = \"display:inline-block;width:0;height:0;padding:0;margin:0;border:0\"\n  span.appendChild(probe)\n  const baseline = probe.getBoundingClientRect().bottom\n  const cs = getComputedStyle(span)\n  const font = `${cs.fontStyle} ${cs.fontWeight} ${cs.fontSize} \u002F ${cs.lineHeight} ${cs.fontFamily}`\n  probe.remove(); span.parentNode.insertBefore(node, span); span.remove()\n  return { baseline, font }\n}\nconst inkOfText = (text, font, baseline) => {\n  const c = document.createElement(\"canvas\").getContext(\"2d\"); c.font = font\n  const m = c.measureText(text)\n  return { top: baseline - m.actualBoundingBoxAscent, bottom: baseline + m.actualBoundingBoxDescent }\n}\n\u002F\u002F An SVG geometry element's getBoundingClientRect IS its ink box (stroke included). Union EVERY child —\n\u002F\u002F a multi-path icon's ink is all of it, not the first path.\nconst inkOfSvg = (svg) => {\n  const rects = [...svg.querySelectorAll(\"path,rect,circle,ellipse,polyline,polygon,line\")]\n    .map((g) => g.getBoundingClientRect())\n  return { top: Math.min(...rects.map((r) => r.top)), bottom: Math.max(...rects.map((r) => r.bottom)) }\n}\n\u002F\u002F → returns textInkCenter - glyphInkCenter. NEGATIVE = glyph sits BELOW the text and must be LIFTED.\n```\n\n**Distrust a suspiciously large reading.** A 3.5px error on an 11.5px font is ~30% — a broken instrument, not a misalignment. If the number claims a gross error and the picture shows a subtle one, fix the instrument.\n\n**Mirror the real product before inventing a treatment.** If the thing exists in a product the user knows (GitHub, Linear, an existing component), drive the real one headless and read its computed values rather than designing from taste. Corollary: color belongs to an item's own state, not to its links.\n\n---\n\n## 7-step checklist\n\nRun for any change to `site\u002F` or other rendered UI. Steps 3–4 are what a screenshot review cannot do.\n\n0. **You are the first reviewer of your own screenshot.** Capturing evidence is not reviewing it. Read the shot back and hunt for what is WRONG — a glyph riding high, one mark heavier than its neighbours, a collision at a narrow width. Capture at a scale where the detail is judgeable. Never hand the user a screenshot you have not personally critiqued.\n1. **Screenshot** — `take_screenshot`, full page + tight crop around the changed element.\n2. **Console** — `list_console_messages`. A 200 alongside a thrown error is still a broken page.\n3. **Occlusion pass** — §1 on the changed element AND neighbors near fixed\u002Fsticky\u002Fabsolute\u002Foverlay elements. `coverage \u003C 1` with a non-ancestor cover → flag it.\n4. **Clip pass** — §2 on the changed element.\n5. **Alignment\u002Fspacing pass** — §3 for anything that should align or sit at a fixed gap. For labels at different font-sizes, §5. For any icon\u002Fglyph\u002Femoji beside text, the ink measurement above, per glyph, then re-measure the residual.\n6. **Viewport pass** — §4.\n7. **State the verdict in measurements.** \"coverage 1.0, clip: false, left-edge delta 0px\" — never a bare \"looks great.\"\n\n## If chrome-devtools MCP is unavailable\n\nSay so explicitly. Reason about stacking from the CSS (`position`, `z-index`, `overflow`, paint order), but label it inference, not measurement. Do not silently claim visual verification you couldn't do.\n","# Visual review — compute occlusion, don't perceive it\n\nA flat PNG has no depth buffer and no stacking-context model, so layering and clipping bugs (z-index, `overflow: hidden`, fixed\u002Fsticky overlays) are exactly where eyeballing fails. The browser already resolved the paint order; query it with `evaluate_script` (chrome-devtools MCP).\n\n**Run both passes.** Geometry catches occlusion the eye misses; the eye catches font-metric and color issues geometry misses.\n\n## Optical ≠ mathematical\n\nA layout can be geometrically consistent and still look wrong. Never declare a spacing\u002Falignment\u002Fcentering change correct from measurements alone — change it, screenshot it, look, and adjust by eye. Expect to nudge *against* the math when:\n\n- **Rounded caps (pills, `rounded-full`) eat edge space** — content at `px-3.5` from a rounded end looks tighter than against a square edge, so a pill with symmetric padding and a leading icon looks lopsided; the text-adjacent cap needs *more* padding (keep symmetric `px` on the pill, add `pr-*`\u002F`pl-*` per button on its text side).\n- **Icon ink ≠ icon box** — a `w-4` icon whose glyph is 14px and visually light leaves dead space, inflating the perceived gap beyond the measured flex `gap`.\n- **Optical ≠ geometric centering** — a glyph can be box-centered and ride visually high\u002Flow because the font's ink sits asymmetrically in the em.\n\nGeometry decides occlusion\u002Fclipping; the eye decides balance\u002Fscale\u002Fcentering.\n\n---\n\n## The `evaluate_script` routines\n\nReplace `'SELECTOR'` with a real CSS selector before running.\n\n### 1 — Occlusion (the non-negotiable check)\n\nReports what fraction of the element is actually visible, and names anything covering it.\n\n```js\n(selector => {\n  const el = document.querySelector(selector);\n  if (!el) return { error: 'not found' };\n  const r = el.getBoundingClientRect();\n  if (r.width === 0 || r.height === 0) return { error: 'zero-size box' };\n  const N = 5;                       \u002F\u002F 5×5 = 25 sample points across the box\n  let visible = 0; const coveredBy = new Set();\n  for (let i = 0; i \u003C N; i++) for (let j = 0; j \u003C N; j++) {\n    const x = r.left + (i + 0.5) \u002F N * r.width;\n    const y = r.top  + (j + 0.5) \u002F N * r.height;\n    const top = document.elementFromPoint(x, y);   \u002F\u002F topmost painted element here\n    if (top === el || el.contains(top)) visible++;\n    else if (top) coveredBy.add(top.tagName.toLowerCase() +\n                                (top.id ? '#' + top.id : '') +\n                                (top.className ? '.' + String(top.className).split(' ')[0] : ''));\n  }\n  return { coverage: visible \u002F (N * N), coveredBy: [...coveredBy] };\n})('SELECTOR')\n```\n\n`coverage === 1` → no occlusion. `coverage \u003C 1` with a `coveredBy` entry that is not an ancestor\u002Fdescendant → occlusion bug; the array names the covering element. No z-index reasoning required — `elementFromPoint` returns the browser's resolved paint order.\n\n### 2 — Ancestor overflow \u002F clip\n\n```js\n(selector => {\n  const el = document.querySelector(selector);\n  const r = el.getBoundingClientRect();\n  for (let p = el.parentElement; p; p = p.parentElement) {\n    const o = getComputedStyle(p).overflow;\n    if (o === 'visible') continue;\n    const pr = p.getBoundingClientRect();\n    if (r.left \u003C pr.left || r.top \u003C pr.top || r.right > pr.right || r.bottom > pr.bottom)\n      return { clippedBy: p.tagName + (p.id ? '#' + p.id : ''),\n               overflow: o, target: r, clip: pr };\n  }\n  return { clipped: false };\n})('SELECTOR')\n```\n\n`clipped: false` is clean. Anything else → the element is cropped by that ancestor.\n\n### 3 — Alignment and spacing\n\n```js\n([a, b] => {\n  const A = document.querySelector(a).getBoundingClientRect();\n  const B = document.querySelector(b).getBoundingClientRect();\n  return {\n    leftAligned: Math.abs(A.left - B.left),       \u002F\u002F px delta; ~0 = aligned\n    centerXdelta: Math.abs((A.left+A.right)\u002F2 - (B.left+B.right)\u002F2),\n    gap: B.top - A.bottom,                          \u002F\u002F vertical spacing between them\n  };\n})(['SEL_A', 'SEL_B'])\n```\n\nState verdicts in px: \"left-edge delta 2px (clean)\", \"gap 28px vs expected 24px.\"\n\n> `getBoundingClientRect` centers the **line box**, not the visible ink. Fine at the same font-size; for\n> elements at **different** font-sizes that must look centered together, use §5.\n\n### 4 — Viewport and off-screen\n\n```js\n(selector => {\n  const r = document.querySelector(selector).getBoundingClientRect();\n  return {\n    inViewport: r.top >= 0 && r.left >= 0 && r.bottom \u003C= innerHeight && r.right \u003C= innerWidth,\n    rect: r,\n    viewport: { w: innerWidth, h: innerHeight },\n  };\n})('SELECTOR')\n```\n\n### 5 — Optical center of mass (different font-sizes)\n\nMeasures the alpha-weighted centroid of the actual glyph ink by rasterizing each label's computed font to a canvas. Implementation lives beside this skill in [`optical-center.js`](optical-center.js); inline it into one `evaluate_script` call.\n\n```js\n\u002F\u002F after inlining optical-center.js in the same evaluate_script:\nopticalCenter(['.wordmark', 'a[href=\"\u002Fdocs\"]', 'a[href=\"\u002Fblog\"]'])\n\u002F\u002F  → results:[{selector, comY, deltaFromAnchor}],  cssHint:[{selector, nudge}]\n\u002F\u002F    deltaFromAnchor ~0 = optically aligned; cssHint gives the ready-to-paste translate.\n```\n\n- **One call does measure + fix + verify.** `{ apply: true }` nudges each non-anchor toward the anchor, re-measures the post-nudge DOM, and iterates until converged, returning `{ before, after, appliedTranslateY }`. Don't hand-derive nudges — transcribe `appliedTranslateY` to CSS.\n- **`{ overlay: true }` paints the analysis onto the page** (anchor solid-green, others dashed-red, px deltas labelled) so the next screenshot self-documents.\n- **Anchor choice matters** — a *filled* pill\u002Fbadge is optically centered by its BOX, not its caps ink; anchor to a bare-glyph sibling.\n- **Auto-handled:** the baseline probe uses `vertical-align:baseline`, which flex\u002Fgrid ignore, so the tool descends from a flex `\u003Ca>` to the inline element hosting the text.\n- **Scope:** exact for a single line of plain text. Letter-spacing, `text-shadow`, `-webkit-text-stroke`, gradient text, and raster content aren't in the font render — screenshot the element's clip box and centroid the real pixels instead, or trust the eye.\n\n**Keep it to ONE tool call.** To avoid re-inlining ~6KB, define it once via `navigate_page`'s `initScript` so `window.opticalCenter` exists in every later `evaluate_script`.\n\n### Portability\n\n`optical-center.js` is dependency-free, JSON-in\u002FJSON-out, no closure over outer scope, so it rides on any evaluate primitive. Pattern is always: **inject once (defines `window.opticalCenter`) → call it.**\n\n```js\n\u002F\u002F chrome-devtools MCP — inline in one evaluate_script, or persist via initScript:\nnavigate_page({ url, initScript: \u003Ccontents of optical-center.js> })\nevaluate_script(`() => window.opticalCenter(['.wm','a[href=\"\u002Fdocs\"]'], { overlay:true })`)\n\n\u002F\u002F Playwright (Node):\nawait page.addInitScript({ path: 'optical-center.js' });     \u002F\u002F window.opticalCenter on every doc\nconst r = await page.evaluate(([t,o]) => window.opticalCenter(t,o),\n                              [['.wm','a[href=\"\u002Fdocs\"]'], { apply:true }]);\n\n\u002F\u002F Puppeteer:\nawait page.evaluateOnNewDocument(fs.readFileSync('optical-center.js','utf8'));\nconst r = await page.evaluate((t,o) => window.opticalCenter(t,o),\n                              ['.wm','a[href=\"\u002Fdocs\"]'], { overlay:true });\n\n\u002F\u002F Selenium \u002F WebDriver (any language):\ndriver.execute_script(open('optical-center.js').read())       \u002F\u002F define it once\nr = driver.execute_script(\"return window.opticalCenter(arguments[0], arguments[1])\",\n                          ['.wm', 'a[href=\"\u002Fdocs\"]'], { 'apply': True })\n\n\u002F\u002F DevTools console \u002F bookmarklet: paste the file, then call opticalCenter([...]).\n```\n\n**Don't break these invariants when editing the file:** no `import`\u002F`export`\u002F`require` in the injected source, args stay plain JSON, the return stays JSON-serializable (never a DOM node), and it keeps defining a single global.\n\n---\n\n## Icon-beside-text alignment — measure each glyph's INK\n\nThe most-repeated visual defect: an icon, glyph, emoji, badge, or counter beside text, riding high or low. `items-center` centers the glyph's **BOX** on the flex line; the eye aligns **INK**, and those never coincide — a digit has no descender so its ink rides high, an SVG's ink sits wherever its path falls in its viewBox, and an emoji is a bitmap whose metrics ignore your font size.\n\nOne shared nudge cannot fix a cluster. Measure each glyph, correct each glyph. Illustrative divergence for a real count-badge cluster (11.5px text, 12px icons):\n\n| glyph | ink height | offset from the digit's ink center | correction |\n| --- | --- | --- | --- |\n| filled octicon | 10.8px | 1.16px low | `translateY(-0.1em)` |\n| lucide stroke glyph | 9.0px | 1.29px low | `translateY(-0.112em)` |\n| emoji | 16.0px | 0.26px — sub-pixel | none; a nudge only blurs the bitmap |\n\n- **Express the correction in `em`, never `px`,** then prove it by doubling the cluster's font size and re-measuring; the residual must stay near zero.\n- **Leave sub-pixel offsets alone.** Below ~0.3px you are under the device grid.\n- **Re-measure after correcting.** The residual should read ~0.01px.\n\n```js\n\u002F\u002F Baseline: an empty zero-size inline-block's bottom margin edge IS the baseline of the INLINE context\n\u002F\u002F it sits in. THE TRAP: a badge holder is usually inline-FLEX, so a probe appended there becomes a FLEX\n\u002F\u002F ITEM and reports the flex line's center — inflating a real 1.2px error into a plausible 3.5px one.\n\u002F\u002F Wrap the text node in its OWN inline span, probe INSIDE.\nconst baselineOfTextNode = (node) => {\n  const span = document.createElement(\"span\")\n  node.parentNode.insertBefore(span, node); span.appendChild(node)\n  const probe = document.createElement(\"span\")\n  probe.style.cssText = \"display:inline-block;width:0;height:0;padding:0;margin:0;border:0\"\n  span.appendChild(probe)\n  const baseline = probe.getBoundingClientRect().bottom\n  const cs = getComputedStyle(span)\n  const font = `${cs.fontStyle} ${cs.fontWeight} ${cs.fontSize} \u002F ${cs.lineHeight} ${cs.fontFamily}`\n  probe.remove(); span.parentNode.insertBefore(node, span); span.remove()\n  return { baseline, font }\n}\nconst inkOfText = (text, font, baseline) => {\n  const c = document.createElement(\"canvas\").getContext(\"2d\"); c.font = font\n  const m = c.measureText(text)\n  return { top: baseline - m.actualBoundingBoxAscent, bottom: baseline + m.actualBoundingBoxDescent }\n}\n\u002F\u002F An SVG geometry element's getBoundingClientRect IS its ink box (stroke included). Union EVERY child —\n\u002F\u002F a multi-path icon's ink is all of it, not the first path.\nconst inkOfSvg = (svg) => {\n  const rects = [...svg.querySelectorAll(\"path,rect,circle,ellipse,polyline,polygon,line\")]\n    .map((g) => g.getBoundingClientRect())\n  return { top: Math.min(...rects.map((r) => r.top)), bottom: Math.max(...rects.map((r) => r.bottom)) }\n}\n\u002F\u002F → returns textInkCenter - glyphInkCenter. NEGATIVE = glyph sits BELOW the text and must be LIFTED.\n```\n\n**Distrust a suspiciously large reading.** A 3.5px error on an 11.5px font is ~30% — a broken instrument, not a misalignment. If the number claims a gross error and the picture shows a subtle one, fix the instrument.\n\n**Mirror the real product before inventing a treatment.** If the thing exists in a product the user knows (GitHub, Linear, an existing component), drive the real one headless and read its computed values rather than designing from taste. Corollary: color belongs to an item's own state, not to its links.\n\n---\n\n## 7-step checklist\n\nRun for any change to `site\u002F` or other rendered UI. Steps 3–4 are what a screenshot review cannot do.\n\n0. **You are the first reviewer of your own screenshot.** Capturing evidence is not reviewing it. Read the shot back and hunt for what is WRONG — a glyph riding high, one mark heavier than its neighbours, a collision at a narrow width. Capture at a scale where the detail is judgeable. Never hand the user a screenshot you have not personally critiqued.\n1. **Screenshot** — `take_screenshot`, full page + tight crop around the changed element.\n2. **Console** — `list_console_messages`. A 200 alongside a thrown error is still a broken page.\n3. **Occlusion pass** — §1 on the changed element AND neighbors near fixed\u002Fsticky\u002Fabsolute\u002Foverlay elements. `coverage \u003C 1` with a non-ancestor cover → flag it.\n4. **Clip pass** — §2 on the changed element.\n5. **Alignment\u002Fspacing pass** — §3 for anything that should align or sit at a fixed gap. For labels at different font-sizes, §5. For any icon\u002Fglyph\u002Femoji beside text, the ink measurement above, per glyph, then re-measure the residual.\n6. **Viewport pass** — §4.\n7. **State the verdict in measurements.** \"coverage 1.0, clip: false, left-edge delta 0px\" — never a bare \"looks great.\"\n\n## If chrome-devtools MCP is unavailable\n\nSay so explicitly. Reason about stacking from the CSS (`position`, `z-index`, `overflow`, paint order), but label it inference, not measurement. Do not silently claim visual verification you couldn't do.\n",{"name":5,"metadata":24,"description":7},{"internal":25},true,"main","9b734566fd36ceed8379f67a92291bc68af60801",".claude\u002Fskills\u002Fvisual-review",71,"https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub","https:\u002F\u002Fnubjs.com","https:\u002F\u002Fgithub.com\u002Fnubjs","The all-in-one Node.js toolkit","2026-11-14 14:11:35",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":25},[37,40,43],{"tool":38,"command":39},"npx","npx skills add nubjs\u002Fnub --skill visual-review",{"tool":41,"command":42},"bunx","bunx skills add nubjs\u002Fnub --skill visual-review",{"tool":44,"command":45},"pnpm","pnpm dlx skills add nubjs\u002Fnub --skill visual-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fvisual-review\u002FSKILL.md",[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"optical-center.js","SCRIPT","脚本",8947,"https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fvisual-review\u002Foptical-center.js",[55,61,67,74,81,88],{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M758BSH88RVXBG8TPCT427TY","nub","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002Fskills\u002Fnub\u002FSKILL.md",[],[],{"skillNo":62,"name":57,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M758BKPRHXS5MS27WG908PBG","This project uses nub, a single Rust CLI that runs on the project's installed Node and replaces the everyday Node toolchain. ALWAYS prefer nub over node, bun, npm, npx, pnpm, and yarn for: executing JS\u002FTS files, running package.json scripts, the npx-equivalent, installing dependencies, watch mode, and Node version management. Surfaces whenever you would otherwise reach for node\u002Fbun\u002Fnpm\u002Fnpx or a package manager.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002Fsite\u002Fpublic\u002Fskill.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M758BCR8A21H8P4TQ0YRHTC7","worktree","Create and manage isolated git worktrees for parallel build\u002Ftest\u002Flanding work on the nub repo. Invoke (via the Skill tool) whenever you need a fresh worktree to land a change, when you want to know what `.worktreeinclude` does or how to add an entry, or when cleaning up after a merge. Encodes the one-command setup (`nub scripts\u002Fnew-worktree.ts \u003Cslug>` or `node …`) that bakes in the proven recipe — worktree off origin\u002Fmain (vendor\u002Faube is plain in-tree files now, no submodule init), the shared CARGO_TARGET_DIR (`~\u002F.cache\u002Fnub\u002Fshared-target`) that all worktrees reuse, and applying `.worktreeinclude` — plus the eagerly-pull-the-shared-tree discipline and the safe cleanup path. Pairs with the `dev-loop` build skill.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fworktree\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M758B9NZ1GQMD1A6B25NK0D9","windows-vm-test","Run ad-hoc Nub tests and debugging probes in the maintainer's existing local Windows 11 ARM64 QEMU\u002FHVF VM when its external disk and runbook are present. Use for interactive win32-arm64 or Windows-on-ARM x64-emulation checks; use ci-adhoc-test for true x64-native behavior or when the local VM is unavailable.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fwindows-vm-test\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M758AWPM7CE440NBAYJHD44J","type-declarations","Add, audit, or update @nubjs\u002Ftypes declarations for Nub runtime APIs. Use whenever Nub adds or changes a user-visible global, built-in method, module loader type, or TC39 proposal; when TypeScript or @types\u002Fnode gains an overlapping declaration; and before every release to reconcile runtime changes since the previous tag. Covers conflict-safe global augmentation, compiler-version routing, fixture matrices, and package verification.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftype-declarations\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M758ARA9YKHET16KTPXNTZXR","soak","Manages the repo's supply-chain soak window (SOAK_DAYS) — checks and fixes the derived surfaces, bumps or disables the window, adds dated per-package exclusions, and bumps pinned external tools. Use when a task touches minimumReleaseAge, min-release-age, min-publish-age, external-tools.json, renovate.json, or taze cooldowns, or when investigating why a freshly published version won't install.","https:\u002F\u002Fgithub.com\u002Fnubjs\u002Fnub\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fsoak\u002FSKILL.md",[],[]]