Repository navigation
Conversation
Adds `packages/ghost-site`, a zero-dependency Node ESM companion CLI and editorial starter theme that compiles any `.ghost/` package into a live brand guideline site. - Three-layer sync contract: compiler-owned `generated/`, human and AI owned `theme/` and `site.config.yml` - Supports both `ghost.package/v1` paired cascades (with `--universal`) and legacy `cover` packages - Adaptive full-viewport split-grid Home overview, full-bleed color tiles with WCAG badges, package-faithful typography specimens and declared scale/weight tables, first-class SVG and variable-font iconography, and hover-revealed source code links - Includes AI customization skill (`skill/SKILL.md`) and Vitest coverage against `apps/docs/.ghost` and synthetic fixtures Co-authored-by: Neon <8d522b99e1737395ba95850a2c30342584d20f3f4d54af3bfdd9e519feda86ac@buzz.block.builderlab.xyz>
| if (seenLogoRel.has(f.relPath) || seenIconRel.has(f.relPath)) continue; | ||
|
|
||
| if (HTML_EXTS.has(f.ext)) { | ||
| const copied = ensureCopied(f.absPath, f.relPath); |
There was a problem hiding this comment.
🤖 Chai read and approved this comment before it was posted.
[P2] The documented static-host setup publishes these raw HTML files on the guideline site’s origin. The iframe sandbox applies only to the embedded preview. Can we sanitize examples before copying them or serve them from an isolated origin?
Updated by Pushback 🤖
| const copiedMap = new Map(); // package relPath -> assetPath (`assets/...`) | ||
|
|
||
| function ensureCopied(absPath, relPath) { | ||
| if (!isInsideDir(absPath, packageDir) || !fs.existsSync(absPath)) |
There was a problem hiding this comment.
🤖 Chai read and approved this comment before it was posted.
[P2] This checks the path before resolving symlinks. Can we check the resolved path against the allowed source root before reading or copying the asset? The documented CI job commits the generated files to the repository.
Updated by Pushback 🤖
| sourceBaseUrl = null, | ||
| ) { | ||
| const nodes = []; | ||
| const entries = fs.readdirSync(packageDir, { withFileTypes: true }); |
There was a problem hiding this comment.
🤖 Chai read and approved this comment before it was posted.
[P2] This scans only top-level Markdown, and the separate parser handles YAML and fenced headings differently from ghost. Can we reuse ghost’s readers and paired-package validation? Please add a fixture with nested guidance, list-valued frontmatter, a fenced heading, and a prerequisite in the standards package. Assert that the prerequisite resolves to an actual page anchor.
Updated by Pushback 🤖
| let controls = {}; | ||
|
|
||
| // Step 1: CSS token files | ||
| const cssFiles = discoverMaterialFiles(packageDir, /\.css$/i).filter((f) => |
There was a problem hiding this comment.
🤖 Chai read and approved this comment before it was posted.
[P2] The docs package declares repo-relative stylesheets, but this scans only package materials. Can we resolve declared stylesheets within the allowed repository root and assert that the docs smoke test renders the palette and monospace specimen?
Updated by Pushback 🤖
| cssFontFaces.push(...parsed.fontFaces); | ||
| rawCssVars.push(...parsed.rawVars); | ||
| if (parsed.swatches.length > 0) { | ||
| rawDirections.push({ |
There was a problem hiding this comment.
🤖 Chai read and approved this comment before it was posted.
[P2] Every CSS file with swatches adds a direction with the ID default. A later file can replace the earlier colors. Can we merge the swatches into one default direction with explicit precedence for duplicate tokens?
Updated by Pushback 🤖
|
|
||
| // Clean & recreate generated/ (NEVER touches theme/ or site.config.yml) | ||
| const generatedDir = path.join(resolvedOut, "generated"); | ||
| cleanGeneratedDir(generatedDir); |
There was a problem hiding this comment.
🤖 Chai read and approved this comment before it was posted.
[P2] This deletes generated/ before token and asset reads finish. An asset read failure leaves the existing site without its generated files. Can we stage the new output and replace the old directory only after the build succeeds? Please test that a failed sync leaves the previous output intact.
Updated by Pushback 🤖
|
|
||
| const brandData = { | ||
| schema: "ghost-site.brand-data/v1", | ||
| generatedAt: new Date().toISOString(), |
There was a problem hiding this comment.
🤖 Chai read and approved this comment before it was posted.
[P2] generatedAt changes on every run, so the documented CI job commits a diff even when the rendered content is identical. Can we remove this field and assert byte-identical output across two syncs with the same inputs?
Updated by Pushback 🤖
| ); | ||
| writeRootRedirect(resolvedOut); | ||
|
|
||
| const compiled = compilePackage({ |
There was a problem hiding this comment.
🤖 Chai read and approved this comment before it was posted.
[P2] Running init on an existing output with a different --package compiles the new package but keeps the old source in site.config.yml. The next sync switches back. Can we reject the mismatch before writing and point to the saved setting?
Updated by Pushback 🤖
Summary
Adds
packages/ghost-site, a private, zero-dependency Node ESM companion CLI and editorial starter theme that compiles any.ghost/package into a live brand guideline site.Architecture
Three-layer sync separation so teams and agents can redesign a guideline site freely without losing automated updates when
.ghost/changes:generated/(compiler-owned):brand-data.json,brand-tokens.css, and copiedassets/. Rebuilt deterministically on everyghost-site sync.theme/(human and AI owned): static HTML/CSS/JS editorial starter theme. Scaffolded once onghost-site init, never overwritten bysync.site.config.yml(human and AI owned): source package path, optional universal standards path,source_urloverride, and section intros.Highlights
init,sync, andserveinpackages/ghost-site/ghost-site.mjswith zero external runtime dependencies.ghost.package/v1paired cascades (with--universal) and legacycoverpackages, while never publishing.ghost/checks/.</>links beside headlines pointing to the underlying.ghost/markdown files (with raw markdown modal fallback).packages/ghost-site/skill/SKILL.mdfor customizingtheme/while preserving thegenerated/sync contract.Verification
pnpm run buildandpnpm run check(biome check .,tsc --build,check:package-bin,check:packed-package,check:file-sizes,check:terminology,check:release-tarball,check:release-workflows)pnpm run check:ghost-packagespnpm --filter @design-intelligence/ghost-site test(6/6 Vitest tests passing, including compilingapps/docs/.ghost)pnpm install --lockfile-only --frozen-lockfile --ignore-scriptsNo changeset is included because
packages/ghost-siteis a private workspace package and@design-intelligence/ghostis unchanged.