Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Jan 6, 2026

Related issue: #30774 (comment) #31933 (comment) #32660

Summary

Adds llms.txt files following the llms.txt specification to help LLMs generate correct, modern Three.js code.

What this does

  • Guides LLMs to use import maps instead of old CDN patterns
  • Includes current version number (@0.182.0) in import examples
  • Explains when to use WebGLRenderer vs WebGPURenderer
  • Provides TSL (Three.js Shading Language) documentation inline
  • Generates markdown versions of all API docs for on-demand access

Files

File Purpose
/llms.txt Pointer to docs versions
/docs/llms.txt Instructions + curated API links (~5KB)
/docs/llms-full.txt Full TSL spec + categorized doc list (~125KB)
/docs/pages/*.html.md 766 API pages in markdown format
/utils/llms/build.js Generator script

Build integration

  • npm run build-llms - Generates all llms.txt files
  • npm run build-docs - Now runs build-llms after JSDoc

Dependencies

  • Added turndown for HTML→Markdown conversion

@mrdoob mrdoob added this to the r183 milestone Jan 6, 2026
@mrdoob mrdoob requested review from Mugen87 and sunag January 6, 2026 01:45
@mrdoob
Copy link
Owner Author

mrdoob commented Jan 6, 2026

@sunag This PR moves wiki/TSL.md to docs/TSL.md.

@mrdoob
Copy link
Owner Author

mrdoob commented Jan 6, 2026

@marwie Ended up doing a different approach than #32660. What do you think?

@sunag
Copy link
Collaborator

sunag commented Jan 6, 2026

Amazing! 🚀

@mrdoob
Copy link
Owner Author

mrdoob commented Jan 6, 2026

@harshpreet931 @Makio64 Looks good?

@harshpreet931
Copy link

@mrdoob looks amazing 💯

@Makio64
Copy link
Contributor

Makio64 commented Jan 6, 2026

My friends Claude & Gemini will be very happy with that update!

Looks good, lets test it ! Thanks!

@RenaudRohlinger
Copy link
Collaborator

Why not use the jsdoc to generate the md files instead? There is already an extraction steps which would fit perfectly for generating llms and md.

@marwie
Copy link
Contributor

marwie commented Jan 6, 2026

@mrdoob Thanks for driving this forward. Some thoughts:

  1. I love to append a .md extension to the URL to get the markdown format like in my PR here. The change is quite small so it should be OK to add support? Alternatively a little link at the bottom of the HTML page to open the markdown file/copy markdown url comes to mind.

  2. The llms.txt file should probably point to the markdown file instead of the HTML file since it's meant to be read / fetched by the LLMs right (see e.g. svelte.llms.txt or stripe.llms.txt)

  3. Should there be some sitemap.xml or maybe all pages linked in the llms.txt to the individual markdown files? (maybe separated by sub-llms.txt, again as svelte does it, for addons / core / tsl, to keep the size reasonable, altough e.g. stripe also doesn't do that so maybe not an issue). Otherwise I'm wondering if these individual .md pages will even be discovered/used by an LLM?

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.

8 participants