Skip to content

How to write documentation that coding agents, and people, can actually use

Short pages, concrete commands, examples that run and links instead of copies. Documentation habits that help agents and humans find the answer.

Published by Contextingo.

An agent reads documentation as text, quickly, and acts on what it finds. Documentation that is good for a new colleague is good for an agent, and the reverse mostly holds too.

Habits

  • One topic per page, with a title that says the topic.
  • Commands in code blocks, ready to copy, with the expected result.
  • Examples that run, and are tested if possible.
  • Link, do not copy. A copied fact becomes a stale fact.
  • State the date and the version a page applies to.
  • Say what is not supported, so no one guesses.
  • Put the reason with the rule. An agent that knows why will not undo it.

Structure that works

# Title
One-sentence summary.
## When to use this
## Steps
## Check that it worked
## Common problems

Keep it true

Wrong documentation is worse than none. Give each page an owner, review pages when the code changes, and delete what no longer applies.

Knowledge that changes daily

Findings and failed attempts change too fast for documents. Keep them as records with a source and status. See why coding agents forget.

Questions

Good to know.

Should I write documentation just for agents?

No. Write for a new teammate. Agents benefit from the same clarity.

How do I know which pages are stale?

Put a date on each page and review the oldest ones first.

Nothing learned is lost. Nothing unchecked is done.