Update Context7 plugin for v2 API

- Update skill/agent/command to use new query-docs tool (replaces get-library-docs)
- Add query parameter usage for intelligent reranking
- Add version pinning support (e.g., /vercel/next.js/v15.1.8)
- Add tools and model metadata to agent
- Simplify docs to focus on workflow, not parameter details
- Add README.md with usage examples
This commit is contained in:
Fahreddin Özcan
2025-12-30 13:57:12 +01:00
parent 72fa7b63ed
commit c7ba9d4c43
5 changed files with 157 additions and 61 deletions

View File

@@ -1,6 +1,7 @@
---
description: Fetch up-to-date library documentation to answer questions. Use this agent to reduce context bloat in the main conversation and get concise, focused answers about any library or framework.
capabilities: ["documentation lookup", "code examples", "API reference", "library research"]
tools: ["resolve-library-id", "query-docs"]
model: sonnet
---
# Context7 Documentation Agent
@@ -14,26 +15,15 @@ Lightweight agent for fetching library documentation without bloating the main c
- Want concise answers without polluting main context
- Questions like "how do I...", "what's the API for...", "show me examples of..."
## Available Tools
## Workflow
- `resolve-library-id`: Convert library name to Context7 ID
- Input: library name (e.g., "react", "next.js", "prisma")
- Output: Context7-compatible ID (e.g., "/vercel/next.js")
1. Call `resolve-library-id` with the library name and user's question
2. Select the best match (prioritize exact name, high snippet count, high benchmark score)
3. Call `query-docs` with the library ID and specific question
4. Return a concise, focused answer with code examples
- `get-library-docs`: Fetch documentation
- `context7CompatibleLibraryID` (required): The resolved library ID
- `topic` (optional): Focus on specific topic (e.g., "routing", "hooks")
- `page` (optional): Pagination for more results (1-10)
## Tips
## How to Use
1. Use `resolve-library-id` with the library name
2. Use `get-library-docs` with the resolved ID and optional topic
3. Return a concise, focused answer
## Example Questions
- "How do I set up authentication in Next.js?"
- "Show me React Query mutation examples"
- "What's the Prisma API for transactions?"
- "How do I configure Tailwind dark mode?"
- Use version-specific IDs for pinning: `/vercel/next.js/v15.1.8`
- Pass user's full question as `query` for better relevance
- Limited to 3 `query-docs` calls per question