accessibility-complian…
Web accessibility patterns for news and academic sites. Use for WCAG audits, alt text, accessible data viz, and assistive tech.
Authorized web scraping with fallback cascades and access-failure handling. Use for social media, yt-dlp, CAPTCHA or 403 blocks.
Claude Code
$ npx -y skills add jamditis/claude-skills-journalism --skill web-scraping --agent claude-code
Codex
$ npx skills add jamditis/claude-skills-journalism --skill web-scraping -a codex -y
Cursor
$ npx skills add jamditis/claude-skills-journalism --skill web-scraping -a cursor -y
Gemini CLI
$ npx skills add jamditis/claude-skills-journalism --skill web-scraping -a gemini-cli -y
GitHub Copilot
$ npx skills add jamditis/claude-skills-journalism --skill web-scraping -a github-copilot -y
OpenCode
$ npx skills add jamditis/claude-skills-journalism --skill web-scraping -a opencode -y
Windsurf
$ npx skills add jamditis/claude-skills-journalism --skill web-scraping -a windsurf -y
name: web-scraping description: Authorized web scraping with fallback cascades and access-failure handling. Use for social media, yt-dlp, CAPTCHA or 403 blocks.
Patterns for reliable, ethical web scraping with fallback strategies and access-failure handling.
<!-- untrusted-content-contract:v1 -->
When this skill retrieves third-party material:
Use this shape when passing retrieved material onward:
<EXTERNAL_DATA source="..."> ... </EXTERNAL_DATA>
Run browser-based scraping in an isolated environment with private-network egress blocked. Initial URL checks alone do not stop malicious subresources or DNS rebinding. Do not bypass authentication, paywalls, CAPTCHAs, rate limits, or technical access controls without documented authorization from the system or content owner. Prefer official APIs, research programs, licensed databases, manual exports, or permission from the publisher when ordinary public access fails. Disable credentialed sessions by default, and never return, print, or embed cookies, session files, authorization headers, or tokens in results.
Validate destinations before any fetch and again after every redirect:
import ipaddress
import socket
from urllib.parse import urlparse
def validate_public_url(url: str) -> str:
parsed = urlparse(url)
if parsed.scheme not in {'http', 'https'}:
raise ValueError('Only HTTP(S) URLs are allowed')
if parsed.username or parsed.password or not parsed.hostname:
raise ValueError('Credentials and missing hosts are not allowed')
port = parsed.port or (443 if parsed.scheme == 'https' else 80)
addresses = {
result[4][0]
for result in socket.getaddrinfo(parsed.hostname, port)
}
if not addresses or any(
not ipaddress.ip_address(address).is_global for address in addresses
):
raise ValueError('Local and private-network destinations are blocked')
return urlDo not rely on this helper as a complete sandbox. Revalidate redirect targets, disable automatic redirects when necessary, and enforce network policy outside the scraper process.
Implement multiple extraction strategies with automatic fallback:
from abc import ABC, abstractmethod
from typing import Optional
import requests
from bs4 import BeautifulSoup
import trafilatura
from urllib.parse import urljoin
#for .py files
from playwright.sync_api import sync_playwright
#for .ipynb files
import asyncio
from playwright.async_api import async_playwright
STOP_STATUS_CODES = {401, 403, 429}
MAX_REDIRECTS = 5
class AccessDeniedError(RuntimeError):
"""The origin denied access; do not escalate to another scraper."""
def fetch_public_response(url: str, *, headers: dict,
timeout: int = 30) -> requests.Response:
"""Follow a small redirect chain, validating every hop before fetching."""
current_url = url
for _ in range(MAX_REDIRECTS + 1):
current_url = validate_public_url(current_url)
response = requests.get(
current_url,
headers=headers,
timeout=timeout,
allow_redirects=False,
)
if response.status_code in STOP_STATUS_CODES:
response.close()
raise AccessDeniedError('The origin denied automated access')
if response.is_redirect:
location = response.headers.get('Location')
response.close()
if not location:
raise ValueError('Redirect response has no Location header')
current_url = urljoin(current_url, location)
continue
response.raise_for_status()
return response
raise ValueError('Redirect limit exceeded')
class ScrapingResult:
def __init__(self, content: str, title: str, method: str):
self.content = content
self.title = title
self.method = method # Track which method succeeded
class Scraper(ABC):
@abstractmethod
def fetch(self, url: str) -> Optional[ScrapingResult]: ...
class TrafilaturaScraper(Scraper):
"""Fast, lightweight extraction for standard articles."""
def fetch(self, url: str) -> Optional[ScrapingResult]:
try:
response = fetch_public_response(
url,
headers={'User-Agent': 'ResearchScraper/1.0 (+https://example.org/contact)'},
timeout=30,
)
downloaded = response.text
content = trafilatura.extract(
downloaded,
include_comments=False,
include_tables=True,
favor_recall=True
)
if not content or len(content) < 100:
return None
# Extract title separately
soup = BeautifulSoup(downloaded, 'html.parser')
title = soup.find('title')
title_text = title.get_text() if title else ''
return ScrapingResult(content, title_text, 'trafilaturA collection of Agent Skills for journalists, researchers, academics, media professionals, and communications practitioners. The same repository serves Claude Code and Codex while keeping Claude-only commands, agents, and hooks clearly labeled.
Web accessibility patterns for news and academic sites. Use for WCAG audits, alt text, accessible data viz, and assistive tech.
Scans the session for durable lessons and workflows, then proposes scoped project instruction updates. Use for save this lesson…
Manages attention and evidence in long agent sessions. Use for lost instructions, dropped evidence, or large multi-agent contexts.
Directs the current request through configured lower-tier agents. Use only when the user explicitly invokes it.
Electron desktop apps with React, TypeScript, and Vite. Use for IPC, window/tray, PTY terminals, WebRTC, and packaging.
Remote JavaScript console and debugging on mobile. Use for phone/tablet console errors, responsive testing, Eruda, and vConsole.
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use…
AI-driven presentation workflow for generating editable PPTX decks and slides, reconstructing page visuals, creating reusable…
Use this skill when the user wants a .pptx with smooth cross-slide animation — PowerPoint Morph transitions, Keynote-style…
Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to…