heymegabyte/agent-skills / 15-site-generation
site-generation
UnverifiedEnd-to-end AI website generation pipeline. Claude Opus 4.8 emits Bolt-style <boltArtifact> envelopes (multi-file, plan-first) that customize Vite+React+Tailwind templates from pre-researched business data. Pre-research via APIs, media acquisition, brand extraction, visual inspection via GPT Image 2 vision, R2 upload (per-file content-type by extension), D1 status updates. Supports all business types: SaaS, portfolio, non-profit, restaurant, salon, medical, legal, retail, tech.
validate-page-count.mjs
View on GitHub#!/usr/bin/env node
// validate-page-count.mjs — page-count floor + 1:N source-mapping gate
// Floor: every site ≥4 pages (Home + About + Services + Contact). Even 1-page source
// rebuilds get the 4-page floor (rules/build-breaking — site-rebuild full-corpus mandate).
// 1:N: when source sitemap has N pages (12, 80, 750), rebuild has ≥N pages. Cap at 1000
// for runaway crawls. Page count is NEVER capped at 5-8.
// Usage: node validate-page-count.mjs <build-dir>
// build-dir: contains _scraped_content.json (source routes) + dist/ (rebuilt pages)
// Exit 0 = pass, exit 1 = fail.
import { readdirSync, readFileSync, statSync, existsSync } from 'node:fs';
import { join, relative, resolve } from 'node:path';
const BUILD = resolve(process.argv[2] || '.');
const SCRAPED = join(BUILD, '_scraped_content.json');
const DIST = existsSync(join(BUILD, 'dist')) ? join(BUILD, 'dist') : BUILD;
if (!existsSync(DIST)) {
console.error(`[validate-page-count] dist dir not found: ${DIST}`);
process.exit(1);
}
function walkHtml(dir) {
const out = [];
for (const entry of readdirSync(dir)) {
if (entry === 'node_modules' || entry === '.git') continue;
const p = join(dir, entry);
if (statSync(p).isDirectory()) out.push(...walkHtml(p));
else if (entry.toLowerCase().endsWith('.html')) out.push(p);
}
return out;
}
const failures = [];
const warnings = [];
const builtHtml = walkHtml(DIST);
const builtCount = builtHtml.length;
// Floor: ≥4 pages
const FLOOR = 4;
if (builtCount < FLOOR) {
failures.push(`page count ${builtCount} below ≥${FLOOR} floor (Home/About/Services/Contact minimum)`);
}
// 1:N mapping when source sitemap available
let sourceCount = 0;
if (existsSync(SCRAPED)) {
const scraped = JSON.parse(readFileSync(SCRAPED, 'utf8'));
const routes = scraped.routes ?? scraped.urls ?? scraped.pages ?? [];
sourceCount = Array.isArray(routes) ? routes.length : 0;
if (sourceCount > FLOOR) {
if (builtCount < sourceCount) {
failures.push(
`source has ${sourceCount} routes, rebuild has only ${builtCount} HTML pages — 1:N mapping violated (lost ${sourceCount - builtCount} routes)`,
);
} else if (builtCount > 1000) {
warnings.push(`built ${builtCount} pages — exceeds 1000 sanity ceiling, possible runaway crawl`);
}
}
} else {
warnings.push(`_scraped_content.json absent — cannot verify 1:N source-mapping`);
}
// Sitemap.xml lastmod check
const sitemap = join(DIST, 'sitemap.xml');
if (existsSync(sitemap)) {
const xml = readFileSync(sitemap, 'utf8');
const urls = xml.match(/<url>[\s\S]*?<\/url>/g) ?? [];
let missingLastmod = 0;
for (const u of urls) {
if (!u.includes('<lastmod>')) missingLastmod++;
}
if (missingLastmod) {
failures.push(`sitemap.xml: ${missingLastmod}/${urls.length} <url> entries missing <lastmod>`);
}
if (urls.length < builtCount) {
warnings.push(`sitemap.xml lists ${urls.length} URLs but ${builtCount} HTML pages exist — sitemap incomplete`);
}
}
// Required floor pages (Home + About + Services + Contact) — by URL or filename presence
const FLOOR_PAGES = [
{ name: 'home', match: /^index\.html$|^\/$/ },
{ name: 'about', match: /about/i },
{ name: 'services|programs|menu|portfolio', match: /services|programs|menu|portfolio|work|products/i },
{ name: 'contact', match: /contact|donate|book|reach|appointment/i },
];
const builtPaths = builtHtml.map((f) => relative(DIST, f).toLowerCase());
for (const fp of FLOOR_PAGES) {
const found = builtPaths.some((p) => fp.match.test(p));
if (!found) {
warnings.push(`floor page "${fp.name}" not found among ${builtCount} built pages`);
}
}
if (warnings.length) {
console.warn(`\n[validate-page-count] ${warnings.length} warnings:`);
warnings.forEach((w) => console.warn(` ⚠ ${w}`));
}
if (failures.length) {
console.error(`\n[validate-page-count] ${failures.length} failures:`);
failures.forEach((f) => console.error(` ✗ ${f}`));
console.error('\n[validate-page-count] BUILD GATE FAILED');
process.exit(1);
}
console.log(`[validate-page-count] ✓ ${builtCount} pages (floor=${FLOOR}, source=${sourceCount || 'unknown'}).`);
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |