/install doc-search
Doc Search
BM25 inverted index + LLM query expansion + grep. Zero external dependencies.
Workflow
Follow these steps in order every time:
Step 1 — Resolve docs_dir
Check if the user mentioned a docs directory. If not, ask:
"Which directory should I search? (e.g. ~/obsidian, ~/notes)"
Step 2 — Check index exists
ls \x3Cdocs_dir>/.cache/index.json
- If missing → go to Step 3 (build index first)
- If exists → skip to Step 4
Step 3 — Build index
python3 ~/.claude/skills/doc-search/scripts/build_index.py \x3Cdocs_dir>
Index saved to \x3Cdocs_dir>/.doc-search/index.json. Incremental on subsequent runs.
Step 4 — Expand query terms
Before searching, expand the user's query to cover synonyms, Chinese/English variants, and likely headings. Combine into one string:
"获取音色列表" → "获取 查询 list voice 音色 tts ListVoice 音色列表"
Step 5 — BM25 search
python3 ~/.claude/skills/doc-search/scripts/search.py "\x3Cexpanded query>" \
--docs-dir \x3Cdocs_dir> --topk 5
Output: JSON array [{path, rel, score, title, summary}, ...]
Step 6 — Grep top-K for precise location
For each result file, grep with the original keywords:
grep -ni -e "keyword1" -e "keyword2" /path/to/doc.md
Report file path + matching line numbers to the user.
Options
| Flag | Default | Description |
|---|---|---|
--topk |
5 |
Number of BM25 results |
--ext |
md,txt,rst,org |
File extensions to index |
--index |
\x3Cdocs_dir>/.doc-search/index.json |
Override index path |
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install doc-search - 安装完成后,直接呼叫该 Skill 的名称或使用
/doc-search触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
doc-search 是什么?
Search a local document library (Obsidian vault, wiki, notes, etc.) using BM25 inverted index + LLM query expansion + grep for precise location. Use when the... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 173 次。
如何安装 doc-search?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install doc-search」即可一键安装,无需额外配置。
doc-search 是免费的吗?
是的,doc-search 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
doc-search 支持哪些平台?
doc-search 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 doc-search?
由 FantasyRL(@fantasyrl)开发并维护,当前版本 v1.0.0。