[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DJKTYSQWN5YYT7ZFAGYRVG":3,"skill-same:01M7DJKTYSQWN5YYT7ZFAGYRVG":57},{"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":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":6,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M7DJKTYSQWN5YYT7ZFAGYRVG","design-spatial",null,"Design — spatial composition","Hazek-dc\u002FPresensiGuru_FaceNet_EMAR","Hazek-dc","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F75208960?v=4","01M7DEQV5B4YGS86A81DYH81DR","Hazek","01M7DEQV5XP4TM0C6NTHXCXCHR",1,"MIT","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-spatial\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: design-spatial\ndescription: Design — spatial composition\nrisk: unknown\nsource: https:\u002F\u002Fgithub.com\u002Fconnerkward\u002Fckw-design-skill\u002Ftree\u002Fmain\u002Fdeterministic-design\u002Fdesign-spatial\nsource_repo: connerkward\u002Fckw-design-skill\nsource_type: community\ndate_added: 2026-07-01\nlicense: MIT\nlicense_source: https:\u002F\u002Fgithub.com\u002Fconnerkward\u002Fckw-design-skill\u002Fblob\u002Fmain\u002FLICENSE\n---\n\n# Design — spatial composition\n## When to Use\n\nUse this skill when you need design — spatial composition.\n\n\nA model cannot trust its own UI output. Everything else follows from two failures.\n\n## 1. It can't see what it made\n\nUI is generated as a token stream, never as pixels — so the model cannot perceive collisions, overlap, imbalance, or broken spacing. It will write a headline that runs into the hero image and have no idea.\n\n**Render it and judge the image, not the code.** Serve with any static server (e.g. `python3 -m http.server` or `npx serve`) and screenshot headless via Playwright. Screenshot at a few widths.\n\n**Critique with fresh eyes — not your own.** Grading your own output rationalizes it; the builder looks at its overlapping headline and calls it fine (this is exactly how a real collision shipped in testing). Use a separate judge — a subagent that did *not* write the page — and tell it to hunt for what's *wrong*: collisions, edge tangents, ragged alignment, lopsided weight, no clear focal point, breaks at some width. Fix, re-render, re-judge.\n\n## 2. Its first idea is the average\n\nWhatever it produces first is the mean of its training data — and there is more than one mean:\n\n- the **generic-AI mean**: Inter, purple-on-white gradients, centered single column, three equal cards;\n- the **designer-trend mean**: oversized condensed caps, dark-mode + grain, monospace \"vibes\" microtext, sticker badges.\n\nLanding on the second isn't taste — it's a more flattering average, which is why it slips past. **Treat your first instinct as the mean and deviate deliberately — toward *this product's specific world*** (use design-thinking's domain \u002F color-world \u002F signature as the direction), **not toward another trend.** If the result could be any startup, you shipped the mean.\n\n## 3. So don't prescribe a style\n\nAny fixed rule — a 12-col grid, an 8-point scale, \"mono = data\" — *becomes* next cycle's mean, and a blind model executes it into collisions anyway. Prescribe the **process, not the look**: see it with fresh eyes, and push off the average toward the domain. Taste supplies the direction (design-thinking \u002F design-philosophy); this skill only insists you **look** and **don't ship the mean**.\n\nFor iterative spatial tuning, a local page with live controls (sliders, pickers, drag handles) beats one-shot critique.\n\n## 4. NEVER ship horizontal overflow — THE mandatory gate, no exceptions\n\n> **BLOCKING GATE. You may not call any web UI \"done\", \"working\", \"fixed\", or\n> \"looks good\" until you have run the `scrollWidth` check below at a narrow width\n> THIS turn and seen `0`. Not \"I added overflow-x:clip so it's fine.\" Not \"it\n> looked fine at my width.\" MEASURE. Narrow. Every time. If you didn't measure,\n> it isn't done — say \"haven't checked overflow yet\" instead of claiming done.**\n\nA side-to-side scrollbar that doesn't match the content is the **single most common\nand most embarrassing** layout failure, and it ships *over and over* because the dev\nviewport is wide enough to hide it — the overflow only appears once the window is\nnarrower than some element. It is **invisible at desktop width**, so the §1\nrender-critique loop will NOT catch it unless you screenshot narrow. Separate,\nexplicit, non-negotiable gate.\n\n**It recurs because layouts GROW after they were last checked.** Every time you add a\nnav tab, a toolbar button, a header control, a chip, a wider equation\u002F`\u003Cpre>`, or any\nnew item to a `flex`\u002F`inline` row, you have invalidated the last overflow check — the\nrow that fit yesterday now pushes past the edge between ~720–1200px while your 1440px\ndev window shows nothing wrong. (Real ship, 2026-06, TWICE: a progress-bar edge label\noverflowed 23px; then a `flex-wrap:nowrap` header that grew 4 tabs scrolled the whole\npage 309px across 720–1200px — both invisible at dev width, both caught only by\nmeasuring narrow.) **So: any change that adds an element to a horizontal row re-arms\nthis gate. Re-measure.**\n\n**Default defenses to apply up front (so the gate passes by construction):**\n- **Header \u002F nav \u002F toolbar rows: `flex-wrap: wrap`, never `nowrap`.** A growing\n  single-row flex is the #1 source of this bug. Wrapping is a no-op when it fits and\n  saves you when it doesn't.\n- **`body { overflow-x: clip }`** as a backstop on every app (clip, not hidden — keeps\n  sticky\u002Fanchored layouts working). A backstop, NOT a substitute for measuring.\n\n**The check — run before calling ANY page done:** `document.documentElement.scrollWidth - document.documentElement.clientWidth` must equal `0`, tested at your dev width AND resized narrow (≤1024px, and a phone width ~390px). If > 0, find the offender:\n```js\ndocument.querySelectorAll('*').forEach(el=>{const r=el.getBoundingClientRect();\n  if(r.right>innerWidth+1||r.left\u003C-1) console.log(Math.round(r.right), el);});\n```\n\n**Safety net:** `overflow-x: clip` on `body` (prefer `clip` over `hidden` — it clips without creating a scroll container, so it won't break `position:sticky`\u002Fanchored layouts). But a net is not a fix — **find and kill the root cause:**\n\n- **`position:absolute` + `white-space:nowrap` anchored at an edge** (`left:100%`, `right:0`): a *centered* nowrap label on the right edge juts past the viewport. (Real ship, 2026-06: a progress bar's \"300 · learned model\" milestone label at `left:100%` with `translateX(-50%)` overflowed 23px → phantom horizontal scroll at sub-1180px widths.) **Anchor edge labels inward** — right end `right:0; transform:none`, left end `left:0; transform:none`.\n- **`100vw`** — includes the scrollbar width (~15px), so on any vertically-scrolling page it guarantees ~15px of horizontal overflow. Use `100%`.\n- **flex \u002F grid children without `min-width:0`** — they refuse to shrink below their content and blow out the track (a long title in a flex card, a `\u003Cpre>` in a grid cell). Add `min-width:0`.\n- **long unbreakable strings** (URLs, hashes, tokens): `overflow-wrap:anywhere` or `word-break:break-word`.\n- fixed pixel widths wider than the viewport; large negative margins; oversized `position:absolute` elements.\n\nThe generalization: **anything pinned to an edge or sized in viewport units is a horizontal-overflow suspect — test narrow, measure `scrollWidth`, clip the body as backstop, and anchor edge-pinned content inward.**\n\n## 5. Lay out in TASK order — minimize transition cost\n\nBefore placing elements, **walk the user's actual step sequence for completing the\npage's action**, then arrange elements in that same perceptual\u002Fview order. The\nlayout should read like the task: orient → work → confirm. Any mouse travel or\nscrolling that serves no practical purpose is a defect.\n\n- **Orient at top:** controls\u002Foptions up top are good — they tell the user what\n  the page is for and what it can do before they commit to reading it.\n- **Confirm where the work ENDS:** if the task is \"review a long list, then act\"\n  (approve, flag, submit, save), the action buttons must ALSO exist at the\n  bottom — where the user's eyes and cursor are when they finish. The original\n  failure: a delete-review page with confirm buttons only in the top toolbar —\n  after scrolling through 120 images, the user had to scroll all the way back up\n  to click \"flag the rest.\" Duplicate the action bar at the bottom (or make the\n  toolbar sticky); both are one line of code, the scroll-back is paid per page.\n- **The heuristic: save the user transit time.** Every interaction has a path:\n  where the eyes\u002Fcursor are when a step ends vs where the next step's control\n  is. Sum those distances; shrink the big ones. Fitts's law for the page as a\n  whole, not just one button.\n- **Check it in the render-and-critique loop (§1):** ask the judge \"trace the\n  task: where is the user when they finish each step, and how far is the next\n  control?\" — a layout can be aligned, balanced, and still force a round trip.\n\n## 6. Balance is measurable — don't eyeball it (or trust a VLM's eye)\n\n§1 says render and have fresh eyes critique it. That qualitative pass catches\ncollisions and ragged alignment, but **a model has no reliable sense of visual\nbalance** — ask a VLM \"is this centered \u002F balanced?\" and it confabulates a verdict.\nThe fix is to stop asking opinions and **measure a number**, then keep that number\nhonest with an *independent* check. Use both: §1's fresh-eyes critique AND the hard\nnumber below. (This pairs a live in-browser box model + auto-balancer with an\noffline pixel-oracle that re-measures the rendered screenshot — see the\n`layout-audit.js` companion script in this skill.)\n\n**The principle.** Visual balance is the *center of mass of visual weight*. It's\narithmetic, not taste — so compute it.\n\n**Optical center, not geometric.** Target `x = 0.50`, `y ≈ 0.46` — slightly high,\nbecause a centroid at literal 50% reads as sagging.\n\n**Visual weight = area × ink-density, not area alone.** Same-size ≠ same-weight: a\nsolid-black heading is heavy; a grey\u002FASCII\u002Flight image reads far lighter than its\narea; body text is sparse. Calibrated starting multipliers (from `asym.html`, re-tune\nper project — these were hand-guesses until corrected against the pixel oracle):\n```js\nconst DENS = {portrait:0.34, h1:0.82, kicker:0.42, lead:0.22, body:0.16, meta:0.5};\n```\n\n**Centroid.** Per axis, `centroid = Σ(wᵢ·posᵢ) \u002F Σwᵢ`; balanced ⇔ the centroid sits\non the optical center. To FIX imbalance, think see-saw: what counts is the **moment**\n= weight × distance-from-axis, so a heavy element near the edge is counterweighted by\n(a) an opposing weight, (b) a bigger element on the other side, (c) pulling the heavy\nelement inward (shorter lever arm), or (d) shrinking it. That's exactly the\nauto-balancer's escalation order in `asym.html` — grow the opposing heading first\n(cheapest), then add weight, then pull the heavy element in, then shrink it (last\nresort).\n\n**Two models — and why you need the independent one:**\n- **Cheap box model** (live tuning): put each element's weight at its bounding-box\n  *center*. Instant, fine for dragging sliders. BUT it has a systematic bug —\n  left-aligned text's ink sits *left* of its box, so the box model misplaces the\n  weight. A metric that shares the layout's own assumptions is **circular**; it once\n  reported \"balanced\" at a pixel-measured 0.93 lopsided.\n- **Ground-truth pixel oracle** (`analyze.py`): rasterize the *rendered* page\n  (Playwright screenshot or html2canvas) and take the centroid of actual non-paper\n  pixels, weighting each pixel by its distance from the background color. It knows\n  nothing about the layout's intent — it just counts ink. **When the box model and\n  the pixels disagree, the pixels win.** (`asym.html` closes the loop: it regresses\n  the box-vs-pixel discrepancy and offers a trust dial α to blend toward the oracle.)\n- **Acceptance criterion (measurable):** `|centroid_x − 0.50| \u003C 0.03` and\n  `|centroid_y − 0.46| \u003C 0.04`, plus low left\u002Fright and top\u002Fbottom imbalance\n  (`|w_left − w_right| \u002F total`).\n\n**The verification gate (lighter than §4's, same spirit).** Before calling a\nbalance-critical layout \"balanced\", do NOT assert it from the code or a VLM opinion —\nscreenshot the *rendered* page, compute the ink-centroid offset from optical center,\nand report the actual number. This is the design-skill application of\n`verify-outputs-rule`: look at the real artifact, and make the validating check\n(pixels) independent of the thing you tuned (the layout). It's the quantitative\ncomplement to §1's qualitative critique.\n\n## 7. The layout audit — metrics that MEDIATE the eye, never replace it\n\n§6 covers balance; this generalizes it to a full deterministic sweep, and fixes the\nfailure mode that matters most: **the model reads a metric\u002FJSON and never looks at the\nscreenshot, so it can't apply the common sense that catches the metric being wrong.**\n\n`scripts\u002Flayout-audit.js` is a dependency-free pass you run via Playwright MCP\n`browser_evaluate` on a rendered page. It measures six things deterministically — all\ngeometry, color, and pixels, no \"does this look right?\":\n\n| check | how (deterministic) | tier |\n|---|---|---|\n| **collision** | content-rect intersection ≥12% | gate |\n| **contrast** | WCAG luminance ratio of text vs effective bg (\u003C4.5, large \u003C3) | gate |\n| **tap** | interactive targets \u003C44×44 (Apple HIG) | gate |\n| **overflow** | `scrollWidth − clientWidth` (the §4 gate) | gate |\n| **alignment** | left-edge clusters → near-misses 1–7px off the shared line | signal |\n| **spacing** | gap CoV among a container's children | signal |\n| **balance** | ink-density-weighted centroid vs optical center (§6) | signal |\n\n**What makes it mediate rather than replace:** it doesn't just return JSON — it **draws\nevery finding as an SVG overlay onto the page**, so the *next* `browser_take_screenshot`\nis an **annotated screenshot**. The number tells you WHERE to look; you then look and\ndecide. This is mandatory, not optional:\n\n```\nbrowser_evaluate({ function: \"() => { \u003Cpaste scripts\u002Flayout-audit.js> ; return __audit({}); }\" })\nbrowser_take_screenshot()      \u002F\u002F ← the overlay is now on the page. VIEW IT. Reason over it.\n```\n\nPass `{align:'.card .title,.card .price', space:'.feature-list'}` to scope the two\nselector-dependent checks; pass `{contentSelector:'…'}` for non-semantic layouts where\ncollision needs help finding the blocks.\n\n**These are HEURISTICS, not laws — and they split into two kinds you must not conflate:**\n\n- **GATES = correctness** (overflow, contrast, tap). These measure accessibility\u002F\n  usability *facts*, not taste. Failing one is a real defect. Safe to **block** on.\n  (Collision is a near-gate: usually a real bug, but can be intentional — so eye-confirm,\n  don't auto-fail.)\n- **SIGNALS = convention** (balance, alignment, spacing rhythm). These measure how\n  closely the layout matches a *symmetric, regular, gridded* aesthetic — which is exactly\n  the **generic mean** §2 tells you to push *away* from. **Optimizing a layout to maximize\n  these scores makes it blander.** An off-center balance, a deliberate misalignment, an\n  uneven rhythm are core creative tools and frequently the best thing on the page. Treat\n  signals as \"worth a look,\" **never** as defects to fix.\n\n**The discipline (the whole point — bias hard toward this):**\n- **Never accept a metric you have not looked at.** A flag is a *pointer to look*, not a\n  verdict. Reading `collisions: 1` and acting without viewing the annotated shot is the\n  exact failure this section exists to kill.\n- **Use signals to catch ACCIDENTS, never to enforce convention.** A 7px alignment drift\n  you didn't mean, a phantom scrollbar, a 1.9:1 caption — catch those. But the *same*\n  balance\u002Falignment\u002Fspacing signal fires on deliberate asymmetry, intentional overlap,\n  and expressive rhythm. **When the metric and the interesting choice conflict, the\n  interesting choice usually wins.** Do not \"fix\" a signal toward symmetry\u002Fevenness unless\n  the eye judges the deviation actually worse. A model that maximizes these scores designs\n  the mean.\n- **Overrule flags the eye judges intentional.** Brutalist headline overlap, avatar on a\n  banner, asymmetric hero — the metric flags them; common sense overrules. Proven live in\n  the worked example: obeying the collision check on the brutalist mock removes the overlap\n  and the design goes *flat*.\n- **Gates are necessary, not sufficient.** `gates_pass:true` (overflow\u002Fcontrast\u002Ftap all 0)\n  clears the deterministic floor — it does **not** mean the layout is good. A bland centered\n  template passes every gate and is still the mean. After gates pass, the real judgment (§1\n  fresh-eyes critique, taste, brand fit) still has to happen.\n\n**The proof, made concrete:** build a page that runs all six algorithms live on a few\nrealistic mock sites in different styles, each with a toggle between the layout **as\ndesigned** and the version **obeying the metric**, plus on-render overlays. It shows both\nhalves: obeying a *gate* fixes a real bug (low-contrast CTA, sub-44 tap target, overlapping\ncards), while obeying a *signal* makes it worse (an asymmetric editorial hero is the more\ninteresting layout; \"correcting\" a deliberate brutalist overlap flattens it). That explorable\nis where `layout-audit.js` was distilled from.\n\n## 8. Optical craft — perception beats geometry\n\nThe audit's alignment check (§7) measures *geometric* edges. The eye doesn't read geometry,\nit reads perception — so a few cases need a manual nudge the metric can't make. These are\neye-judgments, not gates. (From the Web Interface Guidelines, `vercel-labs\u002Fweb-interface-guidelines` @ `4e799d4`.)\n\n- **Optical alignment — nudge ±1–2px when it *looks* off though it measures centered.** A\n  play-triangle in a round button must shift right of geometric center to look centered (its\n  visual mass is left-biased). Glyphs, arrows, and asymmetric icons often need the same. Text\n  vertically centered by box metrics frequently sits a hair low — lift it. Geometry is the\n  starting point; the eye is the judge.\n- **Balance icon\u002Ftext lockups.** When an icon sits beside text, match their *visual weight* —\n  adjust the icon's stroke, size, spacing, or color so neither overpowers. A thin-stroke icon\n  next to medium-weight text looks weak; thicken its stroke (or size it up slightly) so they\n  read as one lockup. Optical size, not equal pixel size, is the target.\n- This is the same principle as the §6\u002F§7 debias: the number gets you close; the eye makes the\n  final 1px call. Don't let a geometric alignment metric *prevent* an optical correction.\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream source and local project context.\n- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.\n- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n","# Design — spatial composition\n## When to Use\n\nUse this skill when you need design — spatial composition.\n\n\nA model cannot trust its own UI output. Everything else follows from two failures.\n\n## 1. It can't see what it made\n\nUI is generated as a token stream, never as pixels — so the model cannot perceive collisions, overlap, imbalance, or broken spacing. It will write a headline that runs into the hero image and have no idea.\n\n**Render it and judge the image, not the code.** Serve with any static server (e.g. `python3 -m http.server` or `npx serve`) and screenshot headless via Playwright. Screenshot at a few widths.\n\n**Critique with fresh eyes — not your own.** Grading your own output rationalizes it; the builder looks at its overlapping headline and calls it fine (this is exactly how a real collision shipped in testing). Use a separate judge — a subagent that did *not* write the page — and tell it to hunt for what's *wrong*: collisions, edge tangents, ragged alignment, lopsided weight, no clear focal point, breaks at some width. Fix, re-render, re-judge.\n\n## 2. Its first idea is the average\n\nWhatever it produces first is the mean of its training data — and there is more than one mean:\n\n- the **generic-AI mean**: Inter, purple-on-white gradients, centered single column, three equal cards;\n- the **designer-trend mean**: oversized condensed caps, dark-mode + grain, monospace \"vibes\" microtext, sticker badges.\n\nLanding on the second isn't taste — it's a more flattering average, which is why it slips past. **Treat your first instinct as the mean and deviate deliberately — toward *this product's specific world*** (use design-thinking's domain \u002F color-world \u002F signature as the direction), **not toward another trend.** If the result could be any startup, you shipped the mean.\n\n## 3. So don't prescribe a style\n\nAny fixed rule — a 12-col grid, an 8-point scale, \"mono = data\" — *becomes* next cycle's mean, and a blind model executes it into collisions anyway. Prescribe the **process, not the look**: see it with fresh eyes, and push off the average toward the domain. Taste supplies the direction (design-thinking \u002F design-philosophy); this skill only insists you **look** and **don't ship the mean**.\n\nFor iterative spatial tuning, a local page with live controls (sliders, pickers, drag handles) beats one-shot critique.\n\n## 4. NEVER ship horizontal overflow — THE mandatory gate, no exceptions\n\n> **BLOCKING GATE. You may not call any web UI \"done\", \"working\", \"fixed\", or\n> \"looks good\" until you have run the `scrollWidth` check below at a narrow width\n> THIS turn and seen `0`. Not \"I added overflow-x:clip so it's fine.\" Not \"it\n> looked fine at my width.\" MEASURE. Narrow. Every time. If you didn't measure,\n> it isn't done — say \"haven't checked overflow yet\" instead of claiming done.**\n\nA side-to-side scrollbar that doesn't match the content is the **single most common\nand most embarrassing** layout failure, and it ships *over and over* because the dev\nviewport is wide enough to hide it — the overflow only appears once the window is\nnarrower than some element. It is **invisible at desktop width**, so the §1\nrender-critique loop will NOT catch it unless you screenshot narrow. Separate,\nexplicit, non-negotiable gate.\n\n**It recurs because layouts GROW after they were last checked.** Every time you add a\nnav tab, a toolbar button, a header control, a chip, a wider equation\u002F`\u003Cpre>`, or any\nnew item to a `flex`\u002F`inline` row, you have invalidated the last overflow check — the\nrow that fit yesterday now pushes past the edge between ~720–1200px while your 1440px\ndev window shows nothing wrong. (Real ship, 2026-06, TWICE: a progress-bar edge label\noverflowed 23px; then a `flex-wrap:nowrap` header that grew 4 tabs scrolled the whole\npage 309px across 720–1200px — both invisible at dev width, both caught only by\nmeasuring narrow.) **So: any change that adds an element to a horizontal row re-arms\nthis gate. Re-measure.**\n\n**Default defenses to apply up front (so the gate passes by construction):**\n- **Header \u002F nav \u002F toolbar rows: `flex-wrap: wrap`, never `nowrap`.** A growing\n  single-row flex is the #1 source of this bug. Wrapping is a no-op when it fits and\n  saves you when it doesn't.\n- **`body { overflow-x: clip }`** as a backstop on every app (clip, not hidden — keeps\n  sticky\u002Fanchored layouts working). A backstop, NOT a substitute for measuring.\n\n**The check — run before calling ANY page done:** `document.documentElement.scrollWidth - document.documentElement.clientWidth` must equal `0`, tested at your dev width AND resized narrow (≤1024px, and a phone width ~390px). If > 0, find the offender:\n```js\ndocument.querySelectorAll('*').forEach(el=>{const r=el.getBoundingClientRect();\n  if(r.right>innerWidth+1||r.left\u003C-1) console.log(Math.round(r.right), el);});\n```\n\n**Safety net:** `overflow-x: clip` on `body` (prefer `clip` over `hidden` — it clips without creating a scroll container, so it won't break `position:sticky`\u002Fanchored layouts). But a net is not a fix — **find and kill the root cause:**\n\n- **`position:absolute` + `white-space:nowrap` anchored at an edge** (`left:100%`, `right:0`): a *centered* nowrap label on the right edge juts past the viewport. (Real ship, 2026-06: a progress bar's \"300 · learned model\" milestone label at `left:100%` with `translateX(-50%)` overflowed 23px → phantom horizontal scroll at sub-1180px widths.) **Anchor edge labels inward** — right end `right:0; transform:none`, left end `left:0; transform:none`.\n- **`100vw`** — includes the scrollbar width (~15px), so on any vertically-scrolling page it guarantees ~15px of horizontal overflow. Use `100%`.\n- **flex \u002F grid children without `min-width:0`** — they refuse to shrink below their content and blow out the track (a long title in a flex card, a `\u003Cpre>` in a grid cell). Add `min-width:0`.\n- **long unbreakable strings** (URLs, hashes, tokens): `overflow-wrap:anywhere` or `word-break:break-word`.\n- fixed pixel widths wider than the viewport; large negative margins; oversized `position:absolute` elements.\n\nThe generalization: **anything pinned to an edge or sized in viewport units is a horizontal-overflow suspect — test narrow, measure `scrollWidth`, clip the body as backstop, and anchor edge-pinned content inward.**\n\n## 5. Lay out in TASK order — minimize transition cost\n\nBefore placing elements, **walk the user's actual step sequence for completing the\npage's action**, then arrange elements in that same perceptual\u002Fview order. The\nlayout should read like the task: orient → work → confirm. Any mouse travel or\nscrolling that serves no practical purpose is a defect.\n\n- **Orient at top:** controls\u002Foptions up top are good — they tell the user what\n  the page is for and what it can do before they commit to reading it.\n- **Confirm where the work ENDS:** if the task is \"review a long list, then act\"\n  (approve, flag, submit, save), the action buttons must ALSO exist at the\n  bottom — where the user's eyes and cursor are when they finish. The original\n  failure: a delete-review page with confirm buttons only in the top toolbar —\n  after scrolling through 120 images, the user had to scroll all the way back up\n  to click \"flag the rest.\" Duplicate the action bar at the bottom (or make the\n  toolbar sticky); both are one line of code, the scroll-back is paid per page.\n- **The heuristic: save the user transit time.** Every interaction has a path:\n  where the eyes\u002Fcursor are when a step ends vs where the next step's control\n  is. Sum those distances; shrink the big ones. Fitts's law for the page as a\n  whole, not just one button.\n- **Check it in the render-and-critique loop (§1):** ask the judge \"trace the\n  task: where is the user when they finish each step, and how far is the next\n  control?\" — a layout can be aligned, balanced, and still force a round trip.\n\n## 6. Balance is measurable — don't eyeball it (or trust a VLM's eye)\n\n§1 says render and have fresh eyes critique it. That qualitative pass catches\ncollisions and ragged alignment, but **a model has no reliable sense of visual\nbalance** — ask a VLM \"is this centered \u002F balanced?\" and it confabulates a verdict.\nThe fix is to stop asking opinions and **measure a number**, then keep that number\nhonest with an *independent* check. Use both: §1's fresh-eyes critique AND the hard\nnumber below. (This pairs a live in-browser box model + auto-balancer with an\noffline pixel-oracle that re-measures the rendered screenshot — see the\n`layout-audit.js` companion script in this skill.)\n\n**The principle.** Visual balance is the *center of mass of visual weight*. It's\narithmetic, not taste — so compute it.\n\n**Optical center, not geometric.** Target `x = 0.50`, `y ≈ 0.46` — slightly high,\nbecause a centroid at literal 50% reads as sagging.\n\n**Visual weight = area × ink-density, not area alone.** Same-size ≠ same-weight: a\nsolid-black heading is heavy; a grey\u002FASCII\u002Flight image reads far lighter than its\narea; body text is sparse. Calibrated starting multipliers (from `asym.html`, re-tune\nper project — these were hand-guesses until corrected against the pixel oracle):\n```js\nconst DENS = {portrait:0.34, h1:0.82, kicker:0.42, lead:0.22, body:0.16, meta:0.5};\n```\n\n**Centroid.** Per axis, `centroid = Σ(wᵢ·posᵢ) \u002F Σwᵢ`; balanced ⇔ the centroid sits\non the optical center. To FIX imbalance, think see-saw: what counts is the **moment**\n= weight × distance-from-axis, so a heavy element near the edge is counterweighted by\n(a) an opposing weight, (b) a bigger element on the other side, (c) pulling the heavy\nelement inward (shorter lever arm), or (d) shrinking it. That's exactly the\nauto-balancer's escalation order in `asym.html` — grow the opposing heading first\n(cheapest), then add weight, then pull the heavy element in, then shrink it (last\nresort).\n\n**Two models — and why you need the independent one:**\n- **Cheap box model** (live tuning): put each element's weight at its bounding-box\n  *center*. Instant, fine for dragging sliders. BUT it has a systematic bug —\n  left-aligned text's ink sits *left* of its box, so the box model misplaces the\n  weight. A metric that shares the layout's own assumptions is **circular**; it once\n  reported \"balanced\" at a pixel-measured 0.93 lopsided.\n- **Ground-truth pixel oracle** (`analyze.py`): rasterize the *rendered* page\n  (Playwright screenshot or html2canvas) and take the centroid of actual non-paper\n  pixels, weighting each pixel by its distance from the background color. It knows\n  nothing about the layout's intent — it just counts ink. **When the box model and\n  the pixels disagree, the pixels win.** (`asym.html` closes the loop: it regresses\n  the box-vs-pixel discrepancy and offers a trust dial α to blend toward the oracle.)\n- **Acceptance criterion (measurable):** `|centroid_x − 0.50| \u003C 0.03` and\n  `|centroid_y − 0.46| \u003C 0.04`, plus low left\u002Fright and top\u002Fbottom imbalance\n  (`|w_left − w_right| \u002F total`).\n\n**The verification gate (lighter than §4's, same spirit).** Before calling a\nbalance-critical layout \"balanced\", do NOT assert it from the code or a VLM opinion —\nscreenshot the *rendered* page, compute the ink-centroid offset from optical center,\nand report the actual number. This is the design-skill application of\n`verify-outputs-rule`: look at the real artifact, and make the validating check\n(pixels) independent of the thing you tuned (the layout). It's the quantitative\ncomplement to §1's qualitative critique.\n\n## 7. The layout audit — metrics that MEDIATE the eye, never replace it\n\n§6 covers balance; this generalizes it to a full deterministic sweep, and fixes the\nfailure mode that matters most: **the model reads a metric\u002FJSON and never looks at the\nscreenshot, so it can't apply the common sense that catches the metric being wrong.**\n\n`scripts\u002Flayout-audit.js` is a dependency-free pass you run via Playwright MCP\n`browser_evaluate` on a rendered page. It measures six things deterministically — all\ngeometry, color, and pixels, no \"does this look right?\":\n\n| check | how (deterministic) | tier |\n|---|---|---|\n| **collision** | content-rect intersection ≥12% | gate |\n| **contrast** | WCAG luminance ratio of text vs effective bg (\u003C4.5, large \u003C3) | gate |\n| **tap** | interactive targets \u003C44×44 (Apple HIG) | gate |\n| **overflow** | `scrollWidth − clientWidth` (the §4 gate) | gate |\n| **alignment** | left-edge clusters → near-misses 1–7px off the shared line | signal |\n| **spacing** | gap CoV among a container's children | signal |\n| **balance** | ink-density-weighted centroid vs optical center (§6) | signal |\n\n**What makes it mediate rather than replace:** it doesn't just return JSON — it **draws\nevery finding as an SVG overlay onto the page**, so the *next* `browser_take_screenshot`\nis an **annotated screenshot**. The number tells you WHERE to look; you then look and\ndecide. This is mandatory, not optional:\n\n```\nbrowser_evaluate({ function: \"() => { \u003Cpaste scripts\u002Flayout-audit.js> ; return __audit({}); }\" })\nbrowser_take_screenshot()      \u002F\u002F ← the overlay is now on the page. VIEW IT. Reason over it.\n```\n\nPass `{align:'.card .title,.card .price', space:'.feature-list'}` to scope the two\nselector-dependent checks; pass `{contentSelector:'…'}` for non-semantic layouts where\ncollision needs help finding the blocks.\n\n**These are HEURISTICS, not laws — and they split into two kinds you must not conflate:**\n\n- **GATES = correctness** (overflow, contrast, tap). These measure accessibility\u002F\n  usability *facts*, not taste. Failing one is a real defect. Safe to **block** on.\n  (Collision is a near-gate: usually a real bug, but can be intentional — so eye-confirm,\n  don't auto-fail.)\n- **SIGNALS = convention** (balance, alignment, spacing rhythm). These measure how\n  closely the layout matches a *symmetric, regular, gridded* aesthetic — which is exactly\n  the **generic mean** §2 tells you to push *away* from. **Optimizing a layout to maximize\n  these scores makes it blander.** An off-center balance, a deliberate misalignment, an\n  uneven rhythm are core creative tools and frequently the best thing on the page. Treat\n  signals as \"worth a look,\" **never** as defects to fix.\n\n**The discipline (the whole point — bias hard toward this):**\n- **Never accept a metric you have not looked at.** A flag is a *pointer to look*, not a\n  verdict. Reading `collisions: 1` and acting without viewing the annotated shot is the\n  exact failure this section exists to kill.\n- **Use signals to catch ACCIDENTS, never to enforce convention.** A 7px alignment drift\n  you didn't mean, a phantom scrollbar, a 1.9:1 caption — catch those. But the *same*\n  balance\u002Falignment\u002Fspacing signal fires on deliberate asymmetry, intentional overlap,\n  and expressive rhythm. **When the metric and the interesting choice conflict, the\n  interesting choice usually wins.** Do not \"fix\" a signal toward symmetry\u002Fevenness unless\n  the eye judges the deviation actually worse. A model that maximizes these scores designs\n  the mean.\n- **Overrule flags the eye judges intentional.** Brutalist headline overlap, avatar on a\n  banner, asymmetric hero — the metric flags them; common sense overrules. Proven live in\n  the worked example: obeying the collision check on the brutalist mock removes the overlap\n  and the design goes *flat*.\n- **Gates are necessary, not sufficient.** `gates_pass:true` (overflow\u002Fcontrast\u002Ftap all 0)\n  clears the deterministic floor — it does **not** mean the layout is good. A bland centered\n  template passes every gate and is still the mean. After gates pass, the real judgment (§1\n  fresh-eyes critique, taste, brand fit) still has to happen.\n\n**The proof, made concrete:** build a page that runs all six algorithms live on a few\nrealistic mock sites in different styles, each with a toggle between the layout **as\ndesigned** and the version **obeying the metric**, plus on-render overlays. It shows both\nhalves: obeying a *gate* fixes a real bug (low-contrast CTA, sub-44 tap target, overlapping\ncards), while obeying a *signal* makes it worse (an asymmetric editorial hero is the more\ninteresting layout; \"correcting\" a deliberate brutalist overlap flattens it). That explorable\nis where `layout-audit.js` was distilled from.\n\n## 8. Optical craft — perception beats geometry\n\nThe audit's alignment check (§7) measures *geometric* edges. The eye doesn't read geometry,\nit reads perception — so a few cases need a manual nudge the metric can't make. These are\neye-judgments, not gates. (From the Web Interface Guidelines, `vercel-labs\u002Fweb-interface-guidelines` @ `4e799d4`.)\n\n- **Optical alignment — nudge ±1–2px when it *looks* off though it measures centered.** A\n  play-triangle in a round button must shift right of geometric center to look centered (its\n  visual mass is left-biased). Glyphs, arrows, and asymmetric icons often need the same. Text\n  vertically centered by box metrics frequently sits a hair low — lift it. Geometry is the\n  starting point; the eye is the judge.\n- **Balance icon\u002Ftext lockups.** When an icon sits beside text, match their *visual weight* —\n  adjust the icon's stroke, size, spacing, or color so neither overpowers. A thin-stroke icon\n  next to medium-weight text looks weak; thicken its stroke (or size it up slightly) so they\n  read as one lockup. Optical size, not equal pixel size, is the target.\n- This is the same principle as the §6\u002F§7 debias: the number gets you close; the eye makes the\n  final 1px call. Don't let a geometric alignment metric *prevent* an optical correction.\n\n## Limitations\n\n- Use this skill only when the task clearly matches its upstream source and local project context.\n- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.\n- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.\n",{"name":5,"risk":24,"source":25,"license":15,"date_added":26,"description":7,"source_repo":27,"source_type":28,"license_source":29},"unknown","https:\u002F\u002Fgithub.com\u002Fconnerkward\u002Fckw-design-skill\u002Ftree\u002Fmain\u002Fdeterministic-design\u002Fdesign-spatial",1782864000000,"connerkward\u002Fckw-design-skill","community","https:\u002F\u002Fgithub.com\u002Fconnerkward\u002Fckw-design-skill\u002Fblob\u002Fmain\u002FLICENSE","main","b1e4ffadb4f933bbbcaa03a83f8b9929171ac28b",".agents\u002Fskills\u002Fdesign-spatial",0,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR","https:\u002F\u002Fgithub.com\u002FHazek-dc","2026-10-22 08:36:44",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill design-spatial",{"tool":43,"command":44},"bunx","bunx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill design-spatial",{"tool":46,"command":47},"pnpm","pnpm dlx skills add Hazek-dc\u002FPresensiGuru_FaceNet_EMAR --skill design-spatial","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-spatial\u002FSKILL.md",true,[51],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"scripts\u002Flayout-audit.js","SCRIPT","脚本",10673,"https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fdesign-spatial\u002Fscripts\u002Flayout-audit.js",[58,65,72,79,86,93],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7DS6GGYRZAYD33PFPS8Z2T3","testing-best-practices","Laravel test design and review. Use when selecting coverage, naming or structuring tests, choosing assertions or test data, isolating dependencies, testing HTTP or security boundaries, improving suite performance, or reviewing test value. Use framework guidance or search-docs for Pest and PHPUnit syntax.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftesting-best-practices\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7DS6BC3AW7HTPRHE2TTVKWM","tailwindcss-development","Always invoke when the user's message includes 'tailwind' in any form. Also invoke for: building responsive grid layouts (multi-column card grids, product grids), flex\u002Fgrid page structures (dashboards with sidebars, fixed topbars, mobile-toggle navs), styling UI components (cards, tables, navbars, pricing sections, forms, inputs, badges), adding dark mode variants, fixing spacing or typography, and Tailwind v3\u002Fv4 work. The core use case: writing or fixing Tailwind utility classes in HTML templates (Blade, JSX, Vue). Skip for backend PHP logic, database queries, API routes, JavaScript with no HTML\u002FCSS component, CSS file audits, build tool configuration, and vanilla CSS.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Ftailwindcss-development\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7DS66GE6B11MYJDVC74HXM4","laravel-best-practices","Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code. This includes creating or modifying controllers, models, migrations, form requests, policies, jobs, scheduled commands, service classes, and Eloquent queries. Triggers for N+1 and query performance issues, caching strategies, authorization and security patterns, validation, error handling, queue and job configuration, route definitions, and architectural decisions. Also use for Laravel code reviews and refactoring existing Laravel code to follow best practices. Covers any task involving Laravel backend PHP code patterns.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Flaravel-best-practices\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7DS5ZW717DMS6P1E90AQCKV","infer-conventions","Use this skill to analyze how a Laravel application is actually written and record its conventions as shared rules. Trigger when the user wants to detect, infer, document, or standardize project conventions or coding style, set up or grow `.ai\u002Frules`, resolve mixed or conflicting patterns (e.g. \"are we using Form Requests or inline validation?\"), or onboard agents and teammates to \"how we do things here\". Covers: a systematic sweep of ~49 Laravel convention dimensions (validation, models, architecture, testing, frontend, database, console), open-ended house-pattern discovery, conflict reporting, and recording rules scoped to the right paths via the Boost `record-rule` MCP tool. Only run this skill when the user explicitly asks for it; never start a sweep as part of another task. Do not use for one-off code review, enforcing formatting a linter already handles, or editing `.ai\u002Frules` files by hand.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finfer-conventions\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7DS5W12RGCVJTFQJ1N0GB8E","inertia-react-development","Develops Inertia.js v2 React client-side applications. Activates when creating React pages, forms, or navigation; using \u003CLink>, \u003CForm>, useForm, or router; working with deferred props, prefetching, or polling; or when user mentions React with Inertia, React pages, React forms, or React navigation.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Finertia-react-development\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7DS5PVDPMPCWSK2RXPDC9BB","deploying-to-cloud","Deploys and manages Laravel applications on Laravel Cloud using the `cloud` CLI. Use when the user wants to deploy an app, ship to Cloud, create or manage applications, environments, databases, caches, object storage, queues, domains, instances, background processes, secrets, compute, scheduled tasks, or Laravel Cloud infrastructure; or check billing, usage, or spend. Triggers on deployment, shipping, Cloud management, environment setup, database provisioning, billing or usage queries, the `cloud` CLI, and Laravel Cloud deployment troubleshooting.","https:\u002F\u002Fgithub.com\u002FHazek-dc\u002FPresensiGuru_FaceNet_EMAR\u002Fblob\u002Fmain\u002Fattendance-web\u002F.claude\u002Fskills\u002Fdeploying-to-cloud\u002FSKILL.md",[],[]]