context7
npx machina-cli add skill ConaryLabs/Mira/context7 --openclawFiles (1)
SKILL.md
1.3 KB
Context7: External Library Documentation
Use Context7 to look up current library APIs instead of guessing from training data.
When to Use
- Implementing with external libraries - Check current API before writing code
- Debugging library errors - Verify correct usage patterns
- User asks "how do I use X" - Get up-to-date examples
- Uncertain about library API - Don't guess, look it up
- Library version matters - Context7 has version-specific docs
Workflow
resolve-library-id(libraryName="tokio", query="async runtime spawn tasks")
query-docs(libraryId="/tokio-rs/tokio", query="how to spawn async tasks")
Always call resolve-library-id first to get the correct library ID, then query-docs with a specific question.
When NOT to Use
- Standard library features (Rust std, Python builtins, etc.)
- Confident in the API from recent experience
- Simple operations with well-known patterns
Example
User asks about async file reading with tokio:
resolve-library-id(libraryName="tokio", query="async file reading")query-docs(libraryId="/tokio-rs/tokio", query="async file reading tokio::fs")- Use the returned docs to write correct code
Source
git clone https://github.com/ConaryLabs/Mira/blob/main/.claude/skills/context7/SKILL.mdView on GitHub Overview
Context7 lets you fetch up-to-date external library documentation rather than guessing from training data. It helps ensure you use the correct API references and considers version-specific docs for accurate implementation.
How This Skill Works
Use resolve-library-id to identify the exact library you want, then query-docs with that ID to fetch current API references and usage examples. This avoids relying on outdated training data and keeps code aligned with the library's current surface.
When to Use It
- Implementing with external libraries – Check current API before writing code
- Debugging library errors – Verify correct usage patterns
- User asks 'how do I use X' – Get up-to-date examples
- Uncertain about library API – Don't guess, look it up
- Library version matters – Context7 has version-specific docs
Quick Start
- Step 1: resolve-library-id(libraryName="tokio", query="async file reading")
- Step 2: query-docs(libraryId="/tokio-rs/tokio", query="async file reading tokio::fs")
- Step 3: Use the returned docs to write correct code
Best Practices
- Always call resolve-library-id first to get the correct library ID
- Query with a precise question to target the right API surface
- Cross-check results against the latest official docs
- Test edge cases using the exact API usage shown in docs
- Respect library version constraints and changelogs
Example Use Cases
- User asks about async file reading with tokio
- Debugging tokio spawn tasks usage in a project
- Looking up how to use tokio::fs for async I/O
- Clarifying version-specific API changes for a library
- Verifying API usage patterns when integrating a new crate
Frequently Asked Questions
Add this skill to your agents