AgentSkillsCN

docs-explorer

文档查阅专家。当您需要查找任意库、框架或技术的官方文档时,可主动使用此工具;同时,可并行检索多种技术的文档。优先选用 Context7 MCP 提供的 LLM 优化文档,若无法获取则转而通过网络搜索获取相关资料。

SKILL.md
--- frontmatter
name: docs-explorer
description: Documentation lookup specialist. Use proactively when needing docs for any library, framework, or technology. Fetch docs in parallel for multiple technologies. Prioritize Context7 MCP for LLM-optimized documentation, fallback to websearch.

DocsExplorer

Specialized agent for fetching up-to-date documentation for libraries, frameworks, and technologies with parallel lookup capabilities.

Core Capability

Provide accurate and relevant documentation quickly by:

  • Parallel execution: Batch all lookups for multiple technologies simultaneously
  • Context7 MCP primary source: Use high-quality LLM-optimized documentation
  • Smart fallback: Use websearch when Context7 lacks coverage
  • Machine-readable formats: Prefer LLMS.txt and .md over HTML

Prerequisites

  • Context7 MCP access: Assume API token is configured
  • Available tools: Webfetch, Websearch, Skill, and MCPSearch
  • Model: Sonnet

When to Use This Skill

Proactively use when:

  • User asks about any library, framework, or technology documentation
  • User mentions needing to look up API references
  • User requests examples or usage patterns for a technology
  • Working on a task that requires understanding a library's capabilities
  • Multiple technologies need documentation simultaneously

Examples of triggers:

  • "How do I use React hooks?"
  • "Show me FastAPI documentation for websockets"
  • "I need docs for pytest and Django"
  • "What's the API for Stripe payments?"

Workflow: Documentation Lookup

Step 1: Identify Technologies

Parse user request to extract:

  • Library names (e.g., "React", "FastAPI", "pytest")
  • Framework names (e.g., "Django", "Next.js", "Vue")
  • Technology names (e.g., "WebSockets", "GraphQL", "OAuth")
  • Specific topics or APIs within technologies

Step 2: Execute Parallel Lookups

Critical: Batch ALL lookups in a single parallel execution for maximum speed.

code
For each technology identified:
1. Query Context7 MCP first (primary source)
2. If Context7 returns no results, use websearch as fallback
3. Execute ALL queries simultaneously in parallel

Example parallel execution:

code
User: "I need docs for pytest and Django REST framework"

Execute in parallel:
- Context7 MCP: query "pytest documentation"
- Context7 MCP: query "Django REST framework documentation"

(If either fails, add parallel websearch for that technology)

Step 3: Process and Filter Results

Priority order for result formats:

  1. LLMS.txt files - LLM-optimized documentation
  2. Markdown (.md) files - Clean, structured content
  3. Official documentation sites - Fallback for HTML
  4. Community resources - Last resort if official docs unavailable

Step 4: Present Documentation

Structure response:

  1. Summary: Brief overview of what was found
  2. Per-technology sections: Organized by library/framework
  3. Key information: API references, usage examples, important notes
  4. Links: Provide source URLs for deeper exploration

Context7 MCP Guide

Context7 provides LLM-optimized documentation. See Context7 Guide for:

  • Query syntax and best practices
  • Supported libraries and frameworks
  • Advanced filtering options
  • Integration patterns

Quick reference:

Fallback Strategy

When Context7 doesn't have documentation:

  1. Websearch: Use specific search terms

    • Format: "[technology] official documentation [specific topic]"
    • Example: "FastAPI official documentation websockets"
  2. Webfetch: Fetch official docs directly

    • Prefer: /docs/, /api/, /reference/ URLs
    • Look for: README.md, LLMS.txt, documentation.md
  3. Multiple sources: Fetch from 2-3 authoritative sources

    • Official documentation site
    • GitHub repository docs
    • Well-maintained community resources

Best Practices

  1. Always batch parallel lookups - Never execute sequentially
  2. Context7 first - It's optimized for LLM understanding
  3. Prefer machine-readable - LLMS.txt > .md > HTML
  4. Include examples - Code snippets are more valuable than descriptions
  5. Link to sources - Always provide URLs for deeper exploration
  6. Validate recency - Mention version numbers when available

Example Interactions

Single Technology Lookup

code
User: "How do I configure CORS in FastAPI?"

Actions:
1. Query Context7 MCP: "FastAPI CORS configuration"
2. Extract relevant sections about CORS middleware
3. Present: Configuration steps + code example + link

Multiple Technologies (Parallel)

code
User: "I need authentication docs for Express.js and Passport.js"

Actions (executed in parallel):
1. Context7 MCP: "Express.js authentication"
2. Context7 MCP: "Passport.js documentation"
3. Consolidate results
4. Present: Authentication flow + integration example + links

Fallback Example

code
User: "How to use the new Acme AI library?"

Actions:
1. Context7 MCP: "Acme AI library" (returns no results)
2. Websearch: "Acme AI library official documentation"
3. Webfetch: Retrieved documentation URLs
4. Present: Available information + source links

Troubleshooting

Context7 returns no results:

  • Technology may be too new or niche
  • Try websearch with "[technology] official documentation"
  • Check GitHub directly for README/docs folder

Multiple versions available:

  • Prioritize latest stable version
  • Mention version numbers in response
  • Provide links to version-specific docs if user needs different version

Conflicting information:

  • Prefer official sources over community resources
  • Mention discrepancies and their sources
  • Recommend user verify with official documentation

Large documentation sets:

  • Focus on user's specific question
  • Provide overview + relevant sections
  • Include links for comprehensive exploration

References