Generate llms.txt and llms-full.txt files for a website to improve AI discoverability. Use when the user asks to create llms.txt, generate llms.txt, fix llms.txt, make site AI-readable, or mentions llms.txt generation.
You generate specification-compliant llms.txt and llms-full.txt files that help AI systems understand and cite a website's content. The output follows the llmstxt.org proposed standard.
Refer to references/llmstxt-spec.md in this skill's directory for the full specification reference.
Extract the target URL from the user's input. Normalize it:
https:// if no protocol specifiedFetch these URLs to check if llms.txt already exists:
{url}/llms.txt
{url}/.well-known/llms.txt
If found:
If not found:
Fetch the homepage to extract:
<title>, <meta property="og:site_name">, or <h1>)<meta name="description"> or <meta property="og:description">)Try these locations in order:
{url}/sitemap.xml{url}/sitemap_index.xml{url}/robots.txt for Sitemap: directiveFrom the sitemap, build a categorized page inventory:
Fetch up to 15 key pages from the inventory to extract:
Rate limiting: Wait 1 second between requests to the same domain.
From the collected data, determine:
| Field | Source Priority |
|---|---|
| Site name | og:site_name > title tag > H1 > domain |
| Summary | meta description > og:description > first paragraph |
| Primary purpose | Navigation structure + content analysis |
| Key topics | H1/H2 headings across pages, meta keywords |
Group pages into llms.txt sections. Use these default categories, but adapt based on actual site structure:
| Category | H2 Section Name | Content Types |
|---|---|---|
| Documentation | ## Docs | Help articles, guides, tutorials, API docs |
| Blog / Articles | ## Blog | Blog posts, news, case studies |
| Products / Services | ## Products or ## Services | Product pages, pricing, features |
| API | ## API | API reference, endpoints, SDKs |
| Company | ## About | About, team, careers, press |
| Legal | ## Legal | Privacy policy, terms, cookies |
Rules:
For each page entry, write a concise description (under 100 characters) that:
Good: Core REST API endpoints for user management and authentication
Bad: Our amazing API documentation
Mark sections as ## Optional if they are:
Create the file following this structure strictly:
# {Site Name}
> {One-paragraph summary: what the site/company does, who it serves, key offerings. 2-4 sentences. Factual and specific.}
{Optional additional context paragraph: technology stack, industry, scale, notable achievements. Only if genuinely useful for AI understanding.}
## Docs
- [{Page Title}]({URL}): {Concise description}
- [{Page Title}]({URL}): {Concise description}
## API
- [{Page Title}]({URL}): {Concise description}
## Blog
- [{Page Title}]({URL}): {Concise description}
## About
- [{Page Title}]({URL}): {Concise description}
## Optional
- [{Page Title}]({URL}): {Concise description}
Format rules:
- [Title](URL): Description formatCreate an expanded version that includes actual page content:
# {Site Name}
> {Same summary as llms.txt}
{Same additional context as llms.txt}
## Docs
### {Page Title}
{URL}
{Full page content converted to clean Markdown: headings, paragraphs, lists, code blocks. Strip navigation, footers, ads, sidebars. Keep only main content.}
---
### {Page Title}
{URL}
{Full page content...}
---
## Blog
### {Article Title}
{URL}
{Full article content...}
Content cleaning rules:
Create two files in the current working directory:
llms.txtllms-full.txtIf an existing llms.txt was found in Phase 1.2, analyze and improve it:
Check against the spec:
[Title](URL): Description formatCompare existing llms.txt against the site's actual content:
Create llms.txt.improved with:
Print a diff summary showing what changed and why.
After generating, print:
llms.txt generated for {domain}
Files created:
llms.txt — {line_count} lines, {section_count} sections, {link_count} links
llms-full.txt — {line_count} lines, {page_count} pages included
Sections:
{section_name}: {link_count} links
{section_name}: {link_count} links
...
Installation:
Place both files at your domain root:
- https://{domain}/llms.txt
- https://{domain}/llms-full.txt
Or at the well-known path:
- https://{domain}/.well-known/llms.txt
Add to robots.txt (optional):
Sitemap: https://{domain}/llms.txt