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
Scroll scenes groundwork: shared stage, inspector film, corrected lag claim
Leonxlnx9305aab5d088
diff --git a/skills/taste-skill/assets/scenes/stage.css b/skills/taste-skill/assets/scenes/stage.cssnew file mode 100644index 0000000..190763d--- /dev/null+++ b/skills/taste-skill/assets/scenes/stage.css@@ -0,0 +1,28 @@+/* tasteskill / scenes / stage.css — the held stage under every scroll scene (references/scenes.md).+ Without .is-live (no script, a failed CDN, reduced motion, a phone set to 'rest') a scene is an ordinary+ section showing its finished composition. With it, the section is (hold + 1) screens tall and the+ stage sticks to the viewport for the hold. */++.scene { position: relative; }+.scene > .scene-stage { position: relative; }++html.js .scene.is-live { height: calc((var(--hold, 2) + 1) * 100svh); }+html.js .scene.is-live > .scene-stage {+ position: sticky;+ top: 0;+ height: 100svh;+ overflow: clip; /* clip, not hidden: hidden would make the stage a scroll container */+ contain: layout paint;+}++/* Everything a scene moves is composited; nothing it moves is laid out again. */+.scene.is-live [data-move] { will-change: transform, opacity; }++/* Lenis */+html.is-smooth { scroll-behavior: auto; }+html.is-smooth body { overscroll-behavior: none; }++@media (prefers-reduced-motion: reduce) {+ html.js .scene.is-live { height: auto; }+ html.js .scene.is-live > .scene-stage { position: relative; height: auto; }+}diff --git a/skills/taste-skill/assets/scenes/stage.js b/skills/taste-skill/assets/scenes/stage.jsnew file mode 100644index 0000000..fd7ba54--- /dev/null+++ b/skills/taste-skill/assets/scenes/stage.js@@ -0,0 +1,133 @@+// tasteskill / scenes / stage.js — the shared stage every scroll scene runs on (references/scenes.md).+//+// A scene is a tall section whose stage sticks to the viewport while the page scrolls past it; a GSAP+// timeline is scrubbed by that scroll. The page always scrolls natively (no wheel capture), the+// scrollbar always tells the truth, and the finished composition is what reduced motion, no script and+// a failed CDN all show.+//+// Load at the end of <body>, in this order (versions pinned):+// <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/gsap.min.js"></script>+// <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ScrollTrigger.min.js"></script>+// <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/SplitText.min.js"></script> (only if a scene splits text)+// <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/lenis.min.js"></script> (optional smoothing)+// <script src="assets/scenes/stage.js"></script>+// <script src="assets/scenes/<scene>.js"></script>+// and keep the one-line <script>document.documentElement.classList.add('js')</script> in <head>.+//+// Stage.smooth() weighted wheel scrolling (Lenis), off for touch and reduced motion+// Stage.scene(root, { hold, scrub, build, phone, rest })+// Stage.split(el, 'lines' | 'words' | 'chars') masked split text, SplitText when loaded+// Stage.ready() resolves when fonts and the scenes' pictures are ready+// Stage.init() starts every <section class="scene" data-scene="<id>"> on the page+//+// A page: Stage.smooth(); Stage.init();+(() => {+ const html = document.documentElement;+ const mq = (q) => window.matchMedia(q).matches;+ const live = !!(window.gsap && window.ScrollTrigger);+ if (live) gsap.registerPlugin(ScrollTrigger);+ if (live && window.SplitText) gsap.registerPlugin(SplitText);++ const Stage = {+ live,+ get reduced() { return mq('(prefers-reduced-motion: reduce)'); },+ get phone() { return mq('(max-width: 767px)'); },+ get touch() { return mq('(pointer: coarse)'); },+ lenis: null,+ scenes: [],+ };++ // Weighted wheel scrolling. lerp 0.1-0.14 feels heavy without lagging behind the hand; touch keeps the+ // phone's own scrolling, and reduced motion keeps the browser's.+ Stage.smooth = ({ lerp = 0.12 } = {}) => {+ if (!live || !window.Lenis || Stage.reduced || Stage.touch || Stage.lenis) return Stage.lenis;+ const lenis = new Lenis({ lerp, smoothWheel: true, anchors: true, autoRaf: false });+ lenis.on('scroll', ScrollTrigger.update);+ gsap.ticker.add((t) => lenis.raf(t * 1000));+ gsap.ticker.lagSmoothing(0);+ html.classList.add('is-smooth');+ Stage.lenis = lenis;+ return lenis;+ };++ // One scroll scene.+ // root <section class="scene"> holding one <div class="scene-stage">+ // hold screens of scroll the stage is held for (1-4); the section is (hold + 1) screens tall+ // scrub true = locked to the scrollbar; a number = seconds of catch-up (0.3-0.8 reads as weight)+ // build(tl, ctx) add the tweens to tl; the timeline runs 0 → 1 over the hold. ctx: { root, stage, phone, q }+ // phone 'same' (default) | 'rest' (the phone gets the finished composition) | { hold, build }+ // rest(ctx) optional: anything extra the finished composition needs (most scenes need nothing)+ // Sets --p (0-1) and data-beat on root, so CSS and captions can follow the scene too.+ Stage.scene = (root, opts = {}) => {+ if (!root) return null;+ const { hold = 2, scrub = true, build, phone = 'same', rest, beats = 0 } = opts;+ const stage = root.querySelector(':scope > .scene-stage') || root.firstElementChild;+ const q = (sel) => [...root.querySelectorAll(sel)];+ const toRest = (ctx) => { root.classList.remove('is-live'); root.classList.add('is-rest'); root.style.removeProperty('--hold'); if (rest) rest(ctx); };+ if (!live) { toRest({ root, stage, phone: Stage.phone, q }); return null; }+ const mm = gsap.matchMedia();+ mm.add({ motion: '(prefers-reduced-motion: no-preference)', phone: '(max-width: 767px)' }, (c) => {+ const isPhone = c.conditions.phone;+ const ctx = { root, stage, phone: isPhone, q };+ const plan = isPhone ? (phone === 'rest' ? null : phone === 'same' ? { hold, build } : { hold: phone.hold ?? hold, build: phone.build ?? build }) : { hold, build };+ if (!c.conditions.motion || !plan || !plan.build) { toRest(ctx); return () => root.classList.remove('is-rest'); }+ root.classList.remove('is-rest');+ root.classList.add('is-live');+ root.style.setProperty('--hold', plan.hold);+ const tl = gsap.timeline({+ defaults: { ease: 'none' },+ scrollTrigger: {+ trigger: root, start: 'top top', end: 'bottom bottom', scrub, invalidateOnRefresh: true,+ onUpdate: (self) => {+ root.style.setProperty('--p', self.progress.toFixed(4));+ if (beats) root.dataset.beat = String(Math.min(beats - 1, Math.floor(self.progress * beats)));+ },+ },+ });+ plan.build(tl, ctx);+ // pad the timeline to exactly 1 so positions in build() read as fractions of the hold+ if (tl.duration() < 1) tl.to({}, { duration: 1 - tl.duration() }, tl.duration());+ return () => { root.classList.remove('is-live'); root.style.removeProperty('--hold'); root.style.removeProperty('--p'); };+ });+ Stage.scenes.push(mm);+ return mm;+ };++ // Masked split text. Lines rise out of their own mask; words and characters are for short headings.+ Stage.split = (el, type = 'lines') => {+ if (!el) return [];+ if (window.SplitText && live) {+ const s = SplitText.create(el, { type: type === 'lines' ? 'lines' : type === 'words' ? 'lines,words' : 'lines,words,chars', mask: 'lines', aria: 'auto', autoSplit: false });+ return type === 'lines' ? s.lines : type === 'words' ? s.words : s.chars;+ }+ // fallback: words in inline-block spans, the full text kept for screen readers+ if (!el.dataset.split) {+ el.setAttribute('aria-label', el.textContent.trim());+ el.innerHTML = el.textContent.trim().split(/\s+/).map((w) => `<span aria-hidden="true" style="display:inline-block">${w}</span>`).join(' ');+ el.dataset.split = 'words';+ }+ return [...el.children];+ };++ // Fonts and the scenes' pictures decide every height a trigger measures; refresh once they are in.+ Stage.ready = () => {+ const imgs = [...document.querySelectorAll('.scene img')].map((i) => (i.complete ? null : i.decode().catch(() => {}))).filter(Boolean);+ return Promise.all([document.fonts ? document.fonts.ready : null, ...imgs]).then(() => { if (live) ScrollTrigger.refresh(); });+ };++ // Every <section class="scene" data-scene="<id>" data-options='{"hold":3}'> on the page, started by+ // the scene file of that id (assets/scenes/<id>.js registers Scenes['<id>']).+ Stage.init = () => {+ for (const el of document.querySelectorAll('.scene[data-scene]')) {+ if (el.__scene) continue;+ const make = window.Scenes[el.dataset.scene];+ if (!make) { console.warn('No scene file loaded for data-scene="' + el.dataset.scene + '"'); continue; }+ let o = {}; try { o = JSON.parse(el.dataset.options || '{}'); } catch {}+ el.__scene = make(el, o) || true;+ }+ };++ window.Scenes = window.Scenes || {};+ window.Stage = Stage;+ if (live) { window.addEventListener('load', () => Stage.ready()); }+})();diff --git a/skills/taste-skill/references/motion.md b/skills/taste-skill/references/motion.mdindex 37702f4..b4fee03 100644--- a/skills/taste-skill/references/motion.md+++ b/skills/taste-skill/references/motion.md@@ -904,10 +904,9 @@ Seen in the study, with how often, and what the house does instead.does nothing).** The visitor cannot tell where they are, how much is left or how to get out, and thekeyboard and screen readers get nothing. Usability 6.01 against 6.50 for pages that scroll. House:native scroll; any scene is driven by scroll position on a sticky stage that ends, with a count.-- **Smooth-scroll libraries (67 of 99).** They make every scrubbed scene possible and every page lag- behind the hand: in the study's capture, frames taken 160 ms after a wheel step came back empty where- the settled frame was full on 52 of the 67, against 4 of the 32 without a library. House: native- scroll.+- **Smooth-scroll libraries (67 of 99).** They make the scrubbed scenes feel weighted, and they also+ put a delay between the hand and the page; with a long ease the page keeps sliding after the wheel+ stops.- **Custom cursors (28 of 99).** Followers, image trails, a lens that smears the headline it sits on,labels that only exist on hover; 10 of the 28 have any reduced-motion rule. House: the system cursor;labels are on the page.diff --git a/skills/taste-skill/references/research.md b/skills/taste-skill/references/research.mdindex f749b49..c38364a 100644--- a/skills/taste-skill/references/research.md+++ b/skills/taste-skill/references/research.md@@ -315,8 +315,9 @@ the frame (margins, balance, empty space, titles). About three in four of thesethe first study.- **Capture.** Headless Chrome at 1440×900 and 390×844 on 18 October 2026: four frames of the first- 4.5 seconds after load, every screen while scrolling with real wheel input (a frame 160ms after each- step and one at rest), five phone screens, and a measurement pass in the page: every picture and+ 4.5 seconds after load, every screen while scrolling with real wheel input (one frame at rest per+ step; the mid-step frames were cut from the top of the document instead of the viewport, so they+ were not used), five phone screens, and a measurement pass in the page: every picture andclip with its box, ratio, fit and corners; every section's content edges and pictures; blank runs;the CSS that loaded (curves, durations, keyframes, breakpoints, feature counts); the animations,transitions and script-driven moves that actually ran; GSAP tweens and scroll triggers where thediff --git a/skills/taste-skill/scripts/inspect.mjs b/skills/taste-skill/scripts/inspect.mjsindex eac56ca..07d7ff2 100644--- a/skills/taste-skill/scripts/inspect.mjs+++ b/skills/taste-skill/scripts/inspect.mjs@@ -1,7 +1,11 @@#!/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] [--app] [--json]+// node inspect.mjs <url | path/to/file.html> [--out DIR] [--widths 1440,768,390] [--allow rule,rule] [--app] [--film] [--json]+//+// --film also photographs the scroll as a visitor sees it (a frame every third of a screen, real wheel+// input) into desktop-film-NN.jpg, so a scroll scene is judged by its in-between states. A direction+// that dealt scroll scenes switches it on by itself.//// --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.@@ -23,15 +27,16 @@ const widths = flag('widths', '1440,768,390').split(',').map(Number).filter(Boollet allow = flag('allow', '').split(',').filter(Boolean);const asJson = has('json');let appMode = has('app');+let film = has('film');let dealtFonts = []; // the faces the saved sheet dealt, to catch a build that quietly fell back to a defaultconst 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]');+ console.error('usage: node inspect.mjs <url | file.html> [--out DIR] [--widths 1440,768,390] [--allow rule,rule] [--app] [--film] [--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 { 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; }+ if (existsSync(p)) { try { const d = JSON.parse(readFileSync(p, 'utf8')); allow = [...new Set([...allow, ...(d.allow || [])])]; if (d.kind === 'app') appMode = true; if (Array.isArray(d.scenes) && d.scenes.length) film = 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@@ -60,7 +65,7 @@ const name = (w) => (w >= 1100 ? 'desktop' : w >= 600 ? 'tablet' : 'mobile');mkdirSync(outDir, { recursive: true });// Screenshots from an earlier run would sit beside the new ones when the page got shorter.-for (const f of readdirSync(outDir)) if (/^(desktop|tablet|mobile)-(fold|page-\d+)\.jpg$/.test(f)) unlinkSync(join(outDir, f));+for (const f of readdirSync(outDir)) if (/^(desktop|tablet|mobile)-(fold|page-\d+|film-\d+)\.jpg$/.test(f)) unlinkSync(join(outDir, f));const browser = await Browser.launch();const helper = await browser.newPage({ width: 1600, height: 1000 });const report = { url: server ? target : url, at: new Date().toISOString(), allow, viewports: [], findings: [], images: [] };@@ -145,6 +150,28 @@ try {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);+ // --film: the scroll as a visitor sees it. Real wheel input and a frame every third of a screen, so a+ // scroll scene shows its in-between states, not only where each screen lands.+ const filmSheets = [];+ if (film && w >= 1100) {+ await page.eval(`window.scrollTo({ top: 0, behavior: 'instant' })`).catch(() => {});+ await sleep(700);+ const shots = []; let lastY = -1, still = 0;+ for (let i = 0; i < 96; i++) {+ shots.push(await page.screenshot({ quality: 70 }));+ await page.wheel(Math.round(h / 3), { step: 100, pauseMs: 16 });+ await sleep(420);+ const y = await page.eval('Math.round(scrollY || document.scrollingElement.scrollTop || 0)').catch(() => -1);+ if (y === lastY) { if (++still >= 2) break; } else still = 0;+ lastY = y;+ }+ for (let i = 0; i < shots.length; i += 24) {+ const p = join(outDir, `${label}-film-${String(i / 24 + 1).padStart(2, '0')}.jpg`);+ await sheet(shots.slice(i, i + 24), 6, 320, 200, p);+ filmSheets.push(p);+ }+ }+const cols = w >= 1100 ? 2 : w >= 600 ? 3 : 4;const cellW = w >= 1100 ? 800 : w >= 600 ? 512 : 390;const cellH = Math.round((cellW * h) / w);@@ -191,7 +218,7 @@ try {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, 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 });+ report.images.push({ viewport: label, width: w, fold, pages: sheets, film: filmSheets });await page.close();}// Under prefers-reduced-motion the page is the finished page: nothing may stay hidden waiting for an@@ -256,7 +283,7 @@ for (const [title, list] of [['FAIL — fix every one of these', fails], ['WARN}line('LOOK AT THE RENDER — open these with your image viewer / Read tool before saying anything about quality:');const rel = (p) => relative(process.cwd(), p).split('\\').join('/');-for (const im of report.images) { line(` ${(im.viewport + ' ' + im.width + 'px').padEnd(15)} ${rel(im.fold)}`); for (const p of im.pages) line(` ${''.padEnd(15)} ${rel(p)}`); }+for (const im of report.images) { line(` ${(im.viewport + ' ' + im.width + 'px').padEnd(15)} ${rel(im.fold)}`); for (const p of im.pages) line(` ${''.padEnd(15)} ${rel(p)}`); for (const p of im.film || []) line(` ${'scroll film'.padEnd(15)} ${rel(p)} (6 frames a row, a third of a screen apart)`); }line('');line(`report: ${rel(join(outDir, 'report.json'))}`);line(fails.length ? `RESULT: ${fails.length} FAIL, ${warns.length} WARN — not done.` : `RESULT: 0 FAIL, ${warns.length} WARN — measurements pass. Passing the meter is the floor, not the grade: score the screenshots with references/critique.md.`);