# Webpage To Markdown

> A Claude skill from kay-ou/ClaudeSkills.

- **Type:** Skill
- **Install:** `agentstack add skill-kay-ou-claudeskills-webpage-to-markdown`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [kay-ou](https://agentstack.voostack.com/s/kay-ou)
- **Installs:** 0
- **Category:** [Content & Media](https://agentstack.voostack.com/c/content-and-media)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [kay-ou](https://github.com/kay-ou)
- **Source:** https://github.com/kay-ou/ClaudeSkills/tree/main/.claude/skills/webpage-to-markdown

## Install

```sh
agentstack add skill-kay-ou-claudeskills-webpage-to-markdown
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

name: webpage-to-markdown
description: Convert web pages to clean Markdown format, extracting main content while preserving structure. This skill should be used when users need to convert web pages to markdown, extract content from websites, save web articles as markdown, convert HTML to markdown, archive web content, or process online documentation. Keywords: 网页转markdown, 网页转换, HTML转markdown, 提取网页内容, 保存网页为markdown, convert webpage to markdown, extract web content, save article as markdown, HTML to markdown conversion, web scraping to markdown, 网页内容提取, 在线文档转换
inputs:
  - url
  - options (optional)
outputs:
  - markdown_content
  - metadata
instructions: |
  # Webpage to Markdown Converter
  
  This skill fetches web pages and converts them to clean, readable Markdown format. It uses readability algorithms to extract the main content while preserving the document structure and formatting.
  
  ## When to Use This Skill
  
  Use this skill when you need to:
  - Convert web articles or documentation to Markdown
  - Extract readable content from web pages
  - Process web content for analysis or transformation
  - Archive web content in a readable format
  - Prepare web content for further processing
  
  ## Processing Steps
  
  ### Step 1: Fetch Web Page Content
  - Validate the provided URL format
  - Send HTTP GET request with appropriate headers
  - Handle redirects and follow them safely
  - Manage different character encodings
  - Handle network errors and timeouts gracefully
  
  ### Step 2: Parse HTML Structure
  - Parse HTML using a robust parser
  - Identify the main content area using readability heuristics
  - Remove navigation, ads, sidebars, and other non-content elements
  - Preserve the document's logical structure
  - Handle malformed HTML gracefully
  
  ### Step 3: Extract Main Content
  - Use readability algorithms to identify primary content
  - Preserve headings and their hierarchy (H1-H6)
  - Maintain paragraph structure and flow
  - Keep important formatting elements
  - Extract images with their alt text and sources
  - Preserve links with proper anchor text
  
  ### Step 4: Convert to Markdown
  - Convert headings to appropriate Markdown levels
  - Transform paragraphs to Markdown format
  - Convert lists (ordered and unordered) to Markdown syntax
  - Handle code blocks with language detection
  - Convert tables to Markdown table format
  - Preserve emphasis (bold, italic) formatting
  - Handle blockquotes appropriately
  
  ### Step 5: Generate Clean Output
  - Remove excessive whitespace and blank lines
  - Ensure consistent formatting throughout
  - Validate Markdown syntax
  - Optimize for readability
  - Preserve important semantic information
  
  ## Optional Parameters
  
  The options parameter can include:
  - `include_images`: Whether to include images (default: true)
  - `preserve_links`: Whether to keep all links (default: true)
  - `extract_metadata`: Whether to extract page metadata (default: true)
  - `content_selector`: CSS selector for specific content extraction
  - `exclude_selectors`: CSS selectors for elements to exclude
  
  ## Output Format
  
  Returns an object containing:
  ```json
  {
    "markdown_content": "# Article Title\n\nArticle content in Markdown format...",
    "metadata": {
      "title": "Original Page Title",
      "author": "Article Author",
      "publish_date": "2024-01-15",
      "url": "https://example.com/article",
      "word_count": 1250,
      "reading_time": 5,
      "extraction_success": true
    }
  }
  ```
  
  ## Content Preservation
  
  The converter preserves:
  - **Headings**: Maintains heading hierarchy (H1 → #, H2 → ##, etc.)
  - **Paragraphs**: Clean paragraph breaks and spacing
  - **Lists**: Both ordered (1., 2., 3.) and unordered (-, *, +) lists
  - **Code Blocks**: With language detection and proper fencing
  - **Links**: Internal and external links with descriptive text
  - **Images**: With alt text and source URLs
  - **Tables**: Converted to Markdown table syntax
  - **Emphasis**: Bold (**text**) and italic (*text*) formatting
  - **Blockquotes**: Preserved with > syntax
  
  ## Error Handling
  
  - Invalid URLs: Return appropriate error messages
  - Network failures: Handle timeouts and connection issues
  - Malformed HTML: Gracefully handle poorly formatted pages
  - Missing content: Return meaningful error if no content found
  - Encoding issues: Handle various character encodings
  - Large pages: Manage memory efficiently for large documents

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [kay-ou](https://github.com/kay-ou)
- **Source:** [kay-ou/ClaudeSkills](https://github.com/kay-ou/ClaudeSkills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-kay-ou-claudeskills-webpage-to-markdown
- Seller: https://agentstack.voostack.com/s/kay-ou
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
