context7

Fetch current documentation and code examples for libraries via Context7.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/ankitjh4/skill-builder --skill context7-ankitjh4
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context7
Source: https://github.com/ankitjh4/skill-builder/tree/main/context7
Command: npx skills add https://github.com/ankitjh4/skill-builder --skill context7-ankitjh4

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

It eliminates outdated or hallucinated API knowledge by pulling the latest, version-specific documentation and code examples for the library or framework a user is working with.

Core Features & Use Cases

  • Live documentation lookup: Search for the correct Context7 library match and fetch relevant docs for a user’s exact question, including code examples.
  • Version-aware, accurate guidance: Use the library ID plus a tailored query to reduce ambiguity and ensure answers match current behavior.
  • Workflow for coding and troubleshooting: Use it when writing or reviewing code that depends on external libraries, SDKs, or frameworks.

Quick Start

Run the Context7 lookup for the library and your question, for example: bun Skills/context7/scripts/context7.ts lookup "next.js" "app router middleware next.js 14" --tokens 10000.

Frequently Asked Questions about context7

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fetch live documentation and code examples for an SDK or library?

Fetch live library documentation by executing a script lookup for the framework name and your specific question, optionally limiting tokens. This resolves the correct library ID and retrieves current, version-specific code examples and API references.

How do I prevent outdated or hallucinated API knowledge when writing code?

Prevent outdated API knowledge by pulling the latest, version-specific documentation for the library or framework you are working with. This ensures your code implementation and troubleshooting guidance matches current SDK behavior.

Can I use this to lookup documentation for a specific framework version?

Yes, you can lookup documentation for a specific framework by resolving its unique library ID and applying a tailored query. This version-aware approach reduces ambiguity and ensures the fetched API references match current behavior.

Do I need an API key to retrieve library documentation and code examples?

An API key is not strictly required but is supported for authentication when retrieving library documentation. You can execute the lookup script to fetch SDK integration examples and API references directly.

What is the best way to get accurate code examples for external library integration?

The best way to get accurate code examples is to query the live documentation source with your exact development question. Using the library ID plus a tailored query reduces ambiguity and returns implementation guidance that matches current behavior.