/llm-txt
生成 llm.txt 文件(用于 LLM 爬虫)
$ npx -y skills add huifer/claude-code-seo --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/llm-txt
Context preview
What this command does when you run it.
生成 llm.txt 文件(用于 LLM 爬虫)
Command definition
llm-txt.mddescription: 生成 llm.txt 文件(用于 LLM 爬虫)
argument-hint: [--verbose]
生成 llm.txt 文件,帮助 AI/LLM 爬虫(如 GPTBot, ClaudeBot, Perplexity)更好地理解和索引网站内容。llm.txt 类似于 robots.txt,但是专门为 LLM 爬虫设计的协议。
功能
- ✅ 生成标准的 llm.txt 文件
- ✅ 提供 LLM 爬虫许可和指引
- ✅ 描述网站内容和结构
- ✅ 列出重要页面链接
- ✅ 指定内容授权和使用范围
- ✅ 帮助 AI 更准确地引用和展示网站内容
参数
- `--verbose`: 生成更详细的描述(可选)
- 包含更详细的内容说明
- 添加更多重要页面链接
- 提供内容类型和格式说明
背景
**什么是 llm.txt?**
llm.txt 是一个新兴的标准,类似于 robots.txt,但是专门为 AI/LLM 爬虫设计的。它:
- 告诉 LLM 爬虫哪些内容可以被使用
- 提供网站上下文和内容摘要
- 帮助 AI 更准确地理解和引用内容
- 指定内容使用的授权范围
**为什么需要 llm.txt?**
1. **AI 引用准确性** - 帮助 AI 正确引用来源 2. **内容可见性** - 控制 LLM 是否可以索引你的内容 3. **品牌保护** - 确保内容被正确呈现 4. **流量引导** - 引导用户回到原始来源
使用示例
示例 1:基本用法
/llm-txt
输出:
# llm.txt 文件
为你的 Next.js 项目生成的 llm.txt 文件:
```txt
# LLM Crawler Directives
# Allow LLM crawlers to index this site
User-agent: *
Allow: /
# Site Information
Name: YourBrand
Description: [网站描述 - 1-2 句话]
Website: https://yourdomain.com
Language: zh-CN, en-US
# Content Scope
Topics: [主要话题列表]
Content-Type: blog, documentation, tutorials
# Important Pages
Homepage: https://yourdomain.com
About: https://yourdomain.com/about
Blog: https://yourdomain.com/blog
# Attribution Requirements
Require-Attribution: true
Attribution-URL: https://yourdomain.com
# License
License: https://yourdomain.com/license
Content-Use: educational, informational
# Contact
Contact-Email: contact@yourdomain.com
文件位置
将此文件放置在项目根目录的 `public/` 文件夹中:
**路径:** `public/llm.txt`
复制上面的内容到 `public/llm.txt` 文件。
验证
创建后,访问 `https://yourdomain.com/llm.txt` 验证文件可访问。
填写说明
Name(网站名称)
- 你的品牌或网站名称
- 示例:`SF Plumbing Services` 或 `Tech Blog`
Description(网站描述)
- 1-2 句话描述你的网站
- 清晰简洁,包含主要话题
- 示例:`提供专业的管道维修和维护服务,覆盖旧金山湾区。包括紧急维修、预防性维护和管道安装服务。`
Topics(主要话题)
- 逗号分隔的话题列表
- 示例:`plumbing, emergency services, home maintenance, DIY tutorials`
Content-Type(内容类型)
- 主要内容类型
- 常见类型:blog, documentation, tutorials, news, products, services
Important Pages(重要页面)
- 列出你希望 LLM 了解的关键页面
- 包含:关于页面、主要服务页面、重要文章
Require-Attribution(要求归属)
- `true` - 要求 AI 引用时提供链接
- `false` - 不要求
License(许可证)
- 指向你的内容许可证页面
- 可以是标准许可证(如 CC BY)
- 或自定义许可证
Content-Use(内容使用范围)
- 允许的使用场景
- 示例:`educational, informational`
- 或 `all`(允许所有用途)
### 示例 2:详细模式
```bash
/llm-txt --verbose
输出:
# llm.txt 文件(详细版)
```txt
# LLM Crawler Directives
# Allow LLM crawlers to index this site
User-agent: *
Allow: /
# Disallow admin and private areas
Disallow: /admin/
Disallow: /api/
Disallow: /private/
# Site Information
Name: YourBrand
Description: YourBrand 是一个专注于 [主题] 的权威网站。我们提供 [服务类型],帮助 [目标受众] [解决问题]。内容包括 [内容类型],旨在 [目标]。
Website: https://yourdomain.com
Language: zh-CN, en-US
Founded: 2020
# Content Scope
Topics: [话题 1], [话题 2], [话题 3], [话题 4]
Content-Type: blog posts, tutorials, guides, case studies
Target-Audience: [受众描述]
Update-Frequency: Weekly
# Important Pages
Homepage: https://yourdomain.com
About: https://yourdomain.com/about
Blog: https://yourdomain.com/blog
Services: https://yourdomain.com/services
Contact: https://yourdomain.com/contact
# Featured Content
Featured-Article-1: https://yourdomain.com/blog/[article-1] - [描述]
Featured-Article-2: https://yourdomain.com/blog/[article-2] - [描述]
Featured-Guide: https://yourdomain.com/guides/[guide] - [描述]
# Content Guidelines
Content-Style: Professional, educational, practical
Tone: Informative, helpful, expert
Accuracy: All content is fact-checked and regularly updated
# Attribution Requirements
Require-Attribution: true
Attribution-URL: https://yourdomain.com
Attribution-Text: "Source: YourBrand (https://yourdomain.com)"
# License
License: https://yourdomain.com/license
Content-License: Creative Commons Attribution 4.0 International (CC BY 4.0)
Content-Use: educational, informational, with attribution
Commercial-Use: Contact for permission
# Contact
Contact-Email: contact@yourdomain.com
Contact-Form: https://yourdomain.com/contact
Social-Media: https://twitter.com/yourbrand, https://linkedin.com/company/yourbrand
# Additional Information
Last-Updated: 2024-01-15
API-Documentation: https://yourdomain.com/api-docs
RSS-Feed: https://yourdomain.com/feed.xml
详细字段说明
Site Information(网站信息)
**Description(详细描述):**
- 2-3 句话详细描述
- 包含:你是谁,你提供什么,你的目标
- 示例:`SF Plumbing Services 是旧金山湾区的专业管道维修公司。我们提供 24/7 紧急管道服务、预防性维护和管道安装。我们的团队由持证专业管道工组成,拥有超过 15 年的服务经验。`
**Language(语言):**
- 主要语言代码
- 可以是多个:`zh-CN, en-US, es-ES`
**Founded(成立时间):**
- 网站或公司成立年份
- 帮助 AI 理解内容的时间背景
Content Scope(内容范围)
**Target-Audience(目标受众):**
- 描述你的主要受众
- 示例:`Homeowners, property managers, DIY enthusiasts`
**Update-Frequency(更新频率):**
- 内容更新频率
- 示例:`Daily`, `Weekly`, `Monthly`
**Content-Style(内容风格):**
- 内容的专业程度和风格
- 示例:`Professional, educational, practical`
Featured Content(精选内容)
列出你希望 AI 特别关注的内容:
Featured-Article-1: https://yourdomain.com/blog/seo-guide - Complete SEO guide for beginners
Featured-Article-2: https://yourdomain.com/blog/ai-trends - AI trends in 2024
Featured-Guide: https://yourdomain.com/guides/plumbing-diy - DIY plumbing maintenance guide
Content Guidelines(内容指南)
**Accuracy(准确性):**
- 说明内容质量和准确性
- 示例:`All content is fact-checked and regularly updated`
**Tone(语调):**
- 内容的语调风格
- 示例:`Informative, helpful, expert-friendly`
License(许可证)
**Content-License(内容许可证):**
- 可以使用标准许可证:
- `CC BY 4.0` - Creative Commons Attribution
- `CC BY-NC 4.0` - Non-commercial only
- `CC BY-SA 4.0` - ShareAlike
- `All Rights Reserved` - 保留所有权利
**Commercial-Use(商业使用):**
- `Allowed` - 允许商业使用
- `Contact for permission` - 需要联系许可
- `Not allowed` - 不允许商业使用
Additional Information(附加信息)
**API-Documentation(API 文档):**
- 如果提供 API,列出文档链接
**RSS-Feed(RSS 订阅):**
- 帮助爬虫发现内容更新
**Last-Updated(最后更新):**
- llm.txt 文件的最后更新日期
### 示例 3:博客网站
```bash
/llm-txt --verbose
输出(针对博客):
# llm.txt for Blog
```txt
# LLM Crawler Directives
# Allow LLM crawlers
User-agent: *
Allow: /
# Site Information
Name: Tech Insights Blog
Description: Tech Insig
Read more
description: 生成 llm.txt 文件(用于 LLM 爬虫) argument-hint: [--verbose]
生成 llm.txt 文件,帮助 AI/LLM 爬虫(如 GPTBot, ClaudeBot, Perplexity)更好地理解和索引网站内容。llm.txt 类似于 robots.txt,但是专门为 LLM 爬虫设计的协议。
功能
- ✅ 生成标准的 llm.txt 文件
- ✅ 提供 LLM 爬虫许可和指引
- ✅ 描述网站内容和结构
- ✅ 列出重要页面链接
- ✅ 指定内容授权和使用范围
- ✅ 帮助 AI 更准确地引用和展示网站内容
参数
- `--verbose`: 生成更详细的描述(可选)
- 包含更详细的内容说明
- 添加更多重要页面链接
- 提供内容类型和格式说明
背景
**什么是 llm.txt?**
llm.txt 是一个新兴的标准,类似于 robots.txt,但是专门为 AI/LLM 爬虫设计的。它:
- 告诉 LLM 爬虫哪些内容可以被使用
- 提供网站上下文和内容摘要
- 帮助 AI 更准确地理解和引用内容
- 指定内容使用的授权范围
**为什么需要 llm.txt?**
1. **AI 引用准确性** - 帮助 AI 正确引用来源 2. **内容可见性** - 控制 LLM 是否可以索引你的内容 3. **品牌保护** - 确保内容被正确呈现 4. **流量引导** - 引导用户回到原始来源
使用示例
示例 1:基本用法
/llm-txt
输出:
# llm.txt 文件 为你的 Next.js 项目生成的 llm.txt 文件: ```txt # LLM Crawler Directives # Allow LLM crawlers to index this site User-agent: * Allow: / # Site Information Name: YourBrand Description: [网站描述 - 1-2 句话] Website: https://yourdomain.com Language: zh-CN, en-US # Content Scope Topics: [主要话题列表] Content-Type: blog, documentation, tutorials # Important Pages Homepage: https://yourdomain.com About: https://yourdomain.com/about Blog: https://yourdomain.com/blog # Attribution Requirements Require-Attribution: true Attribution-URL: https://yourdomain.com # License License: https://yourdomain.com/license Content-Use: educational, informational # Contact Contact-Email: contact@yourdomain.com
文件位置
将此文件放置在项目根目录的 `public/` 文件夹中:
**路径:** `public/llm.txt`
复制上面的内容到 `public/llm.txt` 文件。
验证
创建后,访问 `https://yourdomain.com/llm.txt` 验证文件可访问。
填写说明
Name(网站名称)
- 你的品牌或网站名称
- 示例:`SF Plumbing Services` 或 `Tech Blog`
Description(网站描述)
- 1-2 句话描述你的网站
- 清晰简洁,包含主要话题
- 示例:`提供专业的管道维修和维护服务,覆盖旧金山湾区。包括紧急维修、预防性维护和管道安装服务。`
Topics(主要话题)
- 逗号分隔的话题列表
- 示例:`plumbing, emergency services, home maintenance, DIY tutorials`
Content-Type(内容类型)
- 主要内容类型
- 常见类型:blog, documentation, tutorials, news, products, services
Important Pages(重要页面)
- 列出你希望 LLM 了解的关键页面
- 包含:关于页面、主要服务页面、重要文章
Require-Attribution(要求归属)
- `true` - 要求 AI 引用时提供链接
- `false` - 不要求
License(许可证)
- 指向你的内容许可证页面
- 可以是标准许可证(如 CC BY)
- 或自定义许可证
Content-Use(内容使用范围)
- 允许的使用场景
- 示例:`educational, informational`
- 或 `all`(允许所有用途)
### 示例 2:详细模式 ```bash /llm-txt --verbose
输出:
# llm.txt 文件(详细版) ```txt # LLM Crawler Directives # Allow LLM crawlers to index this site User-agent: * Allow: / # Disallow admin and private areas Disallow: /admin/ Disallow: /api/ Disallow: /private/ # Site Information Name: YourBrand Description: YourBrand 是一个专注于 [主题] 的权威网站。我们提供 [服务类型],帮助 [目标受众] [解决问题]。内容包括 [内容类型],旨在 [目标]。 Website: https://yourdomain.com Language: zh-CN, en-US Founded: 2020 # Content Scope Topics: [话题 1], [话题 2], [话题 3], [话题 4] Content-Type: blog posts, tutorials, guides, case studies Target-Audience: [受众描述] Update-Frequency: Weekly # Important Pages Homepage: https://yourdomain.com About: https://yourdomain.com/about Blog: https://yourdomain.com/blog Services: https://yourdomain.com/services Contact: https://yourdomain.com/contact # Featured Content Featured-Article-1: https://yourdomain.com/blog/[article-1] - [描述] Featured-Article-2: https://yourdomain.com/blog/[article-2] - [描述] Featured-Guide: https://yourdomain.com/guides/[guide] - [描述] # Content Guidelines Content-Style: Professional, educational, practical Tone: Informative, helpful, expert Accuracy: All content is fact-checked and regularly updated # Attribution Requirements Require-Attribution: true Attribution-URL: https://yourdomain.com Attribution-Text: "Source: YourBrand (https://yourdomain.com)" # License License: https://yourdomain.com/license Content-License: Creative Commons Attribution 4.0 International (CC BY 4.0) Content-Use: educational, informational, with attribution Commercial-Use: Contact for permission # Contact Contact-Email: contact@yourdomain.com Contact-Form: https://yourdomain.com/contact Social-Media: https://twitter.com/yourbrand, https://linkedin.com/company/yourbrand # Additional Information Last-Updated: 2024-01-15 API-Documentation: https://yourdomain.com/api-docs RSS-Feed: https://yourdomain.com/feed.xml
详细字段说明
Site Information(网站信息)
**Description(详细描述):**
- 2-3 句话详细描述
- 包含:你是谁,你提供什么,你的目标
- 示例:`SF Plumbing Services 是旧金山湾区的专业管道维修公司。我们提供 24/7 紧急管道服务、预防性维护和管道安装。我们的团队由持证专业管道工组成,拥有超过 15 年的服务经验。`
**Language(语言):**
- 主要语言代码
- 可以是多个:`zh-CN, en-US, es-ES`
**Founded(成立时间):**
- 网站或公司成立年份
- 帮助 AI 理解内容的时间背景
Content Scope(内容范围)
**Target-Audience(目标受众):**
- 描述你的主要受众
- 示例:`Homeowners, property managers, DIY enthusiasts`
**Update-Frequency(更新频率):**
- 内容更新频率
- 示例:`Daily`, `Weekly`, `Monthly`
**Content-Style(内容风格):**
- 内容的专业程度和风格
- 示例:`Professional, educational, practical`
Featured Content(精选内容)
列出你希望 AI 特别关注的内容:
Featured-Article-1: https://yourdomain.com/blog/seo-guide - Complete SEO guide for beginners Featured-Article-2: https://yourdomain.com/blog/ai-trends - AI trends in 2024 Featured-Guide: https://yourdomain.com/guides/plumbing-diy - DIY plumbing maintenance guide
Content Guidelines(内容指南)
**Accuracy(准确性):**
- 说明内容质量和准确性
- 示例:`All content is fact-checked and regularly updated`
**Tone(语调):**
- 内容的语调风格
- 示例:`Informative, helpful, expert-friendly`
License(许可证)
**Content-License(内容许可证):**
- 可以使用标准许可证:
- `CC BY 4.0` - Creative Commons Attribution
- `CC BY-NC 4.0` - Non-commercial only
- `CC BY-SA 4.0` - ShareAlike
- `All Rights Reserved` - 保留所有权利
**Commercial-Use(商业使用):**
- `Allowed` - 允许商业使用
- `Contact for permission` - 需要联系许可
- `Not allowed` - 不允许商业使用
Additional Information(附加信息)
**API-Documentation(API 文档):**
- 如果提供 API,列出文档链接
**RSS-Feed(RSS 订阅):**
- 帮助爬虫发现内容更新
**Last-Updated(最后更新):**
- llm.txt 文件的最后更新日期
### 示例 3:博客网站 ```bash /llm-txt --verbose
输出(针对博客):
# llm.txt for Blog ```txt # LLM Crawler Directives # Allow LLM crawlers User-agent: * Allow: / # Site Information Name: Tech Insights Blog Description: Tech Insig

