# Send Markdown Fetch to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "markdown-fetch",
    "name": "Markdown Fetch",
    "source": "tencent",
    "type": "skill",
    "category": "AI 智能",
    "sourceUrl": "https://clawhub.ai/howtimeschange/markdown-fetch",
    "canonicalUrl": "https://clawhub.ai/howtimeschange/markdown-fetch",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/markdown-fetch",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=markdown-fetch",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "index.js",
      "test.js"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "markdown-fetch",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-02T08:20:48.826Z",
      "expiresAt": "2026-05-09T08:20:48.826Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=markdown-fetch",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=markdown-fetch",
        "contentDisposition": "attachment; filename=\"markdown-fetch-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "markdown-fetch"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/markdown-fetch"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/markdown-fetch",
    "downloadUrl": "https://openagent3.xyz/downloads/markdown-fetch",
    "agentUrl": "https://openagent3.xyz/skills/markdown-fetch/agent",
    "manifestUrl": "https://openagent3.xyz/skills/markdown-fetch/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/markdown-fetch/agent.md"
  }
}
```
## Documentation

### 背景

Cloudflare 推出 Markdown for Agents 功能：

AI 请求时返回 Markdown 格式
Token 消耗比 HTML 减少约 80%

### 使用方法

在需要网页抓取时，使用优化后的 fetch 函数：

const { optimizedFetch } = require('./markdown-fetch');

const result = await optimizedFetch('https://example.com');
// result.markdown - Markdown 内容（如果有）
// result.html - HTML 内容（备用）
// result.tokensSaved - 节省的 tokens（如果有）

### 核心逻辑

async function optimizedFetch(url, options = {}) {
  const headers = {
    'Accept': 'text/markdown, text/html',
    ...options.headers
  };

  const response = await fetch(url, { ...options, headers });
  
  const contentType = response.headers.get('content-type');
  const xMarkdownTokens = response.headers.get('x-markdown-tokens');
  
  let result = {
    url,
    contentType,
    tokensSaved: xMarkdownTokens ? parseInt(xMarkdownTokens) : null
  };
  
  if (contentType.includes('text/markdown')) {
    result.markdown = await response.text();
    result.format = 'markdown';
  } else {
    result.html = await response.text();
    result.format = 'html';
  }
  
  return result;
}

### 响应处理

Content-Type处理方式text/markdown直接使用，跳过 HTML 解析text/html走原有解析逻辑

### 可选：x-markdown-tokens 日志

如果响应中有 x-markdown-tokens header，记录到日志：

if (result.tokensSaved) {
  console.log(\`[Markdown Fetch] Token 节省: ${result.tokensSaved}\`);
}

### 改动范围

找到所有 HTTP 请求（fetch/axios/request）
统一添加 header
响应处理加判断

### 测试验证

找一个 Cloudflare 托管的网站测试：

curl -H "Accept: text/markdown, text/html" https://cloudflare-example.com

确认收到 content-type: text/markdown 响应。
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: howtimeschange
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-02T08:20:48.826Z
- Expires at: 2026-05-09T08:20:48.826Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/markdown-fetch)
- [Send to Agent page](https://openagent3.xyz/skills/markdown-fetch/agent)
- [JSON manifest](https://openagent3.xyz/skills/markdown-fetch/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/markdown-fetch/agent.md)
- [Download page](https://openagent3.xyz/downloads/markdown-fetch)