About this article
As the fourteenth installment of the âDevOps Architectureâ category in the series âArchitecture Crash Course for the Generative-AI Era,â this article explains documentation.
For documentation, deciding âwhere to place itâ before writing comes first - misplacing erases the meaning of writing. This article handles ADR, README, API docs, and docs-as-code as practice maintaining the state of âwhatâs written gets read / AI can read / not rotted half a year later.â
What is documentation, anyway?
Imagine leaving handover notes for your family. âTrash goes out Monday and Thursday,â âpress this button for the water heaterâ â itâs the act of leaving behind the information needed to keep things running even without you. Without it, nobody knows the correct procedures while youâre away.
Software documentation works the same way. Itâs the activity of recording why this design was chosen, how to start the system, and how to use the API so that your future self or new team members wonât be lost six months later.
Without documentation, design rationale vanishes into the heads of people who have left, and new-member onboarding becomes nothing but verbal âask the person next to youâ tradition.
Why documentation matters
The âwhyâ of design vanishes in six months
Reading code tells you âwhat it does,â but not âwhy this design was chosen.â Without recording the reasoning, even you yourself will wonder âwhy did I do this?â six months later.
Donât let onboarding depend on individuals
In teams without documentation, new hires have no option but âask the person sitting next to me,â tanking the mentorâs productivity. A well-maintained README dramatically shortens the time to self-sufficiency.
AI now reads documentation to make decisions
When ADRs (Architecture Decision Records) and OpenAPI specs live in Git, AI agents can generate code with full understanding of design intent. Documentation now has machine readers, not just human ones.
Distinguish 4 types of documents
Whatâs called âdocumentationâ actually mixes 4 types differing in purpose, lifespan, and update frequency. Without distinguishing, âputting everything in Confluenceâ simultaneously degrades searchability and updatability.
flowchart TB
DOCS([Documentation])
subgraph GIT["Git repo (docs-as-code)"]
README[README<br/>entry, startup steps]
ADR[ADR<br/>design-decision record]
API[API docs<br/>OpenAPI/TypeDoc]
end
subgraph WIKI["Confluence/Notion/Wiki"]
BIZ[Business knowledge / ops procedures<br/>org knowledge]
end
DOCS --> GIT
DOCS --> WIKI
GIT -.|PR/review/history/<br/>AI can read|.- L1[unified with code]
WIKI -.|short-mid lifespan<br/>easily outdated|.- L2[business knowledge only]
classDef root fill:#fef3c7,stroke:#d97706;
classDef git fill:#dcfce7,stroke:#16a34a,stroke-width:2px;
classDef wiki fill:#dbeafe,stroke:#2563eb;
class DOCS root;
class GIT,README,ADR,API git;
class WIKI,BIZ wiki;
| Type | Purpose | Lifespan | Place |
|---|---|---|---|
| README (repo intro / startup) | Entry signposting | Mid (same as repo) | Repo root |
| ADR (design decision record) | Why that choice was made | Permanent (append-only) | Repo docs/adr/ |
| API docs | Machine-readable spec definitions | Code-synced | OpenAPI YAML / TypeDoc |
| Business knowledge / ops procedures | Accumulating org knowledge | Short-mid (easily outdated) | Confluence / Notion / Wiki |
The modern standard is committing the first 3 types to Git repos. PR / review / history management together with code, AI can read too. Confluence / Notion is design balancing searchability and updatability by narrowing to âbusiness knowledge / ops proceduresâ only.
ADR - design-decision record
ADR (Architecture Decision Record) is the format Michael Nygard proposed in 2011, leaving âwhy this technology was chosenâ with one file per decision. Today, regardless of OSS, SaaS, or enterprise, itâs the de facto standard format for design records.
# ADR-0007: Adopt PostgreSQL as main DB
## Status
Accepted (2026-03-15)
## Context
SQLite can't meet concurrent-connection / read-replica requirements.
## Decision
Adopt PostgreSQL 16. Compared with MySQL and MongoDB, valued
the combination of JSON type and relational design.
## Consequences
- Secure extensibility for full-text search and geospatial
- For special horizontal distribution, separate products needed
The trick: short (within 1 page), append-only without overwrite (set Status to Superseded by ADR-XX for past decisions). With decision history remaining, new hires half a year later can reconstruct âwhy itâs like thisâ from Git history.
When to write ADR - One-way Door judgment
ADRs arenât to be written for âevery design decision.â Writing too many leads to obsolescence and no one reads. Practical to narrow to those that fall under One-way Door (decisions hard to reverse once passed, Amazonâs decision-making framework).
| Decisions to write | Decisions not to write |
|---|---|
| DB selection (PostgreSQL vs MongoDB) | Switching from library A to B |
| Adding language / framework | Changing function arg types |
| Auth method decision (OAuth / Passkey) | Changing endpoint names |
| Microservice splitting | Refactoring individual APIs |
| Cloud-vendor selection | Changing EC2 instance size |
| Fundamental data-model change | Adding a column |
The ADR-line guideline is âredoing takes 3+ months.â Lighter than this, PR description suffices. Conversely, not leaving One-way Door decisions in ADRs means no one can explain âwhy we did thisâ 3 years later - the entry point of debt frequent in enterprises.
README - the entry signpost
README is the signpost the person opening the repo first sees. In many teams, READMEs polarize into âjust project name and 1-line descriptionâ or âeverything-in-one but no one reads.â The standard is composition narrowing to steps to start in 5 minutes + minimum context needed.
| Should include | Shouldnât include |
|---|---|
| Project purpose (1 paragraph) | Detailed design explanations (-> ADR / docs/) |
| Startup steps (copy-paste-runnable) | All-features usage |
| Dev-env premises (runtime version requirements etc.) | API reference (-> separate file) |
| License / contact | Personal TODO memos |
| Related links (CONTRIBUTING / docs/) | Incident history |
Most important is âstartup by copy-paste.â Guarantee in README a state where just pasting commands in order works, from git clone to localhost:3000. READMEs left with old commands or changed dependencies become devices frustrating new hires within their first 30 minutes.
docs-as-code - lean toward Markdown + Git
docs-as-code is the thinking of managing documentation with the same mechanism as code (Markdown + Git + PR review). The flow today mainstream is leaning from GUI-centric tools like Confluence and Notion to in-repo Markdown.
| Viewpoint | docs-as-code (Markdown + Git) | Confluence / Notion |
|---|---|---|
| Version control | Complete via Git history | Limited (edit history only) |
| Review | PR with same workflow as code | Comment feature only |
| Searchability | Instant via grep / IDE | Search-accuracy issues |
| AI-readable | Excellent (standard format) | Marginal (custom API, scraping difficult) |
| Diagrams | Code-ize with Mermaid / PlantUML | Embedded images (manual update) |
| Learning cost | Markdown knowledge only | Tool-specific UI |
Confluence / Notion is suited for business knowledge / org info, but placing code-tightly-coupled documents there degrades searchability and reviewability. The modern standard is leaning all of API specs / design decisions / READMEs to in-repo Markdown.
Stages for writing documentation - phased practice
Vague âwhen to write docsâ also formalizes. Practical to split timing and granularity by stage, deciding what to leave where at each stage.
| Stage | When to write | What to write | Where to place |
|---|---|---|---|
| 1. Design consideration | Before implementation | ADR (chosen / alternatives / reasons) | docs/adr/NNNN-title.md |
| 2. PR submission | Just after implementation | PR description (changes / verification) | GitHub PR |
| 3. After merge | As needed | README update / API doc generation | In repo |
| 4. Release | At feature publication | CHANGELOG / release notes | CHANGELOG.md (auto-generated) |
| 5. Incident | Within 24h of recovery | Postmortem | docs/postmortems/ |
PR description aims for âthe level where full context is understandable from that commit alone.â The standard is writing 3 points - âwhy this change is needed,â âwhether alternatives were considered,â âverification stepsâ - in the body. Just thoroughly doing this lets people tracing with git blame 3 years later instantly reconstruct context.
Documentation pitfalls - rotted docs are misinformation
The biggest documentation trap is not getting updated after writing. Documentation with old info is worse than âno documentationâ since it guides readers in wrong directions.
| Pitfall | Why it happens / why itâs bad |
|---|---|
| Old commands remain in README | New hires get stuck on day one. Make commands CI-runnable |
| 3-year-old architecture diagrams in Confluence | Diverges from ârunning code.â Images rot |
| Distribute API specs as Word | Doesnât sync with code, becomes lump of misinformation in half a year |
| Cram all-feature usage into README | Bloated, no one reads or updates |
| âDesign docs in Excelâ operations | Unsearchable, undiffable, AI-unparseable |
| âMore detailed is always betterâ | Bloated, no one reads, never updated, rots |
| âConfluence is searchable so itâs fineâ | Search accuracy is poor, AI-unreadable, inappropriate for code-tightly-coupled info |
The countermeasure core is the systematization of placing docs in same place as code, forcing updates via PR. Auto-generate everything code-generatable like OpenAPI / TypeDoc, minimizing docs humans manually update - the modern defense line.
Old documentation is worse than no documentation. The problem is design where the writer doesnât take update responsibility.
AI decision axes
| AI-favored | AI-disfavored |
|---|---|
| Markdown + Git documentation | Confluence, Notion, verbal tradition |
| Culture of leaving âwhyâ in ADRs | âWorking code is documentationâ-ism |
| Machine-readable specs via OpenAPI / TypeDoc | Spec distribution in Word / Excel |
| Mermaid / PlantUML (text diagrams) | PNG / JPG diagrams (un-updatable) |
| README covering startup steps | Thin README, relying on verbal tradition |
- Lean documentation placement to Git repos - Confluence for org info only
- Always leave One-way Door decisions in ADR
- Sync code and spec via OpenAPI / TypeDoc / Mermaid
- Force âwhy / alternatives / verification stepsâ via PR description template
OpenAPI / TypeDoc - auto-generation from code
Hand-writing API specs always rots them. Using OpenAPI (formerly Swagger, machine-readable spec format for REST APIs) or TypeDoc (auto-generated from TypeScript comments), code and spec stay constantly in sync.
| Tool | Target | Characteristics |
|---|---|---|
| OpenAPI (YAML / JSON) | REST API | De facto standard, visualized via SwaggerUI |
| GraphQL Schema (SDL) | GraphQL | Types are the spec |
| gRPC + Protocol Buffers | gRPC | .proto is the spec |
| TypeDoc | TypeScript libraries | HTML generated from comments |
| Sphinx + autodoc | Python | HTML generated from docstrings |
| rustdoc | Rust | Built-in standard |
The modern standard is design where comments / types in code become documentation as is. Using OpenAPI lets you generate server implementation, client SDK, mock server, and HTML docs from one YAML. Manage OpenAPI YAML in Git and verify âcode and YAML stay in syncâ in CI - the biggest defense line preventing API-doc decay.
Mermaid / PlantUML - diagrams as code too
Diagrams are representative of things that rot easily. Pasting PNGs created in Lucidchart or draw.io to repos frequently causes accidents where sources go missing and updates become impossible. Mermaid and PlantUML are mechanisms defining diagrams as text, with best chemistry with docs-as-code since they can be written directly in Markdown.
sequenceDiagram
User->>Frontend: login request
Frontend->>AuthAPI: POST /auth/login
AuthAPI->>DB: user authentication
DB-->>AuthAPI: auth result
AuthAPI-->>Frontend: JWT issued
GitHub, GitLab, Notion, and VS Code render Mermaid as standard. Being text means overwhelming strength on 3 points - diffs readable, change-reviewable in PRs, AI-understandable. The cost gap between âdrawing diagramsâ and âupdating diagramsâ shrinks dramatically, getting the mechanism of âdiagrams donât rot.â
Postmortems - mechanism for learning from incidents
Postmortems (literally âpost-death examination,â in IT industry meaning incident review docs) are the core of SRE practice. Written within 24-48 hours of incidents, documents for improving mechanisms not blaming individuals.
# Postmortem: 2026-03-20 auth incident (45 minutes)
## Impact
All users couldn't log in / impact 14:23-15:08 JST / opportunity loss about 1.2M yen
## Timeline
- 14:23 alert fired
- 14:38 cause identified (Redis connection-pool exhaustion)
- 15:08 normalization confirmed
## Cause (5 Whys analysis)
## Action items
- [ ] Add connection-pool monitoring to Grafana
- [ ] Add this case to load-test scenarios
Blameless (no blame) is the iron rule. Writing not âPerson A made a mistakeâ but it was a mechanism that couldnât prevent mistakes changes recurrence prevention from individual-dependent to mechanism-improvement. Whatâs written is published to all internal staff, turning learning into organizational knowledge - Google SREâs operational style.
Documentation antipatterns
Even with documentation-writing culture, mixing in the following antipatterns drastically reduces effect.
| Antipattern | Why itâs bad |
|---|---|
| Throw everything into Confluence | Unsearchable, no PR review, AI-unreadable |
| Only âresponsible personâ updates docs | Bottleneck-ization, instant outdated when they leave |
| Donât evaluate âwritingâ but only âwriting codeâ | Culture of no one writing settles |
| Cram all-feature usage into 1 file | Bloated, not read |
| Write important info in Slack and share via DM | Unsearchable, new hires canât access |
| Treat docs as confidential and partially disclose | Reviews donât turn unless everyone sees same info |
Design decisions shared in Slack DM are equivalent to non-existent for the org. Slack logs are searchable but buried in unintended flows and undiscoverable, requiring the line âSlack is for discussion, conclusions go to Git.â
What to decide - what is your projectâs answer?
For each of the following, try to articulate your projectâs answer in 1-2 sentences. Starting work with these vague always invites later questions like âwhy did we decide this again?â
- Documentation placement (repo Markdown / Confluence / Notion)
- ADR operation (write targets / template / placement)
- README minimum line (whether startup steps work via copy-paste)
- API-spec management (OpenAPI / GraphQL SDL /
.proto) - Diagram management (Mermaid / PlantUML / images)
- PR description template
- Postmortem operation (writing timing / publication scope)
- Doc-update responsibility rule (simultaneous update in change PRs)
Authorâs note - âConfluence graveyardâ that killed a migration project
Thereâs a case at a mid-size SaaS where 3 years of architecture decisions, ops procedures, and incident responses were all accumulated in Confluence. The problem: new hires couldnât find needed info. Searches hit 10-year-old drafts, old design proposals from other teams, and duplicate pages copied and left, with the state of taking hours to find correct info becoming normal.
This team conducted phased migration from Confluence to in-repo Markdown, ultimately organizing as âall code-tightly-coupled info to Git, only org info in Confluence.â Beyond drastically shortening new-hire ramp-up time, AI agents could read Git docs and generate code, raising dev speed too - the case. Itâs becoming the era where doc placement decides organizational competitiveness.
Confluence easily becomes the graveyard of information. Move code-tightly-coupled info to Git.
Summary
This article covered documentation, including 4-type distinction, ADR, README, docs-as-code, OpenAPI, Mermaid, postmortems, and AI-era placement.
Lean documentation toward Git repos, leave One-way Door in ADRs, auto-sync code and spec, force intent via PR description. That is the practical answer for documentation design in 2026.
Next time weâll cover ticket / project management (Issue, Kanban, WIP limits).
I hope youâll read the next article as well.
đ Series: Architecture Crash Course for the Generative-AI Era (67/89)