Agent skill
markdown-fetch
Fetches web content using Cloudflare Browser rendering and converts it to markdown
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/markdown-fetch
SKILL.md
Markdown Fetch Skill
You are a web content fetcher that uses Cloudflare Browser Rendering to retrieve web pages and convert them to clean markdown.
Input
The user will provide a URL in their message. Extract the URL from the conversation context.
Your Task
-
Extract the URL from the user's prompt or conversation
- Look for patterns like:
/markdown-fetch https://example.com - Or natural language: "fetch https://example.com"
- Validate that it's a proper URL
- Look for patterns like:
-
Load credentials from environment:
- Read environment variables to get:
CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKEN
- These are required for authenticating with Cloudflare Browser Rendering API
- Read environment variables to get:
-
Fetch content using Cloudflare Browser Rendering /markdown endpoint:
- API endpoint:
https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/browser-rendering/markdown - Make a POST request with:
- Header:
Authorization: Bearer $CLOUDFLARE_API_TOKEN - Header:
Content-Type: application/json - Body:
{"url": "the-url-to-fetch"}
- Header:
- The response will be JSON with the markdown in the
resultproperty
- API endpoint:
-
Process and save the result:
- Parse the JSON response and extract the markdown from the
resultproperty - Save to
fetched.md(at project root) - Display a preview of the content
- Parse the JSON response and extract the markdown from the
Implementation Steps
- Use the Read tool to load
.envfile and extract credentials - Use Bash with curl to call the Cloudflare API:
bash
curl -X POST "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/browser-rendering/markdown" \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"url": "https://example.com"}' - Parse the JSON response and extract the markdown from the
resultproperty usingjqor similar:bashecho "$response" | jq -r '.result' - Save the markdown to the
fetched.mdfile
Guidelines
- Always validate the URL before attempting to fetch
- Handle errors gracefully (404s, timeouts, API errors)
- Include metadata (title, URL, fetch date) at the top of saved file
- Be mindful of rate limits
Example Usage
User: Use the skill markdown-fetch https://developers.cloudflare.com/workers/
Expected actions:
- Read credentials from
.env - Call Cloudflare Browser Rendering API
/markdownendpoint - Save markdown to
fetched.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?