clawd-docs-v2
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseClawd-Docs v2.0 - Smart Documentation Access
Clawd-Docs v2.0 - 智能文档访问工具
This skill provides intelligent access to ClawdBot documentation with:
- Local search index - instant keyword lookup (0 tokens)
- Cached snippets - pre-fetched common answers (~300-500 tokens)
- On-demand fetch - full page when needed (~8-12k tokens)
- Freshness tracking - TTL per page type
本Skill为ClawdBot文档提供智能访问功能,包括:
- 本地搜索索引 - 即时关键词查询(0 Token消耗)
- 缓存代码片段(Golden Snippets) - 预获取的常见问题答案(约300-500 Token)
- 按需获取 - 需要时获取完整页面(约8-12k Token)
- 新鲜度追踪 - 按页面类型设置TTL(过期时间)
Quick Start
快速开始
Step 1: Check Golden Snippets First
步骤1:先检查Golden Snippets
Before fetching anything, check if a Golden Snippet exists:
bash
ls ~/clawd/data/docs-snippets/Available snippets (check cache first!):
| Snippet | Query matches |
|---|---|
| "ako nastaviť telegram", "telegram setup" |
| "allowFrom", "kto mi môže písať", "access control" |
| "token expired", "oauth error", "credentials" |
| "ako updatnuť", "update clawdbot" |
| "restart", "reštart", "stop/start" |
| "config", "nastavenie", "konfigurácia" |
| "pridať provider", "discord setup", "nový kanál" |
| "memory", "vector search", "pamäť", "embeddings" |
Read snippet:
bash
cat ~/clawd/data/docs-snippets/telegram-setup.md在获取任何内容之前,先检查是否存在Golden Snippets:
bash
ls ~/clawd/data/docs-snippets/可用的代码片段(先检查缓存!):
| 代码片段 | 匹配查询 |
|---|---|
| "如何设置Telegram", "telegram setup" |
| "allowFrom", "谁可以给我发消息", "access control" |
| "token expired", "oauth error", "credentials" |
| "如何更新ClawdBot", "update clawdbot" |
| "restart", "重启", "stop/start" |
| "config", "设置", "konfigurácia" |
| "添加提供商", "discord setup", "新频道" |
| "memory", "vector search", "记忆", "embeddings" |
读取代码片段:
bash
cat ~/clawd/data/docs-snippets/telegram-setup.mdStep 2: Search Index (if snippet doesn't exist)
步骤2:搜索索引(如果没有对应的代码片段)
Check for page suggestions.
~/clawd/data/docs-index.jsonKeyword matching:
- "telegram" → channels/telegram
- "oauth" → concepts/oauth, gateway/troubleshooting
- "update" → install/updating
- "config" → gateway/configuration
查看获取页面建议。
~/clawd/data/docs-index.json关键词匹配:
- "telegram" → channels/telegram
- "oauth" → concepts/oauth, gateway/troubleshooting
- "update" → install/updating
- "config" → gateway/configuration
Step 3: Check Full Page Cache
步骤3:检查完整页面缓存
BEFORE fetching via brightdata, check if the page is already cached:
bash
undefined在通过brightdata获取之前,先检查页面是否已缓存:
bash
undefinedConvert path: concepts/memory → concepts_memory.md
转换路径:concepts/memory → concepts_memory.md
ls ~/clawd/data/docs-cache/ | grep "concepts_memory"
**If exists, read locally (0 tokens!):**
```bash
cat ~/clawd/data/docs-cache/concepts_memory.mdls ~/clawd/data/docs-cache/ | grep "concepts_memory"
**如果存在,本地读取(0 Token消耗!):**
```bash
cat ~/clawd/data/docs-cache/concepts_memory.mdStep 4: Fetch Page (only if NOT in cache)
步骤4:获取页面(仅当未缓存时)
Use native web_fetch tool (part of Clawdbot core - FREE and fast!):
javascript
web_fetch({ url: "https://docs.clawd.bot/{path}", extractMode: "markdown" })Example:
javascript
web_fetch({ url: "https://docs.clawd.bot/tools/skills", extractMode: "markdown" })web_fetch advantages:
| web_fetch | brightdata | |
|---|---|---|
| Cost | $0 (free!) | ~$0.003/call |
| Speed | ~400ms | 2-5s |
| Quality | Markdown ✅ | Markdown ✅ |
使用原生的web_fetch工具(Clawdbot核心组件 - 免费且快速!):
javascript
web_fetch({ url: "https://docs.clawd.bot/{path}", extractMode: "markdown" })示例:
javascript
web_fetch({ url: "https://docs.clawd.bot/tools/skills", extractMode: "markdown" })web_fetch优势:
| web_fetch | brightdata | |
|---|---|---|
| 成本 | $0(免费!) | 约$0.003/次调用 |
| 速度 | ~400ms | 2-5s |
| 质量 | Markdown ✅ | Markdown ✅ |
Search Index Structure
搜索索引结构
Location:
~/clawd/data/docs-index.jsonjson
{
"pages": [
{
"path": "channels/telegram",
"ttl_days": 7,
"keywords": ["telegram", "tg", "bot", "allowfrom"]
}
],
"synonyms": {
"telegram": ["tg", "telegrambot"],
"configuration": ["config", "nastavenie", "settings"]
}
}Use synonyms for fuzzy matching.
位置:
~/clawd/data/docs-index.jsonjson
{
"pages": [
{
"path": "channels/telegram",
"ttl_days": 7,
"keywords": ["telegram", "tg", "bot", "allowfrom"]
}
],
"synonyms": {
"telegram": ["tg", "telegrambot"],
"configuration": ["config", "nastavenie", "settings"]
}
}使用同义词进行模糊匹配。
TTL Strategy (Freshness)
TTL策略(新鲜度)
| Page Category | TTL | Why |
|---|---|---|
| 1 day | Always current! |
| 7 days | Config changes |
| 7 days | Provider updates |
| 7 days | Features added |
| 14 days | Rarely changes |
| 30 days | Stable templates |
Check snippet expiry:
bash
head -10 ~/clawd/data/docs-snippets/telegram-setup.md | grep expires| 页面分类 | TTL(天) | 原因 |
|---|---|---|
| 1 | 内容需保持最新! |
| 7 | 配置可能变更 |
| 7 | 提供商可能更新 |
| 7 | 可能新增功能 |
| 14 | 很少变更 |
| 30 | 模板稳定 |
检查代码片段过期时间:
bash
head -10 ~/clawd/data/docs-snippets/telegram-setup.md | grep expiresCommon Scenarios
常见场景
"Ako nastaviť Telegram?"
"如何设置Telegram?"
- ✅ Read
~/clawd/data/docs-snippets/telegram-setup.md
- ✅ 读取
~/clawd/data/docs-snippets/telegram-setup.md
"allowFrom nefunguje"
"allowFrom无法正常工作"
- ✅ Read
~/clawd/data/docs-snippets/telegram-allowfrom.md
- ✅ 读取
~/clawd/data/docs-snippets/telegram-allowfrom.md
"Token expired / oauth error"
"Token过期 / OAuth错误"
- ✅ Read
~/clawd/data/docs-snippets/oauth-troubleshoot.md
- ✅ 读取
~/clawd/data/docs-snippets/oauth-troubleshoot.md
"Ako updatnúť ClawdBot?"
"如何更新ClawdBot?"
- ✅ Read
~/clawd/data/docs-snippets/update-procedure.md
- ✅ 读取
~/clawd/data/docs-snippets/update-procedure.md
"Ako pridať nový skill?" (nie je snippet)
"如何添加新Skill?"(无对应代码片段)
- Search index → tools/skills
- Fetch:
web_fetch({ url: "https://docs.clawd.bot/tools/skills", extractMode: "markdown" })
- 搜索索引 → tools/skills
- 获取:
web_fetch({ url: "https://docs.clawd.bot/tools/skills", extractMode: "markdown" })
"Multi-agent routing"
"多Agent路由"
- Search index → concepts/multi-agent
- Fetch:
web_fetch({ url: "https://docs.clawd.bot/concepts/multi-agent", extractMode: "markdown" })
- 搜索索引 → concepts/multi-agent
- 获取:
web_fetch({ url: "https://docs.clawd.bot/concepts/multi-agent", extractMode: "markdown" })
Fallback: Full Index Refresh
备选方案:完整索引刷新
If you can't find what you need:
javascript
web_fetch({ url: "https://docs.clawd.bot/llms.txt", extractMode: "markdown" })Returns complete list of all documentation pages.
如果无法找到所需内容:
javascript
web_fetch({ url: "https://docs.clawd.bot/llms.txt", extractMode: "markdown" })返回所有文档页面的完整列表。
Token Efficiency Guide
Token效率指南
| Method | Tokens | When to use |
|---|---|---|
| Golden Snippet | ~300-500 | ✅ Always first! |
| Search Index | 0 | Keyword lookup |
| Full Page Fetch | ~8-12k | Last resort |
| Batch Fetch | ~20-30k | Multiple related topics |
80-90% of queries should be answered from snippets!
| 方法 | Token消耗 | 使用场景 |
|---|---|---|
| Golden Snippet | ~300-500 | ✅ 优先使用! |
| 搜索索引 | 0 | 关键词查询 |
| 完整页面获取 | ~8-12k | 最后手段 |
| 批量获取 | ~20-30k | 多个相关主题 |
80-90%的查询应该通过代码片段就能回答!
Data Locations
数据存储位置
~/clawd/data/
├── docs-index.json # Search index
├── docs-stats.json # Usage tracking
├── docs-snippets/ # Cached Golden Snippets
│ ├── telegram-setup.md
│ ├── telegram-allowfrom.md
│ ├── oauth-troubleshoot.md
│ ├── update-procedure.md
│ ├── restart-gateway.md
│ └── config-basics.md
└── docs-cache/ # Full page cache (future)~/clawd/data/
├── docs-index.json # 搜索索引
├── docs-stats.json # 使用情况追踪
├── docs-snippets/ # 缓存的Golden Snippets
│ ├── telegram-setup.md
│ ├── telegram-allowfrom.md
│ ├── oauth-troubleshoot.md
│ ├── update-procedure.md
│ ├── restart-gateway.md
│ └── config-basics.md
└── docs-cache/ # 完整页面缓存(未来规划)Version Info
版本信息
| Item | Value |
|---|---|
| Skill version | 2.1.0 |
| Created | 2026-01-14 |
| Updated | 2026-01-26 |
| Authors | Claude Code + Clawd (collaborative) |
| Source | https://docs.clawd.bot/ |
| Dependencies | web_fetch (Clawdbot core tool) |
| Index pages | ~50 core pages |
| Golden snippets | 7 pre-cached |
| 项目 | 数值 |
|---|---|
| Skill版本 | 2.1.0 |
| 创建时间 | 2026-01-14 |
| 更新时间 | 2026-01-26 |
| 作者 | Claude Code + Clawd(协作开发) |
| 来源 | https://docs.clawd.bot/ |
| 依赖 | web_fetch(Clawdbot核心工具) |
| 索引页面数 | ~50个核心页面 |
| Golden Snippets数量 | 7个预缓存 |
Changelog
更新日志
v2.2.0 (2026-01-26)
v2.2.0(2026-01-26)
- Migration to web_fetch - replaced brightdata MCP with native Clawdbot tool
- Benefits: FREE ($0), faster (~400ms vs 2-5s)
- No external dependencies (mcporter no longer required)
- Collaborative work: Claude Code 🦞 implementation, Clawd 🐾 review
- 迁移至web_fetch - 替换brightdata MCP为原生Clawdbot工具
- 优势:免费($0)、速度更快(~400ms vs 2-5s)
- 无外部依赖(不再需要mcporter)
- 协作开发:Claude Code 🦞 实现,Clawd 🐾 审核
v2.1.3 (2026-01-25) - ClawdHub
v2.1.3(2026-01-25)- ClawdHub
- Documentation fix: check vs refresh clarification
- 文档修复:明确检查与刷新的区别
v2.0.0 (2026-01-14)
v2.0.0(2026-01-14)
- 3-layer architecture: Search Index → Snippets → On-demand Fetch
- Golden Snippets pre-cached for common queries
- TTL-based freshness tracking
- Synonym support for fuzzy matching
- 80-90% token reduction for common queries
- 三层架构:搜索索引 → 代码片段 → 按需获取
- 为常见查询预缓存Golden Snippets
- 基于TTL的新鲜度追踪
- 支持同义词模糊匹配
- 常见查询的Token消耗减少80-90%
v1.0.0 (2026-01-08)
v1.0.0(2026-01-08)
- Initial release with brightdata fetch only
This skill provides smart documentation access - always cached snippets first, fetch only when necessary.
- 初始版本,仅支持brightdata获取
本Skill提供智能文档访问功能 - 优先使用缓存代码片段,仅在必要时才进行获取。