Workflow Routing (SYSTEM PROMPT)
CRITICAL: This workflow implements progressive escalation for URL content retrieval.
When user requests scraping/fetching URL content:
Examples: "scrape this URL", "fetch this page", "get content from [URL]", "pull content from this site", "retrieve [URL]", "can't access this site", "this site is blocking me", "use Bright Data to fetch"
→ READ: ${PAI_DIR}/skills/brightdata/workflows/four-tier-scrape.md
→ EXECUTE: Four-tier progressive scraping workflow (WebFetch → Curl → Browser Automation → Bright Data MCP)
When to Activate This Skill
Direct Scraping Requests (Categories 1-4)
- "scrape this URL", "scrape [URL]", "scrape this page"
- "fetch this URL", "fetch [URL]", "fetch this page", "fetch content from"
- "pull content from [URL]", "pull this page", "pull from this site"
- "get content from [URL]", "retrieve [URL]", "retrieve this page"
- "do scraping on [URL]", "run scraper on [URL]"
- "basic scrape", "quick scrape", "simple fetch"
- "comprehensive scrape", "deep scrape", "full content extraction"
Access & Bot Detection Issues (Categories 5-7)
- "can't access this site", "site is blocking me", "getting blocked"
- "bot detection", "CAPTCHA", "access denied", "403 error"
- "need to bypass bot detection", "get around blocking"
- "this URL won't load", "can't fetch this page"
- "use Bright Data", "use the scraper", "use advanced scraping"
Result-Oriented Requests (Category 8)
- "get me the content from [URL]"
- "extract text from [URL]"
- "download this page content"
- "convert [URL] to markdown"
- "need the HTML from this site"
Use Case Indicators
- User needs web content for research or analysis
- Standard methods (WebFetch) are failing
- Site has bot detection or rate limiting
- Need reliable content extraction
- Converting web pages to structured format (markdown)
Core Capabilities
Progressive Escalation Strategy:
- Tier 1: WebFetch - Fast, simple, built-in Claude Code tool
- Tier 2: Customized Curl - Chrome-like browser headers to bypass basic bot detection
- Tier 3: Browser Automation - Full browser automation using Playwright for JavaScript-heavy sites
- Tier 4: Bright Data MCP - Professional scraping service that handles CAPTCHA and advanced bot detection
Key Features:
- Automatic fallback between tiers
- Preserves content in markdown format
- Handles bot detection and CAPTCHA
- Works with any URL
- Efficient resource usage (only escalates when needed)
Workflow Overview
four-tier-scrape.md - Complete URL content scraping with four-tier fallback strategy
- When to use: Any URL content retrieval request
- Process: Start with WebFetch → If fails, use curl with Chrome headers → If fails, use Browser Automation → If fails, use Bright Data MCP
- Output: URL content in markdown format
Extended Context
Integration Points:
- WebFetch Tool - Built-in Claude Code tool for basic URL fetching
- Bash Tool - For executing curl commands with custom headers
- Browser Automation - Playwright-based browser automation for JavaScript rendering
- Bright Data MCP -
mcp__Brightdata__scrape_as_markdown for advanced scraping
When Each Tier Is Used:
- Tier 1 (WebFetch): Simple sites, public content, no bot detection
- Tier 2 (Curl): Sites with basic user-agent checking, simple bot detection
- Tier 3 (Browser Automation): Sites requiring JavaScript execution, dynamic content loading
- Tier 4 (Bright Data): Sites with CAPTCHA, advanced bot detection, residential proxy requirements
Configuration:
No configuration required - all tools are available by default in Claude Code
Examples
Example 1: Simple Public Website
User: "Scrape https://example.com"
Skill Response:
- Routes to three-tier-scrape.md
- Attempts Tier 1 (WebFetch)
- Success → Returns content in markdown
- Total time: <5 seconds
Example 2: Site with JavaScript Requirements
User: "Can't access this site https://dynamic-site.com"
Skill Response:
- Routes to four-tier-scrape.md
- Attempts Tier 1 (WebFetch) → Fails (blocked)
- Attempts Tier 2 (Curl with Chrome headers) → Fails (JavaScript required)
- Attempts Tier 3 (Browser Automation) → Success
- Returns content in markdown
- Total time: ~15-20 seconds
Example 3: Site with Advanced Bot Detection
User: "Scrape https://protected-site.com"
Skill Response:
- Routes to four-tier-scrape.md
- Attempts Tier 1 (WebFetch) → Fails (blocked)
- Attempts Tier 2 (Curl) → Fails (advanced detection)
- Attempts Tier 3 (Browser Automation) → Fails (CAPTCHA)
- Attempts Tier 4 (Bright Data MCP) → Success
- Returns content in markdown
- Total time: ~30-40 seconds
Example 4: Explicit Bright Data Request
User: "Use Bright Data to fetch https://difficult-site.com"
Skill Response:
- Routes to four-tier-scrape.md
- User explicitly requested Bright Data
- Goes directly to Tier 4 (Bright Data MCP) → Success
- Returns content in markdown
- Total time: ~5-10 seconds
Related Documentation:
${PAI_DIR}/skills/CORE/SKILL-STRUCTURE-AND-ROUTING.md - Canonical structure guide
${PAI_DIR}/skills/CORE/CONSTITUTION.md - Overall Kai philosophy
Last Updated: 2025-11-23
1---2name: brightdata3description: Progressive four-tier URL content scraping with automatic fallback strategy. USE WHEN user says "scrape this URL", "fetch this page", "get content from", "can't access this site", "use Bright Data", "pull content from URL", or needs to retrieve web content that may have bot detection or access restrictions.4---56## Workflow Routing (SYSTEM PROMPT)78**CRITICAL: This workflow implements progressive escalation for URL content retrieval.**910**When user requests scraping/fetching URL content:**11Examples: "scrape this URL", "fetch this page", "get content from [URL]", "pull content from this site", "retrieve [URL]", "can't access this site", "this site is blocking me", "use Bright Data to fetch"12→ **READ:** ${PAI_DIR}/skills/brightdata/workflows/four-tier-scrape.md13→ **EXECUTE:** Four-tier progressive scraping workflow (WebFetch → Curl → Browser Automation → Bright Data MCP)1415---1617## When to Activate This Skill1819### Direct Scraping Requests (Categories 1-4)20- "scrape this URL", "scrape [URL]", "scrape this page"21- "fetch this URL", "fetch [URL]", "fetch this page", "fetch content from"22- "pull content from [URL]", "pull this page", "pull from this site"23- "get content from [URL]", "retrieve [URL]", "retrieve this page"24- "do scraping on [URL]", "run scraper on [URL]"25- "basic scrape", "quick scrape", "simple fetch"26- "comprehensive scrape", "deep scrape", "full content extraction"2728### Access & Bot Detection Issues (Categories 5-7)29- "can't access this site", "site is blocking me", "getting blocked"30- "bot detection", "CAPTCHA", "access denied", "403 error"31- "need to bypass bot detection", "get around blocking"32- "this URL won't load", "can't fetch this page"33- "use Bright Data", "use the scraper", "use advanced scraping"3435### Result-Oriented Requests (Category 8)36- "get me the content from [URL]"37- "extract text from [URL]"38- "download this page content"39- "convert [URL] to markdown"40- "need the HTML from this site"4142### Use Case Indicators43- User needs web content for research or analysis44- Standard methods (WebFetch) are failing45- Site has bot detection or rate limiting46- Need reliable content extraction47- Converting web pages to structured format (markdown)4849---5051## Core Capabilities5253**Progressive Escalation Strategy:**541. **Tier 1: WebFetch** - Fast, simple, built-in Claude Code tool552. **Tier 2: Customized Curl** - Chrome-like browser headers to bypass basic bot detection563. **Tier 3: Browser Automation** - Full browser automation using Playwright for JavaScript-heavy sites574. **Tier 4: Bright Data MCP** - Professional scraping service that handles CAPTCHA and advanced bot detection5859**Key Features:**60- Automatic fallback between tiers61- Preserves content in markdown format62- Handles bot detection and CAPTCHA63- Works with any URL64- Efficient resource usage (only escalates when needed)6566---6768## Workflow Overview6970**four-tier-scrape.md** - Complete URL content scraping with four-tier fallback strategy71- **When to use:** Any URL content retrieval request72- **Process:** Start with WebFetch → If fails, use curl with Chrome headers → If fails, use Browser Automation → If fails, use Bright Data MCP73- **Output:** URL content in markdown format7475---7677## Extended Context7879**Integration Points:**80- **WebFetch Tool** - Built-in Claude Code tool for basic URL fetching81- **Bash Tool** - For executing curl commands with custom headers82- **Browser Automation** - Playwright-based browser automation for JavaScript rendering83- **Bright Data MCP** - `mcp__Brightdata__scrape_as_markdown` for advanced scraping8485**When Each Tier Is Used:**86- **Tier 1 (WebFetch):** Simple sites, public content, no bot detection87- **Tier 2 (Curl):** Sites with basic user-agent checking, simple bot detection88- **Tier 3 (Browser Automation):** Sites requiring JavaScript execution, dynamic content loading89- **Tier 4 (Bright Data):** Sites with CAPTCHA, advanced bot detection, residential proxy requirements9091**Configuration:**92No configuration required - all tools are available by default in Claude Code9394---9596## Examples9798**Example 1: Simple Public Website**99100User: "Scrape https://example.com"101102Skill Response:1031. Routes to three-tier-scrape.md1042. Attempts Tier 1 (WebFetch)1053. Success → Returns content in markdown1064. Total time: <5 seconds107108**Example 2: Site with JavaScript Requirements**109110User: "Can't access this site https://dynamic-site.com"111112Skill Response:1131. Routes to four-tier-scrape.md1142. Attempts Tier 1 (WebFetch) → Fails (blocked)1153. Attempts Tier 2 (Curl with Chrome headers) → Fails (JavaScript required)1164. Attempts Tier 3 (Browser Automation) → Success1175. Returns content in markdown1186. Total time: ~15-20 seconds119120**Example 3: Site with Advanced Bot Detection**121122User: "Scrape https://protected-site.com"123124Skill Response:1251. Routes to four-tier-scrape.md1262. Attempts Tier 1 (WebFetch) → Fails (blocked)1273. Attempts Tier 2 (Curl) → Fails (advanced detection)1284. Attempts Tier 3 (Browser Automation) → Fails (CAPTCHA)1295. Attempts Tier 4 (Bright Data MCP) → Success1306. Returns content in markdown1317. Total time: ~30-40 seconds132133**Example 4: Explicit Bright Data Request**134135User: "Use Bright Data to fetch https://difficult-site.com"136137Skill Response:1381. Routes to four-tier-scrape.md1392. User explicitly requested Bright Data1403. Goes directly to Tier 4 (Bright Data MCP) → Success1414. Returns content in markdown1425. Total time: ~5-10 seconds143144---145146**Related Documentation:**147- `${PAI_DIR}/skills/CORE/SKILL-STRUCTURE-AND-ROUTING.md` - Canonical structure guide148- `${PAI_DIR}/skills/CORE/CONSTITUTION.md` - Overall Kai philosophy149150**Last Updated:** 2025-11-23