Skip to content

Agent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages

v2.1 (wip): app screens round-3 fixes

Leonxlnxe080b0ad8a85
diff --git a/skills/taste-skill/assets/charts.js b/skills/taste-skill/assets/charts.js
index 4dd86f5..218c2a3 100644
--- a/skills/taste-skill/assets/charts.js
+++ b/skills/taste-skill/assets/charts.js
@@ -10,7 +10,8 @@
// Charts.barList(el, [{ label: 'Berlin', value: 412 }, …], { format }) a ranked list where the row is the bar
// Charts.plan(el, [{ label: 'Groceries', planned: 600, spent: 412, committed: 60 }, …], { scale: 'row' | 'plan' }) planned against spent
// Charts.bullet(el, [{ label: 'Bonds', value: 0.31, target: 0.25 }, …]) share against a target
-// line/bars also take annotations: [{ at: index, label: 'Deploy a3f09c1' }] and reference: { value, label }
+// line/bars also take annotations: [{ at: index, label: 'Deploy a3f09c1' }] or spans [{ from, to, label: 'Cloud' }],
+// and reference: { value, label, at: 'left' | 'right' } (put the label where no series passes)
// line takes step: true for a balance that only changes on given days; today: index (the forecast after it is dashed);
// endLabel: true (the last value at the line's end); max: caps a flat series with one spike (the peak is labelled)
// Every chart gets role="img" and an aria-label that states what it shows.
@@ -48,7 +49,7 @@
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 }) {
+ function axes(g, { w, h, padL, padB, padT, yt, y, xLabels, x, el, band = false }) {
const grid = css(el, '--grid', '#e8e8e8'), ink = css(el, '--axis-ink', '#6b6b6b');
for (const v of yt) {
const yy = y(v);
@@ -56,13 +57,18 @@
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; });
+ 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': band ? 'middle' : i === 0 ? 'start' : i === n - 1 ? 'end' : 'middle', 'font-size': 12, fill: ink }, g); t.textContent = lab; });
}
// Marks that explain the data: a 1px tick with a short label at an index (a deploy, a campaign), and a
// dashed reference line with its label at the right end (a budget, an SLO, a start time).
function notes(g, el, { annotations = [], reference = null, x, y, padT, h, padB, w, padL }) {
const ink = css(el, '--axis-ink', '#6b6b6b');
- for (const a of annotations) {
+ for (const a of annotations.filter((a) => a.from != null)) {
+ const x0 = x(a.from), x1 = x(a.to);
+ svg('rect', { x: Math.min(x0, x1), y: padT, width: Math.abs(x1 - x0), height: h - padT - padB, fill: ink, opacity: 0.07 }, g);
+ if (a.label) { const t = svg('text', { x: (x0 + x1) / 2, y: padT + 10, 'text-anchor': 'middle', 'font-size': 11, fill: ink }, g); t.textContent = a.label; }
+ }
+ for (const a of annotations.filter((a) => a.at != null)) {
const xx = x(a.at);
svg('line', { x1: xx, x2: xx, y1: padT, y2: h - padB, stroke: ink, 'stroke-width': 1, opacity: 0.45, 'shape-rendering': 'crispEdges' }, g);
if (a.label) { const t = svg('text', { x: xx + 4, y: padT + 10, 'font-size': 11, fill: ink }, g); t.textContent = a.label; }
@@ -70,7 +76,7 @@
for (const r of [].concat(reference || [])) {
const yy = y(r.value);
svg('line', { x1: padL, x2: w, y1: yy, y2: yy, stroke: ink, 'stroke-width': 1, 'stroke-dasharray': '4 4', opacity: 0.7 }, g);
- if (r.label) { const t = svg('text', { x: w, y: yy - 5, 'text-anchor': 'end', 'font-size': 11, fill: ink }, g); t.textContent = r.label; }
+ if (r.label) { const left = r.at === 'left'; const t = svg('text', { x: left ? padL + 4 : w, y: yy - 5, 'text-anchor': left ? 'start' : 'end', 'font-size': 11, fill: ink }, g); t.textContent = r.label; }
}
}
function line(el, { labels, series, format = fmt.int, height = 220, fill = false, min, max, step = false, annotations, reference, today = null, endLabel = false }) {
@@ -130,7 +136,7 @@
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 });
+ axes(g, { w, h, padL, padB, padT, yt, y, xLabels: labels, x, el, band: true });
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)}`; });
notes(g, el, { annotations, reference, x, y, padT, h, padB, w, padL });
diff --git a/skills/taste-skill/library/app.json b/skills/taste-skill/library/app.json
index 281738b..a1347ef 100644
--- a/skills/taste-skill/library/app.json
+++ b/skills/taste-skill/library/app.json
@@ -88,13 +88,14 @@
"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.",
+ "signature": "No brand colour anywhere in the chrome: the one primary action is near-black (a grey pill, #e5e5e5, is the secondary), 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)"
+ "a chart with no y-scale (the study's one example of this look hid magnitude behind hover and was flagged)",
+ "a grey pill as the only button for the screen's main job: in testing an Approve repeated in grey on every row left the screen without a primary"
]
},
{
@@ -313,13 +314,13 @@
"control": "#d9d9d6",
"text": "#1f201d",
"muted": "#636361",
- "accent": "#d32420",
+ "accent": "#1b6e66",
"positive": "#2e7d32",
- "negative": "#1f201d",
+ "negative": "#b42318",
"warning": "#92400e",
"chart": [
"#1f201d",
- "#d32420",
+ "#1b6e66",
"#8c8c88"
],
"pills": {
@@ -328,8 +329,8 @@
"#04250e"
],
"negative": [
- "#f3f3f3",
- "#1f201d"
+ "#fdecea",
+ "#7a1d14"
],
"warning": [
"#fffbeb",
@@ -378,12 +379,10 @@
"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)",
"a tray around every card (a grey panel with a white card 6px inside it, on every block, read as a bento template in testing)",
- "the red accent on a growth line: in an analytics view red reads as loss, so the series is drawn in ink and the red marks one highlighted point or the latest bar"
+ "red as the accent: in testing red marked a record week of upgrades and read as an alarm; red is for the failing fact only"
],
- "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."
+ "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. After testing, the studied red accent was replaced by a deep teal: red on good news read as an alarm."
},
{
"id": "pastel-consumer",
@@ -413,8 +412,8 @@
"warning": "#92400e",
"chart": [
"#1d5fd6",
- "#2a8798",
- "#3f8f60"
+ "#b45309",
+ "#2a8798"
],
"pills": {
"positive": [
@@ -471,13 +470,14 @@
"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.",
+ "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. Tints go on small tiles, avatars and chips; a panel that holds a list stays white. When the product has people (two partners, a family), each gets one hue, at least 60 degrees from the next.",
"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"
+ "a KPI strip on top: the sums belong in their cards",
+ "whole panels tinted per person or category beside white cards (two surface languages on one screen)"
],
"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."
},
diff --git a/skills/taste-skill/references/app-screens.md b/skills/taste-skill/references/app-screens.md
index 137a46b..37f25b5 100644
--- a/skills/taste-skill/references/app-screens.md
+++ b/skills/taste-skill/references/app-screens.md
@@ -53,6 +53,29 @@ the same every time, and each is now a rule below:
Quiet is the starting point, not the goal. A screen that a person would trust shows more of the
product than a template does: its people, its objects, its numbers and the one thing to do next.
+**Give the product a face.** After three rounds the judges' last complaint was the same on most
+screens: "a well-applied kit, not a product with its own identity". The style's tokens make a screen
+correct; these make it this product's:
+
+- **The dealt typeface, really loaded.** A build that fell back to the default face landed on the
+ default look; the inspector now fails it.
+- **The product's mark and name** at the top of the shell, drawn for this product (a simple
+ monogram or symbol in the accent, from its name or its object), never a black square with a letter.
+- **One element only this product has**, built from its own things: the pace groups of a running
+ club as a unit chart, the couple as three lanes, a deploy's commit as the hero of the overview, the
+ family's car on tonight's charging window. Name it in your notes next to the screen's question.
+- **Its people and objects as themselves**: each person gets a stable initial and hue (at least 60
+ degrees from the next), products show their thumbnails, cover art shows the cover.
+- **Words of the trade** in labels and empty states ("Waiting on the customer", "Off sick", "Due
+ on the 28th"), never the generic noun of a template ("Items", "Records", "Status").
+
+**Calendars and timelines** (house rule, from testing; the study has none). People down the left on a
+fixed 160-220px column, days across with today marked by a 1px accent line and weekends one tone
+step darker; bars 20-24px tall on a 32-40px row pitch with radius 4; routine bookings in a pale
+neutral fill with ink text, the kind of leave or work told apart by a 3px left edge in its hue or a
+glyph, and colour at full strength only for what needs a decision (a request breaking cover). Every
+colour drawn is in the legend.
+
## Contents
1. When this applies
diff --git a/skills/taste-skill/scripts/inspect.mjs b/skills/taste-skill/scripts/inspect.mjs
index 35ac7f1..eac56ca 100644
--- a/skills/taste-skill/scripts/inspect.mjs
+++ b/skills/taste-skill/scripts/inspect.mjs
@@ -23,6 +23,7 @@ const widths = flag('widths', '1440,768,390').split(',').map(Number).filter(Bool
let allow = flag('allow', '').split(',').filter(Boolean);
const asJson = has('json');
let appMode = has('app');
+let dealtFonts = []; // the faces the saved sheet dealt, to catch a build that quietly fell back to a default
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] [--app] [--json]');
@@ -30,7 +31,7 @@ if (!target || target === '-h' || target.startsWith('--')) {
}
// 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 { const d = JSON.parse(readFileSync(p, 'utf8')); allow = [...new Set([...allow, ...(d.allow || [])])]; if (d.kind === 'app') appMode = true; } 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; dealtFonts = d.kind === 'app' ? [d.style?.tokens?.font?.family].filter(Boolean) : (d.input?.keep || []).includes('type') ? [] : [d.type?.display?.family, d.type?.text?.family].filter(Boolean); } 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
@@ -155,6 +156,12 @@ try {
sheets.push(p);
}
let findings = judge(m, { width: w, allow });
+ if (dealtFonts.length && w >= 1100 && !allow.includes('font-not-dealt')) {
+ const norm = (f) => String(f).toLowerCase().replace(/["']/g, '').replace(/\s+variable$/, '').trim();
+ const used = m.type.families.filter((f) => f.share >= 0.1).map((f) => norm(f.family));
+ const missing = dealtFonts.filter((f) => !used.some((u) => u === norm(f) || u.startsWith(norm(f))));
+ if (missing.length === dealtFonts.length) findings.push({ level: appMode ? 'FAIL' : 'WARN', id: 'font-not-dealt', width: w, message: `The sheet dealt ${dealtFonts.join(' and ')}, but the page renders ${m.type.families.slice(0, 2).map((f) => f.family).join(', ')}.`, fix: 'Load the dealt face (the link on the sheet) and put it first in font-family. A build that falls back to a default face lands on the default look.' });
+ }
// a third of the studied award pages were still unreadable 4.5s after load; the house sequence is over by 1.2s
if (!appMode && early && early.found && !early.visible && !allow.includes('late-title')) findings.push({ level: 'FAIL', id: 'late-title', width: w, message: `The title is not readable 1.2s after the page loaded (${early.why}).`, fix: 'Put the headline in the HTML, painted on the first frame; the load sequence only adds arrival and is settled by 1.2s (references/motion.md, "Load sequence in 1.2 seconds"). No preloader, no gate, no waiting for the load event.' });
if (lay) findings.push(...judgeLayout(lay, { width: w, allow }));
diff --git a/skills/taste-skill/scripts/lib/app-draw.mjs b/skills/taste-skill/scripts/lib/app-draw.mjs
index 3cb1e4e..279f4d3 100644
--- a/skills/taste-skill/scripts/lib/app-draw.mjs
+++ b/skills/taste-skill/scripts/lib/app-draw.mjs
@@ -72,8 +72,9 @@ function dealShell(style, input, exclude = []) {
}
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;
+ // a pattern written for another kind of product brings that product's furniture with it (a getting-started strip on a
+ // leave planner): when none fits this kind, the sheet says to compose the screen from the chapter instead
+ pool = pool.filter((p) => !p.kinds || p.kinds.includes(input.kind));
return pool.length ? pick(pool) : null;
}
function deal(input) {
diff --git a/skills/taste-skill/scripts/lib/rules.mjs b/skills/taste-skill/scripts/lib/rules.mjs
index f463457..3cd2d79 100644
--- a/skills/taste-skill/scripts/lib/rules.mjs
+++ b/skills/taste-skill/scripts/lib/rules.mjs
@@ -233,4 +233,4 @@ export function judgeApp(A, m, { width = A.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', 'off-centre', 'lopsided', 'blank-gap', 'no-title', 'small-title', 'many-h1', 'name-only-title', 'empty-middle', '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', 'ragged-row', 'below-fold', 'app-title-size', 'kpi-size', 'icon-tiles', 'late-title', 'reduced-hidden', 'no-poster', 'hero-void', 'one-sided-bleed'];
+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', 'name-only-title', 'empty-middle', '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', 'ragged-row', 'below-fold', 'app-title-size', 'kpi-size', 'icon-tiles', 'late-title', 'reduced-hidden', 'no-poster', 'hero-void', 'one-sided-bleed', 'font-not-dealt'];