search-and-fetch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSearch & Fetch
Search & Fetch
通用搜索与内容提取技能,提供两个核心能力:搜索模式(多源并行搜索 + 结果综合)和提取模式(URL 内容提取 + 结构化分析)。
General search and content extraction skill, providing two core capabilities: Search Mode (multi-source parallel search + result synthesis) and Fetch Mode (URL content extraction + structured analysis).
工具概览
Tool Overview
本技能编排以下几类工具,按需组合使用:
| 类别 | 工具 | 说明 |
|---|---|---|
| 内置搜索 | | DuckDuckGo 搜索,始终可用 |
| MCP 搜索 | 当前环境中可用的 MCP 搜索工具 | 中文搜索、专业搜索等,按可用性自动选用 |
| 技术文档 | | 编程库/框架官方文档查询 |
| 浏览器 | | 访问搜索引擎、提取 JS 重度页面(Rust 原生,token 高效) |
| 内容提取 | | 按优先级降级 |
具体调用语法参见 。
references/tool-catalog.mdThis skill orchestrates the following types of tools, combining them as needed:
| Category | Tool | Description |
|---|---|---|
| Built-in Search | | DuckDuckGo search, always available |
| MCP Search | Available MCP search tools in the current environment | Chinese search, professional search, etc., automatically selected based on availability |
| Technical Docs | | Query official docs for programming libraries/frameworks |
| Browser | | Access search engines, extract content from JS-heavy pages (Rust native, token-efficient) |
| Content Extraction | | Degrade by priority |
Refer to for specific invocation syntax.
references/tool-catalog.md意图检测
Intent Detection
本技能负责所有 URL 和搜索意图的识别与路由。根据用户输入自动判断:
This skill is responsible for identifying and routing all URL and search intents. Automatically judge based on user input:
URL 检测
URL Detection
| 情况 | 处理 |
|---|---|
| 消息仅含 URL(无其他文字,或只有 URL + 空格/标点) | 直接进入 Fetch Mode |
| 消息含 URL + 阅读意图("读一下"、"分析"、"看看这个") | 直接进入 Fetch Mode |
| 消息含 URL + 保存意图("保存"、"clip"、"save"、"归档") | Fetch Mode 完成后,自动触发知识库技能的 Clipping Save |
| URL 出现在较长消息中,意图不明 | 询问:"要我提取内容分析,还是只需要链接?" |
| URL 明显是工具性的(localhost、内网地址、文件路径) | 不触发 |
| Scenario | Handling |
|---|---|
| Message contains only URL (no other text, or only URL + spaces/punctuation) | Directly enter Fetch Mode |
| Message contains URL + reading intent ("read this", "analyze", "take a look at this") | Directly enter Fetch Mode |
| Message contains URL + save intent ("save", "clip", "save", "archive") | After completing Fetch Mode, automatically trigger the Clipping Save of the knowledge base skill |
| URL appears in a long message with unclear intent | Ask: "Would you like me to extract and analyze the content, or just keep the link?" |
| URL is obviously tool-based (localhost, internal network address, file path) | Do not trigger |
搜索检测
Search Detection
| 情况 | 处理 |
|---|---|
| 用户提问、研究主题、需要查找信息 | Search Mode |
| 提供 URL + "搜索更多类似的" | 先 Fetch 再 Search |
| 其他技能委托调用 | 按委托方指定的模式执行 |
| Scenario | Handling |
|---|---|
| User asks questions, researches topics, needs to find information | Search Mode |
| Provides URL + "search for more similar content" | First Fetch then Search |
| Delegated call by other skills | Execute according to the mode specified by the delegator |
Search Mode
Search Mode
多源并行搜索,综合去重后输出结构化结果。
Multi-source parallel search, output structured results after deduplication and synthesis.
Step 1 — 查询分类
Step 1 — Query Classification
根据查询内容判断类型,选择工具组合:
| 查询类型 | 判断依据 | 工具组合 |
|---|---|---|
| 技术文档 | 涉及编程库、API、框架用法 | |
| 中文内容 | 中文查询,或中国特定话题 | MCP 搜索 + |
| 通用查询 | 其他一般性问题 | |
| 深度研究 | 用户明确要求全面/深入调研 | 全部工具并行,含 |
Judge the type based on query content, select tool combinations:
| Query Type | Judgment Basis | Tool Combination |
|---|---|---|
| Technical Docs | Involves programming libraries, APIs, framework usage | |
| Chinese Content | Chinese query, or China-specific topics | MCP search + |
| General Query | Other general questions | |
| In-depth Research | User explicitly requests comprehensive/in-depth research | All tools in parallel, including |
Step 2 — 并行执行搜索
Step 2 — Parallel Search Execution
根据分类结果,在同一轮响应中并行调用多个搜索工具。工具调用细节参见 。
references/tool-catalog.md关键原则:
- 独立工具并行调用,不等待
- context7 有顺序依赖:先 解析库 ID,再
ctx7 library查询内容(每个问题最多 3 次调用)ctx7 docs - 对同一查询可以为不同搜索引擎调整措辞(如中文查询给 MCP 搜索原文,给 WebSearch 翻译为英文)
- 深度研究时使用 打开 Google/Bing 搜索页,通过
agent-browser获取元素引用后提取结果snapshot
Based on classification results, call multiple search tools in parallel within the same response round. Refer to for tool invocation details.
references/tool-catalog.mdKey Principles:
- Call independent tools in parallel, no waiting
- context7 has sequential dependencies: first to resolve library ID, then
ctx7 libraryto query content (max 3 calls per question)ctx7 docs - Adjust wording for different search engines for the same query (e.g., send original Chinese query to MCP search, translate to English for WebSearch)
- For in-depth research, use to open Google/Bing search pages, extract results after getting element references via
agent-browsersnapshot
Step 3 — 结果综合
Step 3 — Result Synthesis
- 去重:按 URL 去重,合并来自不同来源的同一页面信息
- 分组:按子主题或关联度分组
- 排序:按相关性和信息质量排序
- 输出格式:
markdown
undefined- Deduplication: Deduplicate by URL, merge information from the same page from different sources
- Grouping: Group by sub-topic or relevance
- Sorting: Sort by relevance and information quality
- Output Format:
markdown
undefined搜索结果:[查询主题]
Search Results: [Query Topic]
[子主题 1]
[Sub-topic 1]
- 要点摘要(来源:标题)
- 要点摘要(来源:标题)
- Key point summary (Source: Title)
- Key point summary (Source: Title)
[子主题 2]
[Sub-topic 2]
- ...
来源列表
- 标题 — 简述
- 标题 — 简述
undefined- ...
Source List
- Title — Brief description
- Title — Brief description
undefinedStep 4 — 后续操作
Step 4 — Follow-up Operations
搜索结果展示后,提供后续选项:
- "要我读取某个链接的完整内容吗?" → 转入 Fetch Mode
- "要保存到知识库吗?" → 引导用户触发 obsidian-knowledge 等知识管理技能
- 用户可继续追问以缩小或扩大搜索范围
After displaying search results, provide follow-up options:
- "Would you like me to read the full content of a certain link?" → Switch to Fetch Mode
- "Would you like to save to the knowledge base?" → Guide users to trigger knowledge management skills like obsidian-knowledge
- Users can continue to ask questions to narrow or expand the search scope
Fetch Mode
Fetch Mode
从 URL 提取干净内容并进行结构化分析。
Extract clean content from URLs and perform structured analysis.
Step 1 — 提取内容
Step 1 — Content Extraction
按优先级尝试,前一个失败(报错、返回空、内容 < 100 字符)时自动降级:
1. defuddle parse <url> --md ← 首选,去除噪音
2. WebFetch(url) ← 通用降级
3. MCP fetch 工具(如有) ← MCP 降级
4. agent-browser open <url> → snapshot → get text ← JS 重度页面最终手段提取成功后记录使用了哪个工具,便于透明告知用户。
工具调用细节参见 。
references/tool-catalog.mdAttempt in priority order, automatically degrade if the previous one fails (error, returns empty, content < 100 characters):
1. defuddle parse <url> --md ← Preferred, removes noise
2. WebFetch(url) ← General degradation
3. MCP fetch tool (if available) ← MCP degradation
4. agent-browser open <url> → snapshot → get text ← Final resort for JS-heavy pagesRecord which tool was used after successful extraction, to transparently inform users.
Refer to for tool invocation details.
references/tool-catalog.mdStep 2 — 结构化分析
Step 2 — Structured Analysis
根据内容类型选择性应用分析维度。详细模板参见 。
references/analysis-template.md| 内容类型 | 适用维度 |
|---|---|
| 文章、评论、论文 | 全部五维(文本解构 → 概念提炼 → 批判审视 → 思想深化 → 实践转化) |
| 新闻、产品页 | 文本解构 + 概念提炼 + 实践转化 |
| 教程、技术文档 | 文本解构 + 概念提炼 + 实践转化 |
| 数据页、API 文档、参考表 | 跳过分析,直接呈现提取内容 |
Selectively apply analysis dimensions based on content type. See for detailed templates.
references/analysis-template.md| Content Type | Applicable Dimensions |
|---|---|
| Articles, comments, papers | All five dimensions (text deconstruction → concept extraction → critical examination → idea deepening → practical transformation) |
| News, product pages | Text deconstruction + concept extraction + practical transformation |
| Tutorials, technical docs | Text deconstruction + concept extraction + practical transformation |
| Data pages, API docs, reference tables | Skip analysis, directly present extracted content |
Step 3 — 输出
Step 3 — Output
两种输出模式:
独立模式(用户直接使用时):
markdown
undefinedTwo output modes:
Standalone Mode (when used directly by users):
markdown
undefined页面标题
Page Title
作者: xxx | 日期: xxx | 字数: xxx
Author: xxx | Date: xxx | Word Count: xxx
摘要
Summary
一段话总结。
A paragraph summary.
分析
Analysis
[按 analysis-template.md 输出适用维度]
[Output applicable dimensions according to analysis-template.md]
关键要点
Key Points
- 要点一
- 要点二
- 要点三
分析输出后,主动提示:"要保存到知识库吗?" 若用户同意,引导触发 obsidian-knowledge 的 Clipping Save 流程。
**集成模式**(被其他技能委托调用时):
以自然语言输出以下信息块,供调用方直接消费(不要输出 JSON):
1. **页面标题**和**原始 URL**
2. **一句话摘要**
3. **关键要点**(要点列表)
4. **五维分析**(按适用维度输出)
5. **完整正文**(提取的干净 markdown 全文)
6. **提取的实体**:提到的工具/软件、股票/公司、人物(姓名+身份)、书籍/论文/资源
---- Point 1
- Point 2
- Point 3
After analysis output, actively prompt: "Would you like to save to the knowledge base?" If the user agrees, guide to trigger the Clipping Save process of obsidian-knowledge.
**Integration Mode** (when delegated by other skills):
Output the following information blocks in natural language, for direct consumption by the caller (do not output JSON):
1. **Page Title** and **Original URL**
2. **One-sentence Summary**
3. **Key Points** (list of points)
4. **Five-dimensional Analysis** (output applicable dimensions)
5. **Full Clean Text** (extracted clean markdown full text)
6. **Extracted Entities**: Mentioned tools/software, stocks/companies, people (name + identity), books/papers/resources
---降级策略
Degradation Strategy
当某个工具不可用时的处理方式:
| 工具不可用 | 影响 | 替代方案 |
|---|---|---|
| defuddle | 无法提取干净正文 | 降级到 WebFetch |
| WebFetch | 提取能力下降 | 使用 MCP fetch 或 agent-browser |
| MCP 搜索 | 搜索来源减少 | 用 WebSearch 处理所有查询 |
| ctx7 | 无库文档搜索 | 用 WebSearch + site:xxx 定向搜索 |
| agent-browser | 无法处理 JS 重度页面 | 告知用户,使用 WebFetch 尽力提取 |
| 全部搜索工具 | 无法搜索 | 告知用户,建议直接提供 URL |
不要因为某个工具失败就中断流程——始终尝试下一个降级方案,直到全部耗尽才告知用户。
Handling methods when a tool is unavailable:
| Tool Unavailable | Impact | Alternative Solution |
|---|---|---|
| defuddle | Cannot extract clean main content | Degrade to WebFetch |
| WebFetch | Reduced extraction capability | Use MCP fetch or agent-browser |
| MCP search | Reduced search sources | Use WebSearch for all queries |
| ctx7 | No library doc search | Use WebSearch + site:xxx targeted search |
| agent-browser | Cannot process JS-heavy pages | Inform users, use WebFetch to extract as much as possible |
| All search tools | Cannot search | Inform users, suggest providing URL directly |
Do not interrupt the process because a tool fails — always try the next degradation solution until all are exhausted before informing the user.
集成协议
Integration Protocol
本技能可被其他技能委托调用。调用方在自己的 SKILL.md 中指定"委托 search-and-fetch"即可。
This skill can be called by other skills. The delegator only needs to specify "delegate to search-and-fetch" in their own SKILL.md.
被委托时的行为
Behavior When Delegated
- 按调用方指定的模式(Search/Fetch)执行
- 使用集成模式输出格式
- 不直接与用户交互后续问题(由调用方处理)
- 如果内容提取完全失败,返回失败标记和原因,由调用方决定如何告知用户
- Execute according to the mode (Search/Fetch) specified by the delegator
- Use Integration Mode output format
- Do not directly interact with users about follow-up questions (handled by the delegator)
- If content extraction completely fails, return failure marker and reason, and the delegator decides how to inform the user