agent-docsbuildvercelwikiuiUpdated 2026-07-06

Bundle Wiki Prebuild

Portable build quickref for copying the parent wiki/ tree into ui/.content/wiki so the Vercel reader can load markdown at runtime.

Open this page when the wiki UI build cannot find markdown, when Vercel deploys from ui/, or when content appears stale in the deployed reader. Architecture context: Kevin Wiki UI Architecture.

Why It Exists

When Vercel's root directory is ui, ../wiki is not present in the serverless deployment filesystem. The prebuild step embeds the wiki tree into .content/wiki so runtime loaders can read the content without reaching outside the deployment bundle.

The same rule applies to instruction/docs files that routes expose as agent docs. ui/scripts/bundle-wiki.mjs starts from root *.md files plus ui/AGENTS.md, follows referenced docs such as scripts/SKILL.md, copies the discovered files into ui/.content, and writes agent-doc-sources.json so deployed routes never reach back to /vercel/path0/*.md at runtime or during tracing.

Contract

Environment Wiki source
Local dev Live ../wiki unless WIKI_DIR overrides.
Production / Vercel Bundled ui/.content/wiki copied during prebuild.
Override WIKI_DIR points the reader at an alternate wiki root.

Checklist

  1. Confirm ui/package.json runs node scripts/bundle-wiki.mjs as prebuild.
  2. Confirm Vercel project root is ui.
  3. Confirm next.config.ts traces .content/**/*.
  4. Confirm root *.md files and referenced instruction docs are allowlisted in root .vercelignore.
  5. Rebuild after wiki changes before deploying reader content.
  6. Pair with Password Gate Setup and Public Categories Env for visibility/privacy.

Timeline