Agent skill

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.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/context7-usage-motoki317-dotfiles

SKILL.md

  <note>For React hooks documentation</note>
  topic="hooks"

  <note>For routing documentation</note>
  topic="routing"
</example>
  <note>For specific Next.js API</note>
  topic="getServerSideProps"

  <note>For specific TypeScript utility type</note>
  topic="Partial"
</example>
  <step>2. Use Context7 to get latest documentation</step>
  get-library-docs context7CompatibleLibraryID="/facebook/react" topic="useState"

  <step>3. Compare current usage with documented best practices</step>
</example>
  <step>2. Use Serena to find all usages of changed APIs</step>
  find_referencing_symbols name_path="getStaticProps"

  <step>3. Plan migration based on documentation</step>
</example>

<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>

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results