Developer documentation
Docs that help engineers understand and use code, APIs and systems.
Developer docs include READMEs, API references, guides and decision records. Good ones are close to the code and kept current. They now also serve AI agents working in the codebase.
Why it matters for a product engineer
Docs let people, and now agents, change code without asking its author. Good developer docs sit close to the code and are short enough to keep current. An agent reads them at the start of every session, so a wrong line costs more than before: the agent follows it every time.
How to do it
- Keep docs in the repository, next to the code they describe. Change them in the same pull request as the code.
- Write each doc for one need: a tutorial to learn, a how-to guide for a task, a reference to look something up, an explanation to understand. Diátaxis shows why mixing them fails.
- Make the README answer four questions: what is this, how do I run it, how do I test it, and where do I start.
- Record each significant decision in a short architecture decision record, with its context and its consequences.
- Give agents a short instruction file, such as
AGENTS.md, with the rules and links to the longer docs. - Delete docs that are no longer true.
Common mistakes
- A wiki far from the code, out of date a month later.
- Docs that repeat what the code does, line by line, but not why.
- Long agent instructions that copy the docs and then drift from them.
- Decisions that live only in a chat thread.
Example
This site’s AGENTS.md is 13 lines. Most of them are the analytics rules: one shared adapter, no
personal data, and no events sent from development or agent runs. The details live in
docs/analytics.md, which people read too. It ends with a ready prompt for an agent’s weekly
analytics review. The rules stay short in one place, and the details live in another.
The five parts of an architecture decision record
ADR 9: LDAP for Multitenant Integration 1Context: the forces at play, described as facts. 2Decision: We will … 3Status: proposed, accepted, deprecated or superseded 4Consequences: all of them, not only the good ones5
- 1TitleA short noun phrase, with a number
- 2ContextOften in tension, and stated without judgement
- 3DecisionFull sentences, in the active voice
- 4StatusA superseded record points to its replacement
- 5ConsequencesThe context after the decision
One or two pages, written as a conversation with a future developer. The consequences include the costs, so the trade-off is still visible years later.
ReportedMichael Nygard, 15 Nov 2011
Sources: Documenting architecture decisions (Michael Nygard) ↗ · Diátaxis (Daniele Procida) ↗
Resources
2- docsStart here
Diátaxis ↗
Daniele Procida · free guideFour kinds of documentation (tutorials, how-to guides, reference, explanation) and why mixing them fails.
- articleStart here
Documenting architecture decisions ↗
Michael Nygard · 2011 · 6 minThe original proposal for short architecture decision records, so trade-offs stay visible later.
Tools
2- ToolFreemium
GitHub Actions
CI/CD built into GitHub, for running tests, checks and deployments on every change.
- ToolOpen source
Renovate
Open-source bot that opens pull requests to keep dependencies up to date.