Skip to content

Anti-AI-slop design skill for Claude Code, Cursor, and Codex.

CSS

References lint themselves before they install

Youssef410888d76b2f
diff --git a/README.md b/README.md
index 70297a1..9b8ace7 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,7 @@ The same SKILL.md, references, gates and scripts run in **Claude Code**, **Codex
node skills/hallmark/scripts/sloplint.mjs <file-or-dir> --genre <genre> --render
```
-One command installs a lean copy (skill, references, scripts, about 1.2 MB, never the marketing site) everywhere it belongs, rebuilding the theme index on the way:
+One command installs a lean copy (skill, references, scripts, never the marketing site) everywhere it belongs. On the way it rebuilds the theme index and runs `scripts/refcheck.mjs`, which reads every reference file for dead links, missing sections, retired gate numbers, unknown tokens, stale stamps and sample copy that breaks a gate; the install stops if it finds one:
```bash
node skills/hallmark/scripts/install.mjs
diff --git a/skills/hallmark/references/components/c2-inline-form-as-cta.md b/skills/hallmark/references/components/c2-inline-form-as-cta.md
index a1be6f2..75a1dac 100644
--- a/skills/hallmark/references/components/c2-inline-form-as-cta.md
+++ b/skills/hallmark/references/components/c2-inline-form-as-cta.md
@@ -1,7 +1,7 @@
### C2 · Inline form as CTA
The CTA is the form: one email field and a verb button on the same rule. No separate sign-up page.
*Use when:* the action is collecting an email.
-*Not:* a two-step flow ("Continue" is for a second step); a field and a button sharing one border (craft § 9); a button that says "Submit" (craft § 6).
+*Not:* a two-step flow ("Continue" is for a second step); a field and a button sharing one border (`craft.md` § 9); a button that says "Submit" (`craft.md` § 6).
```html
<form class="cta-form" action="/subscribe" method="post">
diff --git a/skills/hallmark/references/components/f3-tabular-spec-sheet.md b/skills/hallmark/references/components/f3-tabular-spec-sheet.md
index 3dd2480..d87bacf 100644
--- a/skills/hallmark/references/components/f3-tabular-spec-sheet.md
+++ b/skills/hallmark/references/components/f3-tabular-spec-sheet.md
@@ -1,7 +1,7 @@
### F3 · Tabular spec sheet
Each row is a feature: name, value, note. Hairline rules between rows, tabular numerals.
*Use when:* features compare as numbers.
-*Not:* F1 (rhythmic, not tabular); a card around a table (craft § 9). Every value is the user's and carries its source; a row with neither is dropped (46a).
+*Not:* F1 (rhythmic, not tabular); a card around a table (`craft.md` § 9). Every value is the user's and carries its source; a row with neither is dropped (46a).
```html
<table class="spec-sheet">
@@ -27,4 +27,4 @@ Each row is a feature: name, value, note. Hairline rules between rows, tabular n
## Mobile
-- Below 40rem: the table scrolls sideways in a wrapper (craft § 9); the note column drops.
+- Below 40rem: the table scrolls sideways in a wrapper (`craft.md` § 9); the note column drops.
diff --git a/skills/hallmark/references/components/h8-mockup-split-browser-framed.md b/skills/hallmark/references/components/h8-mockup-split-browser-framed.md
index 9ba3710..1597fbc 100644
--- a/skills/hallmark/references/components/h8-mockup-split-browser-framed.md
+++ b/skills/hallmark/references/components/h8-mockup-split-browser-framed.md
@@ -7,7 +7,7 @@ Headline left, one real capture right, set like a plate in a catalogue: a `<figu
<section class="hero-plate">
<div class="hero-plate__copy"><h1>…</h1><p>…</p><a class="cta-outline" href="#">…</a></div>
<figure class="hero-plate__figure">
- <div class="hero-plate__capture" data-slot="hero"><!-- the user's capture, or the theme's placeholder (craft § 8) --></div>
+ <div class="hero-plate__capture" data-slot="hero"><!-- the user's capture, or the theme's placeholder (`craft.md` § 8) --></div>
<figcaption>…</figcaption>
</figure>
</section>
diff --git a/skills/hallmark/references/export-formats.md b/skills/hallmark/references/export-formats.md
index 63692b8..08aef6d 100644
--- a/skills/hallmark/references/export-formats.md
+++ b/skills/hallmark/references/export-formats.md
@@ -31,6 +31,7 @@ Every Hallmark output writes these tokens (or a subset, if the page doesn't use
| `--color-field` | colour | (Committed posture only: the carried colour) |
| `--color-accent-2` | colour | (a second ink, only on a theme that names it) |
| `--color-focus` | colour | (often = accent at higher chroma) |
+| `--color-error` / `--color-success` | colour | form states; the scaffold's defaults, a theme may override |
| `--font-display` | font | `"Fraunces", ui-serif, Georgia, serif` |
| `--font-body` | font | `"Geist", ui-sans-serif, system-ui, sans-serif` |
| `--font-outlier` | font | `"Geist Mono", ui-monospace, monospace` |
@@ -38,7 +39,7 @@ Every Hallmark output writes these tokens (or a subset, if the page doesn't use
| `--text-xs` … `--text-display` | length | 1.25 (major-third) ratio scale |
| `--ease-out` / `--ease-in` / `--ease-in-out` | easing | `cubic-bezier(0.16, 1, 0.3, 1)` etc. |
| `--dur-micro` / `--dur-short` / `--dur-long` | time | `120ms` / `220ms` / `420ms` |
-| `--rule-hair` / `--rule-fine` | length | `1px` / `2px` |
+| `--rule-hair` / `--rule-bar` | length | `1px` / `2px` to `5px` (a theme that draws heavy rules names `--rule-bar`) |
| `--radius-card` / `--radius-pill` / `--radius-input` | length | varies per theme |
| `--shadow-card` | shadow | varies per theme |
| `--z-base` … `--z-tooltip` | integer | 1, 10, 100, 200, 300, 400, 500, 600 |
diff --git a/skills/hallmark/references/hero-enrichment.md b/skills/hallmark/references/hero-enrichment.md
index d33c370..b0884ca 100644
--- a/skills/hallmark/references/hero-enrichment.md
+++ b/skills/hallmark/references/hero-enrichment.md
@@ -17,7 +17,7 @@ The default is typography only. Match the brief against this table and act on th
| e-commerce, shop, store, product catalogue, brand, fashion, lookbook | Real product photos; a `data-slot` placeholder until the user provides them |
| photography, portfolio, gallery, artist | Imagery is the page; slots until the user provides it |
| food, restaurant, menu, dish, coffee, wine, recipe | A hero photo and product crops; slots until the user provides them |
-| team, staff, about us, portraits, hiring, careers | Kit avatars ([`imagery-kit.md`](imagery-kit.md) § avatar, with their paired names) until the user provides real people; never pravatar, dicebear or unsplash faces (F9) |
+| team, staff, about us, portraits, hiring, careers | A team `data-slot` sized for the user's real photos; kit avatars ([`imagery-kit.md`](imagery-kit.md) § Categories) may hold the slot with no name, title or quote attached; never pravatar, dicebear or unsplash faces (F9) |
| travel, hotel, destination, real estate, listing, property | A cover photo and tile photos; slots until the user provides them |
| news, blog, magazine, journal, publication | A feature image per post; slots until the user provides them |
| SaaS landing, platform, dashboard, developer tool | A real capture in a slot: E4 (screenshot) or E1 (demo video). No capture, a designed placeholder (`craft.md` § 8), never a drawn mockup (47c) |
diff --git a/skills/hallmark/references/interaction-and-states.md b/skills/hallmark/references/interaction-and-states.md
index b4f186b..9aff999 100644
--- a/skills/hallmark/references/interaction-and-states.md
+++ b/skills/hallmark/references/interaction-and-states.md
@@ -91,7 +91,7 @@ The outline starts transparent at 2 px so when the focus ring appears, the box g
| **Active / typing** | Same as focus. Don't add a separate "typing" state. | Focus already says "active here". A second signal is noise. |
| **Filled** | Same as default, the value carries the state. Optionally a subtle ink-2 border to visually distinguish from empty. | Don't fight the user's content with a styled chrome change. |
| **Disabled** | `opacity: 0.55` · `cursor: not-allowed` · placeholder `var(--color-rule-2)` · `aria-disabled="true"` · `tabindex="-1"` | Three independent signals (opacity + cursor + colour) so no single channel carries the whole load. |
-| **Error** | `border-color: var(--color-error, oklch(58% 0.20 25))` · helper-text replaced by error message · `aria-invalid="true"` · an error icon from the page's icon set in the right-edge slot | Border colour flip is OK *because* helper-text and aria signal it too. Never colour alone. |
+| **Error** | `border-color: var(--color-error)` · helper-text replaced by error message · `aria-invalid="true"` · an error icon from the page's icon set in the right-edge slot | Border colour flip is OK *because* helper-text and aria signal it too. Never colour alone. |
| **Success** | Subtle accent-coloured border (3 % chroma above default) · a check icon from the page's icon set · auto-clear if user re-edits | Quiet; success doesn't deserve celebration unless it was hard. |
| **Loading** (validating, async) | Inline spinner at the right edge replacing the standard glyph slot · field stays editable but submit disabled | Don't lock the user out of the field. They may want to fix what they typed. |
diff --git a/skills/hallmark/references/texture.md b/skills/hallmark/references/texture.md
index 299ea8e..240d59b 100644
--- a/skills/hallmark/references/texture.md
+++ b/skills/hallmark/references/texture.md
@@ -58,6 +58,7 @@ Riso's signature, portable to any print-lineage custom:
Arcade's recipe; the retro signal is atmosphere, never a drawn monitor bezel (47a):
```css
+:root { --scanline: oklch(from var(--color-ink) l c h / 0.06); }
body::after { content: ""; position: fixed; inset: 0; z-index: var(--z-raised);
pointer-events: none;
background: repeating-linear-gradient(transparent 0 2px, var(--scanline) 2px 3px); }
diff --git a/skills/hallmark/references/themes/index.json b/skills/hallmark/references/themes/index.json
index bf0e22d..9eb4fbb 100644
--- a/skills/hallmark/references/themes/index.json
+++ b/skills/hallmark/references/themes/index.json
@@ -1,5 +1,5 @@
{
- "built": "2026-09-25",
+ "built": "2026-10-01",
"themes": [
{
"name": "Almanac",
diff --git a/skills/hallmark/scripts/install.mjs b/skills/hallmark/scripts/install.mjs
index 2b8219e..fee9c16 100644
--- a/skills/hallmark/scripts/install.mjs
+++ b/skills/hallmark/scripts/install.mjs
@@ -85,12 +85,22 @@ if (!picked.length) {
process.exit(1);
}
+const { execFileSync } = await import("node:child_process");
try {
- const { execFileSync } = await import("node:child_process");
execFileSync(process.execPath, [path.join(HERE, "theme.mjs"), "index"], { stdio: DRY ? "ignore" : "inherit" });
} catch {
console.log(" (theme index not rebuilt; run node scripts/theme.mjs index)");
}
+const gate = (label, argv) => {
+ try { execFileSync(process.execPath, argv, { stdio: "pipe" }); return true; }
+ catch (e) { console.log(`\n${label} failed:\n${String(e.stdout || "").trim()}`); return false; }
+};
+const themeFiles = fs.readdirSync(path.join(SKILL_ROOT, "references", "themes")).filter((f) => f.endsWith(".md")).map((f) => path.join(SKILL_ROOT, "references", "themes", f));
+const clean = gate("refcheck", [path.join(HERE, "refcheck.mjs"), "--errors"]) & gate("theme validate", [path.join(HERE, "theme.mjs"), "validate", ...themeFiles]);
+if (!clean && !has("--force")) {
+ console.log("\nNothing installed. Fix the findings above, or pass --force to install anyway.");
+ process.exit(1);
+}
console.log(`Hallmark installer${DRY ? " (dry run)" : ""} · payload: ${PAYLOAD.join(", ")}`);
for (const key of picked) {
diff --git a/skills/hallmark/scripts/refcheck.mjs b/skills/hallmark/scripts/refcheck.mjs
new file mode 100644
index 0000000..6dbc9b5
--- /dev/null
+++ b/skills/hallmark/scripts/refcheck.mjs
@@ -0,0 +1,260 @@
+#!/usr/bin/env node
+import { readFileSync, readdirSync, statSync, existsSync } from 'node:fs';
+import { join, dirname, relative, basename, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+const args = process.argv.slice(2);
+const AS_JSON = args.includes('--json');
+const ONLY_ERRORS = args.includes('--errors');
+
+function walk(dir, out = []) {
+ for (const name of readdirSync(dir)) {
+ if (name === 'node_modules' || name === '.hallmark' || name.startsWith('.')) continue;
+ const p = join(dir, name);
+ const st = statSync(p);
+ if (st.isDirectory()) { if (name !== 'fixtures') walk(p, out); }
+ else out.push(p);
+ }
+ return out;
+}
+
+const FILES = walk(ROOT);
+const MD = FILES.filter((f) => f.endsWith('.md'));
+const TEXT = FILES.filter((f) => /\.(md|mjs|json|yaml|css|html)$/.test(f));
+const BY_BASE = new Map();
+for (const f of FILES) { const b = basename(f); if (!BY_BASE.has(b)) BY_BASE.set(b, []); BY_BASE.get(b).push(f); }
+const read = (f) => readFileSync(f, 'utf8');
+const findings = [];
+const add = (level, file, line, rule, msg) => findings.push({ level, file: relative(ROOT, file), line, rule, msg });
+const lineAt = (src, i) => src.slice(0, i).split('\n').length;
+
+const SKILL = join(ROOT, 'SKILL.md');
+const VERSION = (/^version:\s*([\d.]+)/m.exec(read(SKILL)) || [])[1];
+
+const gatesSrc = read(join(ROOT, 'references', 'gates.md'));
+const GATES = new Map();
+for (const m of gatesSrc.matchAll(/^\|\s*(\d{1,2}(?:[a-d]|i{1,3})?)\s*\|\s*(Floor|Reflex|Ledger)\s*\|/gm)) GATES.set(m[1], m[2].toLowerCase());
+const FCHECKS = new Set([...gatesSrc.matchAll(/\b(F\d{1,2})\s/g)].map((m) => m[1]));
+const retiredLine = (/Gates ([\d, and]+) were merged/.exec(gatesSrc) || [])[1] || '';
+const RETIRED = new Set((retiredLine.match(/\d+/g) || []));
+const NUMBERS = new Set([...GATES.keys()].map((k) => k.match(/^\d+/)[0]));
+
+function gateProblem(id) {
+ if (/^F\d+$/.test(id)) return FCHECKS.has(id) ? null : `F-check ${id} does not exist`;
+ const num = id.match(/^\d+/)[0];
+ if (RETIRED.has(num)) return `gate ${num} is retired`;
+ if (GATES.has(id)) return null;
+ if (id === num && NUMBERS.has(num)) return null;
+ if (!NUMBERS.has(num)) return `gate ${num} does not exist`;
+ return `gate ${num} has no clause ${id.slice(num.length)}`;
+}
+
+const ID = String.raw`(?:F\d{1,2}|\d{1,2}(?:[a-d]|i{1,3})?)`;
+const GATE_LIST = new RegExp(String.raw`\b(?:gates?|waive|answered)\s+(${ID}(?:(?:\s*,\s*|\s+and\s+|\s+to\s+|\s+or\s+)${ID})*)`, 'gi');
+const PAREN_LIST = new RegExp(String.raw`\((${ID}(?:,\s*${ID})*)\)`, 'g');
+
+for (const f of MD) {
+ const src = read(f);
+ const isGates = f.endsWith(join('references', 'gates.md'));
+ const seen = new Set();
+ const check = (list, at) => {
+ for (const id of list.split(/\s*,\s*|\s+and\s+|\s+to\s+|\s+or\s+/)) {
+ const key = `${id}@${at}`;
+ if (!id || seen.has(key)) continue;
+ seen.add(key);
+ const p = gateProblem(id);
+ if (p) add('error', f, lineAt(src, at), 'gate', p);
+ }
+ };
+ for (const m of src.matchAll(GATE_LIST)) {
+ if (isGates && /were merged|stay retired|Retired numbers/.test(src.slice(Math.max(0, m.index - 200), m.index + 200))) continue;
+ check(m[1], m.index);
+ }
+ for (const m of src.matchAll(PAREN_LIST)) {
+ if (/[\w-]/.test(src[m.index - 1] || '')) continue;
+ if (/^\d+$/.test(m[1]) && Number(m[1]) > 67) continue;
+ check(m[1], m.index);
+ }
+}
+
+const PROJECT_FILES = new Set(['design.md', 'DESIGN.md', 'brand-spec.md', 'AGENTS.md', 'CLAUDE.md', 'brief.md', 'README.md', 'prompts.md', 'notes.md']);
+const CODE_EXT = /\.(md|mjs)$/;
+for (const f of MD) {
+ const src = read(f);
+ for (const m of src.matchAll(/\]\(([^)\s]+)\)/g)) {
+ const raw = m[1];
+ if (/^(https?:|mailto:|#)/.test(raw)) continue;
+ const target = raw.split('#')[0];
+ if (!target) continue;
+ const p = resolve(dirname(f), target);
+ if (!existsSync(p)) add('error', f, lineAt(src, m.index), 'link', `dead link ${raw}`);
+ }
+ for (const m of src.matchAll(/`([\w./-]+\.(?:md|mjs))`/g)) {
+ const name = m[1];
+ if (name.includes('<') || name.includes('*')) continue;
+ const b = basename(name);
+ if (PROJECT_FILES.has(b) && !name.includes('references/')) continue;
+ if (!CODE_EXT.test(b)) continue;
+ const found = BY_BASE.has(b) || existsSync(resolve(dirname(f), name)) || existsSync(join(ROOT, name));
+ if (!found) add('error', f, lineAt(src, m.index), 'mention', `names ${name}, which does not exist`);
+ }
+}
+
+const headingsOf = new Map();
+function headings(file) {
+ if (!headingsOf.has(file)) {
+ const src = read(file);
+ const hs = [...src.matchAll(/^(#{1,4})\s+(.+)$/gm)].map((m) => m[2].replace(/[*`]/g, '').trim());
+ const bold = [...src.matchAll(/^\s*(?:[-*]\s+|\d+\.\s+)?\*\*([^*]+)\*\*/gm)].map((m) => m[1].trim());
+ headingsOf.set(file, { hs, bold });
+ }
+ return headingsOf.get(file);
+}
+const norm = (s) => s.toLowerCase().replace(/[^a-z0-9 ]+/g, ' ').replace(/\s+/g, ' ').trim();
+for (const f of MD) {
+ const src = read(f);
+ for (const m of src.matchAll(/§\s*([^\n§]{1,60})/g)) {
+ const lineStart = src.lastIndexOf('\n', m.index) + 1;
+ const back = src.slice(lineStart, m.index);
+ const mentions = [...back.matchAll(/([\w-]+(?:\/[\w-]+)*\.md)/g)];
+ const fm = mentions.length ? mentions[mentions.length - 1] : null;
+ let target = f;
+ if (fm) {
+ const cands = BY_BASE.get(basename(fm[1])) || [];
+ if (!cands.length) continue;
+ target = cands.find((c) => c.endsWith(fm[1])) || cands[0];
+ }
+ const rest = m[1].trim();
+ const { hs, bold } = headings(target);
+ const num = /^(\d+)\b/.exec(rest);
+ if (num) {
+ if (!hs.some((h) => new RegExp(`^${num[1]}[.\\s]`).test(h))) add('error', f, lineAt(src, m.index), 'section', `${relative(ROOT, target)} has no § ${num[1]}`);
+ continue;
+ }
+ const words = norm(rest.split(/[,.;:()]|\s(?:and|to|or|for|on|in|when|is|binds|says|owns)\s/)[0]).split(' ').slice(0, 3).join(' ');
+ if (!words || words.length < 3) continue;
+ const pool = [...hs, ...bold].map(norm);
+ const first = words.split(' ')[0];
+ if (!pool.some((h) => h.includes(words) || h.startsWith(first) || h.includes(` ${first}`))) add('warn', f, lineAt(src, m.index), 'section', `${relative(ROOT, target)} has no section like "§ ${rest.split(/[,.;:)]/)[0].trim()}"`);
+ }
+ for (const m of src.matchAll(/\bStep (\d+(?:\.\d+)?)\b/g)) {
+ const n = m[1];
+ if (n.includes('.') || Number(n) > 7) add('error', f, lineAt(src, m.index), 'step', `SKILL.md has no Step ${n} (steps run 0 to 7)`);
+ }
+}
+
+const theme = read(join(ROOT, 'scripts', 'theme.mjs'));
+const tokenNames = (s) => new Set([...s.matchAll(/(--[a-z][\w-]*)\s*:/g)].map((m) => m[1]));
+const CANON = new Set();
+for (const block of ['SCALE', 'CUSTOM_TOKENS']) {
+ const m = new RegExp(`const ${block} = \`([\\s\\S]*?)\`;`).exec(theme);
+ if (m) for (const t of tokenNames(m[1])) CANON.add(t);
+}
+const exportSrc = read(join(ROOT, 'references', 'export-formats.md'));
+const taxonomy = exportSrc.slice(exportSrc.indexOf('## Token taxonomy'), exportSrc.indexOf('## Format 1'));
+for (const m of taxonomy.matchAll(/`(--[a-z][\w-]*)`/g)) CANON.add(m[1]);
+const THEME_DIR = join(ROOT, 'references', 'themes');
+const themeFiles = MD.filter((f) => dirname(f) === THEME_DIR && basename(f) !== 'README.md');
+const themeCount = new Map();
+for (const f of themeFiles) for (const t of tokenNames(read(f))) themeCount.set(t, (themeCount.get(t) || 0) + 1);
+for (const [t, n] of themeCount) if (n >= Math.ceil(themeFiles.length * 0.9)) CANON.add(t);
+for (const t of ['--banner-height', '--i', '--texture-opacity', '--logo-count']) CANON.add(t);
+const PHANTOM = new Map(Object.entries({
+ '--page-gutter': '--gutter', '--page-max': '--container', '--ease-standard': '--ease-out', '--dur-mid': '--dur-long',
+ '--dur-fast': '--dur-micro', '--dur-base': '--dur-short', '--dur-slow': '--dur-long', '--banner-h': '--banner-height',
+ '--bar-h': 'a min-height', '--font-mono': '--font-outlier', '--font-label': '--font-body', '--font-wordmark': '--font-outlier',
+ '--tracking-label': 'nothing (labels are untracked, gate 67)', '--display': '--font-display', '--rule-fine': '--rule-bar',
+}));
+const codeOf = (src) => [...src.matchAll(/```[a-z]*\n([\s\S]*?)```/g)].map((m) => ({ text: m[1], at: m.index + m[0].indexOf(m[1]) })).concat([...src.matchAll(/`([^`\n]+)`/g)].map((m) => ({ text: m[1], at: m.index })));
+for (const f of MD) {
+ const src = read(f);
+ const isTheme = dirname(f) === THEME_DIR;
+ const local = tokenNames(src);
+ for (const { text, at } of codeOf(src)) {
+ for (const m of text.matchAll(/var\(\s*(--[a-z][\w-]*)/g)) {
+ const t = m[1];
+ const line = lineAt(src, at + m.index);
+ if (PHANTOM.has(t) && !local.has(t)) add('error', f, line, 'token', `${t} does not exist; use ${PHANTOM.get(t)}`);
+ else if (!CANON.has(t) && !local.has(t) && !isTheme) {
+ const n = themeCount.get(t) || 0;
+ add('warn', f, line, 'token', n ? `${t} exists only in ${n} theme(s); a shared file cannot rely on it` : `${t} is not in the token vocabulary (export-formats.md § Token taxonomy)`);
+ }
+ }
+ }
+}
+
+const stampRe = /Hallmark · (macrostructure|studied):/g;
+for (const f of TEXT) {
+ const src = read(f);
+ if (/[\u2014\u2013]/.test(src)) for (const m of src.matchAll(/[\u2014\u2013]/g)) add('error', f, lineAt(src, m.index), 'dash', 'em or en dash');
+ for (const m of src.matchAll(stampRe)) add('error', f, lineAt(src, m.index), 'stamp', `old stamp field "${m[1]}:"; the stamp opens with shape, genre, theme`);
+ for (const m of src.matchAll(/(?:Hallmark[^\n]{0,200}|\*\/[^\n]{0,0})\bv(\d+\.\d+\.\d+)\b/g)) {
+ if (VERSION && m[1] !== VERSION && !/v0\.|v1\./.test(`v${m[1]}`)) add('error', f, lineAt(src, m.index), 'version', `v${m[1]} where the skill is v${VERSION}`);
+ }
+}
+const themeVersion = (/const VERSION = '([\d.]+)'/.exec(theme) || [])[1];
+if (themeVersion !== VERSION) add('error', join(ROOT, 'scripts', 'theme.mjs'), 1, 'version', `theme.mjs VERSION ${themeVersion} where SKILL.md says ${VERSION}`);
+
+for (const f of MD) {
+ const src = read(f);
+ for (const m of src.matchAll(/```html\n([\s\S]*?)```/g)) {
+ const html = m[1].replace(/<!--[\s\S]*?-->/g, '').replace(/<(script|style)[\s\S]*?<\/\1>/g, '');
+ for (const t of html.matchAll(/>([^<>]*)</g)) {
+ const text = t[1];
+ const line = lineAt(src, m.index + m[0].indexOf(m[1]) + t.index);
+ if (/[←→↗↘↩]|-->|->/.test(text)) add('error', f, line, '63', `arrow in sample copy: "${text.trim().slice(0, 50)}"`);
+ if (/\S\s·\s\S/.test(text) && !/marquee|ticker/i.test(html)) add('warn', f, line, '63', `middle-dot string in sample copy: "${text.trim().slice(0, 50)}"`);
+ }
+ }
+ for (const m of src.matchAll(/```css\n([\s\S]*?)```/g)) {
+ for (const r of m[1].matchAll(/([^{}]+)\{([^}]*)\}/g)) {
+ const sel = r[1].trim(); const body = r[2];
+ const ls = /letter-spacing:\s*(-?[\d.]+)em/.exec(body);
+ if (/uppercase/.test(body) && ls && Number(ls[1]) > 0.04 && /label|caption|meta|tag|chip|eyebrow|kicker|th\b|nav|link|small|note/i.test(sel) && !/wordmark|logo|brand/i.test(sel)) add('error', f, lineAt(src, m.index + m[0].indexOf(m[1]) + r.index + r[0].length - r[0].trimStart().length), '67', `${sel} sets tracked capitals (${ls[1]}em)`);
+ if (/small-caps|smcp/.test(body)) add('error', f, lineAt(src, m.index + m[0].indexOf(m[1]) + r.index + r[0].length - r[0].trimStart().length), '67', `${sel} sets small caps`);
+ }
+ }
+}
+
+const sloplint = read(join(ROOT, 'scripts', 'sloplint.mjs'));
+const tiersBlock = (/const TIERS = new Map\(Object\.entries\(\{([\s\S]*?)\}\)\)/.exec(sloplint) || [])[1] || '';
+const TIERS = new Map([...tiersBlock.matchAll(/'([\w]+)':\s*'(\w+)'/g)].map((m) => [m[1], m[2]]));
+for (const [id, tier] of GATES) {
+ const t = TIERS.get(id);
+ if (t && t !== tier) add('error', join(ROOT, 'scripts', 'sloplint.mjs'), 1, 'tier', `sloplint tiers ${id} as ${t}; gates.md says ${tier}`);
+}
+
+const index = JSON.parse(read(join(THEME_DIR, 'index.json')));
+const indexed = new Set(index.themes.map((t) => t.slug));
+for (const f of themeFiles) if (!indexed.has(basename(f, '.md'))) add('error', f, 1, 'index', 'theme missing from index.json (run theme.mjs index)');
+for (const t of index.themes) if (!existsSync(join(ROOT, t.file))) add('error', join(THEME_DIR, 'index.json'), 1, 'index', `index lists ${t.file}, which does not exist`);
+
+const reach = new Set([SKILL]);
+const queue = [SKILL];
+while (queue.length) {
+ const f = queue.shift();
+ const src = read(f);
+ const names = new Set([...src.matchAll(/([\w-]+\.(?:md|mjs|json))/g)].map((m) => m[1]));
+ for (const n of names) for (const c of BY_BASE.get(n) || []) if (!reach.has(c)) { reach.add(c); if (c.endsWith('.md')) queue.push(c); }
+}
+for (const f of themeFiles) reach.add(f);
+for (const f of [...reach]) {
+ if (!f.endsWith('.md')) continue;
+ for (const m of read(f).matchAll(/([\w-]+)\/<[\w-]+>\.md/g)) for (const c of MD) if (basename(dirname(c)) === m[1]) reach.add(c);
+}
+for (const f of MD) if (!reach.has(f) && basename(f) !== 'README.md') add('warn', f, 1, 'orphan', 'no file reachable from SKILL.md names this file');
+
+const skillBytes = Buffer.byteLength(read(SKILL));
+if (skillBytes > 20480) add('warn', SKILL, 1, 'size', `SKILL.md is ${skillBytes} bytes; keep it under 20 KB`);
+
+const shown = ONLY_ERRORS ? findings.filter((x) => x.level === 'error') : findings;
+const errors = findings.filter((x) => x.level === 'error').length;
+const warns = findings.length - errors;
+if (AS_JSON) console.log(JSON.stringify({ errors, warns, findings: shown }, null, 1));
+else {
+ shown.sort((a, b) => (a.level === b.level ? a.file.localeCompare(b.file) || a.line - b.line : a.level === 'error' ? -1 : 1));
+ for (const x of shown) console.log(`${x.level === 'error' ? 'ERROR' : 'warn '} ${x.file}:${x.line} [${x.rule}] ${x.msg}`);
+ console.log(errors || warns ? `refcheck: ${errors} error(s), ${warns} warning(s) across ${MD.length} reference files` : `refcheck: clean across ${MD.length} reference files`);
+}
+process.exit(errors ? 1 : 0);
diff --git a/skills/hallmark/scripts/theme.mjs b/skills/hallmark/scripts/theme.mjs
index 0ee4e37..5ce0854 100644
--- a/skills/hallmark/scripts/theme.mjs
+++ b/skills/hallmark/scripts/theme.mjs
@@ -190,6 +190,7 @@ const SCALE = ` --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm
--text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
--ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
--dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms;
+ --color-error: oklch(52% 0.19 27); --color-success: oklch(50% 0.12 150);
--container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap: 144px;
--z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600;`;