Context7 Usage
This skill should be used when the user asks to "check documentation", "latest API", "library docs", "context7", or needs up-to-date library documentation. Provides Context7 MCP usage patterns.
$ インストール
git clone https://github.com/takeokunn/nixos-configuration /tmp/nixos-configuration && cp -r /tmp/nixos-configuration/home-manager/programs/claude-code/skills/context7-usage ~/.claude/skills/nixos-configuration// tip: Run this command in your terminal to install the skill
name: Context7 Usage description: This skill should be used when the user asks to "check documentation", "latest API", "library docs", "context7", or needs up-to-date library documentation. Provides Context7 MCP usage patterns.
For React hooks documentation
topic="hooks"
For routing documentation
topic="routing"
For specific Next.js API
topic="getServerSideProps"
For specific TypeScript utility type
topic="Partial"
2. Use Context7 to get latest documentation
get-library-docs context7CompatibleLibraryID="/facebook/react" topic="useState"
3. Compare current usage with documented best practices
2. Use Serena to find all usages of changed APIs
find_referencing_symbols name_path="getStaticProps"
3. Plan migration based on documentation
<decision_tree name="tool_selection"> What type of operation is needed? Use resolve-library-id to find library Use get-library-docs directly Use get-library-docs with topic parameter Use get-library-docs without topic Use get-library-docs with 2000-3000 tokens Use get-library-docs with 8000-10000 tokens </decision_tree>
<anti_patterns> Calling get-library-docs without resolving library ID first Always call resolve-library-id to get the correct Context7-compatible library ID Requesting maximum tokens for simple queries Use specific topics and appropriate token limits (2000-3000 for quick lookups, 5000 for standard queries) Using libraries with low trust scores or snippet counts Prefer libraries with trust scores 7-10 and higher snippet counts for better documentation quality Using incorrect or outdated library names (e.g., "react-query" vs "tanstack/query") Try alternative names or broader search terms if library not found </anti_patterns>
<best_practices> Always resolve library ID before fetching documentation Prefer libraries with trust scores 7-10 for better documentation quality Use specific topics to reduce token usage and increase relevance Check snippet count as indicator of documentation completeness Use versioned IDs when available for specific version documentation </best_practices>
<error_escalation> Library not found with exact name Note in report, try alternative names, proceed Documentation not available for topic Document issue, use AskUserQuestion for clarification Context7 service unavailable STOP, present options to user Conflicting documentation versions BLOCK operation, require explicit user acknowledgment </error_escalation>
<related_agents> Uses Context7 for architecture documentation and API design Uses Context7 to verify latest library patterns before implementation Uses Context7 to check for known issues and migration guides Uses Context7 to answer library-specific questions </related_agents>
<related_skills> Combines with Context7 for codebase verification workflows Uses Context7 for documentation research Uses Context7 for NixOS and Home Manager documentation Uses Context7 for TypeScript and framework documentation Uses Context7 for Go library documentation Uses Context7 for Rust crate documentation </related_skills>
Repository
