← All posts
·4 min read
View .md

Generate technical docs from your codebase — with proof

Generating technical documentation from a codebase is easy now. Trusting it isn't. Evidence-linked claims and human sign-off are the missing steps.

product-behavior-contracttechnical-documentationai-codingdeveloper-experienceproduct-intelligence

TL;DR: Any AI tool can now generate technical documentation from your codebase. Almost none of them can prove what they wrote. A technical document you can act on needs three things generated prose doesn't have: every claim linked to the source files it came from, an honest line between what's confirmed and what's inferred, and a human who signed off before it became canon.

"Generate technical documentation from your codebase" used to be a fantasy. Now it's a commodity. Point almost any coding agent at a repo and you'll get back confident, well-structured prose about what the system does.

I've done this many times, across my own projects and codebases I inherited. The documents always read well. That turned out to be the problem.

Confident prose is not a technical document

A technical document exists so someone can make a decision: change this behavior, price this acquisition, onboard this engineer, ship this migration. Every one of those decisions has a cost if the document is wrong.

Generated docs fail this test in a specific, repeatable way — not by being obviously wrong, but by being unaccountably right-sounding. Three failure modes show up every time:

No provenance. The document says "payments are retried three times with exponential backoff." Is that true? Which file? Which commit? If you can't jump from the claim to the code that supports it, you can't verify it without redoing the analysis yourself — which defeats the point of having the document.

No confidence line. Generated prose flattens everything to the same register. A behavior that's enforced by tests and a behavior the model guessed from a function name read identically. I wrote before about how auto-generated specs quietly promote placeholders and fallbacks to product canon — the doc-generation version of that problem is worse, because prose hides uncertainty even better than specs do.

No sign-off. Nobody decided the document is true. It was emitted, not reviewed. Six weeks later, someone treats it as a source of truth, and now a guess made by a model has become an assumption load-bearing in someone's plan.

None of this is fixed by a better model. It's a structural gap: text generation produces plausibility, and a technical document needs accountability.

What "with proof" actually means

When I built Stewie Reflect, the design constraint was exactly this gap. Not "generate better docs" — generate documents that carry their own evidence.

Concretely, that means:

Every claim links to source. Reflect reads a snapshot of your repository and produces a plain-language owner's manual of what the product does — and each statement in it is tied to the specific files it was derived from, pinned to the commit that was analyzed. When you read "invoices are finalized before the email is sent," the files that show it are one click away. You verify by reading, not by re-investigating.

Findings are graded, not flattened. What the code demonstrably does, what was inferred, and what looks risky or undecided are kept distinct. A technical document that admits "this part is uncertain" is more useful than one that sounds uniformly sure — because the uncertain parts are exactly where your next incident or your next hard question lives.

Nothing is final until a human says so. The generated manual is a draft of the truth, not the truth. You review it, correct it where your intent differs from what the code drifted into, and sign off. That step is what turns generated text into a document your team can actually rely on. It's also the step every fully-automatic pipeline skips, because it doesn't demo well.

The output is portable. The result exports as Markdown, built on the open Product Behavior Contract format — readable by your team, your tools, and your coding agents, with no lock-in to the tool that produced it.

How this differs from the documentation tools you know

Authoring platforms — GitBook, Confluence, Notion and their peers — are excellent at hosting documentation humans write. They don't know whether what's written matches the code, and they were never designed to. The staleness problem lives entirely with you.

Repo-wiki generators attack staleness by regenerating docs as code changes. That's genuinely useful for helping coding agents orient inside a codebase — I've written about where repo documentation helps and where it stops. But regeneration doesn't add accountability. A wiki that refreshes itself is still unreviewed prose; it's just recent unreviewed prose.

The third path — the one Reflect takes — treats documentation as a claim-by-claim artifact: derived from a pinned snapshot of the code, linked to its evidence, graded by confidence, and finalized by a person. Less magical than "docs that write themselves." Considerably more useful when a decision depends on the document being right.

Where to start

If you have a repository — yours, inherited, or vibe-coded into existence by an agent over a few intense weekends — the honest first step isn't writing documentation. It's finding out what the product actually does now.

Stewie Reflect does that from a repo snapshot: connect the repository, get a free preview of the manual, and see the claims with their source links before deciding anything. If it's useful, the full manual and Markdown export are a one-time US$19 during beta.

Either way, hold your next generated document to the standard that matters: not does this read well, but can anyone prove it?

Vinh Nguyen

Written by Vinh Nguyen — founder of Stewie, building the workspace for capturing product behavior contracts.

Related posts

Stewie reads your codebase and helps you author a living product behavior spec. We're onboarding a small group of product and engineering teams before public launch. Request early access →

Subscribe via RSS