docs-researcher

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Documentation Researcher Skill

Documentation Researcher Skill

Mode 1: Initialize (
init
)

模式1:初始化(
init

When argument is
init
:
  1. Run the initialization script:
    bash
    undefined
node ${CLAUDE_PLUGIN_ROOT}/scripts/init.js .

2. Check if `CLAUDE.md` exists (at project root):
- If exists: Read it and append the knowledge base section if not already present
- If not exists: Create it with the knowledge base section

**Append/create this section in CLAUDE.md:**

```markdown
当参数为
init
时:
  1. 运行初始化脚本:
    bash
    undefined
node ${CLAUDE_PLUGIN_ROOT}/scripts/init.js .

2. 检查项目根目录下是否存在`CLAUDE.md`文件:
- 若存在:读取该文件,若知识库章节尚未存在则追加该章节
- 若不存在:创建该文件并添加知识库章节

**在CLAUDE.md中追加/创建以下章节:**

```markdown

Knowledge Base

知识库

This project uses
.claude/skills/project-knowledge-base/
for documentation.
Before coding unfamiliar patterns:
  1. Load the
    project-knowledge-base
    skill to see available references
  2. If topic not covered, use
    /docs-researcher <technology> <topic> for <context>
Always consult the knowledge base when clarification is needed.

**Example:**
User: /docs-researcher init Actions:
  1. Bash(node ${CLAUDE_PLUGIN_ROOT}/scripts/init.js .)
  2. Read CLAUDE.md (if exists, at project root)
  3. Write updated CLAUDE.md with knowledge base section Response: Report what was created/updated
undefined
本项目使用
.claude/skills/project-knowledge-base/
目录存储文档。
在编写不熟悉的代码模式之前:
  1. 加载
    project-knowledge-base
    skill以查看可用参考资料
  2. 若主题未被覆盖,使用
    /docs-researcher <技术> <主题> for <上下文>
    命令
需要澄清时请务必查阅知识库。

**示例:**
用户:/docs-researcher init 操作:
  1. Bash(node ${CLAUDE_PLUGIN_ROOT}/scripts/init.js .)
  2. 读取CLAUDE.md(若存在,位于项目根目录)
  3. 写入更新后的CLAUDE.md,包含知识库章节 响应:报告已创建/更新的内容
undefined

Mode 2: Research

模式2:研究

When argument is a research request (not "init"), invoke the
docs-researcher
agent.
Task(
  subagent_type: "docs-researcher", 
  description: "Research documentation",
  prompt: "{user's research request}"
)
Agent will:
  • Search the web for documentation
  • Fetch and extract relevant content
  • Save to
    .claude/skills/project-knowledge-base/references/
  • Update the SKILL.md index
Example:
User: /docs-researcher TanStack Router beforeLoad for authentication guards
Action: Task(subagent_type: "docs-researcher", prompt: "TanStack Router beforeLoad for authentication guards")
Response: Agent's research results
当参数为研究请求(非"init")时,调用
docs-researcher
agent。
Task(
  subagent_type: "docs-researcher", 
  description: "Research documentation",
  prompt: "{user's research request}"
)
Agent将执行以下操作:
  • 搜索网络获取文档
  • 获取并提取相关内容
  • 保存至
    .claude/skills/project-knowledge-base/references/
    目录
  • 更新SKILL.md索引
示例:
用户:/docs-researcher TanStack Router beforeLoad for authentication guards
操作:Task(subagent_type: "docs-researcher", prompt: "TanStack Router beforeLoad for authentication guards")
响应:Agent的研究结果