generators
Generators and Derived Artifacts guide
Generators turn graph queries into derived artifacts. Every page of prose, every TypeScript type, every OpenAPI document, every scaffolded code skeleton in the v6 ecosystem should be produced from graph data rather than hand-maintained copies.
Pages in this section
Start with the section hub, then move sideways into adjacent pages when you need more detail.
Generator Design
PageTypeScript is chosen for two reasons. First, it lets us reuse the schema-derived types for the SDK (Phase 6) directly inside generator code — a generator that emits a TypeScript artifact is itself typed against the schema it reads. Second, the toolchain matches the rest of the babysitter monorepo, so generator outputs integrate with existing CI infrastructure without translation.
wiki/generators/00-generator-design.md
@v6/graph-tools
PageUtility package for loading the v6 catalog graph, querying it from scripts or a CLI, and rendering deterministic generator templates.
wiki/generators/tools/README.md
Generators and Derived Artifacts
Generators turn graph queries into derived artifacts. Every page of prose, every TypeScript type, every OpenAPI document, every scaffolded code skeleton in the v6 ecosystem should be produced from graph data rather than hand-maintained copies.
What lives in this directory
| Path | Purpose |
|---|---|
| `00-generator-design.md` | Implementation plan extending the schema derivation spec. |
templates/ | Deterministic templates consumed by generators. |
| `tools/` | @v6/graph-tools, the utility package and CLI for graph loading, querying, template rendering, and generator manifests. |
Quick start
Push-Location graph/wiki/generators/tools; npm install; Pop-Location
node graph/wiki/generators/tools/src/cli.mjs stats --root graph
node graph/wiki/generators/tools/src/cli.mjs nodes --root graph --kind AgentProduct
node graph/wiki/generators/tools/src/cli.mjs render --root graph --template wiki/generators/templates/examples/layers.md.tmpl --kind Layer --stdout
node graph/wiki/generators/tools/src/cli.mjs generate --root graph --spec wiki/generators/templates/examples/layers.generator.yamlPlanned generator outputs
The 10 illustrative outputs from graph/schema/derivation-spec.md:
1. Glossary 2. Stack documentation 3. Product card 4. Capability matrix 5. Hook taxonomy doc 6. Adapter scaffold 7. OpenAPI artifact 8. Per-package README 9. Stack diagram 10. Coverage check
Plus one added by the process design:
11. Gap markdown ↔ YAML sync, keeping wiki/process/gaps/GAP-*.md aligned with graph/catalog-meta/gaps/*.yaml.
Acceptance criteria
- **Pure**: same graph in → byte-identical output.
- **Deterministic**: stable ordering on every collection.
- **Idempotent**: generator manifests avoid no-op rewrites.
- **Manifested**: generated files get a sibling
.manifest.jsonwith input node ids and a content hash.
See `00-generator-design.md` for the full implementation plan.