wps-doc-scraper — скилл для Claude Code: архивация WPS и ProcessOn
Скилл сохраняет публичные документы WPS/KDocs и встроенные карты ProcessOn как исходные данные, SVG или PNG и Markdown. Пригодится, когда ссылку нужно забрать без входа в аккаунт.
npx skills add daymade/claude-code-skills --skill wps-doc-scraper -a claude-codeЧто делает wps-doc-scraper
Скилл разбирает ссылки kdocs.cn и wps.processon.com. Сначала он определяет тип URL: для kdocs.cn/view/l/<share_id> читает метаданные публичной ссылки, для страниц ProcessOn вытаскивает file_id и group_id и идёт в data API. Дальше запускается scripts/wps_processon_extract.py, который скачивает JSON API, разбирает встроенное определение и пишет Markdown вместе с манифестом.
Для карт и канвасов сохраняется исходная картинка. Если страница отдаёт отрендеренный SVG, он сохраняется целиком как <title>-全画布.svg. Когда в SVG есть foreignObject, рендер через ImageMagick даст кривой текст, поэтому для PNG используется scripts/render_svg_tiles.py — он нарезает квадратные плитки через macOS Quick Look и сшивает их. Этот шаг работает только на macOS.
Внутри есть справочники по API ProcessOn, по захвату SVG в браузере и по полям манифеста. Правила жёсткие: скилл не логинится, не сохраняет документ в аккаунт и не обходит капчи или ограничения доступа. HTTP 200 сам по себе ничего не значит — ответ вида 用户未登录 или пустое определение распознаётся как стена логина. Markdown здесь структурная конвертация, а не пересказ: пропуски в данных скилл показывает открыто, а не замазывает гладким текстом.
Какие задачи решает
- сохранить публичную карту ProcessOn как SVG и PNG
- вытащить встроенное определение
.pofв JSON - сделать Markdown из документа KDocs без входа в аккаунт
- отличить стену логина от настоящего содержимого страницы
- собрать манифест архива с полным списком артефактов
Примеры запросов агенту
- забери эту ссылку kdocs.cn и сохрани всё в ./archive
- скачай карту с wps.processon.com и сделай Markdown
- отрендерь SVG в PNG плитками, текст через foreignObject плывёт
Как установить wps-doc-scraper
1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill wps-doc-scraper -a claude-code2Вручную: положить файлы
~/.claude/skills/wps-doc-scraper/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/wps-doc-scraper/
1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill wps-doc-scraper -a codex2Вручную: положить файлы
.agents/skills/wps-doc-scraper/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill wps-doc-scraper -a cursor2Вручную: положить файлы
.cursor/skills/wps-doc-scraper/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install daymade/claude-code-skills wps-doc-scraper2Вручную: положить файлы
.github/skills/wps-doc-scraper/SKILL.md1Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill wps-doc-scraper -a gemini-cli2Командой платформы
gemini skills install https://github.com/daymade/claude-code-skills --path wps-doc-scraperВручную: положить файлы
.devin/skills/wps-doc-scraper/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add daymade/claude-code-skills --skill wps-doc-scraper -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о wps-doc-scraper
Как установить wps-doc-scraper в Claude?
Выполните npx skills add daymade/claude-code-skills --skill wps-doc-scraper -a claude-code. Скилл окажется в ~/.claude/skills/wps-doc-scraper/SKILL.md.
Что делает wps-doc-scraper?
Архивирует публичные документы WPS/KDocs и встроенные карты ProcessOn: сохраняет JSON API, разобранное определение, исходный SVG или PNG и Markdown. Логин и сохранение в аккаунт не используются.
Что нужно для рендера PNG?
Скрипт render_svg_tiles.py опирается на macOS Quick Look, поэтому шаг с плитками рассчитан на macOS. Для SVG с foreignObject это единственный способ получить читаемый текст на картинке.
Исходный текст
SKILL.md · MIT
---
name: wps-doc-scraper
description: Faithfully archive public WPS/KDocs/金山文档 links, especially embedded ProcessOn .pof mind maps and canvases, as raw source data, original SVG/PNG, and Markdown. Use when a user gives a kdocs.cn or wps.processon.com link and asks to scrape, save, download, 扒下来, 归档, or 转 Markdown without logging in or saving the document to an account.
---
# WPS Doc Scraper
## Overview
Archive WPS/KDocs public documents with source fidelity. Prefer unauthenticated data APIs, keep the raw payloads, capture the original visual artifact when the document is a canvas or mind map, and generate Markdown only as a structured representation of the source.
This is an extraction skill, not a writing skill. Do not use an LLM to rewrite, summarize, smooth, or infer missing document content unless the user explicitly asks for a separate analysis after the archive is complete.
## Workflow Decision Tree
1. Identify the URL type.
- `kdocs.cn/view/l/<share_id>` or `kdocs.cn/l/<share_id>`: read public link metadata first.
- `wps.processon.com/diagrams/view?...`: extract `file_id` and `group_id`, then use the ProcessOn data API.
- `wps.processon.com/wpsapi/diagrams/view/api?...`: treat as the source API directly.
- Other WPS/KDocs pages: collect public metadata, try official public export/download only when available, then use browser DOM capture as a fallback.
2. For ProcessOn `.pof` mind maps or canvases, run the API extractor:
```bash
python3 /path/to/wps-doc-scraper/scripts/wps_processon_extract.py \
--url "https://www.kdocs.cn/view/l/..." \
--output-dir "/path/to/archive-dir"
```
Expected outputs: `processon-api.json`, `processon-definition.json`, `capture-manifest.json`, and `<title>.md`.
3. Capture the original image.
- If the page exposes a rendered SVG, save the serialized full SVG as `<title>-全画布.svg`.
- If the SVG uses `foreignObject`, do not trust ImageMagick alone for text rendering. Use `scripts/render_svg_tiles.py` to make the PNG through macOS Quick Look square tiles.
```bash
python3 /path/to/wps-doc-scraper/scripts/render_svg_tiles.py \
--svg "/path/to/<title>-全画布.svg" \
--output "/path/to/<title>-全画布.png"
```
4. Validate the archive.
- Markdown is a structural conversion, not an editorial rewrite.
- The original image exists for visual documents.
- Raw JSON and manifest exist.
- No output text contains the Unicode replacement character `�`.
- Any failed or permission-limited path is recorded in the manifest or final response.
## Hard Rules
- Never log in, save to an account, copy into the user's cloud drive, or mutate the remote document unless the user explicitly requests it.
- Never bypass CAPTCHAs, paywalls, tenant restrictions, or permission walls. A public link that requires login is a hard boundary unless the user provides authorized access.
- Do not infer hidden nodes or missing text. Preserve what the API or rendered DOM actually exposes.
- HTTP 200 is not enough. Detect login-wall payloads such as `用户未登录`, empty definitions, and placeholder shells.
- Keep raw source artifacts before transformation: API JSON, parsed definition JSON, serialized SVG, screenshots or PNGs, and a capture manifest.
- For browser fallback, capture DOM/source data before screenshots when possible; screenshots alone are not a faithful text archive.
- Report extraction gaps plainly. Do not silently produce a polished Markdown file from partial data.
## Bundled Resources
### scripts/
- `wps_processon_extract.py`: deterministic extractor for public WPS/KDocs ProcessOn `.pof` mind maps. It resolves KDocs share metadata, downloads the ProcessOn data API JSON, parses the embedded definition, and writes Markdown plus a manifest.
- `render_svg_tiles.py`: macOS Quick Look based SVG-to-PNG renderer for full-canvas SVGs with `foreignObject` text. It renders square vertical tiles and stitches them into one PNG.
### references/
- `processon-mindmap-api.md`: endpoint pattern and payload shape for WPS-hosted ProcessOn files.
- `rendered-svg-capture.md`: browser-side process for extracting the rendered full-canvas SVG and producing a PNG.
- `capture-manifest.md`: minimum manifest fields and acceptance checks.
- `permission-and-failure-boundaries.md`: login walls, forbidden escalation, and failure reporting rules.
© daymade · MIT · daymade/claude-code-skills