Library Research
Research and retrieve documentation for libraries, frameworks, and packages using Context7 integration.
When to use this skill
Use this skill when:
-
User asks about a library or framework
-
You need to research an API or package documentation
-
User mentions "How do I use..." for a third-party library
-
You need to find official documentation or examples
How It Works
This skill integrates with Context7 to efficiently retrieve library documentation:
-
Library Identification: Parse user query to identify library/package name
-
Resolution: Use Context7 to resolve library name to standard ID
-
Retrieval: Fetch comprehensive documentation for the library
-
Analysis: Extract relevant sections for user's specific question
-
Delivery: Present findings in clear, actionable format
Step-by-Step Process
- Identify Library/Package
Parse the user's question to identify the library:
User: "How do I create a table with React?" Library: React Query: table component
- Resolve Library ID
Use context7_resolve_library_id tool to get the official ID:
context7_resolve_library_id("react") → Returns: /facebook/react, /facebook/react/latest
- Get Documentation
Use context7_get_library_docs to retrieve relevant documentation:
context7_get_library_docs("/facebook/react/latest", mode="code") → Returns: API reference, code examples, component guides
- Extract Relevant Information
From the documentation, find:
-
Relevant classes/functions
-
Usage examples
-
Common patterns
-
Edge cases
-
Error handling
- Present to User
Format findings as:
-
Brief explanation
-
Code example (if applicable)
-
Link to official docs
-
Related resources
Common Library Research Patterns
Pattern: "How to..." Questions
User: "How do I validate JSON with TypeScript?" Skill Response:
- Identify: Zod, TypeScript, or JSON Schema
- Get docs for selected library
- Show validation example
- Explain types and error handling
Pattern: Version-Specific Questions
User: "Does React 18 support X?" Process:
- Resolve: /facebook/react/v18
- Get mode-specific docs
- Check API changes
- Provide version notes
Pattern: Comparison Questions
User: "What's the difference between A and B libraries?" Process:
- Research both libraries
- Compare key features
- Show usage differences
- Recommend use cases
Tools & Integration
Context7 Tools
context7_resolve_library_id: Resolve library name to standard ID
-
Input: Library name string
-
Output: Standard library ID and alternatives
-
Use when: User mentions library but you need official ID
context7_get_library_docs: Fetch library documentation
-
Input: Library ID, mode (code/info)
-
Output: Documentation content, examples, references
-
Use when: You have library ID and need docs
webfetch: Retrieve external documentation
-
Input: Documentation URL
-
Output: Page content
-
Use when: Need latest docs or examples outside Context7
Safety & Best Practices
-
Read-Only: Never modify user code without explicit permission
-
Rate Limiting: Respect API limits on Context7 calls
-
Verification: Always verify documentation is current
-
Attribution: Link to official documentation sources
-
Error Handling: Clearly explain if library not found
Examples
Example 1: React Table Implementation
User: "How do I create a sortable table in React?"
Process:
- Resolve: /facebook/react
- Get: Component examples, hooks, state management
- Present: Table component pattern using useState
- Show: Full working example with sorting logic
- Link: Official React docs for tables and sorting
Example 2: TypeScript Generics
User: "How do TypeScript generics work?"
Process:
- Resolve: /microsoft/typescript
- Get: Generic syntax, constraints, usage
- Present: Generic function example
- Explain: Type parameters and inference
- Show: Common patterns and pitfalls
Example 3: Python Package Query
User: "What does the pandas groupby() method do?"
Process:
- Resolve: /pandas-dev/pandas
- Get: groupby documentation and examples
- Present: Method signature and parameters
- Show: Practical groupby examples
- Link: Official pandas groupby guide
Troubleshooting
Library Not Found
If Context7 can't find a library:
-
Try alternative names (npm vs PyPI names differ)
-
Search for official repository
-
Try webfetch with official docs URL
-
Inform user if library is very new/niche
Documentation Gaps
If official docs are incomplete:
-
Check GitHub repository for examples
-
Search for Stack Overflow answers
-
Look for blog posts or tutorials
-
Note limitations to user
Rate Limits
If hitting Context7 rate limits:
-
Cache previous queries
-
Batch multiple questions
-
Use less frequent calls
-
Fall back to webfetch
Best Practices
-
Always Link: Provide links to official documentation
-
Show Examples: Code examples are crucial for libraries
-
Verify Currency: Check documentation is up-to-date
-
Note Versions: Specify which library version you're documenting
-
Warn Changes: Alert users to breaking changes between versions
-
Test Examples: Where possible, verify code examples work
Related Resources
-
Context7 Documentation: https://context7.io
-
Library Standards: https://opensource.org
-
API Documentation Tools: https://swagger.io
-
Code Example Best Practices: https://www.oreilly.com
Keywords
library, documentation, API, packages, frameworks, context7, research, code-example, integration