agentleFS
5uck1ess5uck1ess/devkit/skills/scrape/SKILL.md

scrape

Skill4 starsChanged 4 months agoMITView on GitHub

Scrape a URL to clean Markdown — use when asked to scrape, fetch, extract content from, or read a webpage and convert it to Markdown. Uses Jina Reader, Playwright, Camoufox (TLS-spoofing Firefox), Scweet (X/Twitter), Firecrawl, or WebFetch.

  • Reads credentials
  • Installs packages
  • Sends data out

34 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use freehire-search, ios-sync and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • arafat1023Skill

    freehire-search

    Use this skill to search live software / tech / data / engineering job listings across many countries and markets (and remote) via the freehire.dev aggregator's public API, or to look up a specific posting. It aggregates roles from ~50 ATS platforms into one schema, so a single skill covers many markets — but its faceted filtering (skills, category, seniority) is tuned tech-first, so scope triggers to technical roles. Trigger phrases: find a tech job, software job search, developer jobs, engineering vacancies, data/ML jobs, DevOps roles, remote developer jobs, "are there any <tech role> jobs in <place>", look up this freehire job posting.

    Also in 6 projects that use this

  • Saqlain-811Skill

    ios-sync

    Regenerate the iOS debug bridge against the latest upstream gstack templates. (gstack)

    Also in 6 projects that use this

  • ShreyRaviSkill

    setup-gbrain

    Set up gbrain for this coding agent: install the CLI, initialize a local PGLite or Supabase brain, register MCP, capture per-remote trust policy. One command from zero to "gbrain is running, and this agent can call it." Use when: "setup gbrain", "connect gbrain", "start gbrain", "install gbrain", "configure gbrain for this machine". (gstack)

    Also in 8 projects that use this

  • ShreyRaviSkill

    plan-tune

    Self-tuning question sensitivity + developer psychographic for gstack (v1: observational). Review which AskUserQuestion prompts fire across gstack skills, set per-question preferences (never-ask / always-ask / ask-only-for-one-way), inspect the dual-track profile (what you declared vs what your behavior suggests), and enable/disable question tuning. Conversational interface — no CLI syntax required.

    Also in 10 projects that use this

  • Saqlain-811Skill

    ios-clean

    Remove the DebugBridge SPM package and all #if DEBUG wiring from an iOS app. (gstack)

    Also in 5 projects that use this

  • arafat1023Skill

    linkedin-search

    Use this skill whenever the user wants to search for jobs in any location or market, find job listings, or look up a specific job posting — in any country, city, or remotely. Invoke for open positions, vacancies, and hiring across any sector or role (software, data, design, marketing, finance, legal, operations, etc.). The location is always supplied explicitly by the user. Trigger phrases: find a job, job search, search for jobs, job openings, vacancies, hiring, positions open, remote jobs, "are there any X jobs in <place>", look up this job posting.

    Also in 6 projects that use this

  • +3 more from ShreyRavi
  • +1 more from Saqlain-811

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 5 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check availability: npx playwright --version.

    line 55
  2. Very specific:

    Never build scripts via inline -e "..." strings.

    line 57
  3. Very specific:

    Check availability: python -m camoufox version.

    line 93
  4. Very specific:

    Write the driver to a file (never inline -c "..." — same reasoning as Playwright).

    line 95
  5. Very specific:

    Check availability: python -c "import Scweet".

    line 136
  6. Distinctive:

    When given multiple URLs, scrape them in parallel:

    line 196
  7. Distinctive:

    If a URL is unreachable by every backend, report the error and continue with remaining URLs.

    line 206
  8. Distinctive:

    Never silently drop or substitute a URL — always report what happened, with the winning backend named.

    line 207
  9. Distinctive:

    Always try Jina Reader first — it's free and produces the cleanest output

    line 242
  10. Distinctive:

    Don't scrape login-gated or paywall content — report it as inaccessible

    line 244
  11. Very specific:

    If the user just wants to read a page, output Markdown.

    line 246

“Common” is measured: kept by at least 6 in 10 of the 27 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Web Scrape to Markdown

Fetch a URL and convert it to clean, LLM-ready Markdown. Supports multiple backends with automatic fallback.

Usage

/devkit:scrape https://example.com
/devkit:scrape https://example.com --json
/devkit:scrape https://example.com https://other.com
/devkit:scrape https://example.com --backend playwright

Arguments

  • One or more URLs to scrape
  • --json — wrap output as Markdown-in-JSON: { "url": "...", "title": "...", "markdown": "..." }
  • --backend <name> — force a specific backend (see below). Default: auto-detect.

Backends (in priority order)

  1. Jina Reader — prepend https://r.jina.ai/ to the URL. Returns Markdown by default. Use if JINA_API_KEY is set (higher rate limits) or anonymously (~20 RPM). Best for articles and docs.
  2. Playwright — use if npx playwright --version succeeds (optional dep, install with npx playwright install chromium). Best for JS-heavy SPAs and sites that block headless scrapers. Free and local — no API keys.
  3. Camoufox — patched Firefox with leak-fixed JA3/TLS fingerprints. Use if python -m camoufox version succeeds (install: pip install -U camoufox[geoip] && python -m camoufox fetch). Free and local. Use when Playwright returns a challenge page (Cloudflare "Just a moment...", DataDome, PerimeterX). Auto-triggered when Playwright response body matches challenge signatures (cf-chl-bypass, __cf_chl_, _Incapsula_Resource).
  4. Scweet (X/Twitter only) — specialized scraper for x.com / twitter.com URLs. Use if SCWEET_COOKIES_PATH is set (points at a JSON cookie file exported from a logged-in browser). Auto-routed when host is x.com or twitter.com — other backends don't work reliably on X post-API lockdown.
  5. Firecrawl — use if FIRECRAWL_API_KEY is set. Paid API. Last-resort anti-bot bypass when stealth browsers still get blocked.
  6. WebFetch fallback — use Claude's built-in WebFetch tool. No API key needed, but returns raw content (less clean).

Execution

Single URL

For each URL, try the highest-priority available backend:

Jina Reader (default):

Use WebFetch to fetch: https://r.jina.ai/{url}
Set header: Accept: text/markdown

If --json flag is set, instead fetch with:
  Accept: application/json
This returns: { "url": "...", "title": "...", "content": "..." }
where "content" is the Markdown.

Playwright:

Validate the URL first (see Rules: http/https only, no private IPs, no @).

Check availability: npx playwright --version. If not installed, tell the user once per session: Playwright not installed. Install with: npx playwright install chromium, then fall through to the next backend. The winning backend is always reported in Step 3 (Error Handling), so the user sees which one served the result.

Never build scripts via inline -e "..." strings. Write the script to a file that reads the URL from process.argv[2], then invoke it:

DRIVER=$(mktemp -t devkit-scrape.XXXXXX.mjs)
trap 'rm -f "$DRIVER"' EXIT

cat > "$DRIVER" <<'EOF'
import { chromium } from 'playwright';

const url = process.argv[2];
if (!url) { console.error('usage: node devkit-scrape.mjs <url>'); process.exit(2); }

const browser = await chromium.launch();
try {
  const page = await browser.newPage();
  await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });
  const title = await page.title();
  const html = await page.content();
  process.stdout.write(JSON.stringify({ title, html }));
} catch (err) {
  console.error('playwright failed:', err.message);
  process.exit(1);
} finally {
  try { await browser.close(); } catch (e) { console.error('playwright close error (browser may have crashed mid-scrape):', e.message); }
}
EOF

node "$DRIVER" "$URL"

Pass the URL as a shell variable (URL=https://example.com), never inline into the command string. The .mjs reads it from process.argv[2] so quotes, backticks, and $() in the URL can't escape.

Then convert HTML → Markdown. Prefer a local converter if available (pandoc, turndown). If none available, strip script/style/nav/footer tags and extract text from article/main/body.

Camoufox (when Playwright returns a challenge page or --backend camoufox):

Check availability: python -m camoufox version. If missing, print once per session: Camoufox not installed. Install with: pip install -U camoufox[geoip] && python -m camoufox fetch, then fall through.

Write the driver to a file (never inline -c "..." — same reasoning as Playwright). Pass the URL as an env var, never interpolated into the command string. Use mktemp rather than a hardcoded /tmp/ path (portability + predictable-path attack surface):

DRIVER=$(mktemp -t devkit-camoufox.XXXXXX.py)
trap 'rm -f "$DRIVER"' EXIT

cat > "$DRIVER" <<'EOF'
import os, json, sys, traceback
from camoufox.sync_api import Camoufox

url = os.environ["DEVKIT_SCRAPE_URL"]
stage = "init"
try:
    with Camoufox(headless=True, humanize=True) as browser:
        page = browser.new_page()
        stage = "goto"
        page.goto(url, wait_until="domcontentloaded", timeout=30000)
        stage = "title"
        title = page.title()
        stage = "content"
        html = page.content()
        print(json.dumps({"title": title, "html": html}))
except Exception as err:
    print(json.dumps({"error": str(err), "stage": stage, "traceback": traceback.format_exc()[-2000:]}))
    sys.exit(1)
EOF

DEVKIT_SCRAPE_URL="$URL" python "$DRIVER"

Then convert HTML → Markdown (same converter as Playwright). If the JSON has an error field, treat the backend as failed and fall through.

Challenge-page detection (triggers auto-fallback Playwright → Camoufox): treat the Playwright result as blocked and retry with Camoufox when ANY of the following holds:

  • Positive anti-bot signature present: cf-chl-bypass, __cf_chl_, <title>Just a moment...</title>, _Incapsula_Resource, dd_cookie_test_, datadome, px-captcha, perimeterx (case-insensitive match against the HTML)
  • Body text under 200 chars AND no <article>/<main>/<section>/<h1> tag (skeleton/challenge shell, not a real small page)

Narrower than a size heuristic alone — valid small pages (404s, hand-rolled minimal HTML, API docs) keep their original backend instead of burning a Camoufox cycle.

Scweet (X/Twitter — host is x.com or twitter.com):

Check availability: python -c "import Scweet". If missing: pip install Scweet. Requires SCWEET_COOKIES_PATH pointing at a JSON cookies file exported from a logged-in browser session (devkit convention: export with a cookie extension, store outside the repo, set SCWEET_COOKIES_PATH=~/.config/devkit/x-cookies.json). Do NOT hardcode auth tokens in env.

Scweet's Python API varies by version — the scrape_tweets / scrape_profile / scrape_tweet entry points differ across 2.x releases. Inspect the installed version with python -c "import Scweet; print(Scweet.__version__)" before wiring. Reference template (adapt to your installed Scweet version):

DRIVER=$(mktemp -t devkit-scweet.XXXXXX.py)
trap 'rm -f "$DRIVER"' EXIT

cat > "$DRIVER" <<'EOF'
import os, json, sys, traceback, re
from urllib.parse import urlparse

url = os.environ["DEVKIT_SCRAPE_URL"]
cookies_path = os.environ["SCWEET_COOKIES_PATH"]
stage = "init"
try:
    # Scweet 2.x: choose entry point by URL shape
    path = urlparse(url).path
    if re.match(r"^/[^/]+/status/\d+", path):
        stage = "import_tweet"
        from Scweet.user import get_tweet
        data = get_tweet(tweet_url=url, cookies_path=cookies_path, headless=True)
    elif re.match(r"^/[^/]+/?$", path):
        stage = "import_profile"
        from Scweet.user import get_user_information
        handle = path.strip("/")
        data = get_user_information(handles=[handle], cookies_path=cookies_path, headless=True)
    else:
        raise ValueError(f"unsupported x.com path: {path}")
    print(json.dumps({"data": data}, default=str))
except Exception as err:
    print(json.dumps({"error": str(err), "stage": stage, "traceback": traceback.format_exc()[-2000:]}))
    sys.exit(1)
EOF

DEVKIT_SCRAPE_URL="$URL" python "$DRIVER"

Output is structured tweet/profile data — render to Markdown (username + timestamp + text + engagement stats for tweets; bio + follower counts for profiles). If the JSON has an error field, fall back to Jina.

Firecrawl (if FIRECRAWL_API_KEY is set and --backend firecrawl):

Use Bash to call (use jq to safely construct JSON — never interpolate URLs directly):
jq -n --arg url "{url}" '{"url": $url, "formats": ["markdown"]}' | \
  curl -s -X POST https://api.firecrawl.dev/v1/scrape \
    -H "Authorization: Bearer $FIRECRAWL_API_KEY" \
    -H "Content-Type: application/json" \
    -d @-

Response contains: { "data": { "markdown": "...", "metadata": { "title": "..." } } }

WebFetch fallback:

Use WebFetch on the raw URL.
Note: output will be noisier than Jina/Firecrawl — no boilerplate removal.

Multiple URLs

When given multiple URLs, scrape them in parallel:

  • Launch one researcher agent per URL (max 5 concurrent)
  • Each agent fetches its URL using the backend logic above
  • Collect all results before outputting

Error Handling

Fallback chain (single linear order): Jina Reader → Playwright → Camoufox → Firecrawl → WebFetch. Each backend is tried in order. Move to the next only on error, empty content, challenge-page detection, or missing dependency. Exception: URLs on x.com / twitter.com route directly to Scweet (skip the chain) when SCWEET_COOKIES_PATH is set; if Scweet is unavailable or fails, fall back to Jina.

  • Report which backend actually ran for each URL, and (if fallbacks happened) why the earlier ones failed. Never silently substitute content — the user must know a paywall/cookie-wall/SPA-skeleton from one backend wasn't the real page fetched by another.
  • If a URL is unreachable by every backend, report the error and continue with remaining URLs.
  • Never silently drop or substitute a URL — always report what happened, with the winning backend named.

Output

Default (plain Markdown)

Output the extracted Markdown directly, prefixed with the source URL:

## Source: {url}

{extracted markdown content}

With --json flag

Output structured JSON:

{
  "url": "https://example.com",
  "title": "Page Title",
  "markdown": "# Heading\n\nContent here...",
  "backend": "jina",
  "timestamp": "2026-04-02T12:00:00Z"
}

For multiple URLs, output a JSON array.

Rules

  • URL validation — only accept http:// and https:// URLs. Reject file://, ftp://, data:, and all other schemes. Reject URLs targeting private/reserved IPs: localhost, 127.0.0.1, 0.0.0.0, 169.254.x.x (cloud metadata — AWS/GCP/Azure), 10.x.x.x, 172.16-31.x.x, 192.168.x.x, [::1]. Reject URLs containing @ (credential-in-URL attacks). When rejecting, report the exact reason and stop — never silently skip a URL in a batch.
  • No shell injection — never interpolate user URLs directly into shell command strings. Use jq to construct JSON payloads for curl. For Playwright, write scripts to files that read URLs from process.argv, and pass the URL as a shell variable — never inline into -e strings.
  • API keys from env only — never hardcode API keys. Always reference $JINA_API_KEY, $FIRECRAWL_API_KEY from environment variables.
  • Always try Jina Reader first — it's free and produces the cleanest output
  • Respect rate limits — if scraping many URLs, add a brief pause between requests
  • Don't scrape login-gated or paywall content — report it as inaccessible
  • Strip cookie banners, nav bars, and footers when possible (Jina/Firecrawl do this automatically)
  • If the user just wants to read a page, output Markdown. If they want to process it, use --json.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.