| name | context7-retrieval-patterns |
| description | Retrieve up-to-date library documentation with Context7 MCP and ground code changes. Use when tasks involve external APIs, version-sensitive behavior, migrations, deprecations, setup/configuration decisions, or framework/library best-practice questions. |
Skill: Context7 Retrieval Patterns
Use this skill when implementation quality depends on current external library/framework documentation.
Goals
- Reduce outdated API usage and hallucinated methods.
- Ground implementation guidance in current, version-aware docs.
- Keep retrieval output concise and directly actionable for code edits.
Trigger Signals
Use when task text contains signals such as:
- "latest docs", "up-to-date", "current API", "breaking change", "migration"
- unknown framework symbols or version-specific behavior
- generated code depends on third-party libraries not fully covered by local repository context
- documentation updates that must reflect latest language/framework guidelines (CSS, HTML, JavaScript, Python, SQL)
Retrieval Workflow
- Resolve library identity first (
resolve-library-id) for each external dependency.
- Query docs second (
query-docs) for exact symbols/topics needed by the task.
- Prefer concise excerpts with examples over large generic dumps.
- Capture version/freshness indicators where available.
- Convert findings into implementation constraints and concrete code guidance.
Tooling Contract
- Always call
resolve-library-id before query-docs unless a valid Context7 library ID is already provided.
- Keep retrieval bounded: ask only task-scoped questions and avoid broad "everything about X" pulls.
- If retrieval quality remains low after focused attempts, report uncertainty and switch to safest conservative guidance.
Quality Rules
- Keep retrieval scoped to task-relevant symbols or features.
- Prefer authoritative library docs over secondary summaries.
- If results conflict, report uncertainty and propose safest default.
- Do not include secrets in queries, outputs, or logs.
Output Contract
Return a compact packet that includes:
- Library/topic resolved
- Key API facts and constraints
- Freshness/version cues (if available)
- Recommended implementation direction for this repository
- Confidence and any unresolved ambiguities
- Evidence: library IDs queried and topics asked
Subagent Handback Packet
When this skill is used inside a delegated subagent task, return this compact packet to the parent orchestrator:
- Skill used:
context7-retrieval-patterns
- Library IDs resolved and topics queried
- Version status (current/latest/unknown)
- Actionable implementation constraints for repository edits
- Validation recommendations and confidence level
Suggested Validations
get_errors for changed files after implementation.
- Targeted tests for affected behavior when available.