Back to Skills

context7

verified

Fetch up-to-date library documentation via Context7 REST API. Use when needing current API docs, framework patterns, or code examples for any library. Use when user asks about React, Next.js, Prisma, Express, Vue, Angular, Svelte, or any npm/PyPI package. Use when user says 'how do I use X library', 'what's the API for Y', or needs official documentation. Lightweight alternative to Context7 MCP with no persistent context overhead.

View on GitHub

Marketplace

arvindand-skills

arvindand/agent-skills

Plugin

agent-skills

Repository

arvindand/agent-skills
7stars

skills/context7/SKILL.md

Last Verified

January 20, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/arvindand/agent-skills/blob/main/skills/context7/SKILL.md -a claude-code --skill context7

Installation paths:

Claude
.claude/skills/context7/
Powered by add-skill CLI

Instructions

# Context7 Documentation Lookup Skill

Fetch current library documentation, API references, and code examples without MCP context overhead.

**Works on all platforms via REST API.**

## When to Use

**Activate automatically when:**

- User asks about library APIs or framework patterns
- User requests code generation using specific libraries/frameworks
- Import statements suggest documentation needs: `import`, `require`, `from`
- Questions about specific library versions or migration
- Need for official documentation patterns vs generic solutions
- Setting up or configuring third-party tools
- "How do I use X library?", "What's the API for Y?"

**Examples:**

- "Create Next.js middleware with authentication" → Use context7
- "Set up Prisma with PostgreSQL" → Use context7
- "Implement Supabase authentication" → Use context7

## Workflow

### Quick Start (If You Know the Library)

**Skip the search** when you already know the library:

```bash
scripts/context7.py docs "/vercel/next.js" "middleware authentication"
```

Common library IDs:

- React: `/facebook/react`
- Next.js: `/vercel/next.js`
- Prisma: `/prisma/prisma`
- Supabase: `/supabase/supabase`
- Express: `/expressjs/express`

### Full Workflow

#### Step 1: Search for Library ID (if unknown)

Search first to get the correct library ID:

```bash
scripts/context7.py search "library-name"
```

Example output shows library IDs you can use:

```txt
ID: /facebook/react
Name: React
Snippets: 2135 | Score: 79.4
```

#### Step 2: Fetch Documentation

```bash
scripts/context7.py docs "<library-id>" "[topic]" "[mode]"
```

**Parameters:**

- `library-id`: From search results (e.g., `/facebook/react`) or known library ID
- `topic`: Optional focus area (e.g., `hooks`, `routing`, `authentication`)
- `mode`: `code` (default) for API/examples, `info` for guides

**Version-Specific Docs:**

```bash
# Request specific version by adding it to the library ID
scripts/context7.py docs "/vercel/next.js/14" "middleware"

# Or mention

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
7894 chars