Agent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
JavaScript agent-skillsai-agentsanti-slopclaude-codecodexcursordesign-systemfrontendlanding-pageui-designweb-design
v2.1 (wip): app screens, frame checks
Leonxlnxcd9078b559d9
diff --git a/README.md b/README.mdindex 9ea9c00..b654948 100644--- a/README.md+++ b/README.md@@ -141,13 +141,15 @@ The default skill is built from a study of 247 curated sites. A build runs in siA build takes roughly 30 to 45 minutes and a few hundred thousand tokens. Details are in the [changelog](CHANGELOG.md) and the [study](skills/taste-skill/references/research.md).+Dashboards and app screens (v2.1) take their own route: the skill deals one of the app styles distilled from real product screens, builds the shell, the data, the charts and the tables to those numbers, and checks the result with app rules: quiet panels, aligned figures, colour spent on data, a phone layout where the navigation folds away.+## SkillsEach skill does one job. You do not need all of them. The **install name** is the value you pass to `--skill`.| Skill | Install name | What it does || --- | --- | --- |-| **[taste-skill](skills/taste-skill/SKILL.md)** | `design-taste-frontend` | v2. Art direction for landing pages, marketing sites, portfolios and product pages, in any stack. Works as described above. |+| **[taste-skill](skills/taste-skill/SKILL.md)** | `design-taste-frontend` | v2. Art direction for landing pages, marketing sites, portfolios and product pages, and since v2.1 for dashboards and app screens, in any stack. Works as described above. |<details><summary>Skills for a specific job (8)</summary>@@ -180,7 +182,7 @@ These produce design images only, no code. Use them with ChatGPT Images, Codex i### Which one should I use?-- Building a new public page: **taste-skill**.+- Building a new public page, a dashboard or an app screen: **taste-skill**.- Improving a page that already exists: **redesign-skill**.- The visual direction is already decided: **soft-skill**, **minimalist-skill** or **brutalist-skill**.- You want images first, then code: an image-generation skill, or **image-to-code-skill** for the whole pipeline in one go.@@ -217,7 +219,7 @@ From open collections such as Wikimedia Commons, Openverse and the Met. Only pubYes. The rules are about design, not a framework.**Is it for dashboards and app screens?**-No. The default skill is for public-facing pages. Use **minimalist-skill** or **soft-skill** for product UI.+Yes, since v2.1. The skill tells a page from an app screen and builds a dashboard, an admin view or a settings screen with its own run: a style dealt from a study of real product screens, quiet panels, honest data and charts, and its own checks (`inspect.mjs --app`).## Support the projectdiff --git a/skills/taste-skill/SKILL.md b/skills/taste-skill/SKILL.mdindex 91d114a..aa048b4 100644--- a/skills/taste-skill/SKILL.md+++ b/skills/taste-skill/SKILL.md@@ -1,6 +1,6 @@---name: design-taste-frontend-description: tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.+description: tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Also for app screens: dashboards, admin and analytics views, settings, inboxes and other screens people work in, with their own run and rules.---# tasteskill v2@@ -31,6 +31,23 @@ In the commands below `<skill>` is this skill's folder. Run them from the projecworking files land in `.taste-skill/` there. The scripts need Node 22+ and an installed Chrome, Edgeor Chromium, and install nothing. `assets.mjs` also needs network access; it uses no API keys.+## Page or app screen++Decide first which of two kinds of work this is.++- **A page** is read and scrolled: a landing page, a marketing or product site, a portfolio, an+ event, a restaurant, a one-pager. It follows **the run** below.+- **An app screen** is worked in: a dashboard, an admin or analytics view, settings, billing, an inbox+ or queue to work through, a wallet, a list with filters, an editor or builder. It follows+ **`references/app-screens.md`**: its own run, its own draw (`draw.mjs --app`), its own house rules+ (quiet borders, small labels and repeated panels are normal there; gradients, glows, icons in tinted+ squares, rainbow charts and invented vanity numbers are not) and `inspect.mjs --app`. Read that file+ whole before you start; the page run below does not apply.++A product site that shows its app is a page; the interface fragments on it follow the app-screen+rules for their insides. When a request mixes both (a landing page and the dashboard behind it),+build each with its own run and one shared palette and typeface.+## The runDo these in order. Steps 1–5 take a few minutes and decide whether the page is any good.@@ -225,7 +242,16 @@ not finished. Order of work:carries. A screen that is mostly empty ground is an underbuilt section, not a rest; one deliberaterest per page is the limit, and the inspector fails a page with two or more near-empty screens.Running text is in the full ink at 16px or more; grey is for secondary notes.-7. **States and semantics.** Real links and buttons, visible focus, alt text, a phone layout that is+7. **The frame.** The page has one pair of equal outer margins at every width, and every section uses+ the width the page has set up: when its text sits in the left half, the right half holds its+ picture, its second column, its list or its figure, never nothing. Asymmetry lives inside the grid,+ never in the frame: a void is placed only when something closes it on the far side. No stretch of+ the page taller than about half a screen holds nothing at all; sections are 120–220px apart on+ desktop. Every section the visitor came for opens with a heading that names it, and the first+ screen carries the page's title in an `h1`. These are what readers name first when a page looks+ wrong ("no clear title", "random empty space", "everything is pushed to one side"), and the+ inspector measures each of them.+8. **States and semantics.** Real links and buttons, visible focus, alt text, a phone layout that isits own composition.Read `references/type.md`, `references/colour.md` and `references/layout.md` when you need the detail@@ -240,8 +266,9 @@ node <skill>/scripts/inspect.mjs <url or path/to/index.html>`lint.mjs` scans source for banned patterns and stock phrases. `inspect.mjs` opens the page in a realbrowser at 1440, 768 and 390 pixels, measures it (headline line counts, type sizes, fonts actually-loaded, colours, rules, shadows, gradients, contrast, overflow) and saves screenshots to-`.taste-skill/inspect/`. Fix every `FAIL`. Treat each `WARN` as wrong unless you can defend it to a+loaded, colours, rules, shadows, gradients, contrast, overflow, and the frame: equal margins, sections+huddled on one side, blank stretches, the title, untitled sections, text against the screen edge) and+saves screenshots to `.taste-skill/inspect/`. Fix every `FAIL`. Treat each `WARN` as wrong unless you can defend it to adesigner in one sentence. Re-run until there are no `FAIL`s. Do not argue with the meter and do nothide things from it. The inspector serves local files over a throwaway local server; if the page mustalso open straight from the file system, open `index.html` that way once before you finish.@@ -278,6 +305,14 @@ every screenshot for content that failed to appear.### 10. Report+Do not report until all of these are true; each one was skipped in a test run that came out badly:++- `inspect.mjs` shows **0 FAIL** at 1440, 768 and 390, on the final version of the page.+- You opened every screenshot it listed after the last change, not only the first screen.+- A stranger reading the first screen for five seconds can say what this is and what to do.+- Every section has a heading; the margins match on both sides; no stretch of the page is empty.+- The critique of your last round is written down in the shape of `references/critique.md` §4.+Tell the user, briefly: the direction dealt (name and seed) and any redraws with reasons; the ideasentence and the live thing; the final scores from your last critique round and what still falls short;every found picture and clip with its title, creator, licence and source page (`assets.mjs --credits` prints@@ -292,6 +327,9 @@ These hold on every build, whatever the direction. `inspect.mjs` measures them.| Rule | Instead || --- | --- || **Headlines: two lines or fewer, at every width.** Every `h1`–`h6`, and the main line of the first screen whatever its tag. | Cut words. Then widen the measure. Size last. |+| **A clear title on the first screen**, in the page's one `h1`, and a heading on every section. | Say what this is: the name with what it does, the product with what it is for, the event with its date and place. |+| **Equal outer margins; no section huddled on one side** with the other half of the screen empty. | Close every void with something on its far side: the section's picture, a second column, a list, a figure. |+| **No blank stretches** taller than about half a screen. | The normal section gap. A deliberate rest is a placed picture or a field of colour, once per page. || **Statements are paragraphs.** An intro sentence or a quotation set large is marked up as `<p>` or `<blockquote>`, stays at statement size (36px or less on desktop, 24px on a phone) and runs to about 25 words, three lines. | Larger than that it is a headline and the two-line rule applies. In blind tests jurors read a 42px sentence over four lines as a four-line headline. || **No eyebrows.** No small label above a heading, no pill badge above the headline, no "New ·" chip. | Put the information in the heading or the first sentence, or drop it. || **No monospace** outside real code blocks. | The text face. Tabular figures where numbers align. |@@ -341,6 +379,8 @@ Short form. Numbers are from the study unless marked as house style.**Space**- One grid, one pair of tight margins (16–32px), used everywhere; large things run to the edges. Textblocks share two or three left edges on the whole page.+- Asymmetry inside the grid, never in the frame: the two outer margins are equal, and an off-centre+ heading is answered by something at the far side of the grid.- The gap between sections is clearly larger than any gap inside one: 120–220px on desktop.- Each section has a different composition from its neighbours; none is a card grid.@@ -398,6 +438,7 @@ open collections could not be searched.| File | Read it when || --- | --- |+| `references/app-screens.md` | Any dashboard, admin, settings or other app screen: its own run, rules, tokens and checks. || `references/copy.md` | Writing the argument and the copy deck (steps 2 and 5). The two-line arithmetic. || `references/type.md` | Setting type: scales, tracking, measure, loading fonts, pairing. || `references/colour.md` | Applying the palette: roles, proportions, tone steps, dark pages, contrast. |diff --git a/skills/taste-skill/assets/app.css b/skills/taste-skill/assets/app.cssnew file mode 100644index 0000000..1c9be25--- /dev/null+++ b/skills/taste-skill/assets/app.css@@ -0,0 +1,156 @@+/* tasteskill / app.css+ A neutral foundation for app screens (dashboards, admin, settings, inboxes), set to the defaults+ measured in the study of real product screens (references/app-screens.md). Copy it into the project,+ replace the token values with the ones on the app sheet (draw.mjs --app), and build on top.+ Delete what you do not use. It has no brand of its own: neutral grounds, one quiet line, one accent. */++/* ---------- tokens (replace with the dealt style) ---------- */+:root {+ /* names match the app sheet printed by draw.mjs --app */+ --ground: #f9fafb; /* the app chrome and page */+ --surface: #ffffff; /* panels and the work sheet */+ --raised: #f4f5f6; /* a filled inner well, hover rows */+ --active: #eeeeee; /* the active nav pill */+ --border: #e8e8e8; /* panel edges: about 1.2:1 on white */+ --rule: #f1f2f3; /* row rules inside tables */+ --control: #d1d5db; /* inputs and outlined buttons: one step stronger */+ --text: #111111;+ --muted: #5f6368; /* secondary text, labels (4.5:1 or more on its ground) */+ --faint: #6b6b6b; /* meta and placeholders: the lightest grey that holds 4.5:1 on white */+ --accent: #1f6f5c; /* one hue: data, focus, the selected thing */+ --primary: #1d1f20; /* the primary button is near-black unless the style says otherwise */+ --primary-ink: #ffffff;+ --positive: #2f8a57; --negative: #c23a26; --warning: #a15c07;+ --pill-positive-bg: #e3f5ea; --pill-positive-ink: #134227;+ --pill-negative-bg: #fdecea; --pill-negative-ink: #7d1d14;+ --pill-warning-bg: #fff6e0; --pill-warning-ink: #6b3d04;+ --pill-neutral-bg: #eeeeee; --pill-neutral-ink: #3d3d3d;+ --chart-1: var(--accent); --chart-2: #8fb8ad; --chart-3: #b08a2e; --chart-muted: #cfd3d6;+ --grid: var(--rule); /* chart gridlines (charts.js) */+ --axis-ink: var(--muted); /* chart tick labels (charts.js) */+ --ink: var(--text);++ --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;+ --fs-title: 24px; --fs-section: 16px; --fs-kpi: 28px; --fs-body: 14px; --fs-small: 12px;++ --sidebar-width: 232px;+ --pad: 24px; /* canvas padding */+ --gap: 16px; /* one gutter, horizontal and vertical */+ --card-pad: 20px;+ --radius-card: 12px; /* tight family: 6–8 / soft family: 16–20; decide once */+ --radius-control: 6px;+ --control-height: 32px; /* every control in the title and filter rows */+ --row-height: 48px; /* single-line table row */+ --nav-row: 32px; /* sidebar item height, on a 34px pitch */++ --ease-out: cubic-bezier(0.22, 1, 0.36, 1);+ --t-press: 120ms; --t-hover: 150ms; --t-ui: 200ms;+}++/* ---------- reset ---------- */+*, *::before, *::after { box-sizing: border-box; }+html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }+body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased; }+h1, h2, h3, h4, p, figure, ul, ol, dl, dd { margin: 0; }+ul[class], ol[class] { padding: 0; list-style: none; }+img, svg, video, canvas { display: block; max-width: 100%; }+button, input, select, textarea { font: inherit; color: inherit; }+a { color: inherit; text-decoration: none; }+:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }+.num, table, .kpi-value { font-variant-numeric: tabular-nums; }++/* ---------- shell: sidebar + canvas ---------- */+.app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100svh; }+.sidebar { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; overflow: auto; }+.sidebar .group-label { margin: 20px 8px 6px; font-size: var(--fs-small); color: var(--faint); }+.nav-item { display: flex; align-items: center; gap: 10px; height: var(--nav-row); padding: 0 8px; border-radius: 8px; color: var(--muted); transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }+.nav-item svg { width: 16px; height: 16px; flex: none; stroke-width: 1.5; }+.nav-item:hover { background: var(--raised); color: var(--text); }+.nav-item[aria-current="page"] { background: var(--active); color: var(--text); }+.sidebar .bottom { margin-top: auto; }+.canvas { min-width: 0; padding: var(--pad); }++/* ---------- title block and filters ---------- */+.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }+.title-row h1 { font-size: var(--fs-title); line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }+.title-row .sub { margin-top: 4px; color: var(--muted); }+.filters { display: flex; align-items: center; gap: 8px; margin-bottom: var(--gap); flex-wrap: wrap; }+.filters .spacer { flex: 1; }+.stamp { color: var(--faint); font-size: var(--fs-small); }++/* ---------- panels and grid ---------- */+.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }+.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }+.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }+.panel h2 { font-size: var(--fs-section); line-height: 1.3; font-weight: 600; }+.panel .meta { color: var(--faint); font-size: var(--fs-small); }++/* KPIs as one divided strip: a label above a number, no icons, no tiles */+.kpis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }+.kpi { padding: 16px var(--card-pad); }+.kpi + .kpi { border-left: 1px solid var(--border); }+.kpi-label { color: var(--muted); }+.kpi-value { margin-top: 6px; font-size: var(--fs-kpi); line-height: 1.15; font-weight: 500; letter-spacing: -0.01em; }+.kpi-value small { font-size: 0.55em; color: var(--muted); font-weight: 400; margin-left: 2px; }+.delta { margin-top: 4px; font-size: var(--fs-small); color: var(--muted); }+.delta .up { color: var(--positive); } .delta .down { color: var(--negative); }++/* ---------- tables ---------- */+.table-wrap { overflow-x: auto; }+table { width: 100%; border-collapse: collapse; }+th { height: 36px; padding: 0 12px; text-align: left; font-weight: 400; font-size: var(--fs-small); color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }+td { height: var(--row-height); padding: 0 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }+tbody tr:last-child td { border-bottom: 0; }+tbody tr:hover td { background: var(--raised); }+th.n, td.n { text-align: right; }+td .sub { display: block; font-size: var(--fs-small); color: var(--muted); }+.truncate { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }++/* status pill: a pale tint with dark ink of the same hue, one per row */+.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: var(--fs-small); font-weight: 500; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); white-space: nowrap; }+.pill.pos { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }+.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }+.pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }++/* ---------- controls ---------- */+.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 12px; border-radius: var(--radius-control); border: 1px solid var(--control); background: var(--surface); font-weight: 500; cursor: pointer; transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }+.btn:hover { background: var(--raised); }+.btn:active { transform: translateY(1px); }+.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: transparent; }+.btn.ghost { border-color: transparent; background: transparent; }+.field { display: grid; gap: 8px; }+.field label { font-weight: 500; }+.field .hint { color: var(--muted); font-size: var(--fs-small); }+.input, select.input { height: 38px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); }+.input::placeholder { color: var(--faint); }+.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: var(--gap); }+.tabs a { padding: 10px 0; color: var(--muted); box-shadow: inset 0 -2px 0 transparent; transition: color var(--t-hover) ease, box-shadow var(--t-hover) ease; }+.tabs a[aria-selected="true"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }+.segmented { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--raised); }+.segmented button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }+.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); }+.switch { appearance: none; width: 32px; height: 20px; border-radius: 999px; background: var(--control); position: relative; cursor: pointer; transition: background-color var(--t-ui) ease; }+.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-ui) var(--ease-out); }+.switch:checked { background: var(--text); } .switch:checked::after { transform: translateX(12px); }++/* empty and loading states keep the frame */+.empty { display: grid; place-items: center; min-height: 96px; padding: 16px; border: 1px dashed var(--control); border-radius: var(--radius-control); color: var(--muted); text-align: center; }+.skeleton { background: var(--raised); border-radius: 4px; animation: pulse 1.4s ease-in-out infinite; }+@keyframes pulse { 50% { opacity: 0.55; } }++/* ---------- phone: the navigation folds away and the canvas takes the width ---------- */+.menu-toggle { display: none; }+@media (max-width: 860px) {+ .app { grid-template-columns: minmax(0, 1fr); }+ .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); z-index: 20; background: var(--surface); transform: translateX(-100%); transition: transform var(--t-ui) var(--ease-out); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0); }+ .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.32); }+ .menu-toggle { display: inline-flex; }+ .canvas { padding: 16px; }+ .grid > * { grid-column: 1 / -1 !important; }+ .kpis { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }+ .kpi + .kpi { border-left: 0; }+ .kpi:nth-child(n + 3) { border-top: 1px solid var(--border); }+ .kpi:nth-child(2n) { border-left: 1px solid var(--border); }+ .title-row { flex-wrap: wrap; align-items: flex-start; }+}+@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; } }diff --git a/skills/taste-skill/assets/charts.js b/skills/taste-skill/assets/charts.jsnew file mode 100644index 0000000..d5cfdda--- /dev/null+++ b/skills/taste-skill/assets/charts.js@@ -0,0 +1,127 @@+// tasteskill / charts.js — small, dependency-free charts for app screens, drawn in SVG from your data.+// They follow references/app-screens.md: one question per chart, one series that matters, 3–5 quiet+// horizontal gridlines, round ticks that top out above the largest value, 2px straight lines with no+// markers, square bars, no gradients, a bare tooltip, tabular figures. Colours come from CSS variables:+// --chart-1 … --chart-4 (series), --chart-muted (other series), --grid, --axis-ink, --ink, --surface+// Usage (after this file loads):+// Charts.line(el, { labels: ['1 Oct', …], series: [{ name: 'Requests', values: [...] }], format: Charts.fmt.compact })+// Charts.bars(el, { labels, values, highlight: 6, format }) one bar may carry the accent+// Charts.ring(el, { value: 0.72, label: '72%', sub: 'of capacity' }) a progress ring with its total inside+// Charts.barList(el, [{ label: 'Berlin', value: 412 }, …], { format }) a ranked list where the row is the bar+// Every chart gets role="img" and an aria-label that states what it shows.+(() => {+ const NS = 'http://www.w3.org/2000/svg';+ const css = (el, name, fb) => getComputedStyle(el).getPropertyValue(name).trim() || fb;+ const svg = (tag, attrs = {}, parent) => { const n = document.createElementNS(NS, tag); for (const [k, v] of Object.entries(attrs)) n.setAttribute(k, v); if (parent) parent.appendChild(n); return n; };+ // numbers follow the page's language (<html lang>), so separators match the rest of the screen+ const nf = (o) => new Intl.NumberFormat(document.documentElement.lang || 'en', o);+ const fmt = {+ int: (v) => nf({ maximumFractionDigits: 0 }).format(v),+ dec: (d) => (v) => nf({ minimumFractionDigits: d, maximumFractionDigits: d }).format(v),+ pct: (d = 1) => (v) => nf({ style: 'percent', minimumFractionDigits: d, maximumFractionDigits: d }).format(v),+ money: (cur = 'EUR', d = 0) => (v) => nf({ style: 'currency', currency: cur, minimumFractionDigits: d, maximumFractionDigits: d }).format(v),+ compact: (v) => nf({ notation: 'compact', maximumFractionDigits: 1 }).format(v),+ ms: (v) => `${nf({ maximumFractionDigits: 0 }).format(v)} ms`,+ };+ // Round ticks (steps of 1, 2, 2.5 or 5 × 10^n) whose top sits above the largest value.+ function ticks(min, max, count = 4) {+ if (max === min) max = min + 1;+ const raw = (max - min) / count, mag = 10 ** Math.floor(Math.log10(raw));+ const step = [1, 2, 2.5, 5, 10].map((m) => m * mag).find((s) => s >= raw) || 10 * mag;+ const lo = Math.floor(min / step) * step; let hi = Math.ceil(max / step) * step; if (hi <= max) hi += step;+ const out = []; for (let v = lo; v <= hi + step / 2; v += step) out.push(+v.toFixed(10));+ return out;+ }+ function frame(el, h) {+ el.innerHTML = '';+ const w = Math.max(240, el.clientWidth || 600);+ const s = svg('svg', { viewBox: `0 0 ${w} ${h}`, width: '100%', height: h, role: 'img', style: 'display:block;overflow:visible;font-variant-numeric:tabular-nums' }, el);+ return { s, w, h };+ }+ function tooltip(el) {+ let t = el.querySelector('.chart-tip');+ if (!t) { t = document.createElement('div'); t.className = 'chart-tip'; t.style.cssText = 'position:absolute;pointer-events:none;padding:6px 8px;font:inherit;font-size:12px;line-height:1.35;border-radius:6px;white-space:nowrap;opacity:0;transition:opacity 120ms ease;background:var(--surface,#fff);color:var(--ink,#111);border:1px solid var(--grid,#e5e7eb)'; if (getComputedStyle(el).position === 'static') el.style.position = 'relative'; el.appendChild(t); }+ return t;+ }+ function axes(g, { w, h, padL, padB, padT, yt, y, xLabels, x, el }) {+ const grid = css(el, '--grid', '#e8e8e8'), ink = css(el, '--axis-ink', '#6b6b6b');+ for (const v of yt) {+ const yy = y(v);+ svg('line', { x1: padL, x2: w, y1: yy, y2: yy, stroke: grid, 'stroke-width': 1, 'shape-rendering': 'crispEdges' }, g);+ const t = svg('text', { x: padL - 8, y: yy + 4, 'text-anchor': 'end', 'font-size': 12, fill: ink }, g); t.textContent = el._fmt(v);+ }+ const n = xLabels.length, every = n <= 8 ? 1 : Math.max(1, Math.ceil(n / 6));+ xLabels.forEach((lab, i) => { if (i % every && i !== n - 1) return; if (i === n - 1 && (n - 1) % every && (n - 1) % every < every / 2) return; const t = svg('text', { x: x(i), y: h - padB + 18, 'text-anchor': i === 0 ? 'start' : i === n - 1 ? 'end' : 'middle', 'font-size': 12, fill: ink }, g); t.textContent = lab; });+ }+ function line(el, { labels, series, format = fmt.int, height = 220, fill = false, min }) {+ el._fmt = format;+ const draw = () => {+ const { s, w, h } = frame(el, height);+ const all = series.flatMap((x) => x.values.filter((v) => v != null));+ const yt = ticks(min ?? Math.min(0, ...all), Math.max(...all), 4);+ const padL = 12 + Math.max(...yt.map((v) => String(format(v)).length)) * 7, padB = 26, padT = 8;+ const x = (i) => padL + (i * (w - padL)) / Math.max(1, labels.length - 1);+ const y = (v) => padT + (h - padT - padB) * (1 - (v - yt[0]) / (yt.at(-1) - yt[0]));+ const g = svg('g', {}, s);+ axes(g, { w, h, padL, padB, padT, yt, y, xLabels: labels, x, el });+ series.forEach((sr, k) => {+ const col = sr.colour || (k === 0 ? css(el, '--chart-1', '#2f6fdf') : css(el, `--chart-${k + 1}`, css(el, '--chart-muted', '#a3a3a3')));+ const pts = sr.values.map((v, i) => (v == null ? null : [x(i), y(v)]));+ const d = pts.reduce((acc, p, i) => (p ? acc + (acc && pts[i - 1] ? 'L' : 'M') + p[0].toFixed(1) + ' ' + p[1].toFixed(1) : acc), '');+ if (fill && k === 0) { const first = pts.find(Boolean), last = [...pts].reverse().find(Boolean); svg('path', { d: `${d}L${last[0]} ${y(yt[0])}L${first[0]} ${y(yt[0])}Z`, fill: col, opacity: 0.12 }, g); }+ svg('path', { d, fill: 'none', stroke: col, 'stroke-width': 2, 'stroke-linejoin': 'round', 'stroke-linecap': 'round' }, g);+ });+ // hover: a rule, a dot per series and a bare tooltip+ const tip = tooltip(el), rule = svg('line', { y1: padT, y2: h - padB, stroke: css(el, '--axis-ink', '#6b6b6b'), 'stroke-width': 1, opacity: 0 }, g);+ const dots = series.map((sr, k) => svg('circle', { r: 3.5, fill: css(el, '--surface', '#fff'), stroke: sr.colour || css(el, `--chart-${k + 1}`, '#2f6fdf'), 'stroke-width': 2, opacity: 0 }, g));+ const hit = svg('rect', { x: padL, y: padT, width: w - padL, height: h - padT - padB, fill: 'transparent' }, s);+ const move = (ev) => { const r = s.getBoundingClientRect(); const px = ((ev.clientX - r.left) / r.width) * w; const i = Math.max(0, Math.min(labels.length - 1, Math.round(((px - padL) / (w - padL)) * (labels.length - 1)))); rule.setAttribute('x1', x(i)); rule.setAttribute('x2', x(i)); rule.setAttribute('opacity', 0.35); series.forEach((sr, k) => { const v = sr.values[i]; dots[k].setAttribute('cx', x(i)); dots[k].setAttribute('cy', v == null ? -99 : y(v)); dots[k].setAttribute('opacity', v == null ? 0 : 1); }); tip.innerHTML = `<div style="opacity:.7">${labels[i]}</div>` + series.map((sr) => `<div><b style="font-weight:600">${sr.values[i] == null ? '–' : format(sr.values[i])}</b> ${series.length > 1 ? sr.name : ''}</div>`).join(''); const left = Math.min((x(i) / w) * r.width + 12, r.width - tip.offsetWidth - 4); tip.style.left = `${Math.max(0, left)}px`; tip.style.top = '0px'; tip.style.opacity = 1; };+ hit.addEventListener('pointermove', move); hit.addEventListener('pointerleave', () => { tip.style.opacity = 0; rule.setAttribute('opacity', 0); dots.forEach((d) => d.setAttribute('opacity', 0)); });+ const last = series[0].values.filter((v) => v != null).at(-1);+ s.setAttribute('aria-label', `${series.map((x) => x.name).join(', ')}, ${labels[0]} to ${labels.at(-1)}; latest ${last == null ? 'no data' : format(last)}`);+ };+ draw(); watch(el, draw);+ }+ function bars(el, { labels, values, format = fmt.int, height = 200, highlight = null, colour }) {+ el._fmt = format;+ const draw = () => {+ const { s, w, h } = frame(el, height);+ const yt = ticks(0, Math.max(...values), 4);+ const padL = 12 + Math.max(...yt.map((v) => String(format(v)).length)) * 7, padB = 26, padT = 8;+ const band = (w - padL) / values.length, bw = Math.max(2, band * 0.62);+ const x = (i) => padL + band * i + band / 2;+ const y = (v) => padT + (h - padT - padB) * (1 - v / yt.at(-1));+ const g = svg('g', {}, s);+ axes(g, { w, h, padL, padB, padT, yt, y, xLabels: labels, x, el });+ const main = colour || css(el, '--chart-1', '#2f6fdf'), muted = css(el, '--chart-muted', '#c9c9c9');+ values.forEach((v, i) => { const r = svg('rect', { x: x(i) - bw / 2, y: y(v), width: bw, height: Math.max(0, y(0) - y(v)), fill: highlight == null || highlight === i ? main : muted, 'shape-rendering': 'crispEdges' }, g); const t = svg('title', {}, r); t.textContent = `${labels[i]}: ${format(v)}`; });+ s.setAttribute('aria-label', `${labels.length} bars from ${labels[0]} to ${labels.at(-1)}; highest ${format(Math.max(...values))}`);+ };+ draw(); watch(el, draw);+ }+ function ring(el, { value, label, sub, size = 132, stroke = 8, colour }) {+ el.innerHTML = '';+ const r = (size - stroke) / 2, c = 2 * Math.PI * r, v = Math.max(0, Math.min(1, value));+ const wrap = document.createElement('div'); wrap.style.cssText = `position:relative;width:${size}px;height:${size}px`;+ const s = svg('svg', { viewBox: `0 0 ${size} ${size}`, width: size, height: size, role: 'img', 'aria-label': `${label}${sub ? ' ' + sub : ''}` }, wrap);+ svg('circle', { cx: size / 2, cy: size / 2, r, fill: 'none', stroke: css(el, '--grid', '#e8e8e8'), 'stroke-width': stroke }, s);+ svg('circle', { cx: size / 2, cy: size / 2, r, fill: 'none', stroke: colour || css(el, '--chart-1', '#2f6fdf'), 'stroke-width': stroke, 'stroke-dasharray': `${c * v} ${c}`, transform: `rotate(-90 ${size / 2} ${size / 2})` }, s);+ const t = document.createElement('div'); t.style.cssText = 'position:absolute;inset:0;display:grid;place-content:center;text-align:center;font-variant-numeric:tabular-nums';+ t.innerHTML = `<div style="font-size:${Math.round(size / 5.5)}px;font-weight:600;line-height:1">${label}</div>${sub ? `<div style="font-size:12px;opacity:.7;margin-top:4px">${sub}</div>` : ''}`;+ wrap.appendChild(t); el.appendChild(wrap);+ }+ function barList(el, rows, { format = fmt.int, colour } = {}) {+ el.innerHTML = '';+ const max = Math.max(...rows.map((r) => r.value)) || 1;+ const list = document.createElement('ol'); list.style.cssText = 'list-style:none;margin:0;padding:0;display:grid;gap:2px;font-variant-numeric:tabular-nums';+ for (const r of rows) {+ const li = document.createElement('li'); li.style.cssText = 'position:relative;display:flex;justify-content:space-between;gap:12px;padding:10px 12px;border-radius:6px;isolation:isolate';+ const bar = document.createElement('span'); bar.style.cssText = `position:absolute;inset:0 auto 0 0;width:${(r.value / max) * 100}%;background:${colour || 'var(--bar-fill, color-mix(in srgb, var(--chart-1, #2f6fdf) 12%, transparent))'};border-radius:inherit;z-index:-1`;+ li.append(bar); const a = document.createElement('span'); a.textContent = r.label; const b = document.createElement('span'); b.textContent = format(r.value); b.style.fontWeight = '500';+ li.append(a, b); list.appendChild(li);+ }+ el.appendChild(list);+ }+ function watch(el, draw) { if (!('ResizeObserver' in window)) return; let w = el.clientWidth; new ResizeObserver(() => { if (Math.abs(el.clientWidth - w) > 4) { w = el.clientWidth; draw(); } }).observe(el); }+ window.Charts = { line, bars, ring, barList, ticks, fmt };+})();diff --git a/skills/taste-skill/evals/evals.json b/skills/taste-skill/evals/evals.jsonindex c858083..f6d5980 100644--- a/skills/taste-skill/evals/evals.json+++ b/skills/taste-skill/evals/evals.json@@ -1,6 +1,6 @@{"skill_name": "design-taste-frontend",- "how_to_run": "For each eval, give the prompt to a fresh agent that has this skill, and to a second fresh agent without it (the baseline). Render both with scripts/inspect.mjs and have a judge who does not know which is which score the screenshots with references/critique.md. Record inspector FAIL counts for both.",+ "how_to_run": "For each eval, give the prompt to a fresh agent that has this skill, and to a second fresh agent without it (the baseline). Render both with scripts/inspect.mjs and have a judge who does not know which is which score the screenshots with references/critique.md. Record inspector FAIL counts for both. Evals 7 to 10 are app screens: inspect them with --app (a sheet dealt by draw.mjs --app switches it on by itself) and judge them with the app-screen passes in references/critique.md.","evals": [{"id": 1,@@ -43,6 +43,34 @@"prompt": "Landing page for Format, a two-day design conference in Rotterdam on 14 and 15 May 2027. Twelve speakers (invent plausible names and talk titles), 400 seats, tickets at 390 euros, venue: Maassilo. Sections: what it is, the line-up, the schedule in brief, tickets, and a short FAQ. No brand exists yet beyond the name. Static HTML/CSS/JS.","expected_output": "An event page with a strong typographic or colour idea, the line-up and schedule set as structured text without divider lines or index numbers, a ticket section that is not three cards, and all house rules met.","files": []+ },+ {+ "id": 7,+ "name": "app-budget-overview",+ "prompt": "Build the main screen of Ledgerly, a budgeting app for couples who share money: the October overview with their accounts and balances, the spending plan (planned against spent by category), bills due in the next 14 days and recent transactions. Two people use it, Mia and Tom. Desktop first, and it must work on a phone. Static HTML/CSS/JS.",+ "expected_output": "An app screen, not a landing page: a quiet shell (sidebar or rail), a clear screen title, numbers that add up and are right-aligned with tabular figures, one chart per question, colour spent on data and status only, no icons in tinted squares, no gradients or glows, no placeholder names, and a phone layout where the navigation folds away. inspect.mjs --app passes.",+ "files": []+ },+ {+ "id": 8,+ "name": "app-deploy-dashboard",+ "prompt": "Dashboard for Relay, an edge deployment platform for web teams: one project's overview with recent deployments (status, branch, commit message, author, duration, region), requests and p95 latency over the last 24 hours, the error rate, and usage against the plan's limits. Dark theme. Static HTML/CSS/JS.",+ "expected_output": "A dense, readable dark screen on a neutral (not navy) ground: one surface step or one hairline between regions, a deployments table with honest statuses and aligned numbers, charts with few gridlines and one series each, IDs in monospace at most, no rainbow series, no glow, and app inspector checks passing.",+ "files": []+ },+ {+ "id": 9,+ "name": "app-settings-billing",+ "prompt": "Workspace settings for Proofline, a design-review tool: general settings, members and roles (a members table with an invite form), billing (current plan, seats, invoices) and notifications. Static HTML/CSS/JS, desktop and phone.",+ "expected_output": "A settings screen with a label column beside its fields (or stacked fields on a phone), labels above inputs, one control height, quiet borders, honest disabled states, a members table with right-aligned figures and one status pill per row, and no decorative icons or gradients.",+ "files": []+ },+ {+ "id": 10,+ "name": "app-support-queue",+ "prompt": "The queue screen of Hearth, a support inbox for a six-person SaaS team: the list of conversations with assignee, priority, channel and time to the SLA, the open conversation with the customer's details beside it, plus filters and saved views. Static HTML/CSS/JS.",+ "expected_output": "A three-region work screen (navigation, list, conversation) that stays readable at 1440 and folds to one region at a time on a phone, with status shown once per row, times in words, no tinted icon squares or emoji, and app inspector checks passing.",+ "files": []}]}diff --git a/skills/taste-skill/library/app.json b/skills/taste-skill/library/app.jsonnew file mode 100644index 0000000..ebbdd8e--- /dev/null+++ b/skills/taste-skill/library/app.json@@ -0,0 +1,691 @@+{+ "version": 1,+ "about": "App-screen library for tasteskill: styles (directions), shells and screen patterns, distilled from the study of 23 desktop product screens (17 light, 6 dark, 17 products) chosen by the owner. Every number is a measurement from the study or a median over it, except where a note says a value was moved for contrast or for the house palette bans. Reference products are not named; the screenshots stay private.",+ "styles": [+ {+ "id": "achromatic-ledger",+ "name": "Achromatic ledger",+ "theme": "light",+ "basis": "4 screens: a seller home, a per-agent insights page, a generated report, a settings page with usage numbers",+ "suits": ["finance", "commerce", "devtools", "support", "report", "workspace", "builder"],+ "idea": "The chrome holds no colour at all; money and counts are set in ink, and a single hue appears only where a figure changed.",+ "colourBudget": "under 1% coloured pixels; the chart is ink, the only hue is a small change signal",+ "tokens": {+ "ground": "#f8f8f8",+ "surface": "#ffffff",+ "raised": "#eeeeee",+ "border": "#e6e6e6",+ "rule": "#f0f0f0",+ "control": "#d4d4d4",+ "text": "#0a0a0a",+ "muted": "#6b6b6b",+ "accent": "#141414",+ "positive": "#2e7d32",+ "negative": "#c4242a",+ "warning": "#92400e",+ "chart": ["#141414", "#8a8a8a", "#1d5fbf"],+ "pills": {+ "positive": ["#dcfae5", "#04250e"],+ "negative": ["#ffedea", "#831c1e"],+ "warning": ["#fffbeb", "#92400e"],+ "neutral": ["#eeeeee", "#3d3d3d"]+ },+ "radius": { "card": 12, "control": 8 },+ "font": {+ "family": "Geist",+ "second": "Geist Mono, for IDs and keys only",+ "fallback": "Inter, system-ui, sans-serif",+ "sizes": { "title": 24, "section": 16, "kpi": 30, "body": 14, "small": 12 },+ "weights": [400, 500, 700],+ "note": "700 is for money figures only; every other number is 400-500."+ },+ "density": "sparse",+ "rowHeight": 44,+ "sidebarWidth": 256,+ "gap": 12,+ "pad": 24,+ "controlHeight": 36+ },+ "shell": "open-plane",+ "shellAlternatives": ["icon-rail", "no-sidebar"],+ "signature": "No brand colour anywhere in the chrome: the primary action is near-black or a grey pill (#e5e5e5), the main series is drawn in ink with the comparison or the part after the cursor in grey, zero balances are set in grey, and the only hue on the screen is a small triangle or a short coloured number where a figure changed.",+ "avoid": [+ "a brand-coloured primary button",+ "tinted cards or tinted KPI tiles",+ "a coloured chart where one series in ink says it",+ "bold on anything but money",+ "a chart with no y-scale (the study's one example of this look hid magnitude behind hover and was flagged)"+ ]+ },+ {+ "id": "framed-sheet",+ "name": "Framed sheet",+ "theme": "light",+ "basis": "6 screens: a developer platform overview, an analytics overview, an events analytics tab, a list detail, a reports dashboard, a flow builder",+ "suits": ["analytics", "devtools", "builder", "smb-admin", "support", "commerce", "report"],+ "idea": "The app chrome is one tinted L-shaped frame; the work sits on a white sheet with a hairline edge and soft corners, so depth comes from a single tone step and no shadow.",+ "colourBudget": "under 3%; the brand shrinks to the logo and a 2px tab underline, the data carries the chroma",+ "tokens": {+ "ground": "#f9fbfc",+ "surface": "#ffffff",+ "raised": "#f4f6f8",+ "active": "#ebedee",+ "border": "#e8eaec",+ "rule": "#f0f1f2",+ "control": "#cdced1",+ "text": "#131416",+ "muted": "#5d5f60",+ "accent": "#1b6c80",+ "positive": "#1e7b4f",+ "negative": "#c4242a",+ "warning": "#92400e",+ "chart": ["#1b6c80", "#2f70bb", "#a86f0c"],+ "pills": {+ "positive": ["#dcfae5", "#04250e"],+ "negative": ["#ffedea", "#831c1e"],+ "warning": ["#fffbeb", "#92400e"],+ "neutral": ["#ebedee", "#353736"]+ },+ "radius": { "card": 8, "control": 6, "sheet": 16 },+ "sheetInset": 8,+ "font": {+ "family": "IBM Plex Sans",+ "second": "IBM Plex Mono, for IDs and keys only",+ "fallback": "Inter, system-ui, sans-serif",+ "sizes": { "title": 22, "section": 16, "kpi": 28, "body": 14, "small": 12 },+ "weights": [400, 500, 600],+ "note": "KPI values at 400; the semibold goes on the label and the active tab."+ },+ "density": "medium",+ "rowHeight": 48,+ "sidebarWidth": 228,+ "gap": 24,+ "pad": 24,+ "controlHeight": 32+ },+ "shell": "framed-sheet",+ "shellAlternatives": [],+ "signature": "One tinted frame holds the sidebar and the 48px top bar with no rule between them; the page is a white sheet inset 8px from the window's right and bottom edges, with a 1px edge, 16px corners and no shadow. The active tab is a 2px underline in ink or the accent; everything else in the chrome is grey.",+ "avoid": [+ "a border between the sidebar and the top bar",+ "a shadow under the sheet",+ "cards whose border is heavier than the sheet's (#cdcfcf on cards read as heavy in the study)",+ "a fourth nesting level: frame, sheet and card are enough",+ "different gutters for the KPI row and the chart row (20 against 24 was flagged)"+ ],+ "notes": "The study's second data hue in this style was an orange (#e88e46) that falls inside the house terracotta range; the third chart colour here is an amber moved out of that range and darkened to 3:1 on white."+ },+ {+ "id": "accent-ladder",+ "name": "Accent ladder",+ "theme": "light",+ "basis": "3 screens: a newsletter home, a network analytics overview, a cap-table company home",+ "suits": ["creator", "smb-admin", "community", "analytics"],+ "idea": "One brand hue at full strength only on small marks, and its pale tints doing all the area work: the active nav row, a plan card, badges and progress tracks.",+ "colourBudget": "3-10%, nearly all of it as pale tints of the one hue",+ "tokens": {+ "ground": "#f9fafb",+ "surface": "#ffffff",+ "raised": "#f3f4f6",+ "border": "#e5e7eb",+ "rule": "#f2f2f2",+ "control": "#d1d5db",+ "text": "#111827",+ "muted": "#5f6672",+ "accent": "#b8336a",+ "accentSoft": "#fdf2f7",+ "accentTrack": "#f8dbe8",+ "accentInk": "#6b1d3e",+ "positive": "#247b50",+ "negative": "#c4242a",+ "warning": "#92400e",+ "chart": ["#b8336a", "#6b7280", "#d4618f"],+ "pills": {+ "positive": ["#dcfce7", "#14532d"],+ "negative": ["#ffedea", "#831c1e"],+ "warning": ["#fffbeb", "#92400e"],+ "neutral": ["#f3f4f6", "#374151"],+ "accent": ["#fdf2f7", "#6b1d3e"]+ },+ "radius": { "card": 8, "control": 6 },+ "font": {+ "family": "DM Sans",+ "second": null,+ "fallback": "Inter, system-ui, sans-serif",+ "sizes": { "title": 32, "section": 18, "kpi": 24, "body": 14, "small": 12 },+ "weights": [400, 500, 600, 700],+ "note": "700 for the page title only."+ },+ "density": "sparse",+ "rowHeight": 45,+ "sidebarWidth": 230,+ "gap": 24,+ "pad": 24,+ "controlHeight": 32+ },+ "shell": "open-plane",+ "shellAlternatives": ["ruled-t-frame"],+ "signature": "The full hue goes only on small marks: the one filled-button style, the data series and the active nav icon. Its 50-200 tints carry every area: the active nav row (tint fill with the dark ink of the hue), the plan or trial card, badges and progress tracks. The primary action may instead be near-black, as on the study's newsletter home.",+ "avoid": [+ "the full hue on large areas",+ "a second accent family (four families on one screen was flagged in the study)",+ "a gradient on the trial chip or upgrade button",+ "a left accent bar on the active nav row on top of the tint (seen once in 23 screens)",+ "violet or indigo"+ ],+ "notes": "All three studied screens of this kind used violet, purple or pink as the one hue. The move does not depend on the hue, so the house's violet and indigo ban holds and the library deals a raspberry instead."+ },+ {+ "id": "editorial-greeting",+ "name": "Editorial greeting",+ "theme": "light",+ "basis": "2 screens: a team workspace home and a personal insights home",+ "suits": ["workspace", "creator"],+ "idea": "A personal or team home that opens with a typeset greeting in a centred column; every number below it is set at regular weight on tonal panels.",+ "colourBudget": "under 2% for the accent; tonal panels carry the structure",+ "tokens": {+ "ground": "#ffffff",+ "surface": "#f9f9f9",+ "raised": "#ffffff",+ "border": "#eaeaea",+ "rule": "#f3f3f3",+ "control": "#d9d9d6",+ "text": "#1f201d",+ "muted": "#636361",+ "accent": "#d32420",+ "positive": "#2e7d32",+ "negative": "#1f201d",+ "warning": "#92400e",+ "chart": ["#d32420", "#8c8c88"],+ "pills": {+ "positive": ["#dcfae5", "#04250e"],+ "negative": ["#f3f3f3", "#1f201d"],+ "warning": ["#fffbeb", "#92400e"],+ "neutral": ["#f3f3f3", "#3d3d3a"]+ },+ "radius": { "card": 22, "control": 999 },+ "font": {+ "family": "Instrument Sans",+ "second": "Instrument Serif, for the greeting only",+ "fallback": "Inter, system-ui, sans-serif",+ "sizes": { "title": 48, "section": 14, "kpi": 32, "body": 14, "small": 12 },+ "weights": [400, 500, 600],+ "note": "The 48px title is the serif greeting; set in the sans it is 24/400. Every figure is 400."+ },+ "density": "sparse",+ "rowHeight": 63,+ "sidebarWidth": 224,+ "gap": 16,+ "pad": 20,+ "controlHeight": 38+ },+ "shell": "open-plane",+ "shellAlternatives": ["framed-sheet"],+ "signature": "The greeting is the h1, in a centred 1100px column on a real 12-column grid (77px columns, 16px gutters), with mixed spans that land on column lines (3/3/3/3, then 7/5, then 8/4). Every figure below is regular weight on tonal panels: panel one step off white, value card white inside it.",+ "avoid": [+ "an emoji in the greeting",+ "a tracked uppercase date above the greeting (put the date after it or in the grey line below)",+ "a 624-864px column on a desktop screen (both were flagged as wasted width)",+ "an orange-brown accent: keep it a clear red, never terracotta or rust",+ "a red falling number: the accent is red here, so a fall is written with a minus sign in ink (negative is set to the ink on purpose)"+ ],+ "notes": "One studied screen set its greeting in a serif at 48/700 and its counts in a mono; the other set the greeting at 24/400 in the sans. The red is the second screen's chart red moved two degrees of hue out of the house terracotta range."+ },+ {+ "id": "pastel-consumer",+ "name": "Pastel consumer",+ "theme": "light",+ "basis": "2 screens: a wallet home and a personal finance home",+ "suits": ["wallet", "finance"],+ "idea": "Categories are coded by pale tints whose ink is the dark of the same hue, all under one large radius, and each headline sum sits inside the card that explains it.",+ "colourBudget": "5-8%, as pale tiles and data marks",+ "tokens": {+ "ground": "#f3f5f7",+ "surface": "#ffffff",+ "raised": "#f2f8fd",+ "border": "#e6e6e6",+ "rule": "#f4f4f4",+ "control": "#d6d9dd",+ "text": "#1b1d1f",+ "muted": "#5c6064",+ "accent": "#1d5fd6",+ "accentSoft": "#dcf1ff",+ "accentInk": "#0a3a80",+ "positive": "#2f7a45",+ "negative": "#c41c29",+ "warning": "#92400e",+ "chart": ["#1d5fd6", "#2a8798", "#3f8f60"],+ "pills": {+ "positive": ["#dcfae5", "#04250e"],+ "negative": ["#ffedea", "#831c1e"],+ "warning": ["#fffbeb", "#92400e"],+ "neutral": ["#eef1f4", "#3a3d40"],+ "accent": ["#dcf1ff", "#0a3a80"]+ },+ "radius": { "card": 20, "control": 10 },+ "font": {+ "family": "Manrope",+ "second": null,+ "fallback": "Inter, system-ui, sans-serif",+ "sizes": { "title": 28, "section": 20, "kpi": 32, "body": 16, "small": 14 },+ "weights": [400, 500, 600],+ "note": "Money at 24-32px; card titles regular; semibold for net worth, bill amounts and actions."+ },+ "density": "medium",+ "rowHeight": 72,+ "sidebarWidth": 240,+ "gap": 24,+ "pad": 24,+ "controlHeight": 40+ },+ "shell": "open-plane",+ "shellAlternatives": ["icon-rail"],+ "signature": "Pale category tiles with the dark of their own hue as ink (#dcf1ff with #0a3a80), one large radius (20px on cards, stepping down to 10, 8 and 5 inside), and quiet money polarity: income green with a plus sign, spending in ink, no red on ordinary outgoings.",+ "avoid": [+ "a gradient balance card",+ "two data palettes on one page (flagged in the study)",+ "red on every outgoing amount",+ "a 624px phone-width column on a desktop screen (flagged as a stretched phone screen)",+ "a KPI strip on top: the sums belong in their cards"+ ],+ "notes": "The two studied screens used a pure #0000ff and an indigo #4723f5 as their brand colour, and pastels such as #7cbecf that fall under 3:1 on white. The library uses a cobalt that reads as blue rather than indigo, and data colours darkened to at least 3:1 on the card."+ },+ {+ "id": "true-black-flat",+ "name": "True-black flat",+ "theme": "dark",+ "basis": "5 screens: an events back office, an event analytics tab, a community overview, an artist studio home, an artist insights page",+ "suits": ["community", "creator", "markets"],+ "idea": "Night mode on true black: sidebar, top bar and page share one ground, elevation is a lightness step alone, and colour is confined to data marks.",+ "colourBudget": "at or under 3%; the accent never touches buttons, tabs or nav",+ "tokens": {+ "ground": "#000000",+ "surface": "#111111",+ "raised": "#2a2a2a",+ "border": "#1a1a1a",+ "rule": "#161616",+ "control": "#444444",+ "text": "#ffffff",+ "muted": "#aaaaaa",+ "faint": "#969696",+ "accent": "#c6f24e",+ "positive": "#3fc07a",+ "negative": "#e5484d",+ "warning": "#e5a93b",+ "chart": ["#c6f24e", "#e6e6e6", "#6b6b6b"],+ "pills": {+ "positive": ["#172a1d", "#3fc07a"],+ "negative": ["#2c1a20", "#e5566f"],+ "warning": ["#2b2414", "#e5a93b"],+ "neutral": ["#222222", "#ffffff"]+ },+ "radius": { "card": 20, "control": 999 },+ "font": {+ "family": "Inter",+ "second": null,+ "fallback": "system-ui, sans-serif",+ "sizes": { "title": 20, "section": 16, "kpi": 24, "body": 14, "small": 12 },+ "weights": [400, 500, 600],+ "note": "Nothing above 600; inactive nav labels #bbb, active #fff."+ },+ "density": "medium",+ "rowHeight": 80,+ "sidebarWidth": 210,+ "gap": 14,+ "pad": 22,+ "controlHeight": 36+ },+ "shell": "ruled-t-frame",+ "shellAlternatives": ["no-sidebar"],+ "signature": "Elevation by lightness alone (#000 ground, #111 card, #2a2a2a nested panel) with no borders or shadows on cards; the active nav item is marked only by its label going from #bbb to #fff; the primary control is made primary by inversion, a white 36px pill with black text.",+ "avoid": [+ "a navy or slate dark theme",+ "glow, neon borders or shadows",+ "a hue per chart (five hues across four charts was flagged)",+ "the accent on buttons, tabs or nav",+ "a 64px top bar left empty across most of its width (flagged twice)"+ ],+ "notes": "The studied screens of this kind used a violet-magenta (#dd6cff) and an orange (#ff5500) as their one data hue. The library deals a lime, which keeps the move and stays clear of the violet ban and of the positive green. The tertiary grey is lifted from the measured #888 to #969696 so it still reads at 4.5:1 on the #2a2a2a nested panel."+ },+ {+ "id": "data-terminal",+ "name": "Data terminal",+ "theme": "dark",+ "basis": "1 screen: a stock research view. Keep it narrow.",+ "suits": ["markets", "devtools"],+ "idea": "A research or monitoring screen read in long sessions: cards darker than the ground, tabular digits that stack, signs instead of colour, and every selection marked by the same 1px accent line.",+ "colourBudget": "under 3%; the accent is never more than a 1px line",+ "tokens": {+ "ground": "#171719",+ "surface": "#131217",+ "raised": "#212023",+ "border": "#222224",+ "rule": "#1b1a1f",+ "control": "#3a3a3e",+ "text": "#ffffff",+ "muted": "#8a8c92",+ "accent": "#4a8ad6",+ "positive": "#44a282",+ "negative": "#e5566f",+ "warning": "#d9a441",+ "chart": ["#f2f2f3", "#e5566f", "#4a8ad6"],+ "pills": {+ "positive": ["#1b2828", "#5fc39c"],+ "negative": ["#2c1a20", "#e5566f"],+ "warning": ["#2a2416", "#d9a441"],+ "neutral": ["#212023", "#bdbdc0"]+ },+ "shadow": "0 12px 28px rgba(0,0,0,.2)",+ "radius": { "card": 6, "control": 999 },+ "font": {+ "family": "Public Sans",+ "second": null,+ "fallback": "Inter, system-ui, sans-serif",+ "sizes": { "title": 26, "section": 20, "kpi": 20, "body": 13, "small": 11 },+ "weights": [400, 500, 600, 700],+ "note": "Section titles 20/400 in the muted grey; card titles 16/600; tabular figures everywhere."+ },+ "density": "dense",+ "rowHeight": 42,+ "sidebarWidth": 50,+ "gap": 24,+ "pad": 32,+ "controlHeight": 34+ },+ "shell": "icon-rail",+ "shellAlternatives": [],+ "signature": "Every selection (tab, toggle, range, nav item) is a 1px accent line exactly as wide as its label, placed on the nearest existing edge; numbers stay white or grey and carry their sign in the text ('+$24,000,000').",+ "avoid": [+ "green and red on every number",+ "filled pill tabs or a coloured segmented control",+ "a chart with no scale and no dates (the studied screen had none and was flagged)",+ "tertiary text under 4.5:1 (#4c4c4f read at about 2:1 in the study)",+ "lighter cards with borders and a glow"+ ],+ "notes": "The studied screen's muted grey #82848a and red #d4405d were lifted to #8a8c92 and #e5566f so text passes 4.5:1 on the card. Its card list rows sit on a 28px pitch and its table rows on 42px."+ }+ ],+ "shells": [+ {+ "id": "open-plane",+ "name": "Open plane",+ "basis": "5 of 23 screens",+ "suits": ["finance", "wallet", "workspace", "creator", "analytics"],+ "numbers": {+ "sidebarWidth": "230-256 (230, 240, 256 in the study; 280 and 292 with a built-in icon rail)",+ "separation": "none, or one 1px hairline; the sidebar sits on the page ground or within 1-2% of it",+ "navPitch": 34,+ "navRowHeight": 32,+ "navIcon": "16px outline, about 1.5px stroke",+ "navLabel": "14px, 400, grey or ink",+ "activeItem": "neutral grey pill, radius 6-12, inset 8-12px from the sidebar edges (#e9e9e9-#ededed)",+ "topBar": "none",+ "canvas": "fluid with a 24-64px gutter, or a centred 1100px column"+ },+ "blueprint": "The labelled sidebar sits on the page ground with nothing or one hairline between it and the canvas; there is no top bar, and the page header and cards sit straight on the ground about 32-36px from the top. Workspace or account switcher at the top of the sidebar, primary nav on a 34px pitch, groups under 12-13px sentence-case grey labels with 22-56px of air above, utilities and the user row pushed to the bottom. Cards are white on the off-white ground (or the sidebar is white with a 1px border on a #f9fafb canvas). The canvas is fluid with one gutter value, or a centred column for personal homes.",+ "phone": "The sidebar folds into a 48px top bar holding the screen's name, a menu button that opens a full-screen sheet with the nav and the switcher, and at most one action. Content takes the full width with 16px margins."+ },+ {+ "id": "framed-sheet",+ "name": "Tinted frame, white sheet",+ "basis": "8 of 23 screens, in three variants",+ "suits": ["analytics", "devtools", "builder", "smb-admin", "support"],+ "numbers": {+ "chrome": "#f6f6f6-#f9fbfc (a warm #f7f6f2 once)",+ "sheetInset": "8px from the window's right and bottom edges (12 and 16 once each)",+ "sheetRadius": "10-16, median 16",+ "sheetEdge": "1px #eaeaea-#ededed, no shadow",+ "sidebarWidth": "220-263 (228 on two screens)",+ "topBar": "48px on the chrome ground with no rule; search 548x32 centred on the window with a shortcut hint",+ "contentPadding": 24,+ "floatingVariant": "both panels inset 12px with a 12px gutter, radius 10"+ },+ "blueprint": "Sidebar and top bar share one tinted ground with no rule between them, forming an L; the page lives on a white sheet. Variant one: the sheet butts against the sidebar and the top bar and is inset 8px from the right and bottom edges, 16px radius, 1px edge. Variant two: a flush L-frame with no inset, the frame marked by one rule. Variant three: sidebar and content are two floating panels inset 12px from every edge with a 12px gutter. The top bar, when present, is 48px and holds a centred search, the account button and a help or AI icon. Inside the sheet the content has 24px padding and starts with the breadcrumb or title row.",+ "phone": "The frame disappears: the sheet becomes the screen, with a 48px top bar (menu button, title, one action) on the chrome tint. The search moves into the menu sheet or behind an icon."+ },+ {+ "id": "ruled-t-frame",+ "name": "Ruled T-frame",+ "basis": "4 of 23 screens (3 dark, 1 light)",+ "suits": ["community", "creator", "smb-admin"],+ "numbers": {+ "sidebarWidth": "210-240",+ "topBar": "64px with a 1px bottom rule",+ "rules": "1px; #1a1a1a on #000, #f2f2f2 on white",+ "navPitch": "34 (dark) or 40 (light)",+ "switcher": "at the top bar's right end, behind a full-height 1px divider",+ "contentGutter": "29px from the sidebar rule and the window edge"+ },+ "blueprint": "A 210-240px sidebar and a 64px top bar share one ground, divided only by 1px rules. The workspace or community switcher sits at the right end of the top bar behind a full-height divider; the sidebar holds the wordmark and the nav on a 34px pitch with sentence-case group labels. On dark, the active item is its label going from #bbb to #fff. The top bar must carry something real (search, the back link and object name, the switcher): two studied screens left about 1070px of it blank and were flagged.",+ "phone": "The top bar stays at 48-56px with the switcher reduced to its mark; the sidebar becomes a full-screen menu sheet or a bottom bar of four or five destinations."+ },+ {+ "id": "icon-rail",+ "name": "Icon rail",+ "basis": "3 of 23 screens",+ "suits": ["markets", "devtools", "finance", "wallet"],+ "numbers": {+ "railWidth": "50-60, median 55",+ "icon": "15-18px outline",+ "pitch": "34-49",+ "active": "icon colour alone, or a full-bleed 50px band at a 2% tint, or a 1px accent bar on the rail's border",+ "groups": "short 20px hairlines, no labels",+ "utilities": "pushed to the bottom after a gap of about 200px"+ },+ "blueprint": "An unlabelled rail of 50-60px carries the brand mark at the top and 15-18px outline icons on a 34-49px pitch; groups are split by 20px hairlines, utilities sit at the bottom. The rail sits on the page ground with a 1px edge, or is white with a faint 4px shadow on a grey ground. It saves about 180px of width against a labelled sidebar, so it suits products with few destinations and screens that need the width. Icons need tooltips and an accessible name.",+ "phone": "The rail becomes a bottom bar with the same four or five icons, each with a short label under it."+ },+ {+ "id": "no-sidebar",+ "name": "No sidebar",+ "basis": "3 of 23 screens",+ "suits": ["report", "creator", "community"],+ "numbers": {+ "topBar": "46-48px on the page ground, no border",+ "column": "centred, 1088-1208px",+ "gutters": "152-212px at a 1512px window",+ "logo": "on the column's left edge",+ "links": "14-15px semibold grey"+ },+ "blueprint": "A 46-48px top bar on the page ground over a centred 1088-1208px column; the logo sits exactly on the column's left edge and the bar's right cluster ends near its right edge, so header and content share one column. Three to five text links, a 36px search, the account. Use it for generated reports, viewers and products with few destinations; with a sticky bar on the same ground, give it a 1px rule when content scrolls under it (the studied bar without one sliced content off).",+ "phone": "The bar keeps the logo, a search icon and a menu button; the links move into the menu sheet. The column becomes the full width with 16px margins."+ }+ ],+ "patterns": [+ {+ "id": "kpi-strip-chart-rail",+ "name": "KPI strip, main chart and a side rail",+ "screen": "overview",+ "kinds": ["creator", "smb-admin", "community", "analytics"],+ "basis": "a newsletter home; a community overview",+ "blueprint": "Title row: a 24px noun or the product's name at 600-700, an optional 14-16px grey line under it, and the one primary action on the right, bottom-aligned with that line. 16-24px below, the scope row: section tabs and the date range in one row of 32-36px controls, or a 48px segmented track with the range select inside its right end. Then a grid of 1fr and a fixed 384px rail with a 24px gap. Main column: one KPI container split by 1px dividers into 3-5 equal cells (14px grey label, 24px value at 400-600, a 12px caption naming the baseline and window), then the main chart card, which is the largest thing on the screen, then the next card, all 16px apart. Rail: 16px headings outside their cards, 8px above each and 16px after the previous card; a recent-items list of 3-5 rows on a 45px pitch with 1px rules, closed by a 30px outlined 'View all' button instead of pagination. The rail starts level with the first card, not with the title.",+ "phone": "The rail moves below the main column; the KPI container becomes a 2-column grid; tabs scroll inside their own row."+ },+ {+ "id": "kpi-tabs-chart",+ "name": "KPIs as the chart's tabs",+ "screen": "overview",+ "kinds": ["finance", "commerce"],+ "basis": "a seller home",+ "blueprint": "One card per subject, stacked full width 8-16px apart, the page header indented by the card padding so the title, the card titles, the numbers and the plot share one left edge. Balances that do not change during the day go first, in one container split by 1px dividers into equal columns; a zero balance is grey and its caption becomes the next step. In the main card, 2-4 KPIs sit in a row and act as the chart's series tabs: the selected one in ink, the others grey with their label and value; choosing one swaps the series. Under them, one line chart as wide as the card's content (about 1136x220 in the study): 3-4 solid 1px gridlines, 4-6 round y ticks at 12px, a 2-3px line in ink with straight segments and no fill, an 8px hover dot with a 1px dashed guide and the line after the cursor in pale grey. Close with a 2-3 row comparison table on a 36px pitch, value and change columns right-aligned under a 14px grey header such as 'vs prior Monday'.",+ "phone": "KPI tabs become a 2-up row above the chart; the chart is full width, 160-200px tall, with 4 x labels; the comparison table keeps its two right-aligned columns."+ },+ {+ "id": "chart-pairs",+ "name": "Per-period and running-total pairs",+ "screen": "analytics",+ "kinds": ["community", "smb-admin", "analytics"],+ "basis": "a network analytics overview",+ "blueprint": "Title at 24-32px with one sentence under it saying what the filters do, then one filter row of 36-38px controls (one filled or near-black, the rest borderless or text, a reset link last) and 16-24px to the KPIs. KPI row: 3 equal cards in the content column (3 x 372 + 2 x 17 = 1152 in the study) or one divided container; a 16px label over the value with the change written as a phrase on the value's baseline ('+8 in the last 90 days'), grey when it is zero. Then one row per metric: the per-period column chart on the left and its cumulative line on the right, at equal width (2 x 568 + 16 = 1152) and with the same x ticks; square bars, a 2px straight line, integer ticks from zero, no legend because each chart has one series. One gap value horizontally and vertically.",+ "phone": "Pairs stack, the cumulative chart directly under its per-period chart; KPI cards become a single column of label-value rows."+ },+ {+ "id": "insights-share-tables",+ "name": "Insights with share tables",+ "screen": "analytics",+ "kinds": ["analytics", "devtools", "builder"],+ "basis": "a per-agent insights page",+ "blueprint": "No cards: sections are carried by whitespace and a 16/500 heading with one 14px grey sentence under it saying what the section shows. A row of up to 6 KPIs on a fixed pitch (12px grey label over a 30px tabular value, no boxes, no dividers), then one full-width time chart (about 218px plot, 5 hairline gridlines, 11-12px grey ticks, a dot legend under the title, a 'Compare to previous period' text button on the right). Then a 2 x 2 grid of small tables with a 24px gutter whose rows align across the two columns. Each table: a header of 12px grey labels with no fill and no rule, 44px rows with 2px gaps whose rounded fill (#f5f7f9, radius 8) is the data bar, its width the row's share divided by the largest share; Share in 12px grey and Count in 14px ink, both right-aligned. An empty table keeps its header and shows one dashed 1px box about 38px tall with one sentence ('No Slack channel usage in this range.').",+ "phone": "KPIs become a 2 x 3 grid; the chart is full width; the share tables stack in one column and keep their row bars."+ },+ {+ "id": "table-filter-bar",+ "name": "Table with tabs and a filter bar",+ "screen": "list",+ "kinds": ["community", "devtools", "commerce", "support", "smb-admin"],+ "basis": "an events back office, a tracks studio, a sessions overview",+ "blueprint": "Title row: an 18-24px title on the left, at most an outlined secondary and the one primary (36px) on the right. Underline tabs for the list's states on a full-width 1px rule with a 2px indicator as wide as the label; 22-32px below, the toolbar: a search of about 252-316 x 32-36 on the left, the count ('7 events') and the sort on the right. The table sits on the panel or page ground with no card around it: a header of 12-13px grey sentence-case labels with no fill and no rule, rows on a 48-56px pitch for one line or 72-92px with a thumbnail (media height plus 24-32px), 1px rules 3-7% darker than the ground or no rules at all, the identity column given the most width, numbers right-aligned in tabular figures with the unit muted ('5 /10'), one status mark per row and one kebab at the far right. Drop a column that is empty in every row (a blank co-host column left a 300px dead band). On an overview, cap the rows and link to the full list; on the full list, state the total and load more at the end.",+ "phone": "Rows become two-line items: identity and the key number on line 1, the secondary fields in 13px grey on line 2, the kebab at the right. Tabs scroll in their own row; the search becomes a full-width field."+ },+ {+ "id": "count-cards-filter",+ "name": "Count cards that filter",+ "screen": "list",+ "kinds": ["community", "commerce", "support"],+ "basis": "an events back office",+ "blueprint": "Above a list, 3-5 equal count cards (61px tall, 12px padding, a 13px grey label over a 16/600 value, 8px gap) are the type filter: the selected card gets a 1.5px accent border and a pale accent fill, and the list below shows that type only. Zero counts print as '0' in the same style; no deltas, no icons. This is one place where a row of identical small cards is right: the cards are peers and each one does work.",+ "phone": "The count cards become a horizontally scrolling row of chips with the count inside each, or a select above the list."+ },+ {+ "id": "settings-two-column",+ "name": "Settings in two columns",+ "screen": "settings",+ "kinds": ["devtools", "smb-admin", "support", "workspace", "commerce", "analytics", "finance", "wallet", "creator", "community", "builder", "markets", "report"],+ "basis": "one settings page; stacking from a narrow rail card. The basis is thin.",+ "blueprint": "A centred column of about 1152px. Each section is one row: a label column of about 450px (16/500 title, 14px grey description; the title's cap top 6-8px below the panel top, level with the panel's first line) beside a panel of about 700px with a #fafafa fill, 16px radius, 16px padding, no border and no shadow. Sections are split by a full-width 1px rule with 32px above and below. Inside a panel: field labels 14/500 above 40px white inputs (1px #e8e8e8, radius 10), 8px from label to field, 16px between fields, 24px from the description to the first label, 16px to the Save button; switch rows with a 14/500 title, a 20px status badge 8px after it, a 14px grey description and a 28x16 toggle 16px from the right edge, centred on the title line. A plan-gated feature shows a 48px tinted strip with a 32px button directly above its panel, and the panel stays readable. When a panel runs much taller than its label, put the section's help or a summary of the current values in the label column rather than 250px of nothing.",+ "phone": "Each section stacks: title and description, then the panel at full width. Inside, label, 8-10px, field, 16-26px to the next pair; toggles stay on the right of their title."+ },+ {+ "id": "settings-with-usage",+ "name": "Settings with usage on top",+ "screen": "settings",+ "kinds": ["devtools", "smb-admin", "support"],+ "basis": "one settings page",+ "blueprint": "When a settings screen also reports usage, put 3-4 usage numbers in one row on top (a 14px grey label, a 30px regular value, a 12px change pinned to the card bottom with its window in words, a grey dash where there is no comparison) and link out to the analytics screen ('View more') instead of drawing a chart. Below, the two-column settings rows. One dark primary per screen. Keep upsell to one surface: the studied settings page carried three nags (a top banner, a setup button and a gated strip) and was flagged for it.",+ "phone": "The usage row becomes a 2-column grid of label-value pairs; settings rows stack."+ },+ {+ "id": "wallet-balance-actions-assets",+ "name": "Balance, actions and assets",+ "screen": "wallet",+ "kinds": ["wallet", "finance"],+ "basis": "a wallet home",+ "blueprint": "One column whose every element snaps to its two edges. A balance card (1px border, 16px radius, about 134px tall) holding one 32px figure and one line under it in which only the change is coloured ('-$0.09 in the last 30 days'); the title says what the figure is, so it needs no label. 32px below, 4 equal action tiles in a pale tint with dark same-hue icon and 12-14px label (4 x 144 + 3 x 16 = 624 in the study; scale the column and keep the arithmetic). 32-40px below, text tabs for the asset kinds on a 1px rule with a 2px ink indicator as wide as the word, a network or account select on the right of the same row. Then the asset table: 72px rows (48px round icon plus 24px), no dividers, two-line cells pairing a 16px value with a 14px grey unit amount, numeric columns right-aligned to shared edges, change as a small solid triangle and a coloured percentage, zero change grey, a missing share a grey em dash. On a desktop do not leave the column at phone width: the study's 624px column was flagged as a stretched phone screen; widen it to 864-1100 or give it a second column.",+ "phone": "This pattern is phone-first: the same column at full width with 16px margins, the 4 tiles in one row, the table as two-line rows with the value right-aligned."+ },+ {+ "id": "finance-home-pinned-rail",+ "name": "Finance home with a pinned accounts column",+ "screen": "overview",+ "kinds": ["finance", "wallet"],+ "basis": "a personal finance home",+ "blueprint": "No page header and no KPI strip: cards start 36px from the top and each headline sum sits in the card that explains it. On the left, a 306px accounts card pinned at the viewport height minus the 36px margins opens with net worth (16/600 label left, value right) and holds the account tree with no dividers: groups 16px ink, categories 14px ink, leaves 14px grey indented 8px, values right-aligned, a 30px pitch and about 45px between groups; an empty group is a bordered box with an '+ Add account' link instead of $0.00. On the right, a 2-column grid with 24px gaps of cards that answer this month's questions, each with its own period caption: the plan (spanning both columns; a ring with an empty hole, a dot legend, the available figure beside it with a per-day line), recent spending as 61px two-line rows (payee over category, amount over date, right-aligned) and upcoming bills. Income is green with a plus sign; spending stays in ink.",+ "phone": "Net worth becomes the first card; the account tree collapses to its groups with totals; the month cards stack."+ },+ {+ "id": "builder-canvas",+ "name": "Builder canvas",+ "screen": "builder",+ "kinds": ["builder"],+ "basis": "a flow builder in analytics mode",+ "blueprint": "No global navigation: a 44px top bar on the window ground with no rule (an exit arrow, the object's name at 16/600 with a status pill, and on the right 16px icon buttons on a 40px pitch, a secondary and a near-black primary, split by 1px dividers). Below, two panels on the ground with 8px outer margins and a 12px gap, both with a 1px border, 16px radius and no shadow: a 232px palette (16px padding, groups under 14px labels, items on a 40px pitch with a small type tile, a label and a drag grip) and the canvas, a flat well one step darker than the ground (#f4f6f8 on #f9fbfc) with no dot grid. Nodes share one width (338px in the study), 12px radius, a 1px hairline, padding 16 on top and 12 at the sides, a type tile and a 16/600 title, and their metrics in a well as key-value rows on a 32px pitch with right-aligned tabular or mono values ('0% (0)'). Nodes stack on one spine 64px apart with a 38px round insert button centred in each gap; connectors are 1px orthogonal lines with 6px rounded elbows. Overlays (date range, zoom, minimap) are small white controls pinned 16px inside the canvas corners. Canvas content is one size larger than the chrome (16 against 14). Node-type tiles may be tinted, one pastel per type, the same in the palette and on the canvas: pass --allow icon-chips to the inspector and say why.",+ "phone": "Editing a graph on a phone is rarely the job: show the flow read-only as a vertical list of nodes with their metrics, and the palette as a bottom sheet if editing is kept."+ },+ {+ "id": "inbox-triage",+ "name": "Inbox triage",+ "screen": "inbox",+ "kinds": ["support", "workspace"],+ "basis": "assembled from the study's list, feed and rail measurements; no inbox screen was in the study",+ "blueprint": "Three regions on one ground: the navigation (a 230px sidebar or a 55px rail), the list, and the open item with its details. The list column has a fixed width (the study's fixed columns are 306 and 384px) and its own toolbar: saved views as underline tabs or a select, a 32px search, the count. Rows are two-line, 64-80px: line 1 is who (14/600) with the time in words right-aligned in grey ('9 min', 'Yesterday'); line 2 is the subject or last message in 13-14px grey, truncated to one line with an ellipsis. Unread rows set the name in ink and add a 6px dot or a 16px count circle; read rows set it in the secondary grey. One status mark per row (priority or SLA, as a pale pill or words, not both). The selected row gets a 1px outline at 6px radius, or a darker border with a 1px ring, never a saturated fill. The open item fills the remaining width; its details (customer, plan, history) sit in a fixed column of 306-384px as key-value rows on a 28-32px pitch.",+ "phone": "One region at a time: the list fills the screen; choosing a row pushes the conversation; the details open from a button in its header; back returns to the list at the same scroll position."+ },+ {+ "id": "workspace-home-greeting",+ "name": "Workspace home with a greeting",+ "screen": "home",+ "kinds": ["workspace", "creator"],+ "basis": "a team workspace home; a personal insights home",+ "blueprint": "A centred column on a real 12-column grid (77px columns, 16px gutters, 1100px), about 72px from the top. The greeting is the h1 (48/700 in a serif, or 24/400 in the sans), with the date after it or in a grey line under it, never as a tracked eyebrow, and no emoji. 50px below, 4 count tiles spanning 3 columns each (128px tall, 16px padding): label, value at regular weight in tabular or mono figures, a plain caption ('Ready when you are'), no deltas. Then mixed spans landing on column lines (7 + 5, then 8 + 4) for the main objects: panels with 20px padding, a 14/600 title, a count chip and a 'View all' link, holding row cards 63px tall with 8px gaps, one step lighter than the panel with a border one step darker. Pale tints may code the panels, each in the hue of the tile that counts it. Only a floating composer, if there is one, carries a shadow, and it must not cover the last rows.",+ "phone": "Greeting at 24-28px; tiles in a 2 x 2 grid; panels stack in reading order."+ },+ {+ "id": "object-detail-header-grid",+ "name": "Object header and a six-column grid",+ "screen": "detail",+ "kinds": ["community", "commerce", "analytics"],+ "basis": "an event's analytics tab",+ "blueprint": "The page header is the object itself: one card (88px, 14px padding) holding a 50x62 cover, the 18/600 name with 28px icon buttons beside it (open, copy, share), a 13px grey meta line (date, time, place) and outlined 36px actions on the right. Under it, underline tabs on a full-width 1px rule, then a 36px row with a segmented time range on the left and a refresh button on the right. The body is one 6-column grid with one gutter (14px) in both directions whose spans change by row while every edge lands on the same lines: 3 KPI tiles of 2 columns, the main chart in 4 columns beside a side chart in 2, two progress cards of 3, a full-width trend of 6. Give the widest card to the screen's question, and do not give 824px to one ring and one legend row (flagged).",+ "phone": "The header card keeps cover, name and meta, with actions in a kebab; every grid item takes the full width in the same order."+ },+ {+ "id": "generated-report",+ "name": "Generated report",+ "screen": "report",+ "kinds": ["report", "analytics"],+ "basis": "a report generated from a CSV",+ "blueprint": "No sidebar; the only chrome is a 47-48px viewer bar with a 1px rule. A centred 1088px column 33px below it: a 24/600 title, a 12px grey line 4px under it naming the source and the load time, one outlined 30px action on the right ('Refresh view'). If the data is a snapshot, one quiet notice (#fffbeb fill, 1px #fde68a, 12px #92400e text, 34px tall). Then 4 stat cards with a 12px gap (4 x 263 + 3 x 12 = 1088), a 12px grey label over an 18/600 tabular value; put the date range in the subtitle, not in a lone fifth card. Two charts side by side at the same 12px gap so their edges meet the stat columns: a time chart on a real time axis with flat labels, and a histogram with equal bins and square bottoms. Then the records table in a card: a 256x30 search in its header, a 14/600 grey header row over a 1px #e5e7eb rule, 37px rows over lighter #f3f4f6 rules, numbers right-aligned, a sort glyph on the active column only.",+ "phone": "Stats in a 2 x 2 grid; charts stacked; the table as two-line rows, or scrolling inside its own frame with the first column fixed."+ },+ {+ "id": "tabbed-object-detail",+ "name": "Tabbed object detail in a sheet",+ "screen": "detail",+ "kinds": ["analytics", "smb-admin", "builder", "support"],+ "basis": "a list's engagement tab; a reports dashboard",+ "blueprint": "Inside the sheet: a breadcrumb row at 16/600 (the parent in grey, the current page as the h1, a 24px grey type chip after it) with its actions on the right (a text button and an outlined 32px dropdown). Under it, the object's tabs at 14px with a 2px ink underline that runs 8px past the label, on a 1px rule that spans the sheet. 30px below, the filter row: a label above a 300x32 select on the left; the freshness stamp ('Last updated July 21, 2026') and a 40px refresh button on the right, centred on the select's line. Then 3 KPI cards (value 36/400, its label at 16/600 under it, the period in words) and 2 chart cards, all on one 24px gutter so the rows share column lines. Do not stretch a short card to its neighbour's height (it left 250px of dead white) and do not list legend series that have no data.",+ "phone": "Breadcrumb shortens to a back link and the h1; tabs scroll; KPI cards stack as label-value rows; charts full width."+ },+ {+ "id": "report-card-legend-table",+ "name": "Report card with a legend table",+ "screen": "analytics",+ "kinds": ["analytics", "smb-admin"],+ "basis": "a campaign overview",+ "blueprint": "A report card (20/600 title, a kebab top right, a 32px select for the scope) whose body splits into a 390px left block and the chart. Left: the hero number at 24/400 with its label under it and one change pill with its window ('vs. previous period'), then the legend as a mini table of 2-4 metric rows on a 57px pitch: dot, name at 15/600, a benchmark pill, the value right-aligned, the change right-aligned. Right: the line chart with 4 gridlines at round values, a 2px baseline with ticks, y labels on the right and axis text no larger than the data (12-14px; 16px ticks were flagged as louder than the numbers). Under it, a detail table whose rate cells stack the count over a 12px grey percentage on one right edge. Use the same colour for a series in the legend dot and in the line.",+ "phone": "The legend table goes above the chart; the detail table becomes two-line rows."+ },+ {+ "id": "research-lists-table",+ "name": "Research lists and a long table",+ "screen": "analytics",+ "kinds": ["markets", "devtools"],+ "basis": "a stock research view",+ "blueprint": "Header: a 26/700 title over a 20px grey date, quiet pill buttons on the right; a 1px rule about 44px below, with the tabs just under it and the active tab marked by a 1px accent line as wide as its label lying on that rule. 64px below, a 2-column row of cards at about 43/57 with a 24px gap: a ranked list on a 28px pitch (16px logo, bold ticker, grey name truncated, a right-aligned grey percentage and a white value, signs in the text) and a chart card with its legend in the header (5px dots, 13px grey labels), a text range selector under the baseline (1M 3M 6M YTD All, the active one marked by the same 1px accent segment) and 'Updated daily' in 11-12px grey. Then a 20/400 grey section title and a full-width table: a 38px header of 11-12px grey labels, 42px rows over 1px rules, ISO dates and every figure right-aligned in tabular numerals, white only for the identity and the total. Give the chart a y-scale and dates (the studied chart had neither and was flagged).",+ "phone": "Cards stack; the range selector stays as text under the chart; the table becomes two-line rows with the total on the right."+ },+ {+ "id": "platform-overview-tray",+ "name": "Platform overview with a usage tray",+ "screen": "overview",+ "kinds": ["devtools", "analytics"],+ "basis": "a developer platform project overview",+ "blueprint": "Sections stacked in one column about 48px apart, each with an 18/500 title on the left and a quiet action on the right ('View all', an outlined Refresh, a date-range button), and freshness in 14px grey after the title with a small status dot. First, a getting-started strip: one container split by 1px dividers into 4 equal cells (16/500 title, a 14px description, a grey arrow top right), shown until setup is done. Then the recent items table, capped at 4-5 rows on a 49px pitch: IDs in mono truncated to 8 characters plus an ellipsis with a copy icon, relative expiry in grey, rules that bleed 8px past the text column. Then usage: a #fafafa tray with 6px padding holding a KPI strip of 5 equal cells (a 14/500 label over a 24/400 value with a 14px unit suffix, '5 mins') and, 6px below, a chart card with a segmented control that switches the metric instead of drawing two series. Durations and timestamps in tabular figures. A missing value is a grey dash at label size, not '--' at value size.",+ "phone": "The getting-started strip becomes a 2 x 2 grid or a list; the table becomes two-line rows; the KPI strip a 2-column grid."+ },+ {+ "id": "bar-list-ranking",+ "name": "Bar list and ranking",+ "screen": "analytics",+ "kinds": ["analytics", "smb-admin"],+ "basis": "an AI-search visibility overview",+ "blueprint": "A 24/700 title with one factual stat chip beside the actions on the right; underline tabs on a 1px rule; a filter row of compound outlined groups that read as a sentence ('Date | Jun 14 - Jul 13 | Daily', 'Region | United States'), 28px tall and 8px apart. KPIs: as many equal columns as there are KPIs (four across, not four in a three-column grid that orphans one), tabular or mono values with fixed decimals. Then two equal panels, each with a 73px header (14/600 title, a 13px grey description, a dropdown that switches the panel's metric) over a full-bleed 1px rule: a sorted bar list (rows on a 64px pitch, a label line, then a 10px pill bar in one colour with no track, the value 5px after the bar's end, the longest bar about 88% of the width) and a ranking table (53px rows, rules inset to the padding, a rank, a 16px logo, a soft chip on the user's own row, values right-aligned). Do not fix a panel's height so its last row is cut off (flagged).",+ "phone": "KPIs in a 2 x 2 grid; panels stack; the bar list keeps its bars at full width."+ }+ ],+ "kinds": {+ "finance": { "note": "money homes, budgeting, accounting, seller balances", "styles": ["achromatic-ledger", "pastel-consumer"], "screens": ["overview", "list", "settings"] },+ "wallet": { "note": "consumer wallets, crypto, personal finance on the go", "styles": ["pastel-consumer", "achromatic-ledger"], "screens": ["wallet", "list", "settings"] },+ "commerce": { "note": "seller and shop back offices: orders, payouts, products", "styles": ["achromatic-ledger", "framed-sheet"], "screens": ["overview", "list", "detail"] },+ "analytics": { "note": "B2B analytics, marketing and growth reporting", "styles": ["framed-sheet", "achromatic-ledger", "accent-ladder"], "screens": ["analytics", "list", "detail"] },+ "devtools": { "note": "developer platforms: deploys, sessions, API keys, usage", "styles": ["framed-sheet", "data-terminal", "achromatic-ledger"], "screens": ["overview", "list", "settings"] },+ "builder": { "note": "flow, form, page and automation builders", "styles": ["framed-sheet", "achromatic-ledger"], "screens": ["builder", "list", "settings"] },+ "creator": { "note": "newsletters, creator studios, audience insights", "styles": ["accent-ladder", "editorial-greeting", "true-black-flat"], "screens": ["overview", "analytics", "list"] },+ "smb-admin": { "note": "small-business and SaaS admin with plans, onboarding and growth nudges", "styles": ["accent-ladder", "framed-sheet"], "screens": ["overview", "list", "settings"] },+ "workspace": { "note": "team hubs and personal homes", "styles": ["editorial-greeting", "achromatic-ledger"], "screens": ["home", "inbox", "settings"] },+ "community": { "note": "community, events and media back offices", "styles": ["true-black-flat", "accent-ladder"], "screens": ["overview", "list", "detail"] },+ "support": { "note": "support inboxes, queues, helpdesks", "styles": ["achromatic-ledger", "framed-sheet"], "screens": ["inbox", "list", "settings"] },+ "markets": { "note": "trading, research and monitoring read in long sessions", "styles": ["data-terminal", "true-black-flat"], "screens": ["analytics", "list", "detail"] },+ "report": { "note": "generated or exported reports with no app around them", "styles": ["achromatic-ledger", "framed-sheet"], "screens": ["report"] }+ }+}diff --git a/skills/taste-skill/references/app-screens.md b/skills/taste-skill/references/app-screens.mdnew file mode 100644index 0000000..276fc24--- /dev/null+++ b/skills/taste-skill/references/app-screens.md@@ -0,0 +1,872 @@+# App screens++Dashboards, admin, analytics, settings, inboxes, wallets and builders: the screens people work in.+Read this file whole before you start one. The page run in `SKILL.md` does not apply to them.++A generated dashboard is the average of every dashboard template: a dark or tinted sidebar with a+coloured pill on the active item, "Welcome back" and a waving hand, four KPI cards each with an icon+in a tinted circle, a green "+12.5%" and a sparkline, a gradient area chart, a zebra table under+uppercase headers. Nothing in it is wrong and none of it was decided.++This chapter is distilled from a study of 23 real product screens chosen by the owner: 17 products,+17 light screens and 6 dark, all at desktop width (1440 or 1512px). Each screen was measured from its+pixels and noted for what works and what fails; the numbers below are those measurements and their+medians. The products are not named. What separates these screens from the generated kind, in order+of how much it shows:++1. **Colour goes on data, not chrome.** The median screen has about 3% coloured pixels; 17 of 23 stay+ at 5% or less. 12 have no filled primary button at all.+2. **KPIs are type, not tiles.** No screen puts an icon in a coloured circle on a KPI, and none draws a+ sparkline on one.+3. **Surfaces are flat.** 17 of 23 give their cards no shadow; separation is a 1px line or one tone+ step.+4. **There is no hero header.** 9 screens have no heading over 16px; where there is one, its median is+ 24px.+5. **Charts carry almost no chrome.** A single series has no legend; gridlines are 3-7 faint lines or+ none.+6. **Navigation recedes.** The active item is a neutral grey pill or a change of text colour; a+ coloured left bar appears once.+7. **Tables are rules and alignment.** No zebra striping, no header bands, numbers right-aligned.+8. **Data states are honest.** Zeros print as zeros, missing values as a grey dash, and an empty+ section keeps its frame.++Taking the template's devices away is half the job, as it is on a page. The other half is substance:+the product's real data, a screen that answers its one question first, and a grid whose arithmetic+closes.++## Contents++1. When this applies+2. The run for an app screen+3. The shell+4. The canvas and the page title+5. KPIs+6. Charts+7. Tables and lists+8. Forms and settings+9. Type and colour+10. Density+11. Empty, zero, loading and error states+12. The phone+13. House rules for app screens+14. Tells of generated dashboards++## 1. When this applies++An app screen is worked in rather than read. This chapter covers:++- dashboards and overviews: a seller's day, a project's health, a publication's growth;+- admin and back office: members, orders, events, a catalogue;+- analytics and reports, including a generated report with no app around it;+- settings and billing;+- list screens to work through: inboxes, queues, tables with filters;+- wallets and finance homes;+- builders and editors: flow, form and page builders, canvases;+- the detail page of one object: an event, a deployment, a customer.++A product site that shows its interface is a page; the interface fragments on it follow these rules+for their insides (mark each fragment's root with `data-ui`). When a request holds both, build each+with its own run and share one palette and one typeface.++The study is 23 desktop screens. It has no phone screens, no loading or error states, one settings+page, no inbox and no dense operations table (the densest screen shows about 120 data points). Where a+rule below goes past the study, it says **house rule**.++## 2. The run for an app screen++Do these in order. The first three steps decide whether the screen is any good.++### 2.1 Inventory the data and the jobs++The page run inventories the subject's world; an app screen inventories its data. Write in your notes,+in 8 to 12 lines:++- **the objects** the screen shows (deployments, invoices, members, events, conversations) and their+ fields, with units;+- **realistic magnitudes**: how many objects, a typical amount, the range of a rate, how values move+ over a day, a month, a year, and for a new account how small they really are;+- **the people**: who opens this screen, how often (a glance once a day, or an eight-hour session),+ on what device;+- **the jobs**: what they do next from here (approve, reply, pay, ship, invite), and which job comes+ up most.++Then write the data itself: a small dataset in a JSON or JS file that the screen renders from, with+believable names, amounts that add up to their totals, dates in order and a unit on every figure.+Totals are computed from the rows, never typed in separately. Small numbers stay small: the studied+screens show new accounts with 1, 6 or 9 of something, drawn honestly at their real size.++### 2.2 Name the screen's one question++Every screen answers one question first: "Did today's sales come in?", "Which deploy broke?", "Who is+waiting for a reply?", "How much of this month's plan is left?". Write it in one line. It decides+three things:++- **what is biggest.** In the study the largest block is the one that carries the screen's question:+ a full-width hourly sales chart on a seller's home, the spending-plan card on a finance home (the+ only card there spanning two columns), the ticket ring on an event's page;+- **what comes first** in the reading order;+- **what is left out.** The studied settings page shows three usage numbers and links to the+ analytics screen instead of drawing a chart; four screens draw no chart at all because a few+ numbers say it.++Then list the screen's blocks as the answers to its next questions, one line each, the way the page+run lists claims. A block with no question is deleted. This is how you avoid the stock order of KPI+row, big chart, two small charts, table.++### 2.3 Choose a style++```bash+node <skill>/scripts/draw.mjs --app --kind <kind> --brief "<one line about the product>" \+ --screens <screens> [--theme light|dark] [--keep palette,type] --options 3+```++This deals three styles from `library/app.json`. `draw.mjs --app --list kinds` (or `styles`, or+`screens`) prints the choices; the screens are `overview`, `analytics`, `list`, `detail`, `settings`, `wallet`,+`builder`, `inbox`, `home` and `report`. The library holds seven styles, each distilled from the+studied screens that share its move:++| Style | Theme | For | The move |+| --- | --- | --- | --- |+| `achromatic-ledger` | light | money homes, reports, settings with usage | No colour in the chrome; charts in ink; one small signal where a figure changed |+| `framed-sheet` | light | B2B analytics, developer platforms, builders | One tinted L-frame; the page on a white sheet inset 8px, no shadow |+| `accent-ladder` | light | creator and small-business admin with plans | The full hue on small marks only; its pale tints on every area |+| `editorial-greeting` | light | team and personal homes | The greeting as the h1 in a centred 12-column column; every figure at regular weight |+| `pastel-consumer` | light | wallets, budgeting | Pale same-hue tiles under one large radius; quiet money polarity |+| `true-black-flat` | dark | community, events, media | Elevation by lightness alone; colour only on data |+| `data-terminal` | dark | markets, monitoring | Every selection is the same 1px accent line; signs, not colour, on numbers |++Choose by how the product is used (long sessions or a quick look, money or media, a team or one+person, day or night), not by what is most familiar, and write one line on why. Then deal the sheet:++```bash+node <skill>/scripts/draw.mjs --app <the same arguments, without --options> --style <id>+```++The sheet gives the style's tokens and type, its shell and one pattern for each screen you named.+Keep the style's one move intact and take every other value from the defaults in this file. Redraw+(`--redraw style | shell | screen:<name>`) only for a reason you can state: it contradicts the brand,+or the product is used in a way the style does not suit. With an existing brand, pass+`--keep palette,type`, map its colours onto the roles in §9 and keep the style's colour budget.++### 2.4 Build the shell++Build the frame first, empty: the sidebar or rail, the top bar if the shell has one, the canvas with+its gutters, the title row (§3 and §4). `<skill>/assets/app.css` is a neutral start for all of it:+copy it into the project and put the sheet's tokens in its `:root`. Look at it at 1440 and at 390 before any data goes in. Do the+grid arithmetic now and write it in a comment: the column count, the gutter, and the sum that proves+the cards land on the canvas edges.++### 2.5 Put in the data++Render every block from the dataset; draw the charts from it too, with `<skill>/assets/charts.js`+(`Charts.line`, `Charts.bars`, `Charts.ring`, `Charts.barList`) or your own SVG to the rules of §6,+never a chart library's defaults and never a picture of a chart. Format every figure by §7.4: separators, fixed decimals per+metric, a sign on every change, units as smaller grey suffixes, tabular figures, right alignment in+columns. Use the product's own words for labels. No placeholder data: the inspector fails lorem ipsum,+Acme, John Doe and their kind. Proof is not invented here either: no vanity totals, no "+12%" on an+account that is a week old.++### 2.6 Build the states++For every block, build its empty, zero, loading and error state (§11); for every row and control, its+hover, selected, focus and disabled state. Look at each one in the browser. A screen that only works+with full data is half built.++### 2.7 The check++```bash+node <skill>/scripts/lint.mjs --app <source files or folder>+node <skill>/scripts/inspect.mjs --app <url or path/to/index.html>+```++A sheet dealt with `--app` switches both tools to the app rules by itself. The inspector opens the+screen at 1440, 768 and 390 and measures what this chapter asks for: an h1; a sidebar that folds on+the phone; the canvas used to its right edge; panel shadows and borders; the number of corner radii;+icons in tinted squares; numeric alignment and tabular figures; chart hues; colour share; placeholder+data; text under 11px; and the page rules that still hold (contrast, gradients, the banned palettes,+emoji). Fix every `FAIL`. Treat each `WARN` as wrong unless you can defend it to a designer in one+sentence.++Then look at the screenshots, every width, and answer these in writing:++1. Is the screen's question answered by the biggest thing on it, and is that read first?+2. Does every block share the screen's edges? Is there a dead strip on one side, a card stopping+ short, an orphan cell?+3. Is colour only on data, on status and on the one primary action?+4. Do the numbers add up, and do they line up digit for digit?+5. Does every zero look like a zero and every missing value like a dash?+6. On the phone, is the navigation folded away, and does each block still answer its question?++Fix the worst three, inspect again, look again. Three rounds at most. Judge the pictures: if a problem+shows in a screenshot, it is real, whatever the code says.++### 2.8 Report++Tell the user, briefly: the style dealt (name and seed) and any redraws with their reasons; each+screen's one question; any check you allowed and why (for example `--allow icon-chips` for node-type+tiles in a builder); and the sample data that must be replaced with real data, listed so it can be+found.++App screens have no motion floor. Motion is feedback: press, hover, focus, a menu or a sheet opening,+a row arriving. Nothing on the screen performs an entrance (house rule).++## 3. The shell++### 3.1 Five archetypes++| Shell | In the study | What it is |+| --- | --- | --- |+| **Open plane** | 5 screens | A labelled sidebar on the page ground (or within 1-2% of it), separated by nothing or by one 1px hairline. No top bar: the header and the cards sit on the ground. The canvas is fluid with a 24-64px gutter, or a centred column. |+| **Tinted frame, white sheet** | 8 screens | Sidebar and top bar share one tinted ground (#f6f6f6-#f9fbfc) with no rule between them; the page sits on a white sheet inset 8px from the window's right and bottom edges, radius 10-16 (median 16), a 1px #eaeaea-#ededed edge and no shadow. Variants: a flush L-frame, the inset sheet, and floating panels inset 8-12px with a 12px gap. |+| **Ruled T-frame** | 4 screens | A 210-240px sidebar and a 64px top bar on one ground, divided only by 1px rules. The workspace switcher sits at the top bar's right end behind a full-height divider. Three of the four are dark. |+| **Icon rail** | 3 screens | An unlabelled rail 50-60px wide (median 55); 15-18px icons on a 34-49px pitch; the active item marked by colour or by a 2% tint band; groups split by 20px hairlines. It saves about 180px of width. |+| **No sidebar** | 3 screens | A 46-48px top bar over a centred 1088-1208px column with 152-212px gutters; the logo sits on the column's left edge. For reports, viewers and products with few destinations. |++All six dark screens use one ground everywhere, divided by 1px rules of #161616-#232323 or by nothing.+No screen in the study puts a dark or saturated sidebar against a light canvas (0 of 17).++### 3.2 Sidebar++- **Width.** Labelled sidebars run 210-292px; the median is 230 and most sit at 224-240. One floating+ sidebar card appears (280px wide, 40px in from the window edge).+- **Rows.** A 32px hit area on a 34px pitch is the mode (7 screens); the roomy versions run 40-52px on+ a 42-60px pitch. Icons are 14-20px, median 16, outline at about 1.5px stroke on 14 of 16 screens.+ Labels are 14px at 400 on 12 of 16, in ink or in a grey of #4b4d4f-#63666e, about 8-10px after the+ icon, with the label column at x 36-48.+- **Active item.** A neutral grey pill with the label unchanged, on 8 screens: radius 4-16 (median 8),+ inset 8-14px from the sidebar's edges, a fill of about #e9e9e9-#ededed. On dark, brightness alone:+ the label goes from #bbb to #fff (3 screens). Colour alone on the icon or label (3, all of them+ rails or a floating card). A tinted accent fill (3). A left accent bar once in 23. The weight+ changes on 2. Default: the grey pill on light, brightness on dark.+- **Groups.** Sentence-case grey labels at 12-13px, never uppercase (9 screens), with 22-56px of air+ above and 13-33px to the first item; or hairlines instead (4). Utilities such as settings and help+ pushed to the bottom (5).+- **Top and bottom.** The workspace or account switcher at the top of the sidebar (7 screens), at its+ bottom (2), or in the top bar. The bottom holds a user row (8) or one upsell (8); one of those+ upsells is a filled accent button.++### 3.3 Top bar++14 of 23 screens have one; the default is none. Heights fall into two groups: 44-51px (median about+48) on light chrome, and 64px, usually with a 1px rule. A top bar must hold something real: search,+the workspace switcher, or the page or object name. Search sits centred on the window at 548x32 with+a shortcut hint (2 screens), or at 457-537x36 in a no-sidebar bar. The right cluster is inset 24-46px+from the edge. Two screens leave about 1070px of their top bar blank; both are flagged for it.++### 3.4 Right rail and pinned columns++One screen has a right rail: a fixed 384px column in a `1fr 384px` grid with a 24px gap, starting+level with the first card rather than with the title, its section headings outside the cards and 8px+above each. Use one only for a stable secondary stream: recent items, the details of the selected+object, share links. A pinned left column appears once: a 306px accounts card at the viewport height+minus 72px, so net worth stays in view while the rest of the screen scrolls.++Five screens float a button (24-56px), and one of those buttons covers the content it sits on and is+flagged. House rule: no floating button unless it is the screen's one primary action and covers+nothing at any width.++## 4. The canvas and the page title++### 4.1 Width and gutters++- **Fluid** (14 screens): side padding 17-64px, median 29, with 24 and 36-40 the common values;+ content 1120-1312px wide, median about 1204.+- **Centred** (8 screens): 624, 864, 1088, 1100, 1152, about 1190 and 1208px; median about 1126.+ Data pages land at 1100-1250 either way. Only two personal homes go narrow (624 and 864), and both+ are flagged for wasting the width.+- **Top offset**, from the canvas top to the title: 20-88px, median about 36. Tools sit at 20-36;+ greeting homes at 50-88.+- **One gutter.** Use one gap value horizontally and vertically. Mixed gutters (12 against 16, 20+ against 24, 16 against 12) are flagged on 8 screens.++### 4.2 One left edge, one right edge++The strongest screens run a single left edge from the header to the last row. One indents its page+header by the cards' 24px padding, so the title, the card titles, the numbers and the chart all start+on one line. Row rules may bleed 7-8px past the text column while the text stays on it.++The grid's arithmetic closes: 3 x 372 + 2 x 17 = 2 x 568 + 16 = 1152; 12 x 77 + 11 x 16 = 1100;+4 x 144 + 3 x 16 = 624; a second-row card exactly as wide as the two cards above it+(251 + 24 + 515). Write your sum down.++Failures to avoid, all from the study: cards stopping 120px short of the sheet's right edge; a 0px+right gutter against a 40px left one; a column centred on the window instead of on the area beside+the sidebar (204px on its left, 444px on its right); a medallion 108px off the column's axis. The+inspector warns when the content stops well short of the right edge.++**Dead space from a grid that does not fit the data** is the commonest failure in the study (10+screens): four KPI tiles in a three-column grid, orphaning the fourth; one card alone in a+three-column row beside 810px of nothing; a card stretched to its neighbour's height with 250px of+blank under its legend. Choose the column count from the number of items, let a lone card span, and+do not match heights when the contents differ.++### 4.3 The title++- **Every screen has one h1**; the inspector fails a screen without one. 14 screens set it in the+ canvas at 18-48px, median and mode 24, at 600-700 (700 on 8). The rest have nothing over 16px: a+ breadcrumb or the top bar names the page. Then the breadcrumb's last item is the h1, at 16px, and+ the screen's name is still the first thing read.+- **A noun, not a greeting**: "Analytics", "Overview", the project's or the object's name. 3 of 23+ greet, and one adds an emoji, which goes. A greeting suits a personal or team home only.+- **An optional second line**: one 14-16px grey sentence saying what the screen shows, or a 12px line+ naming the data's source.+- **Right of the title**: actions only when they are real (10 screens); otherwise nothing. A freshness+ stamp ("Updated Jul 27, 4:09 PM", with a refresh button) on 6.+- **The primary action.** 12 of 23 have no filled primary button; 5 make it near-black (#1d1f20,+ #1f2937) or inverted white on dark; 4 fill it with the brand hue. One primary per screen.++### 4.4 Tabs, filters and the date range++- **The date range** at page level (7 screens) or on each card (7), never both. A card that states its+ own period puts it in its header, right-aligned, in grey.+- **Underline tabs** (8 screens) always sit on a full-width 1px rule; the indicator is 1-4px (median+ 2), as wide as the label or running 8-11px past it.+- **A segmented track** once: 48px, #f3f4f6, a white 36px active pill, and the date select inside its+ right end, so tabs and range read as one row.+- **Control height** in title and filter rows: 28-40px, median 34, clustering at 32 and 36.+- **Order**: scope on the left (the date first, then the filters), utility and refresh on the right.+- **Compound filters** that read as a sentence ("Date | Jun 14 - Jul 13 | Daily"), 28px tall and 8px+ apart, once.+- **To the first card**: 13-64px, median 24.++## 5. KPIs++- **No tile of its own.** 11 of the 20 screens with headline numbers give a KPI no tile: bare text on+ the page or on a card (5), or one container split by 1px hairlines (6). 9 use one card per KPI,+ 61-147px tall (median about 108). The default is one container split by 1px dividers into equal+ columns. 7 screens have no KPI row at all and put each headline number in the card that explains+ it, which is often better.+- **Count.** 1-6 per row, median 3-4. The count matches the grid: four KPIs get four columns.+- **Size.** Values 16-40px, median 26, mode 24. Values in their own tile run larger (median 30) than+ in a shared strip (median 24). Nothing at 48px or over. Labels 12-16px, median 14; the value is+ about 1.7 times the label.+- **Weight.** An even split: 400 on 8 screens, 600 on 6, 700-800 on 6. A large number at regular+ weight under a semibold label is the common pattern. Bold for money only.+- **Order.** Label above the value on 14 screens; labels grey (#6b6b6b-#aaa) on 13; sentence case.+- **Nothing else.** No icon in a coloured circle (0 of 23), no sparkline (0 of 23), no tinted tile.+ An info icon beside the label is fine (5 screens). Units are a smaller grey suffix: "5 mins" at 24+ over 14, "2 m 24 s", "5 /10".+- **A second job.** KPIs may be the chart's series tabs (the unselected one turns grey) or the list's+ type filter (the selected card takes a 1.5px border).++### Deltas++- Optional: 9 of the 20 KPI screens show one; 11 do not.+- 10-15px (median 14), never larger than the label. Text or a small glyph on 6 screens; a pale pill+ on 3.+- **The window in words**: "vs prior 30 days", "in the last 90 days", "from 0 (last 4 weeks)" (7 of+ the 9).+- **Colour only the number**, or set the whole delta in grey.+- **Zero or undefined change is grey.** The study's commonest KPI failure is a zero or undefined change+ shown as a signal: three identical green "up 100%" pills grown from zero, a ">999%", a bold red+ "0.00%", a green "+0". When the prior period was zero, write "+4 (new)"; when there is nothing to+ compare, a short grey dash where the delta would be.++## 6. Charts++### 6.1 Which chart for which question++| Question | Form | In the study |+| --- | --- | --- |+| Is it moving over time? | One line; an area only with a fill of 15% or less | 9 screens |+| How much per period? | Columns with square corners | 3 |+| How is it distributed? | A histogram with equal bins | 1 (its unequal bins are flagged) |+| Who ranks? | A sorted horizontal bar list, or the table row's fill as the bar | 3 |+| What share? | A thin ring, or a 100% stacked bar with 2px seams; five parts at most | 5 |+| How far to the target? | A progress bar, both ends labelled, the fill the true ratio | 4 |+| Where? | A map with a list beside it; the list carries the magnitudes | 1 |+| Per period, and the running total? | The two side by side at equal width, with the same dates | 1 |++When there are only a few numbers, draw no chart: four screens skip it, and the settings page links+to the analytics screen with "View more".++### 6.2 One question, one series++One series per chart is the norm; three is the most any screen draws. To show another metric, switch+it with a control (a segmented control, a dropdown, the KPIs as tabs) instead of overlaying lines.+Plots run 112-264px tall (median about 195) and 316-1136px wide (median about 570), an aspect of 1.8+to 5.2.++### 6.3 Axes and gridlines++- **Gridlines** run horizontally only on 7 of the 12 cartesian charts, both ways on 3, and not at all+ on 2. Use 3-5 (the study runs 3-7, median 4-5): 1px, solid, about #e5e5e5 on light (range+ #cfcfd2-#f2f2f2), #2b2b2b on #111. Dashed lines are allowed in chart grids (4 screens: 3/3, 4/4,+ 3/2.5) and nowhere else on the screen.+- **No y-axis line.** The baseline is the one heavier line (2px on two screens, 1px on one); full axes+ on one.+- **Y ticks**: 4-7, median 5, at 11-16px (median 12) in grey (#5f5f5f-#6c6c6c), on the left (8+ screens) or the right (2). Round, even steps (0/5/10/15%; 0-600 by 150), the top tick above the+ maximum, integers for counts, and zero as the baseline for bars and counts.+- **Never without a scale.** Two screens draw no y-scale and show magnitude only on hover; both are+ flagged. So are uneven ticks (0/3/6/10), a 0.8 tick on a count, a top tick equal to the maximum so+ the line hits the plot's edge, and a cumulative axis that starts at 1.+- **Axis text no larger than the data.** 15-16px ticks beside 14px values are flagged as louder than+ the numbers.+- **X labels**: 4-8 per chart, flat, never rotated (40 degrees is flagged), the first and last pulled+ inside the plot. Labelling only the two ends hides when things happened. Irregular dates on a+ categorical axis are flagged: time goes on a time scale.++### 6.4 Marks++- **Lines** 1-3px, median 2, in straight segments. Four screens smooth their lines, and one smoothed+ curve invents values between daily totals (flagged), so draw straight segments. No point markers,+ except a hover dot (8px on one screen).+- **Fill**: none on 7 of 10 time charts. At most a flat tint of about 14%, or a fade from the line to+ transparent over 150-200px.+- **Bars** have square corners (4 screens), or at most a 4px top radius with a square bottom on the+ baseline. Stacked segments are split by a 1-2px seam.+- **Colour.** One hue per chart. The accent touches only data on 8 screens, and data ink is under 3%+ of the pixels on most. Neutral series are fine and often better: a near-black line that turns pale+ grey after the cursor; a white line against a red one; signs instead of colour ("+$24,000,000").+ One subject keeps one hue across the screen: the same subscribers drawn pink in one chart and indigo+ in the next is flagged. Unrelated hues on one screen (three, five) are flagged every time. Status+ colours are for status. The inspector warns over four hues and fails over six.+- **Legends.** None for a single series (9 charts): the title or the dropdown names it. Otherwise five+ items at most, as a 5-8px dot with a 12-14px grey label in the card's header, or as a small table+ (dot, name, value, change) that makes the legend carry data. Never list a series that has no data+ (flagged). The legend dot is the line's colour.+- **Rings** are never labelled on the slices; the total sits in the centre or beside the ring. The+ screens noted for their rings use thin strokes: 3-5px on a 90-154px ring, 8px on 182px. Two others+ use 28 and 37px.+- **Progress bars** are 4-24px tall (median 8), fully rounded, with both ends labelled ("Skilled 200"+ and "Expert 2,000"); the fill is the true ratio, so 303 on that scale fills 22px of 392. A zero has+ no stub (a 6px stub at zero is flagged).+- **Tooltips** are bare text or a plain box without an arrow: label and value on one line.+- **Short and empty histories are drawn honestly**: a flat zero line with one spike, missing bars for+ empty periods, no padded y-range, no "No data" picture. Do not give one point the screen's largest+ plot, though: a lone dot in a full-size grid reads as barren (flagged once).++## 7. Tables and lists++### 7.1 Rows++- Single-line data rows: 36-53px, median 45.+- Two-line rows with media: 56-92px, median 72. The pitch is the media's height plus 24-32px+ (48 + 24, 48 + 32, 50 + 30).+- Key-value and legend rows inside cards: 21-32px.+- In a two-line cell, line 2 sits about 21px below line 1 (19-23), one size smaller (12-14px) and+ grey.+- Overview lists show 2-5 rows.++### 7.2 Header++- 11-14px, median 12, mostly regular weight, grey, sentence case (9 of the 11 headed tables). The one+ uppercase header in the study is flagged as louder than the data.+- **No fill band** (0 of 11) and **no rule under it** on 8 of 11. Where there is a rule, it is the+ strongest line in the table (#e5e7eb over #f3f4f6 row rules).+- Header row 36-40px.+- Numeric headers are right-aligned and flush with their values; a header that stops 15px short of+ its column is flagged.+- A sort glyph on the active column only.++### 7.3 Dividers++- **No zebra striping** (0 of 23).+- No row dividers on about half the lists; they rely on a 61-92px pitch or on 2-8px gaps between+ filled rows.+- When present: 1px, 3-7% darker than the surface (#ededed-#f4f4f4 on white; #161616 on #000,+ #1b1a1f on #131217).+- Extent: bleeding 8-9px past the text edge; starting at the text column and skipping the media; or+ the full inner width. Pick one per screen.++### 7.4 Figures and alignment++- **Numbers right-aligned**, in tabular figures or a monospace. Every left-aligned numeric column and+ every column of proportional digits in the study is flagged (durations "00:00:12" and "00:00:04"+ that jitter, cents that drift).+- **Fixed decimals per metric**: money 2, percentages 1 or 2, counts none. Thousands separators+ everywhere ("$16,531.54"); abbreviate only in a capacity line ("12.7k of 20.0k"). A sign on every+ change ("-$0.09", "+10,100 (+0.20%)"). No space after the currency sign (one screen's "$ 89.00"+ beside "$15.00" is flagged).+- **The identity column gets the most width**, about a third to a half of the table.+- **Two measures stack in one cell** rather than taking two columns: a count over its 12px grey+ percentage, a date over its time, a money value over the amount in units, both lines on one right+ edge.+- **Dates** in ISO form and right-aligned where rows are compared ("2024-02-15"); in words for+ recency ("Today", "Yesterday", "6 days").+- **IDs** in a monospace at body size, truncated to about 8 characters with an ellipsis and a copy+ icon 12px after.+- Truncate to one line with an ellipsis; never break inside a word.++### 7.5 Ink inside rows++- Only the identity and the key number get the primary ink; everything else is grey ("5" in ink,+ " /10" in grey).+- A missing value is a grey dash; a real zero is printed ("$0", "0.00%", "0% (0)").+- The sign lives in the text, not in the colour: income green with a "+", expenses in ink, no red on+ every negative.+- Link colour on the name cell only, with no underline.++### 7.6 Status pills++- 15-28px tall (median 20), text 9-14px in the study (median 12) at 500; nothing under 11px here. A+ full pill or a 3-5px tag.+- A pale tint with dark text of the same hue, optionally a 1px border one step darker: #dcfae5 with+ #04250e, #ffedea with #831c1e.+- Neutral states are monochrome chips with a glyph ("Public" with a globe).+- A state machine uses one hue at three intensities: grey for off, the full hue for the call to+ action, a dark tint for running. A saturated fill with white text only for that one call to action.+- **One status mark per row.** A tag and a badge that say the same thing are flagged.++### 7.7 Media++16px logos in dense rows; 24-32px avatars; 48-50px in two-line rows. Circles for people, tokens and+companies; a 2-3px radius for artwork and flags; 8px for photographs. One fixed media slot down the+list so the text starts on one edge (a 50px slot with the text 16px after it). Media-to-text gap+10-16px, median 12.++### 7.8 Actions and paging++- **No pagination on an overview** (0 of 23). Cap the rows and link out: "View all" in the section+ header, a 30px outlined button under the list, a full-width 32px bar. State the total ("3 tracks").+- Row actions: none on 9 screens; otherwise one kebab at the far right.+- Checkboxes only where bulk actions exist (one screen: 18px, 2px stroke, 3px radius).+- Hover and selected: a 1px outline at 6px radius overhanging the panel by 1px, or a darker border+ with a 1px ring. No hover that changes the fill was seen.+- Toolbar: one search, 30-36px tall (256x30, 252x36, 316x32).+- **A full list screen** (house rule; the study has none): state the total above the table, keep the+ header row in view while scrolling, and page or load more at the end with the range shown+ ("1-50 of 1,284").++### 7.9 Lists that carry data++- **The row fill is the bar**: the row's rounded background (radius 8) as wide as its share of the+ largest share; 44px rows, 2px gaps.+- **Bar list**: a 64px pitch, a label line, then a 10px pill bar with the value 5px after its end; the+ longest bar about 88% of the width; one colour, no track.+- **Legend as table**: dot, name, pill, value and change on a 57px pitch.+- **Key-value well**: a tinted well, radius 8, 32px rows, label left, figure right.+- **Feed as row cards**: 63px tall, 8px gaps, radius 14, a fill one step lighter and a border one step+ darker than the panel, a relative date on the right.+- **Tree**: no dividers, 8px of indent per level, ink against grey by level, a pitch of about 30px,+ about 45px between groups.++## 8. Forms and settings++The study holds forms on three screens and one settings page, so this section rests on little. It is+enough for the defaults.++### 8.1 Fields++- **Label above the field**, 14px at 500, 8-10px gap. No floating labels and no placeholder standing+ in for a label.+- **Inputs** 38-40px in forms (radius 8-10); toolbar and filter controls 28-40px, median 32. One+ control height per context.+- Inputs stay white with a 1px #e5e7eb-#e8e8e8 border even on a grey panel; filter and select+ controls take a border one step darker (#cdcfcf-#d1d5db).+- A leading icon at 14px, 13px in from the edge, with the text starting at 38px.+- **Spacing**: 24px from a description to the first label, 16px between fields, 16px to the Save+ button.+- **A joined input and action** (a read-only link and its Copy button) share a border and square+ their inner corners.+- **Toggles** 28x16 to 33x20. The on colour is a semantic green or near-black, not the brand accent.+- **Disabled** controls stay legible and say why they are disabled: the study's disabled Save+ (#cecece on #f4f4f4, about 1.4:1) and its plan-locked panel at 30% opacity are flagged as+ unreadable.++### 8.2 Settings layout++- Each section is a row: a label column (about 450px: a 16/500 title and a 14px grey description)+ beside a panel (about 700px, #fafafa, radius 16, padding 16, no border, no shadow). The title's cap+ top aligns with the panel's first line, 6-8px below the panel's top.+- Sections are split by a full-width 1px rule with 32px above and below.+- A switch row: a 14/500 title, a status badge 8px after it, a 14px grey description, and the toggle+ on the right, 16px from the edge and centred on the title line.+- A plan-gated feature: a 48px tinted strip with a 32px button directly above the locked panel; the+ panel stays readable.+- Narrow containers stack: label, 10px, field, then 26px to the next pair.+- Do not leave the label column empty beside a tall panel (a 250px void is flagged): put the section's+ help or a summary of its current values there, or narrow the column.+- **Destructive actions** (house rule; none in the study) go last, in a section of their own, as a+ text or outlined button in the negative colour, with the consequence in words and a confirmation+ that names the object.++### 8.3 Buttons++Controls run 27-40px tall (median 34; 32 is the commonest), with a 6-8px radius in the tight styles+and full pills in the soft ones. One filled primary per screen, usually near-black; a secondary is+white with a 1px border; a tertiary is text. The controls in one row share one height.++## 9. Type and colour++### 9.1 Type++- **One grotesk.** All 23 screens use a neo-grotesk, and 14 use that one family alone. A second face+ always has one job: a monospace for every number or for IDs only, a serif for one greeting, a brand+ face kept to the wordmark or the switcher. Never three.+- **Sizes**:++| Role | Range in the study | Median |+| --- | --- | --- |+| Page title | 14-48 | 24 |+| KPI value | 16-40 | 24 |+| Card title (500-600) | 14-24 | 16 |+| Body, nav, cells | 13-16 | 14 |+| Labels, meta | 11-14 | 12 |+| Axis ticks | 11-16 | 12 |+| Pills, badges | 9-14 | 11-12 (house floor 11) |++ A screen uses 4-9 sizes, median 6. The cleanest scales in the study are 12/14/18/24, 12/14/16/30+ and 12/14/16/24.+- **Weights**: a median of 3 per screen; 10 of 23 never go above 600; 700 does one job per screen+ (money, the greeting or the title).+- **Figures**: tabular on every number in a table, in a KPI, or anywhere it updates. Check that the+ face really has tabular figures: `font-variant-numeric: tabular-nums` must change its digit widths;+ if it does not, take another face.+- **Case**: sentence case on about 19 of 23; uppercase content labels on 4 only. Tracking 0, and+ negative only on large type (-0.02em at 32px). Line height 20px for 14px text, 24px for 16px.+- **Dark** screens set body at 13px on three, and titles at 18-20/600 or 26-28/700.++### 9.2 Colour on light screens++- **Ground models**: white cards on an off-white ground (10 screens; #f3f5f7 to #fdfdfd, median+ #f9f9f9-#f9fafb); grey panels on white (6); a framed sheet (7).+- **The sidebar is never dark or saturated** (0 of 17): it matches the page, sits 1-3 levels off it,+ or is white on a grey page.+- **Lines in three steps.** Card edges median #eaeaea, the working band #e5e7eb-#ededed (about 1.2:1 on+ white). Row rules one step lighter, #efefef-#f4f4f4. Control borders one step darker, median+ #d1d5db. #cbcecd on cards reads heavy; #f5f5f5 disappears.+- **Text in three tiers.** Primary about #111 (range #000 to a tinted #272446). Secondary about #606060+ (#3a3b3b-#8e8e8e). Tertiary in the study runs #969696-#9f9d9b and placeholders #9ca3af-#b0b2b6,+ which is 2.5-3:1 on white and under the house floor. House rule: every tier that carries words+ reaches 4.5:1 on the surface it sits on, placeholders included; #6b6b6b is about the lightest grey+ that holds on white and on #f9fafb.+- **Accent placement**: on data only with greyscale chrome (4 screens), on actions only (2), or no+ accent at all (2). The primary button is usually near-black. Every screen with more than one accent+ family is flagged.+- **Status**: positive greens in the study run #16a34a-#40a670, which is under 4.5:1 as text; use a+ darker green such as #247b50 (5.2:1) for text, and the pale pairs for pills: positive #dcfae5 with+ #04250e, negative #ffedea with #831c1e, a notice #fffbeb with a #fde68a border and #92400e text, a+ count badge #c4242a-#dc3532.++### 9.3 Colour on dark screens++- **Ground**: #000 (3 screens), #111 (2), #171719 (1). No navy and no slate.+- **Surfaces**, three ways: a lighter step with no border (#111 on #000, nested panels at+ #222-#2a2a2a); the ground's own fill with a 1px line (#2e2e2e on #111); darker than the ground with+ a soft shadow (once: #131217 on #171719 with 0 12px 28px rgba(0,0,0,.2)).+- **Lines**: structural lines 22-31 levels above the ground (#1a1a1a on #000, #2e2e2e on #111,+ #222224 on #171719); interactive outlines brighter, #373737-#4c4c4c, so an outlined button reads as+ clickable without a fill.+- **Text**: #fff; secondary about #aaa (#82848a-#bbb); tertiary about #888. #4c4c4f (about 2:1) is+ flagged. The house floor of 4.5:1 holds here too.+- **Accent** on data only, or on one selected state. Active nav by brightness. Emphasis without+ colour: an inverted white pill, a grey-filled button (#212121), an outline.+- **Status** as a hue on a dark tint of itself: #3fc07a on #172a1d; #44a282 on #1b2828.+- **Colour share** at or under 3% on all six.++### 9.4 Surfaces, radius, icons, spacing++- **Edges.** A 1px border separates surfaces on 12 of the 17 light screens; three use a fill step+ alone and one a shadow alone. A border or a shadow, never both. The shadows that exist are faint+ (alpha .06 or less at 0 2px 8px; once 0 1px 4px at .12). Real shadows are for what floats: a menu,+ a popover, a tooltip, a composer.+- **Radius is bimodal**: tight, 4-8px (9 screens, plus square cards on one), or soft, 16-24px (10);+ 11-12px on only 3. Controls follow the cards: 6px with tight cards, full pills with soft ones.+ Nested radii step down (20, 10, 8, 5, 4). The inspector warns over three panel radii.+- **Group, don't box.** A set of KPIs is one card split by 1px dividers, or a bare strip with 48-52px+ vertical dividers.+- **Icons**: outline on 22 of 23; nav icons 14-20px (median 16) at about 1.5px; inline icons 12-14px;+ about 10px to the label; grey (#454545-#73737f in a light nav, white or #81858a-#999 on dark). Never+ in a saturated circle (0 of 23). A container, if any, is neutral (a #f0f0f0 disc) or codes a node+ type in a builder.+- **Spacing** on a 4px base: card gap 6-24px (median 16); card padding 12-34px (median 20); section+ gap 24-64px; control height 27-40px (median 34).++### 9.5 Default tokens++Each style in `library/app.json` carries its own tokens. These are the study's medians for anything a+style does not set, with the greys moved to pass 4.5:1.++The names match the sheet `draw.mjs --app` prints and `assets/app.css`, a neutral start set to these+defaults (shell, title row, panels, the divided KPI strip, tables, pills, controls, tabs, empty states+and the phone fold). `assets/charts.js` draws the line, bar, ring and bar-list charts of §6 in SVG from+your data, with these rules built in.++```css+:root {+ /* light */+ --ground: #f9fafb; --surface: #ffffff; --raised: #f9f9f9; --active: #eeeeee;+ --border: #e8e8e8; --rule: #f2f2f2; --control: #d1d5db;+ --text: #111111; --muted: #5f6368; --faint: #6b6b6b; /* placeholders use --faint */+ --primary: #1d1f20; /* near-black fill, white label */+ --accent: /* one hue, about 3% of pixels: the data, plus at most one control */;+ --positive: #247b50; --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;+ --negative: #c4242a; --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;+ --pill-warning-bg: #fffbeb; --pill-warning-ink: #92400e; /* notice border #fde68a */+ --grid: #e5e5e5;++ --radius-card: 8px; --radius-control: 6px; --radius-chip: 4px; /* soft styles: 20 / 14 / 999 */+ --gap: 16px; --card-pad: 20px; --pad: 24px;+ --nav-row: 34px; --control-height: 32px; --row-height: 48px;+ --font: "Inter", system-ui, sans-serif; /* one grotesk */+ --fs-title: 24px; --fs-section: 16px; --fs-kpi: 24px; --fs-body: 14px; --fs-small: 12px;+}+:root[data-theme="dark"] {+ --ground: #000000; --surface: #111111; --raised: #222222; --active: #222222;+ --border: #1a1a1a; --rule: #161616; --control: #444444; /* on a #111 ground the border is #2e2e2e */+ --text: #ffffff; --muted: #aaaaaa; --faint: #969696;+ --primary: #ffffff; /* inverted: white fill, black label */+ --positive: #3fc07a; --pill-positive-bg: #172a1d; --pill-positive-ink: #3fc07a;+ --negative: #e5566f; --pill-negative-bg: #2c1a20; --pill-negative-ink: #e5566f; /* the study's #d4405d, lifted for 4.5:1 */+ --grid: #2b2b2b;+}+.num { font-variant-numeric: tabular-nums; }+td.num, th.num { text-align: right; }+```++## 10. Density++- The studied screens hold 6 to about 120 data points, median about 25.+ - **Sparse** (6-25): homes, settings, a single object. Card padding 20-24px, rows 56-92px, body+ 14-16px.+ - **Medium** (25-50): analytics overviews, finance homes, list screens. Rows 44-56px, padding+ 16-24px.+ - **Dense** (about 120, one screen): research and monitoring, read in long sessions. A 13px body,+ 28px list rows and 42px table rows, framed with generous air: 100px gutters, 64px between bands,+ 32px of card padding.+- Density is three settings moved together: row pitch, padding and type size. Do not shrink the type+ and keep the padding.+- **Placed space reads as calm; leftover space reads as unfinished.** In the study, emptiness looks+ deliberate when it comes from a fixed grid and repeated gaps, and accidental when it comes from a+ grid that does not fit the data, a column that is empty in every row (a 300px dead band), a mostly+ empty top bar, or a card stretched to its neighbour's height.+- **Design for the data the account has as well as the data it will have.** Several studied screens+ were built for a busy account and show a new one: a 673x240 plot for a line that sits on zero for+ two thirds of its length. Keep the honest drawing, but size the block to the question, not to the+ data the product hopes for.++## 11. Empty, zero, loading and error states++- **A real zero** is printed in the normal style: "$0", "0", "0%", "0.00%", "0% (0)" (10 screens). A+ zero may be dimmed to grey when the caption beside it becomes the next step ("$0.00", then+ "Automate your savings with up to 3.50% APY").+- **Missing or not applicable** is a grey dash: an em dash, a "-", a 6x2px mark. Never a dash at full+ value size: "--" at 24px reads as loading (flagged).+- **An empty section keeps its frame and its header** and adds one sentence: a 1px dashed box, radius+ 8, about 38px tall ("No channel usage in this range."), or a bordered box with an add link+ ("+ Liability account"). In a builder, an empty slot is a dashed 1px box on the canvas colour.+- **An empty chart is drawn**: the zero line, missing bars for empty periods, no padded range, no+ picture.+- **First run** (the whole screen empty): keep the frame and the title, and put the first action where+ the data will appear, with a setup progress at its true percentage if there are steps (one screen+ shows "Complete your setup" at 67%; another a four-cell getting-started strip above its tables).+- **Loading** (house rule; not in the study): the final layout with each value replaced by a flat grey+ bar at its real size (a 24px value gets a 24px-tall bar; rows keep their pitch), labels and headers+ shown at once, no shimmer gradient, and no shift of the layout when the data lands. A refresh of+ data already on screen keeps the old values and updates the freshness stamp.+- **Error** (house rule; not in the study): inside the block that failed, never as a full-screen+ banner. One sentence saying what failed and when the data was last good ("Couldn't load+ deployments. Last updated 09:14."), and a Retry text button. The negative colour only on a small+ icon or in the pill pair.+- **Stale or static data**: a freshness stamp with a refresh button (6 screens). A snapshot that+ cannot refresh says so in one quiet notice (once: #fffbeb, a 1px #fde68a border, 12px #92400e+ text). A notice tint is never a ground; the inspector reads a pale amber ground as cream.+- **Limits and usage**: a bar at the true ratio with both ends labelled ("12.7k of 20.0k").++## 12. The phone++The study has no phone screens. This section is house rule, built from the skill's phone rules+(`layout.md` §8) and from what the desktop screens imply. The inspector fails a sidebar that still+takes more than 30% of a phone's width.++- **Navigation folds.** The sidebar becomes a 48px top bar with the screen's name, a menu button that+ opens a full-screen sheet (nav, workspace switcher, account) and at most one action; or a bottom+ bar of four or five destinations with short labels. An icon rail becomes that bottom bar.+- **Margins** 16-20px; touch targets at least 44px tall; data and labels at 14px, sublines no smaller+ than 12px.+- **The title stays**, at 20-24px. Header actions move into a kebab, except the one primary.+- **Filters** collapse into one row of chips or a Filters sheet; tabs scroll sideways inside their own+ row, never the page.+- **KPIs**: a divided container becomes a 2-column grid, or a list with the label on the left and the+ value on the right. Never four squeezed columns.+- **Charts** go full width, 160-200px tall, with 3-4 x labels, the y ticks inside the plot area and a+ legend of dots above.+- **Tables become lists of two-line rows**: the identity and the key number on line 1, two or three+ secondary fields in 13px grey on line 2, the one action at the right. A table that must stay a table+ scrolls inside its own frame with its first column fixed; the page never scrolls sideways.+- **Several panes** (a list and its detail, an inbox): one region at a time. Choosing a row pushes the+ detail; back returns to the list at its scroll position.+- **Settings**: the label column stacks above its panel.+- **A right rail** moves under the main column or into a tab.+- **Builders** show the work read-only, with the palette as a bottom sheet if editing stays.+- Check 390px in the inspector's screenshots every round.++## 13. House rules for app screens++The house rules in `SKILL.md` were written for pages that are read once. An app screen is read every+day, and part of what those rules ban is the structure of a working screen. These relax, with limits:++| Allowed on app screens | Limit |+| --- | --- |+| **1px borders** on cards, panels, tables and controls | About 1.1-1.3:1 against the ground on light (#e5e7eb-#ededed on white); #1a1a1a on #000, #2e2e2e on #111. Controls one step stronger. A border or a shadow, never both. |+| **Row rules** in tables and lists | 1px, 3-7% darker than the surface. No zebra, no header band. |+| **Dashed lines** | In chart grids and empty slots only. |+| **Small labels** above values | 12-14px, sentence case, grey at 4.5:1. Meta and axis text 11-12px. Nothing under 11px. At most one tracked uppercase label on a screen (a switcher's context label). |+| **Rows of identical cards** | Peer metrics or peer objects only: 3-6 across, equal widths, one gap, no orphan, edges aligned across rows, no icon on top. Prefer one divided card; mixed spans beat a uniform grid. |+| **Monospace** | IDs, keys and code; or every figure, as one style's decision. Otherwise tabular figures in the text face. |+| **Pills** | Inside rows and beside a value only: 16-24px tall, a pale tint with dark text of the same hue. Never above a heading. |+| **Index numbers** | Only as data: a rank ("1."), a node number. |+| **Icons** | 14-20px outline, one set, grey: in the nav, before a label, or as a single affordance (kebab, chevron, info). A container only if it is neutral, or node-type tiles in a builder (pass `--allow icon-chips` and give the reason in the report). |+| **Shadows** | On what floats: a menu, a popover, a tooltip, a composer, a dialog. A resting card gets at most a small blur under 8% black. |+| **A second typeface** | With one job: a mono for IDs or figures, a serif for one greeting. |+| **A gradient** | Only as an area fade under one line chart; a flat tint of about 14% is safer. |++Still banned, as on pages, and checked:++| Banned | Instead |+| --- | --- |+| Gradients on grounds, buttons, cards, text and KPI tiles (the study's two gradient buttons are flagged) | Flat fills |+| Glows, glass, backdrop blur | Opaque surfaces one tone step from the ground |+| An icon in a coloured circle or tinted square on every KPI or card (0 of 23) | A label and a number |+| Rainbow charts: more than four hues, a hue per bar, one subject in two hues | One hue per chart, neutrals for the rest |+| Sparklines on KPIs (0 of 23) | The trend in its own chart, or nowhere |+| Emoji in greetings, labels, nav or empty states | Words |+| Lorem ipsum, Acme, John Doe, "User 1"; vanity figures ("10,000+ teams"); totals that do not add up | Believable sample data computed from rows, listed in the report |+| Status colour on a zero or undefined change | Grey, or the change in words ("+4 (new)") |+| A dark or saturated sidebar on a light screen; a navy or slate dark theme | The page ground for the sidebar; true neutral darks |+| The accent on chrome: a tinted nav row with a left bar, coloured tab pills, a brand fill on every button | The accent on data and at most one control; a near-black primary |+| Uppercase tracked table headers, zebra rows, header bands | 12px grey sentence-case headers; rules or space |+| Left-aligned numbers, proportional figures in columns | Right-aligned tabular figures |+| A hero header, a greeting with an emoji, an illustrated welcome banner | A noun title at 24px |+| Pagination under a five-row overview list | Capped rows, "View all", the total |+| Violet and indigo accents; cream with terracotta | The dealt style's palette |++**On violet and indigo.** 10 of the 23 studied screens use violet or indigo, always as a data hue or a+single control. The ban is the owner's taste, not a finding of the study: the library deals other+hues for the styles that came from those screens, and the inspector's palette check stays on.++## 14. Tells of generated dashboards++Each line sets a habit of generated dashboards against what the 23 screens do instead.++| Tell | What replaces it |+| --- | --- |+| A dark navy or tinted sidebar with a coloured active pill and a left bar | The sidebar on the page ground; a neutral grey pill, or the label brightening on dark. A left bar appears once in 23. |+| "Welcome back, Alex" with a waving hand and a subtitle | A noun title at 24/600. Three screens greet; the one emoji goes. |+| Four KPI cards, each with an icon in a tinted circle | One container split by hairlines, label over value. No icons on any of the 23. |+| A green "+12.5%" pill on every KPI | A delta on 9 of 20 screens, in words with its window; grey for zero; "+4 (new)" from zero. |+| A sparkline on every KPI | None on any of the 23. The trend has its own chart. |+| KPI values at 36-48px, bold, in the brand colour | 24-30px at 400-600 in ink; nothing at 48. |+| A gradient area chart with a smoothed spline and a dot on every point | A 2px straight line, no fill on 7 of 10, no markers. |+| A rainbow palette, a hue per bar or per chart | One hue per chart; the accent on data only; four hues at most on a screen. |+| Gridlines every 20px, axis lines on both sides, a legend for one series | 3-5 faint lines, no y-axis line, no legend for a single series; round ticks above the maximum. |+| A fat donut with labels on the slices and a big total in the hole | A thin ring, no slice labels, the legend as a table with the values. |+| Cards with a 16-24px radius, a 1px border and a large soft shadow | A border or a tone step, no shadow; a tight or a soft radius, chosen once. |+| A zebra table under uppercase tracked headers, with a checkbox, an avatar, a status chip and a kebab on every row | Rules and alignment: 12px grey headers, one status mark, one action where it is needed. |+| Left-aligned numbers in proportional digits | Right-aligned tabular figures, fixed decimals, units in grey. |+| Saturated status chips with white text | Pale tints with dark text of the same hue. |+| The accent on every button, tab and link | No filled primary on 12 of 23; near-black where there is one. |+| A top bar with search, a bell and an avatar on every screen, or one left mostly empty | No top bar on 9 of 23; when there is one, it carries search, the switcher or the object's name. |+| Export, Share and a date picker clustered by the title | Actions only when they are real; a freshness stamp instead. |+| Placeholder people and companies, round vanity totals, growth on a week-old account | The product's own data, small numbers at their real size, totals summed from the rows. |+| Pagination under a short list | Capped rows and "View all". |+| An equal four-up grid whatever the data, with orphan cells and stretched cards | A column count chosen by the item count; spans that change by row and land on the same lines. |+| Neon on dark, glowing borders, glass | True neutral darks, lightness steps, colour on the data. |+| A coloured icon per category in a list | One grey icon set; colour, if any, on the numbers. |+| An illustration and "No data yet" in an empty chart | The zero line drawn, and one sentence in the frame. |++A screen with every tell removed and nothing put in their place is a tidy template. What fills the+space is the product: its own data at its real size, the screen's one question answered by its+biggest block, and a grid whose sums close.diff --git a/skills/taste-skill/references/critique.md b/skills/taste-skill/references/critique.mdindex 8f955f6..1989a85 100644--- a/skills/taste-skill/references/critique.md+++ b/skills/taste-skill/references/critique.md@@ -18,8 +18,10 @@ the code, so you will read your intentions into it. The pictures only show whatOpen `desktop-fold.jpg`, then the `desktop-page-*.jpg` sheets, then `mobile-fold.jpg` and the mobilesheets. Make each pass on its own; do not blend them.-1. **One second.** Glance and look away. What did you see? There should be exactly one answer: a- word, an image, an object. If the answer is "a website", there is no focal point.+1. **One second, then five.** Glance and look away. What did you see? There should be exactly one+ answer: a word, an image, an object. If the answer is "a website", there is no focal point. Then+ give the first screen five seconds as a stranger: can you say what this is, who it is for and+ what to do next? If the title only makes sense after scrolling, it is not a title.2. **Squint.** Blur your attention until text becomes grey bars. The page should reduce to two orthree large masses with clear size differences. Many small similar masses means everything ismedium and nothing leads.@@ -29,9 +31,13 @@ sheets. Make each pass on its own; do not blend them.the pricing, the FAQ and the footer, or does the page turn into stock blocks after the first screen?4. **Edges.** Follow the left edge of every text block down the page. Count the distinct x positions.A composed page has two or three, reused on purpose. Six means things were placed one at a time.-5. **Space.** Are related things close and unrelated things far? Is the gap between sections clearly- larger than any gap inside a section? Is any region empty by accident (a hole) rather than by- decision (a rest)? A hole usually sits beside a short column or under a removed decoration.+5. **Space and frame.** Are related things close and unrelated things far? Is the gap between sections+ clearly larger than any gap inside a section? Is any region empty by accident (a hole) rather than+ by decision (a rest)? A hole usually sits beside a short column or under a removed decoration.+ Then look at the frame: are the left and right margins of the page the same? Does any section keep+ its text in one half and leave the other half empty? Is there a stretch of nothing taller than half+ a screen? Readers name these first ("it is pushed to the left", "random empty space"), before any+ detail; in the study of 100 Sites of the Day about 1 section in 100 left half the width empty.6. **Type.** Is the jump from body text to headline decisive (three times or more)? Do you see morethan five sizes? Any headline with one orphan word on its last line? Any paragraph wider than about75 characters or centred over more than three lines?@@ -122,6 +128,11 @@ These override the arithmetic.grey: design cannot exceed **6.5**.- A section the brief asked for that is missing or reduced to a few words: content cannot exceed **6**.- No real button for the primary action on the first screen: usability cannot exceed **7**.+- The five-second pass fails (no clear title saying what this is on the first screen): usability+ cannot exceed **6**.+- Unequal page margins, a section huddled on one side with the other half empty, or a blank stretch+ taller than half a screen: design cannot exceed **6.5**.+- A section of running text with no heading naming it: usability cannot exceed **7**.- Anything covering a headline at any scroll position: usability cannot exceed **6**.- A blank band where a reveal did not fire, or content clipped off-screen: usability cannot exceed **5**.diff --git a/skills/taste-skill/scripts/draw.mjs b/skills/taste-skill/scripts/draw.mjsindex dc4b533..bbca3fb 100644--- a/skills/taste-skill/scripts/draw.mjs+++ b/skills/taste-skill/scripts/draw.mjs@@ -16,6 +16,7 @@// node draw.mjs --redraw hero|type|palette|photos|section:<role>|direction re-deal one slot// node draw.mjs --list sectors|directions|roles|tones// node draw.mjs --site <id> print one studied reference site in full+// node draw.mjs --app --kind <kind> ... deal a style for an app screen instead (see lib/app-draw.mjs)//// Zero dependencies. Node 18+.import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';@@ -65,6 +66,10 @@ const DEFAULT_SECTIONS = {// requested role names → the role vocabulary used by library/sections.jsonconst ROLE_ALIAS = { features: 'features', feature: 'features', benefits: 'features', services: 'features', showcase: 'showcase', product: 'showcase', demo: 'showcase', 'how-it-works': 'how-it-works', how: 'how-it-works', process: 'how-it-works', steps: 'how-it-works', testimonial: 'testimonial', testimonials: 'testimonial', quotes: 'testimonial', proof: 'proof', logos: 'proof', press: 'proof', stats: 'stats', numbers: 'stats', pricing: 'pricing', plans: 'pricing', faq: 'faq', cta: 'cta', footer: 'footer', intro: 'intro', manifesto: 'intro', about: 'about', team: 'about', work: 'work', projects: 'work', index: 'work', 'case-studies': 'work', gallery: 'gallery', images: 'gallery', list: 'list', menu: 'list', schedule: 'list', lineup: 'list', 'line-up': 'list', speakers: 'list', agenda: 'list', programme: 'list', program: 'list', timetable: 'list', rooms: 'list', tickets: 'pricing', price: 'pricing', contact: 'contact', booking: 'contact', newsletter: 'contact', signup: 'contact' };+// App screens (dashboards, admin, settings) have their own library and sheet: scripts/lib/app-draw.mjs.+const savedKind = (() => { try { return JSON.parse(readFileSync(sheetPath, 'utf8')).kind; } catch { return null; } })();+if (opt('app') || ((opt('show') || opt('redraw')) && savedKind === 'app')) await import('./lib/app-draw.mjs');+if (opt('list')) {const what = opt('list');if (what === 'sectors') console.log(SECTORS.join('\n'));diff --git a/skills/taste-skill/scripts/inspect.mjs b/skills/taste-skill/scripts/inspect.mjsindex 1c5b6cc..d2dd333 100644--- a/skills/taste-skill/scripts/inspect.mjs+++ b/skills/taste-skill/scripts/inspect.mjs@@ -1,7 +1,10 @@#!/usr/bin/env node// tasteskill / inspect — render the page in a real browser, measure it, and photograph it.//-// node inspect.mjs <url | path/to/file.html> [--out DIR] [--widths 1440,768,390] [--allow rule,rule] [--json]+// node inspect.mjs <url | path/to/file.html> [--out DIR] [--widths 1440,768,390] [--allow rule,rule] [--app] [--json]+//+// --app judges an app screen (dashboard, admin, settings) by the rules in references/app-screens.md; a+// direction dealt with draw.mjs --app switches it on by itself.//// Exit code 0 = no FAIL findings. Exit code 1 = at least one FAIL (the page is not done).// Zero dependencies: drives an installed Chrome/Edge/Chromium. Node 22+.@@ -9,8 +12,8 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync, statSync, createReaimport { resolve, join, relative, dirname, extname, sep } from 'node:path';import { createServer } from 'node:http';import { Browser, sleep } from './lib/cdp.mjs';-import { probe, frame } from './lib/probe.mjs';-import { judge } from './lib/rules.mjs';+import { probe, frame, layout, app, colourShare } from './lib/probe.mjs';+import { judge, judgeLayout, judgeApp, APP_SKIP } from './lib/rules.mjs';const args = process.argv.slice(2);const flag = (name, def) => { const i = args.indexOf('--' + name); if (i === -1) return def; const v = args[i + 1]; args.splice(i, 2); return v; };@@ -19,14 +22,15 @@ const outDir = resolve(flag('out', '.taste-skill/inspect'));const widths = flag('widths', '1440,768,390').split(',').map(Number).filter(Boolean);let allow = flag('allow', '').split(',').filter(Boolean);const asJson = has('json');+let appMode = has('app');const target = args[0];if (!target || target === '-h' || target.startsWith('--')) {- console.error('usage: node inspect.mjs <url | file.html> [--out DIR] [--widths 1440,768,390] [--allow rule,rule] [--json]');+ console.error('usage: node inspect.mjs <url | file.html> [--out DIR] [--widths 1440,768,390] [--allow rule,rule] [--app] [--json]');process.exit(2);}// Allowances granted by the drawn direction (written by draw.mjs) apply automatically.for (const p of ['.taste-skill/direction.json', join(outDir, '..', 'direction.json')]) {- if (existsSync(p)) { try { allow = [...new Set([...allow, ...(JSON.parse(readFileSync(p, 'utf8')).allow || [])])]; } catch {} break; }+ if (existsSync(p)) { try { const d = JSON.parse(readFileSync(p, 'utf8')); allow = [...new Set([...allow, ...(d.allow || [])])]; if (d.kind === 'app') appMode = true; } catch {} break; }}// A local file is served over http from a throwaway server on 127.0.0.1, so the browser never has to// open a file path (some sandboxes show Node and the browser different views of the disk) and relative@@ -118,6 +122,9 @@ try {await sleep(350);const after = await page.eval(probe).catch(() => metrics);const m = after.headings.length >= metrics.headings.length ? after : metrics;+ const lay = await page.eval(layout).catch(() => null);+ const appM = appMode ? await page.eval(app).catch(() => null) : null;+ if (appM) appM.colourShare = await helper.eval(colourShare, 'data:image/jpeg;base64,' + frames[0]).catch(() => null);const cols = w >= 1100 ? 2 : w >= 600 ? 3 : 4;const cellW = w >= 1100 ? 800 : w >= 600 ? 512 : 390;@@ -129,7 +136,12 @@ try {await sheet(frames.slice(i, i + perSheet), cols, cellW, cellH, p);sheets.push(p);}- const findings = judge(m, { width: w, allow });+ let findings = judge(m, { width: w, allow });+ if (lay) findings.push(...judgeLayout(lay, { width: w, allow }));+ if (appMode) {+ findings = findings.filter((f) => !APP_SKIP.has(f.id) && f.id !== 'no-title' && f.id !== 'small-title');+ if (appM) findings.push(...judgeApp(appM, m, { width: w, allow }));+ }// what only shows up while scrolling: text hidden under something, and screens with almost nothing on themconst coveredText = [...new Map(frameChecks.filter(Boolean).flatMap((f, i) => f.covered.map((c) => [c.text, { ...c, screen: i + 1 }]))).values()];if (coveredText.length && !allow.includes('covered-text')) findings.push({ level: 'FAIL', id: 'covered-text', width: w, message: `Large text lies under another element at some scroll position: ` + coveredText.slice(0, 4).map((c) => `"${c.text}" (screen ${c.screen}, ${Math.round(c.share * 100)}% hidden)`).join('; '), fix: 'Nothing may sit on top of a headline or statement. Move the picture, shorten the pinned run, or raise the text above it (z-index) and give it a ground.' });@@ -150,8 +162,8 @@ try {else if (moving < MOTION_GOOD) findings.push({ level: 'WARN', id: 'still-page', width: w, message: `Little motion: ${motion.elements} element(s) moved while the page loaded and scrolled.`, fix: 'Give every section an entrance for its parts (not one fade of the whole block) and add one moving picture: a looping clip or a slow move on a photograph.' });}if (w >= 1100 && empty.length >= 2 && !allow.includes('empty-screens')) findings.push({ level: 'FAIL', id: 'empty-screens', width: w, message: `${empty.length} of ${frameChecks.length} desktop screens are almost empty ground (under 20% of the screen holds text, a picture or a colour field): screens ${empty.map(({ i }) => i + 1).join(', ')}.`, fix: 'An empty screen is a rest only once per page. Elsewhere it means the section is underbuilt: set its content larger, give it the full information, put it on a colour field, or cut it.' });- report.viewports.push({ width: w, height: h, load: how, screens: frames.length, filled: frameChecks.map((f) => f?.filled ?? null), motion, metrics: m, consoleErrors: page.consoleErrors.slice(0, 5) });- report.findings.push(...findings);+ report.viewports.push({ width: w, height: h, load: how, screens: frames.length, filled: frameChecks.map((f) => f?.filled ?? null), motion, metrics: m, layout: lay, app: appM, consoleErrors: page.consoleErrors.slice(0, 5) });+ report.findings.push(...(appMode ? findings.filter((f) => !APP_SKIP.has(f.id)) : findings));report.images.push({ viewport: label, width: w, fold, pages: sheets });await page.close();}diff --git a/skills/taste-skill/scripts/lib/app-draw.mjs b/skills/taste-skill/scripts/lib/app-draw.mjsnew file mode 100644index 0000000..3cb1e4e--- /dev/null+++ b/skills/taste-skill/scripts/lib/app-draw.mjs@@ -0,0 +1,185 @@+// tasteskill / draw --app — deal a style for an app screen (dashboard, admin, settings, inbox).+//+// node draw.mjs --app --kind <kind> --brief "one line" [--screens overview,list,detail,settings]+// [--theme light|dark] [--keep palette,type] [--options 3] [--style <id>] [--seed N]+// node draw.mjs --show reprint the saved sheet+// node draw.mjs --redraw style|shell|screen:<name>+// node draw.mjs --app --list kinds|styles|screens+//+// Same idea as the page draw: the script deals, you choose among what it dealt, so two products do not+// end up in the same default look. The library (library/app.json) was distilled from a study of real+// product screens; it holds styles (tokens and the one move that makes each recognisable), shells and+// screen patterns.+import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'node:fs';+import { dirname, join, resolve } from 'node:path';+import { fileURLToPath } from 'node:url';+import { randomInt } from 'node:crypto';+import { homedir } from 'node:os';++const HERE = dirname(fileURLToPath(import.meta.url));+const LIB = JSON.parse(readFileSync(join(HERE, '..', '..', 'library', 'app.json'), 'utf8'));+const argv = process.argv.slice(2);+const opt = (name, def) => { const i = argv.indexOf('--' + name); if (i === -1) return def; const v = argv[i + 1]; return v === undefined || v.startsWith('--') ? true : v; };+const list = (v) => (typeof v === 'string' ? v.split(',').map((s) => s.trim()).filter(Boolean) : []);+const outDir = resolve(String(opt('out', '.taste-skill')));+const sheetPath = join(outDir, 'direction.json');++const KINDS = Object.keys(LIB.kinds);+const SCREENS = [...new Set(LIB.patterns.map((p) => p.screen))];++if (opt('list')) {+ const what = opt('list');+ if (what === 'kinds') for (const [k, v] of Object.entries(LIB.kinds)) console.log(`${k.padEnd(14)} ${v.note}`);+ else if (what === 'screens') for (const s of SCREENS) console.log(`${s.padEnd(12)} ${LIB.patterns.filter((p) => p.screen === s).map((p) => p.id).join(', ')}`);+ else for (const s of LIB.styles) console.log(`${s.id.padEnd(22)} ${s.name} — ${s.theme}, ${s.suits.join(', ')}`);+ process.exit(0);+}++let seed = opt('seed') !== undefined && opt('seed') !== true ? Number(opt('seed')) : randomInt(1, 2 ** 31 - 1);+const startSeed = seed;+const rnd = () => { seed |= 0; seed = (seed + 0x6d2b79f5) | 0; let t = Math.imul(seed ^ (seed >>> 15), 1 | seed); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; };+const pick = (arr) => arr[Math.floor(rnd() * arr.length)];+const userHist = process.env.TASTE_SKILL_HISTORY || join(homedir(), '.taste-skill', 'history.json');+const readHist = () => { try { return JSON.parse(readFileSync(userHist, 'utf8')); } catch { return []; } };+const writeHist = (e) => { try { mkdirSync(dirname(userHist), { recursive: true }); const h = readHist(); h.unshift(e); writeFileSync(userHist, JSON.stringify(h.slice(0, 24), null, 1)); } catch {} };+const recentStyles = readHist().filter((h) => h.kind === 'app').slice(0, 3).map((h) => h.style);++const saved = existsSync(sheetPath) ? JSON.parse(readFileSync(sheetPath, 'utf8')) : null;+if (opt('show')) { if (!saved || saved.kind !== 'app') { console.error('No saved app sheet. Run draw.mjs --app first.'); process.exit(2); } console.log(render(saved)); process.exit(0); }++function stylePool(input) {+ const pref = LIB.kinds[input.kind]?.styles || [];+ let pool = LIB.styles.filter((s) => !(input.avoid || []).includes(s.id));+ if (input.theme) { const t = pool.filter((s) => s.theme === input.theme); if (t.length) pool = t; }+ const fit = pool.filter((s) => pref.includes(s.id) || s.suits.includes(input.kind));+ if (fit.length >= 2) pool = fit;+ return pool;+}+function dealStyle(input, exclude = []) {+ let pool = stylePool(input).filter((s) => !exclude.includes(s.id));+ if (!pool.length) pool = LIB.styles.filter((s) => !exclude.includes(s.id));+ const fresh = pool.filter((s) => !recentStyles.includes(s.id));+ return pick(fresh.length ? fresh : pool.length ? pool : LIB.styles);+}+// The style's own shell usually carries part of its move, so it is dealt about two times in three.+function dealShell(style, input, exclude = []) {+ const own = LIB.shells.find((s) => s.id === style.shell && !exclude.includes(s.id));+ const alts = LIB.shells.filter((s) => (style.shellAlternatives || []).includes(s.id) && !exclude.includes(s.id));+ if (own && (!alts.length || rnd() < 0.66)) return own;+ if (alts.length) return pick(alts);+ const rest = LIB.shells.filter((s) => !exclude.includes(s.id));+ return pick(rest.length ? rest : LIB.shells);+}+function dealScreen(name, style, input, exclude = []) {+ let pool = LIB.patterns.filter((p) => p.screen === name && !exclude.includes(p.id));+ const fit = pool.filter((p) => !p.kinds || p.kinds.includes(input.kind));+ if (fit.length) pool = fit;+ return pool.length ? pick(pool) : null;+}+function deal(input) {+ const style = input.style ? LIB.styles.find((s) => s.id === input.style) : dealStyle(input);+ if (!style) { console.error(`No app style ${input.style}. List them with --app --list styles.`); process.exit(2); }+ const s = { version: 1, kind: 'app', at: new Date().toISOString(), seed: startSeed, input, style, shell: dealShell(style, input), screens: [] };+ for (const name of input.screens) s.screens.push({ name, pattern: dealScreen(name, style, input) });+ return s;+}++let sheet;+if (opt('redraw') && saved?.kind === 'app') {+ sheet = saved; sheet.redraws = (sheet.redraws || 0) + 1;+ const what = String(opt('redraw'));+ if (what === 'style') { sheet.style = dealStyle(sheet.input, [sheet.style.id]); }+ else if (what === 'shell') sheet.shell = dealShell(sheet.style, sheet.input, [sheet.shell.id]);+ else if (what.startsWith('screen:')) { const n = what.slice(7); const i = sheet.screens.findIndex((x) => x.name === n); if (i === -1) { console.error('No screen ' + n + ' on this sheet.'); process.exit(2); } sheet.screens[i].pattern = dealScreen(n, sheet.style, sheet.input, [sheet.screens[i].pattern?.id]) || sheet.screens[i].pattern; }+ else { console.error('Redraw style, shell or screen:<name>.'); process.exit(2); }+} else {+ const kind = String(opt('kind', ''));+ if (!KINDS.includes(kind)) { console.error(`--kind is required with --app. One of:\n ${KINDS.join(', ')}`); process.exit(2); }+ const screens = list(opt('screens')).length ? list(opt('screens')) : (LIB.kinds[kind].screens || ['overview']);+ const bad = screens.filter((x) => !SCREENS.includes(x));+ if (bad.length) { console.error(`Unknown screen(s): ${bad.join(', ')}. One of: ${SCREENS.join(', ')}`); process.exit(2); }+ const input = { kind, brief: typeof opt('brief') === 'string' ? opt('brief') : '', theme: ['light', 'dark'].includes(opt('theme')) ? opt('theme') : null, screens, keep: list(opt('keep')), style: typeof opt('style') === 'string' ? opt('style') : null };+ if (opt('options')) {+ const n = Math.max(2, Math.min(5, Number(opt('options')) || 3)); const pool = stylePool(input); const out = [];+ let rest = pool.filter((s) => !recentStyles.includes(s.id)); if (rest.length < n) rest = pool;+ while (out.length < n && rest.length) { const s = pick(rest); out.push(s); rest = rest.filter((x) => x !== s); }+ console.log(`# ${out.length} app styles dealt for this brief\n`);+ console.log('Choose the one that suits how this product is used (long sessions or a quick look, money or media, a team or one person), not the most familiar. Then deal it with the same command plus `--style <id>` (and without --options).\n');+ for (const s of out) console.log(`## \`${s.id}\` — ${s.name} (${s.theme})\n${s.idea}\nThe move: ${s.signature}\n`);+ process.exit(0);+ }+ sheet = deal(input);+}+mkdirSync(outDir, { recursive: true });+writeFileSync(sheetPath, JSON.stringify(sheet, null, 1));+if (!opt('redraw')) writeHist({ at: sheet.at, kind: 'app', style: sheet.style.id, shell: sheet.shell.id });+console.log(render(sheet));+process.exit(0);++function kebab(k) { return k.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase()); }+// A Google Fonts link for the style's faces (all of them are free there).+function fontLink(f) {+ const fam = (name, w) => 'family=' + name.trim().replace(/ /g, '+') + ':wght@' + w.join(';');+ const fams = [fam(f.family, f.weights || [400, 500, 600])];+ const second = f.second && f.second.split(',')[0].trim();+ if (second && !/^(system|inter\b)/i.test(second)) fams.push(fam(second, [400, 500]));+ return `<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>\n<link href="https://fonts.googleapis.com/css2?${fams.join('&')}&display=swap" rel="stylesheet">`;+}+function render(s) {+ const st = s.style, t = st.tokens, o = []; const p = (x = '') => o.push(x);+ p(`# APP SHEET — ${st.name}`);+ p(`seed ${s.seed} · drawn ${s.at.slice(0, 10)}${s.redraws ? ` · redraws: ${s.redraws}` : ''} · kind ${s.input.kind} · ${st.theme}`);+ if (s.input.brief) p(`Brief: ${s.input.brief}`);+ p();+ p('This is the style for this product. Adopt it whole and keep its move intact; everything the sheet does not fix comes from the');+ p('shared defaults in references/app-screens.md. Redraw only for a reason you can state (it contradicts the brand, or the product is');+ p('used in a way the style does not suit) and say why in your report. The values were measured on real product screens: use them');+ p('as given rather than rounding them towards your habits.');+ p();+ p('## 1. The style'); p(st.idea); p(); p(`**The move:** ${st.signature}`); p();+ if (st.colourBudget) p(`**Colour budget:** ${st.colourBudget}.`);+ if (st.avoid?.length) p('**Off-style here:** ' + st.avoid.join('; ') + '.');+ if (st.basis) p(`Distilled from ${st.basis}.${st.notes ? ' ' + st.notes : ''}`);+ p();+ const f = t.font || {};+ if (!s.input.keep.includes('palette')) {+ p('## 2. Tokens'); p('```css'); p(':root {');+ for (const [k, v] of Object.entries(t)) {+ if (k === 'font' || k === 'density') continue;+ if (typeof v === 'string') p(` --${kebab(k)}: ${v};`);+ else if (typeof v === 'number') p(` --${kebab(k)}: ${v}px;`);+ else if (k === 'chart') v.forEach((c, i) => p(` --chart-${i + 1}: ${c};`));+ else if (k === 'pills') for (const [n, [bg, ink]] of Object.entries(v)) p(` --pill-${n}-bg: ${bg}; --pill-${n}-ink: ${ink};`);+ else if (k === 'radius') for (const [n, r] of Object.entries(v)) p(` --radius-${n}: ${r}px;`);+ }+ if (f.sizes) for (const [n, v] of Object.entries(f.sizes)) p(` --fs-${n}: ${v}px;`);+ p('}'); p('```');+ p(`Density: ${t.density}. One gap value, horizontally and vertically. ${t.shadow ? 'The shadow belongs to this dark style\'s cards only; nothing else casts one.' : 'No shadow on anything at rest.'}`);+ p();+ } else { p('## 2. Tokens'); p('Kept from the brand: map its colours onto this style\'s roles (ground, surface, raised, border, rule, control, text, muted, accent, status pills, chart) and keep its proportions: ' + (st.colourBudget || 'colour on data and status only') + '. Take the sizes, radii, row and control heights from the style as they are.'); p(); }+ if (!s.input.keep.includes('type') && f.family) {+ p(`## 3. Type — ${f.family}`);+ p('```html'); p(fontLink(f)); p('```');+ p(`\`font-family: "${f.family}", ${f.fallback || 'system-ui, sans-serif'}\`. Weights ${(f.weights || []).join(', ')}. Sizes: ${Object.entries(f.sizes || {}).map(([k, v]) => `${k} ${v}px`).join(' · ')}.${f.note ? ' ' + f.note : ''}${f.second ? ' Second face: ' + f.second + '.' : ''}`);+ p('Numbers: `font-variant-numeric: tabular-nums` on every table, KPI and anything that updates. Sentence case; no tracked capitals.'); p();+ }+ p(`## 4. Shell — ${s.shell.name}`); p(s.shell.blueprint);+ if (s.shell.numbers) p('Numbers: ' + Object.entries(s.shell.numbers).map(([k, v]) => `${k} ${v}`).join('; ') + '.');+ if (s.shell.phone) p(`On a phone: ${s.shell.phone}`); p();+ p('## 5. Screens');+ for (const sc of s.screens) {+ p();+ if (!sc.pattern) { p(`### ${sc.name}`); p('No pattern in the library for this screen. Compose it from the rules in references/app-screens.md.'); continue; }+ p(`### ${sc.name} — ${sc.pattern.name}`); p(sc.pattern.blueprint); if (sc.pattern.phone) p(`On a phone: ${sc.pattern.phone}`);+ }+ p();+ p('## 6. Always');+ p('Real data for this product, written before the markup: names, amounts that add up, dates in order, units on every figure,');+ p('honest zeros and dashes. One chart answers one question. No gradients, glows, glass, icons in tinted squares, sparklines on KPIs,');+ p('rainbow charts, emoji, lorem or Acme. `<skill>/assets/app.css` and `<skill>/assets/charts.js` are a neutral start set to these');+ p('rules. Check with `node <skill>/scripts/lint.mjs <files>` and `node <skill>/scripts/inspect.mjs <page>`: this sheet switches both');+ p('to app rules.');+ p();+ p(`Saved to ${sheetPath.split('\\').join('/')} · reprint with \`node draw.mjs --show\``);+ return o.join('\n');+}diff --git a/skills/taste-skill/scripts/lib/probe.mjs b/skills/taste-skill/scripts/lib/probe.mjsindex 1739967..463ebfa 100644--- a/skills/taste-skill/scripts/lib/probe.mjs+++ b/skills/taste-skill/scripts/lib/probe.mjs@@ -551,6 +551,237 @@ export function frame() {return { covered, clipped, pinnedOver, filled: Math.round((filled / samples) * 100) / 100, big, y: Math.round(scrollY) };}+// layout() runs once, back at the top after the page has been scrolled through (so reveals have fired).+// It measures the frame of the page rather than its details: the two outer margins, sections whose content+// huddles on one side, blank stretches with nothing in them, the title, untitled sections, text pressed+// against the edge of the screen and how many left edges the text uses.+export function layout() {+ const W = innerWidth, H = innerHeight, SY = scrollY;+ const D = document.documentElement, B = document.body;+ const pageH = Math.max(D.scrollHeight, B.scrollHeight);+ const pct = (arr, p) => { if (!arr.length) return null; const s = [...arr].sort((a, b) => a - b); return s[Math.min(s.length - 1, Math.max(0, Math.round((s.length - 1) * p)))]; };+ const shown = (el) => { for (let p = el, i = 0; p && p !== B && i < 30; p = p.parentElement, i++) { const cs = getComputedStyle(p); if (cs.display === 'none' || cs.visibility === 'hidden' || +cs.opacity < 0.05) return false; if (i < 4 && (cs.clip === 'rect(0px, 0px, 0px, 0px)' || /inset\(50%\)/.test(cs.clipPath))) return false; } return true; };+ const layerOf = (el) => { for (let p = el; p && p !== B; p = p.parentElement) { const pos = getComputedStyle(p).position; if (pos === 'fixed') return 'fixed'; if (pos === 'sticky') return 'sticky'; } return null; };+ const sel = (el) => (el.tagName.toLowerCase() + (el.id ? '#' + el.id : '') + (typeof el.className === 'string' && el.className.trim() ? '.' + el.className.trim().split(/\s+/).slice(0, 2).join('.') : '')).slice(0, 60);+ const boxes = [];+ // text, one box per text node (its line boxes merged)+ const walker = document.createTreeWalker(B, NodeFilter.SHOW_TEXT); const rg = document.createRange();+ for (let n = walker.nextNode(); n && boxes.length < 6000; n = walker.nextNode()) {+ const t = n.nodeValue.replace(/\s+/g, ' ').trim(); if (t.length < 2) continue;+ const el = n.parentElement; if (!el || /^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE|OPTION)$/.test(el.tagName) || el.closest('svg')) continue;+ rg.selectNodeContents(n); const r = rg.getBoundingClientRect(); if (r.width < 2 || r.height < 2) continue;+ if (!shown(el)) continue;+ const cs = getComputedStyle(el);+ boxes.push({ kind: 'text', el, l: r.left, r: r.right, t: r.top + SY, b: r.bottom + SY, chars: t.length, text: t.slice(0, 50), size: parseFloat(cs.fontSize), align: cs.textAlign, layer: layerOf(el), tag: el.tagName });+ }+ // pictures, drawings and controls+ for (const el of B.querySelectorAll('img, video, canvas, picture, iframe, svg, input, select, textarea, button, [role="button"], a, div, section, figure, span, li')) {+ const tag = el.tagName;+ let kind = null;+ if (/^(IMG|VIDEO|CANVAS|PICTURE|IFRAME)$/.test(tag)) kind = 'media';+ else if (tag === 'svg') { if (el.parentElement && el.parentElement.closest('svg')) continue; kind = 'media'; }+ else if (/^(INPUT|SELECT|TEXTAREA|BUTTON)$/.test(tag) || el.getAttribute('role') === 'button') kind = 'control';+ else { const bi = getComputedStyle(el).backgroundImage; if (bi && bi.includes('url(')) kind = 'media'; else continue; }+ const r = el.getBoundingClientRect(); if (r.width < 24 || r.height < 24) continue;+ if (kind === 'media' && r.width * r.height < 48 * 48) continue;+ if (!shown(el)) continue;+ boxes.push({ kind, el, l: r.left, r: r.right, t: r.top + SY, b: r.bottom + SY, chars: 0, size: 0, layer: layerOf(el), tag });+ }+ const flow = boxes.filter((b) => b.layer !== 'fixed');+ // 1. the frame: how far the page's content comes to each edge (full-bleed things say nothing about margins)+ const framed = flow.filter((b) => b.r - b.l < W * 0.97 && b.r > 0 && b.l < W);+ const L = framed.length ? Math.max(0, pct(framed.map((b) => b.l), 0.02)) : null;+ const R = framed.length ? Math.max(0, W - pct(framed.map((b) => b.r), 0.98)) : null;+ // 2. sections: descend through single wrappers, then take the blocks+ const tall = (c) => { const r = c.getBoundingClientRect(); return r.height >= 120 && r.width >= W * 0.6 && getComputedStyle(c).position !== 'fixed' && shown(c); };+ let root = B;+ for (let i = 0; i < 12; i++) { const kids = [...root.children].filter(tall); if (kids.length === 1) root = kids[0]; else break; }+ // a tall block is split into its parts; the parts of a block that has its own heading continue it+ let blocks = [...root.children].filter(tall).map((el) => ({ el, cont: false }));+ for (let pass = 0; pass < 2; pass++) blocks = blocks.flatMap((b) => { const k = [...b.el.children].filter(tall); if (b.el.getBoundingClientRect().height > H * 1.6 && k.length >= 2) { const titled = b.cont || !!b.el.querySelector('h1, h2, h3, h4, [role="heading"]'); return k.map((el) => ({ el, cont: titled })); } return [b]; });+ const continues = new Set(blocks.filter((b) => b.cont).map((b) => b.el));+ blocks = blocks.map((b) => b.el);+ const bodySize = (() => { const m = new Map(); for (const b of flow) if (b.kind === 'text' && b.chars >= 40) m.set(Math.round(b.size), (m.get(Math.round(b.size)) || 0) + b.chars); return [...m.entries()].sort((a, b) => b[1] - a[1])[0]?.[0] || 16; })();+ const sections = blocks.slice(0, 40).map((s, i) => {+ const r = s.getBoundingClientRect(); const top = r.top + SY, bot = r.bottom + SY;+ const inside = flow.filter((b) => b.t >= top - 2 && b.b <= bot + 2 && s.contains(b.el));+ const own = inside.filter((b) => b.r - b.l < W * 0.97);+ const text = inside.filter((b) => b.kind === 'text');+ const media = inside.filter((b) => b.kind === 'media' && (b.r - b.l) * (b.b - b.t) >= 160 * 120);+ const words = text.reduce((a, b) => a + b.text.split(' ').length + Math.max(0, Math.round((b.chars - 50) / 6)), 0);+ const headRe = /^H[1-4]$/;+ const heading = text.filter((b) => (b.el.closest('h1,h2,h3,h4,[role="heading"]') || b.size >= Math.max(22, bodySize * 1.35)) && b.t <= top + Math.max(520, (bot - top) * 0.45)).sort((a, b) => b.size - a.size)[0];+ const cs = getComputedStyle(s);+ return {+ sel: sel(s), tag: s.tagName.toLowerCase(), top: Math.round(top), height: Math.round(r.height), words, media: media.length,+ heading: heading ? { text: heading.text, size: Math.round(heading.size), tag: (heading.el.closest('h1,h2,h3,h4,h5,h6') || heading.el).tagName.toLowerCase() } : null,+ left: own.length ? Math.round(Math.max(0, Math.min(...own.map((b) => b.l)))) : null, right: own.length ? Math.round(Math.max(0, W - Math.max(...own.map((b) => b.r)))) : null,+ textLeft: text.length ? Math.round(Math.min(...text.map((b) => b.l))) : null, textRight: text.length ? Math.round(W - Math.max(...text.map((b) => b.r))) : null,+ fullBleed: inside.some((b) => b.kind === 'media' && b.r - b.l >= W * 0.97), footer: s.tagName === 'FOOTER' || !!s.querySelector('footer') || i === blocks.length - 1,+ hero: top < H * 0.5, continues: continues.has(s), pinned: cs.position === 'sticky' || !!s.querySelector('.pin-spacer') || [...s.querySelectorAll('*')].slice(0, 400).some((e) => getComputedStyle(e).position === 'sticky' && e.getBoundingClientRect().height > H * 0.5),+ };+ });+ // 3. blank stretches: rows of the page with no text, picture or control, between the first and the last content.+ // A sticky element's track (its parent) and a pinning spacer are scroll distance, not blank page.+ const STEP = 4, rows = Math.ceil(pageH / STEP), occ = new Uint8Array(rows);+ const mark = (t, b, v) => { for (let y = Math.max(0, Math.floor(t / STEP)); y < Math.min(rows, Math.ceil(b / STEP)); y++) occ[y] = v; };+ for (const b of flow) if (b.layer !== 'sticky') mark(b.t, b.b, 1);+ for (const el of B.querySelectorAll('.pin-spacer')) { const r = el.getBoundingClientRect(); mark(r.top + SY, r.bottom + SY, 2); }+ let scanned = 0;+ for (const el of B.querySelectorAll('*')) { if (++scanned > 9000) break; const cs = getComputedStyle(el); if (cs.position === 'sticky' && el.parentElement) { const r = el.parentElement.getBoundingClientRect(); mark(r.top + SY, r.bottom + SY, 2); } }+ let first = 0; while (first < rows && occ[first] !== 1) first++;+ let last = rows - 1; while (last > 0 && occ[last] !== 1) last--;+ const gaps = []; let run = 0;+ for (let y = first; y <= last + 1; y++) { if (y <= last && occ[y] === 0) run++; else { if (run * STEP >= H * 0.3) gaps.push({ top: (y - run) * STEP, height: run * STEP }); run = 0; } }+ // 4. the title+ const h1s = [...document.querySelectorAll('h1')].filter((h) => { const r = h.getBoundingClientRect(); return r.width > 0 && r.height > 0 && shown(h); }).map((h) => { const r = h.getBoundingClientRect(); return { text: (h.innerText || '').replace(/\s+/g, ' ').trim().slice(0, 80), size: Math.round(parseFloat(getComputedStyle(h).fontSize)), top: Math.round(r.top + SY), firstScreen: r.top + SY < H * 0.95 }; });+ // 5. text pressed against the edge of the screen (type deliberately bled past the edge is a different device)+ const edge = W < 600 ? 12 : 16;+ const edgeText = flow.filter((b) => b.kind === 'text' && b.chars >= 3 && b.size < 40 && b.l >= -1 && b.r <= W + 1 && (b.l < edge || b.r > W - edge) && !b.el.closest('[class*="marquee" i],[class*="ticker" i],marquee,[data-ui],table')).slice(0, 8).map((b) => ({ text: b.text, side: b.l < edge ? 'left' : 'right', px: Math.round(b.l < edge ? b.l : W - b.r) }));+ // 6. left edges used by running text and headings (left-aligned blocks only)+ // headings and paragraphs only: the items of a grid or a list each start their own column on purpose+ const lefts = flow.filter((b) => b.kind === 'text' && b.size >= 14 && !/center|right|end/.test(b.align) && b.l >= 0 && (b.el.closest('h1, h2, h3') || (b.chars >= 60 && b.el.closest('p, blockquote'))) && !b.el.closest('nav, footer, [data-ui], table, li, figcaption')).map((b) => b.l).sort((a, b) => a - b);+ const edges = []; for (const x of lefts) { const e = edges.find((g) => Math.abs(g.x - x) <= 10); if (e) e.n++; else edges.push({ x: Math.round(x), n: 1 }); }+ edges.sort((a, b) => b.n - a.n);+ return { viewport: { w: W, h: H }, pageH, margins: { left: L == null ? null : Math.round(L), right: R == null ? null : Math.round(R) }, sections, gaps, h1s, edgeText, edges: edges.slice(0, 12), leftBlocks: lefts.length, bodySize };+}++// app() measures what an app screen (dashboard, admin, settings, inbox) gets right or wrong: the shell,+// how much of the canvas is used, panels and their edges, numbers in tables and KPIs, chart colours,+// the icon-in-a-tinted-square habit, placeholder data, and what happens to the sidebar on a phone.+export function app() {+ const W = innerWidth, H = innerHeight, SY = scrollY, B = document.body;+ const cvs = document.createElement('canvas'); cvs.width = cvs.height = 1;+ const ctx = cvs.getContext('2d', { willReadFrequently: true });+ const rgba = (c) => { ctx.clearRect(0, 0, 1, 1); ctx.fillStyle = 'rgba(0,0,0,0)'; ctx.fillStyle = c; ctx.fillRect(0, 0, 1, 1); const d = ctx.getImageData(0, 0, 1, 1).data; return { r: d[0], g: d[1], b: d[2], a: d[3] / 255 }; };+ const hex = (v) => '#' + [v.r, v.g, v.b].map((n) => n.toString(16).padStart(2, '0')).join('');+ const lum = (v) => { const f = (x) => { x /= 255; return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4; }; return 0.2126 * f(v.r) + 0.7152 * f(v.g) + 0.0722 * f(v.b); };+ const contrast = (a, b) => { const l1 = lum(a), l2 = lum(b); return Math.round(((Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05)) * 100) / 100; };+ const hsl = (v) => { const r = v.r / 255, g = v.g / 255, b = v.b / 255, mx = Math.max(r, g, b), mn = Math.min(r, g, b); const l = (mx + mn) / 2; let h = 0, s = 0; if (mx !== mn) { const d = mx - mn; s = l > 0.5 ? d / (2 - mx - mn) : d / (mx + mn); h = mx === r ? (g - b) / d + (g < b ? 6 : 0) : mx === g ? (b - r) / d + 2 : (r - g) / d + 4; h *= 60; } return { h: Math.round(h), s, l }; };+ const shown = (el, cs) => { cs = cs || getComputedStyle(el); if (cs.display === 'none' || cs.visibility === 'hidden' || +cs.opacity < 0.05) return false; const r = el.getBoundingClientRect(); return r.width > 0 && r.height > 0; };+ const groundOf = (el) => { for (let p = el; p; p = p.parentElement) { const v = rgba(getComputedStyle(p).backgroundColor); if (v.a >= 0.9) return v; } return { r: 255, g: 255, b: 255, a: 1 }; };+ const pageBg = groundOf(B);+ const all = [...B.querySelectorAll('*')].slice(0, 12000);+ // 1. the shell: a tall column at one side (sidebar) and a bar across the top+ let sidebar = null, topbar = null;+ for (const el of all) {+ const r = el.getBoundingClientRect(); if (r.width < 40) continue;+ if (!sidebar && r.left <= 1 && r.top <= 80 && r.height >= H * 0.7 && r.width >= 48 && r.width <= Math.min(360, W * 0.45) && (el.querySelectorAll('a, button').length >= 3) && shown(el)) sidebar = { w: Math.round(r.width), tag: el.tagName.toLowerCase(), links: el.querySelectorAll('a, button').length, share: Math.round((r.width / W) * 100) / 100 };+ if (!topbar && r.top <= 1 && r.left <= (sidebar ? sidebar.w + 2 : 2) && r.width >= W * 0.6 && r.height >= 36 && r.height <= 96 && shown(el)) topbar = { h: Math.round(r.height) };+ if (sidebar && topbar) break;+ }+ // 2. how much of the canvas the content uses (right of the sidebar)+ const x0 = sidebar ? sidebar.w : 0;+ // the text itself (a block element's box runs to the edge whatever its text does), pictures, charts and controls+ const boxes = [];+ const tw = document.createTreeWalker(B, NodeFilter.SHOW_TEXT); const trg = document.createRange();+ for (let n = tw.nextNode(); n && boxes.length < 5000; n = tw.nextNode()) {+ if (n.nodeValue.trim().length < 2 || !n.parentElement || n.parentElement.closest('svg')) continue;+ const cs = getComputedStyle(n.parentElement); if (cs.visibility === 'hidden' || cs.display === 'none' || +cs.opacity < 0.05) continue;+ trg.selectNodeContents(n); const r = trg.getBoundingClientRect(); if (r.width < 2 || r.left < x0 - 1 || (cs.position === 'fixed' && r.left > W * 0.5)) continue;+ boxes.push(r);+ }+ for (const el of B.querySelectorAll('svg, canvas, img, video, input, select, textarea, button, table')) {+ if (el.parentElement && el.parentElement.closest('svg')) continue;+ const r = el.getBoundingClientRect(); if (r.width < 8 || r.height < 8 || r.left < x0 - 1 || !shown(el)) continue;+ boxes.push(r);+ }+ const rights = boxes.map((r) => r.right).sort((a, b) => a - b), lefts = boxes.map((r) => r.left).sort((a, b) => a - b);+ const canvas = boxes.length ? { left: Math.round(lefts[Math.floor(lefts.length * 0.02)] - x0), right: Math.round(W - rights[Math.floor(rights.length * 0.98)]) } : null;+ // 3. panels: boxes that read as cards (a fill one step from the ground, a border, or a shadow)+ const panels = []; const radii = new Map(); let heavyBorders = 0, heavyShadows = 0, softShadows = 0, glass = 0; const borderSamples = [], shadowSamples = [];+ for (const el of all) {+ const r = el.getBoundingClientRect(); if (r.width < 140 || r.height < 72 || r.width > W * 0.98) continue;+ const cs = getComputedStyle(el); if (!shown(el, cs)) continue;+ const bg = rgba(cs.backgroundColor), bw = parseFloat(cs.borderTopWidth) || 0, bc = rgba(cs.borderTopColor);+ const ground = groundOf(el.parentElement || B);+ const filled = bg.a >= 0.9 && contrast(bg, ground) >= 1.04, bordered = bw >= 0.5 && cs.borderTopStyle !== 'none' && bc.a > 0.05;+ const sh = cs.boxShadow !== 'none' ? cs.boxShadow : '';+ if (!filled && !bordered && !sh) continue;+ if (!(el.innerText || '').trim()) continue;+ panels.push({ w: Math.round(r.width), h: Math.round(r.height) });+ const rad = Math.round(parseFloat(cs.borderTopLeftRadius) || 0); radii.set(rad, (radii.get(rad) || 0) + 1);+ if (bordered) { const c = contrast({ ...bc, a: 1 }, bg.a >= 0.9 ? bg : ground); if (c >= (lum(ground) > 0.4 ? 1.45 : 1.9)) { heavyBorders++; if (borderSamples.length < 3) borderSamples.push(`${hex(bc)} on ${hex(bg.a >= 0.9 ? bg : ground)} (${c}:1)`); } }+ if (sh) {+ for (const part of sh.split(/,(?![^(]*\))/)) {+ if (/inset/.test(part)) continue; const col = part.match(/rgba?\([^)]+\)/); const nums = part.replace(/rgba?\([^)]+\)/, '').trim().split(/\s+/).map(parseFloat);+ const a = col ? rgba(col[0]).a : 1; const blur = nums[2] || 0, y = Math.abs(nums[1] || 0);+ if (a <= 0.02 || (blur === 0 && y === 0 && !(nums[3] > 0))) continue;+ // on a dark ground a black shadow barely shows; there it only counts when it is near-opaque+ const darkGround = lum(ground) < 0.2;+ if (darkGround ? a >= 0.45 : ((a >= 0.12 && blur >= 12) || y >= 8 || a >= 0.25)) { heavyShadows++; if (shadowSamples.length < 3) shadowSamples.push(part.trim().slice(0, 70)); } else softShadows++;+ }+ }+ if (cs.backdropFilter && cs.backdropFilter !== 'none') glass++;+ }+ // 4. the icon-in-a-tinted-square habit: small boxes with a coloured fill holding one icon, repeated+ const chips = [];+ for (const el of all) {+ const r = el.getBoundingClientRect(); if (r.width < 24 || r.width > 64 || Math.abs(r.width - r.height) > 4) continue;+ const cs = getComputedStyle(el); const bg = rgba(cs.backgroundColor); if (bg.a < 0.08) continue;+ const icon = el.querySelector('svg, i, img, [class*="icon" i]'); if (!icon || (el.innerText || '').trim().length > 2) continue;+ const c = hsl(bg); if (c.s < 0.18 && bg.a > 0.5) continue; // a neutral grey square is an avatar or a plain button+ chips.push({ hue: c.h, size: Math.round(r.width), radius: cs.borderTopLeftRadius });+ }+ const chipHues = new Set(chips.map((c) => Math.round(c.hue / 30)));+ // 5. numbers: tables and KPI figures+ const numRe = /^[−\-+]?[$€£¥]?\s?\d[\d,.\s]*(%|[kKmMbB]|\s?(ms|s|h|min|GB|MB|kB|x))?$/;+ const cells = [...B.querySelectorAll('td, [role="cell"], [role="gridcell"]')].filter((el) => numRe.test((el.innerText || '').trim()));+ const leftNums = cells.filter((el) => { const a = getComputedStyle(el).textAlign; const inner = el.firstElementChild ? getComputedStyle(el.firstElementChild).textAlign : a; return /left|start/.test(a) && /left|start/.test(inner) && getComputedStyle(el).justifyContent !== 'flex-end'; }).length;+ const figures = [];+ for (const el of all) { if (el.children.length) continue; const t = (el.innerText || '').trim(); if (!numRe.test(t) || t.length < 2) continue; const cs = getComputedStyle(el); if (!shown(el, cs)) continue; figures.push({ size: parseFloat(cs.fontSize), tabular: /tabular-nums/.test(cs.fontVariantNumeric) || /"tnum"/.test(cs.fontFeatureSettings), weight: +cs.fontWeight }); }+ const tabularShare = figures.length ? Math.round((figures.filter((f) => f.tabular).length / figures.length) * 100) / 100 : null;+ const rows = [...B.querySelectorAll('tbody tr, [role="row"]')].map((tr) => Math.round(tr.getBoundingClientRect().height)).filter((h) => h > 0);+ // 6. chart colours: saturated fills and strokes inside SVG charts and canvas-free charts+ const hues = new Map();+ for (const svg of B.querySelectorAll('svg')) {+ const r = svg.getBoundingClientRect(); if (r.width < 120 || r.height < 60) continue;+ for (const s of svg.querySelectorAll('path, rect, circle, line, polyline, polygon')) {+ const cs = getComputedStyle(s);+ for (const c of [cs.fill, cs.stroke]) { if (!c || c === 'none' || c.startsWith('url')) continue; const v = rgba(c); if (v.a < 0.3) continue; const h = hsl(v); if (h.s < 0.25 || h.l < 0.12 || h.l > 0.92) continue; const k = Math.round(h.h / 24); hues.set(k, (hues.get(k) || 0) + 1); }+ }+ }+ // bars and segments drawn with divs count too (a common way to fake a chart)+ // 7. placeholder data+ const text = B.innerText || '';+ const placeholders = [...new Set((text.match(/\b(John|Jane) Doe\b|\bAcme( Inc| Corp)?\b|\bLorem ipsum\b|\bexample\.com\b|\bUser Name\b|\bFirstname Lastname\b|\b123 Main St\b|\bfoo(bar)?\b/gi) || []).map((s) => s.toLowerCase()))];+ // 8. type at app sizes+ const sizes = new Map(); let tiny = 0; const tinySamples = [];+ const walker = document.createTreeWalker(B, NodeFilter.SHOW_TEXT);+ for (let n = walker.nextNode(); n; n = walker.nextNode()) { const t = n.nodeValue.trim(); if (t.length < 2 || !n.parentElement) continue; const cs = getComputedStyle(n.parentElement); if (cs.visibility === 'hidden' || cs.display === 'none') continue; const s = Math.round(parseFloat(cs.fontSize)); sizes.set(s, (sizes.get(s) || 0) + t.length); if (s < 11 && t.length >= 3) { tiny++; if (tinySamples.length < 4) tinySamples.push(t.slice(0, 24) + ' ' + s + 'px'); } }+ const total = [...sizes.values()].reduce((a, b) => a + b, 0) || 1;+ const under13 = Math.round(([...sizes.entries()].filter(([s]) => s < 13).reduce((a, [, c]) => a + c, 0) / total) * 100) / 100;+ const h1 = document.querySelector('h1'); const h1r = h1 && h1.getBoundingClientRect();+ return {+ viewport: { w: W, h: H }, dark: lum(pageBg) < 0.2, ground: hex(pageBg),+ sidebar, topbar, canvas,+ panels: { count: panels.length, radii: [...radii.entries()].sort((a, b) => b[1] - a[1]).slice(0, 6), heavyBorders, borderSamples, heavyShadows, softShadows, shadowSamples, glass },+ chips: { count: chips.length, hues: chipHues.size, samples: chips.slice(0, 4) },+ numbers: { cells: cells.length, leftAligned: leftNums, figures: figures.length, tabularShare, kpiMax: figures.length ? Math.max(...figures.map((f) => f.size)) : null },+ rows: rows.length ? { count: rows.length, median: rows.sort((a, b) => a - b)[Math.floor(rows.length / 2)] } : null,+ chartHues: hues.size,+ placeholders,+ type: { under13, tiny, tinySamples, sizes: [...sizes.keys()].sort((a, b) => a - b) },+ title: h1 && h1r.width > 0 ? { text: (h1.innerText || '').trim().slice(0, 60), size: Math.round(parseFloat(getComputedStyle(h1).fontSize)), top: Math.round(h1r.top + SY) } : null,+ };+}++// Share of a screenshot's pixels that are strongly coloured (saturated, neither near-black nor near-white).+// The studied app screens keep it near 3%; pale tints barely count. Runs inside any page; takes a data: URL.+export async function colourShare(dataUrl) {+ const img = new Image(); img.src = dataUrl; await img.decode();+ const w = 240, h = Math.max(1, Math.round((240 * img.height) / img.width));+ const c = document.createElement('canvas'); c.width = w; c.height = h;+ const x = c.getContext('2d', { willReadFrequently: true }); x.drawImage(img, 0, 0, w, h);+ const d = x.getImageData(0, 0, w, h).data; let n = 0;+ for (let i = 0; i < d.length; i += 4) {+ const r = d[i] / 255, g = d[i + 1] / 255, b = d[i + 2] / 255, mx = Math.max(r, g, b), mn = Math.min(r, g, b), l = (mx + mn) / 2;+ const s = mx === mn ? 0 : l > 0.5 ? (mx - mn) / (2 - mx - mn) : (mx - mn) / (mx + mn);+ if (s >= 0.4 && l >= 0.18 && l <= 0.82) n++;+ }+ return Math.round((n / (w * h)) * 1000) / 1000;+}+// Dominant colours of a screenshot. Runs inside any page; takes a data: URL.export async function palette(dataUrl) {const img = new Image(); img.src = dataUrl; await img.decode();diff --git a/skills/taste-skill/scripts/lib/rules.mjs b/skills/taste-skill/scripts/lib/rules.mjsindex a2dada2..2c8c613 100644--- a/skills/taste-skill/scripts/lib/rules.mjs+++ b/skills/taste-skill/scripts/lib/rules.mjs@@ -134,4 +134,81 @@ export function judge(m, { width = m.viewport.w, allow = [] } = {}) {return out;}-export const RULE_IDS = ['headline-lines', 'statement-length', 'focal-point', 'hero-words', 'mixed-font-headline', 'eyebrow', 'mono', 'numbering', 'micro-label', 'emoji', 'gradient', 'gradient-text', 'shadow', 'text-shadow', 'button-fx', 'hairline', 'outlined-box', 'dashed', 'glass', 'icon-cards', 'card-rows', 'pill-nav', 'palette-claude', 'palette-terracotta', 'palette-cream', 'palette-purple', 'default-link', 'contrast', 'font-count', 'font-fallback', 'size-count', 'body-size', 'measure', 'small-text', 'all-centred', 'ui-wrapper', 'overflow', 'broken-image', 'no-hero', 'first-action', 'grey-body', 'blend-text', 'covered-text', 'clipped-text', 'pinned-over-picture', 'empty-screens', 'long-pin', 'side-scroll', 'few-pictures', 'no-real-pictures', 'no-footage', 'still-page'];+// The frame of the page, measured once per width by layout(): margins, balance, blank stretches, titles.+// These catch the failures a reader names first: "no clear title", "random empty space", "it is all+// pushed to one side", "text touching the edge".+export function judgeLayout(L, { width = L.viewport.w, allow = [] } = {}) {+ const out = [];+ const add = (level, id, message, fix) => { if (!allow.includes(id)) out.push({ level, id, width, message, fix }); };+ const mobile = width < 600, H = L.viewport.h;+ // the outer frame: the two margins match (asymmetry belongs inside the grid, never in the frame)+ const { left, right } = L.margins;+ if (left != null && right != null) {+ const diff = Math.abs(left - right), wide = Math.max(left, right);+ if (diff >= Math.max(mobile ? 14 : 40, width * 0.045) && wide >= (mobile ? 28 : width * 0.07)) {+ add('FAIL', 'off-centre', `The page sits off-centre: its content comes to ${left}px from the left edge but only to ${right}px from the right, at ${width}px.`, `Give the page one pair of equal margins. Check the wrapper for a max-width without margin-inline: auto, a grid with an empty last column, or padding on one side only. If one side is meant to hold air, it must still be closed by something that reaches the margin (a picture, the navigation's last item, a figure).`);+ }+ }+ // sections whose content huddles on one side, leaving the other half of the screen empty+ if (!mobile && left != null) {+ const lop = L.sections.filter((s) => !s.hero && !s.footer && !s.fullBleed && !s.pinned && s.left != null && s.words >= 12 && s.height >= 180 && Math.min(s.left, s.right) <= Math.max(left, right) + 24 && Math.max(s.left, s.right) >= width * 0.42);+ if (lop.length >= 2) add('FAIL', 'lopsided', `${lop.length} sections keep all their content on one side and leave ${Math.round(Math.max(...lop.map((s) => Math.max(s.left, s.right))) / width * 100)}% of the width empty: ` + lop.slice(0, 4).map((s) => `${s.heading ? '"' + s.heading.text + '"' : s.sel} (${s.right > s.left ? 'right' : 'left'} ${Math.max(s.left, s.right)}px empty)`).join('; '), 'Use the whole width the page has set up: put the section\'s picture, its second column, its list or its figure in the empty half, or set the text larger across the grid. Empty space must be placed, with something on each side of it.');+ else if (lop.length) add('WARN', 'lopsided', `A section keeps its content on one side and leaves ${Math.max(lop[0].left, lop[0].right)}px of the width empty: ${lop[0].heading ? '"' + lop[0].heading.text + '"' : lop[0].sel}.`, 'Fill the other side with what the section has (its picture, a second column, the figure), or defend the void in one sentence.');+ }+ // blank stretches: nothing at all for a long run down the page+ const big = L.gaps.filter((g) => g.height >= H * 0.6), mid = L.gaps.filter((g) => g.height >= H * 0.42 && g.height < H * 0.6);+ if (big.length || mid.length >= 2) add('FAIL', 'blank-gap', `${big.length + mid.length} stretch(es) of the page hold nothing at all: ` + [...big, ...mid].slice(0, 4).map((g) => `${g.height}px at ${g.top}px`).join('; ') + ` (the screen is ${H}px tall).`, 'Close the gap: a section gap is 120–220px on desktop and 72–112px on a phone. Look for a min-height: 100vh on a short section, an empty grid row, a hidden element still holding its space, or a reveal that never fired. A deliberate rest is a placed picture or colour field, not nothing.');+ else if (mid.length) add('WARN', 'blank-gap', `A ${mid[0].height}px stretch at ${mid[0].top}px holds nothing.`, 'Check that it is a deliberate rest (once per page at most); otherwise close it to the normal section gap.');+ // the title: one h1, on the first screen, that says what this is+ if (!L.h1s.length) add('FAIL', 'no-title', 'The page has no visible h1.', 'Give the first screen a clear title in an h1 that says what this is (a name with what it does, the product with what it is for, the event with its date and place).');+ else {+ const first = L.h1s[0];+ if (!first.firstScreen) add('FAIL', 'no-title', `The h1 ("${first.text.slice(0, 50)}") is not on the first screen (it starts ${first.top}px down).`, 'The title belongs on the first screen, where a visitor decides whether to stay.');+ else if (first.size < (mobile ? 26 : 32)) add('WARN', 'small-title', `The h1 is ${first.size}px ("${first.text.slice(0, 50)}").`, 'Set the title at display size, or make the large text of the first screen the h1.');+ if (L.h1s.length > 1) add('WARN', 'many-h1', `${L.h1s.length} h1 elements.`, 'One h1 per page; section titles are h2.');+ }+ // sections with running text but no heading: the reader cannot tell what they are+ const untitled = L.sections.filter((s) => !s.hero && !s.footer && !s.continues && !s.heading && s.words >= 30 && s.height >= 200);+ if (untitled.length >= 2) add('FAIL', 'untitled-section', `${untitled.length} sections carry text but no heading: ` + untitled.slice(0, 4).map((s) => `${s.sel} at ${s.top}px (${s.words} words)`).join('; '), 'Give each section a short heading that names what it holds (the menu, the rooms, how it works, the price), in the heading face at the section size.');+ else if (untitled.length) add('WARN', 'untitled-section', `A section carries text but no heading: ${untitled[0].sel} at ${untitled[0].top}px.`, 'Name it with a short heading unless it is the continuation of the section above.');+ // text pressed against the screen edge+ if (L.edgeText.length) add('FAIL', 'edge-text', `${L.edgeText.length} text block(s) sit within ${mobile ? 12 : 16}px of the screen edge: ` + L.edgeText.slice(0, 4).map((t) => `"${t.text.slice(0, 30)}" (${t.px}px from the ${t.side})`).join('; '), `Keep text inside the page margin (${mobile ? '16–20px' : '16–32px or more'}). Only display type deliberately bled past the edge may touch it.`);+ // too many left edges: nothing lines up+ if (!mobile && L.edges.length > 6 && L.leftBlocks >= 8) {+ const top3 = L.edges.slice(0, 3).reduce((a, e) => a + e.n, 0) / L.leftBlocks;+ if (top3 < 0.6) add('WARN', 'ragged-edges', `Left-aligned text starts at ${L.edges.length} different lines (${L.edges.slice(0, 7).map((e) => e.x + 'px').join(', ')}); the three most used hold only ${Math.round(top3 * 100)}% of it.`, 'Pick two or three anchor lines from the grid and start every heading and paragraph on one of them.');+ }+ return out;+}++// App screens (dashboards, admin, settings, inboxes) keep conventions a marketing page does not: tables+// and panels may have quiet borders, labels are small, cards repeat, there is no hero, no picture floor+// and no motion floor. These page rules do not apply to them; references/app-screens.md has the reasons.+export const APP_SKIP = new Set(['hero-words', 'eyebrow', 'numbering', 'hairline', 'outlined-box', 'dashed', 'icon-cards', 'card-rows', 'pill-nav', 'grey-body', 'measure', 'first-action', 'few-pictures', 'no-real-pictures', 'no-footage', 'focal-point', 'no-hero', 'body-size', 'small-text', 'statement-length', 'shadow', 'glass', 'still-page', 'empty-screens', 'long-pin', 'side-scroll', 'pinned-over-picture', 'off-centre', 'lopsided', 'ragged-edges', 'untitled-section', 'size-count', 'all-centred']);++export function judgeApp(A, m, { width = A.viewport.w, allow = [] } = {}) {+ const out = [];+ const add = (level, id, message, fix) => { if (!allow.includes(id)) out.push({ level, id, width, message, fix }); };+ const mobile = width < 600;+ if (mobile && A.sidebar && A.sidebar.share > 0.3) add('FAIL', 'sidebar-phone', `The sidebar still takes ${Math.round(A.sidebar.share * 100)}% of the width on a ${width}px phone.`, 'On a phone the navigation folds into a top bar with a menu button or a bottom bar of four or five destinations; the screen\'s content gets the full width.');+ if (!mobile && width >= 1100 && A.canvas && A.canvas.right > Math.max(120, width * 0.1) && A.canvas.right > A.canvas.left + 80) add('WARN', 'unused-canvas', `The content stops ${A.canvas.right}px short of the right edge while it starts ${A.canvas.left}px from the sidebar.`, 'Let the grid fill the canvas (columns in fr units), or centre a capped canvas with equal margins. A dead strip on one side reads as unfinished.');+ if (A.panels.heavyShadows) add('FAIL', 'heavy-shadow', `${A.panels.heavyShadows} panel shadow(s) heavy enough to read as floating: ${A.panels.shadowSamples.join(' | ')}`, 'Panels sit on the ground: separate them with a fill one step from the ground or a quiet 1px border. A shadow, if any, is under 8% black with a small blur. Real overlays (menus, dialogs, popovers) may float.');+ if (A.panels.glass) add('FAIL', 'glass', `${A.panels.glass} blurred glass panel(s).`, 'Opaque surfaces only.');+ if (A.panels.heavyBorders >= 3) add('WARN', 'heavy-borders', `${A.panels.heavyBorders} panel borders are dark against their ground: ${A.panels.borderSamples.join(' | ')}`, 'A panel border is a whisper: about 1.1–1.3:1 against its ground on a light screen (#e5e7eb–#ededed on white), and about 1.2–1.5:1 on a dark one (#1a1a1a on #000, #2e2e2e on #111). Darker lines turn the screen into a grid of boxes; keep the stronger line for controls.');+ const radii = A.panels.radii.filter(([, n]) => n >= 2).map(([r]) => r);+ if (radii.length > 3) add('WARN', 'radius-mix', `Panels use ${radii.length} corner radii (${radii.join(', ')}px).`, 'One radius for panels, one for controls, full round only for pills and avatars.');+ if (A.chips.count >= 3) add(A.chips.hues >= 2 ? 'FAIL' : 'WARN', 'icon-chips', `${A.chips.count} icons sit in tinted squares or circles${A.chips.hues >= 2 ? ` in ${A.chips.hues} different colours` : ''}.`, 'This is the commonest tell of a generated dashboard. Drop the tinted square: a KPI is a label and a number; an icon, if it helps, is plain and in the text colour.');+ if (A.numbers.cells >= 6 && A.numbers.leftAligned / A.numbers.cells >= 0.5) add('WARN', 'numeric-align', `${A.numbers.leftAligned} of ${A.numbers.cells} numeric table cells are left-aligned.`, 'Right-align numbers, amounts and percentages (and their column headers) so the digits line up.');+ if (A.numbers.figures >= 6 && A.numbers.tabularShare != null && A.numbers.tabularShare < 0.5) add('WARN', 'tabular', `Only ${Math.round(A.numbers.tabularShare * 100)}% of the figures use tabular numerals.`, 'Set font-variant-numeric: tabular-nums on tables, KPIs and anything that updates, so digits keep their width.');+ if (A.chartHues > 6) add('FAIL', 'rainbow-chart', `The charts use ${A.chartHues} different hues.`, 'One hue for the series that matters, a neutral for the rest, and at most four series colours in total; status colours only for status.');+ else if (A.chartHues > 4) add('WARN', 'rainbow-chart', `The charts use ${A.chartHues} different hues.`, 'Four series colours at most; prefer one accent and neutrals.');+ if (A.colourShare != null && A.colourShare > 0.12) add('WARN', 'colour-sprawl', `${Math.round(A.colourShare * 100)}% of the first screen is strongly coloured.`, 'Keep the screen neutral and spend colour on data and status: the studied screens sit near 3%, and only tinted styles reach 10–15%, as pale tints rather than saturated fills.');+ if (A.placeholders.length) add('FAIL', 'placeholder-data', `Placeholder data on screen: ${A.placeholders.join(', ')}.`, 'Use believable data for this product: real-looking names, amounts that add up, dates in order, units on every figure.');+ if (A.type.tiny > 2) add('FAIL', 'tiny-text', `${A.type.tiny} text blocks under 11px: ${A.type.tinySamples.join(', ')}.`, 'Nothing below 11px; secondary text 12px, data 13–14px.');+ else if (A.type.under13 > 0.45) add('WARN', 'tiny-text', `${Math.round(A.type.under13 * 100)}% of the text is under 13px.`, 'Data and labels read at 13–14px; keep 11–12px for sublines and axis ticks.');+ if (!A.title) add('FAIL', 'no-title', 'The screen has no h1.', 'Name the screen in an h1 at the top of the canvas (18–28px): "Overview", "Payouts", the project\'s name.');+ if (m && m.type && m.type.monoProseShare > 0.15) add('WARN', 'mono', `Monospace is ${Math.round(m.type.monoProseShare * 100)}% of the text.`, 'Monospace for IDs, keys and code only; numbers use tabular figures in the text face.');+ return out;+}++export const RULE_IDS = ['headline-lines', 'statement-length', 'focal-point', 'hero-words', 'mixed-font-headline', 'eyebrow', 'mono', 'numbering', 'micro-label', 'emoji', 'gradient', 'gradient-text', 'shadow', 'text-shadow', 'button-fx', 'hairline', 'outlined-box', 'dashed', 'glass', 'icon-cards', 'card-rows', 'pill-nav', 'palette-claude', 'palette-terracotta', 'palette-cream', 'palette-purple', 'default-link', 'contrast', 'font-count', 'font-fallback', 'size-count', 'body-size', 'measure', 'small-text', 'all-centred', 'ui-wrapper', 'overflow', 'broken-image', 'no-hero', 'first-action', 'grey-body', 'blend-text', 'covered-text', 'clipped-text', 'pinned-over-picture', 'empty-screens', 'long-pin', 'side-scroll', 'few-pictures', 'no-real-pictures', 'no-footage', 'still-page', 'off-centre', 'lopsided', 'blank-gap', 'no-title', 'small-title', 'many-h1', 'untitled-section', 'edge-text', 'ragged-edges', 'sidebar-phone', 'unused-canvas', 'heavy-shadow', 'heavy-borders', 'radius-mix', 'icon-chips', 'numeric-align', 'tabular', 'rainbow-chart', 'placeholder-data', 'tiny-text', 'colour-sprawl'];diff --git a/skills/taste-skill/scripts/lint.mjs b/skills/taste-skill/scripts/lint.mjsindex b0bdc7b..3d2ca71 100644--- a/skills/taste-skill/scripts/lint.mjs+++ b/skills/taste-skill/scripts/lint.mjs@@ -2,7 +2,7 @@// tasteskill / lint — static scan of source files for the tells this skill bans.// Catches them before a render, plus the ones a render cannot see (copy habits, motion values).//-// node lint.mjs [files or directories ...] [--json]+// node lint.mjs [files or directories ...] [--app] [--json]//// Exit code 1 when any FAIL is found. Zero dependencies.import { readFileSync, readdirSync, statSync } from 'node:fs';@@ -10,6 +10,11 @@ import { join, extname, relative, resolve } from 'node:path';const args = process.argv.slice(2);const asJson = args.includes('--json');+// App screens (references/app-screens.md) keep quiet table and panel lines, faint shadows, data labels+// and their own typefaces; a sheet dealt with draw.mjs --app switches this on by itself.+let appMode = args.includes('--app');+try { if (JSON.parse(readFileSync('.taste-skill/direction.json', 'utf8')).kind === 'app') appMode = true; } catch {}+const APP_LEVEL = { hairline: null, 'outlined-box': null, 'default-font': null, numbering: 'WARN', mono: 'WARN', shadow: 'WARN', eyebrow: 'WARN', 'cta-copy': null, 'h-screen': null };const roots = args.filter((a) => !a.startsWith('--'));if (!roots.length) roots.push('.');const EXT = new Set(['.html', '.htm', '.css', '.scss', '.less', '.js', '.jsx', '.ts', '.tsx', '.vue', '.svelte', '.astro', '.mdx']);@@ -54,6 +59,11 @@ const R = [['WARN', 'h-screen', /\bh-screen\b|height\s*:\s*100vh/, '100vh jumps on mobile. Use 100svh / 100dvh.'],['WARN', 'bounce', /animate-(bounce|ping|pulse)\b/, 'Looping attention animation (bounce / ping / pulse dot).'],];+if (appMode) {+ for (const r of R) if (r[1] in APP_LEVEL) r[0] = APP_LEVEL[r[1]];+ R.push(['FAIL', 'placeholder-data', /\b(John|Jane) Doe\b|\bAcme( Inc| Corp)?\b|\bexample\.com\b|\bFirstname Lastname\b|\b123 Main St\b/, 'Placeholder data. Use believable names, amounts that add up and real units for this product.']);+ R.push(['WARN', 'framework-colour', /#(3b82f6|2563eb|1d4ed8|60a5fa|10b981|22c55e|ef4444|f59e0b)\b/i, 'A framework default colour (Tailwind blue, green, red, amber). Take the accent and status colours from the dealt style.']);+}const findings = [];let emDashes = 0;@@ -73,6 +83,7 @@ for (const file of files) {if (/taste-skill-ignore/.test(line)) return;if (!/^\s*(\/\/|\/\*|\*|<!--)/.test(line)) emDashes += (line.replace(/\/\/.*$|\/\*.*?\*\/|<!--.*?-->/g, '').match(/—/g) || []).length; // comments are not copyfor (const [level, id, re, message] of R) {+ if (!level) continue;if (id === 'mono' && (codeLine || /(^|[\s,>+~(])(pre|code|kbd|samp)\b|code/i.test(selector))) continue; // real code may be monospaceif ((id === 'hairline' || id === 'outlined-box') && /(^|[\s,>+~(])(table|thead|tbody|tfoot|tr|td|th|input|textarea|select|fieldset)\b/i.test(selector)) continue; // real tables and form fields keep their linesif (inUi && (id === 'hairline' || id === 'outlined-box' || id === 'shadow')) continue;