Reads local files and URLs into clean Markdown. Automatically retries if content quality is low.
Install
mkdir -p .claude/skills/gather && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10734" && unzip -o skill.zip -d .claude/skills/gather && rm skill.zipInstalls to .claude/skills/gather
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Read content from local files and explicit URLs provided by the user. Uses markitdown as primary reader with format-specific fallbacks for garbled output. 3-tier URL fetching: fetch_webpage → httpx → Playwright stealth mode (for bot-protected sites). Auto-reviews gathered content quality and retries with fallback readers if insufficient. Always use this skill when the user provides files to read or specific URLs to fetch — "đọc file này", "lấy nội dung từ URL này", or when a file path or URL is dropped into chat. Do NOT use for web search, topic research, or platform discovery → use search skill.Key capabilities
- →Read local files
- →Fetch content from URLs
- →Convert web pages to markdown
- →Auto-review content quality
How it works
The skill reads local files or fetches URLs using a 3-tier strategy (fetch_webpage, httpx, Playwright), then auto-reviews the content quality and retries if necessary.
Inputs & outputs
When to use gather
- →Reading documentation from a URL
- →Extracting code from a local file
- →Converting web pages to markdown for analysis
- →Retrieving content from bot-protected sites
About this skill
Thu Thập — File & URL Reading Skill
References: references/code-patterns.md | references/playwright-stealth.md
Governance: Read and follow .github/RULE.md — it overrides all instructions below.
This skill reads content from local files and explicit URLs — and returns clean Markdown text. It runs standalone or as part of the synthesize pipeline.
Quality loop (RULE-2): After reading all sources, self-review runs automatically. If content is insufficient, pivots through fallback strategies (max 3 pivots per RULE-2):
- Switch reader: markitdown → format-specific library
- Switch fetch tier: fetch_webpage → httpx → Playwright
- Report failure with honest gap assessment
For web search, topic research, or platform discovery → use the search skill instead.
All responses to the user are in Vietnamese.
Supported Formats
LOCAL_FILES:
primary_reader: markitdown
supported: .docx, .xlsx, .pdf, .pptx, .txt, .md, .csv, .html, .jpg, .png
fallback: format-specific library if markitdown returns < 100 chars
URLS:
tier_1: Copilot fetch_webpage tool (fast, default)
tier_2: httpx + beautifulsoup4 (fallback for failures)
tier_3: Playwright stealth mode (bot-protected / JS-rendered sites)
bot_signals: 403/429, Cloudflare challenge, empty JS content → auto-escalate to Tier 3
Step 0: State Read-Back (RULE-13)
Call save_state.py read-context gather as FIRST action before any processing. Check relevant_artifacts[] for upstream outputs to incorporate.
Step 1: Identify Sources
- Extract file paths from the user request (absolute or relative)
- Extract URLs (http:// or https://)
- If user provides neither files nor URLs, check if they want web search → route to search skill
- Report: "📂 Nguồn: {N} file / {M} URL"
Step 2: Read Local Files
For each file:
- Skip files > 50 MB with a warning (too large for context)
- Try
markitdown {file}first - If output < 100 chars → use format-specific fallback reader (see
references/code-patterns.md) - Report: "✅ {filename} — {chars} ký tự" or "❌ {filename} — {error}"
Step 3: Fetch URL Content (3-Tier Fallback)
Try tiers in order — escalate on failure or bot-detection:
- fetch_webpage (default) — if content ≥ 50 chars: done
- httpx + BeautifulSoup — if Tier 1 fails (see
references/code-patterns.md) - Playwright stealth — if bot-detection signals (403, Cloudflare challenge, empty JS
content):
python3 scripts/playwright_fetch.py "{url}" --wait 3
After each fetch: read first 200–500 chars. Reject error pages, login walls, empty stubs, or wrong page type (e.g., got a listing page when you need a detail page). If bad → next tier.
Skip directly to Playwright when: domain is known bot-protected, a previous request from the same domain returned 403/429, or the URL pattern clearly indicates a JS-rendered SPA.
Step 4: Quality Review
Before returning content, check:
- Volume: ≥500 chars per source (reject empty/error pages)
- Specificity: contains actual content, not just navigation/headers
If a source fails: try fallback reader once. If still empty, report failure for that source.
Step 5: Combine & Return
Structure each source:
## Nguồn: {source_name}
> {path_or_url} | {char_count} ký tự
{content}
---
Final summary: "📋 Thu thập hoàn tất: {N} nguồn / {total_chars} ký tự / {quality_assessment}"
Examples
- "Đọc file report.pdf và data.xlsx" → markitdown both → combined Markdown
- "Lấy nội dung từ https://example.com" → fetch_webpage → Markdown
- "Đọc 3 file docx trong thư mục input/" → markitdown each → combined output
Step 6: Artifact Registration (RULE-13)
Call save_state.py register-artifact --step gather --path <file> --type gathered_content --summary "<text>" for every file created in tmp/ or output/.
What This Skill Does NOT Do
- Does NOT search the internet or discover platforms → search
- Does NOT synthesize or translate content → compose
- Does NOT generate output files → gen-* skills
- Does NOT install dependencies → setup
When not to use it
- →Web search
- →Topic research
Prerequisites
Limitations
- →Limited to 50MB for local files
- →Requires manual fallback if quality loop fails
How it compares
It includes a quality loop that automatically pivots through fallback readers if the initial content is insufficient, ensuring high-quality output.
Compared to similar skills
gather side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| gather (this skill) | 0 | 3mo | Review | Beginner |
| compact | 4 | 6mo | Review | Beginner |
| skill-name | 0 | 7mo | Review | Advanced |
| context-updater | 0 | 3mo | Review | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by markxLee
View all by markxLee →You might also like
compact
catlog22
Compact current session memory into structured text for session recovery. Supports custom descriptions and tagging.
skill-name
2025Emma
What it does + when to use (activation triggers).
context-updater
yasu0805-netizen
Explicitly learns style nuances and updates user context from specified sources (Opt-in only).
agent-context-system
diegosouzapw
A persistent local-only memory system for AI coding agents. Two files, one idea — AGENTS.md (committed, shared) + .agents.local.md (gitignored, personal). Agents read both at session start, update the scratchpad at session end, and promote stable patterns over time. Works across Claude Code, Cursor,
planning-with-files
davila7
Implements Manus-style file-based planning for complex tasks. Creates task_plan.md, findings.md, and progress.md. Use when starting complex multi-step tasks, research projects, or any task requiring >5 tool calls.
skill-builder
ruvnet
Create new Claude Code Skills with proper YAML frontmatter, progressive disclosure structure, and complete directory organization. Use when you need to build custom skills for specific workflows, generate skill templates, or understand the Claude Skills specification.