llms-txt

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LLMs.txt Generator

LLMs.txt 生成工具

Generate
/llms.txt
and
/llms-full.txt
files for web projects following the llmstxt.org spec.
This workflow uses a Script-First approach: a crawler script handles the "labor" of mapping the repo structure and finding brand rules, leaving the agent to handle the "judgment" of writing the LLM-friendly context files.
遵循llmstxt.org规范,为Web项目生成
/llms.txt
/llms-full.txt
文件。
该工作流采用**脚本优先(Script-First)**方法:爬虫脚本负责完成映射仓库结构、查找品牌规则这类“劳力”工作,而Agent则负责撰写LLM友好型上下文文件这类“判断”工作。

Usage

使用方法

When asked to "generate llms.txt", "make the site AI-friendly", or "add llms-full.txt":
  1. Run the manifest script:
    bash
    python3 ~/.agents/skills/llms-txt/scripts/generate_llms_manifest.py \
      --root "." \
      --out "llms_manifest.json"
  2. Read the manifest: Load
    llms_manifest.json
    to see:
    • Discovered brand guides (README.md, GEMINI.md, etc.).
    • List of all content files (.md, .mdx, .txt).
    • High-level project structure and summary snippet.
  3. Draft Context Files: Use the manifest to create the two required files:
    • /public/llms.txt
      : Brief summary, brand guardrails, and top-level links.
    • /public/llms-full.txt
      : Comprehensive manifest including all content links.
当被要求“生成llms.txt”、“让站点对AI友好”或“添加llms-full.txt”时:
  1. 运行清单脚本:
    bash
    python3 ~/.agents/skills/llms-txt/scripts/generate_llms_manifest.py \
      --root "." \
      --out "llms_manifest.json"
  2. 读取清单: 加载
    llms_manifest.json
    查看:
    • 已发现的品牌指南(README.md、GEMINI.md等)。
    • 所有内容文件列表(.md、.mdx、.txt)。
    • 高层级项目结构和摘要片段。
  3. 撰写上下文文件: 使用清单创建两个必填文件:
    • /public/llms.txt
      :简短摘要、品牌规则和顶级链接。
    • /public/llms-full.txt
      :包含所有内容链接的完整清单。

File Standards

文件标准

llms.txt (The Brief)

llms.txt(精简版)

  • Start with a H1 title and brief description.
  • LLM Instructions section: Explicit rules for how other agents should write for this project.
  • Top-level links: Point to major sections (Docs, API, Components).
  • 以H1标题和简短描述开头。
  • LLM指令部分:明确其他Agent为该项目撰写内容的规则。
  • 顶级链接:指向主要板块(文档、API、组件)。

llms-full.txt (The Full Record)

llms-full.txt(完整版记录)

  • List every public-facing content file identified in the manifest.
  • Group by directory.
  • Provide a 1-sentence description for each major section.
  • 列出清单中识别到的所有面向公众的内容文件。
  • 按目录分组。
  • 为每个主要板块提供一句描述。

Anti-patterns (The "Hot Take" List)

反模式(“热门观点”清单)

  • Agent labor: Don't manually
    ls -R
    to find files; use the script.
  • Hallucinated links: Only include files found in the deterministic manifest.
  • Vague descriptions: Use the
    summary_snippet
    from the manifest to ground the project purpose.
  • Agent劳力浪费:不要手动执行
    ls -R
    查找文件;使用脚本。
  • 虚构链接:仅包含确定性清单中找到的文件。
  • 模糊描述:使用清单中的
    summary_snippet
    明确项目目标。