clawd-docs-v2

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Clawd-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!):
SnippetQuery matches
telegram-setup.md
"ako nastaviť telegram", "telegram setup"
telegram-allowfrom.md
"allowFrom", "kto mi môže písať", "access control"
oauth-troubleshoot.md
"token expired", "oauth error", "credentials"
update-procedure.md
"ako updatnuť", "update clawdbot"
restart-gateway.md
"restart", "reštart", "stop/start"
config-basics.md
"config", "nastavenie", "konfigurácia"
config-providers.md
"pridať provider", "discord setup", "nový kanál"
memory-search.md
"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-setup.md
"如何设置Telegram", "telegram setup"
telegram-allowfrom.md
"allowFrom", "谁可以给我发消息", "access control"
oauth-troubleshoot.md
"token expired", "oauth error", "credentials"
update-procedure.md
"如何更新ClawdBot", "update clawdbot"
restart-gateway.md
"restart", "重启", "stop/start"
config-basics.md
"config", "设置", "konfigurácia"
config-providers.md
"添加提供商", "discord setup", "新频道"
memory-search.md
"memory", "vector search", "记忆", "embeddings"
读取代码片段:
bash
cat ~/clawd/data/docs-snippets/telegram-setup.md

Step 2: Search Index (if snippet doesn't exist)

步骤2:搜索索引(如果没有对应的代码片段)

Check
~/clawd/data/docs-index.json
for page suggestions.
Keyword 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
undefined

Convert 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.md
ls ~/clawd/data/docs-cache/ | grep "concepts_memory"

**如果存在,本地读取(0 Token消耗!):**
```bash
cat ~/clawd/data/docs-cache/concepts_memory.md

Step 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_fetchbrightdata
Cost$0 (free!)~$0.003/call
Speed~400ms2-5s
QualityMarkdown ✅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_fetchbrightdata
成本$0(免费!)约$0.003/次调用
速度~400ms2-5s
质量Markdown ✅Markdown ✅

Search Index Structure

搜索索引结构

Location:
~/clawd/data/docs-index.json
json
{
  "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.json
json
{
  "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 CategoryTTLWhy
install/updating
1 dayAlways current!
gateway/*
7 daysConfig changes
channels/*
7 daysProvider updates
tools/*
7 daysFeatures added
concepts/*
14 daysRarely changes
reference/*
30 daysStable templates
Check snippet expiry:
bash
head -10 ~/clawd/data/docs-snippets/telegram-setup.md | grep expires

页面分类TTL(天)原因
install/updating
1内容需保持最新!
gateway/*
7配置可能变更
channels/*
7提供商可能更新
tools/*
7可能新增功能
concepts/*
14很少变更
reference/*
30模板稳定
检查代码片段过期时间:
bash
head -10 ~/clawd/data/docs-snippets/telegram-setup.md | grep expires

Common Scenarios

常见场景

"Ako nastaviť Telegram?"

"如何设置Telegram?"

  1. ✅ Read
    ~/clawd/data/docs-snippets/telegram-setup.md
  1. ✅ 读取
    ~/clawd/data/docs-snippets/telegram-setup.md

"allowFrom nefunguje"

"allowFrom无法正常工作"

  1. ✅ Read
    ~/clawd/data/docs-snippets/telegram-allowfrom.md
  1. ✅ 读取
    ~/clawd/data/docs-snippets/telegram-allowfrom.md

"Token expired / oauth error"

"Token过期 / OAuth错误"

  1. ✅ Read
    ~/clawd/data/docs-snippets/oauth-troubleshoot.md
  1. ✅ 读取
    ~/clawd/data/docs-snippets/oauth-troubleshoot.md

"Ako updatnúť ClawdBot?"

"如何更新ClawdBot?"

  1. ✅ Read
    ~/clawd/data/docs-snippets/update-procedure.md
  1. ✅ 读取
    ~/clawd/data/docs-snippets/update-procedure.md

"Ako pridať nový skill?" (nie je snippet)

"如何添加新Skill?"(无对应代码片段)

  1. Search index → tools/skills
  2. Fetch:
    web_fetch({ url: "https://docs.clawd.bot/tools/skills", extractMode: "markdown" })
  1. 搜索索引 → tools/skills
  2. 获取:
    web_fetch({ url: "https://docs.clawd.bot/tools/skills", extractMode: "markdown" })

"Multi-agent routing"

"多Agent路由"

  1. Search index → concepts/multi-agent
  2. Fetch:
    web_fetch({ url: "https://docs.clawd.bot/concepts/multi-agent", extractMode: "markdown" })

  1. 搜索索引 → concepts/multi-agent
  2. 获取:
    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效率指南

MethodTokensWhen to use
Golden Snippet~300-500✅ Always first!
Search Index0Keyword lookup
Full Page Fetch~8-12kLast resort
Batch Fetch~20-30kMultiple 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

版本信息

ItemValue
Skill version2.1.0
Created2026-01-14
Updated2026-01-26
AuthorsClaude Code + Clawd (collaborative)
Sourcehttps://docs.clawd.bot/
Dependenciesweb_fetch (Clawdbot core tool)
Index pages~50 core pages
Golden snippets7 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提供智能文档访问功能 - 优先使用缓存代码片段,仅在必要时才进行获取。