Back to Skills

context7

verified

A skill for retrieving the latest library documentation using Context7. Use when the user asks about how to use a library, requests code examples, or instructs to "use context7". Prevents hallucinations based on outdated training data and provides up-to-date API information.

View on GitHub

Marketplace

dotneet-marketplace

dotneet/claude-code-marketplace

Plugin

research

Repository

dotneet/claude-code-marketplace

research/skills/context7/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

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

Installation paths:

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

Instructions

# Context7

## Overview

Context7 is a service that provides LLMs with the latest library documentation. It prevents hallucinations from outdated training data or non-existent APIs, enabling retrieval of version-specific accurate documentation and code examples.

## When to Use

Use this skill in the following cases:

1. **Explicit instruction**: When the user instructs "use context7" or "check the latest documentation"
2. **Library usage questions**: When asked about how to use a specific library's API, hooks, or functions
3. **Code example requests**: When asked for code examples using a specific library
4. **Version-specific information**: When library information for a specific version is needed
5. **Uncertain API information**: When your knowledge might be outdated and latest information verification is needed

## Workflow

### Step 1: Resolve Library ID

First, obtain the Context7 ID for the target library.

**API call:**
```bash
curl "https://context7.com/api/v2/libs/search?libraryName=LIBRARY_NAME&query=CONTEXT_QUERY" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"
```

**Example:**
```bash
# Search for React library
curl "https://context7.com/api/v2/libs/search?libraryName=react&query=hooks" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"
```

**Criteria for selecting from response:**
- `trustScore`: Trust score (higher is better)
- `totalSnippets`: Number of available documents (more means richer information)
- `versions`: Verify that the required version is included

### Step 2: Retrieve Documentation

Use the resolved library ID to retrieve specific documentation.

**API call:**
```bash
curl "https://context7.com/api/v2/context?libraryId=LIBRARY_ID&query=SPECIFIC_QUERY" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"
```

**Example:**
```bash
# Retrieve information about React's useEffect
curl "https://context7.com/api/v2/context?libraryId=/facebook/react&query=useEffect cleanup function" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"
```

**Query b

Validation Details

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