agentleFS
shalombshalomb/agent-skills/skills/web-to-markdown/SKILL.md

web-to-markdown

Skill3 starsChanged 3 months agoMITView on GitHub

Convert URLs or local files (PDF/DOCX/PPTX/HTML) to Markdown, with optional summarization. Single or batch processing. Uses markitdown for intelligent extraction, falls back to curl+pandoc. Use when fetching web pages as markdown, converting documents for analysis, or producing quick summaries.

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when you need to:

    line 19
  2. Distinctive:

    Use the wrapper script for summarization with context:

    line 40
  3. Very specific:

    Add to .bashrc / .zshrc:

    line 57

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Web to Markdown

Convert URLs and local files to Markdown for analysis, quoting, or processing. Optionally summarize long documents before deeper work.

When to use

Use this skill when you need to:

  • pull down a web page as a document-like Markdown representation
  • convert binary docs (PDF/DOCX/PPTX) into Markdown for analysis
  • quickly produce a short summary of a long document before deeper work

Quick Usage

Convert a URL or file

uvx --from 'markitdown[pdf]' markitdown <url-or-path>

Save to a specific file:

uvx --from 'markitdown[pdf]' markitdown <url-or-path> > /tmp/doc.md

Convert + summarize

Use the wrapper script for summarization with context:

node scripts/to-markdown.mjs <url-or-path> --summary --prompt "Focus on security implications"
node scripts/to-markdown.mjs <url-or-path> --tmp     # write to temp file, print path
node scripts/to-markdown.mjs <url-or-path> --out notes.md

The summarizer:

  1. Converts to Markdown via markitdown
  2. Saves full Markdown to a temp file (prints path as hint so you can inspect the full content)
  3. Runs pi --model claude-haiku-4-5 to summarize with your prompt

Always provide context — summaries are only useful when you provide what you want extracted and the audience/purpose. Without a focus prompt, summaries become generic and unhelpful.

Batch processing (shell function)

Add to .bashrc / .zshrc:

web-to-markdown() {
  local url output_dir format batch_file output_file
  output_dir="." format="markdown"

  while [[ $# -gt 0 ]]; do
    case $1 in
      --batch) batch_file="$2"; shift 2 ;;
      --output-dir) output_dir="$2"; shift 2 ;;
      --format) format="$2"; shift 2 ;;
      --output) output_file="$2"; shift 2 ;;
      *) url="$1"; shift ;;
    esac
  done

  _fetch() {
    local u=$1 fmt=$2
    local content
    content=$(uvx --from 'markitdown[pdf]' markitdown "$u" 2>/dev/null) \
      || content=$(curl -sL "$u" | pandoc -f html -t markdown)
    [[ -z "$content" ]] && return 1
    [[ "$fmt" == "plain" ]] && echo "$content" | pandoc -f markdown -t plain || echo "$content"
  }

  if [[ -n "${batch_file-}" ]]; then
    [[ ! -f "$batch_file" ]] && { echo "ERROR: $batch_file not found" >&2; return 1; }
    mkdir -p "$output_dir"
    local ok=0 fail=0
    while IFS= read -r u || [[ -n "$u" ]]; do
      [[ -z "$u" || "$u" =~ ^# ]] && continue
      local name ext out
      name=$(echo "$u" | sed 's|https\?://||;s|/|-|g' | cut -c1-100)
      ext=$([[ "$format" == "plain" ]] && echo txt || echo md)
      out="$output_dir/${name}.${ext}"
      if _fetch "$u" "$format" > "$out" 2>/dev/null; then
        echo "✓ $(basename "$out")" >&2; (( ++ok ))
      else
        echo "✗ $u" >&2; rm -f "$out"; (( ++fail ))
      fi
    done < "$batch_file"
    echo "Done: $ok ok, $fail failed" >&2
    return $(( fail > 0 ? 1 : 0 ))
  fi

  [[ -z "${url-}" ]] && { echo "Usage: web-to-markdown <URL> [--output FILE] [--format markdown|plain]" >&2; return 1; }
  [[ -z "${output_file-}" ]] && {
    local name ext
    name=$(echo "$url" | sed 's|https\?://||;s|/|-|g' | cut -c1-100)
    ext=$([[ "$format" == "plain" ]] && echo txt || echo md)
    output_file="${name}.${ext}"
  }
  _fetch "$url" "$format" > "$output_file" && echo "✓ Saved: $output_file" || { rm -f "$output_file"; return 1; }
}

Examples:

web-to-markdown "https://example.com/article" --output article.md
web-to-markdown --batch urls.txt --output-dir ./docs --format markdown
web-to-markdown "https://example.com" --format plain

Dependencies

  • markitdown (auto-installed via uvx) — smart content extraction
  • curl + pandoc — fallback for when markitdown fails
  • pi — only needed for --summary mode

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.