| name | documentation-first |
| description | Enforces fetching current library documentation before writing any code. Triggers at session start or before any implementation work. Prevents building on stale LLM knowledge by requiring verification against current docs via Context7, official sites, or web search.
|
| triggers | ["session start","before implementation","**/*.ts","**/*.tsx","**/*.py","lib/**/*","app/**/*","src/**/*"] |
| model | opus |
Documentation-first workflow
Why this exists
LLM knowledge cutoffs cause real damage. Libraries change APIs between major versions. Model IDs get renamed and retired. Config file formats shift. Building on stale knowledge wastes hours or days of work.
The fix: read the current docs before writing any code. Every time.
The protocol
1. FETCH → Get current docs (Context7 / official sites / web search)
2. VERIFY → Compare what docs say vs what you "know" — note ALL differences
3. RECORD → Write verified versions and API signatures into session START.md
What to verify before writing code
For every library you will use in the current session:
Context7 usage
Context7 provides up-to-date library documentation. Use the resolve-library-id tool to find the right library, then get-library-docs to fetch content.
Common library IDs (verify these are current):
| Technology | Context7 Library ID | What changes most |
|---|
| Next.js | /llmstxt/nextjs_llms_txt | App Router API, middleware, config |
| React | /facebook/react | Hooks, Server Components, Suspense |
| AI SDK | /websites/ai-sdk_dev | streamText, generateText, tools |
| Drizzle ORM | /drizzle-team/drizzle-orm-docs | Schema API, migration CLI |
| Prisma | /prisma/prisma | Client API, migrations |
| FastAPI | /fastapi/fastapi | Dependencies, middleware |
| Django | /django/django | ORM, views, settings |
| Tailwind CSS | /tailwindlabs/tailwindcss.com | Config format, utilities |
| shadcn/ui | /shadcn-ui/ui | Component API, CLI |
Add your project's specific libraries to this table.
AI model verification
AI models change faster than any library. Never trust model IDs from memory.
| Provider | Where to verify | What changes |
|---|
| Anthropic | docs.anthropic.com/en/docs/about-claude/models | Model IDs, context windows, pricing |
| OpenAI | platform.openai.com/docs/models | Model IDs, deprecations |
| Google | ai.google.dev/gemini-api/docs/models | Model names, capabilities |
Verification record template
Every session START.md should include:
## Documentation verification record
| Technology | Version | Source | Date | Finding |
| ---------- | ------- | -------- | ---------- | ------------------- |
| Next.js | 16.x.x | Context7 | YYYY-MM-DD | No breaking changes |
| AI SDK | 6.x.x | Context7 | YYYY-MM-DD | New tool() API |
When docs conflict with your specs
- Library docs win for API signatures — your spec may target an older version
- Your architecture decisions win for patterns — you chose them for a reason
- If the conflict is significant, create an ADR documenting the change
- Update your spec to match current library reality
- Log in lessons-learned.md so future sessions don't repeat the mistake
Anti-patterns to avoid
- Trusting LLM memory for function signatures (it's often wrong)
- Skipping verification because "it worked last time" (APIs change between patches)
- Verifying once and assuming it's good forever (check every session)
- Using Context7 without checking the version number (old docs are still docs)