llms — Claude Code command: generate llms.txt for your project
Writes llms.txt and llms-full.txt from your project wiki: a short link index plus a full version with page text inlined.
.claude/commands/llms.mdWhat llms does
The command walks the repository and the wiki that already exists, collecting the project name, a one-line description, languages and technologies, every .md file under wiki/, guides in onboarding/, and the README. It then writes two files into wiki/. The first stays small: links with a sentence of explanation each. The second keeps the same skeleton but drops whole pages into <doc> blocks carrying title and path attributes.
Before any generation it settles where the source lives. It runs git remote get-url origin and asks whether the repository is local-only or has a URL. That answer decides the link style: absolute REPO_URL/blob/BRANCH/path or relative paths into the wiki. The branch comes from git rev-parse --abbrev-ref HEAD. Nothing is written until this is resolved, so in a checkout with no remote configured the command opens with a question instead of output.
Structure follows the llms.txt spec: a single H1, a blockquote summary, H2 sections holding [Title](url): description lists. An “Optional” section marks links a tool may skip to save context. Section names come from the actual wiki catalogue rather than a fixed template. In llms-full.txt the VitePress frontmatter is stripped from inlined pages, while tables, Mermaid diagrams and [file:line](URL) citations survive untouched.
What it helps with
- give a coding agent a compact map of the project wiki
- hand over the whole documentation as one file
- group wiki pages into sections with useful descriptions
- point links at the right repository URL and branch
- catch links that lead to files no longer in the wiki
Example prompts for the agent
- Generate
llms.txtandllms-full.txtfor this project's wiki - Build
llms.txtfrom the pages inwiki/, keep links relative - Refresh
llms-full.txtwith full page content inside<doc>blocks
How to install llms
Manually: put the files in place
.claude/commands/llms.mdCall it with /llms. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/llms.mdCall it with /prompts:llms. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/llms.prompt.mdManually: put the files in place
.gemini/commands/llms.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about llms
How do I install llms in Claude Code?
Place the command file at .claude/commands/llms.md and /llms becomes available in Claude.
What does the llms command do?
It produces llms.txt with links to your wiki pages and llms-full.txt with their full content, following the llms.txt specification.
What has to happen before it runs?
The source repository has to be resolved. The command checks git remote get-url origin and asks whether the repo is local-only or has a URL; it does not proceed until that is settled.
Source text
llms.md · MIT
---
description: Generate llms.txt and llms-full.txt files for the wiki — LLM-friendly project summaries following the llms.txt specification
---
# Deep Wiki: Generate llms.txt
You are generating `llms.txt` and `llms-full.txt` files that provide LLM-friendly access to the wiki documentation. These follow the [llms.txt specification](https://llmstxt.org/).
## Source Repository Resolution (MUST DO FIRST)
Before generating, resolve the source repository context:
1. **Check for git remote**: Run `git remote get-url origin`
2. **Ask the user**: _"Is this a local-only repository, or do you have a source repository URL?"_
- Remote URL → store as `REPO_URL`, use linked references: `[Title](REPO_URL/blob/BRANCH/path)`
- Local → use relative paths to wiki files
3. **Determine default branch**: Run `git rev-parse --abbrev-ref HEAD`
4. **Do NOT proceed** until resolved
## What is llms.txt
`llms.txt` is a standardized markdown file that helps LLMs quickly understand a project. It provides:
- A concise project summary
- Links to key documentation files with brief descriptions
- Structured sections (Onboarding, Architecture, API, etc.)
Two files are generated:
| File | Purpose | Size |
|------|---------|------|
| `llms.txt` | Links + brief descriptions — fits in small context windows | Small (1-5 KB) |
| `llms-full.txt` | Full inlined content of all linked pages | Large (50-500 KB) |
## Step 1: Gather Project Context
Scan the repository and existing wiki (if generated) to collect:
1. **Project identity** — name, one-sentence description, primary language, key technologies
2. **Wiki pages** — scan `wiki/` directory for all generated `.md` files
3. **Onboarding guides** — check for `onboarding/` folder with audience-tailored guides
4. **README** — extract the core project description
5. **Key entry points** — main files, API surface, configuration
## Step 2: Generate `llms.txt`
Create `wiki/llms.txt` following the llms.txt spec format:
```markdown
# {Project Name}
> {One-paragraph summary: what it does, who it's for, key technologies. Dense and informative.}
{2-3 paragraphs of important context: architectural philosophy, key constraints, what makes this project different. Include things an LLM needs to know to give accurate answers about this project.}
## Onboarding
- [{Contributor Guide}](./onboarding/contributor-guide.md): Step-by-step guide for new contributors — environment setup, first task, testing, and coding conventions
- [{Staff Engineer Guide}](./onboarding/staff-engineer-guide.md): Architectural deep-dive for senior engineers — design decisions, domain model, component types, and failure modes
- [{Executive Guide}](./onboarding/executive-guide.md): Capability overview for engineering leaders — risk assessment, technology investment, and scaling model
- [{Product Manager Guide}](./onboarding/product-manager-guide.md): Feature-focused guide for PMs — user journeys, capabilities, limitations, and data/privacy
## Architecture
- [{Architecture Overview}](./02-architecture/overview.md): System architecture, component boundaries, and deployment topology
- [{Data Model}](./02-architecture/data-model.md): Core entities, relationships, and data invariants
- [{API Reference}](./02-architecture/api-reference.md): Endpoints, authentication, and wire format
## Getting Started
- [{Setup Guide}](./01-getting-started/setup.md): Prerequisites, installation, and first run
- [{Configuration}](./01-getting-started/configuration.md): Environment variables, feature flags, and config files
## Deep Dive
- [{Component Name}](./03-deep-dive/component.md): Description of component purpose and scope
- ...additional pages...
## Optional
- [{Changelog}](./changelog.md): Recent changes and version history
- [{Contributing}](./contributing.md): How to contribute to the project
```
### llms.txt Rules
1. **H1** — Project name (REQUIRED, only one)
2. **Blockquote** — Dense one-paragraph summary (REQUIRED)
3. **Context paragraphs** — Important notes, constraints, non-obvious things (optional but recommended)
4. **H2 sections** — Each contains a markdown list of `[Title](url): Description` entries
5. **"Optional" section** — Special meaning: these links can be skipped for shorter context. Put changelog, contributing guides, and supplementary material here.
6. **All links are relative** to the wiki directory (e.g., `./onboarding/contributor-guide.md`)
7. **Descriptions are concise** — one sentence per link, informative not generic
8. **Order matters** — put the most important sections first (Onboarding → Architecture → Getting Started → Deep Dive → Optional)
9. **Dynamic content** — derive ALL section names and page titles from the actual generated wiki catalogue, not from templates
### Content Quality
- The blockquote summary should be **dense and specific** — not "A project for doing things" but "A distributed task orchestration engine built on Orleans virtual actors, providing reliable workflow execution with at-least-once delivery guarantees for Azure-hosted microservices"
- Context paragraphs should include **non-obvious constraints** — things an LLM would get wrong without being told (e.g., "Although the API surface resembles FastAPI, it uses a custom router that does not support dependency injection")
- Link descriptions should tell the reader **what they'll learn**, not just restate the title
## Step 3: Generate `llms-full.txt`
Create `wiki/llms-full.txt` — same structure as `llms.txt` but with full page content inlined using XML-style tags.
### Format
```markdown
# {Project Name}
> {Same blockquote summary as llms.txt}
{Same context paragraphs as llms.txt}
## Onboarding
<doc title="{Contributor Guide}" path="onboarding/contributor-guide.md">
{Full markdown content of contributor-guide.md}
</doc>
<doc title="{Staff Engineer Guide}" path="onboarding/staff-engineer-guide.md">
{Full markdown content of staff-engineer-guide.md}
</doc>
...
## Architecture
<doc title="{Architecture Overview}" path="02-architecture/overview.md">
{Full markdown content of overview.md}
</doc>
...
## Optional
<doc title="{Changelog}" path="changelog.md">
{Full markdown content of changelog.md}
</doc>
```
### llms-full.txt Rules
1. **Same H1, blockquote, and context** as `llms.txt`
2. **Replace link lists** with `<doc>` blocks containing full page content
3. **Each `<doc>` tag** has `title` and `path` attributes
4. **Strip VitePress frontmatter** (YAML `---` blocks) from inlined content
5. **Preserve Mermaid diagrams** — keep them as-is inside `<doc>` blocks
6. **Preserve citations** — all `[file:line](URL)` links stay intact
7. **Preserve tables** — all markdown tables stay intact
8. **Same section order** as `llms.txt`
9. **"Optional" section** — still present but readers/tools may skip it for context savings
## Step 4: Validate
After generating both files, verify:
1. **All links in `llms.txt` point to files that exist** in the wiki directory
2. **All `<doc>` blocks in `llms-full.txt` contain actual content** (not empty or placeholder)
3. **The blockquote summary is specific** to this project (not generic)
4. **Section ordering** matches: Onboarding → Architecture → Getting Started → Deep Dive → Optional
5. **No duplicate entries** — each wiki page appears in exactly one section
6. **File sizes are reasonable** — `llms.txt` should be 1-5 KB, `llms-full.txt` should contain all wiki pages
## Output
Generate three files:
```
./llms.txt # Root-level discovery file (repo standard path)
wiki/
├── llms.txt # Links + descriptions (for VitePress site)
└── llms-full.txt # Full inlined content (comprehensive reference)
```
### Root `./llms.txt` (Discovery File)
The root `./llms.txt` is the **standard discovery location** per the llms.txt spec. Coding agents and tools (including the GitHub MCP server's `get_file_contents` and `search_code`) look for `/llms.txt` at the repository root. This file should be identical to `wiki/llms.txt` but with paths adjusted to point into the `wiki/` directory:
```markdown
- [{Page Title}](./wiki/onboarding/contributor-guide.md): Description
```
If a root `llms.txt` already exists and was NOT generated by deep-wiki, do NOT overwrite it — report that it was skipped.
Report a summary:
```
## llms.txt Generation Report
- `./llms.txt` — Root discovery file, {N} sections, {M} linked pages
- `wiki/llms.txt` — {N} sections, {M} linked pages, {size} KB
- `wiki/llms-full.txt` — {N} sections, {M} inlined pages, {size} KB
### Sections
| Section | Pages | Notes |
|---------|-------|-------|
| Onboarding | 4 | All audience-tailored guides |
| Architecture | 3 | Core architecture pages |
| Getting Started | 2 | Setup and configuration |
| Deep Dive | {N} | Component documentation |
| Optional | {N} | Changelog, contributing |
```
$ARGUMENTS
© microsoft · MIT · microsoft/skills