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-html-entities.mjs
View on GitHub#!/usr/bin/env node
// validate-html-entities.mjs — banned HTML entity gate (rules/copy-writing.md typography rule)
// JSX entity decoding only fires for JSX text children, NOT for JS string literals piped
// through {variable} or stored in data arrays — those render the literal `'` to the user.
// This validator greps both source (.tsx/.jsx/.ts) AND build output (.html) and fails on any
// match. Use raw Unicode: ' " " … – — · (U+00A0) instead.
// Usage: node validate-html-entities.mjs <build-dir>
// build-dir: project root (scans src/ + dist/) or dist (scans dist only)
// Exit 0 = pass, exit 1 = fail.
import { readdirSync, readFileSync, statSync, existsSync } from 'node:fs';
import { join, relative, resolve } from 'node:path';
const ROOT = resolve(process.argv[2] || '.');
if (!existsSync(ROOT)) {
console.error(`[validate-html-entities] dir not found: ${ROOT}`);
process.exit(1);
}
const SCAN_DIRS = ['src', 'dist', 'public'].filter((d) => existsSync(join(ROOT, d)));
const SOURCE_EXTS = ['.tsx', '.jsx', '.ts', '.js', '.mjs'];
const HTML_EXTS = ['.html'];
const SKIP_DIRS = new Set(['node_modules', '.git', '.cache', '.vite', '.turbo']);
const BANNED_ENTITIES = [
''', '·', '&', '“', '”', '…',
'–', '—', ' ', '"', '‘', '’',
''', '"', ' ', '’', '“', '”', '…',
];
function walk(dir, exts) {
const out = [];
for (const entry of readdirSync(dir)) {
if (SKIP_DIRS.has(entry)) continue;
const p = join(dir, entry);
const st = statSync(p);
if (st.isDirectory()) out.push(...walk(p, exts));
else if (exts.some((e) => entry.toLowerCase().endsWith(e))) out.push(p);
}
return out;
}
const failures = [];
let scanned = 0;
for (const sub of SCAN_DIRS) {
const dir = join(ROOT, sub);
const exts = sub === 'src' ? SOURCE_EXTS : sub === 'public' ? HTML_EXTS : [...HTML_EXTS, ...SOURCE_EXTS];
const files = walk(dir, exts);
for (const file of files) {
scanned++;
const content = readFileSync(file, 'utf8');
const lines = content.split('\n');
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
// Skip CSS @import statements (rare false positives) and JSDoc comments
if (line.trim().startsWith('//') || line.trim().startsWith('*')) continue;
for (const ent of BANNED_ENTITIES) {
const idx = line.indexOf(ent);
if (idx === -1) continue;
// For .tsx/.jsx files, allow entities ONLY in JSX text content.
// Heuristic: if entity appears inside a JS string literal (quotes or backticks)
// or inside a {} expression interpolation, that's the bug we want to flag.
// For .html files, all entities are flagged.
failures.push(`${relative(ROOT, file)}:${i + 1}: banned entity "${ent}" — use raw Unicode`);
break; // one report per line
}
}
}
}
if (failures.length) {
console.error(`\n[validate-html-entities] ${failures.length} occurrences across ${scanned} files:`);
failures.slice(0, 50).forEach((f) => console.error(` ✗ ${f}`));
if (failures.length > 50) console.error(` ... +${failures.length - 50} more`);
console.error('\n[validate-html-entities] BUILD GATE FAILED — replace with raw Unicode (U+2019 ‘ U+201C " U+2026 …)');
process.exit(1);
}
console.log(`[validate-html-entities] ✓ ${scanned} files scanned, no banned entities found.`);
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 |