Claude-skill-registry fetch-library-docs
Fetches official documentation for external libraries and frameworks (React, Next.js, Prisma, FastAPI, Express, Tailwind, MongoDB, etc.) with 60-90% token savings via content-type filtering. Use this skill when implementing features using library APIs, debugging library-specific errors, troubleshooting configuration issues, installing or setting up frameworks, integrating third-party packages, upgrading between library versions, or looking up correct API patterns and best practices. Triggers automatically during coding work - fetch docs before writing library code to get correct patterns, not after guessing wrong.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/fetch-library-docs" ~/.claude/skills/majiayu000-claude-skill-registry-fetch-library-docs-c9efd4 && rm -rf "$T"
skills/data/fetch-library-docs/SKILL.mdLibrary Documentation Skill
Fetches official library documentation with 60-90% token savings.
WHEN TO INVOKE (Auto-Detection)
INVOKE AUTOMATICALLY when:
| Context | Detection Signal | Content Type |
|---|---|---|
| Implementing | About to write code using library API | |
| Debugging | Error contains library name (e.g., ) | |
| Installing | Adding new package, , setup task | |
| Integrating | Connecting libraries ("use X with Y") | |
| Upgrading | Version migration, breaking changes | |
| Uncertain | First use of library feature, unsure of pattern | |
DO NOT INVOKE when:
- Already have sufficient knowledge from training
- User pasted docs or has them open
- Task is about local/private code (use codebase search)
- Comparing libraries (use web search)
DECISION LOGIC
1. Identify Library
Priority: User mention → Error message → File imports → package.json → Ask user
Examples:
→ library = "prisma"PrismaClientKnownRequestError
→ library = "react"import { useState } from 'react'
→ library = "fastapi"from fastapi import FastAPI
2. Identify Topic
Priority: User specifies → Error message → Feature being implemented → "getting started"
3. Select Content Type
| Task | Content Type |
|---|---|
| Implementing code | |
| Debugging error | |
| Installing/setup | |
| Integrating libs | |
| Upgrading version | |
| Understanding why | |
| Best practices | |
EXECUTION
# With known library ID (faster - saves 1 API call) bash scripts/fetch-docs.sh --library-id <id> --topic "<topic>" --content-type <types> # With library name (auto-resolves) bash scripts/fetch-docs.sh --library <name> --topic "<topic>" --content-type <types>
Quick Library IDs
| Library | ID |
|---|---|
| React | |
| Next.js | |
| Prisma | |
| Tailwind | |
| FastAPI | |
See references/library-ids.md for complete list.
ERROR HANDLING (Quick Reference)
| Error | Action |
|---|---|
| Try spelling variations |
| Use --library-id directly |
| Broaden topic or use |
| Check API key setup |
Call Budget: Context7 allows 3 calls/question. Use
--library-id to save 1 call.
See references/context7-tools.md for full error handling.
REFERENCES
- Library IDs - Complete library ID list
- Usage Patterns - Real-world examples
- Context7 Tools - API details, error codes, setup