Anti-AI-slop design skill for Claude Code, Cursor, and Codex.
CSS
Hallmark 2.5: redesign returns as a verb, with a record of what the page must keep
Youssef3569c58d86c5
diff --git a/README.md b/README.mdindex 2a85e67..bfebad1 100644--- a/README.md+++ b/README.md@@ -91,17 +91,34 @@ node skills/hallmark/scripts/install.mjs| Harness | Install location | Invoke || --- | --- | --- |-| Claude Code | `~/.claude/skills/hallmark` | `/hallmark <brief>` or just describe the build |-| Codex CLI | `~/.agents/skills/hallmark` | `$hallmark <brief>` or implicit |-| OpenCode | auto-discovers the copies above | `/hallmark <brief>` or implicit |+| Claude Code | `~/.claude/skills/hallmark` | `/hallmark <brief>`, `/hallmark redesign <path>`, or just describe the build |+| Codex CLI | `~/.agents/skills/hallmark` | `$hallmark <brief>`, `$hallmark redesign <path>`, or implicit |+| OpenCode | auto-discovers the copies above | `/hallmark <brief>`, `/hallmark redesign <path>`, or implicit |On Claude Code, `node skills/hallmark/scripts/install-hook.mjs` wires the Floor gates into a PostToolUse hook so a failing artifact is reported the moment it is written; the taste gates wait for the end-of-build sweep, so the hook never nags. `--global`, `--print` and `--remove` do what they say.----## The verbs+## Redesign-Auditing a page, redesigning one, studying a reference and dealing variants are separate skills (`/audit`, `/redesign`, `/study`, `/variants`) in a companion pack that installs beside Hallmark and reads its gates and craft files, so they never drift from the build skill. Hallmark itself does one job: build.+Hallmark runs by itself when you ask for something new. For a page, a site or an app that already exists, say the verb:++```+/hallmark redesign ./src/app+/hallmark audit ./index.html+```++A redesign keeps what the page says and does and changes how it looks, at the depth you ask for:++| Depth | Stays | Changes |+| --- | --- | --- |+| **polish** | the system and the layout | only what reads as generated: the tells, contrast, states, motion |+| **restyle** | the layout | colour, type, radius, shadow, motion, the controls |+| **full** | the content and the wiring | the system and the composition |++Before it touches anything, `sloplint --before` lints the page and records every link, form field, handler, test hook, heading and figure. After the build, `sloplint --kept` fails the redesign if any of them went missing, a fresh-context reviewer compares the new screens with the old ones, and the project's own build and tests have to pass. The handoff is a before and after: findings, what was kept, what changed, and anything dropped, with the reason on the record. `audit` stops after the report and edits nothing.++Dashboards, admin screens and tools are app screens: the landing-page rules (hero, fold, section rhythm) step aside and density, tables and the four data states take over. Small edits to an existing design are not Hallmark runs; the edit-time hook below keeps the Floor on them in the background.---@@ -111,7 +128,12 @@ Auditing a page, redesigning one, studying a reference and dealing variants arenpx skills add nutlope/hallmark```-Re-run any time to update, or copy [`SKILL.md`](skills/hallmark/SKILL.md), [`references/`](skills/hallmark/references/) and [`scripts/`](skills/hallmark/scripts/) into your harness's skills folder. Worked examples in [`docs/recipes.md`](docs/recipes.md).+Re-run any time to update. Worked examples in [`docs/recipes.md`](docs/recipes.md).++- **One harness only:** `npx skills add nutlope/hallmark --agent claude-code` (or `codex`, `opencode`, `cursor`, `github-copilot`).+- **By hand:** copy the whole [`skills/hallmark/`](skills/hallmark/) folder (`SKILL.md`, `references/` and `scripts/` together) into your harness's skills folder: `~/.claude/skills/`, `~/.agents/skills/`, or `.cursor/skills/` in a project. Any harness that reads Agent Skills can run it; Claude Code, Codex CLI and OpenCode are the three it is tuned and tested on.+- **If it does not fire on its own,** name it: *use hallmark to build ...*. Smaller models rarely pick up a skill unprompted.+- **Models:** the flow leans on long instructions, tool calls and, for the reviews, subagents. It is tuned on current Claude and GPT models; small local models tend to stall partway.---diff --git a/ROADMAP.md b/ROADMAP.mdindex 1480185..1d1de78 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -2,7 +2,7 @@What is next for Hallmark.-**Where v2 stands.** Hallmark does one job, build. A build deals three themes from a catalog of forty-nine materials, each with a picture of a finished page, or derives a world of its own on request. A Floor of hard rules and a set of Reflex defaults are enforced by a zero-dependency linter that reads HTML, CSS, framework components and Tailwind classes, and with `--render` measures the page itself: the fold at three widths, contrast against the pixels behind the text, focus rings found by tabbing, section rhythm, heads crowding what precedes them, text cramped against its box or painted under another element. Two fresh-context reviews, of the first screen and of the finished page, close every build.+**Where v2 stands.** Hallmark builds new pages by itself and redesigns existing ones when asked by name. A build deals three themes from a catalog of forty-nine materials, each with a picture of a finished page, or derives a world of its own on request. A redesign records what the page says and does before it starts, works at one of three depths (polish, restyle, full), and fails its own sweep if a link, a form field, a handler or a test hook went missing. A Floor of hard rules and a set of Reflex defaults are enforced by a zero-dependency linter that reads HTML, CSS, framework components and Tailwind classes, and with `--render` measures the page itself: the fold at three widths, contrast against the pixels behind the text, focus rings found by tabbing, section rhythm, heads crowding what precedes them, text cramped against its box or painted under another element. Two fresh-context reviews, of the first screen and of the finished page, close every build.---@@ -10,7 +10,7 @@ What is next for Hallmark.**Decide the field's newest named defaults.** The leading design skills now also name cream or off-white paper on its own, pill-shaped buttons, near-black with one acid accent, and the hairline broadsheet as generated looks. Sixteen catalog themes sit on cream papers and nineteen put their controls on a full pill. Custom runs already treat these as spent; the catalog needs a decision: keep them as deliberate materials dealt only on their keywords, or re-paper and re-shape the ones that drift there.-**Conformance on all three harnesses.** Run the same brief through Claude Code, `codex exec` and OpenCode's non-interactive mode and assert each one reaches a 0 FAIL sweep with its fresh-context review recorded.+**Conformance on all three harnesses.** Run the same brief and the same redesign through Claude Code, `codex exec` and OpenCode's non-interactive mode and assert each one reaches a 0 FAIL sweep with its fresh-context review recorded.**Measure a build.** Time and token cost of one page build before and after the v2 efficiency pass (patterns in place of a whole exemplar page, `base.css` written by the scaffold, review briefs the builder never reads), on the same brief.@@ -21,7 +21,9 @@ What is next for Hallmark.- **Theme-aware motion tokens.** Per-theme `--dur-micro`, `--dur-short` and `--dur-long` from each theme's motion character, so a severe theme moves faster than a calm one without hand-tuning.- **Multi-page coherence.** Lock the brand axes in a `design.md`, vary the page-voice axes: different pages of one site, not different sites.- **Brand-first flow.** From a short product description, a complete brand (palette, type, voice, imagery through the image hook) locked into a `design.md`, then every page built against it.-- **The edit-time hook on by default.** `scripts/install-hook.mjs` is opt-in today; ship a project `.claude/settings.json` with it wired.+- **The edit-time hook on by default.** `scripts/install-hook.mjs` is opt-in today; a Claude Code plugin could ship it wired, so small edits to a Hallmark page keep the Floor without calling the skill.+- **App screens in depth.** The app scope skips the landing-page gates and names what replaces them; next are checks of its own (the four data states, table figures, a control vocabulary that holds across screens).+- **Study, as a verb.** Reading a reference page into a direction the build can use; about one run in fourteen asked for it in v1.---diff --git a/package.json b/package.jsonindex 73b3dfb..eb921bd 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "hallmark",- "version": "2.4.0",+ "version": "2.5.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/skills/hallmark/SKILL.md b/skills/hallmark/SKILL.mdindex c0879d9..584e052 100644--- a/skills/hallmark/SKILL.md+++ b/skills/hallmark/SKILL.md@@ -1,7 +1,8 @@---name: hallmark-description: "Design skill for pages, sites and components that look made, not generated. Deals a theme from its catalog or derives a world, sets type, colour, layout and motion to a hard floor, builds, then lints and reviews the result. Use when the user asks to build, design, style or lay out a page, landing page, site, app screen or UI component, or invokes Hallmark by name."-version: 2.4.0+description: "Design skill for pages, sites, app screens and components that look made, not generated. Builds new UI from a dealt theme or a derived world on a hard floor, then lints and reviews it; `redesign <path>` does the same to an existing page, site or app and keeps its content and wiring. Use when the user asks to build or design new UI, asks to redesign or restyle a whole page, site or app, says one looks generic or AI-generated, or invokes Hallmark by name. Not for small edits to an existing design."+argument-hint: "<brief> | redesign <path> | audit <path>"+version: 2.5.0---# Hallmark@@ -37,12 +38,14 @@ Above the Floor, a **Reflex** gate is a default a model falls into, which a buil0. Pre-flight: read the project before asking anything.1. Ask once: material, audience, use, tone.-2. Shape: design the page, then name what you designed.-3. Direction: deal a theme (the default) or derive a world (only when asked for custom).-4. Load `references/craft.md`, the genre file, the theme file, and `gates.md` § 1 to § 4.-5. The Picks block, once, then a beat before code.+2. Shape: design the page, then name it.+3. Direction: deal a theme, or derive a world when asked for custom.+4. Load the craft, genre and theme files and `gates.md` § 1 to § 4.+5. The Picks block, once.6. Build: the hero first, then the page; stamp, `tokens.css`, log.-7. Sweep: `sloplint --render` until clean, the judged gates (`gates.md` § 5), the finish review (§ 6), the material ask.+7. Sweep: `sloplint --render` until clean, the judged gates, the finish review, the material ask.++**Verbs.** `redesign <target>`, `audit <target>`, or a plain ask to redesign, restyle or polish an existing page, site or app: read [`references/redesign.md`](references/redesign.md) first; it stands in for Steps 0 to 2 and adds a before and an after. A small edit to an existing design is not a Hallmark run.Codex CLI and OpenCode read [`references/flow.md`](references/flow.md) § Harnesses first; other harnesses run this file as written.@@ -62,11 +65,11 @@ Skipped fields are opt-outs: infer them, state the inferences in one line at the**Genre** is picked here, silently, from the brief: *AI tool, generative, music, video, voice, dark, atmospheric* → **atmospheric**; *SaaS, enterprise, API, platform, developer tool, infra, B2B* → **modern-minimal**; *playful, fun, friendly, soft, kids, games, community* → **playful**; otherwise **editorial**, which holds most consumer and family briefs. The picked theme's genre wins from Step 4 on (genre file, stamp, `--genre`); when two non-default genres fire, add one either-or to the Step 1 message, or on go ahead pick and say so.-**Scope** is checked here too. A brief naming one element (button, input, card, modal, nav, footer, tab strip, chip) or saying "just the X" is a component: read [`references/flow.md`](references/flow.md) § Component scope and skip macrostructure, chrome, enrichment and the log.+**Scope** is checked here too. A brief naming one element (button, input, card, modal, nav, footer, tab strip, chip) or saying "just the X" is a component: read [`references/flow.md`](references/flow.md) § Component scope and skip macrostructure, chrome, enrichment and the log. A screen someone works in (a dashboard, an admin, settings, a tool) is an app screen: § App screens.### 2. Shape-**Material first.** Before the shape, write the inventory in one line: *real* (every concrete thing the brief and the project supply: the name, the claim, numbers, places, dates, inputs and outputs, images), *slots* (what the user will hand over later), *absent* (every proof the page will not have: logos, quotes, metrics nobody gave). The shape follows it: shapes built on screenshots (Bento, Workbench, Feature Stack) need two real visuals or the user's "leave slots"; with neither, choose a shape that carries type and facts (Long Document, Letter, Index-First, Manifesto, a spec sheet built on `components/f3-tabular-spec-sheet.md`). Pages read as generated when they have nothing to show and pretend otherwise.+**Material first.** Before the shape, write the inventory in one line: *real* (every concrete thing the brief and the project supply: the name, the claim, numbers, places, dates, images), *slots* (what the user will hand over later), *absent* (every proof the page will not have: logos, quotes, metrics nobody gave). The shape follows it: shapes built on screenshots (Bento, Workbench, Feature Stack) need two real visuals or the user's "leave slots"; with neither, choose a shape that carries type and facts (Long Document, Letter, Index-First, Manifesto, a spec sheet built on `components/f3-tabular-spec-sheet.md`).Decide the page's shape, how it opens, how sections separate, what the nav and footer do, how tall the hero stands and what carries it. You are designing, not filling a form. For a starting point: 21 page shapes in [`references/macrostructures.md`](references/macrostructures.md), navs, footers and sections in [`references/component-cookbook.md`](references/component-cookbook.md), enrichment in [`references/hero-enrichment.md`](references/hero-enrichment.md); load only the one file you pick, never a whole catalog.@@ -74,7 +77,7 @@ Decide the page's shape, how it opens, how sections separate, what the nav and f**Signature.** Every page has one move a visitor would describe to a friend: an object, a composition, an interaction, built from the inventory's strongest real thing. Decide it here and fit it to the dealt theme's objects; it goes in the Picks block and the stamp, it shows on the first screen (a slot's caption counts), and the reviewer checks it. A page without one is a template with good tokens.-Decide all of this and hold it. It is said once, at Step 5.+Decide all of this and hold it; it is said once, at Step 5.### 3. Direction@@ -88,7 +91,7 @@ Check in order; the first match wins.node <skill-dir>/scripts/theme.mjs deal --genre <genre> --brief "<the brief>" [--log .hallmark/log.json]```-It deals three themes that fit the brief and clear Rotation (consecutive systems differ on paper band, display class or accent band), with a reproducible seed. Look at the three pictures, pick the one whose material can carry what the brief asks for (motion, photographs, code), say which and why, and load only `references/themes/<slug>.md`. Re-deal only when the user asks (`--reroll 1`). No Node: read `references/themes/index.json`, apply the same rule by hand, and stamp `deal: manual`.+It deals three themes that fit the brief and clear Rotation, with a reproducible seed. Look at the three pictures, pick the one whose material can carry what the brief asks for (motion, photographs, code), say which and why, and load only `references/themes/<slug>.md`. Re-deal only when the user asks (`--reroll 1`). No Node: read `references/themes/index.json`, apply the same rule by hand, and stamp `deal: manual`.A catalog theme is a material, not a plan: it never sets what the page contains or in what order, and two pages in one theme should not share a section sequence. Where the theme and a shape, genre, craft or enrichment file disagree on material, controls or motion, the theme wins; the Floor and the user's own words beat both.@@ -105,7 +108,7 @@ Loading more is the largest avoidable cost; `gates.md` § 5 waits for Step 7, §The run's only prose recital of its decisions, and the user's five-second redirect window:```markdown-**Hallmark · v2.4.0**+**Hallmark · v2.5.0**- **Shape** · Workbench (last 3: Bento, Long Document, Manifesto) · genre modern-minimal- **Theme** · Coral, dealt 2/3 (warm grey, one coral signal, General Sans, soft pills) · clears Cobalt on paper band@@ -119,7 +122,7 @@ The run's only prose recital of its decisions, and the user's five-second redireA custom run's rows are in `direction.md` R.7. Then one quiet line: *System portable? Say `lock the system` for a `design.md`.* Skip it in component scope or when `design.md` exists.-On signal 9, [`references/comp.md`](references/comp.md) runs here; absent the key the step does not exist.+On signal 9, `comp.md` runs here.### 6. Build@@ -127,7 +130,7 @@ Emit code that satisfies the theme and the shape. Always:- **Start from the scaffold.** `node <skill-dir>/scripts/theme.mjs scaffold <slug>` (with the deal's `--dealt`; `--custom` on a derived run) writes `tokens.css` (the theme's tokens and the shared scale) and `base.css` (the rules the Floor already decided), and prints the stamp skeleton and the two imports that open the page's stylesheet. Fill the stamp and write only the page.- **Read [`references/patterns.md`](references/patterns.md) once:** controls in all eight states, a slot, a missing fact, a form that posts nowhere yet, one reveal, figures that compare, written to pass the gates. Take their shape, never their copy.-- **Hero first.** Write the nav and the hero, run `node <skill-dir>/scripts/sloplint.mjs <file> --render --stage hero`, then the hero review in fresh context (`gates.md` § 6). Build the sections only once the hero ships: a hero rewrite after eight sections exist costs eight sections.+- **Hero first.** Write the nav and the hero, run `node <skill-dir>/scripts/sloplint.mjs <file> --render --stage hero`, then the hero review in fresh context (`gates.md` § 6). Build the sections only once the hero ships.- **One idea per screen.** Hero: headline (seven words or fewer, 50 characters or fewer), one sentence (twelve words or fewer), one or two actions. A section: a heading of three to five words, at most one line, then its object (a slot, a figure, a drawn thing, a list of four or fewer, a table of five rows or fewer). Four to eight sections, footer included; 450 visible words at most, fewer when the brief has less to say. Never pad to a count.- **Show, do not describe.** On a product page with material or "leave slots": at least two `data-slot` containers, the hero visual (unless the theme's own object holds the hero) and a demo strip (or one capture per stage where the shape stages the product); with neither, the page shows what is real (Step 2). The user's images fill them; otherwise a designed placeholder in the theme's colours with a corner label (`craft.md` § Demo slots). Never a grey box or a fake screenshot with invented figures.- **The fold.** The hero is the first screen and only the first screen at 1440 x 900 and 1920 x 1080, its visual beside the text (centres within 60px, 48 to 120px apart), never pinned in a corner; a Banner shares it with the first section.@@ -136,7 +139,7 @@ Emit code that satisfies the theme and the shape. Always:- **Type.** The theme's faces, at most two families (three with one outlier role); display tracking and leading per `craft.md` § 1; body 16px or more at 1.5 to 1.65, 45 to 75ch; heads roman; labels never mono unless mono is the material (64). A head is one weight and one colour throughout; the accented word is a tell (38iii).- **States and motion.** Eight states on every interactive element; `transform` and `opacity` only; at most one orchestrated reveal per page, none where the theme keeps still, 0.4 to 0.8s, visible by default; exits at 60 to 75% of the enter; nothing bounces.- **Browser surfaces.** Keep the scaffold's selection, caret, scrollbar and focus rules; tabular numerals wherever figures compare.-- **Stamp.** Line 1 of CSS is the scaffold's stamp skeleton with every field filled (`hero: Stage · nav: edge-aligned · signature: live pricing table in the hero slot`), then the critique line (`gates.md` § 3), any `waive` and `answered` lines, and a custom run's direction contract. Everything the linter reads sits in the first 40 lines.+- **Stamp.** Line 1 of CSS is the scaffold's stamp skeleton with every field filled, then the critique line (`gates.md` § 3), any `waive` and `answered` lines, and a custom run's direction contract. Everything the linter reads sits in the first 40 lines.- **`tokens.css`** is the scaffold's, at the project root, imported by the page; on a `design.md` project, refresh its `## Exports` ([`references/export-formats.md`](references/export-formats.md)).- **Existing stylesheets are append-only:** keep the Tailwind directives where they are, import `tokens.css` and `base.css` below them, reuse the project's own token names; rewrite only on request.- **Log.** `node <skill-dir>/scripts/theme.mjs log --entry '<json>'` puts the build atop `.hallmark/log.json`: `shape`, `theme`, `axes`, `hero`, `nav`, `footer`, `enrichment`, `entry` (the section opening), `fingerprint` (`Hanging|Asymmetric spans|Hairline|Outlined|Margin-aligned|None`), `signature`, `waived`, `brief`; it names any field you left out.@@ -145,7 +148,7 @@ Emit code that satisfies the theme and the shape. Always:1. `node <skill-dir>/scripts/sloplint.mjs <files> --genre <genre> --render` (add `--scope component` on a component; in a framework project with a dev server running, add `--url http://localhost:<port>/<route>`). Fix every FAIL, re-run until clean. The render tier writes the screenshots; never run Chrome by hand.2. Load [`references/gates.md`](references/gates.md) § 5 and walk the J and R/J gates. Confirm or dismiss every WARN. Fix every open Floor finding; fix or waive every Reflex one; answer every Finish one.-3. The finish review in fresh context (`gates.md` § 6): hand the reviewer its brief file and the inputs it lists, act on its first word (`recapture`, `rebuild`, `fix`, `ship`), and score the fixes yourself.+3. The finish review in fresh context (`gates.md` § 6): hand the reviewer its brief file and its inputs, act on its first word (`recapture`, `rebuild`, `fix`, `ship`), and score the fixes yourself.4. Close with the material ask: every slot, its size and what belongs there, then the one piece of material that would most improve the page.5. Update the Picks block: any row the build changed, and the last row with the real outcome (`Floor 0 FAIL · Reflex 2 (1 waived: 47b) · finish-review: subagent, 3 resolved`). A fabricated pass is itself slop.@@ -153,4 +156,4 @@ Verification is budgeted: one batched inspection, one fix batch, at most one con## Branches-[`references/flow.md`](references/flow.md) holds them; read only the section you are in: component scope, signal 8 (the archive builds, Hallmark sweeps), comp before build, the Codex and OpenCode levers, the pre-flight edge cases, **fast mode** (`--fast`, or a brief that says quick, rough or prototype) and the edit-time hook. In an existing project, name the files you will touch before touching them, and never delete a route or a component tree without a file-level plan the user approved.+[`references/flow.md`](references/flow.md) holds them; read only the section you are in: component scope, app screens, signal 8 (the archive builds, Hallmark sweeps), comp before build, the Codex and OpenCode levers, the pre-flight edge cases, **fast mode** (`--fast`, or a brief that says quick, rough or prototype) and the edit-time hook. In an existing project, name the files you will touch first, and never delete a route or a component tree without a file-level plan the user approved.diff --git a/skills/hallmark/agents/openai.yaml b/skills/hallmark/agents/openai.yamlindex 9397071..559441f 100644--- a/skills/hallmark/agents/openai.yaml+++ b/skills/hallmark/agents/openai.yaml@@ -5,6 +5,7 @@ interface:- "$hallmark a landing page for <product>"- "$hallmark a pricing page for <product>, custom"- "$hallmark a signup form component"+ - "$hallmark redesign <path to a page or an app>"policy:allow_implicit_invocation: truediff --git a/skills/hallmark/references/craft.md b/skills/hallmark/references/craft.mdindex d2e9eee..b82f89f 100644--- a/skills/hallmark/references/craft.md+++ b/skills/hallmark/references/craft.md@@ -162,6 +162,7 @@ The last 2% that separates set from generated. sloplint's F-checks report most o- **Responsive finish.** Body-adjacent UI (meta, nav links, controls, checkboxes) renders larger on mobile and steps down at 60rem; display heads are exempt; body never drops below 16px on a phone. Every desktop sidebar or filter column collapses into a menu or disclosure. Container queries for widgets whose layout depends on their box, placed on the closest wrapper.- **Browser surfaces** (F16). The scaffold's `base.css` themes the selection, the caret, the scrollbar, the focus ring and the underline; keep them, and set numerals tabular wherever they compare. The parts you did not draw still carry the design.- **Nav.** One line, 56 to 80px tall; a sticky one taller than the scaffold's `scroll-padding-top` raises it so anchors and focus land clear. Text-only links in the top bar, one weight across default, hover and active (state is a colour or a soft background, never a primary fill); a tab row scrolls sideways rather than wrapping; under 60rem, links that no longer fit go behind a menu, while two or three short ones that fit stay in the bar; the logo is a link home with an `aria-label`.+- **The document.** `lang` on `<html>`, a `<title>` in the page's own words, a one-sentence meta description (F24); heading levels step one at a time and CSS sets their size (F21); every `<img>` carries `width`, `height` and a file that exists (76).- **Prose pages** (articles, docs): line-height 1.65 to 1.75, one family for the title and its subheads, `text-wrap: pretty` on the title, a measure of 60 to 75ch (25).- **Stat rows and dashboards.** A stat's title never wraps, no icon sits in a stat, siblings part with a top or side hairline, and a widget's layout answers its container (`@container`), not the viewport.- **Definition lists.** Features and metadata are a `<dl>`: `<dt>` one weight heavier and higher contrast, `<dd>` regular and quieter, so a link inside the `<dd>` still reads.diff --git a/skills/hallmark/references/craft/tier-b-svg.md b/skills/hallmark/references/craft/tier-b-svg.mdindex 5c9e477..bf5351e 100644--- a/skills/hallmark/references/craft/tier-b-svg.md+++ b/skills/hallmark/references/craft/tier-b-svg.md@@ -89,7 +89,7 @@ The breath comes from `@property --bake` interpolating a number into `scaleY()`;```css/* Hallmark · shape: Long Document · genre: editorial · theme: Editorial (deal 3/3, seed small-bakery-lisbon·2026-10-02·r0)* hero: Settled · nav: wordmark and two links · footer: letter close · enrichment: E5 illustration, tier B SVG, 60 lines, still · signature: the loaf drawn beside the first line, scored in coral- * axes: light/display-condensed/warm · posture: restrained · contrast: pass · fold: pass · v2.4.0 */+ * axes: light/display-condensed/warm · posture: restrained · contrast: pass · fold: pass · v2.5.0 */```The next bakery brief gets a different loaf (another curvature and score pattern) or a different subject altogether (a boule, a baguette, a flatbread), and Rotation never lets E5 follow E5 (SKILL.md Step 2).diff --git a/skills/hallmark/references/design-md.md b/skills/hallmark/references/design-md.mdindex 953c642..5dde885 100644--- a/skills/hallmark/references/design-md.md+++ b/skills/hallmark/references/design-md.md@@ -1,6 +1,6 @@# design.md: the locked system-Loaded only when the user asks to lock the current build's system into a portable file. A build never writes `design.md` on its own; `tokens.css` already makes every build portable, and the Picks block offers the lock in one line.+Loaded when the user asks to lock the current build's system into a portable file, or when a redesign reaches more than one page (`redesign.md`). A single build never writes `design.md` on its own; `tokens.css` already makes every build portable, and the Picks block offers the lock in one line.## Triggersdiff --git a/skills/hallmark/references/flow.md b/skills/hallmark/references/flow.mdindex 3693cf7..521bd1f 100644--- a/skills/hallmark/references/flow.md+++ b/skills/hallmark/references/flow.md@@ -40,7 +40,25 @@ 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.4.0 */`. Sweep: `sloplint --scope component`, which runs the Floor tier minus the page-only gates.+Stamp: `/* Hallmark · component: <type> · genre: <genre> · theme: <theme> · states: 8 · contrast: pass · v2.5.0 */`. Sweep: `sloplint --scope component`, which runs the Floor tier minus the page-only gates.++## App screens++A dashboard, an admin, a settings page, a tool: a screen someone works in rather than reads. Signals: the brief says app, dashboard, admin, console, settings or tool; the target sits behind a sign-in; the screen is tables, forms and controls. The bar is earned familiarity: the tool disappears into the task, and someone fluent in the category trusts it at once. The marketing rules step aside: no shape from `macrostructures.md`, no hero or fold, no screen word budget, no section rhythm, no slots, no enrichment, no reveal on load. `sloplint --scope app` skips their gates (1, 6, 8, 9, 32, 42, 44, 46b, 58, 59, 66 and 68) and reads control heights on the app range. Everything else binds, the Floor first: tokens, contrast, focus, states, no eyebrow, no tracked-caps label on a table head, no invented figure.++What takes their place:++- **The theme lends its palette, its faces, its radius and one signature move,** never its layout, navigation or ornament. One family is often right, and a familiar sans or a system face is allowed here; the type scale is fixed, at a ratio of 1.125 to 1.2, with no fluid heads and no display face on labels, buttons or data.+- **Colour is restrained.** The accent marks the primary action, the current selection and state, nothing else; a second neutral carries sidebars, toolbars and panels.+- **The shell is the project's own.** A new one is a top bar; a sidebar is earned by more than about seven destinations, never reached for by reflex, and it collapses to a menu under 60rem. Standard patterns (tabs, breadcrumbs, a command palette) beat invented ones, and a modal is the last answer, after inline editing and disclosure.+- **Density is the design.** Controls 32 to 40px with a 44px hit target, one container recipe, tables before cards (a table may run wider than any prose measure), and `craft.md` § 9 for controls, inputs, tables and stat rows.+- **Every region that loads data has four states:** loading (a skeleton in the shape of what is coming), empty (what belongs here and the one action that fills it), error (what broke and what to do) and full, per `interaction-and-states.md`. A build that draws only the full state has drawn a quarter of the screen.+- **State lives in the URL** (filters, tabs, pagination), and a destructive action is undone or confirmed.+- **Motion is state, never decoration:** `--dur-micro` and `--dur-short`, nothing orchestrated.+- **Figures are the product's own.** A stat is a figure and its label in tabular numerals; no icon tile, no gradient, no trend arrow nobody measured (46a).+- **The signature** is still owed: the one object this tool is known by (the ledger, the timeline, the queue), not a greeting above four stat cards.++The Picks block drops Shape, Hero and Sections and names the screen instead: `Screen · transactions table with an inline filter row · states: loading, empty, error`. The stamp says `shape: app screen`, which sloplint and the edit-time hook read as the app scope, and the log entry carries `scope: app`.## Signal 8: the archive builds, Hallmark sweeps@@ -57,7 +75,7 @@ Enter at Step 7 over the files the archive wrote, with five differences:```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: external (reference archive) · v2.4.0 */+ * built: external (reference archive) · v2.5.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 ae905cd..fb63e24 100644--- a/skills/hallmark/references/gates.md+++ b/skills/hallmark/references/gates.md@@ -29,6 +29,8 @@ Three fields: the gate, the **guard evidence**, the reason. sloplint re-derivesA Finish finding is answered the same way: `/* Hallmark · answered F3 · the display head is one word and cannot wrap */`. A `WARN` is a suspicion: confirm it and fix it, or dismiss it on the record, `/* Hallmark · dismissed 58 · the window holds a five-row table, counted twice across the sticky pane */`.+Words the user insists on are material, not output: `copy: verbatim` in the stamp reports the copy gates (19, 58, 69) as notes. A redesign records what it gives up the same way, with `dropped` (`redesign.md` § After).+## 3. Pre-emit critiqueBefore the gate sweep, score the planned page 1 to 5 on six axes. Anything under 3 triggers a revision pass first.@@ -75,6 +77,7 @@ One line each. `a`/`b` clauses share a number and carry their own tier. Genre no| 55a | Floor | M | Uppercase display head that can wrap with `line-height` under 1.0 (cap collision) | line-height 1.0 floor, 1.02 to 1.08 recommended || 55b | Reflex | M | A single-line caps lockup under 1.02. Guard: it cannot wrap at 320px | leave it || 64 | Reflex | M | Mono as costume: a monospace face on labels, captions, meta rows, table heads or small type when neither the display nor the body is mono and the content is not code, a figure or a measurement. Guard: the theme's material is mono (Terminal, Ledger's figures) or the text is code | set labels in the body face at a smaller size and normal case |+| 75 | Reflex | R | Text that strains: running text under 12px, functional text under 11px, or multi-line prose leaded under 1.3 | body 16px at 1.5 to 1.65; labels a step smaller, never two || 67 | Floor | M | The tracked-caps label: a label, caption, table head, nav link, tag, chip or any text at 15px or under set uppercase or in small caps, or any of them letter-spaced past 0.03em. House rule. Legal: a wordmark; a control on a page whose display is itself uppercase, tracked 0.04em or less | the body face, a step smaller, sentence case, untracked |### Structure and layout@@ -100,7 +103,7 @@ One line each. `a`/`b` clauses share a number and carry their own tier. Genre no| 58 | Floor | M/R | More than about 80 words in any 900px window at 1440, or a hero with more than two text blocks before its actions. House rule | headline, one sentence, actions; a section is a heading, one line, then its object || 59 | Reflex | M/R | A gap under 120px between sections at 1440 (64px where the paper changes), or every gap the same. Guard: a dense macrostructure that separates with rules and colour | 120px floor, varied || 71 | Reflex | R | The crowded head: two or more h2 to h4 sitting nearer what precedes them than what they head (the space above under 0.75 times the space below and 12px or more short). Heads inside a box under 200px tall are exempt | at least twice the space above a head as below it |-| 72 | Reflex | R | The cramped box: text in a filled or side-bordered box over 100 x 30px closer than max(8px, 0.5em) to its sides or max(4px, 0.3em) to its top and bottom (the em part capped at 24 and 12px) | pad the box |+| 72 | Reflex | R | The cramped box: text in a filled or side-bordered box over 100 x 30px closer than max(8px, 0.5em) to its sides or max(4px, 0.3em) to its top and bottom (the em part capped at 24 and 12px), or running text within 8px of the screen's edge on a phone | pad the box; a 16px gutter |### Chrome and copy@@ -149,6 +152,7 @@ One line each. `a`/`b` clauses share a number and carry their own tier. Genre no| 30a | Floor | M | An emoji standing in for an icon | one icon library, custom SVG, or typography || 30b | Reflex | M | Two icon libraries on one page. Guard: the second is a brand or platform mark in at most two slots | one library || 33 | Floor | M | A decorative `<svg>`, `<canvas>` or CSS-art element with neither `aria-hidden="true"` nor a label | hide it or name it |+| 76 | Floor | M/R | A broken image: an `<img>` with no source, or one that does not load | the real file, a `data-slot` placeholder, or no image || 73 | Floor | R | Text painted under another element: an opaque box, an image or another run of text covers a line of it (sticky and fixed chrome excepted) | give the text its own space, or its own surface above the cover || 40 | Floor | M/R | Text, icon, focus ring or a field's edge under its contrast threshold against its computed background (body 4.5:1 or APCA Lc 60; large text, icons, rings and field edges 3:1 or Lc 45) | fix the pair; a field takes `--color-muted` || 41 | Floor | M/R | Button text within 5% L and 0.05 chroma of its fill; `--color-accent-ink` missing where accent carries text; a dark panel that does not swap its text colour; grey text on a coloured surface | the paired ink token |@@ -159,7 +163,7 @@ One line each. `a`/`b` clauses share a number and carry their own tier. Genre no### 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 · 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, more than one container width, more than one column gap below the hero, more than one radius per nesting level, or more centred heading groups than left-aligned ones · F16 browser surfaces unthemed: no `::selection`, no `caret-color`, no `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), usually a grid placement gone wide (render) · F18 a `data-slot` that renders under 40px in either dimension at 1440, collapsed by a percentage width inside a shrink-to-fit parent (render) · F19 more than three font weights in running use, display and body together (render) · F20 a grid or a wrapping row that leaves one item alone on its last row under a fuller row (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 · 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, more than one container width, more than one column gap below the hero, more than one radius per nesting level, or more centred heading groups than left-aligned ones · F16 browser surfaces unthemed: no `::selection`, no `caret-color`, no `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), usually a grid placement gone wide (render) · F18 a `data-slot` that renders under 40px in either dimension at 1440, collapsed by a percentage width inside a shrink-to-fit parent (render) · F19 more than three font weights in running use, display and body together (render) · F20 a grid or a wrapping row that leaves one item alone on its last row under a fuller row (render) · F21 a heading level skipped (an h2 followed by an h4) · F22 justified text without `hyphens: auto` · F23 em dashes saturating the copy (eight or more, about one per 500 characters) · F24 a document without `lang`, a `<title>` or a meta description.## 5. Judged clauses@@ -209,7 +213,7 @@ The gates above that a script cannot settle, with enough to judge them well.## 6. The reviews, in fresh context-The thread that built the page is its weakest reviewer. Two reviews run with no inherited transcript (a subagent in Claude Code): the **hero review** once at Step 6, before any section below the fold exists, and the **finish review** at Step 7. Do not read their briefs yourself: start the reviewer with *Read `<skill-dir>/references/review-hero.md` (or `review-finish.md`) and follow it* and pass these, as paths. The hero review: the four `hero-*` screenshots, the stamp's first two lines, the Picks block's Material and Signature rows, the theme's picture. The finish review: the render tier's screenshots, the page's HTML, the stamp's theme line or direction contract, the theme's picture, the hero review's findings with how each was settled, and `gates.md` § 4. Wait for it once.+The thread that built the page is its weakest reviewer. Two reviews run with no inherited transcript (a subagent in Claude Code): the **hero review** once at Step 6, before any section below the fold exists, and the **finish review** at Step 7. Do not read their briefs yourself: start the reviewer with *Read `<skill-dir>/references/review-hero.md` (or `review-finish.md`) and follow it* and pass these, as paths. The hero review: the four `hero-*` screenshots, the stamp's first two lines, the Picks block's Material and Signature rows, the theme's picture. The finish review: the render tier's screenshots, the page's HTML, the stamp's theme line or direction contract, the theme's picture, the hero review's findings with how each was settled, `gates.md` § 4, and on a redesign the `before` screenshots. Wait for it once.Act on its first word. Fix what is real, recapture the same shots (`--stage hero` for the hero), and score each finding yourself against its recapture: `resolved`, `partial` or `unresolved`, with a reason. Send the recaptures back for one scoring round only when the first word was `rebuild` or a finding named a Floor gate; scoring is not a second review. Record the outcome in the stamp, hero first: `hero-review: fix · 4 findings · 4 resolved`, then `finish-review: subagent · 5 findings · 4 resolved 1 unresolved · gap: none`. No subagents: re-read the artifact cold, run the same brief against yourself, and record `in-thread`.diff --git a/skills/hallmark/references/hero-enrichment.md b/skills/hallmark/references/hero-enrichment.mdindex 55dc65e..d0adffb 100644--- a/skills/hallmark/references/hero-enrichment.md+++ b/skills/hallmark/references/hero-enrichment.md@@ -114,7 +114,7 @@ The enrichment and polish go on the stamp's second line, in the `enrichment:` fi```css/* Hallmark · shape: Workbench · genre: modern-minimal · theme: Cobalt (deal 1/3, seed tracejam·2026-09-22·r0)* hero: Stage · nav: edge-aligned · footer: colophon line · enrichment: E1 demo capture, clip right, 16/10, hairline · polish: HP4 numeral, issue 22 · signature: the trace runs off the page- * axes: light/grotesk-sans/cool · posture: restrained · contrast: pass · fold: pass · v2.4.0 */+ * axes: light/grotesk-sans/cool · posture: restrained · contrast: pass · fold: pass · v2.5.0 */```No polish, omit `polish:`. No enrichment, write `enrichment: none`. Never fake either. The log entry's `enrichment` field carries the same value so Rotation can read it.diff --git a/skills/hallmark/references/redesign.md b/skills/hallmark/references/redesign.mdnew file mode 100644index 0000000..79edc17--- /dev/null+++ b/skills/hallmark/references/redesign.md@@ -0,0 +1,84 @@+# Redesign++Loaded when the request opens with `redesign` or `audit`, or plainly asks to redesign, restyle or polish an existing page, site or app, or to make one look less generated. A redesign is a build whose material is the page that exists: SKILL.md still binds, and this file says what the run keeps, what stands in for Steps 0 to 2, and what the sweep adds. A small edit to an existing design (a tweak, one fix, new copy) is neither a redesign nor a Hallmark run.++## What a redesign keeps++- **The content.** Every fact, claim, name, price, date and quote the page states. Figures, quotes and logos already on the page are the user's material: carried over as found, never added to, and listed in the handoff for the user to verify.+- **The wiring.** Every link, form field, action, handler, route, id and test hook; every script, data call and analytics call. Edit markup inside the component that owns it. Never move logic, rename a prop, or drop a `name`, an `id`, a `key`, an `href` or a `data-testid` that a script or a test reads.+- **The files.** No file deleted, no route removed and no component tree replaced without a file-level plan the user approved, and no test edited to make the redesign pass. Documents in the repo (a README, a brief, a deck) explain the product; they are not page copy. In a git project, start from a clean tree (ask the user to commit or stash; never do it for them), so the redesign is one diff they can read and revert.+- **The brand.** A logo, a brand colour and a brand face the pre-flight finds stay at every depth unless the user lets them go; a real brand runs `brand-truth.md`. A locked `design.md` is the system at every depth.+- **The words,** unless a gate names them. Wording that fails a copy gate (19, 58, 63, 69) is tightened from the facts already on the page, and the handoff lists every changed line, before and after. Legal and consent text is never reworded. When the user says to keep every word, stamp `copy: verbatim`: 19, 58 and 69 then report as notes.++## Depth++How far the run goes. The user's words pick it; otherwise the project does, and the Picks block says which. Between two depths, take the lighter: a redesign that kept too much is one message from going further, and one that replaced too much has to be undone. The depths do not blend: a polish that finds the concept wrong says so and recommends the deeper run, it never smuggles one in.++| Depth | Stays | Changes | Picked by |+| --- | --- | --- | --- |+| **polish** | the system and the layout | only what a gate names: the tells, contrast, states, motion, tokens | *polish*, *clean up*, *fix the design*; a `design.md`; a design system the project owns |+| **restyle** | the layout | the system: colour, type, radius, shadow, motion, the controls | *restyle*, *reskin*, *a new look*; an app screen |+| **full** | the content and the wiring | the system and the composition: shape, hero, section objects, chrome | *redesign* on a marketing page; *looks generic*, *looks generated* |++*From scratch* is a build, not a depth: SKILL.md as written, the old page as its Step 2 inventory, in new files beside the old ones.++## Before++1. Run the pre-flight (Step 0), then list the pages in the target: route, file, and whether each is a marketing page, a content page or an app screen (`flow.md` § App screens). In a framework project start the dev server.+2. Record the page as it stands:++```+node <skill-dir>/scripts/sloplint.mjs <target> --render --before [--url <route> ...] [--scope app]+```++It lints, writes the screenshots to `.hallmark/before/`, and records every link, field, action, handler, test hook, heading and figure in `.hallmark/before.json`. An unstamped page has no genre: infer it as Step 1 does and say so.++3. Look at the screenshots before the findings, so the linter does not write the verdict, then give the read in four lines: what the page is for (the audience, the one action); what works and stays (at least one thing); what reads as generated (the worst tells, by gate); what is broken.++**`audit <target>` stops here:** the findings by tier with `file:line`, the read, and one line naming the depth that would settle them. It edits nothing.++## The ask++One message stands in for Step 1; skip it when the request already answers it or no one can answer:++> *Before I redesign, three things. 1. **What stays**: the look (I fix only what reads as generated), the layout (new colour and type on the same structure), or only the content (a new design)? And anything I must not touch. 2. **What is wrong with it**, in your words, and the feeling you want instead. 3. **Anything new to show**: screenshots, photos, numbers, a quote. Or say **go ahead** and I will pick the depth from the project and say which.*++## The plan++The Picks block opens with four rows of its own, and nothing is deleted until the user has seen the Files row:++```markdown+- **Redesign** · restyle · 3 pages (/, /pricing, /docs)+- **Before** · Floor 14 FAIL · Reflex 9 · a centred template in a stock indigo; the pricing table is clear and stays+- **Keeps** · every link, field and handler · the green and the brand face · the pricing table+- **Files** · edit: app/page.tsx, app/pricing/page.tsx, app/globals.css · create: tokens.css, base.css · delete: none+```++Then the build rows the depth reaches: Theme at restyle and full (dealt, `brand` or locked); Shape, Chrome, Hero, Signature and Sections at full only. At polish the block stops after Files.++## Build++- **Polish** is the sweep in `flow.md` § Signal 8, on the user's own page: fix in place, single elements and tokens, never restructure. Its check stamp opens the stylesheet, with `built: the project · redesign: polish`.+- **Where the layout stays** (polish and restyle), the stamp's `redesign:` field tells sloplint to report the layout gates (6b, 8, 9, 32, 42, 44a, 44c, 58) as notes. Print them for the user with the depth that would settle them; do not rebuild them.+- **Restyle and full** start from the scaffold: `tokens.css` and `base.css` imported below the project's own styles and mapped onto the project's token names (a Tailwind theme, shadcn variables: `export-formats.md`). Then the shared components and the chrome, then the pages, the most visited first, each swept before the next.+- **More than one page** at restyle or full: lock the system first (`design-md.md`). Every page reads it and the variety rule inverts: pages share theme, type and accent, and differ only in shape. Past three pages, give each page to its own subagent where the harness has them, with `design.md`, the page's files and this file.+- **Full depth** runs the hero stage and the hero review. Polish and restyle skip both.++## After++1. The sweep, against the record: `sloplint <target> --render --kept`. Anything the page had and no longer has is a `FAIL kept` (a link, a field, a form action, a handler, a test hook, a selector a script still queries) or a `WARN kept` (a heading, a figure, an image, an id). Restore it, or record what the user agreed to lose: `/* Hallmark · dropped /blog, #team · the user is retiring the blog and the team section */`.+2. The project's own checks, where it has them: the type check, the build, the tests. A redesign that breaks one is not finished.+3. The finish review also takes the `before` screenshots and answers what the old page did better (`review-finish.md`).+4. The stamp carries `redesign: <depth>`; the log entry carries `mode: redesign`, `depth` and `scope` (page, site or app), plus the build's fields at full depth.+5. The handoff, ahead of the material ask:++```+Redesign · restyle · 3 pages+Before Floor 14 FAIL · Reflex 9+After Floor 0 · Reflex 1 waived (47b)+Kept 14/14 links · 5/5 fields · 9/9 handlers · 11/11 headings · every figure · the layout+Changed the system: colour, type, radius, motion, the controls+Dropped none+Layout 2 findings a full redesign would settle (8, 42), listed below+Yours 2 claims kept as found ("50,000+ teams", the Acme quote) · 4 lines reworded, listed below+```diff --git a/skills/hallmark/references/review-finish.md b/skills/hallmark/references/review-finish.mdindex d87c39f..215292e 100644--- a/skills/hallmark/references/review-finish.md+++ b/skills/hallmark/references/review-finish.md@@ -8,4 +8,6 @@ Then the findings, ranked by cost to the page, at most eight, one line each: theThen one answer to the question no gate can: does the stamp's contract or theme describe the page in front of you? Name the largest gap, or say there is none.+On a redesign you also get the `before` screenshots. Add one answer: what did the old page do better? Name anything a visitor could do, read or find before that is harder now; if nothing, say so.+Close with one line naming what must not be diluted while fixing. Do not fix anything.diff --git a/skills/hallmark/scripts/fixtures/eyebrow-pass/index.html b/skills/hallmark/scripts/fixtures/eyebrow-pass/index.htmlindex b9d3228..1549a13 100644--- a/skills/hallmark/scripts/fixtures/eyebrow-pass/index.html+++ b/skills/hallmark/scripts/fixtures/eyebrow-pass/index.html@@ -18,11 +18,13 @@<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Gate 54 carve-out fixture (must pass)</title>+<meta name="description" content="Fragments that sit near a heading without announcing it; gate 54 must stay quiet on every one."><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.1.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 {--color-paper: oklch(97% 0.006 250); --color-ink: oklch(20% 0.02 250);--color-muted: oklch(52% 0.015 250); --color-accent: oklch(52% 0.14 250); --color-accent-ink: oklch(98% 0.005 250);diff --git a/skills/hallmark/scripts/fixtures/tailwind-pass/index.html b/skills/hallmark/scripts/fixtures/tailwind-pass/index.htmlindex b504fa8..cb58fac 100644--- a/skills/hallmark/scripts/fixtures/tailwind-pass/index.html+++ b/skills/hallmark/scripts/fixtures/tailwind-pass/index.html@@ -5,6 +5,7 @@<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Tailwind pass fixture</title>+<meta name="description" content="A Tailwind page written to pass every gate the static tier reads from utility classes."><script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script><link rel="stylesheet" href="style.css"></head>diff --git a/skills/hallmark/scripts/sloplint-render.mjs b/skills/hallmark/scripts/sloplint-render.mjsindex 1f06166..e6a015f 100644--- a/skills/hallmark/scripts/sloplint-render.mjs+++ b/skills/hallmark/scripts/sloplint-render.mjs@@ -9,6 +9,7 @@ const isUrl = (t) => /^https?:\/\//.test(t);const slugOf = (t) => isUrl(t) ? t.replace(/^https?:\/\//, '').replace(/[^\w.-]+/g, '-').replace(/-+$/, '') : basename(t, '.html');const SHOTS = [];+let SHOT_DIR = 'shots';const frames = (page) => page.evaluate(() => new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)))).catch(() => {});function contrast(a, b) {const lin = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);@@ -51,7 +52,7 @@ async function pixelBehind(page, probe) {async function shoot(page, file, tag, fullPage) {try {- const dir = isUrl(file) ? join(process.cwd(), '.hallmark', 'shots') : join(dirname(file), '.hallmark', 'shots');+ const dir = isUrl(file) ? join(process.cwd(), '.hallmark', SHOT_DIR) : join(dirname(file), '.hallmark', SHOT_DIR);mkdirSync(dir, { recursive: true });const out = join(dir, `${slugOf(file)}-${tag}.png`);await page.screenshot({ path: out, fullPage });@@ -61,8 +62,10 @@ async function shoot(page, file, tag, fullPage) {export async function renderCheck(htmlFiles, metaIn) {const failed = [];- const meta = { genre: null, postureByFile: {}, heroPostureByFile: {}, stage: 'page', ...(metaIn || {}) };+ const meta = { genre: null, postureByFile: {}, heroPostureByFile: {}, stage: 'page', scope: 'page', before: false, ...(metaIn || {}) };const heroOnly = meta.stage === 'hero';+ SHOT_DIR = meta.before ? 'before' : 'shots';+ const inventories = {};let puppeteer = null;const { createRequire } = await import('node:module');const { pathToFileURL } = await import('node:url');@@ -152,7 +155,8 @@ export async function renderCheck(htmlFiles, metaIn) {if (!heroOnly) {await page.setViewport({ width: 1440, height: 900 });await frames(page);- const quality = await page.evaluate(observeQuality).catch(() => []);+ inventories[file] = await page.evaluate(inventory).catch(() => null);+ const quality = await page.evaluate(observeQuality, meta.scope).catch(() => []);const hidden = await page.evaluate(observeOcclusion).catch(() => []);for (const f of [...quality, ...hidden]) findings.push({ ...f, file, line: 1, evidence: `[1440px] ${f.evidence}` });await page.evaluate(() => { window.scrollTo(0, 0); if (document.activeElement && document.activeElement.blur) document.activeElement.blur(); });@@ -188,9 +192,35 @@ export async function renderCheck(htmlFiles, metaIn) {return true;});kept.failed = failed;+ kept.inventories = inventories;return kept;}+function inventory() {+ const base = location.pathname.slice(0, location.pathname.lastIndexOf('/') + 1);+ const key = (raw) => {+ try {+ const u = new URL(raw, location.href);+ if (!/^(https?|file):$/.test(u.protocol)) return raw.trim();+ if (u.origin !== location.origin) return u.href;+ if (u.pathname === location.pathname && u.search === location.search && u.hash) return u.hash;+ return (location.protocol === 'file:' && u.pathname.startsWith(base) ? u.pathname.slice(base.length) : u.pathname) + u.search + u.hash;+ } catch { return raw.trim(); }+ };+ const uniq = (a) => [...new Set(a.filter(Boolean))];+ const text = (el) => (el.innerText || el.textContent || '').replace(/\s+/g, ' ').trim();+ const quiet = (el) => !!el.closest('script, style, noscript, template');+ const links = uniq([...document.querySelectorAll('a[href]')].map((a) => a.getAttribute('href')).filter((h) => h && h.trim() && h.trim() !== '#').map(key));+ const fields = uniq([...document.querySelectorAll('input[name], select[name], textarea[name], button[name]')].map((f) => f.getAttribute('name')));+ const actions = uniq([...document.querySelectorAll('form[action]')].map((f) => `${(f.getAttribute('method') || 'get').toLowerCase()} ${key(f.getAttribute('action'))}`));+ const headings = uniq([...document.querySelectorAll('h1, h2, h3, h4')].filter((h) => !quiet(h)).map((h) => text(h).toLowerCase()).filter((t) => t.length > 1));+ const body = text(document.body);+ const figures = uniq((body.match(/[$€£¥]\s?\d[\d,.]*\+?[kKmM]?|\b\d[\d,.]*\s?%|\b\d[\d,.]*[kKmM]?\+(?=\s|$)|\b\d{1,3}(?:,\d{3})+\b|\b\d{1,2}[:.]\d{2}\s?(?:am|pm)?\b/gi) || []).map((t) => t.replace(/\s+/g, '').toLowerCase()));+ const images = uniq([...document.querySelectorAll('img[src]')].map((i) => (i.getAttribute('src') || '').split('?')[0].split('/').pop()));+ const controls = document.querySelectorAll('button, [role="button"], input[type="submit"], input[type="button"], select, textarea, input:not([type="hidden"])').length;+ return { links, fields, actions, headings, figures, images, controls, words: body ? body.split(' ').length : 0 };+}+function focusRing() {const el = document.activeElement;if (!el || el === document.body || el === document.documentElement) return null;@@ -261,6 +291,18 @@ function observe(checkFold, meta) {'overflow-x: clip on html and body; find the overflowing block');}+ if (window.innerWidth === 375) {+ const flush = [...document.querySelectorAll('p, li, h1, h2, h3, blockquote, dd')].find((el) => {+ if (!visible(el) || el.closest('nav, pre, table, [data-slot]')) return false;+ const own = [...el.childNodes].filter((n) => n.nodeType === 3 && n.textContent.trim().length >= 20);+ if (own.reduce((n, t) => n + t.textContent.trim().length, 0) < 40) return false;+ let left = Infinity, right = -Infinity;+ for (const t of own) { const range = document.createRange(); range.selectNodeContents(t); for (const r of range.getClientRects()) { if (r.width < 2) continue; left = Math.min(left, r.left); right = Math.max(right, r.right); } }+ return right - left > 120 && right <= window.innerWidth + 1 && (left < 8 || right > window.innerWidth - 8);+ });+ if (flush) push(72, 'REFLEX', `text runs to the edge of the screen (${describe(flush)})`, 'Give the page a gutter: 16px or more at each side on a phone');+ }+for (const el of document.querySelectorAll('a, button, [role="button"], [role="tab"]')) {if (!visible(el)) continue;const text = (el.textContent || '').trim();@@ -615,7 +657,7 @@ function observeSpace(atLaptop, heroOnly, heroPosture) {return out;}-function observeQuality() {+function observeQuality(scope) {const out = [];const push = (gate, grade, evidence, fix) => out.push({ gate: String(gate), grade, evidence, fix });const vis = (el) => { const cs = getComputedStyle(el); if (cs.display === 'none' || cs.visibility === 'hidden' || parseFloat(cs.opacity) === 0) return false; const r = el.getBoundingClientRect(); return r.width > 1 && r.height > 1; };@@ -693,8 +735,8 @@ function observeQuality() {if (tight.length) push(72, 'REFLEX', `text crowds the edge of its box: ${tight.join('; ')}`, 'Pad the box: max(8px, 0.5em) at the sides, max(4px, 0.3em) above and below');const controls = all.filter((el) => (el.tagName === 'BUTTON' || el.getAttribute('role') === 'button' || (el.tagName === 'A' && /btn|button|cta/i.test(String(el.className))) || (el.tagName === 'INPUT' && /^(submit|button|text|email|search|tel|url|password|number)$/.test(el.type))) && !el.closest('nav, header, dialog, [role="dialog"], [data-slot], [role="tablist"]') && (el.tagName === 'INPUT' || (el.innerText || '').trim()));- const offSize = controls.map((el) => ({ el, h: el.getBoundingClientRect().height })).filter((c) => c.h > 8 && (c.h < 42 || c.h > 54));- if (offSize.length) push('39b', 'REFLEX', `control height outside 44 to 52px: ${offSize.slice(0, 3).map((c) => `${name(c.el)} ${Math.round(c.h)}px`).join(', ')}`, 'Marketing controls stand 44 to 52px; app UI 32 to 40px with a 44px hit target');+ const offSize = controls.map((el) => ({ el, h: el.getBoundingClientRect().height })).filter((c) => c.h > 8 && (c.h < (scope === 'app' ? 30 : 42) || c.h > 54));+ if (offSize.length) push('39b', 'REFLEX', `control height outside ${scope === 'app' ? '32 to 52px' : '44 to 52px'}: ${offSize.slice(0, 3).map((c) => `${name(c.el)} ${Math.round(c.h)}px`).join(', ')}`, 'Marketing controls stand 44 to 52px; app UI 32 to 40px with a 44px hit target');const cv = document.createElement('canvas'); cv.width = cv.height = 1;const cx = cv.getContext('2d', { willReadFrequently: true });@@ -719,13 +761,24 @@ function observeQuality() {if (weak.length) push(40, 'FAIL', `a field's edge is under 3:1 against what surrounds it: ${weak.slice(0, 3).join(', ')}`, 'Draw the field in --color-muted, or fill it a step off the surface it sits on');const weights = new Map();+ const strained = [];const tw = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT);for (let t = tw.nextNode(); t; t = tw.nextNode()) {const host = t.parentElement; const txt = t.textContent.trim();if (!txt || !host || quiet(host) || host.closest('svg') || !vis(host)) continue;- const w = Math.round((parseFloat(getComputedStyle(host).fontWeight) || 400) / 100) * 100;+ const hs = getComputedStyle(host);+ const w = Math.round((parseFloat(hs.fontWeight) || 400) / 100) * 100;weights.set(w, (weights.get(w) || 0) + txt.length);+ if (strained.length >= 4 || txt.length < 3 || host.closest('sup, sub, [data-slot], figure svg') || strained.some((x) => x.el === host)) continue;+ const size = parseFloat(hs.fontSize) || 16;+ const prose = !!host.closest('p, li, dd, blockquote') && txt.length > 60;+ const lh = parseFloat(hs.lineHeight);+ if (size < 11 || (prose && size < 12)) strained.push({ el: host, why: `${name(host)} at ${Math.round(size * 10) / 10}px` });+ else if (prose && lh && lh / size < 1.3 && host.getBoundingClientRect().height > lh * 2.2) strained.push({ el: host, why: `${name(host)} leaded ${(lh / size).toFixed(2)}` });}+ if (strained.length) push(75, 'REFLEX', `text that strains the eye: ${strained.map((x) => x.why).join(', ')}`, 'Running text 12px or more (16px for body), functional text 11px or more, multi-line prose leaded 1.3 or more');+ const dead = [...document.querySelectorAll('img')].filter((el) => !quiet(el) && el.complete && el.naturalWidth === 0 && !el.closest('[data-slot]') && (el.currentSrc || el.getAttribute('src')));+ if (dead.length) push(76, 'FAIL', `an image that does not load: ${dead.slice(0, 3).map((el) => (el.getAttribute('src') || '').split('/').pop().slice(0, 40)).join(', ')}`, 'Point it at a file that exists, make it a data-slot placeholder, or remove it');const used = [...weights].filter(([, n]) => n >= 30).map(([w]) => w).sort((a, b) => a - b);if (used.length > 3) push('F19', 'WARN', `${used.length} font weights in running use (${used.join(', ')})`, 'Three weights at most, display and body together, picked as extremes');diff --git a/skills/hallmark/scripts/sloplint.mjs b/skills/hallmark/scripts/sloplint.mjsindex 936fb5a..6a288a0 100644--- a/skills/hallmark/scripts/sloplint.mjs+++ b/skills/hallmark/scripts/sloplint.mjs@@ -1,17 +1,19 @@#!/usr/bin/env node/* sloplint: Hallmark's mechanical gate checker. Zero dependencies, Node 18+. Gate ids and tiers: references/gates.md. */-import { readFileSync, readdirSync, statSync, existsSync } from 'node:fs';+import { readFileSync, readdirSync, statSync, existsSync, writeFileSync, mkdirSync } from 'node:fs';import { join, extname, dirname, basename, resolve } from 'node:path';const GENRES = ['editorial', 'modern-minimal', 'atmospheric', 'playful'];const args = process.argv.slice(2);-const opts = { genre: null, scope: 'page', json: false, render: false, tier: null, stage: 'page', urls: [], paths: [] };+const opts = { genre: null, scope: 'page', json: false, render: false, tier: null, stage: 'page', before: false, kept: false, urls: [], paths: [] };for (let i = 0; i < args.length; i++) {const a = args[i];if (a === '--genre') { opts.genre = args[++i]; }else if (a === '--scope') { opts.scope = args[++i]; }else if (a === '--json') { opts.json = true; }else if (a === '--render') { opts.render = true; }+ else if (a === '--before') { opts.before = true; }+ else if (a === '--kept') { opts.kept = true; }else if (a === '--tier') { opts.tier = args[++i]; }else if (a === '--stage') { opts.stage = args[++i]; }else if (a === '--url') { opts.urls.push(args[++i]); opts.render = true; }@@ -20,7 +22,8 @@ for (let i = 0; i < args.length; i++) {else opts.paths.push(a);}function usage() {- console.error('usage: node sloplint.mjs <file-or-dir ...> [--genre editorial|modern-minimal|atmospheric|playful] [--scope page|component] [--stage hero|page] [--json] [--render] [--url http://localhost:3000] [--tier floor]');+ console.error('usage: node sloplint.mjs <file-or-dir ...> [--genre editorial|modern-minimal|atmospheric|playful] [--scope page|component|app] [--stage hero|page] [--json] [--render] [--url http://localhost:3000] [--tier floor] [--before | --kept]');+ console.error('--before records what the target says and does (.hallmark/before.json, screenshots in .hallmark/before); --kept checks a redesign against that record');console.error('reads .html and .css, plus .jsx .tsx .vue .svelte .astro (Tailwind class strings, cn/clsx/cva calls); skips node_modules, dist, build, coverage and dot folders');}if (!opts.paths.length && !opts.urls.length) { usage(); process.exit(2); }@@ -29,9 +32,10 @@ if (opts.urls.some((u) => !/^https?:\/\//.test(u || ''))) { console.error('--urlif (opts.genre && !GENRES.includes(opts.genre)) {console.error(`--genre must be one of: ${GENRES.join(', ')}`); process.exit(2);}-if (!['page', 'component'].includes(opts.scope)) {- console.error('--scope must be page or component'); process.exit(2);+if (!['page', 'component', 'app'].includes(opts.scope)) {+ console.error('--scope must be page, component or app'); process.exit(2);}+if (opts.before && opts.kept) { console.error('--before records and --kept compares; pass one'); process.exit(2); }const DOC_EXT = new Set(['.html', '.jsx', '.tsx', '.vue', '.svelte', '.astro']);const BUILD_DIRS = new Set(['dist', 'build', 'coverage']);@@ -781,6 +785,8 @@ const trunc = (s, n = 72) => (s.length > n ? s.slice(0, n - 1) + '…' : s);const PAGE_ONLY = new Set(['3', '8', '9', '25', '28', '32', '34', '42', '44', '46b', '47b', '47c', '49', '50', '54', '55', '56', '58', '59', '65', '66', '68', '69', '71', 'F7', 'F8', 'F15', 'F16', 'F20']);const gateNumber = (id) => (/^(\d{1,2})/.exec(String(id)) || [])[1] || null;const pageOnly = (id) => PAGE_ONLY.has(String(id)) || PAGE_ONLY.has(gateNumber(id));+const APP_SKIP = new Set(['1', '6', '8', '9', '32', '42', '44', '46b', '58', '59', '66', '68', 'F8', 'F15', 'F20']);+const appSkip = (id) => APP_SKIP.has(String(id)) || APP_SKIP.has(gateNumber(id));const TIERS = new Map(Object.entries({'2': 'floor', '4': 'floor', '10': 'floor', '15': 'floor', '17': 'floor', '18': 'floor', '19': 'floor',@@ -797,7 +803,7 @@ const TIERS = new Map(Object.entries({'28a': 'floor', '28b': 'reflex', '30a': 'floor', '30b': 'reflex', '38i': 'floor', '38ii': 'reflex', '38iii': 'reflex','39a': 'floor', '39b': 'reflex', '44a': 'reflex', '44b': 'floor', '44c': 'reflex', '44d': 'floor','46a': 'floor', '46b': 'reflex', '47a': 'floor', '47b': 'reflex', '47c': 'reflex', '49a': 'floor', '49b': 'reflex',- '55a': 'floor', '55b': 'reflex', '71': 'reflex', '72': 'reflex', '73': 'floor', '74': 'reflex',+ '55a': 'floor', '55b': 'reflex', '71': 'reflex', '72': 'reflex', '73': 'floor', '74': 'reflex', '75': 'reflex', '76': 'floor',}));const HERO_SKIP = new Set(['8', '9', '32', '59', 'F8', 'F15']);@@ -873,15 +879,23 @@ function reasonIsBoilerplate(reason) {let WAIVED = new Set();let ANSWERED = new Set();let DISMISSED = new Set();+let VERBATIM = false;+let APPSCREEN = false;+let LAYOUT_KEPT = false;+const STRUCTURAL = new Set(['6b', '8', '9', '32', '42', '44a', '44c', '58']);+const COPY_GATES = new Set(['19', '58', '69']);const findings = [];function report(gate, grade, file, line, evidence, fix) {const g = String(gate);if (opts.scope === 'component' && pageOnly(g)) return;+ if ((opts.scope === 'app' || APPSCREEN) && appSkip(g)) return;if (opts.stage === 'hero' && HERO_SKIP.has(String(g))) return;const tier = tierOf(g);const b = baseGate(g);const waived = WAIVED.has(b) || WAIVED.has(gateNumber(b));+ if (VERBATIM && COPY_GATES.has(gateNumber(b)) && (grade === 'FAIL' || grade === 'WARN')) grade = 'NOTE';+ if (LAYOUT_KEPT && (STRUCTURAL.has(b) || STRUCTURAL.has(gateNumber(b))) && grade !== 'NOTE') grade = 'NOTE';if (grade === 'FAIL') {if (tier === 'ledger') grade = 'NOTE';else if (tier === 'reflex') grade = waived ? 'WAIVED' : 'REFLEX';@@ -889,11 +903,14 @@ function report(gate, grade, file, line, evidence, fix) {if (tier === 'finish' && grade !== 'FAIL' && ANSWERED.has(b)) grade = 'ANSWERED';if (grade === 'WARN' && (DISMISSED.has(b) || DISMISSED.has(gateNumber(b)))) grade = 'DISMISSED';if (grade === 'WARN' && tier === 'reflex' && waived) grade = 'WAIVED';- findings.push({ gate: g, grade, tier, file: rel(file), line: line || 1, evidence: trunc(String(evidence), 120), fix });+ findings.push({ gate: g, grade, tier, file: rel(file), line: line || 1, evidence: trunc(String(evidence), g === 'kept' ? 400 : 120), fix });}function applyWaivers(ctx, dir) {WAIVED = new Set(); ANSWERED = new Set(); DISMISSED = new Set();+ VERBATIM = /\bcopy:\s*verbatim\b/i.test(ctx.stampText);+ APPSCREEN = /\bshape:\s*app screen\b/i.test(ctx.stampText);+ LAYOUT_KEPT = /\bredesign:\s*(?:polish|restyle)\b/i.test(ctx.stampText);const re = /\/\*\s*Hallmark\s*·\s*waive\s+(\d{1,2}[a-z]{0,3}|F\d+)\s*·\s*([^·*]+?)\s*·\s*([^*]+?)\s*\*\//gi;const claims = [...ctx.stampText.matchAll(re)].map((m) => ({id: m[1], evidence: m[2].trim(), reason: m[3].trim(), raw: m[0],@@ -3782,13 +3799,70 @@ function checkComponentText(ctx) {}}+function checkF21(ctx) {+ for (const doc of ctx.docs) {+ if (doc.kind !== 'html') continue;+ let prev = 0;+ for (const m of doc.src.matchAll(/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1>/gi)) {+ const level = Number(m[1]);+ if (prev && level > prev + 1) {+ report('F21', 'WARN', doc.file, doc.lineOf(m.index), `h${prev} is followed by h${level} ("${trunc(m[2].replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim(), 32)}")`, 'Step heading levels one at a time; size a head with CSS, never with its level');+ break;+ }+ prev = level;+ }+ }+}++function checkF22(ctx) {+ for (const r of ctx.rules) {+ const j = r.decls.find((d) => d.prop === 'text-align' && /^justify\b/.test(d.value.trim()));+ if (j && !r.decls.some((d) => d.prop === 'hyphens' && /auto/.test(d.value))) { report('F22', 'WARN', r.file, j.line, `justified text without hyphenation on ${r.selector}`, 'Set it left, or add hyphens: auto'); return; }+ }+ for (const doc of ctx.docs) {+ const m = /class(?:Name)?\s*=\s*["'][^"']*(?<![\w-])text-justify(?![\w-])/.exec(doc.src);+ if (m && !/(?<![\w-])hyphens-auto(?![\w-])/.test(doc.src)) { report('F22', 'WARN', doc.file, doc.lineOf(m.index), 'justified text without hyphenation (text-justify)', 'Set it left, or add hyphens-auto'); return; }+ }+}++function checkF23(ctx) {+ for (const doc of ctx.docs) {+ const prose = maskedProse(doc);+ const hits = [...prose.matchAll(/\u2014|—|—|\s--\s/g)];+ const chars = prose.replace(/\s+/g, ' ').length;+ if (hits.length >= 8 && hits.length * 500 >= chars) report('F23', 'WARN', doc.file, doc.lineOf(hits[0].index), `${hits.length} em dashes in ${chars} characters of copy`, 'A comma, a colon, a full stop or parentheses; the dash at this density reads as generated');+ }+}++function checkF24(ctx) {+ for (const doc of ctx.docs) {+ if (doc.kind !== 'html' || !/<html\b/i.test(doc.src)) continue;+ const missing = [];+ const html = /<html\b([^>]*)>/i.exec(doc.src);+ if (!html || !getAttr(html[1], 'lang')) missing.push('lang on <html>');+ if (!/<title\b[^>]*>\s*[^<\s][^<]*<\/title>/i.test(doc.src)) missing.push('a <title>');+ if (!/<meta\b[^>]*\bname\s*=\s*["']description["'][^>]*>/i.test(doc.src)) missing.push('a meta description');+ if (missing.length) report('F24', 'WARN', doc.file, 1, `the document lacks ${missing.join(', ')}`, 'Name the language, title the page in its own words, and describe it in one sentence for link previews');+ }+}++function check76(ctx) {+ for (const doc of ctx.docs) {+ if (doc.kind !== 'html') continue;+ for (const m of doc.src.matchAll(/<img\b([^>]*)>/gi)) {+ const src = getAttr(m[1], 'src');+ if ((src == null || !src.trim() || src.trim() === '#') && !getAttr(m[1], 'srcset') && !hasAttr(m[1], 'data-src')) { report('76', 'FAIL', doc.file, doc.lineOf(m.index), 'an <img> with no source', 'Give it the real image, make it a data-slot placeholder, or remove it'); break; }+ }+ }+}+const CHECKS = [check1, check2, check3, check3Stripe, check4, check6a, check7, check10, check10Motion, check11,check12, check15, check17, check18, check19, check20, check22, check23, check24, check24a,check25, check26, check27, check28, check30, check33, check34, check37, check38a,check39, check40_41, check42, check42Footer, check46, check47, check48, check49,check50, check50Wrap, check53, check54, check55, check56, checkCopyTell, check62, check63, check64, check65, check67, check38c,check19Tells, check58Static, check68, check69, check70, check42TwoButton, check47Placeholders, check65Tailwind, check29Glow, check11Lift, check15Fade,- checkF1, checkF2, checkF3, checkF4, checkF5, checkF6, checkF7, checkF7Pills, checkF8, checkF9, checkF15, checkF16,+ checkF1, checkF2, checkF3, checkF4, checkF5, checkF6, checkF7, checkF7Pills, checkF8, checkF9, checkF15, checkF16, checkF21, checkF22, checkF23, checkF24, check76,checkTailwind, checkComponentText];const files = opts.paths.length ? collectFiles(opts.paths) : [];@@ -3944,7 +4018,7 @@ for (const [dir, g] of groups) {shareProjects(contexts);for (const [key, ctx] of contexts) {applyWaivers(ctx, key);- waiversByKey.set(key, { WAIVED, ANSWERED, DISMISSED });+ waiversByKey.set(key, { WAIVED, ANSWERED, DISMISSED, VERBATIM, APPSCREEN, LAYOUT_KEPT });for (const check of CHECKS) {try { check(ctx); } catch (e) {console.error(`sloplint: internal error in ${check.name} for ${rel(key)}: ${e.message}`);@@ -3953,27 +4027,130 @@ for (const [key, ctx] of contexts) {}let renderNotRun = null;+let domInventories = {};if (opts.render) {const htmlFiles = files.filter((f) => extname(f).toLowerCase() === '.html');if (!htmlFiles.length && !opts.urls.length) renderNotRun = 'no HTML page to render; pass --url for a running dev server';else try {const mod = await import(new URL('./sloplint-render.mjs', import.meta.url).href);- const extra = await mod.renderCheck([...htmlFiles, ...opts.urls], { genre: opts.genre, postureByFile, heroPostureByFile, stage: opts.stage });- const allWaivers = { WAIVED: new Set([...waiversByKey.values()].flatMap((x) => [...x.WAIVED])), ANSWERED: new Set([...waiversByKey.values()].flatMap((x) => [...x.ANSWERED])), DISMISSED: new Set([...waiversByKey.values()].flatMap((x) => [...(x.DISMISSED || [])])) };+ const extra = await mod.renderCheck([...htmlFiles, ...opts.urls], { genre: opts.genre, postureByFile, heroPostureByFile, stage: opts.stage, scope: opts.scope === 'app' || [...waiversByKey.values()].some((x) => x.APPSCREEN) ? 'app' : opts.scope, before: opts.before });+ domInventories = extra.inventories || {};+ const allWaivers = { WAIVED: new Set([...waiversByKey.values()].flatMap((x) => [...x.WAIVED])), ANSWERED: new Set([...waiversByKey.values()].flatMap((x) => [...x.ANSWERED])), DISMISSED: new Set([...waiversByKey.values()].flatMap((x) => [...(x.DISMISSED || [])])), VERBATIM: [...waiversByKey.values()].some((x) => x.VERBATIM), APPSCREEN: [...waiversByKey.values()].some((x) => x.APPSCREEN), LAYOUT_KEPT: [...waiversByKey.values()].some((x) => x.LAYOUT_KEPT) };for (const f of extra) {const w = /^https?:/.test(f.file) ? allWaivers : (waiversByKey.get(f.file) || waiversByKey.get(dirname(f.file)));WAIVED = w ? w.WAIVED : new Set();ANSWERED = w ? w.ANSWERED : new Set();DISMISSED = w ? (w.DISMISSED || new Set()) : new Set();+ VERBATIM = !!(w && w.VERBATIM);+ APPSCREEN = !!(w && w.APPSCREEN);+ LAYOUT_KEPT = !!(w && w.LAYOUT_KEPT);report(f.gate, f.grade === 'REFLEX' ? 'FAIL' : f.grade, f.file, f.line, f.evidence, f.fix);}- for (const x of extra.failed || []) { WAIVED = new Set(); ANSWERED = new Set(); DISMISSED = new Set(); report('render', 'FAIL', x.file, 1, `the page did not render (${trunc(x.message, 60)}); its render gates did not run`, 'Fix the page or the URL and rerun; an unrendered page is never a pass'); }+ for (const x of extra.failed || []) { WAIVED = new Set(); ANSWERED = new Set(); DISMISSED = new Set(); VERBATIM = false; APPSCREEN = false; LAYOUT_KEPT = false; report('render', 'FAIL', x.file, 1, `the page did not render (${trunc(x.message, 60)}); its render gates did not run`, 'Fix the page or the URL and rerun; an unrendered page is never a pass'); }if (extra.notRun) renderNotRun = extra.notRun;} catch (e) {renderNotRun = e.message;}}+const SNAP = join(process.cwd(), '.hallmark', 'before.json');+const squash = (t) => t.replace(/\s+/g, ' ').trim();+const escRe = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');+function wiringOf(src) {+ const body = src.replace(/<!--[\s\S]*?-->/g, '');+ const w = { handlers: [], links: [], fields: [], hooks: [], ids: [] };+ const val = String.raw`("[^"]*"|'[^']*'|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})`;+ for (const m of body.matchAll(new RegExp(String.raw`(?<![\w-])(on[A-Z]\w*|on:[\w|]+|@[a-z][\w.:-]*|v-on:[\w.:-]+|on(?:click|submit|change|input|keydown|keyup|blur|focus))\s*=\s*` + val, 'g'))) w.handlers.push(`${m[1]}=${squash(m[2])}`);+ for (const m of body.matchAll(new RegExp(String.raw`(?<![\w:-])(?:href|to|action)\s*=\s*` + val, 'g'))) { const v = squash(m[1]).replace(/^["']|["']$/g, '').replace(/^\.\//, ''); if (v && v !== '#') w.links.push(v); }+ for (const m of body.matchAll(/(?<![\w-])name\s*=\s*["']([^"']+)["']/g)) {+ const tag = (/<([A-Za-z][\w.-]*)[^<]*$/.exec(body.slice(Math.max(0, m.index - 600), m.index)) || [])[1] || '';+ if (!/^(meta|slot|iframe|param|a|map|object|link)$/i.test(tag)) w.fields.push(m[1]);+ }+ for (const m of body.matchAll(/\bregister\(\s*["']([\w.-]+)["']/g)) w.fields.push(m[1]);+ for (const m of body.matchAll(/\bdata-(?:testid|test|cy|qa|track[\w-]*|analytics[\w-]*|event[\w-]*|gtm[\w-]*)\s*=\s*["']([^"']+)["']/g)) w.hooks.push(m[1]);+ for (const m of body.matchAll(/(?<![\w-])id\s*=\s*["']([^"'{}\s]+)["']/g)) w.ids.push(m[1]);+ return w;+}+function danglingHooks(docs) {+ const markup = docs.map((d) => (d.raw || d.src).replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, '')).join('\n');+ let js = docs.map((d) => [...(d.raw || d.src).matchAll(/<script\b(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi)].map((m) => m[1]).join('\n')).join('\n');+ const local = new Set();+ for (const d of docs) for (const m of (d.raw || d.src).matchAll(/<script\b[^>]*\bsrc\s*=\s*["']([^"']+)["']/gi)) {+ if (/^(?:https?:)?\/\//.test(m[1])) continue;+ const f = resolve(dirname(d.file), m[1].split('?')[0]);+ if (existsSync(f)) local.add(f);+ }+ for (const f of local) { try { js += '\n' + readFileSync(f, 'utf8'); } catch {} }+ const sels = new Set();+ for (const m of js.matchAll(/getElementById\(\s*["'`]([\w-]+)["'`]/g)) sels.add('#' + m[1]);+ for (const m of js.matchAll(/(?:querySelector(?:All)?|closest|matches)\(\s*["'`]([^"'`]+)["'`]/g)) for (const t of m[1].matchAll(/#[\w-]+|\.[A-Za-z_][\w-]*|\[data-[\w-]+/g)) sels.add(t[0][0] === '[' ? t[0] + ']' : t[0]);+ const has = (sel) => sel[0] === '#' ? new RegExp(`(?<![\\w-])id\\s*=\\s*["']${escRe(sel.slice(1))}["']`).test(markup)+ : sel[0] === '.' ? new RegExp(`(?<![\\w-])class(?:Name)?\\s*=\\s*["'][^"']*(?<![\\w-])${escRe(sel.slice(1))}(?![\\w-])`).test(markup)+ : markup.includes(sel.slice(1, -1));+ return [...sels].filter((x) => !has(x)).sort();+}+function takeInventory() {+ const docs = [...new Set(contexts.flatMap(([, c]) => c.docs))];+ const wiring = { handlers: new Set(), links: new Set(), fields: new Set(), hooks: new Set(), ids: new Set() };+ for (const d of docs) { const w = wiringOf(d.raw || d.src); for (const k of Object.keys(wiring)) for (const v of w[k]) wiring[k].add(v); }+ const pages = {};+ for (const [file, inv] of Object.entries(domInventories)) if (inv) pages[/^https?:/.test(file) ? file : rel(file)] = inv;+ return { wiring: Object.fromEntries(Object.entries(wiring).map(([k, v]) => [k, [...v].sort()])), dangling: danglingHooks(docs), pages };+}+let keptLine = null;+if (opts.kept) {+ let was = null;+ try { was = JSON.parse(readFileSync(SNAP, 'utf8')); } catch {}+ WAIVED = new Set(); ANSWERED = new Set(); DISMISSED = new Set(); VERBATIM = false; APPSCREEN = false; LAYOUT_KEPT = false;+ if (!was) report('kept', 'FAIL', SNAP, 1, 'no before record here; --kept has nothing to compare against', 'Run sloplint with --before from this folder before the redesign starts');+ else {+ const now = takeInventory();+ const stamps = contexts.map(([, c]) => c.stampText).join('\n');+ const allowed = [...stamps.matchAll(/\/\*\s*Hallmark\s*·\s*dropped\s+([^·*]+?)\s*·\s*([^*]+?)\s*\*\//gi)].filter((m) => m[2].trim().length >= 12).flatMap((m) => m[1].split(',').map((t) => t.trim().replace(/^[`"']|[`"']$/g, '').toLowerCase()).filter(Boolean));+ const acked = {};+ const gone = (a, b, cat) => (a || []).filter((x) => {+ if ((b || []).includes(x)) return false;+ if (allowed.some((t) => x.toLowerCase() === t || x.toLowerCase().includes(t))) { if (cat) (acked[cat] ||= new Set()).add(x); return false; }+ return true;+ });+ const hard = { links: new Set(), fields: new Set(), 'form actions': new Set(), handlers: new Set(), 'test hooks': new Set() };+ const soft = { headings: new Set(), figures: new Set(), images: new Set(), ids: new Set() };+ const total = { links: new Set(was.wiring.links), fields: new Set(was.wiring.fields), handlers: new Set(was.wiring.handlers), 'test hooks': new Set(was.wiring.hooks), headings: new Set(), figures: new Set() };+ for (const x of gone(was.wiring.links, now.wiring.links, 'links')) hard.links.add(x);+ for (const x of gone(was.wiring.fields, now.wiring.fields, 'fields')) hard.fields.add(x);+ for (const x of gone(was.wiring.handlers, now.wiring.handlers, 'handlers')) hard.handlers.add(x);+ for (const x of gone(was.wiring.hooks, now.wiring.hooks, 'test hooks')) hard['test hooks'].add(x);+ for (const x of gone(was.wiring.ids, now.wiring.ids)) soft.ids.add(x);+ const skipped = [];+ let wordsWas = 0, wordsNow = 0;+ for (const [k, b] of Object.entries(was.pages || {})) {+ const a = now.pages[k];+ if (!a) { skipped.push(k); continue; }+ for (const x of b.links || []) total.links.add(x);+ for (const x of b.fields || []) total.fields.add(x);+ for (const x of b.headings || []) total.headings.add(x);+ for (const x of b.figures || []) total.figures.add(x);+ for (const x of gone(b.links, [...a.links, ...now.wiring.links], 'links')) hard.links.add(x);+ for (const x of gone(b.fields, [...a.fields, ...now.wiring.fields], 'fields')) hard.fields.add(x);+ for (const x of gone(b.actions, a.actions)) hard['form actions'].add(x);+ for (const x of gone(b.headings, a.headings, 'headings')) soft.headings.add(x);+ for (const x of gone(b.figures, a.figures, 'figures')) soft.figures.add(x);+ for (const x of gone(b.images, a.images)) soft.images.add(x);+ wordsWas += b.words || 0; wordsNow += a.words || 0;+ }+ const list = (set, n = 8) => { const a = [...set]; return a.slice(0, n).map((x) => trunc(x, 48)).join(', ') + (a.length > n ? ` and ${a.length - n} more` : ''); };+ const fix = 'Restore each one, or record it in the stamp: /* Hallmark · dropped <item>, <item> · <the reason, in the user\'s words> */';+ for (const [k, set] of Object.entries(hard)) if (set.size) report('kept', 'FAIL', SNAP, 1, `${k} the page had before and no longer has: ${list(set)}`, fix);+ const unhooked = gone(now.dangling, was.dangling || []);+ if (unhooked.length) report('kept', 'FAIL', SNAP, 1, `a script still queries ${list(unhooked)}, which the markup no longer has`, 'Keep the ids, classes and data attributes scripts query, or change the script with the markup');+ for (const [k, set] of Object.entries(soft)) if (set.size) report('kept', 'WARN', SNAP, 1, `${k} gone or reworded since the before record: ${list(set)}`, 'Confirm each was meant to go, restore it, or record it as dropped in the stamp');+ if (wordsWas > 80 && wordsNow < wordsWas * 0.6) report('kept', 'WARN', SNAP, 1, `the pages hold ${wordsNow} words where they held ${wordsWas}`, 'Check that no section of content was dropped');+ if (skipped.length) report('kept', 'WARN', SNAP, 1, `not compared, because this run did not render them: ${list(skipped, 4)}`, 'Render the same pages or URLs the before record holds');+ const lostOf = (k) => (hard[k] || soft[k]).size;+ keptLine = { parts: ['links', 'fields', 'handlers', 'test hooks', 'headings', 'figures'].filter((k) => total[k].size).map((k) => { const d = acked[k] ? acked[k].size : 0; return `${k} ${Math.max(0, total[k].size - lostOf(k) - d)}/${total[k].size}${d ? ` (${d} dropped on record)` : ''}`; }), was: was.summary || null };+ }+}+const seen = new Set();const tierOk = (f) => !opts.tier || (opts.tier === 'floor' ? (f.tier === 'floor' && f.grade === 'FAIL') : f.tier === opts.tier);const unique = findings.filter((f) => {@@ -4012,16 +4189,29 @@ if (answered) tally.push(`${answered} ANSWERED`);if (dismissed) tally.push(`${dismissed} DISMISSED`);if (notes) tally.push(`${notes} NOTE`);+let beforeLine = null;+if (opts.before) {+ const inv = takeInventory();+ mkdirSync(dirname(SNAP), { recursive: true });+ writeFileSync(SNAP, JSON.stringify({ v: 1, at: new Date().toISOString(), scope: opts.scope, summary: { fails, reflex, warns }, ...inv }, null, 1) + '\n');+ beforeLine = `before: recorded ${new Set([...inv.wiring.links, ...Object.values(inv.pages).flatMap((p) => p.links)]).size} links, ${new Set([...inv.wiring.fields, ...Object.values(inv.pages).flatMap((p) => p.fields)]).size} fields, ${inv.wiring.handlers.length} handlers, ${inv.wiring.hooks.length} test hooks${Object.keys(inv.pages).length ? ` and ${Object.keys(inv.pages).length} rendered page(s)` : ''} in ${rel(SNAP)}; --kept checks a redesign against it`;+}+const keptNote = keptLine ? `kept: ${keptLine.parts.join(', ') || 'nothing recorded'}${keptLine.was ? `; before ${keptLine.was.fails} FAIL, ${keptLine.was.reflex} REFLEX, now ${fails} FAIL, ${reflex} REFLEX` : ''}` : null;const scopeNote = `${files.length} file(s)${opts.urls.length ? ` and ${opts.urls.length} URL(s)` : ''}${opts.stage === 'hero' ? ' (hero stage)' : ''}`;const renderNote = opts.render ? (renderNotRun ? `render tier not run: ${renderNotRun}` : null) : null;if (opts.json) {console.log(JSON.stringify({- summary: { fails, reflex, warns, waived, rejected, answered, dismissed, notes, files: files.length, render: opts.render ? (renderNotRun ? `not run: ${renderNotRun}` : 'ran') : 'off' },+ summary: { fails, reflex, warns, waived, rejected, answered, dismissed, notes, files: files.length, render: opts.render ? (renderNotRun ? `not run: ${renderNotRun}` : 'ran') : 'off', ...(keptNote ? { kept: keptNote } : {}), ...(beforeLine ? { before: beforeLine } : {}) },findings: unique,}, null, 2));} else {if (!unique.length) console.log(`sloplint: clean. 0 FAIL, 0 REFLEX, 0 WARN across ${scopeNote}.`);- else {+ else if (opts.before) {+ const by = new Map();+ for (const f of unique) { const k = `${f.grade} ${f.gate}`; if (!by.has(k)) by.set(k, []); by.get(k).push(f); }+ for (const [k, list] of by) console.log(` ${k}${list.length > 1 ? ` x${list.length}` : ''} ${list.slice(0, 2).map((f) => `${f.file}:${f.line} ${trunc(f.evidence, 64)}`).join('; ')} | fix: ${list[0].fix}`);+ console.log(`sloplint: ${tally.join(', ')} across ${scopeNote}, grouped by gate; run without --before for every line.`);+ } else {const byFile = new Map();for (const f of unique) { if (!byFile.has(f.file)) byFile.set(f.file, []); byFile.get(f.file).push(f); }const told = new Set();@@ -4037,5 +4227,7 @@ if (opts.json) {console.log(`sloplint: ${tally.join(', ')} across ${scopeNote}.`);}if (renderNote) console.log(renderNote);+ if (keptNote) console.log(keptNote);+ if (beforeLine) console.log(beforeLine);}-process.exit(fails > 0 || reflex > 0 ? 1 : 0);+process.exit(!opts.before && (fails > 0 || reflex > 0) ? 1 : 0);diff --git a/skills/hallmark/scripts/theme.mjs b/skills/hallmark/scripts/theme.mjsindex 5b948f7..7c6c9f3 100644--- a/skills/hallmark/scripts/theme.mjs+++ b/skills/hallmark/scripts/theme.mjs@@ -7,7 +7,7 @@ import { createHash } 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.4.0';+const VERSION = '2.5.0';const args = process.argv.slice(2);const cmd = args[0];const flag = (k, d = null) => { const i = args.indexOf('--' + k); const v = i >= 0 ? args[i + 1] : undefined; return v !== undefined && !String(v).startsWith('--') ? v : d; };@@ -76,14 +76,18 @@ function addLog() {try { entry = JSON.parse(flag('entry', '')); } catch { entry = null; }if (!entry || Array.isArray(entry) || typeof entry !== 'object') { console.error('--entry takes one JSON object, the build\'s log entry'); process.exit(2); }if (!entry.date) entry.date = new Date().toISOString().slice(0, 10);- const missing = ['shape', 'theme', 'axes', 'hero', 'nav', 'footer', 'enrichment', 'entry', 'fingerprint', 'signature', 'brief'].filter((k) => !entry[k]);+ if (!entry.mode) entry.mode = 'build';+ if (!['build', 'redesign'].includes(entry.mode)) { console.error('mode is build or redesign'); process.exit(2); }+ if (entry.mode === 'redesign' && !['polish', 'restyle', 'full'].includes(entry.depth)) { console.error('a redesign entry names its depth: polish, restyle or full'); process.exit(2); }+ const composed = entry.scope !== 'app' && (entry.mode === 'build' || entry.depth === 'full');+ const missing = [...(composed ? ['shape', 'axes', 'hero', 'nav', 'footer', 'enrichment', 'entry', 'fingerprint', 'signature'] : []), 'theme', 'brief'].filter((k) => !entry[k]);if (existsSync(file)) { try { JSON.parse(readFileSync(file, 'utf8')); } catch { console.error(`${file} is not valid JSON; fix it or move it aside, nothing was written`); process.exit(1); } }const next = [entry, ...readLog(file)].slice(0, 20);mkdirSync(dirname(file), { recursive: true });const tmp = `${file}.${process.pid}.tmp`;writeFileSync(tmp, JSON.stringify(next, null, 1) + '\n');renameSync(tmp, file);- console.log(`logged ${entry.shape || '?'} in ${entry.theme || '?'} at the top of ${file} (${next.length} of 20)${missing.length ? `; missing ${missing.join(', ')}, which Rotation reads, so log them` : ''}`);+ console.log(`logged ${entry.mode === 'redesign' ? `a ${entry.depth} redesign` : entry.shape || '?'} in ${entry.theme || '?'} at the top of ${file} (${next.length} of 20)${missing.length ? `; missing ${missing.join(', ')}, which Rotation reads, so log them` : ''}`);}function readLog(p) {