HTML to Skill

html-to-skill

Give it a URL and it packages the whole website into a skill an agent can call.

SkillShellMIT★ 0Updated

GitHub repository

Install as a Claude Code skill

git clone https://github.com/weitzu-com/html-to-skill.git ~/.claude/skills/html-to-skill

The README below is shown in its original language.

把任意网站的完整内容(文字、图片、视频元数据)打包成一个 Claude Code Skill。

一句话

输入一个 URL → 7 阶段流水线 → 输出一个 .claude/skills/<name>/ 目录,Agent 可调用。

流水线

URL → ①勘测 → ②镜像 → ③提取 → ④压缩 → ⑤索引 → ⑥打包 → ⑦验证 → Skill
阶段 工具 产出
① 勘测 curl + 启发式 recon.md
② 镜像 wget / Scrapling / OpenCLI raw/
③ 提取 BS4 / Scrapling Parser extracted/
④ 压缩 LLM 语义蒸馏 compressed/
⑤ 索引 倒排表 + 关键词 compressed/references/index.md
⑥ 打包 Python 脚本 skill-/
⑦ 验证 Shell + Python verify.md

安装

# 克隆到 skills 目录
git clone https://github.com/weitzu-com/html-to-skill.git ~/.claude/skills/html-to-skill

# 依赖(按需)
pip install "scrapling[all]"      # 方案D 反爬绕过
npm install -g @jackwener/opencli  # 方案E 浏览器操控
npm install -g @mdream/crawl       # 方案C 全站爬取(可选)

使用方法

在 Claude Code 对话中:

"把 https://docs.example.com 打包成 skill"
"mirror this site as a skill"
"把这个文档站做成技能" 极速模式

抓取方案选择

方案 场景 速度
A: wget 纯静态、无JS、无反爬 ~200页/分钟
B: docsite-to-md 文档站(Mintlify/GitBook等) ~100页/分钟
C: mdream 通用站 ~50页/分钟
D: Scrapling 反爬/Cloudflare ~20页/分钟
E: OpenCLI 登录墙/SPA ~5页/分钟

输出结构

skill-<sitename>/
├── SKILL.md              ← Agent 入口(能力/触发词/使用方式)
├── llms.txt              ← L1 站点摘要(~2k tokens)
├── llms-full.txt         ← L2 全站文本(~50k tokens)
├── references/           ← L3 详细文件 + 倒排索引
├── assets/               ← L4 图片/视频 JSON
├── scripts/update.sh     ← 增量更新
├── .metadata.json        ← 源信息
└── README.md

执行模式

模式 触发词 适用
极速 极速 <100页静态站,~30min
标准 默认 中等规模,~2h
严审 严审 对外发布,质量优先
增量 增量 已有 Skill 刷新

第一性原理

  1. 网站 = 有向图 G(V,E) — 全量打包 ≡ 图遍历 + 节点 DOM→结构化知识
  2. DOM 是呈现态,不是知识态 — HTML→MD 是剥离样式、保留信息的过程
  3. 全量 ≠ 全文 — 压缩是 LLM 语义蒸馏,不是机械截断
  4. Skill 是再生能力 — 不是内容快照,是"网站变了怎么重新理解它"的方法
  5. 门禁是脊梁 — 每阶段 PASS/FAIL + 退回动作 + 上限

许可证

MIT — 详见 LICENSE

相关

Synced automatically from the README of github.com/weitzu-com/html-to-skill.