Context7
Anti-hallucination protocol for library APIs — resolves the exact installed version from the lockfile, fetches current official docs (Context7 MCP if installed, web fetch otherwise), quotes the doc before writing any code, and pins the version in output. Use when code touches a fast-moving library (Next.js, React, LangChain, Prisma, Tailwind), when the user says "check the actual docs" or "what's the current API for X", or after any deprecation or breaking-change error.From its SKILL.md
npx -y skills add alebgl77/claude-inc --skill context7Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.7 KB, 782 tokens by cl100k_base, as published. Nobody here has run it
Context7 — Docs Fetcher
"Live library docs"
Trained knowledge ages; your dependencies don't wait. The docs are the source of truth — memory is only a hint.
When to use
- Writing code against fast movers — Next.js, React, LangChain, Prisma, Tailwind — where trained knowledge is stale by default
- "Check the actual docs before you write this" / "is this still the right API in v15?"
- "This worked in v4 but breaks in v5" — any deprecation warning or breaking-change error
- Choosing between API generations — "app router or pages router way?"
- Before adding a dependency — verify the current install command and quickstart, not remembered ones
Workflow
- List the libraries the task touches and flag fast movers (any project with major releases in the past year).
- Resolve the exact installed version from the lockfile —
package-lock.json,pnpm-lock.yaml,yarn.lock,poetry.lock,uv.lock,Cargo.lock,go.sum. Grep the lockfile itself; never trust manifest ranges or memory. - Fetch current docs for that version. Optional upgrade: with the Context7 MCP server installed, call
resolve-library-idthenget-library-docs. Otherwise WebFetch/WebSearch the official docs, changelog, and migration guide — official sources only. - Quote the relevant passage verbatim — signature, options, gotchas — before writing a single line of code.
- Write the code against the quoted signature, exactly; no extra parameters from memory.
- Pin the library and version in the output header; note any deprecations between installed and latest.
- If lockfile and docs disagree (docs describe a newer API), surface it: ship code for the installed version plus the upgrade path.
- If the doc page covers multiple versions, confirm the version selector matches the installed one before quoting.
- No network at all? Say so loudly, mark the code UNVERIFIED, and list exactly which signatures must be checked before merge.
Output format
Library: <name>@<exact version> (source: <lockfile>)
Docs: <official URL or Context7 library ID> (fetched <date>)
Doc quote:
> <verbatim excerpt covering every API surface used below>
Code:
<snippet that matches the quote>
Version notes: <deprecations, breaking changes, upgrade advice — or "none">
Quality bar
- Version came from a lockfile, not a guess or a
^range - Doc passage quoted verbatim before code was written
- Code uses only the quoted, verified surface — zero from-memory APIs
- Library and version pinned in the output header
- Source is official (docs, changelog, repo) with fetch date recorded
- Docs-vs-lockfile disagreements surfaced with an upgrade path
Example
Ask: "Add streaming to our LangChain chat endpoint."
Run: lockfile shows langchain==0.3.14; 0.3 docs fetched; quoted the astream_events signature and event schema; wrote the endpoint against it; flagged the deprecated alternative and the migration notes.
Library: langchain==0.3.14 (source: uv.lock)
Docs: python.langchain.com/docs/how_to/streaming (fetched 2026-07-11)
Doc quote: > "astream_events(version='v2') yields event dicts with event, name, data"
Version notes: astream_log deprecated in 0.3; event payload keys renamed in 0.4
Credits
Inspired by Upstash Context7.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most docs writing skills give in 782 tokens
Counted across 1,951 of the 3,904 authors here whose files we hold, read 2026-09-06
- Use third-person for skill descriptionsin 54 of 1951, across 35 files
- Start descriptions with Use whenin 43 of 1951, across 29 files
- Run baseline scenarios before writing any skillin 40 of 1951, across 26 files
- Use active voicein 40 of 1951, across 36 files
- Map file responsibilities before defining tasksin 36 of 1951, across 29 files
- Use checkbox syntax for tracking stepsin 35 of 1951, across 27 files
- Ask one question at a timein 35 of 1951
- Offer execution options after saving the planin 33 of 1951, across 24 files
- Include complete code in every stepin 33 of 1951, across 27 files
- Design units with clear boundaries and interfacesin 31 of 1951, across 23 files
- Announce the skill usage at the startin 30 of 1951
- Verify agent compliance after adding the skillin 29 of 1951, across 17 files
Said here and by no other author read
- Identify fast-moving libraries in the task
- Resolve exact library versions from lockfiles
- Quote relevant documentation passages verbatim
- Pin library and version in output header
- Surface disagreements between lockfile and documentation
- Mark code as unverified if network is unavailable
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.