Skip to content

Doc-Bootstrap

Look up the tier rubric, the script/CLI surface, and the JSON contracts of the doc-bootstrap subsystem. For the steps see the how-to; for the design see the explanation.

The subsystem lives under scripts/doc-bootstrap/. Every script is zero-dependency Node, read-only unless it is the write path, and exposes both a module API and a --json CLI.

/doc-bootstrap [--path <project>] [--tier 0|1|2] [--apply]
Flag Meaning
--path Target project root (default: cwd). May be an external, non-BoB project.
--tier Force a tier, bypassing triage. Omit to let triage propose one.
--apply Write accepted drafts. Omit for a dry-run (stage + report; the tree is untouched).

Engine: scripts/doc-bootstrap/bootstrap.js. Surface: commands/doc-bootstrap.md.

Defined declaratively in scripts/doc-bootstrap/rubric.json, validated against schemas/doc-coverage-rubric.schema.json in make check. Tiers are cumulative via extends.

Tier Name Artifacts (cumulative)
0 Minimal README.md
1 Standard + CLAUDE.md, docs/reference/, docs/how-to/, runbooks/<project>.md
2 Full + docs/tutorials/, docs/explanation/, docs-site.json

Each artifact declares a kind (file / directory), whether it is required, a Diátaxis doc_type (or null), an optional min_docs for directories, and a completeness checklist.

Script Purpose Key CLI
rubric.js Load the rubric; evaluate a tree’s coverage against a tier (the rubric-aware gap reporter audit/sync/bootstrap share). rubric.js coverage --tier N --path P
inventory.js Read-only probe: stack, project type, surfaces, audience, existing docs. Never executes project code. inventory.js --path P
triage.js Map inventory signals → proposed tier + confidence; applyOverride() respects an operator tier. triage.js --path P [--tier N]
generate.js Author artifacts toward the tier; attach source_evidence; verifyAll() rejects ungrounded claims. generate.js --path P --tier N [--verify]
reconcile.js Classify existing docs via doc-keeper/audit.js; augment-not-clobber plan; surface code-vs-doc conflicts. reconcile.js --path P --tier N
draft.js Stage drafts outside the tree; review summary; gated write (applyDecisions). draft.js --path P --tier N [--apply]
bootstrap.js The orchestrator: inventory → triage → loop[audit → generate → write → audit] until audit-clean. bootstrap.js --path P [--tier N] [--apply]
fixpoint.js Structural-idempotency guard: would a same-tier run change anything? fixpoint.js --path P --tier N
external.js External-project policy: ban .claude/ writes; CLAUDE.md opt-in. external.js --path P
docsite.js Tier 2 handoff to /docs-site init + dev; never deploys. docsite.js --path P --tier 2 [--apply]
stack-hooks/<stack>.js Pluggable per-stack discovery (first: drupal.js). Loaded by name from the inventory. (via inventory.js)

Inventory (inventory.js) — consumed by triage:

{ version, project, name, is_bob_project, stack[], project_type,
surfaces: { entry_points[], commands[], routes[], public_api[], env_vars[] },
audience: { signals[], role_count, multi_audience },
existing_docs: { readme, claude_md, docs_dir, runbooks, docs_site, doc_count },
stack_specific?: { drupal: { content_types[], views[], modules[], hooks[], ... } } }

Triage (triage.js):

{ proposed_tier, confidence, interactive_recommended, scores, reasons[],
selected_tier?, overridden? }

Coverage (rubric.js coverage):

{ tier, complete, present_count, total, gap_count,
artifacts: [{ id, path, present, required, detail }], gaps[] }

source_evidence (per generated artifact, generate.js):

{ id, path, doc_type, content, source_evidence: [{ claim, file, line }] }

Reconcile plan actions (reconcile.js): create · augment · skip-aligned · replace-archive. Aligned docs are never written.

Bootstrap report (bootstrap.js): { tier, is_external, converged, coverage_complete, policy_excluded[], pre_coverage, post_coverage, iterations[], conflicts[], docsite_handoff }.

One suite per concern, all wired into make test:

test-doc-bootstrap-rubric test-doc-bootstrap-reconcile test-doc-bootstrap-external
test-doc-bootstrap-inventory test-doc-bootstrap-draft test-doc-bootstrap-docsite
test-doc-bootstrap-triage test-doc-bootstrap-orchestration test-doc-bootstrap-drupal-hook
test-doc-bootstrap-generate test-doc-bootstrap-fixpoint