feat: make route map the interactive landing page

This commit is contained in:
Marcos Paulo
2026-09-04 04:18:15 +00:00
parent 94f3491d7a
commit aa85864868
15 changed files with 203 additions and 65 deletions
+18
View File
@@ -0,0 +1,18 @@
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');
+15 -4
View File
@@ -1,6 +1,7 @@
import { readFileSync } from 'node:fs';
const read = (path) => readFileSync(new URL(`../${path}`, import.meta.url), 'utf8');
const html = read('index.html');
const landingHtml = read('index.html');
const html = read('full-guide/index.html');
const js = read('app.js');
const refs = read('docs/references/README.md');
const additional = read('docs/references/additional-reading.md');
@@ -38,9 +39,9 @@ console.log('rules content verification passed');
for (const token of ['const languageCopy','const stages','const skills','const prompts','renderStage','renderSkill','renderLanguage','copyPrompt','addEventListener']) if (!rulesJs.includes(token)) throw new Error(`missing rules interaction ${token}`);
for (const token of ['data-lang="en"','data-lang="pt"','data-copy-prompt','aria-live="polite"','role="tablist"']) if (!rulesHtml.includes(token)) throw new Error(`missing rules control ${token}`);
console.log('rules interaction verification passed');
if (!html.includes('href="rules/"')) throw new Error('main presentation does not link to rules page');
if (!html.includes('href="skills-review/"')) throw new Error('main presentation does not link to skills review page');
for (const token of ['summary/','models/','agents/','skills/','chapter-route']) if (!html.includes(token)) throw new Error(`main presentation missing chapter route ${token}`);
if (!html.includes('href="../rules/"')) throw new Error('main presentation does not link to rules page');
if (!html.includes('href="../skills-review/"')) throw new Error('main presentation does not link to skills review page');
for (const token of ['../summary/','../models/','../agents/','../skills/','chapter-route']) if (!html.includes(token)) throw new Error(`main presentation missing chapter route ${token}`);
if (rulesHtml.includes('script src="http') || rulesHtml.includes('rel="stylesheet" href="http')) throw new Error('rules page has an external runtime dependency');
for (const token of ['@media(min-width:2200px)','@media(max-width:900px)','@media(max-width:600px)','prefers-reduced-motion']) if (!rulesCss.includes(token)) throw new Error(`missing rules responsive contract ${token}`);
console.log('rules standalone verification passed');
@@ -53,3 +54,13 @@ console.log('skills review verification passed');
for (const page of [summaryHtml, modelsHtml, agentsHtml, skillsHtml]) if (!page.includes('../chapters.css') || !page.includes('ROUTE MAP')) throw new Error('chapter page missing shared navigation');
for (const token of ['--ink','@media(max-width:800px)','@media(max-width:520px)']) if (!chaptersCss.includes(token)) throw new Error(`missing chapter responsive contract ${token}`);
console.log('chapter route verification passed');
for (const token of ['The short route','full-guide/','models/','agents/','skills/','rules/','hands-on/starter/','skills-review/']) if (!landingHtml.includes(token)) throw new Error(`landing page missing ${token}`);
if (landingHtml.includes('app.js')) throw new Error('landing page should remain a fast, static route map');
console.log('landing route verification passed');
for (const token of ['data-package-file="skill"','data-package-file="references"','data-package-file="scripts"','data-package-file="assets"','id="package-preview"','script src="app.js"']) if (!skillsHtml.includes(token)) throw new Error(`skills anatomy missing ${token}`);
const skillsApp = read('skills/app.js');
const skillsCss = read('skills/styles.css');
for (const token of ['const packageFiles','function renderPackage','addEventListener','renderPackage(\'skill\')']) if (!skillsApp.includes(token)) throw new Error(`skills anatomy interaction missing ${token}`);
for (const token of ['grid-template-columns:minmax(190px','overflow-wrap:anywhere','@media(max-width:800px)','prefers-reduced-motion']) if (!skillsCss.includes(token)) throw new Error(`skills anatomy responsive contract missing ${token}`);
console.log('skills anatomy verification passed');
console.log('presentation verification passed');