Files
computer-playbook/cli/build/README.md
T
kevinveenbirkenbachandClaude Opus 4.8 90b3845998 feat(readme): role README generator with Cosmos diagrams, Quick Setup, and lint
Add cli/build/readme: derives each role README's managed sections from
templates/roles/README.md.j2.tmpl (the Cosmos mermaid diagram from
meta/services.yml, an invokable-gated Quick Setup, and Credits).

The Cosmos diagram shows dependencies, every declared service, and
dependents (roles that consume this one, matched by role name and by
provides provision-name in both directions). Role nodes carry deploy-mode
emoji markers (compose/swarm/host); disabled and shared services get a
stop mark; dependents are capped at 12.

test_readme enforces the Quick Setup body is byte-exact with the template
render. `make readme-generate` and `make cosmos` regenerate; `make cosmos`
also runs inside `make quality`.

Refactor: utils/symbol_glossary.py is the single source of truth for the
word/emoji mapping (unique project-wide), consumed by the complexity
matrix and the Cosmos builder. utils/roles/deploy.py holds role_has_stack
and role_deploy_modes, shared by both so the logic never drifts.

Add `make lint-mermaid` and its CI workflow, rendering every diagram via
mermaid-cli; the render step provisions chrome-headless-shell and unzip
on demand so it works in the minimal container.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 14:44:33 +02:00

931 B

Build 🏗️

Build-time generators that materialise role include lists, dependency graphs, and tree visualisations from the role metadata in roles/.

readme

python -m cli.build.readme [roles...] [--override] [--update-cosmos] [--check] generates or completes role README.md files from templates/roles/README.md.j2 (the section schema single source of truth). It derives the ## Cosmos mermaid diagram from meta/services.yml, the ## Quick Setup commands from the role id, and the ## Credits block from meta/main.yml. Prose sections are never rewritten.

  • default: add only the managed sections that are missing.
  • --override: regenerate every managed section in place.
  • --update-cosmos: regenerate only the Cosmos diagram.
  • --check: write nothing; exit non-zero if any README would change.

Make wrappers: make readme-generate [role=<id>] [override=true] [cosmos=true] and make readme-check.