Context7 Version-Pinned Docs and Convention Lookup
Pins the exact library version you run, pulls matching docs via Context7 or local sources, and copies your codebase's own patterns.
Before & after
Same prompt, same agent — the only difference is the skill.
Hallucinated APIs are a common frustration. Here are some ways to reduce it: - Provide the actual documentation in your prompt - Share relevant code files so the model sees your real patterns - Be specific about library versions - Ask the model to only use APIs it can verify - Correct it when it invents something so it adjusts The core issue is that the model's training data may be outdated or it fills gaps with plausible-sounding but incorrect APIs. Grounding it in your actual code and current docs helps a lot. Which library or framework is it getting wrong?
That's the #1 large-project failure mode, and it's structural: the model
is limited to its training data + whatever fits the context window, so
on a big or recently-updated stack it fills gaps with plausible-looking
APIs. Context7 removes the gap instead of correcting it after the fact.
WHAT IT CHANGES
• Live documentation lookup — Claude retrieves the CURRENT docs for
your exact library version on demand, instead of recalling a
possibly-outdated version from training.
• Smart codebase search — it pulls the real patterns and conventions
already in your repo, so it matches your code rather than inventing
a generic shape.
THE MECHANISM THAT MATTERS
Retrieval on demand, not preload. It doesn't try to stuff your whole
codebase into context (which fails past a certain size). It fetches the
exact doc page or code pattern when the task needs it — so a 500K-line
project stops being "too big to reason about."
BEFORE / AFTER, CONCRETELY
Without: "use client.users.findByEmail()" — plausible, doesn't exist,
you find out at runtime.
With: it looks up your actual data layer first, sees
user.repository.findOne({ email }), and writes that.
WHY IT'S A GLOBAL-INSTALL RECOMMENDATION
Experts put it on every project because the failure it fixes —
convention drift and invented APIs — is universal on large codebases,
not specific to one stack. It's one of three commonly recommended
always-on skills for exactly that reason.
Once it's installed, the correction loop you're doing now mostly
disappears — the model retrieves the real API instead of guessing and
waiting to be corrected.
Which library is it hallucinating most? That's the first one to confirm
it's resolving correctly.About this skill
Claude writes @field_validator when your lockfile pins Pydantic 1.10. It calls a Next.js API that does not exist in your version. It imports axios directly when your team routes every request through a shared client. This skill makes Claude check what you actually have installed and how your code already solves the problem before it writes a line.
What it does
- Reads the resolved version from your lockfile, not the loose range in package.json or pyproject, and scopes every lookup to that version
- Uses the Context7 MCP server to resolve the right library ID and pull narrow, topic-scoped docs for that version
- Falls back to ground truth when Context7 is missing or off-version: installed type definitions, site-packages source,
go doc, and changelogs - Finds your project's nearest existing analog and its wrappers before writing new code, so output matches house patterns
- Resolves conflicts on a fixed rule: installed source wins for signatures, and your codebase wins for style. Deprecated usage gets flagged, never silently migrated
- Tags every non-trivial API claim with its evidence (lockfile, types file, docs topic, repo file:line, or unverified memory)
What you get
Code that runs on the versions you actually have installed and follows your existing patterns. It comes with a short version check and source list, so you can see what was verified and what was not.
Best for
Developers working with fast-moving libraries such as Next.js, Pydantic, LLM SDKs, Tailwind, Prisma, and Zod. Teams with internal wrappers and conventions. Anyone tired of fixing code written for the wrong major version.
SKILL.md preview
---
name: context7-version-pinned-docs-lookup
description: Verifies library APIs against the exact installed version. It reads lockfiles, queries the Context7 MCP docs server, and falls back to installed types and source. It also finds how the codebase already solves a problem, so new code matches existing wrappers and conventions. Use when the user says "use context7", "check the docs for the version we're on", "Claude keeps using APIs that don't exist", "that method was removed, why did you write it", "follow our existing pattern for this", "my code broke after you used the v2 syntax", or "how do we usually do X in this repo".
---
# Context7 Version-Pinned Docs and Convention Lookup
… (sign up to view the full skill)More development skills
View all Development skills →Performance Bottleneck Profiling: Node, Python, Go
Classifies a slowdown, gives exact profiler commands, reads the output, and proves the fix with same-conditions p95/p99 numbers.
Feature Scaffolding with Working Tests
Turn a short feature spec into code, runnable tests, and integration wiring that match your existing project.
Feature Flag Rollouts and Kill Switches
Design staged flag rollouts, verify rollback paths, and audit flag debt with explicit defaults, gates, and retirement plans.
Microcontroller Firmware and RTOS Engineering
Build and debug MCU firmware with bounded ISR/RTOS timing, safe DMA ownership, and measured power budgets.