Skip to content

Serve AI-Friendly Markdown Docs (llms.txt) from the Docs Site#343

Merged
Jeremy-Walton merged 5 commits into
mainfrom
op-240-serve-ai-friendly-markdown-docs-llmstxt-from-the-docs-site
Jul 15, 2026
Merged

Serve AI-Friendly Markdown Docs (llms.txt) from the Docs Site#343
Jeremy-Walton merged 5 commits into
mainfrom
op-240-serve-ai-friendly-markdown-docs-llmstxt-from-the-docs-site

Conversation

@zoopmaster

@zoopmaster zoopmaster commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Task

OP-240

Why?

The documentation site is a Storybook app, so AI coding assistants can't read it. Asking an assistant to look up a component's markup, token values, or customization patterns comes back empty. Serving the same documentation as plain markdown (the llms.txt convention) makes it readable by those tools without changing how the docs are written.

What Changed

  • Added a build step that converts every Storybook MDX docs page to plain markdown, with each Canvas embed replaced by the story's actual rendered HTML and each token doc block replaced by a table of token names and values
  • The docs site now serves llms.txt (an index of every page), llms-full.txt (the whole documentation in one file), and one markdown file per docs page
  • The generator runs automatically as part of the storybook and build-storybook scripts, so the files ship with the next docs deploy
  • Documented the new endpoints and build step in the README

Quality Assurance

  • Have you tagged the PR with the correct labels?
  • Have you validated the changes?
    • Have you run linters? (yarn sanity-check)
    • Have you run prettier?
    • Have you tried building the css?
    • Have you tried building storybook?
  • Have you updated any usage of changed tokens?
  • Did you add a component?
    • Have you added it to the dependency graph?
    • Have you added it to the docs?
  • Did you update a component?
    • Have you updated the dependency graph?
    • Have you updated the docs?
  • Do you need to update the package version?
    • Did you update the example pages in .storybook/assets?
  • Were any changes made to the top level optics.css file?
    • Were those changes reflected in the other top level files?

Screenshots

N/A, no UI changes. Sample generated output: https://docs.optics.rolemodel.design/llms.txt (live after the next docs deploy).

@zoopmaster zoopmaster requested a review from Jeremy-Walton July 15, 2026 04:01
@linear-code

linear-code Bot commented Jul 15, 2026

Copy link
Copy Markdown

OP-240

@Jeremy-Walton Jeremy-Walton added the documentation Improvements or additions to documentation label Jul 15, 2026
@Jeremy-Walton

Jeremy-Walton commented Jul 15, 2026

Copy link
Copy Markdown
Member

I'm more inclined to go down the context7 path along with utilizing or enhancing https://github.com/RoleModel/rolemodel-skills/tree/main/skills/optics-context

Potentially also move that skill into here so it lives alongside Optics code and could grow or expand with other skills specific to Optics.

I could see a world were we build out version migration skills, etc. Something similar to how impeccable has a top level skill with sub commands https://impeccable.style/

@Jeremy-Walton Jeremy-Walton force-pushed the op-240-serve-ai-friendly-markdown-docs-llmstxt-from-the-docs-site branch from f809bff to 8106366 Compare July 15, 2026 15:48
@Jeremy-Walton Jeremy-Walton merged commit c559089 into main Jul 15, 2026
4 checks passed
@Jeremy-Walton Jeremy-Walton deleted the op-240-serve-ai-friendly-markdown-docs-llmstxt-from-the-docs-site branch July 15, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Development

Successfully merging this pull request may close these issues.

2 participants