-
Notifications
You must be signed in to change notification settings - Fork 7.8k
feat: Add llms.txt support for AI-friendly documentation #8130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Fixes reactjs#8117 Adds llms.txt and llms-full.txt generation following https://llmstxt.org/ spec to ensure AI models can access the latest React documentation. - llms.txt: 13KB hierarchical link index (167 pages) - llms-full.txt: 2.7MB full embedded documentation Generated from sidebar configs and markdown content at build time. Integrated into build pipeline via package.json scripts.
|
Hi @artimath! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Size changes📦 Next.js Bundle Analysis for react-devThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
|
CLA signed. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Awesome, thank you! I'm not sure about the llms-full.txt version. I feel like if we provide this, we really should optimize it for LLM consumption, as no one is going to load the entire set of docs into context? What if we revert that and just go with the llms.txt? |
Having both and let developers decide which one to feed to their AIs is probably better than not giving them the option to choose. NextJS for instance has a very big llms-full.txt too. |
|
Yeah but it's formatted a bit better. I'm not saying we shouldn't ever have it, but it would be better to wait for the full version when we can do more than just dump the markdown files. |
Fixes #8117
Summary
Adds `llms.txt` and `llms-full.txt` generation following the llms.txt specification to ensure AI models can access the latest React documentation with proper structure and metadata.
What's Included
Two file formats generated at build time:
Both files are automatically generated from:
Implementation Details
Testing
Verified locally that:
Files Changed