docs-seeker
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDocumentation Discovery via Scripts
基于脚本的文档发现
Overview
概述
Script-first documentation discovery using llms.txt standard.
Execute scripts to handle entire workflow - no manual URL construction needed.
以脚本优先的方式,基于llms.txt标准进行文档发现。
执行脚本即可处理整个工作流——无需手动构建URL。
Primary Workflow
核心工作流
ALWAYS execute scripts in this order:
bash
undefined请务必按照以下顺序执行脚本:
bash
undefined1. DETECT query type (topic-specific vs general)
1. 检测查询类型(特定主题 vs 通用)
node scripts/detect-topic.js "<user query>"
node scripts/detect-topic.js "<用户查询>"
2. FETCH documentation using script output
2. 使用脚本输出结果获取文档
node scripts/fetch-docs.js "<user query>"
node scripts/fetch-docs.js "<用户查询>"
3. ANALYZE results (if multiple URLs returned)
3. 分析结果(若返回多个URL)
cat llms.txt | node scripts/analyze-llms-txt.js -
Scripts handle URL construction, fallback chains, and error handling automatically.cat llms.txt | node scripts/analyze-llms-txt.js -
脚本会自动处理URL构建、回退链和错误处理。Scripts
脚本说明
detect-topic.js- Identifies topic-specific vs general queries
- Extracts library name + topic keyword
- Returns JSON:
{topic, library, isTopicSpecific} - Zero-token execution
fetch-docs.js- Constructs context7.com URLs automatically
- Handles fallback: topic → general → error
- Outputs llms.txt content or error message
- Zero-token execution
analyze-llms-txt.js- Categorizes URLs (critical/important/supplementary)
- Recommends agent distribution (1 agent, 3 agents, 7 agents, phased)
- Returns JSON with strategy
- Zero-token execution
detect-topic.js- 识别特定主题查询与通用查询
- 提取库名称 + 主题关键词
- 返回JSON格式:
{topic, library, isTopicSpecific} - 零Token执行
fetch-docs.js- 自动构建context7.com的URL
- 处理回退逻辑:主题 → 通用 → 错误
- 输出llms.txt内容或错误信息
- 零Token执行
analyze-llms-txt.js- 对URL进行分类(关键/重要/补充)
- 推荐Agent分发策略(1个Agent、3个Agent、7个Agent、分阶段)
- 返回包含策略的JSON结果
- 零Token执行
Workflow References
工作流参考
Topic-Specific Search - Fastest path (10-15s)
General Library Search - Comprehensive coverage (30-60s)
Repository Analysis - Fallback strategy
特定主题搜索 - 最快路径(10-15秒)
通用库搜索 - 全面覆盖(30-60秒)
仓库分析 - 回退策略
References
参考文档
context7-patterns.md - URL patterns, known repositories
errors.md - Error handling, fallback strategies
advanced.md - Edge cases, versioning, multi-language
context7-patterns.md - URL模式、已知仓库
errors.md - 错误处理、回退策略
advanced.md - 边缘情况、版本控制、多语言
Execution Principles
执行原则
- Scripts first - Execute scripts instead of manual URL construction
- Zero-token overhead - Scripts run without context loading
- Automatic fallback - Scripts handle topic → general → error chains
- Progressive disclosure - Load workflows/references only when needed
- Agent distribution - Scripts recommend parallel agent strategy
- 脚本优先 - 执行脚本而非手动构建URL
- 零Token开销 - 脚本运行无需加载上下文
- 自动回退 - 脚本处理主题→通用→错误的回退链
- 渐进式披露 - 仅在需要时加载工作流/参考文档
- Agent分发 - 脚本推荐并行Agent策略
Quick Start
快速开始
Topic query: "How do I use date picker in shadcn?"
bash
node scripts/detect-topic.js "<query>" # → {topic, library, isTopicSpecific}
node scripts/fetch-docs.js "<query>" # → 2-3 URLs特定主题查询示例: "如何在shadcn中使用日期选择器?"
bash
node scripts/detect-topic.js "<查询内容>" # → {topic, library, isTopicSpecific}
node scripts/fetch-docs.js "<查询内容>" # → 2-3个URLRead URLs with WebFetch
使用WebFetch读取URL内容
**General query:** "Documentation for Next.js"
```bash
node scripts/detect-topic.js "<query>" # → {isTopicSpecific: false}
node scripts/fetch-docs.js "<query>" # → 8+ URLs
cat llms.txt | node scripts/analyze-llms-txt.js - # → {totalUrls, distribution}
**通用查询示例:** "Next.js的文档"
```bash
node scripts/detect-topic.js "<查询内容>" # → {isTopicSpecific: false}
node scripts/fetch-docs.js "<查询内容>" # → 8个以上URL
cat llms.txt | node scripts/analyze-llms-txt.js - # → {totalUrls, distribution}Deploy agents per recommendation
根据推荐部署Agent
undefinedundefinedEnvironment
环境配置
Scripts load : > > >
.envprocess.env.claude/skills/docs-seeker/.env.claude/skills/.env.claude/.envSee for configuration options.
.env.example脚本会加载文件,优先级: > > >
.envprocess.env.claude/skills/docs-seeker/.env.claude/skills/.env.claude/.env配置选项可参考。
.env.example