zhihaoairobotic/clawphd/pdf2md
Claude Code and agent skill by zhihaoairobotic/clawphd
- community
Checking that the SKILL.md file is still in the repository.
Convert a local paper PDF to structured Markdown and export all figures as PNG + SVG + drawio. Attempts editable figure reconstruction via the built-in autofigure pipeline (SAM3 → RMBG-2.0 → VLM → SVG), falling back to a layered-SVG wrapper when API keys are unavailable. Use when the user wants to parse a paper PDF, extract its text as Markdown, or get editable/exportable figure assets.
Install
npx vskill@latest install zhihaoairobotic/clawphd/pdf2mdSKILL.md
PDF → Markdown & Editable Figures
One tool. Uses pdf_to_markdown with your local PDF. Core Markdown conversion needs no cloud API. Editable figure reconstruction uses the built-in autofigure pipeline when vlm_provider + fal_api_key are configured; otherwise degrades gracefully to a layered-SVG fallback.
When to use
Trigger words / phrases (Chinese or English):
- 论文 PDF 转 Markdown / PDF 转 md
- 把这篇论文转成 Markdown
- 提取论文图片 / 导出论文的图
- 导出可编辑图 / 可编辑 SVG / 可编辑 drawio
- pdf to markdown / parse paper PDF / extract paper figures
- 把 PDF 解析成结构化文本
Tool
Parameters
| Parameter | Type | Default | Notes | |||
|---|---|---|---|---|---|---|
pdf_path | string | required | Absolute or workspace-relative path to the PDF | |||
out_root | string | outputs/pdf2md | Root output dir; paper lands in <out_root>/<original_pdf_stem>/ | |||
backend | "docling" \ | "mineru" | "docling" | Markdown engine; mineru requires separate CLI install | ||
export_figures | bool | true | Extract labelled figures to assets/figures/ | |||
figure_box_source | "auto" \ | "docling" \ | "fitz" | "auto" | How figure boxes are located | |
export_svg | bool | true | Attempt SVG per figure (mutool → pdf2svg → fitz → PNG wrapper) | |||
export_drawio | bool | true | Attempt drawio per figure (built-in editable conversion from SVG) | |||
| `enable_rebuild` | bool | `true` | Run editable reconstruction (see below). DEFAULT IS TRUE. |
`enable_rebuild` defaults to `true`. When the autofigure pipeline isfully configured (needsfal_api_keyin config + a VLM provider), it runsSAM3 segmentation → RMBG-2.0 background removal → VLM SVG template →icon replacement. When not configured it falls back to a two-layer SVGthat embeds the raster PNG with an empty vector overlay. The fallbacknever crashes the pipeline.
Editable rebuild pipeline
The autofigure pipeline runs entirely in-process (no external CLI needed):
| Step | Module | What it does | |
|---|---|---|---|
| 1 | SegmentFigureTool | SAM3 via fal.ai — detects icons/elements | |
| 2 | CropRemoveBgTool | RMBG-2.0 (local torch) — removes backgrounds | |
| 3 | GenerateSVGTemplateTool | VLM reconstructs figure layout as SVG | |
| 4 | ReplaceIconsSVGTool | Embeds transparent icon PNGs into SVG |
Requirements for full autofigure rebuild:
fal_api_keyset in~/.clawphd/config.jsonundertools.autofigure- A multimodal VLM provider configured (openrouter / gemini recommended)
pip install clawphd-ai[autofigure](torch / torchvision / transformers)
Output directory layout
paper_id (sha1(pdf_bytes)[:12]) is returned in metadata for traceability.
SVG export priority
- mutool draw — highest-quality vector SVG, full-page then viewBox-cropped
- pdf2svg — alternative CLI, full-page then viewBox-cropped
- fitz (PyMuPDF built-in) — per-figure cropbox SVG
- PNG-embedding SVG — final fallback, always works
run.json fields
Typical workflow
Simplest call (all defaults)
Produces <stem>.md, copied PDF, all figures as PNG + SVG, and a rebuilt.svg per figure (autofigure if configured, else layered-SVG fallback).
With drawio export
Disable rebuild (faster, skips reconstruction step)
Use MinerU backend
Requires the MinerU CLI (mineru or magic-pdf) on PATH. Falls back to docling automatically if MinerU is absent or fails.
Return value (JSON string)
Report the out_dir and md_path to the user so they know where to find the outputs. If warnings is non-empty, summarise them briefly.
Example conversation
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclawphd/skills/pdf2md/SKILL.md
Popularity
- Repository stars
- 157
- Repository forks
- 11
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zhihaoairobotic/clawphd/pdf2md)