Generated from cat-harness/skills/ui/ui-core/docs-generation.md — do not edit here.

✎ Edit this page’s source

Documentation Generation Skill

Role

Coordinate all documentation generation pipelines. This covers the full set of rendered artifacts published to the docs site, from the content-object schemas through to per-paper PDF/HTML viewers.

Documentation artifacts

ArtifactGeneratorOutput path (docs site)Trigger
Paper PDFpipeline/build.ts + PDF enginepapers/<dir>/<dir>.pdfpublish workflow
Paper HTMLgenerate-html.py (Pandoc + enhance)papers/<dir>/paper.htmlpublish workflow
Paper MarkdownPandoc (gfm)papers/<dir>/<dir>.mdpublish workflow
Paper viewergenerate-index.pypapers/<dir>/index.htmlpublish workflow
Folio landinggenerate-folio-index.pyindex.htmlpublish workflow
Schema docsTypeDoc (npm run build:docs)schema-docs/publish workflow
Schema manifestcat-harness-tools/scripts/generate-schema-manifest.ts/api/schema-manifestMCP server
Formal API docsdoc generatordocs/formal-layer workflow
Dependency graphgenerate_dependency_graph.pydependency-graph.svgpublish / formal workflow
Proof/object reportextract_proof_objects.pyproof-objects.jsonall workflows

Paper document generation

Pipeline: content objects → PDF

content/<paper>/<paper>.ts          paper manifest (metadata, sections)
     ↓
pipeline/build.ts           validates + renders sections → output
     ↓
preamble template + manifest        generate-main.ts → main document
     ↓
PDF engine                          main → PDF
     ↓
pandoc                              → .md → paper-raw.html
     ↓
generate-html.py                    → paper.html (enhanced)
     ↓
generate-index.py                   → per-paper index.html (viewer)

Running locally

# Build sections + generate the main document from the manifest
cd content && bun run pipeline/build.ts \
  <paper>/<paper>.ts \
  --out-dir ../sections/ \
  --generate-main \
  --main-out ../main.tex \
  --preamble ../latex/preamble.tex

# Compile PDF (requires the PDF engine). No engine in the sandbox? Run
# scripts/install-tex.sh first, or fall back to the Docker image.
cd .. && <pdf-engine> main.tex

Key files

FilePurpose
latex/preamble.texShared rendering preamble template (paper-agnostic)
pipeline/build.tsContent → output section build
pipeline/generate-main.tsManifest + preamble → main document
pipeline/render.tsBlock-level markdown → output conversion
.github/scripts/generate-html.pyPandoc HTML → enhanced paper.html
.github/scripts/generate-index.pyPer-paper viewer (paper/visualizer toggle)
.github/scripts/generate-folio-index.pyRoot folio landing page

Schema documentation (TypeDoc)

Pretty-printed HTML reference for the content-object type system.

Configuration

FilePurpose
typedoc.jsonTypeDoc config (entry points, output dir, theme)
schemas/types.tsCore types: Block, Section, Paper
schemas/constraints.tsZod runtime validation schemas
schemas/builders.tsConstructor functions (definition(), theorem(), etc.)
schemas/output-types.tsCI/output types (objects, glossary, coverage)
schemas/README.mdTypeDoc landing page content
package.jsonbuild:docs script

Running locally

# Install TypeDoc (if not already)
npm install

# Generate schema docs
npm run build:docs
# Output: build/schema-docs/

Schema manifest (lightweight JSON)

For programmatic access (viewer, MCP server):

bun run cat-harness-tools/scripts/generate-schema-manifest.ts
# Output: build/schema-manifest.json

Formal-layer documentation

When a paper carries a formal layer (e.g. a proof assistant), its API documentation is generated by the formal-layer CI workflow after the formal build succeeds. If the primary doc generator fails, the workflow falls back to a static HTML source browser.

A gap/axiom report lists unproved-gap declarations and dependency transparency; it is produced by the same workflow.

Folio landing page

The root index.html on the docs site is a folio page listing all papers with viewer links. Generated from content/folio.ts.

This is the paper pipeline’s own page. In a checkout that instantiates several harnesses, which instance owns <base>/index.html is site.landing in the root index.config.json — an instance name, or "hub". That is index-config’s rule. For where every other page is published, canonical and alias, see schema-management §”Where a viewer publishes”.

Adding a new paper to the folio

  1. Create content/<paper-dir>/<paper-dir>.ts (paper manifest with title, authors, abstract, macros, sections)
  2. Create section directories with content objects
  3. Add paperRef({ dir: "<paper-dir>", title: "...", ... }) to content/folio.ts
  4. The pipeline discovers it automatically via extract-folio.py

Key scripts

ScriptPurpose
.github/scripts/extract-folio.pyParse folio.ts → JSON paper list
.github/scripts/generate-folio-index.pyGenerate root index.html

Dependency graph

Visual SVG showing dependencies between content blocks.

python3 .github/scripts/generate_dependency_graph.py \
  --manifest proof-objects.json \
  --output dependency-graph.svg

Unified Docker image

All CI/CD workflows use the same paper-assistant Docker image (adapters/mcp-server/Dockerfile), which is also the folio MCP server. This eliminates per-workflow tool installation and ensures consistent build environments. The image bundles the PDF engine, the content pipeline runtime (Bun), pandoc, graph tooling, and CI scripts.

Using locally (Docker fallback)

When the PDF engine isn’t installed locally, the render hooks automatically fall back to the Docker image. The scripts/lib/docker-tex.sh helper automates this fallback for the render hooks.

CI workflows

WorkflowContainerDocs generated
publish.ymlpaper-assistantPaper PDF/HTML/MD, folio index, schema docs, dep graph
formal-layer workflowpaper-assistantFormal API docs, gap report, manifests

When to use this skill

  • “generate docs” / “build docs” / “rebuild documentation”
  • “schema docs” / “type docs” / “TypeDoc”
  • “build paper” / “compile PDF” / “render HTML”
  • “update folio page” / “add paper to landing page”
  • “dependency graph” / “gap report”

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed dev