Skip to content

Make the docs easier for AI agents to read: llms.txt, page descriptions, Markdown fixes - #152

Merged
rithviknishad merged 2 commits into
mainfrom
claude/llms-txt-ai-readiness-b83f42
Dec 4, 2026
Merged

rithviknishad merged 2 commits into
mainfrom
claude/llms-txt-ai-readiness-b83f42

Conversation

@rithviknishad

Copy link
Copy Markdown
Member

The site already served /llms.txt, /llms-full.txt and a Markdown copy of every page (from #91). This makes those files more useful, fixes the broken links in them, and adds checks so they stay that way.

What was wrong on docs.ohc.network

Before After this PR
llms.txt descriptions 439 of 564 were just "Overview" or "Definition" Every page has a one-sentence summary
Meta description / link previews "Definition" on the Patient page, for example The same summary
llms.txt sections URL slugs: ## concepts, ## category, ## markdown-page The sidebar's names and order: Flows › Clinical › Encounter
Links inside the Markdown pages 106 links to 10 URLs like /apps/ai-vision/.md returned 404 All resolve (checked in CI)
llms-full.txt 7.1 MB, with heading anchors, base64 images and table padding 5.1 MB of content
HTML pages No link to their Markdown copy <link rel="alternate" type="text/markdown">, plus Copy page, View as Markdown, Open in Claude and Open in ChatGPT
robots.txt 404 Allows all, names the sitemap and points to llms.txt

Changes

Commit 1: page descriptions (637 files, one line each). scripts/add_descriptions.py drafted a description: for every page from the page's own first sentence. "This flow describes how to…" became "How to…", and six weak drafts were rewritten by hand. The script never overwrites an existing description. The 3.0 pages got descriptions too, for their search snippets.

Commit 2: tooling.

  • plugins/llms-txt/route-rules.js builds llms.txt's sections from _category_.json labels and positions. A "How to use these docs" note follows the summary.
  • plugins/llms-txt/clean-markdown.js fixes the plugin's trailing-slash .md links and removes heading anchors and base64 images. Tables are no longer padded, and videos are labelled.
  • Generated /category/* pages and the template's src/pages/markdown-page.mdx are left out of llms.txt; the template page is deleted.
  • Theme wrappers DocItem/Metadata and DocItem/Content add the alternate link and the page actions. They appear only where a .md exists: the latest version, in English. 3.0 and /ml/ pages are unchanged.
  • static/robots.txt.
  • CI (test-deploy.yml) now runs add_descriptions.py --check before the build and scripts/check_llms.py build after it.
  • The concept, flow and reference skills, their templates and Ezhuthachan's draft checks now ask for a description:.

Checked

  • npm run build (en + ml) passes. add_descriptions.py --check and check_llms.py build both pass: 534 pages listed, 535 Markdown pages, every link resolves.
  • Served the build locally:
    • The page actions work on desktop and mobile, in light and dark mode.
    • Copy page copied the page in the in-app browser, through the execCommand fallback (that browser blocks the Clipboard API).
    • The alternate link points at a .md that exists, including for routes that end in a slash (/deployment/providers/aws → aws.md).
    • No page actions on 3.0, /ml/ or /category/ pages.

For review

  • Read some of the descriptions: they are drafts made from each page's first sentence. A sample is in the llms.txt preview of this PR's build.
  • The "Open in Claude / ChatGPT" links prefill a prompt with the page's .md URL. They are ordinary links, and no data is sent until the reader submits.
  • The Copy page button can't work in npm start, because the .md files are made only by npm run build.

Not in this PR

  • llms-full.txt is still about 5 MB, more than a model's context window. Agents should use llms.txt and fetch single pages; the note in llms.txt says so.
  • Serving Markdown on Accept: text/markdown would need a host other than GitHub Pages.
  • .github/workflows/daily-doc-updater.md was not changed (its .lock.yml is compiled). CI will now flag any page it adds without a description.

🤖 Generated with Claude Code

rithviknishad and others added 2 commits December 3, 2026 22:44
Every page now has a `description:` in its front matter: one sentence that
says what the page is or does. It becomes the page's meta description and
og:description, and the summary next to its link in /llms.txt.

Before this, no page had one, so Docusaurus used the first line of the
page. For 439 of the 564 links in /llms.txt that was just "Overview" or
"Definition", and search results showed the same word.

scripts/add_descriptions.py drafted them from each page's own first
sentence (flows' "This flow describes how to…" became "How to…"), and six
weak drafts were rewritten by hand. It never overwrites a description, and
--check lists the pages that have none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
llms.txt
- Sections, names and order now come from the sidebar's folders
  (plugins/llms-txt/route-rules.js), with headings such as
  "Flows › Clinical › Encounter" instead of URL slugs. Each page is
  listed once; before, each also had its own heading that repeated its
  description.
- A "How to use these docs" note after the summary: the .md URLs, what
  concepts, flows and references are, which version is listed, and that
  the code wins where they disagree.
- Left out: the generated /category pages, which only repeated links, and
  the Docusaurus template's example page (deleted).
- Context7 is listed under Optional.

Markdown copies of pages (plugins/llms-txt/clean-markdown.js)
- Fixes 106 links to pages whose route ends in a slash, which the plugin
  wrote as /apps/ai-vision/.md (a 404) instead of /apps/ai-vision.md.
- Drops the "#" heading anchors, base64 images (keeping their alt text)
  and table column padding. llms-full.txt goes from 7.1 MB to 5.1 MB.
- Labels embedded videos as videos, with a youtube.com/watch link.

Pages
- Each page of the latest English docs links to its Markdown copy with
  <link rel="alternate" type="text/markdown">, and has a "Copy page"
  button with "View as Markdown", "Open in Claude" and "Open in ChatGPT".
- robots.txt with the sitemap and a pointer to llms.txt.

Keeping it that way
- CI checks that every page has a description, and after the build that
  every Markdown link resolves (scripts/check_llms.py).
- The concept, flow and reference skills, their templates and
  Ezhuthachan's draft checks now ask for a description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying coredocs with  Cloudflare Pages  Cloudflare Pages

Latest commit: b7d096a
Status: ✅  Deploy successful!
Preview URL: https://5b58973a.coredocs.pages.dev
Branch Preview URL: https://claude-llms-txt-ai-readiness.coredocs.pages.dev

View logs

@rithviknishad
rithviknishad merged commit 5592fdb into main Dec 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant