04.7.3 · Skill in Developer experience

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.

Your status · Developer documentation

Saved in this browser. Sign in to keep it on every device.It colours this skill's tile on your map.

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

  1. Keep docs in the repository, next to the code they describe. Change them in the same pull request as the code.
  2. 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.
  3. Make the README answer four questions: what is this, how do I run it, how do I test it, and where do I start.
  4. Record each significant decision in a short architecture decision record, with its context and its consequences.
  5. Give agents a short instruction file, such as AGENTS.md, with the rules and links to the longer docs.
  6. 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.

Anatomy

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

  1. 1TitleA short noun phrase, with a number
  2. 2ContextOften in tension, and stated without judgement
  3. 3DecisionFull sentences, in the active voice
  4. 4StatusA superseded record points to its replacement
  5. 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 guide

    Four kinds of documentation (tutorials, how-to guides, reference, explanation) and why mixing them fails.

  • articleStart here
    Documenting architecture decisions ↗
    Michael Nygard · 2011 · 6 min

    The original proposal for short architecture decision records, so trade-offs stay visible later.

Tools

2
Tools for Developer experience