Document Intent, Not Just Method

Code describes how; comments and specs must describe why — the reasoning that code cannot encode.

What it is

Code is a complete, executable record of *what* the system does and *how* it does it. But code cannot express the reasoning behind its own existence: why this approach rather than an alternative, what constraint the implementation is satisfying, what invariant must hold even as the code changes. When documentation is limited to restating the code in prose, it adds no information. When documentation captures intent — the decision rationale, the constraint being satisfied, the design alternative rejected and why — it becomes the only place that information lives. Agents reading code without intent documentation must reverse-engineer the reasoning, which they do unreliably. Agents reading intent documentation can apply, extend, and correct the code without contaminating it with false assumptions.

A mature intent layer does not stop at scattered comments; it emits a durable intent artifact set that downstream agents can read, apply, and validate against:

These artifacts should live where agents can actually reach them — in the repository, a knowledge base, a workflow state directory, or a structured project bundle — not buried in a chat transcript no agent will read.

When to reach for it

When NOT to

Exemplars

Related