Documentation That Writes Itself
You open a repository you left alone in February. The README describes a service that signs its own requests, a queue that no longer exists, and a setup command that fails on the second line. Someone wrote it once and meant every word. What is actually true about that project was said out loud four months ago, in a working session where you and an agent argued out why the retry had to move behind the queue — and then the window filled up and the conversation was dropped on the floor. The documentation was never missing. It was produced, used, and discarded, every working day.
The track is worn first, then paved
There is a park near a station where the paving follows no plan. Two straight walks meet at a right angle, and across the corner runs a bare strip two feet wide, pressed down to the soil by ten thousand people who were not going to spend the extra thirty seconds. For years the parks office reseeded it. Eventually someone gave up and paved the strip. That route was never designed. It was recorded. The walking had already decided, and the only labour left was noticing.
A trace-driven compiler does the noticing. One hook fires when a session ends and another just before the window is compacted, so the transcript is captured before anything is thrown away. A first pass pulls out the parts that carry weight — the decisions taken, the lessons, the small traps somebody fell into — and files them in a log for that day. A later pass compiles those logs into articles, one per concept, cross-referenced, and regenerates an index so the next session can actually find them. Nobody sat down to write any of it. The pages are made out of what the work already said.
The bare strip outlives the puddle it avoided
The trouble with a worn route is that it remembers reasons that are gone. It bends around a puddle drained two summers ago, and the bend stays, because feet follow feet. Generated pages fail the same way and they fail harder, because a stale page is not merely ignored: an agent loads it and acts on it. Knowledge produced once and treated as permanent is not a wiki. It is a steady supply of confident, obsolete instruction.
So the loop needs a trigger, not just a first run. The wiki is regenerated when the sources it describes move — a job that inspects the repository after a change and proposes the documentation diff beside the code diff, to be read and approved like any other edit. And there is a second discipline, sharper than the first: not everything learned deserves promotion. Trellis draws that line explicitly. After the final check, a dedicated step lifts new learnings into the project’s spec files, so a rule such as this library needs that particular flag becomes part of what the next session starts with, while whatever belonged to one run stays down in the journal where it happened.
Somebody still decides what gets paved
That line — general rule up, single-run detail down — is where the cost went. It did not vanish. Producing the page is close to free now; deciding which sentence has earned the right to govern every future session is not, and it is the same judgement a good technical writer was always paid for. What changed is when you spend it. Instead of a quarterly effort to describe a system you have already half forgotten, you spend a minute on a diff while the reason is still warm.
The other half is duller and matters more: the pages are plain files in the repository, a little structured front matter, ordinary links between them, an index and a log that mean the same thing to whatever reads them next. That is what lets the knowledge outlive the tool that produced it. It can be diffed, reviewed, migrated, and read by a human at two in the morning.
Nobody writes the documentation any more. Somebody still has to decide what is worth paving.