Markdown Browser Skills
This skill is an orchestration layer, not a replacement fetcher. It always keeps official web_fetch as the fetch source of truth.
MECE Architecture
- 1. Fetch layer (official, exclusive)
- - Use OpenClaw
web_fetch to retrieve the page. - Do not call direct HTTP fetch inside this skill for normal operation.
- 2. Policy layer (these skills)
- - Parse
Content-Signal and compute policy_action. - Current action focuses on
ai-input semantics: allow_input, block_input, needs_review.
- 3. Privacy layer (these skills)
- - Redact path/fragment/query values in output URL fields.
- Keep URL shape useful for debugging without leaking sensitive values.
- 4. Normalization layer (these skills)
- - If
contentType=text/markdown, keep content as-is. - If
contentType=text/html, convert with turndown as fallback enhancement. - For other content types, pass through text.
Execution Order
- 1. Call official
web_fetch. - Pass the result JSON into this wrapper.
- Optionally pass
Content-Signal and x-markdown-tokens header values if available. - Use the returned normalized object for downstream agent logic.
Wrapper Tool
INLINECODE14
Input:
- -
web_fetch_result (required): JSON payload returned by OpenClaw web_fetch. - INLINECODE17 (optional): raw
Content-Signal header string. - INLINECODE19 (optional): raw
x-markdown-tokens header value.
Output:
- - INLINECODE21
- INLINECODE22 (
markdown | html-fallback | text) - INLINECODE26 (
number | null) - INLINECODE28
- INLINECODE29
- INLINECODE30 (redacted)
- INLINECODE31
- INLINECODE32
CLI Usage
CODEBLOCK0
Markdown 浏览器技能
该技能是一个编排层,而非替代性抓取工具。它始终将官方的 web_fetch 作为抓取数据源的真实依据。
MECE 架构
- 1. 抓取层(官方,独占)
- 使用 OpenClaw web_fetch 获取页面。
- 在正常操作中,不要在此技能内部直接调用 HTTP 抓取。
- 2. 策略层(本技能)
- 解析 Content-Signal 并计算 policy_action。
- 当前操作聚焦于 ai-input 语义:allow
input、blockinput、needs_review。
- 3. 隐私层(本技能)
- 对输出 URL 字段中的路径/片段/查询值进行脱敏处理。
- 保留 URL 形状以便调试,同时不泄露敏感值。
- 4. 标准化层(本技能)
- 如果 contentType=text/markdown,保持内容不变。
- 如果 contentType=text/html,使用 turndown 作为回退增强进行转换。
- 对于其他内容类型,直接透传文本。
执行顺序
- 1. 调用官方 web_fetch。
- 将结果 JSON 传入此包装器。
- 可选地传入 Content-Signal 和 x-markdown-tokens 头部值(如果可用)。
- 使用返回的标准化对象进行下游代理逻辑处理。
包装器工具
processwebfetchresult({ webfetchresult, contentsignalheader, markdowntokens_header })
输入:
- - webfetchresult(必需):OpenClaw webfetch 返回的 JSON 负载。
- contentsignalheader(可选):原始的 Content-Signal 头部字符串。
- markdowntokens_header(可选):原始的 x-markdown-tokens 头部值。
输出:
- - content
- format(markdown | html-fallback | text)
- tokenestimate(number | null)
- contentsignal
- policyaction
- sourceurl(已脱敏)
- statuscode
- fallbackused
CLI 使用方式
bash
在技能目录内安装一次运行时依赖
npm install --omit=dev
1) 首先获取 web_fetch 负载(从 OpenClaw 运行时)
2) 将其保存为 /tmp/web_fetch.json
3) 运行包装器后处理
node browser.js \
--input /tmp/web_fetch.json \
--content-signal ai-input=yes, search=yes, ai-train=no \
--markdown-tokens 1820