Skip to content

heymegabyte/agent-skills / 15-site-generation

site-generation

Unverified

End-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.

FileKindSize
SKILL.mdskill md11.7 KB
_real-ua.mjsscript1.4 KB
blog-import.mjsscript10.5 KB
bolt-artifact-protocol.mdmarkdown8.4 KB
build-breaking-rules.mdmarkdown86.0 KB
build-image-redirects.mjsscript3.4 KB
build-prompts.mdmarkdown86.3 KB
check-routes.shexecutablescript904 B
domain-features.mdmarkdown17.1 KB
enhance-blog-posts.mjsscript12.9 KB
homepage-block-library.mdmarkdown12.6 KB
local-seo.mdmarkdown7.6 KB
media-acquisition.mdmarkdown39.2 KB
non-technical-owner-onboarding.mdmarkdown8.3 KB
page-set-expansion.mdmarkdown19.1 KB
pseo-templates.mdmarkdown13.3 KB
quality-gates.mdmarkdown46.6 KB
research-pipeline.mdmarkdown20.5 KB
scan-assets.mjsscript3.0 KB
small-business-mode.mdmarkdown9.6 KB
source-fidelity-loop.mdmarkdown10.0 KB
squarespace-full-crawl.mjsscript2.8 KB
template-improvements-100.mdmarkdown15.0 KB
template-system.mdmarkdown39.7 KB
validate-assets.mjsscript5.0 KB
validate-banned-slop.mjsscript4.6 KB
validate-brand-colors.mjsexecutablescript6.1 KB
validate-citations.mjsscript6.0 KB
validate-color-contrast.mjsscript5.2 KB
validate-favicon-set.mjsscript4.9 KB
validate-html-entities.mjsscript3.4 KB
validate-image-relevance.mjsscript6.1 KB
validate-internal-links.mjsscript4.3 KB
validate-jsonld-schema.mjsscript5.1 KB
validate-nap-consistency.mjsexecutablescript8.0 KB
validate-page-count.mjsscript4.1 KB
validate-page-set-completeness.mjsscript9.3 KB
validate-photo-authenticity.mjsexecutablescript10.0 KB
validate-pwa-kit.mjsscript7.0 KB
validate-route-metadata.mjsscript7.3 KB
validate-source-fidelity.mjsscript6.0 KB
validate-typography.mjsscript4.0 KB
verticals/local-business-site.mdmarkdown3.8 KB
verticals/nonprofit-site.mdmarkdown3.3 KB
verticals/restaurant-site.mdmarkdown2.6 KB

validate-page-set-completeness.mjs

View on GitHub
#!/usr/bin/env node
/**
 * validate-page-set-completeness.mjs — union(source, standard, jewels, locales) − cruft gate
 *
 * Purpose: enforce rules/source-site-enhancement.md HARD_GATE_PAGE_COUNT — every rebuild
 * deploys `keep + STANDARD_SET[org_type] + JEWELS[org_type] + locale_count × (keep+standard+jewels)`
 * routes minimum. Floors per 15/page-set-expansion.md: nonprofit 14+10, saas 10+8, local 12+8,
 * portfolio 5+6, church 10+6, gov 12+5, edu 12+6, healthcare 12+6, legal 10+6. English stays
 * unprefixed at `/`; non-English locales mirror at `/{locale}/*`.
 *
 * When: runs post-deploy in `strict` mode after every rebuild/optimize/enhance prompt. Pairs
 * with validate-locale-mirror.mjs (hreflang) + validate-jewel-content-authority.mjs (jewel
 * body authority) + validate-cruft-301.mjs (301-coverage for dead/dupe URLs).
 *
 * Reads (from build dir, default `./`):
 *   _url_inventory.json — Agent-A crawler output: [{url, classification: keep|merge|301|drop}]
 *   _research.json      — Agent-A/E research output: {category, source_url, ...}
 *   _locales.json       — Agent-B demographics output: {locales: ["en","es","pt"], hreflang_pairs}
 *   _org_type.json      — Agent-C infer output: {org_type: "nonprofit"|...}
 *
 * Writes: _route_inventory_gap.json — {expected_routes[], deployed_routes[], missing[],
 *   cruft_still_serving[], pass_fail, summary{expected_count, deployed_count, missing_count,
 *   cruft_count, floor, org_type, locale_count}}
 *
 * Discovery of deployed routes:
 *   1. --deployed-url <url> → fetch `<url>/sitemap.xml` with REAL_UA per rules/fetch-defaults.md
 *   2. else → walk `dist/index.html` + linked HTML for `<a href>` graph + `dist/sitemap.xml`
 *
 * Exit codes: 0 = pass, 1 = fail (missing routes OR cruft serving 200), 2 = config error.
 *
 * Usage:
 *   node validate-page-set-completeness.mjs [--dir ./] [--deployed-url https://x.workers.dev]
 */

import { readFileSync, existsSync, writeFileSync, readdirSync, statSync } from 'node:fs';
import { join, resolve } from 'node:path';
import { REAL_UA_DESKTOP, REAL_HEADERS } from './_real-ua.mjs';

const REAL_UA = REAL_UA_DESKTOP;
const FETCH_HEADERS = REAL_HEADERS;

const ORG_FLOORS = {
  nonprofit: { standard: 14, jewels: 10 },
  saas: { standard: 10, jewels: 8 },
  local: { standard: 12, jewels: 8 },
  portfolio: { standard: 5, jewels: 6 },
  church: { standard: 10, jewels: 6 },
  gov: { standard: 12, jewels: 5 },
  edu: { standard: 12, jewels: 6 },
  healthcare: { standard: 12, jewels: 6 },
  legal: { standard: 10, jewels: 6 },
};

const CRUFT_RE = /\/home$|\/testpage$|\/new-page-\d+$|\/-1$|\/-2$|\/page-\d+$|\/blog-\d+$|.+-(copy|backup|old|draft|test|tmp)(-\d+)?$|\/[a-f0-9]{20,}$|\/blog\/\d{4}\/\d{1,2}\/\d{1,2}\/[a-f0-9]{20,}$/;

const args = process.argv.slice(2);
const flag = (name) => { const i = args.indexOf(name); return i >= 0 ? args[i + 1] : null; };
const BUILD = resolve(flag('--dir') || '.');
const DEPLOYED_URL = flag('--deployed-url')?.replace(/\/$/, '') || null;

function readJson(path, fallback) {
  if (!existsSync(path)) return fallback;
  try { return JSON.parse(readFileSync(path, 'utf8')); }
  catch (err) { console.error(`[validate-page-set-completeness] unparsable ${path}: ${err.message}`); process.exit(2); }
}

const urlInventory = readJson(join(BUILD, '_url_inventory.json'), null);
const research = readJson(join(BUILD, '_research.json'), {});
const locales = readJson(join(BUILD, '_locales.json'), { locales: ['en'] });
const orgTypeData = readJson(join(BUILD, '_org_type.json'), { org_type: research.category || 'local' });

if (!urlInventory) { console.error('[validate-page-set-completeness] _url_inventory.json missing — Agent-A crawler must run first'); process.exit(2); }

const orgType = (orgTypeData.org_type || 'local').toLowerCase();
const floor = ORG_FLOORS[orgType] || ORG_FLOORS.local;
const localeList = Array.isArray(locales.locales) && locales.locales.length ? locales.locales : ['en'];

const keepUrls = urlInventory.filter((r) => r.classification === 'keep').map((r) => r.url.replace(/^https?:\/\/[^/]+/, '') || '/');
const keepCount = keepUrls.length;
const perLocale = keepCount + floor.standard + floor.jewels;
const localeCount = localeList.length;
const expectedTotal = perLocale + (localeCount - 1) * perLocale;

const expectedRoutes = new Set();
const englishRoutes = new Set(keepUrls);
for (let i = 0; i < floor.standard; i++) englishRoutes.add(`__standard_${i}__`);
for (let i = 0; i < floor.jewels; i++) englishRoutes.add(`__jewel_${i}__`);
for (const r of englishRoutes) expectedRoutes.add(r);
for (const loc of localeList) {
  if (loc === 'en') continue;
  for (const r of englishRoutes) expectedRoutes.add(r.startsWith('__') ? `${loc}:${r}` : `/${loc}${r === '/' ? '' : r}`);
}

async function fetchDeployedRoutes(baseUrl) {
  const out = new Set();
  try {
    const sm = await fetch(`${baseUrl}/sitemap.xml`, { headers: FETCH_HEADERS });
    if (sm.ok) {
      const xml = await sm.text();
      for (const m of xml.matchAll(/<loc>([^<]+)<\/loc>/g)) {
        const u = m[1].replace(baseUrl, '').replace(/^https?:\/\/[^/]+/, '') || '/';
        out.add(u);
      }
    }
  } catch (err) { console.warn(`[validate-page-set-completeness] sitemap fetch failed: ${err.message}`); }
  return out;
}

function walkDistHtml(dir) {
  const out = new Set();
  if (!existsSync(dir)) return out;
  function recur(d, prefix) {
    for (const e of readdirSync(d)) {
      if (e === 'node_modules' || e.startsWith('.')) continue;
      const p = join(d, e);
      const st = statSync(p);
      if (st.isDirectory()) recur(p, `${prefix}/${e}`);
      else if (e === 'index.html') out.add(prefix || '/');
      else if (e.endsWith('.html')) out.add(`${prefix}/${e.replace(/\.html$/, '')}`);
    }
  }
  recur(dir, '');
  const smPath = join(dir, 'sitemap.xml');
  if (existsSync(smPath)) {
    const xml = readFileSync(smPath, 'utf8');
    for (const m of xml.matchAll(/<loc>([^<]+)<\/loc>/g)) {
      const u = m[1].replace(/^https?:\/\/[^/]+/, '') || '/';
      out.add(u);
    }
  }
  return out;
}

const deployedRoutes = DEPLOYED_URL ? await fetchDeployedRoutes(DEPLOYED_URL) : walkDistHtml(join(BUILD, 'dist'));

const missing = [];
for (const u of keepUrls) if (!deployedRoutes.has(u)) missing.push(u);
const deployedCount = deployedRoutes.size;
const standardGap = Math.max(0, floor.standard - Math.max(0, deployedCount - keepCount));
const jewelGap = Math.max(0, floor.jewels - Math.max(0, deployedCount - keepCount - floor.standard));
if (standardGap > 0) missing.push(`__${standardGap}_standard_pages_missing_for_${orgType}__`);
if (jewelGap > 0) missing.push(`__${jewelGap}_jewel_pages_missing_for_${orgType}__`);

const perLocaleDeployed = {};
for (const loc of localeList) {
  if (loc === 'en') continue;
  const prefix = `/${loc}`;
  const mirrorRoutes = [...deployedRoutes].filter((r) => r === prefix || r.startsWith(`${prefix}/`));
  perLocaleDeployed[loc] = mirrorRoutes.length;
  if (mirrorRoutes.length < perLocale) missing.push(`__locale_${loc}_mirror_incomplete_${mirrorRoutes.length}_of_${perLocale}__`);
}

const cruftStillServing = [];
const cruftUrls = urlInventory.filter((r) => CRUFT_RE.test(r.url) || r.classification === '301').map((r) => r.url.replace(/^https?:\/\/[^/]+/, '') || '/');
if (DEPLOYED_URL) {
  for (const c of cruftUrls) {
    try {
      const res = await fetch(`${DEPLOYED_URL}${c}`, { headers: FETCH_HEADERS, redirect: 'manual' });
      if (res.status === 200) cruftStillServing.push(c);
    } catch { /* network failure = treat as not-serving */ }
  }
} else {
  for (const c of cruftUrls) if (deployedRoutes.has(c)) cruftStillServing.push(c);
}

const pass = missing.length === 0 && cruftStillServing.length === 0 && deployedCount >= expectedTotal;
const gap = {
  expected_routes: [...expectedRoutes],
  deployed_routes: [...deployedRoutes],
  missing,
  cruft_still_serving: cruftStillServing,
  pass_fail: pass ? 'pass' : 'fail',
  summary: { expected_count: expectedTotal, deployed_count: deployedCount, missing_count: missing.length, cruft_count: cruftStillServing.length, floor, org_type: orgType, locale_count: localeCount, locales: localeList, per_locale_deployed: perLocaleDeployed, keep_count: keepCount },
};
writeFileSync(join(BUILD, '_route_inventory_gap.json'), JSON.stringify(gap, null, 2));

if (!pass) {
  console.error(`\n[validate-page-set-completeness] BUILD GATE FAILED — ${orgType} site needs ≥${expectedTotal} routes (keep ${keepCount} + standard ${floor.standard} + jewels ${floor.jewels} × ${localeCount} locales), deployed ${deployedCount}.`);
  if (missing.length) { console.error(`  ✗ ${missing.length} missing routes:`); missing.slice(0, 20).forEach((m) => console.error(`    - ${m}`)); if (missing.length > 20) console.error(`    ...+${missing.length - 20} more (see _route_inventory_gap.json)`); }
  if (cruftStillServing.length) { console.error(`  ✗ ${cruftStillServing.length} cruft URLs still serving 200 (must 301):`); cruftStillServing.slice(0, 10).forEach((c) => console.error(`    - ${c}`)); }
  console.error('\n  → see rules/source-site-enhancement.md HARD_GATE_PAGE_COUNT + 15/page-set-expansion.md');
  process.exit(1);
}
console.log(`[validate-page-set-completeness] ✓ ${orgType} | keep=${keepCount} | std=${floor.standard} | jewels=${floor.jewels} | locales=${localeCount} (${localeList.join('|')}) | expected=${expectedTotal} | deployed=${deployedCount}.`);
process.exit(0);
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 322kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 119kUpdated Claude CodeCodexVerifiedInstall
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: 118kUpdated Claude CodeCodexVerifiedInstall