Research Docs
Overview
Your training data is outdated. Current documentation is always more accurate.
When designing features, planning implementation, writing code, or debugging issues involving libraries/frameworks/tools, you MUST fetch current documentation using Context7 before proceeding.
Core Principle
LLM training data becomes stale the moment training ends. Libraries evolve:
- APIs change between versions
- Best practices get updated
- New features get added
- Old patterns get deprecated
Never design or implement from memory. Always verify with current docs.
Mandatory Workflow
Step 1: Recognize the Trigger
You MUST use documentation search when you encounter ANY of these:
- Library name mentioned (react-query, fastapi, pydantic, express, etc.)
- Framework name mentioned (Next.js, Django, React, Vue, etc.)
- Version number specified (react-query v5, Python 3.12, etc.)
- Technical concept tied to specific tool (optimistic updates in react-query)
- Implementation questions (how do I X in Y?)
- Best practices questions (what's the right way to X?)
- Debugging library-specific behavior
- Evaluating technology choices for a design
- Designing a system that uses external libraries
- Any delta phase (design, plan, implement) involving libraries
Red flags that mean you're about to fail:
- "Based on my knowledge of..."
- "From what I remember about..."
- "The typical pattern for..."
- Writing code without checking docs first
- Designing around a library without checking current docs
- Assuming library capabilities from training data during design
- Having uncertainty about the correct approach
Step 2: Dispatch Documentation Search Subagent
Why subagent instead of direct Context7:
- Saves 10,000-20,000 tokens of context in main agent
- Subagent filters docs to only what you need
- Main agent stays focused on the task
- Better token management across the session
How to dispatch:
Dispatch the katachi:doc-researcher agent with the following information:
- Library name: Exact package/library name (e.g., "react-query", "fastapi", "pydantic")
- Topic: Specific concept or feature (e.g., "optimistic updates", "path parameters", "field validators")
- What you need: Specific APIs, patterns, or examples you're looking for
The agent will search Context7 documentation and provide a focused synthesis with:
- Exact API signatures
- Recommended patterns and best practices
- Code examples
- Version-specific guidance
Step 3: Act on Verified Patterns
After receiving subagent synthesis:
- Cite what you learned: "According to react-query v5 docs (from doc-researcher)..."
- Use exact API signatures provided
- Follow recommended patterns from synthesis
- Note any differences from what you expected
- If gaps exist, dispatch another search or use WebSearch
During design phases:
- Base design decisions on current library capabilities
- Document technology choices with sources from synthesis
- Don't propose deprecated patterns as design options
- Verify feasibility of design approach with current API
During implementation:
- Use exact API signatures from synthesis
- Follow current best practices, not training data patterns
- Reference documentation source in code comments when the choice would be unclear
Never:
- Mix training data patterns with doc patterns
- Assume API names/signatures
- Skip documentation check "to save time"
- Design or implement first, verify later
- Use Context7 MCP tools directly (always dispatch
katachi:doc-researcher agent)
Red Flags - STOP
If you're thinking ANY of these, you're about to violate the skill:
Context Rationalization Flags
- "I'm only using X% of budget" - Percentage hides absolute waste
- "Well within acceptable limits" - Ignores session-wide compounding
- "I have plenty of budget left" - Context is for ENTIRE session
- "This is just one search" - "Just one" becomes "just one more"
Efficiency Framing Flags
- "Direct access is more efficient" - You're optimizing for wrong metric
- "Subagent dispatch is overhead" - It's an investment, not overhead
- "Completed in fewer messages" - Messages don't matter, tokens do
- "For straightforward lookups, direct is optimal" - Context math doesn't change
Quality Justification Flags
- "I got comprehensive examples" - You don't need comprehensive, you need relevant
- "I can filter the docs myself" - Filtering doesn't remove docs from context
- "I need detailed information" - Subagent provides exactly what you need
The context math:
- Direct Context7: 15,000-25,000 tokens per search
- Subagent: 2,000-5,000 tokens per search
- Difference: 10,000-20,000 tokens SAVED per search
- 3 searches: 48,000 tokens saved
- That's 48,000 tokens for MORE searches, longer conversations, complex implementations
Never use "I have budget left" to justify waste.
When NOT to Use Documentation Search
Skip documentation search for:
- Trivial language built-ins (Python
dict.get, JavaScript Array.map, string methods)
- Pure algorithms (sorting, searching, graph traversal)
- Questions about YOUR codebase (use Read/Grep)
But DO use documentation search for:
- Third-party libraries, even familiar ones
- Framework-specific patterns
- Version-specific APIs
- Best practices for tools
- Complex standard library modules (subprocess, streams, pathlib, logging)
- During design phases, when evaluating library fitness
- When comparing approaches that involve external libraries
- Even if the library was used recently in this session
When in doubt: dispatch a subagent. The cost of a subagent search (2,000-5,000 tokens) is trivially small. The cost of designing or implementing against stale docs is enormous.
Context Management Strategy
Why subagents are mandatory:
Context savings per search:
- Direct Context7: 15,000-25,000 tokens per search
- Subagent approach: 2,000-5,000 tokens per search
- Savings: 10,000-20,000 tokens per search
Across a session:
- 3 direct searches: ~60,000 tokens
- 3 subagent searches: ~12,000 tokens
- Savings: ~48,000 tokens
That's 48,000 tokens available for:
- More codebase files
- Longer conversations
- Additional library searches
- Complex implementations
Verification Checklist
Before claiming you've designed or implemented something correctly, verify:
If you have ANY uncertainty after receiving synthesis:
- Dispatch another
katachi:doc-researcher agent with refined topic
- Use WebSearch for supplementary info
- Ask human for clarification
Never:
- Use Context7 MCP tools directly
- Ship uncertain design or implementation
- Skip documentation search to "save time"
Common Mistakes
Mistake 1: "I remember this API"
❌ "I know react-query uses useQuery, let me write this..."
✅ "Let me dispatch katachi:doc-researcher to verify the current useQuery API..."
Why it fails: APIs change. Your memory is from training cutoff.
Mistake 2: "Subagent overhead isn't worth it"
❌ "This is just one search, I'll use Context7 directly..."
✅ "Even one search saves 15,000 tokens. Always dispatch katachi:doc-researcher."
Why it fails: "Just one" becomes "just one more" throughout the session. Context compounds.
Mistake 3: "I'll verify after writing"
❌ [Writes full implementation] "Let me check if this is right..."
✅ [Dispatches katachi:doc-researcher first] "Now I'll implement using verified patterns..."
Why it fails: Fixing wrong code takes longer than writing correct code once.
Mistake 4: "This is just a design, I'll check docs during implementation"
❌ [Designs feature assuming library behavior] "I'll verify the APIs when I implement..."
✅ [Dispatches katachi:doc-researcher during design] "Let me verify this is feasible with current APIs..."
Why it fails: Wrong design foundations compound through the entire feature lifecycle. A design based on deprecated APIs wastes the spec, design, plan, AND implementation phases.
Summary
Before designing or implementing ANYTHING involving a library/framework:
- Recognize trigger (library name → stop)
- Dispatch
katachi:doc-researcher agent
- Provide clear library name, topic, and what you need
- Receive synthesis with API signatures and patterns
- Act using verified patterns from synthesis
- Cite documentation source
Critical rules:
- NEVER use Context7 MCP tools directly
- ALWAYS dispatch
katachi:doc-researcher agent for documentation
- Context savings: 10,000-20,000 tokens per search
- Your training data is always outdated
- Current documentation is always more accurate
- Dispatch agent first, design or write code second
This is not optional. This is mandatory.
1---2name: research-docs3description: Use BEFORE designing, implementing, planning, or configuring ANY feature involving libraries, frameworks, or complex APIs - even before reading existing code. Fetches current documentation to ensure correct usage. Triggers on third-party libraries (such as react-query, FastAPI, Django, pytest), complex standard library modules (such as subprocess, streams, pathlib, logging), and "how to" questions about library usage. Do NOT use for trivial built-ins (such as dict.get, Array.map) or pure algorithms. Load this skill first to receive guidance on finding current documentation when working on deltas, patches, or answering library-related questions.4---56# Research Docs78## Overview910**Your training data is outdated. Current documentation is always more accurate.**1112When designing features, planning implementation, writing code, or debugging issues involving libraries/frameworks/tools, you MUST fetch current documentation using Context7 before proceeding.1314## Core Principle1516LLM training data becomes stale the moment training ends. Libraries evolve:17- APIs change between versions18- Best practices get updated19- New features get added20- Old patterns get deprecated2122**Never design or implement from memory. Always verify with current docs.**2324## Mandatory Workflow2526### Step 1: Recognize the Trigger2728You MUST use documentation search when you encounter ANY of these:2930- Library name mentioned (react-query, fastapi, pydantic, express, etc.)31- Framework name mentioned (Next.js, Django, React, Vue, etc.)32- Version number specified (react-query v5, Python 3.12, etc.)33- Technical concept tied to specific tool (optimistic updates in react-query)34- Implementation questions (how do I X in Y?)35- Best practices questions (what's the right way to X?)36- Debugging library-specific behavior37- Evaluating technology choices for a design38- Designing a system that uses external libraries39- Any delta phase (design, plan, implement) involving libraries4041**Red flags that mean you're about to fail:**42- "Based on my knowledge of..."43- "From what I remember about..."44- "The typical pattern for..."45- Writing code without checking docs first46- Designing around a library without checking current docs47- Assuming library capabilities from training data during design48- Having uncertainty about the correct approach4950### Step 2: Dispatch Documentation Search Subagent5152**Why subagent instead of direct Context7:**53- Saves 10,000-20,000 tokens of context in main agent54- Subagent filters docs to only what you need55- Main agent stays focused on the task56- Better token management across the session5758**How to dispatch:**5960Dispatch the `katachi:doc-researcher` agent with the following information:6162- **Library name**: Exact package/library name (e.g., "react-query", "fastapi", "pydantic")63- **Topic**: Specific concept or feature (e.g., "optimistic updates", "path parameters", "field validators")64- **What you need**: Specific APIs, patterns, or examples you're looking for6566The agent will search Context7 documentation and provide a focused synthesis with:67- Exact API signatures68- Recommended patterns and best practices69- Code examples70- Version-specific guidance7172### Step 3: Act on Verified Patterns7374**After receiving subagent synthesis:**75761. Cite what you learned: "According to react-query v5 docs (from doc-researcher)..."772. Use exact API signatures provided783. Follow recommended patterns from synthesis794. Note any differences from what you expected805. If gaps exist, dispatch another search or use WebSearch8182**During design phases:**83- Base design decisions on current library capabilities84- Document technology choices with sources from synthesis85- Don't propose deprecated patterns as design options86- Verify feasibility of design approach with current API8788**During implementation:**89- Use exact API signatures from synthesis90- Follow current best practices, not training data patterns91- Reference documentation source in code comments when the choice would be unclear9293**Never:**94- Mix training data patterns with doc patterns95- Assume API names/signatures96- Skip documentation check "to save time"97- Design or implement first, verify later98- Use Context7 MCP tools directly (always dispatch `katachi:doc-researcher` agent)99100## Red Flags - STOP101102If you're thinking ANY of these, you're about to violate the skill:103104### Context Rationalization Flags105- "I'm only using X% of budget" - Percentage hides absolute waste106- "Well within acceptable limits" - Ignores session-wide compounding107- "I have plenty of budget left" - Context is for ENTIRE session108- "This is just one search" - "Just one" becomes "just one more"109110### Efficiency Framing Flags111- "Direct access is more efficient" - You're optimizing for wrong metric112- "Subagent dispatch is overhead" - It's an investment, not overhead113- "Completed in fewer messages" - Messages don't matter, tokens do114- "For straightforward lookups, direct is optimal" - Context math doesn't change115116### Quality Justification Flags117- "I got comprehensive examples" - You don't need comprehensive, you need relevant118- "I can filter the docs myself" - Filtering doesn't remove docs from context119- "I need detailed information" - Subagent provides exactly what you need120121**The context math:**122- Direct Context7: 15,000-25,000 tokens per search123- Subagent: 2,000-5,000 tokens per search124- Difference: 10,000-20,000 tokens SAVED per search125- 3 searches: 48,000 tokens saved126- That's 48,000 tokens for MORE searches, longer conversations, complex implementations127128**Never use "I have budget left" to justify waste.**129130## When NOT to Use Documentation Search131132**Skip documentation search for:**133- Trivial language built-ins (Python `dict.get`, JavaScript `Array.map`, string methods)134- Pure algorithms (sorting, searching, graph traversal)135- Questions about YOUR codebase (use Read/Grep)136137**But DO use documentation search for:**138- Third-party libraries, even familiar ones139- Framework-specific patterns140- Version-specific APIs141- Best practices for tools142- Complex standard library modules (subprocess, streams, pathlib, logging)143- During design phases, when evaluating library fitness144- When comparing approaches that involve external libraries145- Even if the library was used recently in this session146147**When in doubt: dispatch a subagent.** The cost of a subagent search (2,000-5,000 tokens) is trivially small. The cost of designing or implementing against stale docs is enormous.148149## Context Management Strategy150151**Why subagents are mandatory:**152153**Context savings per search:**154- Direct Context7: 15,000-25,000 tokens per search155- Subagent approach: 2,000-5,000 tokens per search156- Savings: 10,000-20,000 tokens per search157158**Across a session:**159- 3 direct searches: ~60,000 tokens160- 3 subagent searches: ~12,000 tokens161- Savings: ~48,000 tokens162163**That's 48,000 tokens available for:**164- More codebase files165- Longer conversations166- Additional library searches167- Complex implementations168169## Verification Checklist170171Before claiming you've designed or implemented something correctly, verify:172173- [ ] Dispatched `katachi:doc-researcher` agent to fetch current documentation174- [ ] Provided clear library name, topic, and what you need175- [ ] Received synthesis with API signatures176- [ ] API signatures match documentation exactly177- [ ] Patterns follow current best practices from synthesis178- [ ] No uncertainties remain about correct approach179- [ ] Can cite documentation source for key decisions180- [ ] Did NOT use Context7 MCP tools directly181182**If you have ANY uncertainty after receiving synthesis:**183- Dispatch another `katachi:doc-researcher` agent with refined topic184- Use WebSearch for supplementary info185- Ask human for clarification186187**Never:**188- Use Context7 MCP tools directly189- Ship uncertain design or implementation190- Skip documentation search to "save time"191192## Common Mistakes193194### Mistake 1: "I remember this API"195196```197❌ "I know react-query uses useQuery, let me write this..."198✅ "Let me dispatch katachi:doc-researcher to verify the current useQuery API..."199```200201**Why it fails:** APIs change. Your memory is from training cutoff.202203### Mistake 2: "Subagent overhead isn't worth it"204205```206❌ "This is just one search, I'll use Context7 directly..."207✅ "Even one search saves 15,000 tokens. Always dispatch katachi:doc-researcher."208```209210**Why it fails:** "Just one" becomes "just one more" throughout the session. Context compounds.211212### Mistake 3: "I'll verify after writing"213214```215❌ [Writes full implementation] "Let me check if this is right..."216✅ [Dispatches katachi:doc-researcher first] "Now I'll implement using verified patterns..."217```218219**Why it fails:** Fixing wrong code takes longer than writing correct code once.220221### Mistake 4: "This is just a design, I'll check docs during implementation"222223```224❌ [Designs feature assuming library behavior] "I'll verify the APIs when I implement..."225✅ [Dispatches katachi:doc-researcher during design] "Let me verify this is feasible with current APIs..."226```227228**Why it fails:** Wrong design foundations compound through the entire feature lifecycle. A design based on deprecated APIs wastes the spec, design, plan, AND implementation phases.229230## Summary231232**Before designing or implementing ANYTHING involving a library/framework:**2332341. Recognize trigger (library name → stop)2352. Dispatch `katachi:doc-researcher` agent2363. Provide clear library name, topic, and what you need2374. Receive synthesis with API signatures and patterns2385. Act using verified patterns from synthesis2396. Cite documentation source240241**Critical rules:**242- **NEVER use Context7 MCP tools directly**243- **ALWAYS dispatch `katachi:doc-researcher` agent for documentation**244- **Context savings: 10,000-20,000 tokens per search**245- **Your training data is always outdated**246- **Current documentation is always more accurate**247- **Dispatch agent first, design or write code second**248249**This is not optional. This is mandatory.**