scraper-generator/skills/create-scraper/SKILL.md
Generate a complete API documentation scraper from a URL. Use for API docs scraper generation, docs site analysis, parser architecture, Python scraper package creation, and validation.
npx skillsauth add grailautomation/claude-plugins create-scraperInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a complete, production-ready API documentation scraper. This workflow supports Claude Code slash-command/subagent usage and Codex direct workflow usage.
Given an API documentation URL, this command:
The result is a standalone scraper like workato_scraper/ that can run forever without AI assistance.
Resolve the plugin root before loading bundled references:
${CLAUDE_PLUGIN_ROOT}.<repo-root>/scraper-generator.SKILL.md.Codex does not load Claude plugin subagents or Task dispatch from this plugin.
Run the phases inline unless the user explicitly asks for Codex subagents or
parallel agent work.
First, understand the target documentation structure.
Load the doc-site-analysis skill:
Read ${PLUGIN_ROOT}/skills/doc-site-analysis/SKILL.md
Fetch and analyze the target URL in Claude Code:
WebFetch {url}
Fetch and analyze the target URL in Codex:
Use an available repo-safe fetch method, such as curl -L, python3 with
urllib.request, or Playwright only when static HTML is insufficient. Save a
small HTML sample under the chosen output directory when it helps make the
analysis repeatable.
Identify:
Document findings:
Write analysis to {output}/site-analysis.md
Use the site-analyzer agent in Claude Code if the analysis is complex:
Task: Analyze the API documentation structure at {url}
Agent: site-analyzer
In Codex, perform this analysis inline by reading
${PLUGIN_ROOT}/skills/doc-site-analysis/SKILL.md and its targeted references.
Spawn a Codex subagent only when the user explicitly authorizes parallel agent
work.
Design the scraper based on discovered patterns.
Load the scraper-architecture skill:
Read ${PLUGIN_ROOT}/skills/scraper-architecture/SKILL.md
Study the reference implementation:
Read ${PLUGIN_ROOT}/skills/scraper-architecture/examples/README.md
Plan:
Generate the complete scraper package.
Load the code-generation skill:
Read ${PLUGIN_ROOT}/skills/code-generation/SKILL.md
Generate all files:
{name}_scraper/__init__.py - Package exports{name}_scraper/models.py - Pydantic data models{name}_scraper/scraper.py - HTTP fetching logic{name}_scraper/parser.py - HTML parsing (the core logic){name}_scraper/sections.py - Section registry{name}_scraper/cli.py - Command-line interface{name}_scraper/formatters/ - Output formattersmain.py - Entry pointpyproject.toml - Package configurationREADME.md - Usage documentationUse the code-generator agent in Claude Code for complex implementations:
Task: Generate scraper code based on site-analysis.md
Agent: code-generator
In Codex, generate the package inline using
${PLUGIN_ROOT}/skills/code-generation/SKILL.md and the architecture
references. Keep generated files inside the requested output directory.
Verify the generated scraper works.
Run the validation script:
${PLUGIN_ROOT}/skills/code-generation/scripts/validate-scraper.sh {output}/{name}_scraper
Or use the validator agent in Claude Code:
Task: Validate the generated scraper at {output}/{name}_scraper
Agent: scraper-validator
In Codex, run the validation script directly from the resolved plugin root. If the generated scraper has dependencies that are not installed, create an isolated virtual environment inside the output directory or clearly report the missing dependency as a validation blocker.
Check:
If validation finds issues:
When validation passes:
User input:
/scraper-generator:create-scraper https://docs.workato.com/workato-api/connections.html
Phase 1 output:
Analyzing https://docs.workato.com/workato-api/connections.html...
Detected: VuePress framework
Index pattern: Quick reference table with Type/Resource/Description columns
Section pattern: H2 headings with explicit IDs
Found: 8 endpoints on this page
Wrote analysis to ./site-analysis.md
Phase 2-3 output:
Designing scraper architecture...
Using reference: workato_scraper
Generating package: workato_scraper/
✓ models.py (6 models)
✓ scraper.py (fetch with retry)
✓ parser.py (table + heading strategies)
✓ sections.py (28 sections)
✓ cli.py (argparse interface)
✓ formatters/ (JSON, Markdown, OpenAPI)
✓ main.py
✓ pyproject.toml
✓ README.md
Phase 4 output:
Validating generated scraper...
✓ Package structure valid
✓ Python syntax valid
✓ Package imports successfully
✓ Scraper runs (extracted 8 endpoints)
✓ JSON output valid
✓ OpenAPI spec valid
Validation: PASSED
Phase 5 output:
## Scraper Created Successfully!
Generated: workato_scraper/
### Usage:
```bash
# Install
uv venv && uv pip install -e .
# List sections
python main.py --list-sections
# Scrape connections
python main.py --section connections --verbose
# Scrape all sections
python main.py --all --verbose
## Key Principles
1. **Discovery-first** - Don't assume patterns; discover them
2. **Reference-informed** - Learn from workato_scraper example
3. **Validation-driven** - Test until it works
4. **Self-contained** - Generated code runs without AI
## Error Handling
**If site analysis fails:**
- Try alternative pages from the same site
- Look for API reference section
- Check if site requires authentication
**If code generation fails:**
- Simplify the extraction strategy
- Fall back to more generic patterns
- Generate skeleton with TODOs for complex parts
**If validation fails:**
- Read error messages carefully
- Fix one issue at a time
- Re-run validation after each fix
development
Parse and analyze Workato recipe JSON exports. Use when the user asks about a Workato recipe's logic, data flow, field mappings, error handling, or control flow. Also use when the user references a .recipe.json file or asks to debug a Workato integration.
databases
Review implementation plans as a staff software engineer. Use when the user asks for staff engineer feedback, senior engineering review, plan review, architecture review, implementation-plan critique, approval before proceeding, risk review, or feedback on a proposed technical plan.
tools
Use when the user invokes $spec-kit:tasks or /spec-kit:tasks, or asks to generate dependency-ordered tasks from the plan and repo context.
testing
Use when the user invokes $spec-kit:specify or /spec-kit:specify, or asks to create a brownfield-aware feature specification from a natural language description.