Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Vaardigheden in dit hoofdstuk
- Documentation — P1032–P1041
The knowledge map: decisions, runbooks, onboarding
Three shelves, one owner each, reviewed when the service changes.
Three shelves hold the knowledge a team actually reuses: decisions, runbooks and onboarding. Leave one out and the other two rot.
- Decide: Decision record, Decision log, Threat model
- Operate: Service runbook, Incident review, Owner register
- Join: README and setup, First week path, Service map
Full note: P1032 — The knowledge map: decisions, runbooks, onboarding
Writing an ADR people read
Write the page someone will need when you are not there to explain.
Most decision records are written to be approved and never opened again. The one people read is written for the engineer who finds the code two years later.
- One decision: Numbered, dated, in the repository, written in five minutes and read in five more.
- Five parts: Title, status, context, decision, consequences. Nothing else is required.
- The rejected options: Two alternatives with the constraint that ruled each one out.
- Status and links: Accepted is immutable; a new decision supersedes it and links both ways.
Full note: P1033 — Writing an ADR people read
Five docs that pay for themselves
Five documents, one owner each, reviewed on a date.
Documentation pays back when it removes a question that would otherwise go to a person.
- A runbook per service: restart, rollback, dashboard, wake the owner.
- One page per decision you cannot cheaply undo, options included.
- An onboarding path with a real first task that ships in week one.
- A postmortem that ends in owners and dates, not a timeline.
Full note: P1034 — Five docs that pay for themselves
Turning an incident into a runbook
Nine moves, one page, tested by somebody else.
An incident produces two things worth keeping: a timeline and a set of commands that worked. A runbook is what survives when the timeline is thrown away.
- While it is still fresh: Keep the timeline; Copy the commands; Name each decision.
- Turn the night into steps: Cut the story; Split by symptom; Check before touching.
- Prove it before the next alert: Dry run on staging; Time the recovery; Date it and name it.
Full note: P1035 — Turning an incident into a runbook
Onboarding docs that shorten week one
One target, five lines, one real first change.
Every new joiner pays a tax in week one, and the receipt is a list of questions somebody else has already answered.
- One target: A merged, deployed change by Friday. Every page is judged against that.
- Five README lines: What it is, how to run it, where things live, who owns it, how to test it.
- Setup as a script: One command, pinned versions, seed data committed, tested on a clean machine.
- A real first task: Small, reviewed, deployed, with the rollback demonstrated.
Five rules for diagrams that survive
One message, labelled arrows, one level, a date and a name.
A diagram is read before the document it sits in, and often instead of it.
- One message per diagram. If the caption needs two sentences, split the canvas.
- Label every arrow with a verb: calls, reads, publishes, retries.
- One shape per kind of thing, and a legend that names each shape.
- One level of abstraction: no database beside a business unit.
Full note: P1037 — Five rules for diagrams that survive
Docs-as-code commands
Author, check, build, ship, and let the pipeline fail.
Docs-as-code is four blocks deep: author, check, build, ship. Most teams run the first and skip the rest.
- Author:
git switch -c docs/adr-0042 - Check:
vale --minAlertLevel=error docs/ - Build:
mkdocs build --strict - Ship:
mkdocs gh-deploy --force
Full note: P1038 — Docs-as-code commands
API documentation that answers questions
Answer the question the reader arrived with, then prove the answer runs.
Developers do not read API docs from the beginning. They arrive from a search result with one question and ninety seconds to spare.
- Question first: Auth, limits, errors, paging: one page each, linked from the quickstart.
- One shape: Method, purpose, parameters, request, response, errors, in that order.
- Errors with a fix: A standard problem body, a stable code, a request id and the next action.
- Examples that run: Paste, run, see the response. Tested against a sandbox on every merge.
Four numbers for a docs page
Four numbers, printed on the page, reviewed with the owner.
Four numbers tell you whether a documentation page is alive. None of them is a word count.
- Freshness: days since someone checked the page against the system it describes, printed on the page.
- Owner: one person, not a team, plus the date the page is next due for review.
- Links: broken links caught by the build, not by a reader who needed the page at 2am.
- Reads: page views beside the searches that returned nothing, so you fix what people wanted.
Full note: P1040 — Four numbers for a docs page
The documentation stack: source, build, publish, measure
Source once, build strictly, publish at a stable URL, measure the misses.
A documentation stack is a few stages and one feedback loop, and most teams stop before the last.
- Source: Markdown in the repository of the code it describes.
- Review: A pull request, a preview build, an approving owner.
- Build: A static generator that fails on a broken reference.
- Publish: One URL per version, HTTPS, a redirect for every move.
Full note: P1041 — The documentation stack: source, build, publish, measure