Published · 8 min read
How to create an llms.txt file for your docs
Learn how to create llms.txt for your documentation: what goes in it, how to write or generate one, and how to keep it accurate after each release.
Published · 8 min read
Set up a docs preview for pull requests: each docs change renders on a preview URL, carries evidence for why it exists, and waits for human approval.

Who on your team knows which docs pages went stale after this morning's merge? And if someone fixes them, who checks the fix before it goes live? For most engineering leads, the honest answer is "nobody, reliably." A docs preview for pull requests changes that. Every documentation change arrives as a pull request, renders on a preview URL, carries the evidence for why it exists, and waits for a person to approve it. This guide walks through setting that up so docs keep pace with code and nothing publishes without a human sign-off.
Start with where the change lives. If your docs sit in a separate editor with its own workflow, keeping them current depends on someone remembering to go there. When docs are MDX or Markdown in a repository, the documentation update can ride in the same pull request as the code, or in a linked PR reviewed at the same time. The reviewer then sees the code diff and the docs diff together.
That gives you three things a separate editor can't:
Writing the docs PR is a different problem. On a fast-shipping team, especially one leaning on AI coding tools, nobody wants to stop after every merge and work out which pages just went wrong. Guides, tutorials, support articles, and marketing pages often mention a behavior without being "the docs for" that feature. Those are the pages that drift.
This is the gap Thally's Automation fills. You install a read-only GitHub App on your product and docs repositories. When a pull request merges into a watched branch, Thally analyzes the change, drafts the documentation updates it implies, and opens them as a pull request on your docs repo, ready for your review. You choose which events start a draft. Turn on the ones that change your public surface and leave the rest off. A relevant merge produces either an evidence-backed docs PR or a clear "no change needed".
Whether a person or a tool writes the change, the rule is the same: docs changes arrive as pull requests, never as direct edits to what's live.
A Markdown diff tells you which words changed. It doesn't tell you whether the page still renders, whether a code block broke, or whether a callout now sits in the wrong section. Reviewers need to see the page itself.
Most hosting platforms can build each pull request to its own URL. Netlify describes Deploy Previews as deploying pull and merge requests "to a unique URL different from the one your production site uses". In its example, pull request #42 deploys to deploy-preview-42--mysitename.netlify.app. Vercel works in a similar way. The latest push to any pull request gets its own preview URL, and "these URLs will be provided through a comment on each pull request". If the bot comments get noisy, you can turn them off and still get preview deployments.
Whatever builds your previews, check these before you rely on them:
Give reviewers a short, repeatable checklist so preview review takes minutes:

A preview shows what changed. Evidence shows why. Without it, a reviewer has two bad options: approve on trust, or reconstruct the reasoning from tickets and diffs.
Good evidence on a docs PR answers a few direct questions:
When a docs PR carries that context, review gets fast and specific. The reviewer can open the source change, confirm the behavior, check the preview, and approve. When it doesn't, the reviewer either rubber-stamps the PR or bounces it back with "why?" Rubber-stamping is how wrong docs get published. Bouncing it back is how docs PRs pile up unreviewed.
It matters because documentation quality isn't cosmetic. DORA reports "a clear link between documentation quality and organizational performance". It measured documentation quality with eight metrics, including clarity, findability, and reliability. DORA's 2023 report also found that high-quality documentation greatly increases how much technical practices improve organizational performance. Reliable docs need reviewers who can verify each change, and they can only do that when the evidence is in front of them.
Evidence also covers the opposite case. "No change needed" is a useful answer when it comes with reasons. A reviewer who can see that a merge was checked and found harmless doesn't have to wonder whether anyone looked.
This is the part engineering leads care about most, and GitHub already gives you the controls.
Protect the branch your docs site publishes from. Admins, or custom roles with the "edit repository rules" permission, can require a set number of approving reviews before a pull request merges into a protected branch. In the branch protection settings, you "select the Required number of approvals before merging dropdown menu". Once that's set, a collaborator who tries to merge a pull request with pending or rejected reviews "will receive an error message".
Tighten that with a few more settings:
Branch protection controls what merges. Environment protection controls what deploys. GitHub says "you can use deployment protection rules to require a manual approval, delay a job, or restrict the environment to certain branches". A few details to know before you lean on it:
Some teams ask for a docs platform that updates docs automatically after merges with no manual review at all. That's the wrong goal. Without review, the pages your users and AI assistants read can change with nobody checking them. A better goal is to make review cheap. Let automation do the detection and drafting. Put a preview and evidence on every PR. Keep the human step to a quick, informed approval. You save the hours without giving up control.

Not every draft should ship. Sometimes the change is internal-only, sometimes the wording is wrong, and sometimes the feature is about to change again. Rejecting a draft is a normal outcome, and it should leave a record.
When a docs draft is a pull request, rejection is just closing it. That gives you more than deleting it would:
A few habits keep this useful:
With a preview, the evidence, an approval step, and a record of what was rejected, a docs change gets the same review as the code that caused it.
Published under the Thally editorial policy. Technical conformance is defined in the agent-readiness methodology.
Create a managed site, or use the open-source engine to run Thally yourself.