From 72fa7b63ed38d6c9fa41a566a0071f9764a18e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahreddin=20=C3=96zcan?= Date: Wed, 24 Dec 2025 08:57:31 +0100 Subject: [PATCH 1/6] feat: add c7 agent --- .../context7/agents/docs-researcher.md | 39 ++++++++++++++++++ external_plugins/context7/commands/docs.md | 31 ++++++++++++++ .../skills/documentation-lookup/SKILL.md | 40 +++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 external_plugins/context7/agents/docs-researcher.md create mode 100644 external_plugins/context7/commands/docs.md create mode 100644 external_plugins/context7/skills/documentation-lookup/SKILL.md diff --git a/external_plugins/context7/agents/docs-researcher.md b/external_plugins/context7/agents/docs-researcher.md new file mode 100644 index 0000000..f7aeb06 --- /dev/null +++ b/external_plugins/context7/agents/docs-researcher.md @@ -0,0 +1,39 @@ +--- +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"] +--- + +# Context7 Documentation Agent + +Lightweight agent for fetching library documentation without bloating the main conversation context. + +## When to Use + +- Any question about a library, framework, or package +- Need code examples or API reference +- Want concise answers without polluting main context +- Questions like "how do I...", "what's the API for...", "show me examples of..." + +## Available Tools + +- `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") + +- `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) + +## 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?" diff --git a/external_plugins/context7/commands/docs.md b/external_plugins/context7/commands/docs.md new file mode 100644 index 0000000..45b6f4b --- /dev/null +++ b/external_plugins/context7/commands/docs.md @@ -0,0 +1,31 @@ +--- +description: Fetch up-to-date documentation and code examples for any library +argument-hint: [topic] +--- + +# Context7 Documentation Lookup + +Fetch current, version-specific documentation straight from source repositories. + +## Arguments + +`$ARGUMENTS` = ` [topic]` + +Examples: +- `react hooks` → library="react", topic="hooks" +- `next.js routing` → library="next.js", topic="routing" +- `prisma` → library="prisma", topic=none + +## Steps + +1. Parse arguments: first word = library, remaining = topic +2. Call `resolve-library-id` with the library name +3. Call `get-library-docs` with: + - `context7CompatibleLibraryID`: the resolved ID + - `topic`: the topic (if provided) +4. Present documentation with code examples + +## Tips + +- If you know the exact library ID, use it directly: `/context7:docs /vercel/next.js routing` +- Use `page` parameter (1-10) if initial results aren't sufficient diff --git a/external_plugins/context7/skills/documentation-lookup/SKILL.md b/external_plugins/context7/skills/documentation-lookup/SKILL.md new file mode 100644 index 0000000..1fd02bb --- /dev/null +++ b/external_plugins/context7/skills/documentation-lookup/SKILL.md @@ -0,0 +1,40 @@ +--- +name: documentation-lookup +description: Use when user needs code generation, setup/configuration steps, or library/API documentation. Automatically fetch up-to-date docs for any library or framework without requiring "use context7" in the prompt. +--- + +# Context7 Documentation Skill + +Automatically fetch up-to-date, version-specific documentation and code examples straight from the source. + +## Why Use This + +Without Context7: +- Code examples based on outdated training data +- Hallucinated APIs that don't exist +- Generic answers for old package versions + +With Context7: +- Current documentation from source repositories +- Working code examples +- Version-specific information + +## When to Trigger + +- User asks "how do I..." for any library +- User needs code generation with a specific library +- User asks about setup or configuration +- User needs API reference or examples +- User mentions any framework: React, Next.js, Vue, Svelte, Express, Prisma, Tailwind, etc. + +## Available Tools + +- `resolve-library-id`: Convert library name → Context7 ID +- `get-library-docs`: Fetch docs with optional topic filter + +## How to Use + +1. Identify the library from user's question +2. Call `resolve-library-id` with library name +3. Call `get-library-docs` with resolved ID and topic (if specific) +4. Present code examples and explanations From c7ba9d4c4316cfac0f116cc00a7370a47aed9822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahreddin=20=C3=96zcan?= Date: Tue, 30 Dec 2025 13:57:12 +0100 Subject: [PATCH 2/6] 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 --- .../context7/.claude-plugin/plugin.json | 2 +- external_plugins/context7/README.md | 119 ++++++++++++++++++ .../context7/agents/docs-researcher.md | 32 ++--- external_plugins/context7/commands/docs.md | 31 +++-- .../skills/documentation-lookup/SKILL.md | 34 ++--- 5 files changed, 157 insertions(+), 61 deletions(-) create mode 100644 external_plugins/context7/README.md diff --git a/external_plugins/context7/.claude-plugin/plugin.json b/external_plugins/context7/.claude-plugin/plugin.json index a53438c..dbfa285 100644 --- a/external_plugins/context7/.claude-plugin/plugin.json +++ b/external_plugins/context7/.claude-plugin/plugin.json @@ -2,6 +2,6 @@ "name": "context7", "description": "Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.", "author": { - "name": "Upstash" + "name": "Upstash " } } diff --git a/external_plugins/context7/README.md b/external_plugins/context7/README.md new file mode 100644 index 0000000..5d1a95e --- /dev/null +++ b/external_plugins/context7/README.md @@ -0,0 +1,119 @@ +# Context7 Plugin + +Up-to-date, version-specific documentation and code examples for any library, directly in your AI coding assistant. + +## What is Context7? + +Context7 solves the problem of outdated training data and hallucinated APIs by providing real-time library documentation. Instead of relying on potentially outdated knowledge, Context7 fetches current documentation straight from source repositories. + +**Without Context7:** +- Code examples based on outdated training data +- Hallucinated APIs that don't exist +- Generic answers for old package versions + +**With Context7:** +- Current documentation from source repositories +- Working code examples +- Version-specific information +- Intelligent query-based context selection + +## Available Tools + +### `resolve-library-id` + +Search and resolve library names to Context7-compatible library IDs. + +``` +Parameters: +- libraryName: Library name to search for (e.g., "react", "next.js") +- query: Your question for relevance ranking + +Returns: +- id: Context7-compatible ID (e.g., "/vercel/next.js") +- title: Display name +- description: Short description +- totalSnippets: Documentation coverage +- benchmarkScore: Quality indicator (0-100) +- versions: Available versions +``` + +### `query-docs` + +Fetch documentation with intelligent, query-based reranking. + +``` +Parameters: +- libraryId: Context7-compatible library ID + - Format: /org/project (e.g., /vercel/next.js) + - With version: /org/project/version (e.g., /vercel/next.js/v15.1.8) +- query: Specific question or task + +Features: +- LLM-driven reranking based on query intent +- Deduplicated snippet selection +- Limited to 3 calls per question +``` + +## Usage + +### Automatic (Skill) + +The `documentation-lookup` skill triggers automatically when you: +- Ask "how do I..." for any library +- Need code generation with a specific library +- Ask about setup or configuration +- Mention any framework (React, Next.js, Vue, etc.) + +### Manual (Command) + +Use the `/context7:docs` command: + +``` +/context7:docs react hooks +/context7:docs next.js how to set up authentication +/context7:docs /vercel/next.js/v15.1.8 app router +``` + +### Agent + +Use the `docs-researcher` agent for focused documentation lookups that don't bloat the main conversation: + +``` +Spawn a docs-researcher agent to find React Query mutation examples +``` + +## Version Pinning + +For consistent, reproducible results, use version-specific library IDs: + +``` +/vercel/next.js/v15.1.8 +/facebook/react/v18.3.0 +/prisma/prisma/v5.0.0 +``` + +## Examples + +**Basic usage:** +``` +How do I set up authentication in Next.js? +→ Automatically fetches Next.js auth documentation +``` + +**With specific version:** +``` +/context7:docs /vercel/next.js/v15.1.8 middleware +→ Fetches Next.js 15.1.8 middleware documentation +``` + +**Multiple libraries:** +``` +How do I use Prisma with Next.js API routes? +→ Fetches relevant docs from both Prisma and Next.js +``` + +## Links + +- [Context7 Website](https://context7.com) +- [GitHub Repository](https://github.com/upstash/context7) +- [Upstash](https://upstash.com) diff --git a/external_plugins/context7/agents/docs-researcher.md b/external_plugins/context7/agents/docs-researcher.md index f7aeb06..7661496 100644 --- a/external_plugins/context7/agents/docs-researcher.md +++ b/external_plugins/context7/agents/docs-researcher.md @@ -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 diff --git a/external_plugins/context7/commands/docs.md b/external_plugins/context7/commands/docs.md index 45b6f4b..5e1b514 100644 --- a/external_plugins/context7/commands/docs.md +++ b/external_plugins/context7/commands/docs.md @@ -1,31 +1,28 @@ --- description: Fetch up-to-date documentation and code examples for any library -argument-hint: [topic] +argument-hint: [query] --- # Context7 Documentation Lookup -Fetch current, version-specific documentation straight from source repositories. +Fetch current, version-specific documentation from source repositories. ## Arguments -`$ARGUMENTS` = ` [topic]` +`$ARGUMENTS` = ` [query]` + +- First word: library name (or direct library ID starting with `/`) +- Remaining: your specific question or topic Examples: -- `react hooks` → library="react", topic="hooks" -- `next.js routing` → library="next.js", topic="routing" -- `prisma` → library="prisma", topic=none +- `react hooks` +- `next.js authentication` +- `/vercel/next.js/v15.1.8 app router` ## Steps -1. Parse arguments: first word = library, remaining = topic -2. Call `resolve-library-id` with the library name -3. Call `get-library-docs` with: - - `context7CompatibleLibraryID`: the resolved ID - - `topic`: the topic (if provided) -4. Present documentation with code examples - -## Tips - -- If you know the exact library ID, use it directly: `/context7:docs /vercel/next.js routing` -- Use `page` parameter (1-10) if initial results aren't sufficient +1. Parse arguments: first word = library, remaining = query +2. If library starts with `/`, use it directly as library ID +3. Otherwise, call `resolve-library-id` with library name and query +4. Call `query-docs` with the library ID and query +5. Present documentation with code examples diff --git a/external_plugins/context7/skills/documentation-lookup/SKILL.md b/external_plugins/context7/skills/documentation-lookup/SKILL.md index 1fd02bb..959d907 100644 --- a/external_plugins/context7/skills/documentation-lookup/SKILL.md +++ b/external_plugins/context7/skills/documentation-lookup/SKILL.md @@ -5,19 +5,7 @@ description: Use when user needs code generation, setup/configuration steps, or # Context7 Documentation Skill -Automatically fetch up-to-date, version-specific documentation and code examples straight from the source. - -## Why Use This - -Without Context7: -- Code examples based on outdated training data -- Hallucinated APIs that don't exist -- Generic answers for old package versions - -With Context7: -- Current documentation from source repositories -- Working code examples -- Version-specific information +Fetch up-to-date, version-specific documentation and code examples from source repositories. ## When to Trigger @@ -27,14 +15,16 @@ With Context7: - User needs API reference or examples - User mentions any framework: React, Next.js, Vue, Svelte, Express, Prisma, Tailwind, etc. -## Available Tools +## Workflow -- `resolve-library-id`: Convert library name → Context7 ID -- `get-library-docs`: Fetch docs with optional topic filter - -## How to Use - -1. Identify the library from user's question -2. Call `resolve-library-id` with library name -3. Call `get-library-docs` with resolved ID and topic (if specific) +1. Call `resolve-library-id` with the library name and user's question +2. Select the best match (prioritize exact name, high `totalSnippets`, high `benchmarkScore`) +3. Call `query-docs` with the library ID and user's question 4. Present code examples and explanations + +## Tips + +- Use version-specific IDs for pinned versions: `/vercel/next.js/v15.1.8` +- The `query` parameter improves result relevance - pass the user's full question +- Limited to 3 `query-docs` calls per question to prevent context bloat +- Check `versions` field from `resolve-library-id` for available versions From 24cec23cf1f54b37d977f4daf95c779a2a69fca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahreddin=20=C3=96zcan?= Date: Tue, 30 Dec 2025 13:59:29 +0100 Subject: [PATCH 3/6] Switch Context7 MCP to remote HTTP server --- external_plugins/context7/.mcp.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external_plugins/context7/.mcp.json b/external_plugins/context7/.mcp.json index 6dec78d..989effd 100644 --- a/external_plugins/context7/.mcp.json +++ b/external_plugins/context7/.mcp.json @@ -1,6 +1,6 @@ { "context7": { - "command": "npx", - "args": ["-y", "@upstash/context7-mcp"] + "type": "http", + "url": "https://mcp.context7.com/mcp" } } From 32f2cdbe0ce525171c6db3bb9f9a72cfc8167dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahreddin=20=C3=96zcan?= Date: Wed, 14 Jan 2026 19:03:43 +0300 Subject: [PATCH 4/6] feat: update tools with better skill/agent format prompt --- external_plugins/context7/README.md | 120 ++++++------------ .../context7/agents/docs-researcher.md | 47 ++++--- external_plugins/context7/commands/docs.md | 51 +++++--- .../skills/documentation-lookup/SKILL.md | 61 ++++++--- 4 files changed, 142 insertions(+), 137 deletions(-) diff --git a/external_plugins/context7/README.md b/external_plugins/context7/README.md index 5d1a95e..48a88e9 100644 --- a/external_plugins/context7/README.md +++ b/external_plugins/context7/README.md @@ -1,119 +1,73 @@ -# Context7 Plugin +# Context7 Plugin for Claude Code -Up-to-date, version-specific documentation and code examples for any library, directly in your AI coding assistant. +Context7 solves a common problem with AI coding assistants: outdated training data and hallucinated APIs. Instead of relying on stale knowledge, Context7 fetches current documentation directly from source repositories. -## What is Context7? +## What's Included -Context7 solves the problem of outdated training data and hallucinated APIs by providing real-time library documentation. Instead of relying on potentially outdated knowledge, Context7 fetches current documentation straight from source repositories. +This plugin provides: -**Without Context7:** -- Code examples based on outdated training data -- Hallucinated APIs that don't exist -- Generic answers for old package versions +- **MCP Server** - Connects Claude Code to Context7's documentation service +- **Skills** - Auto-triggers documentation lookups when you ask about libraries +- **Agents** - A dedicated `docs-researcher` agent for focused lookups +- **Commands** - `/context7:docs` for manual documentation queries -**With Context7:** -- Current documentation from source repositories -- Working code examples -- Version-specific information -- Intelligent query-based context selection +## Installation + +Add the marketplace and install the plugin: + +```bash +claude plugin marketplace add upstash/context7 +claude plugin install context7-plugin@context7-marketplace +``` ## Available Tools -### `resolve-library-id` +### resolve-library-id -Search and resolve library names to Context7-compatible library IDs. +Searches for libraries and returns Context7-compatible identifiers. ``` -Parameters: -- libraryName: Library name to search for (e.g., "react", "next.js") -- query: Your question for relevance ranking - -Returns: -- id: Context7-compatible ID (e.g., "/vercel/next.js") -- title: Display name -- description: Short description -- totalSnippets: Documentation coverage -- benchmarkScore: Quality indicator (0-100) -- versions: Available versions +Input: "next.js" +Output: { id: "/vercel/next.js", name: "Next.js", versions: ["v15.1.8", "v14.2.0", ...] } ``` -### `query-docs` +### query-docs -Fetch documentation with intelligent, query-based reranking. +Fetches documentation for a specific library, ranked by relevance to your question. ``` -Parameters: -- libraryId: Context7-compatible library ID - - Format: /org/project (e.g., /vercel/next.js) - - With version: /org/project/version (e.g., /vercel/next.js/v15.1.8) -- query: Specific question or task - -Features: -- LLM-driven reranking based on query intent -- Deduplicated snippet selection -- Limited to 3 calls per question +Input: { libraryId: "/vercel/next.js", query: "app router middleware" } +Output: Relevant documentation snippets with code examples ``` -## Usage +## Usage Examples -### Automatic (Skill) +The plugin works automatically when you ask about libraries: -The `documentation-lookup` skill triggers automatically when you: -- Ask "how do I..." for any library -- Need code generation with a specific library -- Ask about setup or configuration -- Mention any framework (React, Next.js, Vue, etc.) +- "How do I set up authentication in Next.js 15?" +- "Show me React Server Components examples" +- "What's the Prisma syntax for relations?" -### Manual (Command) - -Use the `/context7:docs` command: +For manual lookups, use the command: ``` -/context7:docs react hooks -/context7:docs next.js how to set up authentication -/context7:docs /vercel/next.js/v15.1.8 app router +/context7:docs next.js app router +/context7:docs /vercel/next.js/v15.1.8 middleware ``` -### Agent - -Use the `docs-researcher` agent for focused documentation lookups that don't bloat the main conversation: +Or spawn the docs-researcher agent when you want to keep your main context clean: ``` -Spawn a docs-researcher agent to find React Query mutation examples +spawn docs-researcher to look up Supabase auth methods ``` ## Version Pinning -For consistent, reproducible results, use version-specific library IDs: +To get documentation for a specific version, include the version in the library ID: ``` /vercel/next.js/v15.1.8 -/facebook/react/v18.3.0 -/prisma/prisma/v5.0.0 +/supabase/supabase/v2.45.0 ``` -## Examples - -**Basic usage:** -``` -How do I set up authentication in Next.js? -→ Automatically fetches Next.js auth documentation -``` - -**With specific version:** -``` -/context7:docs /vercel/next.js/v15.1.8 middleware -→ Fetches Next.js 15.1.8 middleware documentation -``` - -**Multiple libraries:** -``` -How do I use Prisma with Next.js API routes? -→ Fetches relevant docs from both Prisma and Next.js -``` - -## Links - -- [Context7 Website](https://context7.com) -- [GitHub Repository](https://github.com/upstash/context7) -- [Upstash](https://upstash.com) +The `resolve-library-id` tool returns available versions, so you can pick the one that matches your project. diff --git a/external_plugins/context7/agents/docs-researcher.md b/external_plugins/context7/agents/docs-researcher.md index 7661496..ec7e8aa 100644 --- a/external_plugins/context7/agents/docs-researcher.md +++ b/external_plugins/context7/agents/docs-researcher.md @@ -1,29 +1,40 @@ --- -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. -tools: ["resolve-library-id", "query-docs"] +name: docs-researcher +description: Lightweight agent for fetching library documentation without cluttering your main conversation context. model: sonnet --- -# Context7 Documentation Agent +You are a documentation researcher specializing in fetching up-to-date library and framework documentation from Context7. -Lightweight agent for fetching library documentation without bloating the main conversation context. +## Your Task -## When to Use +When given a question about a library or framework, fetch the relevant documentation and return a concise, actionable answer with code examples. -- Any question about a library, framework, or package -- Need code examples or API reference -- Want concise answers without polluting main context -- Questions like "how do I...", "what's the API for...", "show me examples of..." +## Process -## Workflow +1. **Identify the library**: Extract the library/framework name from the user's question. -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 +2. **Resolve the library ID**: Call `resolve-library-id` with: + - `libraryName`: The library name (e.g., "react", "next.js", "prisma") + - `query`: The user's full question for relevance ranking -## Tips +3. **Select the best match**: From the results, pick the library with: + - Exact or closest name match + - Highest benchmark score + - Appropriate version if the user specified one (e.g., "React 19" → look for v19.x) -- 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 +4. **Fetch documentation**: Call `query-docs` with: + - `libraryId`: The selected Context7 library ID (e.g., `/vercel/next.js`) + - `query`: The user's specific question for targeted results + +5. **Return a focused answer**: Summarize the relevant documentation with: + - Direct answer to the question + - Code examples from the docs + - Links or references if available + +## Guidelines + +- Pass the user's full question as the query parameter for better relevance +- When the user mentions a version (e.g., "Next.js 15"), use version-specific library IDs if available +- If `resolve-library-id` returns multiple matches, prefer official/primary packages over community forks +- Keep responses concise - the goal is to answer the question, not dump entire documentation diff --git a/external_plugins/context7/commands/docs.md b/external_plugins/context7/commands/docs.md index 5e1b514..8a2df78 100644 --- a/external_plugins/context7/commands/docs.md +++ b/external_plugins/context7/commands/docs.md @@ -1,28 +1,45 @@ --- -description: Fetch up-to-date documentation and code examples for any library +description: Look up documentation for any library argument-hint: [query] --- -# Context7 Documentation Lookup +# /context7:docs -Fetch current, version-specific documentation from source repositories. +Fetches up-to-date documentation and code examples for a library. -## Arguments +## Usage -`$ARGUMENTS` = ` [query]` +``` +/context7:docs [query] +``` -- First word: library name (or direct library ID starting with `/`) -- Remaining: your specific question or topic +- **library**: The library name, or a Context7 ID starting with `/` +- **query**: What you're looking for (optional but recommended) -Examples: -- `react hooks` -- `next.js authentication` -- `/vercel/next.js/v15.1.8 app router` +## Examples -## Steps +``` +/context7:docs react hooks +/context7:docs next.js authentication +/context7:docs prisma relations +/context7:docs /vercel/next.js/v15.1.8 app router +/context7:docs /supabase/supabase row level security +``` -1. Parse arguments: first word = library, remaining = query -2. If library starts with `/`, use it directly as library ID -3. Otherwise, call `resolve-library-id` with library name and query -4. Call `query-docs` with the library ID and query -5. Present documentation with code examples +## How It Works + +1. If the library starts with `/`, it's used directly as the Context7 ID +2. Otherwise, `resolve-library-id` finds the best matching library +3. `query-docs` fetches documentation relevant to your query +4. Results include code examples and explanations + +## Version-Specific Lookups + +Include the version in the library ID for pinned documentation: + +``` +/context7:docs /vercel/next.js/v15.1.8 middleware +/context7:docs /facebook/react/v19.0.0 use hook +``` + +This is useful when you're working with a specific version and want docs that match exactly. diff --git a/external_plugins/context7/skills/documentation-lookup/SKILL.md b/external_plugins/context7/skills/documentation-lookup/SKILL.md index 959d907..8b7f399 100644 --- a/external_plugins/context7/skills/documentation-lookup/SKILL.md +++ b/external_plugins/context7/skills/documentation-lookup/SKILL.md @@ -1,30 +1,53 @@ --- name: documentation-lookup -description: Use when user needs code generation, setup/configuration steps, or library/API documentation. Automatically fetch up-to-date docs for any library or framework without requiring "use context7" in the prompt. +description: This skill should be used when the user asks about libraries, frameworks, API references, or needs code examples. Activates for setup questions, code generation involving libraries, or mentions of specific frameworks like React, Vue, Next.js, Prisma, Supabase, etc. --- -# Context7 Documentation Skill +When the user asks about libraries, frameworks, or needs code examples, use Context7 to fetch current documentation instead of relying on training data. -Fetch up-to-date, version-specific documentation and code examples from source repositories. +## When to Use This Skill -## When to Trigger +Activate this skill when the user: -- User asks "how do I..." for any library -- User needs code generation with a specific library -- User asks about setup or configuration -- User needs API reference or examples -- User mentions any framework: React, Next.js, Vue, Svelte, Express, Prisma, Tailwind, etc. +- Asks setup or configuration questions ("How do I configure Next.js middleware?") +- Requests code involving libraries ("Write a Prisma query for...") +- Needs API references ("What are the Supabase auth methods?") +- Mentions specific frameworks (React, Vue, Svelte, Express, Tailwind, etc.) -## Workflow +## How to Fetch Documentation -1. Call `resolve-library-id` with the library name and user's question -2. Select the best match (prioritize exact name, high `totalSnippets`, high `benchmarkScore`) -3. Call `query-docs` with the library ID and user's question -4. Present code examples and explanations +### Step 1: Resolve the Library ID -## Tips +Call `resolve-library-id` with: -- Use version-specific IDs for pinned versions: `/vercel/next.js/v15.1.8` -- The `query` parameter improves result relevance - pass the user's full question -- Limited to 3 `query-docs` calls per question to prevent context bloat -- Check `versions` field from `resolve-library-id` for available versions +- `libraryName`: The library name extracted from the user's question +- `query`: The user's full question (improves relevance ranking) + +### Step 2: Select the Best Match + +From the resolution results, choose based on: + +- Exact or closest name match to what the user asked for +- Higher benchmark scores indicate better documentation quality +- If the user mentioned a version (e.g., "React 19"), prefer version-specific IDs + +### Step 3: Fetch the Documentation + +Call `query-docs` with: + +- `libraryId`: The selected Context7 library ID (e.g., `/vercel/next.js`) +- `query`: The user's specific question + +### Step 4: Use the Documentation + +Incorporate the fetched documentation into your response: + +- Answer the user's question using current, accurate information +- Include relevant code examples from the docs +- Cite the library version when relevant + +## Guidelines + +- **Be specific**: Pass the user's full question as the query for better results +- **Version awareness**: When users mention versions ("Next.js 15", "React 19"), use version-specific library IDs if available from the resolution step +- **Prefer official sources**: When multiple matches exist, prefer official/primary packages over community forks From 085871e8e7c509aea3d77be61d7f2da4ddb80cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahreddin=20=C3=96zcan?= Date: Wed, 14 Jan 2026 19:07:09 +0300 Subject: [PATCH 5/6] fmt --- external_plugins/context7/.claude-plugin/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external_plugins/context7/.claude-plugin/plugin.json b/external_plugins/context7/.claude-plugin/plugin.json index dbfa285..a53438c 100644 --- a/external_plugins/context7/.claude-plugin/plugin.json +++ b/external_plugins/context7/.claude-plugin/plugin.json @@ -2,6 +2,6 @@ "name": "context7", "description": "Upstash Context7 MCP server for up-to-date documentation lookup. Pull version-specific documentation and code examples directly from source repositories into your LLM context.", "author": { - "name": "Upstash " + "name": "Upstash" } } From 42d7afb1f04eb672cb16faa68e8d220666af6f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahreddin=20=C3=96zcan?= Date: Wed, 14 Jan 2026 19:08:42 +0300 Subject: [PATCH 6/6] fix: installation guide --- external_plugins/context7/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/external_plugins/context7/README.md b/external_plugins/context7/README.md index 48a88e9..0ca26a7 100644 --- a/external_plugins/context7/README.md +++ b/external_plugins/context7/README.md @@ -13,11 +13,10 @@ This plugin provides: ## Installation -Add the marketplace and install the plugin: +Install the plugin from the official marketplace: ```bash -claude plugin marketplace add upstash/context7 -claude plugin install context7-plugin@context7-marketplace +claude plugin install context7@claude-plugins-official ``` ## Available Tools