Agentic engineering

Docs that agents can trust

Repo docs now have two readers, a person who needs the why and an agent that has to find the doc and rely on it. The same rules serve both.

Listen to this note
A diagram of one doc read by a person who needs the why and an agent that needs to find and trust it, built on evidence, citations and ASK HUMAN.

Documentation used to have one reader. Now it has two: a teammate who needs to understand why something is the way it is, and an agent that has to find the doc and trust it enough to act on it. The good news is the same discipline serves both.

The real hazard is made-up whys

The code tells you what and how. It doesn’t tell you why: the business reason, the alternative that was rejected, what got deferred, what it really costs. Those are exactly the gaps where a confident writer, human or AI, fills in plausible fiction. No test catches it and no reviewer can grep for it.

So the rules:

  • Gather evidence before writing. The code, the conversation where the decision was made, the ticket, and above all the git history. Pull request descriptions and review threads are usually the richest record of why.
  • Cite every why. Each sentence about reasons or cost points at its source: a commit, a ticket, a dated conversation.
  • Write ASK HUMAN instead of guessing. If nothing established it, say so and stop. A doc with open questions can’t be marked authoritative until a person answers them.

Lead with the answer

Every doc opens with a short summary, then why it exists, then how it works, pointing at the code rather than pasting it. Decisions, deferred decisions, gotchas and cost follow. An agent that only reads the first screen should still get the point.

The repo teaches the agent

The most valuable file in an agentic codebase is one canonical guide for agents: what this is, how to build and test it, and what never to do. Tool-specific files just point at it. Behind it sits a folder of docs that explain why, maintained by the same skills that write them: one to write, one to review without changing anything, one to update.

Why it matters for a team

Docs that confabulate are worse than no docs, because people and agents both believe them. Docs that cite their sources and admit what they don’t know are the cheapest way to make every future agent run start from the truth.