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-2 fixes

Leonxlnx6947655a9ff2
diff --git a/skills/taste-skill/assets/app.css b/skills/taste-skill/assets/app.css
index 1c9be25..a95f3f7 100644
--- a/skills/taste-skill/assets/app.css
+++ b/skills/taste-skill/assets/app.css
@@ -154,3 +154,6 @@ td .sub { display: block; font-size: var(--fs-small); color: var(--muted); }
.title-row { flex-wrap: wrap; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; } }
+
+/* an empty message spans the block it stands in, never one squeezed column */
+.rows .empty, .grid > .empty, li > .empty { grid-column: 1 / -1; width: 100%; }
diff --git a/skills/taste-skill/assets/charts.js b/skills/taste-skill/assets/charts.js
index 353bd2a..4dd86f5 100644
--- a/skills/taste-skill/assets/charts.js
+++ b/skills/taste-skill/assets/charts.js
@@ -8,10 +8,11 @@
// 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
-// Charts.plan(el, [{ label: 'Groceries', planned: 600, spent: 412, committed: 60 }, …]) planned against spent
+// 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 takes step: true for a balance that only changes on given days
+// 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.
(() => {
const NS = 'http://www.w3.org/2000/svg';
@@ -72,24 +73,40 @@
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; }
}
}
- function line(el, { labels, series, format = fmt.int, height = 220, fill = false, min, step = false, annotations, reference }) {
+ function line(el, { labels, series, format = fmt.int, height = 220, fill = false, min, max, step = false, annotations, reference, today = null, endLabel = false }) {
el._fmt = format;
const draw = () => {
const { s, w, h } = frame(el, height);
const all = series.flatMap((x) => x.values.filter((v) => v != null)).concat([].concat(reference || []).map((r) => r.value));
- 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);
+ // max caps the range (a flat series with one spike): values above it are clipped and their peak labelled
+ const top = max ?? Math.max(...all);
+ const yt = ticks(min ?? Math.min(0, ...all), top, 4);
+ const lastVal = series[0].values.filter((v) => v != null).at(-1);
+ const padL = 12 + Math.max(...yt.map((v) => String(format(v)).length)) * 7, padB = 26, padT = 8, padR = endLabel ? 8 + String(format(lastVal)).length * 7 : 0;
+ const x = (i) => padL + (i * (w - padL - padR)) / 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 pts = sr.values.map((v, i) => (v == null ? null : [x(i), y(Math.min(v, yt.at(-1)))]));
// step: a balance that only changes on given days holds its value until the next one
const d = pts.reduce((acc, p, i) => (p ? acc + (acc && pts[i - 1] ? (step ? `L${p[0].toFixed(1)} ${pts[i - 1][1].toFixed(1)}L` : '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);
+ if (today == null) svg('path', { d, fill: 'none', stroke: col, 'stroke-width': 2, 'stroke-linejoin': 'round', 'stroke-linecap': 'round' }, g);
+ else {
+ // a forecast: the line after today is dashed, so a projection never reads as a fact
+ const cut = x(today), id = 'c' + k + Math.random().toString(36).slice(2, 8);
+ const defs = svg('defs', {}, g);
+ const a = svg('clipPath', { id: id + 'a' }, defs); svg('rect', { x: 0, y: 0, width: cut, height: h }, a);
+ const b = svg('clipPath', { id: id + 'b' }, defs); svg('rect', { x: cut, y: 0, width: w, height: h }, b);
+ svg('path', { d, fill: 'none', stroke: col, 'stroke-width': 2, 'stroke-linejoin': 'round', 'clip-path': 'url(#' + id + 'a)' }, g);
+ svg('path', { d, fill: 'none', stroke: col, 'stroke-width': 2, 'stroke-dasharray': '5 4', opacity: 0.8, 'clip-path': 'url(#' + id + 'b)' }, g);
+ if (k === 0) { svg('line', { x1: cut, x2: cut, y1: padT, y2: h - padB, stroke: css(el, '--axis-ink', '#6b6b6b'), 'stroke-width': 1, opacity: 0.4 }, g); const t = svg('text', { x: cut + 4, y: h - padB - 6, 'font-size': 11, fill: css(el, '--axis-ink', '#6b6b6b') }, g); t.textContent = 'Today'; }
+ }
+ // values clipped by max: label the peak where it leaves the plot
+ sr.values.forEach((v, i) => { if (v != null && v > yt.at(-1) && (i === 0 || sr.values[i - 1] == null || sr.values[i - 1] <= yt.at(-1))) { let j = i, peak = v; while (j < sr.values.length && sr.values[j] != null && sr.values[j] > yt.at(-1)) { peak = Math.max(peak, sr.values[j]); j++; } const t = svg('text', { x: x(i) + 4, y: padT + 10, 'font-size': 11, fill: col }, g); t.textContent = format(peak) + ' at ' + labels[i]; } });
+ if (endLabel && k === 0) { const li = sr.values.map((v, i) => (v == null ? -1 : i)).filter((i) => i >= 0).at(-1); const t = svg('text', { x: x(li) + 6, y: y(Math.min(sr.values[li], yt.at(-1))) + 4, 'font-size': 12, 'font-weight': 600, fill: css(el, '--ink', '#111') }, g); t.textContent = format(sr.values[li]); }
});
notes(g, el, { annotations, reference, x, y, padT, h, padB, w, padL });
// hover: a rule, a dot per series and a bare tooltip
@@ -136,18 +153,21 @@
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';
+ const valueCol = Math.max(...rows.map((r) => String(format(r.value)).length)) + 1;
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 li = document.createElement('li'); li.style.cssText = 'display:grid;grid-template-columns:minmax(0,1fr) ' + valueCol + 'ch;align-items:center;gap:12px';
+ const track = document.createElement('span'); track.style.cssText = 'position:relative;padding:10px 12px;border-radius:6px;isolation:isolate;min-width:0';
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);
+ track.append(bar); const a = document.createElement('span'); a.textContent = r.label; a.style.cssText = 'position:relative;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis'; track.append(a);
+ const b = document.createElement('span'); b.textContent = format(r.value); b.style.cssText = 'font-weight:500;text-align:right';
+ li.append(track, b); list.appendChild(li);
}
el.appendChild(list);
}
// Planned against spent: the track is the plan, the fill what is spent, a lighter segment what is
// already committed (bills to come), and an overrun past the track's end in the negative colour.
// One row per category: label and figures on one line, the 8px track under them.
- function plan(el, rows, { format = fmt.money('EUR', 0), note = (r) => r.spent > r.planned ? `${format(r.spent - r.planned)} over` : `${format(r.planned - r.spent - (r.committed || 0))} left` } = {}) {
+ function plan(el, rows, { format = fmt.money('EUR', 0), scale = 'row', note = (r) => r.spent > r.planned ? `${format(r.spent - r.planned)} over` : `${format(r.planned - r.spent - (r.committed || 0))} left` } = {}) {
el.innerHTML = '';
const list = document.createElement('ul'); list.style.cssText = 'list-style:none;margin:0;padding:0;display:grid;gap:14px;font-variant-numeric:tabular-nums';
const max = Math.max(...rows.map((r) => Math.max(r.planned, r.spent + (r.committed || 0))));
@@ -156,12 +176,14 @@
const li = document.createElement('li');
const top = document.createElement('div'); top.style.cssText = 'display:flex;justify-content:space-between;gap:12px;margin-bottom:6px';
top.innerHTML = `<span>${r.label}</span><span><b style="font-weight:500">${format(r.spent)}</b> <span style="color:var(--muted,#5f6368)">of ${format(r.planned)} · </span><span style="color:${over ? 'var(--negative,#c4242a)' : 'var(--muted,#5f6368)'}">${note(r)}</span></span>`;
- const track = document.createElement('div'); track.style.cssText = `position:relative;height:8px;border-radius:999px;background:var(--rule,#eceeef);width:${(r.planned / max) * 100}%;overflow:visible`;
+ // scale 'row': each track is full width and shows the share used (rows in a grid compare); 'plan': as long as its plan
+ const room = over ? 100 / (1 + Math.max(0.06, (r.spent - r.planned) / r.planned)) : 100;
+ const track = document.createElement('div'); track.style.cssText = 'position:relative;height:8px;border-radius:999px;background:var(--rule,#eceeef);overflow:visible;width:' + (scale === 'plan' ? (r.planned / max) * room : room) + '%';
const pct = (v) => (v / r.planned) * 100;
const spent = Math.min(r.spent, r.planned);
track.innerHTML = `<span style="position:absolute;inset:0 auto 0 0;width:${pct(spent)}%;border-radius:999px;background:var(--chart-1,#2f6fdf)"></span>`
+ (r.committed ? `<span style="position:absolute;top:0;bottom:0;left:${pct(spent)}%;width:${Math.min(pct(r.committed), 100 - pct(spent))}%;background:var(--chart-1,#2f6fdf);opacity:.35"></span>` : '')
- + (over ? `<span style="position:absolute;top:0;bottom:0;left:100%;width:${pct(r.spent - r.planned)}%;border-radius:0 999px 999px 0;background:var(--negative,#c4242a)"></span>` : '');
+ + (over ? `<span style="position:absolute;top:-3px;bottom:-3px;left:100%;width:1px;background:var(--text,#111)"></span><span style="position:absolute;top:0;bottom:0;left:calc(100% + 2px);width:max(12px, ${pct(r.spent - r.planned)}%);border-radius:0 999px 999px 0;background:var(--negative,#c4242a)"></span>` : '');
track.setAttribute('role', 'img'); track.setAttribute('aria-label', `${r.label}: ${format(r.spent)} of ${format(r.planned)}${r.committed ? `, ${format(r.committed)} committed` : ''}${over ? ', over plan' : ''}`);
li.append(top, track); list.appendChild(li);
}
diff --git a/skills/taste-skill/references/app-screens.md b/skills/taste-skill/references/app-screens.md
index e0024be..137a46b 100644
--- a/skills/taste-skill/references/app-screens.md
+++ b/skills/taste-skill/references/app-screens.md
@@ -127,14 +127,24 @@ Every screen answers one question first: "Did today's sales come in?", "Which de
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 is biggest.** In the study the largest block is always the one that carries the screen's
+ question, whatever form it takes (a chart, a plan, a ring, a list);
- **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 name the screen's **one finding**: the fact in today's data that most needs attention ("9 no-shows
+while 8 people waited for a place", "the 23:28 deploy doubled the error rate", "eating out is £36 over").
+Put it where it is read first, as the line under the title or the subline of the headline figure,
+next to the action it drives. In testing, the finding that mattered sat in a 14px caption at the
+bottom of a card and the screen read as flat.
+
+**Do not rebuild a studied screen.** When the product is of the same kind as a screen in the study (a
+finance home, a deploy overview), its arrangement is the trap: judges recognised the copies at once.
+Take the structure from the product's own things instead: for a couple's budget, Mia, Joint and Tom
+as three columns running through accounts, plan and bills; for a running club, the pace groups.
+
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.
@@ -367,7 +377,9 @@ fewer, runs to about 760px at 1440 and pairs with the next block; stretched to 1
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
+- **An optional second line**: one 14-16px grey sentence about the data or the object (the finding,
+ the period, the scope), never about the interface ("the filters narrow every block…", "this page
+ shows…" read as instructions, not a product), 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.
@@ -405,7 +417,14 @@ fewer, runs to about 760px at 1440 and pairs with the next block; stretched to 1
- **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
+- **The answer figure leads.** When one figure is the screen's answer (a balance, net worth, the
+ portfolio's value), it is 30-36px and at least 1.3 times its sibling figures (those at 18-24px). In
+ testing, a 24px portfolio value beside two 24px figures left the screen without a lead.
+- **One figure, one place.** A figure shown in the strip is not repeated in a legend beside it, and a
+ KPI strip whose every cell names a panel below (RSVPs, then an RSVPs panel) is dropped: lead each
+ panel with its own number instead.
+- **A second job.** KPIs may be the chart's series tabs (the selected one carries a 2px rule or the
+ active fill, the others a hover state; grey values with no marker read as disabled) or the list's
type filter (the selected card takes a 1.5px border).
### Deltas
@@ -443,6 +462,20 @@ fewer, runs to about 760px at 1440 and pairs with the next block; stretched to 1
| 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 |
+Three more, from testing:
+
+- **The pair of per-period bars and the running total is used once per screen**, and only when the
+ total crosses a line that matters (capacity, a target). Three such pairs in six charts read as one
+ pattern stamped out.
+- **A series that is flat except for one event** gets at most two-thirds of the width and about 140px of
+ height, or a range capped at about twice its reference line with the off-scale peak labelled
+ (`Charts.line({ max })`). A full-width plot that is 85% empty was the biggest block on a first
+ screen and was marked down.
+- **A forecast is not a fact**: after today the line is dashed and the end value is labelled
+ (`Charts.line({ today, endLabel })`), with the gap to the target bracketed when there is one.
+- **What the brief asks to see over time is drawn on the first screen.** KPI cells may switch the chart
+ only between metrics the brief did not name.
+
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".
@@ -492,7 +525,9 @@ to 5.2.
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
+- **Rings** only for three to five parts of a whole that are not already listed beside them (a ring
+ redrawing the spent, due and left figures of the tile next to it was marked redundant). 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"
@@ -553,7 +588,11 @@ to 5.2.
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.
+- **The identity column gets the most width**, about a third to a half of the table, and it is never
+ the one cut off at desktop width: shorten names editorially first (drop the issuer every row
+ shares, the share class, "Ltd") and use the same short name at every width.
+- **One right edge per row or card**: every right-aligned figure inside a card or row ends on the same
+ padding line (a days-in-stage figure 18px short of the value above it reads as a second edge).
- **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.
@@ -599,7 +638,9 @@ list so the text starts on one edge (a 50px slot with the text 16px after it). M
- **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. When a row needs doing
+- Row actions: none on 9 screens; otherwise one kebab at the far right. Reserve a trailing action
+ column only when most rows carry the action; otherwise the action is an ink text action on the
+ row's second line and the figures stay flush to the card edge. When a row needs doing
(a bill to pay, an order to pack, a failed deploy), its action is a visible ghost button or an ink
text action in one fixed trailing column, at the same pitch for every row; never muted grey text,
and never stacked under the amount so the rows change height.
@@ -845,7 +886,14 @@ td.num, th.num { text-align: right; }
"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
+- **Counts follow the view.** Counts shown in scope (tabs, KPI tiles, "12 open") are computed from
+ the rows in the current view or filter and recomputed on every switch.
+- **Red is a signal, not a texture**: one red mark per object at most, on the overdue or failing fact;
+ thirteen red strings on one board read as noise, and a list of deals needing attention does not
+ repeat the same flags on the board beside it.
+- **An empty section keeps its frame and its header** and adds one sentence spanning the block (in a
+ row grid, `grid-column: 1 / -1`; a message squeezed into one 34px column broke word by word in
+ testing): 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
diff --git a/skills/taste-skill/scripts/lib/rules.mjs b/skills/taste-skill/scripts/lib/rules.mjs
index 9882fa0..0dd6861 100644
--- a/skills/taste-skill/scripts/lib/rules.mjs
+++ b/skills/taste-skill/scripts/lib/rules.mjs
@@ -194,7 +194,7 @@ export function judgeLayout(L, { width = L.viewport.w, allow = [] } = {}) {
// 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 const APP_SKIP = new Set(['hero-words', 'eyebrow', 'mono', 'name-only-title', 'empty-middle', '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 = [];