Automatically generate llms.txt files and markdown versions of MDX/MD content following the llms.txt specification. Perfect for making documentation LLM-readable.
Automatically generate `llms.txt` files and markdown versions of all MDX/MD content files for LLM consumption, following the [llms.txt specification](https://llmstxt.org/).
This skill uses the `get-llms-txt` npm package to:
1. Scan a content directory for `.mdx` and `.md` files
2. Extract metadata (title, description, tags) from files
3. Convert MDX files to plain markdown (removes JSX components)
4. Generate individual `.md` files in an output directory
5. Create a high-level `llms.txt` index file with categorized content
The resulting files make your documentation easily consumable by LLMs.
When the user requests to generate LLM-friendly documentation or create an `llms.txt` file:
First, check if `get-llms-txt` is already installed in the project:
```bash
npm list get-llms-txt
```
If not installed, install it as a dev dependency:
```bash
npm install --save-dev get-llms-txt
```
Ask the user or search the project to identify where markdown/MDX content files are located. Common locations:
If unclear, ask the user: "Where are your markdown/MDX content files located?"
Identify or ask where the generated files should go:
Execute the command with appropriate options:
**Basic usage:**
```bash
npx get-llms-txt --content-dir ./content --output-dir ./public
```
**With base URL (recommended for production):**
```bash
npx get-llms-txt --content-dir ./content --output-dir ./out --base-url https://example.com
```
**With custom project metadata:**
```bash
npx get-llms-txt --content-dir ./docs --output-dir ./public --project-name "My Docs" --project-description "Technical documentation for My Project"
```
After running, verify that files were created:
1. Check for `llms.txt` in the output directory
2. Check for `md/` subdirectory with converted markdown files
3. Report to the user what was generated
If the user wants this automated, add it to their build scripts in `package.json`:
```json
{
"scripts": {
"build": "next build && npx get-llms-txt --output-dir ./out",
"build:prod": "next build && npx get-llms-txt --output-dir ./out --base-url https://example.com"
}
}
```
The tool handles:
```
<output-dir>/
├── llms.txt # Main index file
└── md/ # Converted markdown files
├── blog/
├── docs/
└── ...
```
**User:** "Generate llms.txt for my Next.js blog"
**Response:**
1. Check if `get-llms-txt` is installed
2. Identify content directory (e.g., `./content`)
3. Run: `npx get-llms-txt --content-dir ./content --output-dir ./public --project-name "My Blog"`
4. Report: "Generated llms.txt and 15 markdown files in ./public/md/"
**User:** "Add this to my build process"
**Response:**
1. Edit `package.json`
2. Add to build script: `&& npx get-llms-txt --output-dir ./out`
3. Confirm the change
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/generate-llm-friendly-documentation/raw