web-doc-resolver
Web Documentation Resolver
Resolve query or URL inputs into compact, high-signal markdown for agents and RAG systems using an intelligent cascade.
When to Use This Skill
Activate this skill when you need to:
- Fetch and parse documentation from a URL
- Search for technical information across the web
- Build context from web sources
- Extract markdown from websites
- Query for technical documentation, APIs, or code examples
Platform Tool Mapping
This skill works across multiple platforms. Use the appropriate tools for your platform:
| Platform | Fetch Tool | Search Tool |
|---|---|---|
| opencode | webfetch |
websearch |
| claude code | WebFetch (MCP) |
WebSearch (MCP) |
| blackbox | web_fetch |
web_search |
| Python script | Auto-detects available tools | Auto-detects available tools |
Cascade Resolution Strategy
For URL inputs
Use this cascade (in order):
- Check llms.txt first: Probe
https://origin/llms.txtfor site-provided structured documentation (free, always check first) - Fetch URL: Use platform's fetch tool to get markdown content
- Search fallback: Use platform's search tool to find cached/mirrored versions if direct fetch fails
For query inputs
Use this cascade (in order):
- Search first: Use platform's search tool with relevant query (fast, free)
- Fetch top results: Use fetch tool to get markdown from top search results if needed
Implementation
Python Script (scripts/resolve.py)
The skill includes a Python script that auto-detects available tools:
# Resolve a URL
python scripts/resolve.py "https://docs.rust-lang.org/book/"
# Resolve a query
python scripts/resolve.py "Rust async programming"
# JSON output
python scripts/resolve.py "query" --json
# Custom max chars
python scripts/resolve.py "query" --max-chars 4000
# Force specific backend
python scripts/resolve.py "query" --backend httpx
Direct Tool Usage by Platform
opencode
# Check for llms.txt
webfetch https://example.com/llms.txt
# Fetch URL
webfetch --format markdown https://docs.rust-lang.org/book/
# Search
websearch "Rust book documentation"
claude code (MCP)
# Check for llms.txt
WebFetch(url="https://example.com/llms.txt")
# Fetch URL
WebFetch(url="https://docs.rust-lang.org/book/")
# Search
WebSearch(query="Rust book documentation")
blackbox
# Check for llms.txt
web_fetch(url="https://example.com/llms.txt", prompt="Extract all content")
# Fetch URL
web_fetch(url="https://docs.rust-lang.org/book/", prompt="Extract main content")
# Search
web_search(query="Rust book documentation")
Usage Examples
Basic URL Resolution
# Using Python script (auto-detects backend)
python scripts/resolve.py "https://docs.rust-lang.org/book/"
# Or use platform tool directly
webfetch https://docs.rust-lang.org/book/ # opencode
Query Resolution
# Using Python script
python scripts/resolve.py "Rust async programming best practices 2026"
# Or use platform tool directly
websearch "Tokio runtime configuration options" # opencode
Workflow for Building Context
- Check for llms.txt first: Probe
https://origin/llms.txt - Fetch content: Use fetch tool to get markdown from the URL
- Search if needed: Use search tool for additional context or when fetch fails
Best Practices
- Check for llms.txt first: Many documentation sites have
/llms.txtfor structured content - Use specific queries: "rust tokio spawn vs spawn_blocking difference" gets better results than "rust tokio"
- Filter by date: Add "2025" or "2026" to queries for current information
- Prefer official docs: Always check official documentation first
- Try multiple sources: If one URL fails, search for alternative mirrors
Quality Indicators
Good content has:
- Code examples with language markers
- API signatures and type annotations
- Configuration examples
- Version information
- Clear headings and structure
Poor content has:
- Excessive boilerplate/navigation
- Paywall blocks
- Login requirements
- Heavy advertising
Error Handling
- Provider failures should trigger cascade fallback
- Use alternative sources when primary sources fail
- Log errors for debugging
- Fall back to search when direct fetch fails
Testing
Run tests:
cd .agents/skills/web-doc-resolver
python -m pytest tests/ -v
Run samples:
python samples/sample_basic.py
python samples/sample_json.py
Files
scripts/resolve.py- Main implementation (multi-backend)tests/test_resolve.py- Unit testssamples/sample_basic.py- Basic usage examplessamples/sample_json.py- JSON output examplesreference.md- Detailed reference documentation
More from d-o-hub/rust-self-learning-memory
loop-agent
Execute workflow agents iteratively for refinement and progressive improvement until quality criteria are met. Use when tasks require repetitive refinement, multi-iteration improvements, progressive optimization, or feedback loops until convergence.
51web-search-researcher
Research topics using web search and content fetching to find accurate, current information. Use when you need modern information, official documentation, best practices, technical solutions, or comparisons beyond your training data.
46perplexity-researcher-reasoning-pro
Highest level of research and reasoning capabilities for complex decision-making with significant consequences, strategic planning, technical architecture decisions, multi-stakeholder problems, or high-complexity troubleshooting requiring expert-level judgment and sophisticated reasoning chains. Prioritizes actively maintained repositories and validates website sources for 2025 relevance.
44context-retrieval
Retrieve relevant episodic context from memory for informed decision-making. Use when you need past episodes, patterns, or solutions to similar tasks.
44rust-code-quality
Perform comprehensive Rust code quality reviews against best practices for async Rust, error handling, testing, and project structure
43codebase-analyzer
Analyze implementation details, trace data flow, explain technical workings, locate files, and consolidate codebases. Use when you need to understand HOW code works, find file locations, or assess technical debt.
40