Anti-AI-slop design skill for Claude Code, Cursor, and Codex.
CSS
Hallmark 2.0.0: the release version, a security pass on the scripts, a line-break check and a cleaner landing page
Youssef45d70b3fea5e
diff --git a/.gitignore b/.gitignoreindex 288b619..faea584 100644--- a/.gitignore+++ b/.gitignore@@ -35,36 +35,13 @@ build/# Runtime state from Hallmark's own runs (per-project log, never publish).hallmark/-# `skills` CLI install lockfile — generated whenever 'skills add' runs in this+# `skills` CLI install lockfile: generated whenever 'skills add' runs in this# directory, not part of the skill source.skills-lock.json.agents/-# Local agent / preview tooling config (Claude Code, etc.) — not skill source+# Local agent / preview tooling config (Claude Code, etc.), not skill source.claude/-# Launch-day comparison artifacts — one-off, not referenced from the marketing-# site or README. Kept locally if useful.-site/_launch-comparison/--# Local example explorations — kept on disk, never published. The landing-# carousel links only the featured builds (carnival-01, cobalt-01, custom-01–05,-# hum-07, lumen-01); those stay tracked. Everything below is scratch: extra-# generations, the private gallery/worked indexes, and component demos.-site/examples/index.html-site/examples/worked.html-site/examples/lumen-index.html-site/examples/_diagnostic.html-site/examples/nav-demo/-site/examples/hum-buttons/-site/examples/gallery-0[12]/-site/examples/carnival-0[2-9]/-site/examples/cobalt-02/-site/examples/hum-01/-site/examples/hum-02/-site/examples/hum-0[3-8]/-!site/examples/hum-07/+# Local leftover from the old test thumbnails, never published.site/_tests/_thumbs/hum-02.jpg--site/examples/lumen-0[2-4]/-diff --git a/README.md b/README.mdindex 2049c39..6cd889d 100644--- a/README.md+++ b/README.md@@ -2,7 +2,7 @@**A design skill for Claude Code, Codex CLI and OpenCode that refuses to look AI-generated.**-[Live demo](https://www.usehallmark.com) · forty-eight themes, dealt three at a time · a custom world on request · press `T` to cycle.+[usehallmark.com](https://www.usehallmark.com) · forty-eight themes · custom on request · redesign and audit by nameMade by Together AI.@@ -16,6 +16,15 @@ The gates come in tiers. The **Floor** never ships: contrast, focus, reduced motTwo pages by Hallmark for two different briefs feel like different sites, not colour-swaps of the same template. The skill is built to stop a model looking generic, not to stop it being good.+## New in v2++- **Forty-eight themes.** Each is a material (paper, type, colour, surfaces, a way with photographs) with a picture of a finished page, and the build lays out its own page in it.+- **Custom.** Ask for a custom page and Hallmark designs from your brief alone, under the same rules and checks.+- **Your real product.** Point it at a URL, a dev server or an app folder and it runs the product and captures the screenshots itself.+- **Real photographs.** A library of 755 openly licensed photos, picked per subject, treated in the theme's way and credited on the page.+- **Redesign and audit.** `/hallmark redesign <path>` rebuilds an existing page and keeps its content and wiring; `/hallmark audit <path>` only reports.+- **A linter that looks.** `sloplint --render` opens the page at eight widths and measures the fold, contrast, spacing, photo balance and line breaks.+---## What a build looks likediff --git a/eval/briefs.json b/eval/briefs.jsonindex b50558a..4ad2799 100644--- a/eval/briefs.json+++ b/eval/briefs.json@@ -295,5 +295,32 @@"scope": "page","notes": "Opus 5.5 at medium effort; the product exists and should be captured, not mocked."}+ },+ {+ "id": "b33",+ "name": "custom",+ "brief": "Make me a custom landing page for a late-night ramen counter.",+ "expect": {+ "scope": "page",+ "notes": "Custom route, small prompt, Opus 5.5 at medium effort."+ }+ },+ {+ "id": "b34",+ "name": "custom",+ "brief": "Custom site for a small type foundry.",+ "expect": {+ "scope": "page",+ "notes": "Custom route, small prompt, Opus 5.5 at medium effort."+ }+ },+ {+ "id": "b35",+ "name": "custom",+ "brief": "A custom landing page for a habit tracker app.",+ "expect": {+ "scope": "page",+ "notes": "Custom route, small prompt, Opus 5.5 at medium effort."+ }}]diff --git a/package.json b/package.jsonindex c674504..b08dd19 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "hallmark",- "version": "2.8.0",+ "version": "2.0.0","description": "A design skill for AI coding assistants. Makes the UIs they generate look made, not generated. Powered by Together AI.","keywords": ["claude",diff --git a/site/index.html b/site/index.htmlindex 5146c8f..2d8afee 100644--- a/site/index.html+++ b/site/index.html@@ -48,7 +48,7 @@<div class="wrap hero__copy"><h1 id="hero-title" class="hl" data-hl aria-label="The design skill that ends AI slop."><span class="hl__w hl__the">The</span> <span class="hl__w">design</span> <span class="hl__w">skill</span> <span class="hl__w">that</span> <span class="hl__w">ends</span> <span class="hl__w">AI slop.</span></h1><script>/* the head opens on "A design skill" where there is motion to show the edit (js/headline.js) */(function(){var h=document.querySelector("[data-hl]");if(!h||!h.animate||matchMedia("(prefers-reduced-motion: reduce)").matches)return;var a=document.createElement("span");a.className="hl__w hl__a";a.textContent="A";a.setAttribute("aria-hidden","true");h.querySelector(".hl__the").before(a);h.classList.add("is-a")})();</script>- <p class="hero__sub">For Claude Code, Codex and OpenCode, in one line.</p>+ <p class="hero__sub">Works in Claude Code, Codex and OpenCode. One line to install.</p><div class="install" data-copy-root><span class="install__caret" aria-hidden="true">$</span><code class="install__cmd" data-copy-text>npx skills add nutlope/hallmark</code>@@ -75,8 +75,8 @@<section class="sec" id="compare" aria-labelledby="cmp-title"><div class="wrap"><div class="head">- <h2 id="cmp-title">Same prompt. Same model.</h2>- <p class="head__sub">Opus 5.5 on low effort, one prompt, no edits. Left without Hallmark, right with.</p>+ <h2 id="cmp-title">One prompt, built twice</h2>+ <p class="head__sub">Opus 5.5 on low effort, no edits. On the left the model alone, on the right the model with Hallmark.</p></div><div class="cmp-tabs" role="tablist" aria-label="Prompts" data-cmp-tabs><button class="pill" role="tab" type="button" aria-selected="true" aria-controls="cmp-stage" data-pair="0">Bakery</button>@@ -102,7 +102,7 @@</div></div></div>- <p class="cmp-note" data-cmp-note>Issues are failures in Hallmark’s own linter. Keep scrolling to read both pages; drag the line to compare.</p>+ <p class="cmp-note" data-cmp-note>The issue counts come from Hallmark’s linter. Scroll to read both pages, or drag the line.</p><script type="application/json" data-cmp-data>[{"id":"b17","label":"Bakery","bareH":2770,"hmH":4254,"bare":17,"hm":0},{"id":"b14","label":"Rooftop cinema","bareH":3887,"hmH":3796,"bare":24,"hm":0},{"id":"b16","label":"Climbing gym","bareH":2863,"hmH":3361,"bare":7,"hm":0},{"id":"b15","label":"Meeting notes app","bareH":4399,"hmH":4299,"bare":18,"hm":0}]</script></div></section>@@ -110,7 +110,7 @@<section class="sec" id="how" aria-labelledby="how-title"><div class="wrap"><div class="head">- <h2 id="how-title">It designs before it codes.</h2>+ <h2 id="how-title">It designs before it codes</h2><p class="head__sub">What happens between your sentence and the page.</p></div><ol class="how" data-how>@@ -124,7 +124,7 @@</ul></div><h3>Asks for your material</h3>- <p>Your photos, facts and words. Nothing invented.</p>+ <p>Your photos, real numbers, screenshots of your app. It never makes them up.</p></li><li class="how__step"><div class="how__art how__art--deal" aria-hidden="true">@@ -134,7 +134,7 @@<span class="deal__tag">Hedgerow</span></div><h3>Deals one of 48 themes</h3>- <p>Paper, type, colour and photography that fit the brief.</p>+ <p>It picks three that fit your brief. Say custom and it designs from scratch.</p></li><li class="how__step"><div class="how__art how__art--draw" aria-hidden="true">@@ -142,8 +142,8 @@<i class="w-nav"></i><i class="w-h1"></i><i class="w-p"></i><i class="w-btn"></i><i class="w-pic"></i><i class="w-a"></i><i class="w-b"></i><i class="w-c"></i></div></div>- <h3>Draws a fresh layout</h3>- <p>A new structure every build, never a template.</p>+ <h3>Lays out the page from scratch</h3>+ <p>The sections and their order change on every build.</p></li><li class="how__step"><div class="how__art how__art--lint" aria-hidden="true">@@ -157,7 +157,7 @@<p class="lint__ok">0 fail, 0 warn</p></div><h3>Checks its own work</h3>- <p>A linter in a real browser, then a review.</p>+ <p>It lints the page in a real browser, then reviews it with fresh eyes.</p></li></ol></div>@@ -166,8 +166,8 @@<section class="sec" id="themes" aria-labelledby="themes-title"><div class="wrap"><div class="head">- <h2 id="themes-title">Forty-eight materials, not templates.</h2>- <p class="head__sub">A theme sets paper, type, colour and photography. The layout is drawn fresh.</p>+ <h2 id="themes-title">Forty-eight themes to start from</h2>+ <p class="head__sub">Each one is a paper, a set of type, a palette and a way with photographs. The layout is up to the build.</p></div><div class="th-bar"><div class="seg" role="group" aria-label="Filter themes by genre" data-th-filter>@@ -256,8 +256,8 @@<section class="sec" id="same" aria-labelledby="same-title"><div class="wrap"><div class="head">- <h2 id="same-title">One theme. Never the same page.</h2>- <p class="head__sub">Every build draws its own structure, so one theme gives two different pages.</p>+ <h2 id="same-title">Same theme, different pages</h2>+ <p class="head__sub">Two briefs in Kiln and two in Midnight. Each build chose its own structure.</p></div><div class="pairs"><div class="pair">@@ -276,15 +276,27 @@<section class="sec sec--q" id="faq" aria-labelledby="faq-title"><div class="wrap faq">- <h2 id="faq-title">Questions.</h2>+ <h2 id="faq-title">Questions</h2><div class="faq__list"><details><summary>Does it need an API key?<span class="faq__mark" aria-hidden="true"></span></summary>- <p>No. Photographs come from its own open library; an image key is optional.</p>+ <p>No. Photographs come from its own library of openly licensed pictures. An image key is optional.</p>+ </details>+ <details>+ <summary>Can it redesign a site I already have?<span class="faq__mark" aria-hidden="true"></span></summary>+ <p>Yes, when you ask by name: <code>/hallmark redesign ./site</code>. It keeps your content, links and forms and rebuilds how the page looks. It never touches an existing site on its own.</p>+ </details>+ <details>+ <summary>Can I skip the themes?<span class="faq__mark" aria-hidden="true"></span></summary>+ <p>Yes. Ask for a custom page and it designs from your brief alone, with the same rules and checks.</p>+ </details>+ <details>+ <summary>Can it show my actual app?<span class="faq__mark" aria-hidden="true"></span></summary>+ <p>Yes. Give it the URL or the folder and it runs the app and takes the screenshots itself.</p></details><details><summary>Can it follow my design system?<span class="faq__mark" aria-hidden="true"></span></summary>- <p>Yes. It reads your tokens and <code>design.md</code> first, and <code>redesign</code> keeps your content and wiring.</p>+ <p>Yes. It reads your tokens and <code>design.md</code> before it designs anything.</p></details><details><summary>Where do the photographs come from?<span class="faq__mark" aria-hidden="true"></span></summary>@@ -301,8 +313,8 @@<section class="made" id="examples" aria-labelledby="ex-title"><div class="wrap"><div class="head head--on-ink">- <h2 id="ex-title">Made with Hallmark.</h2>- <p class="head__sub">Twelve pages, each from one sentence. Drag the wheel, open any page.</p>+ <h2 id="ex-title">Made with Hallmark</h2>+ <p class="head__sub">Each one started as a single sentence. Drag the wheel to look around.</p></div></div><div class="wheel" data-wheel tabindex="0" role="region" aria-roledescription="carousel" aria-label="Pages made with Hallmark; left and right arrows turn the wheel">diff --git a/skills/hallmark/SKILL.md b/skills/hallmark/SKILL.mdindex 4caed10..d1ad5b8 100644--- a/skills/hallmark/SKILL.md+++ b/skills/hallmark/SKILL.md@@ -2,7 +2,7 @@name: hallmarkdescription: "Design skill for new pages, sites, app screens and components that look made, not generated: deals a theme or designs from scratch, builds on a hard floor, lints and reviews. Use when the user asks to build or design something new, or names Hallmark. Never use it to change an existing design (a restyle, new colours or theme, a polish, a redesign, a small edit) unless the user names Hallmark: `/hallmark redesign <path>` is the explicit full redesign, keeping content and wiring; `/hallmark audit <path>` only reports."argument-hint: "<brief> | redesign <path> | audit <path>"-version: 2.8.0+version: 2.0.0---# Hallmark@@ -108,7 +108,7 @@ Only when needed, in `references/`: one macrostructure file · `microinteractionThe run's only recital of its decisions, and the user's redirect window:```markdown-**Hallmark · v2.8.0**+**Hallmark · v2.0.0**- **Shape** · Workbench, from draw 7f3a2c · genre modern-minimal- **Theme** · Coral, dealt 2/3 (warm grey, one coral signal, General Sans, soft pills) · clears Cobalt on paper banddiff --git a/skills/hallmark/references/craft.md b/skills/hallmark/references/craft.mdindex 33cf9d8..3086a4e 100644--- a/skills/hallmark/references/craft.md+++ b/skills/hallmark/references/craft.md@@ -10,7 +10,7 @@ At most two families, a display face and a body face (one family may do both). A- **Sizes:** the roles in `layout.md` § 2, built on a 1.25 ratio from a 16px body, plus a wordmark size if the theme names one; hierarchy past those comes from weight and colour.- **Display:** tracking -0.02 to -0.04em on a regular-width face, 0 to -0.015em on a condensed or very heavy one (two letters touching is a fault); line-height 1.0 to 1.15, tighter as it grows (1.2 reads as inherited; a mixed-case poster head may close to 0.92). An uppercase head that can wrap never goes under 1.0 (55a). A head is one weight, one style and one colour: one word set apart by italic, colour, weight or a highlight is the accented word (38i, 38iii); stress comes from a line break or a second line at a second size.- **Display size:** `--text-display` (84px at 1440); a theme may set 5.5rem, 6rem when display-heavy, 7rem for a single word. A poster-scale theme or shape (Manifesto, Marquee Hero, a Poster hero) sizes with the screen, `clamp(4rem, 10vw, 9rem)`, full size at 1440 and held at 1920 (Floor 14), while the fold still holds the headline, one sentence and the action. A wide face takes the poster scale a step down.-- **Headline by length:** count the rendered `h1`: 20 characters or fewer, full display (a single word may reach 7rem); 21 to 50, display; 51 to 90, `--text-display-s` or split at the sense break with `<br>`; over 90, rewrite.+- **Headline by length:** count the rendered `h1`: 20 characters or fewer, full display (a single word may reach 7rem); 21 to 50, display; 51 to 90, `--text-display-s` or split at the sense break with `<br>`; over 90, rewrite. A `<br>` goes only between phrases and is checked at 375, where it often lands badly; heads take `text-wrap: balance`, body copy `pretty`, so no head ends on a stub and no paragraph on one word (F26).- **Heading measure** rides on the element in `ch` (the scaffold sets `h1` 20ch, `h2` 30ch, `h3` 40ch; a head at display-s about 24ch), never on the heading group's wrapper.- **Body:** 16px minimum, line-height 1.5 to 1.65, measure 45 to 75ch (25); never all caps, never justified without hyphenation (F22), never tracked past 0.05em.- **Labels, captions, table heads, meta, tags, chips, nav links:** the body face a step smaller, sentence case (lowercase on a theme whose voice is lowercase), untracked (67). Mono only for code, a figure or a measurement, or when mono is the theme's material (64). Capitals belong to a wordmark and to a theme whose display voice is uppercase, where a control may follow at 0.04em or less.diff --git a/skills/hallmark/references/flow.md b/skills/hallmark/references/flow.mdindex 7c104a5..7e1d6b0 100644--- a/skills/hallmark/references/flow.md+++ b/skills/hallmark/references/flow.md@@ -44,7 +44,7 @@ Signals: the brief names one element (button, input, form, card, modal, dropdown.btn:active, .btn.is-active { transform: translateY(1px); }```-Stamp: `/* Hallmark · component: <type> · genre: <genre> · theme: <theme> · states: 8 · contrast: pass · v2.8.0 */`. Sweep: `sloplint --scope component`, which skips the page-only gates.+Stamp: `/* Hallmark · component: <type> · genre: <genre> · theme: <theme> · states: 8 · contrast: pass · v2.0.0 */`. Sweep: `sloplint --scope component`, which skips the page-only gates.## App screens@@ -77,7 +77,7 @@ Two runs fix a page in place instead of building one: a polish (`redesign.md`) a```css/* Hallmark · checked: 2026-09-22 · genre: modern-minimal (inferred)* floor: 0 FAIL · fixed: 6 (2, 7, 22, 27, 38, 54) · structural: 2 printed (8, 42)- * built: the project · redesign: polish · v2.8.0 */+ * built: the project · redesign: polish · v2.0.0 */```The fresh-context review still runs, one round, with the narrower question: *does anything here read as machine-made?* Close with the counts: `Swept 4 files · fixed 6 · 2 structural findings printed · Floor 0 FAIL`.diff --git a/skills/hallmark/references/gates.md b/skills/hallmark/references/gates.mdindex b570aa8..aaee761 100644--- a/skills/hallmark/references/gates.md+++ b/skills/hallmark/references/gates.md@@ -175,7 +175,7 @@ Loaded at Step 7, with the sweep's findings in hand.### Finish (F-checks, never block)-F1 straight quotes in prose · F2 `...` for an ellipsis · F3 no `text-wrap: balance` on display heads · F4 more than one filled-primary button recipe on a page (dialogs count as their own page), or two filled buttons side by side · F5 an icon in a coloured coin · F6 display-size figures without tabular numerals · F7 one container recipe stamped on six or more selectors, or the pill radius on five or more selectors that are not controls, tags or badges · F8 more than one scroll-choreography pattern · F9 fake-human avatar hotlinks (this half is a FAIL) or person-keyword stock URLs · F10 a Lottie where CSS or SVG would do · F11 a highlighter band at the baseline instead of behind the x-height, or an underline thicker than 2px or offset more than 0.25em · F12 a flex row of unequal heights without `align-items: center` · F13 the outlier face carrying more than one role · F14 a helper-text slot with no reserved `min-height: 1lh` · F15 page invariants broken: more than one primary button style, container width, column gap below the hero or radius per nesting level, or more centred heading groups than left-aligned ones · F16 browser surfaces unthemed: no `::selection`, `caret-color` or `scrollbar-color` on a page with a committed palette · F17 a text block squeezed into a sliver at 1440 (under about 16 characters wide over four lines or more) (render) · F18 a `data-slot` rendering under 40px in either dimension at 1440, or a page with slots and no `hallmarkSlots` script (render) · F19 more than three font weights in running use, display and body together (render) · F20 a grid or wrapping row leaving one item alone on its last row under a fuller row (render) · F21 a heading level skipped · F22 justified text without `hyphens: auto` · F23 a document without `lang`, a `<title>` or a meta description · F24 a hairline border under a wide soft shadow (24px or more of blur after a negative spread) on one surface · F25 content a phone never gets: about 40 words or more shown at 1440 and hidden at 375, navigation aside, or a table opening with two or more columns off-screen (render).+F1 straight quotes in prose · F2 `...` for an ellipsis · F3 no `text-wrap: balance` on display heads · F4 more than one filled-primary button recipe on a page (dialogs count as their own page), or two filled buttons side by side · F5 an icon in a coloured coin · F6 display-size figures without tabular numerals · F7 one container recipe stamped on six or more selectors, or the pill radius on five or more selectors that are not controls, tags or badges · F8 more than one scroll-choreography pattern · F9 fake-human avatar hotlinks (this half is a FAIL) or person-keyword stock URLs · F10 a Lottie where CSS or SVG would do · F11 a highlighter band at the baseline instead of behind the x-height, or an underline thicker than 2px or offset more than 0.25em · F12 a flex row of unequal heights without `align-items: center` · F13 the outlier face carrying more than one role · F14 a helper-text slot with no reserved `min-height: 1lh` · F15 page invariants broken: more than one primary button style, container width, column gap below the hero or radius per nesting level, or more centred heading groups than left-aligned ones · F16 browser surfaces unthemed: no `::selection`, `caret-color` or `scrollbar-color` on a page with a committed palette · F17 a text block squeezed into a sliver at 1440 (under about 16 characters wide over four lines or more) (render) · F18 a `data-slot` rendering under 40px in either dimension at 1440, or a page with slots and no `hallmarkSlots` script (render) · F19 more than three font weights in running use, display and body together (render) · F20 a grid or wrapping row leaving one item alone on its last row under a fuller row (render) · F21 a heading level skipped · F22 justified text without `hyphens: auto` · F23 a document without `lang`, a `<title>` or a meta description · F24 a hairline border under a wide soft shadow (24px or more of blur after a negative spread) on one surface · F25 content a phone never gets: about 40 words or more shown at 1440 and hidden at 375, navigation aside, or a table opening with two or more columns off-screen (render). · F26 a paragraph that leaves one word on its last line, or a head of two or three lines ending on a stub, at 375 or 1280 (balance the head, `pretty` the copy, or rewrite)### Judged clausesdiff --git a/skills/hallmark/references/imagery.md b/skills/hallmark/references/imagery.mdindex c7c6ac6..d0aa414 100644--- a/skills/hallmark/references/imagery.md+++ b/skills/hallmark/references/imagery.md@@ -56,7 +56,7 @@ A slot is any picture the user will replace: `data-slot="<name>"` (`hero`, `demonode <skill-dir>/scripts/capture.mjs http://localhost:3000 --routes /,/settings --sizes desktop,phone [--selector ".editor"] [--full] [--out images/screens]```-It writes 2x PNGs at 1440 x 900 and 390 x 844 (or one element with `--selector`) and prints an `<img>` for each. A desktop app is captured with the OS (`screencapture -l <window id>` or `-R x,y,w,h` on macOS), a phone app with its simulator (`xcrun simctl io booted screenshot`), a terminal tool by running it and setting its real output in a code block. Look at every capture before it ships: nothing personal on screen (names, emails, tokens, file paths), no error states unless they are the point, no debug overlays. Use several: the main screen in the hero, a detail cropped large lower down, a second screen, the phone view. Stamp `imagery: screenshots <n> (capture.mjs)` and credit nothing; they are the user's own.+It writes 2x PNGs at 1440 x 900 and 390 x 844 (or one element with `--selector`) and prints an `<img>` for each. A desktop app built on Electron, WebView2 or CEF is started with a DevTools port and captured through it (`capture.mjs --cdp 9222 --target "<window title>" [--selector ...]`, clean and at its own pixel density); any other desktop app with the OS (`screencapture -l <window id>` or `-R x,y,w,h` on macOS), a phone app with its simulator (`xcrun simctl io booted screenshot`), a terminal tool by running it and setting its real output in a code block. Look at every capture before it ships: nothing personal on screen (names, emails, tokens, file paths), no error states unless they are the point, no debug overlays. Use several: the main screen in the hero, a detail cropped large lower down, a second screen, the phone view. Stamp `imagery: screenshots <n> (capture.mjs)` and credit nothing; they are the user's own.**Frame it in the theme.** A capture sits in a `data-slot` with the theme's radius and the inset outline (§ 5), never inside a drawn browser bar, device frame, traffic lights or notch (47a, 47b). Crop to the part that sells (`object-position`, or `--selector`), keep text in it legible at its displayed size (scale 2, never upscaled), and never retouch what the product shows. Captures are product pictures: mark their slots `data-kind="product"`, so they do not count toward the photo balance (83).diff --git a/skills/hallmark/references/themes/index.json b/skills/hallmark/references/themes/index.jsonindex cfc2190..7e25848 100644--- a/skills/hallmark/references/themes/index.json+++ b/skills/hallmark/references/themes/index.json@@ -1,5 +1,5 @@{- "built": "2026-10-20",+ "built": "2026-10-21","themes": [{"name": "Almanac",diff --git a/skills/hallmark/scripts/capture.mjs b/skills/hallmark/scripts/capture.mjsindex 0269311..5558c76 100644--- a/skills/hallmark/scripts/capture.mjs+++ b/skills/hallmark/scripts/capture.mjs@@ -4,6 +4,10 @@// node capture.mjs <url | file.html> [--out <dir>] [--name <prefix>] [--routes /,/pricing]// [--sizes desktop,phone] [--full] [--selector "<css>"] [--wait <ms>]// [--dark] [--scale <1|2>]+// node capture.mjs --cdp <port> [--target "<window title>"] [--selector "<css>"] [--out <dir>] [--name <prefix>]+//+// --cdp attaches to a desktop app already running with a DevTools port (an Electron app started with+// --remote-debugging-port=<port>, a WebView2 or CEF app) and captures its window as it is.//// Opens each route at 1440 x 900 (desktop) and 390 x 844 (phone), waits for fonts and images,// and writes PNGs into --out (default ./images/screens). It prints, for each file, its size and a@@ -19,14 +23,14 @@ const HERE = dirname(fileURLToPath(import.meta.url));const argv = process.argv.slice(2);const flag = (k, d) => { const i = argv.indexOf(`--${k}`); return i >= 0 && argv[i + 1] && !argv[i + 1].startsWith('--') ? argv[i + 1] : d; };const has = (k) => argv.includes(`--${k}`);-const VALUED = new Set(['--out', '--name', '--routes', '--sizes', '--selector', '--wait', '--scale']);+const VALUED = new Set(['--out', '--name', '--routes', '--sizes', '--selector', '--wait', '--scale', '--cdp', '--target']);const target = argv.find((a, i) => !a.startsWith('--') && !VALUED.has(argv[i - 1]));-if (!target) {+if (!target && !has('cdp')) {console.error('usage: node capture.mjs <url | file.html> [--out <dir>] [--name <prefix>] [--routes /,/pricing] [--sizes desktop,phone] [--full] [--selector "<css>"] [--wait <ms>] [--dark] [--scale 2]');process.exit(2);}const out = resolve(flag('out', 'images/screens'));-const name = flag('name', 'screen');+const name = flag('name', 'screen').replace(/[^\w.-]+/g, '-').replace(/^\.+/, '') || 'screen';const routes = flag('routes', '/').split(',').map((r) => r.trim()).filter(Boolean);const sizes = flag('sizes', 'desktop,phone').split(',').map((s) => s.trim());const wait = Number(flag('wait', '600'));@@ -46,13 +50,36 @@ for (const root of roots) {}if (!puppeteer) { console.error('capture.mjs needs puppeteer-core or puppeteer (local, global or HALLMARK_PUPPETEER). Without it, take the screenshots with the harness or the OS (imagery.md § 4).'); process.exit(1); }const chrome = [process.env.CHROME_PATH, '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', '/Applications/Chromium.app/Contents/MacOS/Chromium', '/usr/bin/google-chrome', '/usr/bin/chromium', '/usr/bin/chromium-browser'].find((p) => p && existsSync(p)) || (typeof puppeteer.executablePath === 'function' ? puppeteer.executablePath() : null);+if (has('cdp')) {+ const port = Number(flag('cdp', ''));+ if (!Number.isInteger(port) || port < 1 || port > 65535) { console.error('--cdp takes the app\'s DevTools port, for example --cdp 9222'); process.exit(2); }+ const want = flag('target', '').toLowerCase();+ const app = await puppeteer.connect({ browserURL: `http://127.0.0.1:${port}`, defaultViewport: null }).catch((e) => { console.error(`no DevTools endpoint on port ${port}: ${e.message}`); process.exit(1); });+ let page = null;+ for (const pg of await app.pages()) { const t = (await pg.title().catch(() => '')).toLowerCase(); if (!want || t.includes(want)) { page = pg; break; } }+ if (!page) { console.error(`no window${want ? ` titled like "${want}"` : ''} on port ${port}`); await app.disconnect(); process.exit(1); }+ mkdirSync(out, { recursive: true });+ const file = join(out, `${name}-app${selector ? '-part' : ''}.png`);+ const el = selector ? await page.$(selector) : null;+ if (selector && !el) { console.error(`no element matches ${selector}`); await app.disconnect(); process.exit(1); }+ await (el || page).screenshot({ path: file });+ const box = el ? await el.boundingBox() : await page.evaluate(() => ({ width: innerWidth, height: innerHeight }));+ const dpr = await page.evaluate(() => devicePixelRatio).catch(() => 1);+ const rel = relative(process.cwd(), file);+ console.log(`${rel} ${Math.round(box.width * dpr)} x ${Math.round(box.height * dpr)} (app window)`);+ console.log(` <img src="${rel}" width="${Math.round(box.width * dpr)}" height="${Math.round(box.height * dpr)}" alt="" loading="lazy">`);+ await app.disconnect();+ process.exit(0);+}if (!chrome) { console.error('no Chrome or Chromium found; set CHROME_PATH'); process.exit(1); }const isUrl = /^https?:\/\//i.test(target);const urlFor = (route) => {if (!isUrl) return pathToFileURL(resolve(target)).href;const u = new URL(target);- return route === '/' ? u.href : new URL(route, u.origin).href;+ if (route === '/') return u.href;+ const r = new URL(route, u.origin);+ return r.origin === u.origin ? r.href : null;};mkdirSync(out, { recursive: true });const browser = await puppeteer.launch({ executablePath: chrome, headless: true });@@ -64,7 +91,9 @@ try {const p = await browser.newPage();if (has('dark')) await p.emulateMediaFeatures([{ name: 'prefers-color-scheme', value: 'dark' }]);await p.setViewport({ width: w, height: h, deviceScaleFactor: scale, isMobile: mobile, hasTouch: mobile });- const res = await p.goto(urlFor(route), { waitUntil: 'networkidle2', timeout: 45000 }).catch((e) => ({ err: e.message }));+ const to = urlFor(route);+ if (!to) { console.log(`skip ${route}: not on ${new URL(target).origin}`); await p.close(); continue; }+ const res = await p.goto(to, { waitUntil: 'networkidle2', timeout: 45000 }).catch((e) => ({ err: e.message }));if (res && res.err) { console.log(`skip ${route} at ${size}: ${res.err}`); await p.close(); continue; }await p.evaluate(async () => { if (document.fonts) await document.fonts.ready; for (const i of document.querySelectorAll('img[loading="lazy"]')) i.loading = 'eager'; await Promise.race([Promise.all([...document.images].filter((i) => !i.complete).map((i) => new Promise((r) => { i.onload = i.onerror = r; }))), new Promise((r) => setTimeout(r, 6000))]); }).catch(() => {});await new Promise((r) => setTimeout(r, wait));diff --git a/skills/hallmark/scripts/fixtures/exemplars/atmospheric.html b/skills/hallmark/scripts/fixtures/exemplars/atmospheric.htmlindex 026a43d..d3aa8f7 100644--- a/skills/hallmark/scripts/fixtures/exemplars/atmospheric.html+++ b/skills/hallmark/scripts/fixtures/exemplars/atmospheric.html@@ -10,8 +10,8 @@<link href="https://fonts.googleapis.com/css2?family=Young+Serif&family=Instrument+Sans:wght@400;500;600&display=swap" rel="stylesheet"><style>/* Hallmark · shape: Photographic · genre: atmospheric · theme: Spore (by request)- * hero: Settled · nav: floating pill · footer: statement · imagery: photographs, library 6, warm con=6 exp=-4 · signature: a pour into the decanter after five beside the head, with tonight's door in the nav · spore: cellar- * axes: dark/roman-serif/warm · posture: committed · contrast: pass · fold: pass · v2.8.0 */+ * hero: Settled · nav: floating pill · footer: statement · imagery: photographs, library 3, warm con=6 exp=-4 · signature: a pour into the decanter after five beside the head, with tonight's door in the nav · spore: cellar+ * axes: dark/roman-serif/warm · posture: committed · contrast: pass · fold: pass · v2.0.0 *//* Hallmark · pre-emit critique: P4 H4 E4 S4 R5 V4 · weakest: S, the photographs are a stand-in bar; every head carries a fact from the brief, the pour is pink like the one signal, and the nav reads tonight's door from the brief's hours *//* Hallmark · hero-review: in-thread · ship · 0 findings · finish-review: subagent · fix · 5 findings · 5 resolved · gap: the maker's-log voice can name no bottle until the user gives the list */:root {@@ -119,28 +119,25 @@ button, input, select, textarea { font: inherit; }background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.6 0 0 0 0 0.55 0 0 0 0 0.45 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E"); }.grained > * { position: relative; z-index: var(--z-raised); }-/* A photograph that runs edge to edge */-.bleed { width: 100%; aspect-ratio: 21 / 9; border-radius: 0; }-.bleed > img { outline: 0; }-/* The list: the racks edge to edge, the head on a grained plate across its foot */.list { padding-top: var(--section-gap); }.list__photo { aspect-ratio: 21 / 9; }.plate { display: grid; gap: var(--space-md); width: min(100%, 37rem); margin: calc(-1 * var(--space-4xl)) 0 0 var(--space-2xl); padding: var(--space-xl); border-radius: var(--radius-card); background: var(--color-paper-2); box-shadow: var(--shadow-card); z-index: var(--z-raised); }.plate__more { color: var(--color-ink-2); }-/* Under the racks, the pair: the bar wide, the shop narrow */-.pair { margin-top: var(--space-3xl); display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--gap-columns); }-.pair__item { display: grid; gap: var(--space-md); margin: 0; }-.pair .photo { height: clamp(400px, 34vw, 480px); }-.pair figcaption { display: flex; flex-wrap: wrap; gap: var(--space-xs); font-size: var(--text-sm); color: var(--color-muted); }-.pair figcaption b { font-weight: 600; color: var(--color-ink); }--/* Four nights: the room full, the days set over its dark foot */-.nights { position: relative; margin-top: var(--section-gap); }-.nights__photo { aspect-ratio: 21 / 9; }-.nights__over { position: absolute; inset: auto 0 0 0; z-index: var(--z-raised); padding-block: var(--space-4xl) var(--space-2xl); background: linear-gradient(to top, color-mix(in oklab, var(--color-paper) 82%, transparent) 15%, color-mix(in oklab, var(--color-paper) 0%, transparent)); }+/* Four nights: the week set in type, the open nights lit, the dark ones left dim */+.nights { margin-top: var(--section-gap); }.statement { max-width: 18ch; font-size: var(--text-display); line-height: 1.02; }+.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: var(--space-3xl) 0 0; padding: 0; list-style: none; border-top: var(--rule-hair) solid var(--color-rule); }+.week__day { display: grid; gap: var(--space-xs); padding: var(--space-lg) var(--space-md) 0 0; }+.week__name { font: 400 var(--text-xl)/1.1 var(--font-display); letter-spacing: var(--tracking-display); }+.week__hours { font-size: var(--text-sm); color: var(--color-ink-2); }+.week__day.is-open { box-shadow: inset 0 2px 0 var(--color-ink); }+.week__day.is-shut .week__name, .week__day.is-shut .week__hours { color: var(--color-muted); }+.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gap-columns); margin-top: var(--space-3xl); }+.way { display: grid; gap: var(--space-sm); padding-top: var(--space-lg); border-top: var(--rule-hair) solid var(--color-rule); }+.way h3 { font-size: var(--text-section); max-width: none; }+.way p { font-size: var(--text-lead); color: var(--color-ink-2); }/* Tastings: the one band, grained, the price in pink */.tastings { margin-top: var(--section-gap-s); padding-block: var(--section-gap-s); background: var(--color-paper-3); }@@ -180,10 +177,11 @@ button, input, select, textarea { font: inherit; }@media (max-width: 60rem) {.plate { margin: calc(-1 * var(--space-2xl)) 0 0; padding: var(--space-lg); }.list__photo { aspect-ratio: 4 / 3; }- .pair { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xl); }- .pair .photo { height: auto; aspect-ratio: 4 / 3; }- .bleed, .nights__photo { aspect-ratio: 4 / 3; }- .nights__over { padding-block: var(--space-2xl) var(--space-lg); }+ .week { grid-template-columns: minmax(0, 1fr); margin-top: var(--space-2xl); border-top: 0; }+ .week__day { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; padding: var(--space-sm) 0; border-top: var(--rule-hair) solid var(--color-rule); }+ .week__day.is-open { box-shadow: none; }+ .week__name { font-size: var(--text-lg); }+ .ways { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xl); margin-top: var(--space-3xl); }.statement, .footer__line { font-size: var(--text-section); }.tastings__grid { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-xl); }.tastings__text { padding-right: 0; }@@ -236,30 +234,30 @@ button, input, select, textarea { font: inherit; }<h2 id="list-title">Every bottle here is natural.</h2><p class="plate__more">The full list: <span class="fill" data-fill="list">link to come</span>.</p></div>- <div class="pair">- <figure class="pair__item pair__item--wide">- <div class="photo" data-slot="photo-2" data-alt="A glass poured at the bar">- <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Paris_-_A_waiter_lighting_candles_in_a_bar_-_3418.jpg/1280px-Paris_-_A_waiter_lighting_candles_in_a_bar_-_3418.jpg" width="4368" height="2912" loading="lazy" alt="Lighting rows of red glass candles along a dark bar counter" style="object-position: 40% 65%">- </div>- <figcaption><b>The bar</b> Open a bottle and stay.</figcaption>- </figure>- <figure class="pair__item">- <div class="photo" data-slot="photo-3" data-alt="The shop's shelves of bottles">- <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/Cocktail-Bar_%28Kleines_Phi%29_in_Hamburg.jpg/1280px-Cocktail-Bar_%28Kleines_Phi%29_in_Hamburg.jpg" width="4971" height="4000" loading="lazy" alt="Shelves of bottles under hanging lamps behind a long counter" style="object-position: 72% 15%">- </div>- <figcaption><b>The shop</b> Take one home.</figcaption>- </figure>- </div></div></section><section class="nights" aria-labelledby="nights-title">- <figure class="photo bleed nights__photo" data-slot="photo-4" data-alt="The bar room after five">- <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/01/Bokeh_raindrops_on_a_window_1.jpg/1280px-Bokeh_raindrops_on_a_window_1.jpg" width="3283" height="4385" loading="lazy" alt="Rain on a window at night, the lights inside blurred to warm discs" style="object-position: 50% 30%">- </figure>- <div class="nights__over">- <div class="container">- <h2 id="nights-title" class="statement">Four nights a week, Thursday to Sunday.</h2>+ <div class="container">+ <h2 id="nights-title" class="statement">Four nights a week, Thursday to Sunday.</h2>+ <ol class="week" role="list" aria-label="Opening hours">+ <li class="week__day is-shut"><span class="week__name">Monday</span><span class="week__hours">Closed</span></li>+ <li class="week__day is-shut"><span class="week__name">Tuesday</span><span class="week__hours">Closed</span></li>+ <li class="week__day is-shut"><span class="week__name">Wednesday</span><span class="week__hours">Closed</span></li>+ <li class="week__day is-open"><span class="week__name">Thursday</span><span class="week__hours">From 5pm</span></li>+ <li class="week__day is-open"><span class="week__name">Friday</span><span class="week__hours">From 5pm</span></li>+ <li class="week__day is-open"><span class="week__name">Saturday</span><span class="week__hours">From 5pm</span></li>+ <li class="week__day is-open"><span class="week__name">Sunday</span><span class="week__hours">From 5pm</span></li>+ </ol>+ <div class="ways">+ <div class="way">+ <h3>The bar</h3>+ <p>Open a bottle and stay.</p>+ </div>+ <div class="way">+ <h3>The shop</h3>+ <p>Take one home.</p>+ </div></div></div></section>@@ -279,7 +277,7 @@ button, input, select, textarea { font: inherit; }<p class="signup__help" id="email-help" aria-live="polite"></p></form></div>- <figure class="photo tastings__photo" data-slot="photo-5" data-alt="Glasses poured for a tasting">+ <figure class="photo tastings__photo" data-slot="photo-2" data-alt="Glasses poured for a tasting"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/e3/Wine_being_poured_into_a_glass.jpg/1280px-Wine_being_poured_into_a_glass.jpg" width="1955" height="1300" loading="lazy" alt="A taste of red wine poured into a glass held by its stem" style="object-position: 62% 50%"></figure></div>@@ -297,7 +295,7 @@ button, input, select, textarea { font: inherit; }</ul></div><p class="legal">© 2026 Night Cellar</p>- <p class="credits" data-credits>Photographs: <a href="https://commons.wikimedia.org/wiki/File:Pouring_wine_into_a_decanter.jpg">suksim</a> <span>(CC BY 2.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Schramsberg_Vineyards,_July_2019-7579%2B7580.jpg">Frank Schulenburg</a> <span>(CC BY-SA 4.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Paris_-_A_waiter_lighting_candles_in_a_bar_-_3418.jpg">Jorge Royan</a> <span>(CC BY-SA 3.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Cocktail-Bar_(Kleines_Phi)_in_Hamburg.jpg">Achim Schleuning</a> <span>(CC BY-SA 4.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Bokeh_raindrops_on_a_window_1.jpg">W.carter</a> <span>(CC0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Wine_being_poured_into_a_glass.jpg">Fabio Ingrosso</a> <span>(CC BY 2.0)</span>, via Wikimedia Commons.</p>+ <p class="credits" data-credits>Photographs: <a href="https://commons.wikimedia.org/wiki/File:Pouring_wine_into_a_decanter.jpg">suksim</a> <span>(CC BY 2.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Schramsberg_Vineyards,_July_2019-7579%2B7580.jpg">Frank Schulenburg</a> <span>(CC BY-SA 4.0)</span>, <a href="https://commons.wikimedia.org/wiki/File:Wine_being_poured_into_a_glass.jpg">Fabio Ingrosso</a> <span>(CC BY 2.0)</span>, via Wikimedia Commons.</p></div></footer>diff --git a/skills/hallmark/scripts/fixtures/exemplars/editorial.html b/skills/hallmark/scripts/fixtures/exemplars/editorial.htmlindex 0f77258..c088269 100644--- a/skills/hallmark/scripts/fixtures/exemplars/editorial.html+++ b/skills/hallmark/scripts/fixtures/exemplars/editorial.html@@ -9,12 +9,12 @@<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link href="https://fonts.googleapis.com/css2?family=Grenze+Gotisch:wght@600&family=Hanken+Grotesk:wght@400;500;600&family=IBM+Plex+Mono:wght@400&display=swap" rel="stylesheet"><style>-/* Hallmark · shape: Trade Ledger (custom: the roast as a Poster, the house's day book beside its books, the cup as a spread, the order on the pigment) · genre: editorial · theme: Vellum (by request)- * hero: Poster · nav: masthead, the blackletter wordmark centred over a double rule, one link at each end · footer: letter close · imagery: photographs, library 5, warm con=6 · signature: the roast itself, beans swept round the cooling tray full-bleed under a parchment plate · vellum: parchment- * axes: light/blackletter/cool · posture: committed · contrast: pass · fold: pass · v2.8.0 */+/* Hallmark · shape: Trade Ledger (custom: the roast as a Poster, the house's day book set as its own ledger, the cup as a pair, the order on the pigment) · genre: editorial · theme: Vellum (by request)+ * hero: Poster · nav: masthead, the blackletter wordmark centred over a double rule, one link at each end · footer: letter close · imagery: photographs, library 3, warm con=6 · signature: the roast itself, beans swept round the cooling tray full-bleed under a parchment plate · vellum: parchment+ * axes: light/blackletter/cool · posture: committed · contrast: pass · fold: pass · v2.0.0 *//* Hallmark · pre-emit critique: P4 H5 E4 S5 R4 V4 · weakest: E, the plate must not bury the hand and the falling beans; it rests on the tray's far side and the plain wall, so the stream and the lever stay clear *//* Hallmark · hero-review: in-thread · fix · 1 finding · 1 resolved (the head breaks after York) */-/* Hallmark · finish-review: in-thread (the subagent limit was reached) · fix · 3 findings · 1 resolved (the order head failed the swap test, then its blackletter I read as J: now 250 g bags, or a subscription) · 2 answered (the pair's captions are card facts, imagery.md 5; the croissant and the cafe window are the closest honest frames the library holds) · gap: none */+/* Hallmark · finish-review: in-thread (the subagent limit was reached) · fix · 3 findings · 1 resolved (the order head failed the swap test, then its blackletter I read as J: now 250 g bags, or a subscription) · 2 answered (the pair's captions are card facts, imagery.md 5; the pair are the closest honest frames the library holds) · gap: none *//* Hallmark · answered F4 · the order field inverts the primary to parchment on pigment, as the theme's own hint sets it for its one field */:root {color-scheme: light;@@ -132,33 +132,34 @@ h3 { font-family: var(--font-body); font-weight: 600; }.photo > img { outline: var(--rule-hair) solid var(--color-rule); outline-offset: -1px; }figcaption { margin-top: var(--space-sm); font: 500 var(--text-sm)/1.4 var(--font-body); color: var(--color-muted); }-/* The day book: the house's ledger on the fibre band, beside its books */-.ledger__grid { align-items: center; }-.ledger__text { grid-column: 1 / span 6; }-.ledger .lead { margin-top: var(--space-md); }-.ledger__photo { grid-column: 7 / span 6; aspect-ratio: 5 / 4; }-.book { width: 100%; margin-top: var(--space-2xl); border-collapse: collapse; font-size: var(--text-lg); line-height: 1.35; }+/* The day book: the house's ledger on the fibre band, the entries kept in the hand of the wordmark */+.ledger__grid { align-items: start; }+.ledger__text { grid-column: 1 / span 4; position: sticky; top: var(--space-2xl); }+.ledger__text h2 { font-size: var(--text-display); max-width: 9ch; }+.ledger .lead { margin-top: var(--space-lg); max-width: 22ch; }+.ledger__book { grid-column: 6 / span 7; }+.book { width: 100%; border-collapse: collapse; font-size: var(--text-lg); line-height: 1.35; }.book thead th { padding: 0 0 var(--space-sm); border-bottom: 4px double var(--color-ink); font: 500 var(--text-sm)/1.3 var(--font-body); color: var(--color-muted); text-align: left; }-.book td, .book tbody th { padding: var(--space-md) 0; border-top: var(--rule-hair) solid var(--color-rule); vertical-align: baseline; }+.book td, .book tbody th { padding: var(--space-lg) 0; border-top: var(--rule-hair) solid var(--color-rule); vertical-align: baseline; }.book tbody tr:first-child > * { border-top: 0; }.book tbody tr:last-child > * { border-bottom: var(--rule-hair) solid var(--color-ink); }.book tbody th { font-weight: 500; text-align: left; color: var(--color-ink); }.book .idx { width: 3.5rem; font-weight: 600; color: var(--color-accent); }.book .r, .book thead th.r { text-align: right; }-.book td.r { color: var(--color-ink-2); }-.book .num { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; color: var(--color-ink); }+.book td.r { font: 600 var(--text-2xl)/1 var(--font-display); letter-spacing: var(--tracking-display); color: var(--color-ink); }+.book td.r .unit { font: 500 var(--text-md)/1 var(--font-body); color: var(--color-ink-2); }+.book .num { font-variant-numeric: lining-nums tabular-nums; }/* The cup: one wide frame, then a pair, each with its fact */.cup { padding-top: var(--section-gap-l); }.cup__head { align-items: end; }.cup__head h2 { grid-column: 1 / span 6; }.cup__head .lead { grid-column: 8 / span 5; }-.cup__wide { margin-top: var(--space-2xl); aspect-ratio: 21 / 9; }-.cup__pair { margin-top: var(--gap-columns); }+.cup__pair { margin-top: var(--space-2xl); }.cup__pair > figure { margin: 0; }.cup__note { grid-column: 1 / span 7; }.cup__cup { grid-column: 8 / span 5; }-.cup__pair .photo { height: 36rem; }+.cup__pair .photo { height: 34rem; }/* The order, on the one pigment field */.order-band { margin-top: var(--section-gap-s); padding-block: var(--section-gap-s); background: var(--color-field); color: var(--color-accent-ink); }@@ -201,8 +202,10 @@ figcaption { margin-top: var(--space-sm); font: 500 var(--text-sm)/1.4 var(--fon.letter__credit a:hover { color: var(--color-ink); text-decoration-color: var(--color-accent); }@media (max-width: 60rem) {- .ledger__text, .ledger__photo, .cup__head h2, .cup__head .lead, .cup__note, .cup__cup, .order__text, .order__fields { grid-column: 1 / -1; }- .ledger__photo { margin-top: var(--space-xl); }+ .ledger__text, .ledger__book, .cup__head h2, .cup__head .lead, .cup__note, .cup__cup, .order__text, .order__fields { grid-column: 1 / -1; }+ .ledger__text { position: static; }+ .ledger__book { margin-top: var(--space-2xl); }+ .book td.r { font-size: var(--text-xl); }.cup__head .lead { margin-top: var(--space-md); }.cup__pair { row-gap: var(--space-xl); }.cup__pair .photo { height: auto; aspect-ratio: 4 / 3; }@@ -249,23 +252,21 @@ figcaption { margin-top: var(--space-sm); font: 500 var(--text-sm)/1.4 var(--fon<div class="ledger__text"><h2 id="ledger-h">Written in the day book</h2><p class="lead">Five lines the roastery keeps to.</p>+ </div>+ <div class="ledger__book"><table class="book"><thead><tr><th scope="col">No.</th><th scope="col">Entry</th><th scope="col" class="r">Kept</th></tr></thead><tbody><tr><td class="idx">1</td><th scope="row">Coffees roasted each week</th><td class="r"><span class="num">6</span></td></tr>- <tr><td class="idx">2</td><th scope="row">Weight of each bag</th><td class="r"><span class="num">250</span> g</td></tr>+ <tr><td class="idx">2</td><th scope="row">Weight of each bag</th><td class="r"><span class="num">250</span> <span class="unit">g</span></td></tr><tr><td class="idx">3</td><th scope="row">Ways to buy</th><td class="r">By the bag, or by subscription</td></tr><tr><td class="idx">4</td><th scope="row">Roastery</th><td class="r">York</td></tr><tr><td class="idx">5</td><th scope="row">Roasting since</th><td class="r"><span class="num">1921</span></td></tr></tbody></table></div>- <figure class="photo ledger__photo" data-slot="daybooks" data-alt="The roastery's own day books on the shelf, or the bench where the week is written up">- <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/13-11-02-olb-by-RalfR-03.jpg/1280px-13-11-02-olb-by-RalfR-03.jpg" width="1920" height="1275" loading="lazy"- alt="Wooden arches lined with old bound books in a library">- </figure></div></section>@@ -275,10 +276,6 @@ figcaption { margin-top: var(--space-sm); font: 500 var(--text-sm)/1.4 var(--fon<h2 id="cup-h">From a York drum to your kettle</h2><p class="lead">Fenwick and Daughters roasts the coffee. The cup is yours to make.</p></div>- <figure class="photo cup__wide" data-slot="brew" data-alt="A cup of the week's coffee being brewed, at the roastery or at home">- <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/0/0e/D%C3%BClmen%2C_Privatr%C3%B6sterei_Schr%C3%B6er_--_2018_--_0553.jpg/1280px-D%C3%BClmen%2C_Privatr%C3%B6sterei_Schr%C3%B6er_--_2018_--_0553.jpg" width="1920" height="1280" loading="lazy"- alt="A wall of brass scoop bins filled with coffee beans in a roastery shop" style="object-position: 45% 55%">- </figure><div class="split cup__pair"><figure class="cup__note"><div class="photo" data-slot="desk" data-alt="The York roaster between roasts, the drum over its cooling tray">@@ -338,7 +335,7 @@ figcaption { margin-top: var(--space-sm); font: 500 var(--text-sm)/1.4 var(--fon<a href="#order">Order</a></nav><p class="legal">© 2026 Fenwick and Daughters</p>- <p class="letter__credit" data-credits>Photographs: <a href="https://commons.wikimedia.org/wiki/File:Cooling_time_for_coffee.jpg">Jameswasswa</a> (CC BY-SA 4.0), <a href="https://commons.wikimedia.org/wiki/File:13-11-02-olb-by-RalfR-03.jpg">Ralf Roletschek</a> (CC BY 3.0), <a href="https://commons.wikimedia.org/wiki/File:D%C3%BClmen,_Privatr%C3%B6sterei_Schr%C3%B6er_--_2018_--_0553.jpg">Dietmar Rabich</a> (CC BY-SA 4.0), <a href="https://commons.wikimedia.org/wiki/File:Coffee_roasting_machine,_The_Roastery,_Coaltown_Coffee,_Ammanford,_Wales.jpg">Vouliagmeni</a> (CC BY-SA 4.0), <a href="https://commons.wikimedia.org/wiki/File:Espresso_coffee_pouring_from_retro_espresso_machine.jpg">Shixart1985</a> (CC BY 2.0), all on Wikimedia Commons.</p>+ <p class="letter__credit" data-credits>Photographs: <a href="https://commons.wikimedia.org/wiki/File:Cooling_time_for_coffee.jpg">Jameswasswa</a> (CC BY-SA 4.0), <a href="https://commons.wikimedia.org/wiki/File:Coffee_roasting_machine,_The_Roastery,_Coaltown_Coffee,_Ammanford,_Wales.jpg">Vouliagmeni</a> (CC BY-SA 4.0), <a href="https://commons.wikimedia.org/wiki/File:Espresso_coffee_pouring_from_retro_espresso_machine.jpg">Shixart1985</a> (CC BY 2.0), all on Wikimedia Commons.</p></div></div></footer>diff --git a/skills/hallmark/scripts/fixtures/exemplars/modern-minimal.html b/skills/hallmark/scripts/fixtures/exemplars/modern-minimal.htmlindex fb02c1b..cd66f80 100644--- a/skills/hallmark/scripts/fixtures/exemplars/modern-minimal.html+++ b/skills/hallmark/scripts/fixtures/exemplars/modern-minimal.html@@ -13,7 +13,7 @@<style>/* Hallmark · shape: Conversational FAQ, opened by the product · genre: modern-minimal · theme: Coral (by request)* hero: Settled · nav: edge-aligned, the wordmark at the left, one link and one outlined pill at the right · footer: mast, the wordmark large over the links · imagery: product sample in hero, demo-2 and demo-3, photographs library 1 muted sepia=8 · signature: invoice 0042 being chased, live in the hero- * axes: light/grotesk-sans/warm · posture: restrained · contrast: pass · fold: pass · v2.8.0 */+ * axes: light/grotesk-sans/warm · posture: restrained · contrast: pass · fold: pass · v2.0.0 *//* Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V5 · weakest: E, the built screens must read as one product at every width, so every inner length is in em on a container-unit base, the screens scale as a whole and re-lay themselves on a phone *//* Hallmark · hero-review: subagent · fix · 5 findings · 5 resolved · finish-review: in-thread, the subagent limit was reached · ship · 1 finding · 1 resolved · gap: none */:root {diff --git a/skills/hallmark/scripts/fixtures/exemplars/playful.html b/skills/hallmark/scripts/fixtures/exemplars/playful.htmlindex 439e0e5..a4410d5 100644--- a/skills/hallmark/scripts/fixtures/exemplars/playful.html+++ b/skills/hallmark/scripts/fixtures/exemplars/playful.html@@ -11,7 +11,7 @@<style>/* Hallmark · shape: Photographic · genre: playful · theme: Overprint (by request)* hero: Poster · nav: slab, the ink bar with the wordmark in stock colour, three links and a knocked-out Tickets outline · footer: mast, the wordmark across the container over the bar rule · imagery: photographs, library 6, mono pulled through one pass each · signature: the bill knocked out of a gig photograph printed in the orange pass · overprint: newsprint- * axes: light/grotesk-heavy/cool · posture: full-palette · contrast: pass · fold: pass · v2.8.0 */+ * axes: light/grotesk-heavy/cool · posture: full-palette · contrast: pass · fold: pass · v2.0.0 *//* Hallmark · pre-emit critique: P4 H5 E4 S4 R4 V4 · weakest: S, the brief names no acts, so the listing is one honest slot and the photographs and the two times carry the night *//* Hallmark · hero-review: in-thread · fix · 2 findings · 1 resolved 1 partial (the stage act is a laptop duo; the library holds no band shot with a dark foot, so the handoff asks for the venue's own) · finish-review: in-thread · fix · 1 finding · 1 resolved (the bill's room under the Poster raised to 96px) · gap: the two passes never cross on this page, so the moss shows nowhere */:root {diff --git a/skills/hallmark/scripts/fixtures/eyebrow-pass/index.html b/skills/hallmark/scripts/fixtures/eyebrow-pass/index.htmlindex f59a0db..3c8a194 100644--- a/skills/hallmark/scripts/fixtures/eyebrow-pass/index.html+++ b/skills/hallmark/scripts/fixtures/eyebrow-pass/index.html@@ -22,7 +22,7 @@<style>/* Hallmark · shape: fixture · genre: editorial · theme: fixture (by request)* hero: Settled · nav: none · footer: none · enrichment: none · signature: none, this is a gate 54 fixture- * axes: light/roman-serif/cool · posture: restrained · contrast: pass · fold: n/a · v2.7.0 */+ * axes: light/roman-serif/cool · posture: restrained · contrast: pass · fold: n/a · v2.0.0 *//* Hallmark · pre-emit critique: P3 H3 E3 S3 R3 V3 · weakest: all, this is a fixture *//* Hallmark · answered F21 · unrelated fragments in one file, not a single document outline */:root {diff --git a/skills/hallmark/scripts/imagegen.mjs b/skills/hallmark/scripts/imagegen.mjsindex 022d415..25deab3 100644--- a/skills/hallmark/scripts/imagegen.mjs+++ b/skills/hallmark/scripts/imagegen.mjs@@ -64,6 +64,7 @@ try {method: "POST",headers: { "content-type": "application/json", authorization: `Bearer ${key}` },body: JSON.stringify({ model, prompt, width: w, height: h, steps, n, response_format: "b64_json" }),+ signal: AbortSignal.timeout(180000),});if (!res.ok) {const detail = (await res.text()).slice(0, 300);diff --git a/skills/hallmark/scripts/install-hook.mjs b/skills/hallmark/scripts/install-hook.mjsindex afceee6..4b0a6cf 100644--- a/skills/hallmark/scripts/install-hook.mjs+++ b/skills/hallmark/scripts/install-hook.mjs@@ -1,5 +1,5 @@#!/usr/bin/env node-import { readFileSync, writeFileSync, mkdirSync, existsSync } from "node:fs";+import { readFileSync, writeFileSync, mkdirSync, existsSync, renameSync, realpathSync } from "node:fs";import { fileURLToPath } from "node:url";import { dirname, join } from "node:path";import { homedir } from "node:os";@@ -17,7 +17,7 @@ const settingsPath = has("--global")const hookEntry = {matcher: MATCHER,- hooks: [{ type: "command", command: HOOK_CMD, timeout: 5000 }],+ hooks: [{ type: "command", command: HOOK_CMD, timeout: 10 }],};function readSettings() {@@ -28,7 +28,7 @@ function readSettings() {}}-const ourHook = (h) => typeof h?.command === "string" && h.command.includes("lint-hook.mjs");+const ourHook = (h) => typeof h?.command === "string" && /hallmark[\\/]scripts[\\/]lint-hook\.mjs/.test(h.command);const withoutOurs = (list) => list.flatMap((e) => {if (!Array.isArray(e?.hooks) || !e.hooks.some(ourHook)) return [e];const rest = e.hooks.filter((h) => !ourHook(h));@@ -41,20 +41,30 @@ if (has("--print")) {process.exit(0);}+if (has("--remove") && !existsSync(settingsPath)) {+ console.log(`no ${settingsPath}; nothing to remove`);+ process.exit(0);+}+const settings = readSettings();+if (!settings || typeof settings !== "object" || Array.isArray(settings)) { console.error(`refusing to rewrite ${settingsPath}: it is not a JSON object`); process.exit(1); }settings.hooks ??= {};settings.hooks.PostToolUse ??= [];+if (!Array.isArray(settings.hooks.PostToolUse)) { console.error(`refusing to rewrite ${settingsPath}: hooks.PostToolUse is not a list`); process.exit(1); }+// Write beside the file and rename over it, so a crash never leaves settings.json half written.+// A symlinked settings.json (a dotfiles repo) keeps its link: the write lands on the file it points at.+const save = () => { const dest = existsSync(settingsPath) ? realpathSync(settingsPath) : settingsPath; const tmp = `${dest}.hallmark-tmp`; writeFileSync(tmp, JSON.stringify(settings, null, 2) + "\n"); renameSync(tmp, dest); };settings.hooks.PostToolUse = withoutOurs(settings.hooks.PostToolUse);if (has("--remove")) {- writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");+ save();console.log(`removed the Hallmark lint hook from ${settingsPath}`);process.exit(0);}settings.hooks.PostToolUse.push(hookEntry);mkdirSync(dirname(settingsPath), { recursive: true });-writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");+save();console.log(`installed the Hallmark edit-time lint hook into ${settingsPath}`);console.log(`it lints Hallmark .html and .css files, and .jsx, .tsx, .vue, .svelte and .astro files inside a project with a .hallmark folder, on write; it advises and never blocks. Remove with --remove.`);diff --git a/skills/hallmark/scripts/install.mjs b/skills/hallmark/scripts/install.mjsindex 9819656..1e19a07 100644--- a/skills/hallmark/scripts/install.mjs+++ b/skills/hallmark/scripts/install.mjs@@ -37,6 +37,7 @@ function copyDir(src, dest) {fs.mkdirSync(dest, { recursive: true });for (const entry of fs.readdirSync(src, { withFileTypes: true })) {if (entry.name === ".DS_Store" || entry.name === ".hallmark" || entry.name === "node_modules" || entry.name === "fixtures") continue;+ if (entry.isSymbolicLink()) continue; // never follow a link out of the skill into the installconst s = path.join(src, entry.name);const d = path.join(dest, entry.name);if (entry.isDirectory()) copyDir(s, d);diff --git a/skills/hallmark/scripts/picture.mjs b/skills/hallmark/scripts/picture.mjsindex f052924..bf50e5f 100644--- a/skills/hallmark/scripts/picture.mjs+++ b/skills/hallmark/scripts/picture.mjs@@ -11,6 +11,7 @@ if (!slug || !pageArg) {console.error('usage: node picture.mjs <theme slug> <page index.html> [y of the lower screen at 1440x900]');process.exit(2);}+if (!/^[a-z0-9][a-z0-9-]*$/.test(slug)) { console.error(`not a theme slug: ${slug}`); process.exit(2); }const page = resolve(pageArg);const themeFile = join(THEMES, `${slug}.md`);if (!existsSync(themeFile)) { console.error(`no theme at ${themeFile}`); process.exit(1); }diff --git a/skills/hallmark/scripts/sloplint-render.mjs b/skills/hallmark/scripts/sloplint-render.mjsindex 2712c7b..0fb35a1 100644--- a/skills/hallmark/scripts/sloplint-render.mjs+++ b/skills/hallmark/scripts/sloplint-render.mjs@@ -153,6 +153,7 @@ export async function renderCheck(htmlFiles, metaIn) {if (width === 1280) await shoot(page, file, `${prefix}1280x800`, false);if (width === 375 && !heroOnly) { await settleImages(page); await frames(page); }if (width === 375) await shoot(page, file, heroOnly ? 'hero-375x812' : '375', !heroOnly);+ if (!heroOnly && (width === 375 || width === 1280)) for (const f of await page.evaluate(lineBreaks).catch(() => [])) findings.push({ ...f, file, line: 1 });const res = await page.evaluate(observe, width === 1280, pageMeta);const measured = new Map();for (const f of res) {@@ -669,6 +670,41 @@ function observe(checkFold, meta) {return out;}+// F26: a paragraph whose last line is one short word (a straggler), or a head of two or three lines whose last line is a stub+function lineBreaks() {+ const out = [];+ const vis = (el) => { const s = getComputedStyle(el); if (s.display === 'none' || s.visibility === 'hidden' || parseFloat(s.opacity) === 0) return false; const r = el.getBoundingClientRect(); return r.width > 1 && r.height > 1; };+ const lines = (el) => {+ const rows = [];+ const w = document.createTreeWalker(el, NodeFilter.SHOW_TEXT);+ for (let t = w.nextNode(); t; t = w.nextNode()) {+ if (!t.textContent.trim() || t.parentElement.closest('svg, [aria-hidden="true"]')) continue;+ const rg = document.createRange(); rg.selectNodeContents(t);+ for (const q of rg.getClientRects()) {+ if (!q.width || !q.height) continue;+ const row = rows.find((x) => Math.abs(x.mid - (q.top + q.height / 2)) < q.height / 3);+ if (row) { row.l = Math.min(row.l, q.left); row.r = Math.max(row.r, q.right); } else rows.push({ mid: q.top + q.height / 2, l: q.left, r: q.right });+ }+ }+ return rows.sort((a, b) => a.mid - b.mid).map((x) => x.r - x.l);+ };+ const bad = [];+ for (const e of document.querySelectorAll('p, li, blockquote, h1, h2, h3')) {+ if (bad.length >= 3 || !vis(e) || e.closest('nav, footer, svg, pre, code, table, [aria-hidden="true"], [data-slot]') || e.querySelector('br')) continue;+ const text = (e.innerText || '').trim(); const words = text.split(/\s+/).length;+ if (words < 4 || e.getBoundingClientRect().width < 200) continue;+ const cs = getComputedStyle(e); const wrap = `${cs.textWrap || ''} ${cs.textWrapStyle || ''}`;+ if (/flex|grid|table/.test(cs.display) || [...e.children].some((c) => /flex|grid|block|table/.test(getComputedStyle(c).display))) continue;+ const ls = lines(e); if (ls.length < 2) continue;+ const last = ls[ls.length - 1], widest = Math.max(...ls), prev = ls[ls.length - 2];+ const head = /^H[123]$/.test(e.tagName);+ if (head && ls.length <= 3 && !/balance/.test(wrap) && last < prev * 0.35) bad.push(`${e.tagName.toLowerCase()} "${text.replace(/\s+/g, ' ').slice(0, 32)}" ends on a stub`);+ else if (!head && !/pretty|balance/.test(wrap) && !/\s/.test(text.split(/\s+/).slice(-1)[0]) && last < widest * 0.3 && ls.length >= 2 && (e.innerText || '').trim().split('\n').pop().trim().split(/\s+/).length === 1) bad.push(`"${text.replace(/\s+/g, ' ').slice(0, 32)}" leaves one word on its last line`);+ }+ if (bad.length) out.push({ gate: 'F26', grade: 'WARN', evidence: `[${innerWidth}px] ${bad.join('; ')}`, fix: 'text-wrap: balance on heads and pretty on body copy, or rewrite the line; a <br> goes only between phrases and is checked at 375' });+ return out;+}+function observeSpace(atLaptop, heroOnly, heroPosture, photoShape) {const freeFold = /^(poster|ledge|banner|custom)$/.test(heroPosture || '');const out = [];diff --git a/skills/hallmark/scripts/sloplint.mjs b/skills/hallmark/scripts/sloplint.mjsindex e25cf9e..7beb86f 100644--- a/skills/hallmark/scripts/sloplint.mjs+++ b/skills/hallmark/scripts/sloplint.mjs@@ -771,6 +771,8 @@ function resolveVars(value, tokens, local = null, depth = 0) {return resolveVars(out, tokens, local, depth + 1);}+// A family's identity ignores spaces, hyphens and underscores, so "GeistSans" and "Geist Sans" are one face+const famKey = (f) => String(f || '').replace(/[\s_-]+/g, '');function firstFamily(value) {const first = value.split(',')[0].trim().replace(/^['"]|['"]$/g, '').toLowerCase();return first;@@ -829,7 +831,7 @@ function tierOf(gate) {function fontFamilyCount(ctx) {const fams = new Set();for (const [prop, val] of Object.entries(ctx.tokens || {})) {- if (/^--font-/.test(prop)) fams.add(firstFamily(resolveVars(val, ctx.tokens)));+ if (/^--font-/.test(prop)) fams.add(famKey(firstFamily(resolveVars(val, ctx.tokens))));}return fams.size;}@@ -1100,7 +1102,7 @@ function check1(ctx) {const banned = new Set(['inter', 'roboto', 'open sans', 'poppins', 'lato', 'system-ui', '-apple-system', 'arial', 'helvetica', 'helvetica neue', 'segoe ui']);const seen = new Set();const flag = (fam, file, line, where) => {- if (banned.has(fam) && !seen.has(fam + where)) {+ if ([...banned].some((b) => famKey(b) === famKey(fam)) && !seen.has(fam + where)) {seen.add(fam + where);report(1, 'FAIL', file, line, `display font "${fam}" (${where})`, 'Pick a display face from the typography catalog');}@@ -1802,7 +1804,7 @@ function check37(ctx) {if (/^--font-/.test(d.prop) && !isTokenRule(r)) continue;const fam = firstFamily(resolveVars(d.value, ctx.tokens));if (!fam || generic.has(fam) || fam.startsWith('var(')) continue;- if (!families.has(fam)) families.set(fam, { file: r.file, line: d.line });+ if (![...families.keys()].some((k) => famKey(k) === famKey(fam))) families.set(fam, { file: r.file, line: d.line });}}if (families.size > 3) {@@ -2608,7 +2610,7 @@ function checkF3(ctx) {&& r.decls.some((d) => d.prop === 'font-size' && (maxPxIn(resolveVars(d.value, ctx.tokens)) ?? 0) >= 40);if (!isH12 && !isDisplayClass) continue;targets.push(r);- if (r.decls.some((d) => /^text-wrap(-style)?$/.test(d.prop) && /balance|pretty/.test(d.value))) satisfied = true;+ if (r.decls.some((d) => /^text-wrap(-style)?$/.test(d.prop) && /balance/.test(d.value))) satisfied = true;}if (targets.length && !satisfied) {report('F3', 'WARN', targets[0].file, targets[0].line,diff --git a/skills/hallmark/scripts/theme.mjs b/skills/hallmark/scripts/theme.mjsindex 7617f0f..90c5287 100644--- a/skills/hallmark/scripts/theme.mjs+++ b/skills/hallmark/scripts/theme.mjs@@ -7,7 +7,7 @@ import { createHash, randomBytes } from 'node:crypto';const HERE = dirname(fileURLToPath(import.meta.url));const THEMES = join(HERE, '..', 'references', 'themes');const INDEX = join(THEMES, 'index.json');-const VERSION = '2.8.0';+const VERSION = '2.0.0';const PHOTOS = join(HERE, 'photos.json');const args = process.argv.slice(2);const cmd = args[0];@@ -16,6 +16,8 @@ const has = (k) => args.includes('--' + k);const VALUED = new Set(['genre', 'brief', 'log', 'n', 'reroll', 'dealt', 'dir', 'axes', 'face', 'hue', 'entry', 'redesign', 'theme', 'orient', 'save', 'avoid', 'material', 'seed']);const positional = () => { const out = []; for (let i = 1; i < args.length; i++) { const a = args[i]; if (a.startsWith('--')) { if (VALUED.has(a.slice(2))) i++; continue; } out.push(a); } return out; };const GENRES = ['editorial', 'modern-minimal', 'atmospheric', 'playful'];+// A theme slug names a file in references/themes, so it is a plain name, never a path.+const isSlug = (s) => /^[a-z0-9][a-z0-9-]*$/.test(s);function usage() {console.error(`usage:@@ -171,7 +173,7 @@ function draw() {const low = (x) => String(x || '').toLowerCase();let pictured = [];const slug = flag('theme', '');- if (slug && existsSync(join(THEMES, `${slug}.md`))) pictured = low(parseHeader(readFileSync(join(THEMES, `${slug}.md`), 'utf8'), slug).pictured).split(/,\s*/).map((x) => x.replace(/ hero$/, ''));+ if (slug && isSlug(slug) && existsSync(join(THEMES, `${slug}.md`))) pictured = low(parseHeader(readFileSync(join(THEMES, `${slug}.md`), 'utf8'), slug).pictured).split(/,\s*/).map((x) => x.replace(/ hero$/, ''));const recent = (k, n) => log.slice(0, n).map((r) => low(r[k]));const near = (opts, n, k, extra = []) => { const bad = new Set([...recent(k, n), ...extra]); const ok = opts.filter((o) => ![...bad].some((b) => b && b.includes(low(o)))); return ok.length ? ok : opts; };const take = (opts, m = 1) => { const pool = [...new Set(opts)]; const out = []; while (out.length < m && pool.length) out.push(pool.splice(Math.floor(rand() * pool.length), 1)[0]); return out; };@@ -323,7 +325,7 @@ async function photos() {let header = null, treat = { css: '', bad: [] };if (slug) {const file = join(THEMES, `${slug}.md`);- if (!existsSync(file)) { console.error(`no theme at ${file}`); process.exit(1); }+ if (!isSlug(slug) || !existsSync(file)) { console.error(`no theme at ${file}`); process.exit(1); }const src = readFileSync(file, 'utf8');header = parseHeader(src, file);treat = treatmentOf(header.photo, tokensOf(src, file));@@ -376,9 +378,12 @@ async function photos() {const w = p.sizes[p.sizes.length - 1];const file = join(resolve(saveDir), `${savedName(p.id)}-${w}.jpg`);try {+ const url = thumbOf(p, w);+ if (!url.startsWith('https://upload.wikimedia.org/')) throw new Error('not a Wikimedia Commons file');let res;- for (let t = 0; t < 4; t++) { res = await fetch(thumbOf(p, w), { headers: { 'User-Agent': 'Hallmark/2.8 (https://github.com/Nutlope/hallmark; theme.mjs photos --save)' } }); if (res.status !== 429) break; await new Promise((ok) => setTimeout(ok, 10000 * (t + 1))); }+ for (let t = 0; t < 4; t++) { res = await fetch(url, { headers: { 'User-Agent': 'Hallmark/2.0 (https://github.com/Nutlope/hallmark; theme.mjs photos --save)' }, signal: AbortSignal.timeout(60000) }); if (res.status !== 429) break; await new Promise((ok) => setTimeout(ok, 10000 * (t + 1))); }if (!res.ok) throw new Error(`HTTP ${res.status}`);+ if (!/^image\//.test(res.headers.get('content-type') || '')) throw new Error(`not an image (${res.headers.get('content-type') || 'no content-type'})`);writeFileSync(file, Buffer.from(await res.arrayBuffer())); p.saved = file;} catch (e) { p.saved = null; p.error = String(e.message || e); }}@@ -482,7 +487,7 @@ function scaffold() {let header = null;if (!custom) {const file = join(THEMES, `${slug}.md`);- if (!existsSync(file)) { console.error(`no theme at ${file}; run \`theme.mjs list\` for the slugs`); process.exit(1); }+ if (!isSlug(slug) || !existsSync(file)) { console.error(`no theme at ${file}; run \`theme.mjs list\` for the slugs`); process.exit(1); }const src = readFileSync(file, 'utf8');header = parseHeader(src, file);name = header.name;