From Code Context
This skill should be used when the user asks to "understand a codebase", "get code context", "research a library", "explore a repository", "find code examples", "look up documentation", asks a natural-language code/technology question (e.g. "how does X work", "X vs Y", "best practice for Z"), or wants to understand how a specific project, library, or concept works before making changes.
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-context:code-contextThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides 5 methods for retrieving code context. Select methods based on the target: public GitHub repos, library docs, code search, direct inspection, or post-clone web enrichment.
This skill provides 5 methods for retrieving code context. Select methods based on the target: public GitHub repos, library docs, code search, direct inspection, or post-clone web enrichment.
Never run any external lookup in the main context. Always spawn Task agents:
read_wiki_structure / read_wiki_contents / ask_question, extracts architecture summary and key relationships, returns concise overview.resolve-library-id then query-docs, extracts the minimum viable API surface and usage examples, returns copyable snippets with version notes.get_code_context_exa, extracts minimum viable snippets, deduplicates near-identical results (mirrors, forks, repeated StackOverflow answers), returns copyable snippets + brief explanation./tmp/, reads entry points and core modules, runs rm -rf cleanup, returns file structure summary and key patterns.WebSearch with version-anchored queries derived from clone findings, calls WebFetch on high-signal URLs, returns only validated insights cross-referenced against cloned code.Main context stays clean regardless of search volume. Only final summaries return to the caller.
Best for: Well-known public GitHub repositories where you need architecture overview, component explanations, or high-level understanding fast.
Tools: read_wiki_structure, read_wiki_contents, ask_question
Process:
read_wiki_structure with the owner/repo (e.g., "facebook/react") to get topic listread_wiki_contents for relevant topics, or ask_question for targeted queriesStrengths: Zero setup, instant AI-summarized documentation, good for onboarding to unfamiliar repos.
Limitations: Only works for public GitHub repos; coverage varies by project popularity.
Best for: Getting up-to-date API docs, usage examples, and version-specific documentation for npm/pip packages and frameworks.
Tools: resolve-library-id, query-docs
Process:
resolve-library-id with the library name (e.g., "react", "fastapi") to get the canonical ID"react@18"), select the matching version from the versions list returned by resolve-library-id and append it to the library ID path (e.g., /facebook/react/18.3.1)query-docs with libraryId and query — these are the only two parametersQuery tips: Be specific -- "useCallback dependency array" beats "react hooks". Include the framework version when known.
Version pinning: Encode version into the library ID path (e.g., /vercel/next.js/v14.3.0-canary.87), not as a separate parameter. Use the versions list from resolve-library-id to pick the correct slug.
Strengths: Always current docs, supports version pinning, covers thousands of libraries, excellent for API reference.
Limitations: Requires the library to be indexed; less useful for internal/private packages.
Best for: Finding real-world usage patterns, StackOverflow-style answers, GitHub Gist examples, and code snippets from across the web.
Tool: get_code_context_exa
Setup: Works without an API key (free tier with rate limits). For higher limits, set the EXA_API_KEY environment variable.
Process:
get_code_context_exa with a precise querytokensNum based on need: 3000 for quick examples, 8000 for comprehensive patternsQuery writing guidance:
"TypeScript React" not just "React""Next.js 14 app router""useServerAction" not "server action hook""example", "error handling", "migration guide""TypeScript Next.js 14 app router server action error handling example"Strengths: Finds diverse real-world examples, not limited to official docs, surfaces community solutions.
Limitations: Results may be outdated; always check publication dates and verify against official docs.
Best for: Private repositories, detailed implementation review, running local analysis, or when other methods lack depth.
Process:
git clone <repo-url> /tmp/<repo-name> --depth=1 to fetch the coderm -rf /tmp/<repo-name>Strengths: Full code access, works with private repos (with credentials), enables static analysis tools.
Limitations: Requires network access and disk space; slow for large repos; credentials needed for private repos.
Best for: Concepts, rationale, "best practice" questions, changelogs, issue discussions, blog posts, and migration guides that live outside source code. Two modes:
Tools: WebSearch, WebFetch
When to apply: Standalone for concept / rationale / best-practice queries; post-clone when enriching a repo inspection with context not in the source.
Process:
WebSearch with query set to a precise, version-anchored string (e.g., "<library> <version> breaking change <symbol>")WebFetch with url (from search results) and a focused prompt to extract only the relevant sectionQuery patterns:
"<repo-name> CHANGELOG v<version>" or "<repo-name> release notes""<repo-name> <concept> why OR rationale site:github.com""<repo-name> <symbol or pattern> issue OR bug site:github.com""<repo-name> migrate from <old-version> to <new-version>"Strengths: Surfaces context that never appears in source code — deprecation notices, upstream issue threads, author blog posts, community migration experiences.
Limitations: Results may be stale or inaccurate; always validate fetched claims against the actual cloned code. Rate-limited without API key.
Each input target falls into one of three kinds. Classify before selecting a method:
owner/repo slug or git URL. Use DeepWiki (public) or Git Clone (private / deeper detail).name@version. Use Context7; encode version into the libraryId path.When the caller passes --method=, only use the intersection of allowed methods and applicable methods. If the intersection is empty for a target, skip external lookups for that target and report that no allowed method applies.
| Scenario | Primary Method | Fallback |
|---|---|---|
| "How does X library work?" | Context7 | DeepWiki |
| "Understand the architecture of Y repo" | DeepWiki | Git Clone |
| "Find examples of Z pattern" | Exa | Context7 |
| "Inspect private/internal repo" | Git Clone | - |
| "What changed in v3 of library?" | Context7 | Exa |
| "How are modules connected?" | DeepWiki | Git Clone |
| "Why was this design decision made?" | Git Clone → Web Search+Fetch | DeepWiki |
| "What broke between versions?" | Web Search+Fetch | Context7 |
| "Compare X vs Y" (natural-language) | Exa + Context7 | Web Search+Fetch |
| "Best practice for Z" (natural-language) | Web Search+Fetch | Exa |
For comprehensive context, combine methods:
Always prefer non-destructive read-only operations. When cloning, use /tmp and clean up after.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Runs a structured interview session to sharpen plans or designs, producing ADRs and a glossary as output.
Applies curated color/font themes to slides, docs, and HTML artifacts. Includes 10 preset themes and can generate custom themes on demand.
npx claudepluginhub daisycatts/dotclaude --plugin code-context