agentleFS
iadr-deviadr-dev/colab/skills/context7-aware-coding/SKILL.md

context7-aware-coding

Skill2 starsChanged 7 months agoMITView on GitHub

Enforces use of Context7 MCP for all external library documentation. Prevents API hallucination by requiring real-time doc fetching before any external library call. Auto-triggered when external library usage is detected in code context.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never use training data for external library API signatures.

    line 12
  2. Distinctive:

    Before writing any code that calls an external library:

    line 16
  3. Distinctive:

    Use the fetched signature — not your memory

    line 22
  4. Distinctive:

    Use normal Context7 queries first.

    line 54
  5. Distinctive:

    Check the library's official GitHub — read source if docs are missing

    line 67
  6. Distinctive:

    Never silently guess. Always flag when docs were unavailable.

    line 70
  7. Distinctive:

    After executor/verifier confirms the research produced working code:

    line 75

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Context7-Aware Coding

Never use training data for external library API signatures. Always fetch current docs.

The Rule

Before writing any code that calls an external library:

  1. Identify the library and the specific API needed
  2. Check .ohc/research/ cache first — research.lookup(library, topic). Fresh hit → use cached body, do not re-fetch.
  3. On miss or stale hit: fetch current docs via Context7
  4. After fetch: research.save({library, topic, source:'context7', version, payload})
  5. Use the fetched signature — not your memory

This prevents: hallucinated method names, deprecated APIs, wrong parameter order, missing required fields, version incompatibilities.

The cache is cross-session (survives /clear and new sessions) and indexed into session start via the <ohc_research_index> reminder, so the agent knows upfront what's already been researched.

How to Use Context7

Prefix trigger

use context7 — how do I use prisma findMany with cursor-based pagination?
use context7 nextjs — what is the correct way to use server actions in Next.js 15?

By library ID

context7 /vercel/next.js — app router metadata API
context7 /prisma/prisma — transaction API
context7 /tailwindlabs/tailwindcss.com — responsive variants

See references/ folder for library IDs organized by category:

  • references/frontend-library-ids.md - React, Vue, Next.js, Tailwind CSS
  • references/backend-fullstack-library-ids.md - Express, Prisma, tRPC, auth
  • references/mobile-library-ids.md - React Native, Flutter, Android, iOS
  • references/python-library-ids.md - FastAPI, Flask, Django, data science
  • references/ai-llm-library-ids.md - Vercel AI SDK, LangChain, OpenAI

Research mode

Use normal Context7 queries first. If the answer is shallow, outdated, or missing the exact API surface needed, retry the same query with research mode enabled.

Research mode requires a Context7 API key. If unavailable, say so explicitly and use the normal docs response plus official docs/source as the fallback.

When Context7 Returns Nothing (or isn't configured)

  1. Try broader query (less specific version requirement)
  2. Retry with research mode if a Context7 API key is configured
  3. Fall back to the researcher agent with Brave Search MCP
  4. If no docs MCP is configured at all: use your own built-in web search / WebFetch to read the library's official documentation site directly.
  5. Check the library's official GitHub — read source if docs are missing
  6. Flag explicitly: "Could not find current docs for X. Based on v{N} docs: ..."

Never silently guess. Always flag when docs were unavailable. The order is a degradation ladder: Context7 → Brave → built-in web search → GitHub source → flag.

Cache audit (verified-working)

After executor/verifier confirms the research produced working code:

ohc research verify <library> <topic> <commit-sha>

This stamps verified_working: true + the commit SHA onto the cached entry so the reviewer can audit which design decisions rest on which fetched docs, and so subsequent sessions can trust that entry more strongly.

MCP Install (if not already configured)

# Without key (60 req/hr free tier)
claude mcp add context7 -- npx -y @upstash/context7-mcp

# With free API key (higher limits — get at context7.com/dashboard)
claude mcp add context7 -- npx -y @upstash/context7-mcp --api-key YOUR_KEY

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.