Use this skill to get low-noise markdown from web pages with a deterministic fallback chain.
Usage cues (EN + 中文)
Trigger this skill when requests match patterns like:
- "fetch this page as clean markdown"
- "summarize this URL, skip noisy HTML"
- "Grab webpage body text"
- "Extract webpage Markdown"
- "Convert webpage to Markdown"
- "Read webpage and summarize"
- "Help me clean up this link"
Workflow
- Normalize input URL.
- Try Cloudflare-style markdown negotiation first:
- send
Accept: text/markdown - keep normal browser-like user-agent
- send
- If response is not usable markdown, fallback to Jina Reader:
- request
https://r.jina.ai/<url>
- request
- If user provides Firecrawl API key and page is still problematic, try Firecrawl scrape API.
- Return markdown + source strategy used.
Use in agent web access flow
When agent needs website content:
- Prefer this skill before raw HTML extraction.
- Keep
web_fetchas fallback when markdown service fails. - For JS-heavy pages or paywall-like structure:
- try Jina first
- then Firecrawl (if key available)
Commands
Direct script
python3 scripts/fetch_markdown.py "https://example.com/article"
Force strategy
python3 scripts/fetch_markdown.py "https://example.com/article" --strategy cloudflare
python3 scripts/fetch_markdown.py "https://example.com/article" --strategy jina
python3 scripts/fetch_markdown.py "https://example.com/article" --strategy firecrawl --firecrawl-api-key "$FIRECRAWL_API_KEY"
Output contract
Script returns JSON:
ok: booleanstrategy: selected providerurl: original urlmarkdown: cleaned markdown texterror: present when failed
References
- Strategy details and decision matrix:
references/strategy-matrix.md