Skip to content

Doc-Bootstrap Reference

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.

Command

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

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

Tiers (the rubric)

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

TierNameArtifacts (cumulative)
0MinimalREADME.md
1Standard+ CLAUDE.md, docs/reference/, docs/how-to/, runbooks/<project>.md
2Full+ 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.

Scripts

ScriptPurposeKey CLI
rubric.jsLoad 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.jsRead-only probe: stack, project type, surfaces, audience, existing docs. Never executes project code.inventory.js --path P
triage.jsMap inventory signals → proposed tier + confidence; applyOverride() respects an operator tier.triage.js --path P [--tier N]
generate.jsAuthor artifacts toward the tier; attach source_evidence; verifyAll() rejects ungrounded claims.generate.js --path P --tier N [--verify]
reconcile.jsClassify existing docs via doc-keeper/audit.js; augment-not-clobber plan; surface code-vs-doc conflicts.reconcile.js --path P --tier N
draft.jsStage drafts outside the tree; review summary; gated write (applyDecisions).draft.js --path P --tier N [--apply]
bootstrap.jsThe orchestrator: inventory → triage → loop[audit → generate → write → audit] until audit-clean.bootstrap.js --path P [--tier N] [--apply]
fixpoint.jsStructural-idempotency guard: would a same-tier run change anything?fixpoint.js --path P --tier N
external.jsExternal-project policy: ban .claude/ writes; CLAUDE.md opt-in.external.js --path P
docsite.jsTier 2 handoff to /docs-site init + dev; never deploys.docsite.js --path P --tier 2 [--apply]
stack-hooks/<stack>.jsPluggable per-stack discovery (first: drupal.js). Loaded by name from the inventory.(via inventory.js)

Key JSON contracts

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 }.

Tests

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