skills/asmayaseen/fetching-library-docs/SKILL.md
Token-efficient library API documentation fetcher using Context7 MCP with 77% token savings. Fetches code examples, API references, and usage patterns for published libraries (React, Next.js, Prisma, etc). Use when users ask "how do I use X library", need code examples, want API syntax, or are learning a framework's official API. Triggers: "Show me React hooks", "Prisma query syntax", "Next.js routing API". NOT for exploring repo internals/source code (use researching-with-deepwiki) or local files.
npx skillsauth add aiskillstore/marketplace fetching-library-docsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fetch library documentation with automatic 77% token reduction via shell pipeline.
Always use the token-efficient shell pipeline:
# Automatic library resolution + filtering
bash scripts/fetch-docs.sh --library <library-name> --topic <topic>
# Examples:
bash scripts/fetch-docs.sh --library react --topic useState
bash scripts/fetch-docs.sh --library nextjs --topic routing
bash scripts/fetch-docs.sh --library prisma --topic queries
Result: Returns ~205 tokens instead of ~934 tokens (77% savings).
For any documentation request, follow this workflow:
Extract from user query:
bash scripts/fetch-docs.sh --library <library> --topic <topic> --verbose
The --verbose flag shows token savings statistics.
The script automatically:
bash scripts/fetch-docs.sh [OPTIONS]
Required (pick one):
--library <name> - Library name (e.g., "react", "nextjs")--library-id <id> - Direct Context7 ID (faster, skips resolution)Optional:
--topic <topic> - Specific feature to focus on--mode <code|info> - code for examples (default), info for concepts--page <1-10> - Pagination for more results--verbose - Show token savings statisticsCode Mode (default): Returns code examples + API signatures
--mode code
Info Mode: Returns conceptual explanations + fewer examples
--mode info
Use --library-id for faster lookup (skips resolution):
React: /reactjs/react.dev
Next.js: /vercel/next.js
Express: /expressjs/express
Prisma: /prisma/docs
MongoDB: /mongodb/docs
Fastify: /fastify/fastify
NestJS: /nestjs/docs
Vue.js: /vuejs/docs
Svelte: /sveltejs/site
User asks: "Show me React useState examples"
bash scripts/fetch-docs.sh --library react --topic useState --verbose
Returns: 5 code examples + API signatures + notes (~205 tokens)
User asks: "How do I get started with Prisma?"
# Step 1: Get overview
bash scripts/fetch-docs.sh --library prisma --topic "getting started" --mode info
# Step 2: Get code examples
bash scripts/fetch-docs.sh --library prisma --topic queries --mode code
User asks: "How does Next.js routing work?"
bash scripts/fetch-docs.sh --library-id /vercel/next.js --topic routing
Using --library-id is faster when you know the exact ID.
User needs comprehensive information:
# Page 1: Basic examples
bash scripts/fetch-docs.sh --library react --topic hooks --page 1
# Page 2: Advanced patterns
bash scripts/fetch-docs.sh --library react --topic hooks --page 2
How it works:
fetch-docs.sh calls fetch-raw.sh (which uses mcp-client.py)Savings:
Do NOT use mcp-client.py directly - it bypasses filtering and wastes tokens.
If library name fails, try variations:
# Try different formats
--library "next.js" # with dot
--library "nextjs" # without dot
--library "next" # short form
# Or search manually
bash scripts/fetch-docs.sh --library "your-library" --verbose
# Check output for suggested library IDs
Run: python3 scripts/verify.py
Expected: ✓ fetch-docs.sh ready
ls -la scripts/fetch-docs.shchmod +x scripts/fetch-docs.sh| Issue | Solution |
|-------|----------|
| Library not found | Try name variations or use broader search term |
| No results | Use --mode info or broader topic |
| Need more examples | Increase page: --page 2 |
| Want full context | Use --mode info for explanations |
| Permission denied | Run: chmod +x scripts/*.sh |
For detailed Context7 MCP tool documentation, see:
Components (for reference only, use fetch-docs.sh):
mcp-client.py - Universal MCP client (foundation)fetch-raw.sh - MCP wrapperextract-code-blocks.sh - Code example filter (awk)extract-signatures.sh - API signature filter (awk)extract-notes.sh - Important notes filter (grep)fetch-docs.sh - Main orchestrator (ALWAYS USE THIS)Architecture: Shell pipeline processes documentation in subprocess, keeping full response out of Claude's context. Only filtered essentials enter the LLM context, achieving 77% token savings with 100% functionality preserved.
Based on Anthropic's "Code Execution with MCP" blog post.
development
Apple Human Interface Guidelines for content display components. Use this skill when the user asks about charts component, collection view, image view, web view, color well, image well, activity view, lockup, data visualization, content display, displaying images, rendering web content, color pickers, or presenting collections of items in Apple apps. Also use when the user says how should I display charts, what's the best way to show images, should I use a web view, how do I build a grid of items, what component shows media, or how do I present a share sheet. Cross-references: hig-foundations for color/typography/accessibility, hig-patterns for data visualization patterns, hig-components-layout for structural containers, hig-platforms for platform-specific component behavior.
tools
Automate HelpDesk tasks via Rube MCP (Composio): list tickets, manage views, use canned responses, and configure custom fields. Always search tools first for current schemas.
testing
Expert Haskell engineer specializing in advanced type systems, pure functional design, and high-reliability software. Use PROACTIVELY for type-level programming, concurrency, and architecture guidance.
tools
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.