add llms.txt and llms-full.txt for LLM agent consumption #12
Labels
No labels
bug
contribution welcome
duplicate
enhancement
good first issue
help wanted
invalid
question
upstream
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
marvin8/longwei#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
LLM agents consuming this library have no machine-friendly entry point to the documentation. Adding two files addresses this:
llms.txt— a lightweight index (llmstxt.org standard) listing all doc pages with short descriptions, placed at the site root.llms-full.txt— the complete documentation concatenated into a single plain-text file, generated at build time via a MkDocs hook.Both are served at the root of the versioned docs site (e.g.
/latest/llms.txt) so LLM tools can fetch the full context in one request rather than crawling individual pages.Exploration findings:
docs_hooks.pyhas one hook (on_config) that updates the copyright year — good pattern to follow foron_post_build._flatten_navjust needs to extract values from the list of single-key dicts..txtfiles indocs/are copied as-is tosite_dirby MkDocs (no processing), sollms.txtcan live there as a static file.site_dirto the versioned path, so both files will land at.../latest/llms.txtand.../latest/llms-full.txtautomatically.Plan of attack:
tests/test_docs_hooks.py(TDD RED): mock config with temp dirs, callon_post_build, assertllms-full.txtis generated in correct order.docs/llms.txt(hand-written, llmstxt.org format, links uselatestalias).docs_hooks.pywithon_post_build+ private_flatten_navhelper that extracts file paths from the nav list.