Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计异常

documentation-scraper文档刮刀

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

1,187

周安装

48

GitHub Stars

35

下载量

372
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:documentation-scraper(文档刮刀)
来源仓库:https://github.com/ratacat/claude-skills
仓库路径:skills/documentation-scraper
安装命令:
npx skills add https://github.com/ratacat/claude-skills --skill documentation-scraper
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/ratacat/claude-skills --skill documentation-scraper

简介

通过 slurp-ai 工具抓取网站文档并整合为单文件供 AI 上下文消费使用。

  • 采用确定性算法而非 AI 进行抓取,保证结果轻量快速且无幻觉风险。
  • 必须在外网环境运行,因沙箱会阻断必要的网络访问权限。
  • 包含安装检测、站点分析和实际抓取等多个阶段的操作指引说明。
  • documentation-scraper 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Documentation Scraper with slurp-ai

Overview

slurp-ai scrapes documentation websites and compiles them into a single markdown file optimized for AI agent context. It is lightweight, fast, and deterministic - it does NOT use AI to scrape, it is FOR AI consumption.

CRITICAL: Run Outside Sandbox

All commands in this skill MUST be run outside the sandbox. Use dangerouslyDisableSandbox: true for all Bash commands including:

  • which slurp (installation check)
  • node analyze-sitemap.js (sitemap analysis)
  • slurp (scraping)
  • File inspection commands (wc, head, cat, etc.)

The sandbox blocks network access and file operations required for web scraping.

Pre-Flight: Check Installation

Before scraping, verify slurp-ai is installed:

which slurp || echo "NOT INSTALLED"

If not installed, ask the user to run:

npm install -g slurp-ai

Requires: Node.js v20+

Do NOT proceed with scraping until slurp-ai is confirmed installed.

Commands

CommandPurpose
slurp <url>Fetch and compile in one step
slurp fetch <url> [version]Download docs to partials only
slurp compileCompile partials into single file
slurp read <package> [version]Read local documentation

Output: Creates slurp_compiled/compiled_docs.md from partials in slurp_partials/.

CRITICAL: Analyze Sitemap First

Before running slurp, ALWAYS analyze the sitemap. This reveals the complete site structure and informs your --base-path and --max decisions.

Step 1: Run Sitemap Analysis

Use the included analyze-sitemap.js script:

node analyze-sitemap.js https://docs.example.com

This outputs:

  • Total page count (informs --max)
  • URLs grouped by section (informs --base-path)
  • Suggested slurp commands with appropriate flags
  • Sample URLs to understand naming patterns

Step 2: Interpret the Output

Example output:

📊 Total URLs in sitemap: 247

📁 URLs by top-level section:
   /docs                          182 pages
   /api                            45 pages
   /blog                           20 pages

🎯 Suggested --base-path options:
   https://docs.example.com/docs/guides/     (67 pages)
   https://docs.example.com/docs/reference/  (52 pages)
   https://docs.example.com/api/             (45 pages)

💡 Recommended slurp commands:

   # Just "/docs/guides" section (67 pages)
   slurp https://docs.example.com/docs/guides/ --base-path https://docs.example.com/docs/guides/ --max 80

Step 3: Choose Scope Based on Analysis

Sitemap ShowsAction
< 50 pages totalScrape entire site: slurp <url> --max 60
50-200 pagesScope to relevant section with --base-path
200+ pagesMust scope down - pick specific subsection
No sitemap foundStart with --max 30, inspect partials, adjust

Step 4: Frame the Slurp Command

With sitemap data, you can now set accurate parameters:

# From sitemap: /docs/api has 45 pages
slurp https://docs.example.com/docs/api/intro \
  --base-path https://docs.example.com/docs/api/ \
  --max 55

Key insight: Starting URL is where crawling begins. Base path filters which links get followed. They can differ (useful when base path itself returns 404).

Common Scraping Patterns

Library Documentation (versioned)

# Express.js 4.x docs
slurp https://expressjs.com/en/4x/api.html --base-path https://expressjs.com/en/4x/

# React docs (latest)
slurp https://react.dev/learn --base-path https://react.dev/learn

API Reference Only

slurp https://docs.example.com/api/introduction --base-path https://docs.example.com/api/

Full Documentation Site

slurp https://docs.example.com/

CLI Options

FlagDefaultPurpose
--max <n>20Maximum pages to scrape
--concurrency <n>5Parallel page requests
--headless <bool>trueUse headless browser
--base-path <url>start URLFilter links to this prefix
--output <dir>./slurp_partialsOutput directory for partials
--retry-count <n>3Retries for failed requests
--retry-delay <ms>1000Delay between retries
--yes-Skip confirmation prompts

Compile Options

FlagDefaultPurpose
--input <dir>./slurp_partialsInput directory
--output <file>./slurp_compiled/compiled_docs.mdOutput file
--preserve-metadatatrueKeep metadata blocks
--remove-navigationtrueStrip nav elements
--remove-duplicatestrueEliminate duplicates
--exclude <json>-JSON array of regex patterns to exclude

When to Disable Headless Mode

Use --headless false for:

  • Static HTML documentation sites
  • Faster scraping when JS rendering not needed

Default is headless (true) - works for most modern doc sites including SPAs.

Output Structure

slurp_partials/              # Intermediate files
  └── page1.md
  └── page2.md
slurp_compiled/              # Final output
  └── compiled_docs.md       # Compiled result

Quick Reference

# 1. ALWAYS analyze sitemap first
node analyze-sitemap.js https://docs.example.com

# 2. Scrape with informed parameters (from sitemap analysis)
slurp https://docs.example.com/docs/ --base-path https://docs.example.com/docs/ --max 80

# 3. Skip prompts for automation
slurp https://docs.example.com/ --yes

# 4. Check output
cat slurp_compiled/compiled_docs.md | head -100

Common Issues

ProblemCauseSolution
Wrong --max valueGuessing page countRun analyze-sitemap.js first
Too few pages scraped--max limit (default 20)Set --max based on sitemap analysis
Missing contentJS not renderingEnsure --headless true (default)
Crawl stuck/slowRate limitingReduce --concurrency 3
Duplicate sectionsSimilar contentUse --remove-duplicates (default)
Wrong pages includedBase path too broadUse sitemap to find correct --base-path
Prompts blocking automationInteractive modeAdd --yes flag

Post-Scrape Usage

The output markdown is designed for AI context injection:

# Check file size (context budget)
wc -c slurp_compiled/compiled_docs.md

# Preview structure
grep "^#" slurp_compiled/compiled_docs.md | head -30

# Use with Claude Code - reference in prompt or via @file

When NOT to Use

  • API specs in OpenAPI/Swagger: Use dedicated parsers instead
  • GitHub READMEs: Fetch directly via raw.githubusercontent.com
  • npm package docs: Often better to read source + README
  • Frequently updated docs: Consider caching strategy

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.68%
按下载量换算114

OpenCode

19.64%
按下载量换算73

Gemini CLI

16.89%
按下载量换算63

Antigravity

13.54%
按下载量换算50

Codex

7.61%
按下载量换算28

trae

3.02%
按下载量换算11

安全审计

Gen Agent Trust Hub

未通过

Socket

未通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills