Files
ai-for-dummies/scripts/audit-ui.mjs
Marcos Paulo 2e79aacecc revert: drop task 03's out-of-scope audit-ui changes
The verification-engineer brief scopes task 03 to the snapshot regression net.
It also rewrote scripts/audit-ui.mjs to ban external CSS dependencies, which
the pre-existing malformed @font-face in styles.css violates, leaving the gate
red for every downstream task.

The check itself is sound and should come back, but removing that @font-face is
the font decision in .agents/context/design-system.md — task 02's call, and a
human one. Snapshot net kept intact.

Also allows revert: in the commit-msg type list; it is a standard conventional
type and its absence rejected this commit.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 03:31:53 +00:00

40 lines
1.5 KiB
JavaScript

import { readFileSync } from 'node:fs';
const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8');
const pages = [
'index.html',
'full-guide/index.html',
'summary/index.html',
'models/index.html',
'agents/index.html',
'skills/index.html',
'rules/index.html',
'skills-review/index.html',
'hands-on/starter/index.html',
'hands-on/rules/index.html',
];
for (const page of pages) {
const html = read(page);
if (!html.includes('name="viewport"')) throw new Error(`${page} lacks a viewport declaration`);
if (html.match(/<(script|link)[^>]+(src|href)="https?:[^\"]+"/i))
throw new Error(`${page} has an external runtime dependency`);
}
const shared = read('chapters.css');
const skills = read('skills/styles.css');
const guide = read('full-guide/index.html');
const guideAudit = read('full-guide/audit.css');
for (const token of ['@media(max-width:800px)', '@media(max-width:520px)'])
if (!shared.includes(token)) throw new Error(`shared chapter CSS lacks ${token}`);
for (const token of [
'minmax(0,1.3fr)',
'overflow-wrap:anywhere',
'@media(max-width:800px)',
'prefers-reduced-motion',
])
if (!skills.includes(token)) throw new Error(`skills package CSS lacks ${token}`);
if (!guide.includes('href="audit.css"'))
throw new Error('full guide does not load its responsive audit overrides');
for (const token of ['.handoff table', '.route-table button', 'overflow-wrap:anywhere'])
if (!guideAudit.includes(token)) throw new Error(`full guide audit CSS lacks ${token}`);
console.log('responsive UI audit passed');