Skip to content

feat(docs): serve llms.txt and Markdown pages for agents - #159

Merged
sweepies merged 4 commits into
mainfrom
feat/docs-agent-discoverability
Nov 2, 2026
Merged

sweepies merged 4 commits into
mainfrom
feat/docs-agent-discoverability

Conversation

@sweepies

@sweepies sweepies commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Makes the docs site easier to find for search engines and easier to read for AI agents.

  • Descriptions: 31 of 36 pages had no description, so they all shared the site tagline as their meta description. Every page has its own now.
  • llms.txt: starlight-llms-txt generates llms.txt, llms-full.txt, llms-small.txt (leaves out internals and benchmarks) and one set per section. The details in llms.txt list every sidebar page with its description, linked to its Markdown copy.
  • Markdown per page: a small local Starlight plugin (docs/src/plugins/markdown-pages.mjs) writes <page>/index.md from the built HTML. No existing plugin fit: the ones that emit per-page Markdown convert from MDX source, which drops the ?raw-imported Pkl schemas on the two reference pages. Each page links its copy with <link rel="alternate" type="text/markdown">.
  • Accept: text/markdown: Workers static assets can't vary on Accept, and Cloudflare's Markdown for Agents needs a Pro zone. docs/worker.js runs before pages only (not _astro/ or pagefind/), serves the .md copy when text/markdown ranks at least as high as text/html, and adds Vary: Accept.
  • JSON-LD SoftwareApplication on the home page, and a Content-Signal line in robots.txt (search, ai-input and ai-train all allowed).

Tested locally with wrangler dev (Accept variants, q-values, the trailing-slash redirect, 404s and plain assets).

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

@socket-security

socket-security Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​starlight-llms-txt@​0.12.0991007489100
Addednpm/​unist-util-remove@​4.0.010010010082100
Addednpm/​remark-gfm@​4.0.19910010083100
Addednpm/​rehype-remark@​10.0.110010010083100
Addednpm/​rehype-parse@​9.0.110010010083100
Addednpm/​remark-stringify@​11.0.010010010083100

View full report

@deepsource-io

deepsource-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 8b00f4b...71850b6 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Rust Nov 2, 2026 11:15p.m. Review ↗
JavaScript Nov 2, 2026 11:15p.m. Review ↗
Shell Nov 2, 2026 11:15p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 42 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/src/content/docs/internals/engine.md">

<violation number="1" location="docs/src/content/docs/internals/engine.md:3">
P3: This description attributes exit-code handling to the engine, but the CLI determines exit codes from the engine’s `Result<Report>`. Clarify that distinction in the summary.</violation>
</file>

<file name="docs/src/content/docs/reference/environment.md">

<violation number="1" location="docs/src/content/docs/reference/environment.md:3">
P2: This description promises complete coverage, but the table omits `MISE_DATA_DIR` and `XDG_DATA_HOME`, which control where local runs find existing mise installs. Add those entries or narrow the description’s claim.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@@ -1,5 +1,6 @@
---
title: "Environment variables"
description: "Every environment variable patchula reads, which commands use it, and what it does."

@cubic-dev-ai cubic-dev-ai Bot Nov 2, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This description promises complete coverage, but the table omits MISE_DATA_DIR and XDG_DATA_HOME, which control where local runs find existing mise installs. Add those entries or narrow the description’s claim.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/src/content/docs/reference/environment.md, line 3:

<comment>This description promises complete coverage, but the table omits `MISE_DATA_DIR` and `XDG_DATA_HOME`, which control where local runs find existing mise installs. Add those entries or narrow the description’s claim.</comment>

<file context>
@@ -1,5 +1,6 @@
 ---
 title: "Environment variables"
+description: "Every environment variable patchula reads, which commands use it, and what it does."
 ---
 | Variable | Used by | Meaning |
</file context>
Fix with cubic

Comment thread docs/worker.js Resolved
@@ -1,5 +1,6 @@
---
title: "Batch engine"
description: "How the engine reads repositories, looks up updates, builds the report and exit codes, and writes branches."

@cubic-dev-ai cubic-dev-ai Bot Nov 2, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This description attributes exit-code handling to the engine, but the CLI determines exit codes from the engine’s Result<Report>. Clarify that distinction in the summary.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/src/content/docs/internals/engine.md, line 3:

<comment>This description attributes exit-code handling to the engine, but the CLI determines exit codes from the engine’s `Result<Report>`. Clarify that distinction in the summary.</comment>

<file context>
@@ -1,5 +1,6 @@
 ---
 title: "Batch engine"
+description: "How the engine reads repositories, looks up updates, builds the report and exit codes, and writes branches."
 ---
 `patchula-engine::Engine` takes a token, the shared SQLite cache, a
</file context>
Suggested change
description: "How the engine reads repositories, looks up updates, builds the report and exit codes, and writes branches."
description: "How the engine reads repositories, looks up updates, builds reports and writes branches, and how the CLI determines exit codes."
Fix with cubic

@context7

context7 Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Docs7 for sweepies/count-patchula

Result Status Action
Deployment ➖ Not used —
Content review ✅ Passed. No problems found. —

Commit e8b66fe

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula e8b66fe Commit Preview URL

Branch Preview URL
Nov 02 2026, 10:42 PM

@@ -1,5 +1,6 @@
---
title: "Environment variables"
description: "The environment variables patchula reads, which commands use each one, and what it does."

This comment was marked as outdated.

sweepies and others added 4 commits November 2, 2026 23:15
- Add page descriptions to the 31 pages that fell back to the site tagline.
- Generate llms.txt, llms-full.txt, llms-small.txt and per-section sets
  with starlight-llms-txt; llms.txt lists every page with its description.
- Write a Markdown copy of every page to <page>/index.md, converted from
  the built HTML so MDX components and the imported Pkl schemas survive,
  and link it from each page's head.
- Put a Worker in front of the pages that serves the Markdown copy to
  requests preferring text/markdown, with Vary: Accept.
- Add SoftwareApplication JSON-LD to the home page and content signals
  to robots.txt.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sweepies
sweepies force-pushed the feat/docs-agent-discoverability branch from e8b66fe to 71850b6 Compare November 2, 2026 23:15
@sweepies
sweepies merged commit f9d912e into main Nov 2, 2026
7 of 11 checks passed
@sweepies
sweepies deleted the feat/docs-agent-discoverability branch November 2, 2026 23:16
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