|
| 1 | +--- |
| 2 | +adr: "0034" |
| 3 | +status: Proposed |
| 4 | +date: 2026-08-05 |
| 5 | +tags: [clients, mobile, server, sdk] |
| 6 | +--- |
| 7 | + |
| 8 | +# 0034 - Adopt engineering documentation standard |
| 9 | + |
| 10 | +<AdrTable frontMatter={frontMatter}></AdrTable> |
| 11 | + |
| 12 | +## Context and problem statement |
| 13 | + |
| 14 | +Documentation practice has fragmented as the organization has grown: |
| 15 | + |
| 16 | +- Major repos use divergent layouts (`docs/`, `Docs/`, per-crate READMEs, none), inconsistent README |
| 17 | + casing and quality, and no shared definition of what must be documented where. |
| 18 | +- The de facto standards page lives in Confluence and is not enforced; practice diverges from it. |
| 19 | +- Content sits in the wrong home: single-repo architecture on this site, shipped-code architecture |
| 20 | + deep dives in Confluence, production runbooks in personal spaces, and duplicated guidance across |
| 21 | + homes. |
| 22 | +- Stale content accumulates with no supersession discipline, leaving superseded pages beside current |
| 23 | + ones with no deprecation. |
| 24 | +- AI agents have become first-class documentation consumers and maintainers, and their instruction |
| 25 | + files (`CLAUDE.md`, rules, and skills across all repos) accumulate documentation-like content with |
| 26 | + nothing defining whether they are documentation at all. |
| 27 | + |
| 28 | +A 2026-07 audit classified every documentation artifact across the major repos, this site, and |
| 29 | +Confluence against a proposed routing model, confirming these gaps. |
| 30 | + |
| 31 | +## Considered options |
| 32 | + |
| 33 | +- **Status quo:** per-team conventions, advisory Confluence page. |
| 34 | +- **Confluence-first:** centralize engineering docs in the wiki. |
| 35 | +- **Per-repo standards:** each repo defines its own documentation rules and keeps its own ADRs. |
| 36 | +- **One org-wide, docs-as-code documentation standard:** close-to-code default, single routing |
| 37 | + model, enforced through PR review and AI-agent guardrails. |
| 38 | + |
| 39 | +## Decision outcome |
| 40 | + |
| 41 | +Chosen option: **one org-wide, docs-as-code documentation standard**, published as the Documentation |
| 42 | +section under Contributing on this site. The standard is the living reference. Its rules evolve by |
| 43 | +PR without superseding this decision and this ADR is superseded only if the model itself changes. A |
| 44 | +snapshot of the rules at adoption: |
| 45 | + |
| 46 | +1. **Public by default**. Private content is limited to documentation about working at Bitwarden and |
| 47 | + sensitive information. |
| 48 | +2. **Located at the lowest common ancestor** of what is described. |
| 49 | +3. **Every doc has an audience**. AI agents and humans are both first-class audiences and |
| 50 | + maintainers. |
| 51 | +4. **Always up to date**. Doc maintenance is a top priority and happens alongside changes to what it |
| 52 | + describes. |
| 53 | +5. **Discoverable and unified**, enforced by the style guide the standard publishes. |
| 54 | + |
| 55 | +Diagrams follow the separate diagram standard adopted in |
| 56 | +[ADR-0033](./0033-adopt-mermaid-diagram-standard.md), which keeps its own living reference at |
| 57 | +Contributing › Diagrams. |
| 58 | + |
| 59 | +AI instruction files are explicitly not documentation and are out of the standard's scope. Their |
| 60 | +guidance lives with the AI tooling. |
| 61 | + |
| 62 | +### Positive consequences |
| 63 | + |
| 64 | +- One place to answer "where does this doc live" and "which docs do I update", for engineers and AI |
| 65 | + agents alike. |
| 66 | +- Documentation rides the code PR, so freshness is enforced by review and agent guardrails. |
| 67 | +- Public-by-default locations serve external contributors and AI agents without special access. |
| 68 | + |
| 69 | +### Negative consequences |
| 70 | + |
| 71 | +- A migration backlog: existing content sits in homes the routing model forbids and must move. |
| 72 | +- Strict-move deletions can break unknown inbound links. Known links are updated at move time and |
| 73 | + link checkers in CI are the mitigation for the rest. |
| 74 | +- Every repo carries adoption work before the standard applies in practice. |
| 75 | + |
| 76 | +### Plan |
| 77 | + |
| 78 | +Follow-up PRs complete the standard: |
| 79 | + |
| 80 | +- The standard, with its format guidance and templates, publishes as the Documentation section under |
| 81 | + Contributing and becomes the living reference this ADR mandates. |
| 82 | +- An ai-plugin is produced and made available to help identify when local documents need to be |
| 83 | + updated as well as adding both local and external documentation update requirements to AI review |
| 84 | + tools. |
| 85 | +- Each repo adopts the standard: base documentation obligations in the root `CLAUDE.md`, a |
| 86 | + `CONTRIBUTING` pointer, and markdown tooling parity. |
| 87 | +- Remediation work items are filed for every rule that current reality violates, and the superseded |
| 88 | + Confluence standards page is deleted. |
| 89 | + |
| 90 | +The migration backlog proceeds opportunistically under named owners. Small one-shot fixes are |
| 91 | +tracked as work items; the long-running efforts: |
| 92 | + |
| 93 | +- **Single-repo content migrates off this site**: `architecture/{clients,server,sdk,mobile-clients}` |
| 94 | + and 12 of 28 deep-dive pages (including the whole `autofill/` subtree) move into their repos per |
| 95 | + the routing table. Contributing docs' Deep Dives section holds only cross-repo or conceptual |
| 96 | + material. |
| 97 | +- **Shipped-code architecture migrates out of Confluence**: pages describing shipped code (the SSH |
| 98 | + agent suite, event collection, key management cryptography) move in-repo or to this site per the |
| 99 | + decision rule. |
| 100 | +- **README coverage in Bitwarden repositories**: generated stubs and missing module READMEs brought |
| 101 | + to the module README standard, and filename casing normalized. |
| 102 | +- **Confluence hygiene**: stale and superseded pages deleted or stale-marked, and team runbook |
| 103 | + indexes adopt the runbook standard and its Last verified discipline. |
| 104 | +- **Incident documentation consolidation**: RCAs converge on the incident.io export as the single |
| 105 | + home. |
| 106 | +- **Style long tail**: style violations fixed across the site as pages are touched. |
0 commit comments