search-and-fetch

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Search & 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

本技能编排以下几类工具,按需组合使用:
类别工具说明
内置搜索
WebSearch
DuckDuckGo 搜索,始终可用
MCP 搜索当前环境中可用的 MCP 搜索工具中文搜索、专业搜索等,按可用性自动选用
技术文档
ctx7
CLI
编程库/框架官方文档查询
浏览器
agent-browser
CLI
访问搜索引擎、提取 JS 重度页面(Rust 原生,token 高效)
内容提取
defuddle
CLI →
WebFetch
→ MCP fetch →
agent-browser
按优先级降级
具体调用语法参见
references/tool-catalog.md
This skill orchestrates the following types of tools, combining them as needed:
CategoryToolDescription
Built-in Search
WebSearch
DuckDuckGo search, always available
MCP SearchAvailable MCP search tools in the current environmentChinese search, professional search, etc., automatically selected based on availability
Technical Docs
ctx7
CLI
Query official docs for programming libraries/frameworks
Browser
agent-browser
CLI
Access search engines, extract content from JS-heavy pages (Rust native, token-efficient)
Content Extraction
defuddle
CLI →
WebFetch
→ MCP fetch →
agent-browser
Degrade by priority
Refer to
references/tool-catalog.md
for specific invocation syntax.

意图检测

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、内网地址、文件路径)不触发
ScenarioHandling
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 intentAsk: "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
其他技能委托调用按委托方指定的模式执行

ScenarioHandling
User asks questions, researches topics, needs to find informationSearch Mode
Provides URL + "search for more similar content"First Fetch then Search
Delegated call by other skillsExecute 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、框架用法
ctx7
(library → docs)+
WebSearch
中文内容中文查询,或中国特定话题MCP 搜索 +
WebSearch
并行
通用查询其他一般性问题
WebSearch
+ MCP 搜索 并行
深度研究用户明确要求全面/深入调研全部工具并行,含
agent-browser
访问 Google/Bing
Judge the type based on query content, select tool combinations:
Query TypeJudgment BasisTool Combination
Technical DocsInvolves programming libraries, APIs, framework usage
ctx7
(library → docs) +
WebSearch
Chinese ContentChinese query, or China-specific topicsMCP search +
WebSearch
in parallel
General QueryOther general questions
WebSearch
+ MCP search in parallel
In-depth ResearchUser explicitly requests comprehensive/in-depth researchAll tools in parallel, including
agent-browser
to access Google/Bing

Step 2 — 并行执行搜索

Step 2 — Parallel Search Execution

根据分类结果,在同一轮响应中并行调用多个搜索工具。工具调用细节参见
references/tool-catalog.md
关键原则
  • 独立工具并行调用,不等待
  • context7 有顺序依赖:先
    ctx7 library
    解析库 ID,再
    ctx7 docs
    查询内容(每个问题最多 3 次调用)
  • 对同一查询可以为不同搜索引擎调整措辞(如中文查询给 MCP 搜索原文,给 WebSearch 翻译为英文)
  • 深度研究时使用
    agent-browser
    打开 Google/Bing 搜索页,通过
    snapshot
    获取元素引用后提取结果
Based on classification results, call multiple search tools in parallel within the same response round. Refer to
references/tool-catalog.md
for tool invocation details.
Key Principles:
  • Call independent tools in parallel, no waiting
  • context7 has sequential dependencies: first
    ctx7 library
    to resolve library ID, then
    ctx7 docs
    to query content (max 3 calls per question)
  • 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
    agent-browser
    to open Google/Bing search pages, extract results after getting element references via
    snapshot

Step 3 — 结果综合

Step 3 — Result Synthesis

  1. 去重:按 URL 去重,合并来自不同来源的同一页面信息
  2. 分组:按子主题或关联度分组
  3. 排序:按相关性和信息质量排序
  4. 输出格式
markdown
undefined
  1. Deduplication: Deduplicate by URL, merge information from the same page from different sources
  2. Grouping: Group by sub-topic or relevance
  3. Sorting: Sort by relevance and information quality
  4. 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]

  • ...

来源列表
  1. 标题 — 简述
  2. 标题 — 简述
undefined
  • ...

Source List
  1. Title — Brief description
  2. Title — Brief description
undefined

Step 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.md
Attempt 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 pages
Record which tool was used after successful extraction, to transparently inform users.
Refer to
references/tool-catalog.md
for tool invocation details.

Step 2 — 结构化分析

Step 2 — Structured Analysis

根据内容类型选择性应用分析维度。详细模板参见
references/analysis-template.md
内容类型适用维度
文章、评论、论文全部五维(文本解构 → 概念提炼 → 批判审视 → 思想深化 → 实践转化)
新闻、产品页文本解构 + 概念提炼 + 实践转化
教程、技术文档文本解构 + 概念提炼 + 实践转化
数据页、API 文档、参考表跳过分析,直接呈现提取内容
Selectively apply analysis dimensions based on content type. See
references/analysis-template.md
for detailed templates.
Content TypeApplicable Dimensions
Articles, comments, papersAll five dimensions (text deconstruction → concept extraction → critical examination → idea deepening → practical transformation)
News, product pagesText deconstruction + concept extraction + practical transformation
Tutorials, technical docsText deconstruction + concept extraction + practical transformation
Data pages, API docs, reference tablesSkip analysis, directly present extracted content

Step 3 — 输出

Step 3 — Output

两种输出模式:
独立模式(用户直接使用时):
markdown
undefined
Two 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 UnavailableImpactAlternative Solution
defuddleCannot extract clean main contentDegrade to WebFetch
WebFetchReduced extraction capabilityUse MCP fetch or agent-browser
MCP searchReduced search sourcesUse WebSearch for all queries
ctx7No library doc searchUse WebSearch + site:xxx targeted search
agent-browserCannot process JS-heavy pagesInform users, use WebFetch to extract as much as possible
All search toolsCannot searchInform 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