home / skills / julianobarbosa / claude-code-skills / looking-up-docs-skill

looking-up-docs-skill skill

/skills/looking-up-docs-skill

This skill helps you quickly fetch up-to-date library documentation and code examples with exact version context using Context7.

npx playbooks add skill julianobarbosa/claude-code-skills --skill looking-up-docs-skill

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.9 KB
---
name: looking-up-docs
description: Look up library documentation using Context7. Use when needing API reference, library docs, framework documentation, or technical documentation lookup. Provides up-to-date, version-specific docs and code examples.
allowed-tools: Read, Grep, Glob, mcp__context7__resolve-library-id, mcp__context7__get-library-docs
---

# Documentation Lookup with Context7

Context7 provides up-to-date, version-specific documentation and code examples directly from source libraries.

## Why Context7

- **Current APIs**: No hallucinated or outdated patterns
- **Version-specific**: Gets docs for exact library versions
- **Code examples**: Real, working code from actual documentation

## Workflow

1. **Resolve library ID**: `mcp__context7__resolve-library-id` with `libraryName`
2. **Get documentation**: `mcp__context7__get-library-docs` with `context7CompatibleLibraryID` and `topic`

## Modes

| Mode   | Use For                                    |
| ------ | ------------------------------------------ |
| `code` | API references, code examples (default)    |
| `info` | Conceptual guides, architecture, tutorials |

## Examples

```
# React hooks
resolve-library-id: "react"
get-library-docs: context7CompatibleLibraryID="/facebook/react", topic="hooks", mode="code"

# Next.js middleware
resolve-library-id: "next.js"
get-library-docs: context7CompatibleLibraryID="/vercel/next.js", topic="middleware"

# Go net/http
resolve-library-id: "go net/http"
get-library-docs: context7CompatibleLibraryID="/golang/go", topic="http server"

# Kubernetes API
resolve-library-id: "kubernetes"
get-library-docs: context7CompatibleLibraryID="/kubernetes/kubernetes", topic="deployment"
```

## Tips

- Use `topic` parameter to narrow results to specific features
- Try `mode="info"` for architectural questions
- Paginate with `page=2`, `page=3` if initial results insufficient

Overview

This skill looks up library documentation using Context7 to deliver version-specific API references and real code examples. It returns up-to-date docs, precise topics, and can switch between code-focused and conceptual modes. Use it when you need authoritative, current documentation rather than second-hand summaries.

How this skill works

First it resolves a library identifier from a casual name to a Context7-compatible library ID. Then it requests documentation for a given topic and mode (code or info) and returns the relevant pages, examples, and version metadata. You can paginate results and narrow queries with the topic parameter for focused results.

When to use it

  • Fetching precise API reference or method signatures for a specific library version
  • Finding official code examples from library documentation to copy or adapt
  • Looking up framework or runtime configuration options and defaults
  • Researching architecture or conceptual guides using the info mode
  • Verifying current behavior after library upgrades or before implementing features

Best practices

  • Provide a clear topic string to narrow results (e.g., 'hooks', 'middleware', 'http server')
  • Resolve the library ID first to ensure correct repository and version mapping
  • Use mode='code' for API examples and mode='info' for conceptual explanations
  • Paginate if the initial result set is large or if you need more examples
  • Include the library version in follow-up checks when validating breaking changes

Example use cases

  • Resolve 'react' and fetch 'hooks' examples to implement a custom hook using documented patterns
  • Resolve 'next.js' and fetch 'middleware' to copy recommended server-side middleware setup
  • Resolve 'go net/http' and fetch 'http server' for canonical request handling snippets
  • Resolve 'kubernetes' and fetch 'deployment' to confirm API fields and example manifests
  • Switch to mode='info' to read architectural guides when evaluating a library for adoption

FAQ

Can I get docs for a specific library version?

Yes — the skill returns version-specific documentation when available; resolving the correct library ID helps map to the right version.

What’s the difference between mode='code' and mode='info'?

Use mode='code' for API references and concrete examples, and mode='info' for conceptual guides, architecture explanations, and tutorials.