llms.txt
Generate or refresh llms.txt from the project's routes, sitemap, or docs navigation, write it to the static directory, and verify that every link resolves.
/llms-txt[site root or docs dir] [--full]A slash command that runs the llms-txt-generator procedure inside a project: it finds the page inventory (docs navigation, sitemap, route tree, or content folder), resolves the production origin, writes llms.txt to the static directory in the llmstxt.org shape, verifies every link, and on later runs refreshes the lists while keeping the hand-written header.
Install to ~/.claude/commands/llms-txt.md
npx agentscamp add commands/llms-txtCreate or refresh the project's llms.txt from what the project already knows about its pages. This command runs the same procedure as the llms-txt-generator skill, with the file-handling decided for you: it detects the framework, finds the page inventory, resolves the production origin, writes the file where the project serves static assets, and verifies the links. When a file already exists, it refreshes the link sections and leaves the header prose alone.
Scope
Interpret $ARGUMENTS as follows:
- Empty: the current directory is the site root. Use its framework config, sitemap, and content tree.
- A directory path: treat it as the site root if it holds a framework config or
public/; otherwise treat it as a docs subtree and list only the pages under it, still writing the file at the site root. --fullanywhere in the arguments: also writellms-full.txt, which inlines each page's Markdown body under its H1 with aSource:line.- If
public/llms.txt(or the equivalent static path) already exists, run in refresh mode: rebuild the link lists, keep the H1, blockquote, and prose, and report the diff.
If no inventory source can be found (no navigation config, no sitemap, no routes, no content folder), stop and say which paths were checked. Do not write a file from guesses.
Step 1 — Find the inventory
Check in this order and use the first that exists: a docs navigation config (mkdocs.yml, Docusaurus sidebars.*, Starlight sidebar in astro.config.*, VitePress themeConfig.sidebar); sitemap.xml in the static folder or a sitemap route (app/sitemap.ts); the route tree (app/**/page.*, src/pages/**); a content directory with frontmatter. Say which one you used; the navigation config wins because a person already grouped the pages.
Step 2 — Resolve the production origin
Every link must be absolute. Look for metadataBase in the Next.js root layout, site in astro.config.*, url or homepage in package.json, site_url in mkdocs.yml, or an existing sitemap's host. If none is found, ask for the origin once and stop until answered.
Step 3 — Build the file
Follow the llmstxt.org shape: # <site name>, one blockquote summary from the README or home page, optional short prose, then ## sections of - [Title](absolute-url): one-line description, and a final ## Optional section for secondary pages (changelog, legal, archived versions). Descriptions come from each page's own description, meta description, or first sentence. Pages with none are listed in the report, not described from imagination. Prefer a Markdown rendition of each page when the site serves one.
Step 4 — Write it
public/llms.txt for Next.js, Astro, Vite, and most static builders; static/llms.txt for Hugo and Gatsby; docs/llms.txt for MkDocs. If the project already generates the file from a route handler, edit the data it reads from instead of writing a static file, and say so. Before overwriting an existing file whose header prose would change, show the change and ask.
WARNING
List only pages you want quoted, and describe them truthfully. The file is a reading guide for models; a description that oversells a page becomes an answer somebody receives with your site's name on it.
Step 5 — Verify
If the site is live, check each link:
rg -o 'https?://[^) ]+' public/llms.txt | sort -u | while read -r u; do
printf '%s %s\n' "$(curl -s -o /dev/null -w '%{http_code}' "$u")" "$u"
done | rg -v '^200'If it is not live yet, map each URL back to a route or content file with Glob and report any that have no source. A link that fails verification is dropped from the file and listed in the report.
Step 6 — Report
## /llms-txt: <site name>
Mode: created | refreshed
Inventory: docs navigation (astro.config.mjs sidebar), 48 pages
Origin: https://orbit.example
Written: public/llms.txt (52 links, 4 sections + Optional)
Also written: public/llms-full.txt (184 KB) # only with --full
Verification: 52 links checked, 52 returned 200
Needs a description (listed without one, in Optional): 3
- /docs/internals/scheduler
- /docs/internals/cache
- /legal/dpa
Refresh diff: +4 added, -2 removed (moved to /docs/v2/…), 0 renamedNOTE
llmstxt.org is a proposal; whether a given assistant reads the file is up to that vendor. Treat this as a low-cost courtesy that keeps a curated map of the site current, and let the seo-specialist agent or the seo-technical-auditor skill handle the parts of search that do move rankings.
TIP
Run this after /update-readme when the README's summary changed; the blockquote comes from it. The full set of search and AI-search installables is in the best Claude skills for SEO.
Filed under
Related
- 9 Best Claude Skills for SEO (and AI Search)Compare Claude skills, commands, and agents for technical SEO audits, structured data, answer-engine readiness, llms.txt, content briefs, landing pages, Core Web Vitals, and brand voice.
- llms.txt GeneratorGenerate or refresh a site's llms.txt (and, on request, llms-full.txt) from its sitemap, route tree, docs navigation, or content directory, following the llmstxt.org conventions: an H1 with the site name, a blockquote summary, H2 sections of links each with a one-line description taken from the page's own metadata, and an Optional section for secondary pages. Use when a site or docs repository needs the file created, or an existing one checked against the pages that actually exist today.
- SEO SpecialistUse this agent to review a site or a set of pages for search and answer-engine performance and get one prioritized plan: it checks technical hygiene with the seo-technical-auditor skill, the match between each page's title, H1, and lead and the query it targets, title and meta wording, internal linking, answer-first structure with the geo-content-auditor skill, and structured data with the schema-markup-generator skill, then ranks the fixes by effect and effort. Read-only; it never edits a page or invents a search volume. Examples: "review our docs site for SEO and tell me what to fix first", "why does this guide rank but never get cited by AI Overviews", "audit the ten pages in this folder and give me a plan".
- SEO Technical AuditorAudit a website's source or built output (Next.js, Astro, or static HTML) for technical on-page and crawl hygiene: title and meta description length and uniqueness, self-referencing canonicals, one H1 and an unbroken heading hierarchy, presence of JSON-LD, sitemap and robots.txt, redirect chains, internal-link click depth, and image alt text, then return one findings table ordered by severity with the file or route to fix. Use when you want the crawl and markup plumbing checked across a whole site, not the quality of the writing or the correctness of the structured data.
- llms.txtllms.txt is a proposed Markdown file at a site's root that gives AI models a curated summary and link list, so they can find the right pages at inference time.
- Update READMEUpdate the README to reflect the current scripts, structure, and features of the repo.