ADR-006: Documentation Generation Strategy

Status

Accepted

Date

2026-07-11

Context

We need to generate CLI reference documentation in multiple formats:

  1. Markdown files for GitHub Pages (docs/usage/)
  2. Troff man pages for man stamp (docs/man/)
  3. The documentation must stay in sync with the command tree (never drift)
  4. Binary users must be able to install man pages without building from source

Decision

Dual Approach: Build-Time Tool + Self-Contained Command

1. Build-Time Doc Generation (tools/docgen/ + task docs)

A standalone Go program in tools/docgen/ imports github.com/spf13/cobra/doc and generates:

Invoked via task docs and enforced in CI:

- name: Verify docs are up to date
  run: |
    go run ./tools/docgen/
    git diff --exit-code docs/usage/ || (echo "error: docs out of date" && exit 1)

2. Self-Contained Man Page Installation (stamp man)

The stamp binary itself can generate and install man pages via stamp man install:

Rationale for Two Approaches

Drift Prevention

Alternatives Considered

Single Tool Only (Only tools/docgen)

Single Binary Only (Only stamp man)

Consequences