skills/context7-docs/SKILL.md
Fetch official library docs via Context7 MCP for Tailwind CSS, React, Next.js, Vue, MCP, OpenCode, or any npm library. Always use before external web search.
npx skillsauth add Thomashighbaugh/opencode context7-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 up-to-date library documentation via the Context7 MCP server. Use this skill when you need to research any npm library, framework, or tool.
| Action | Command | Description |
|--------|---------|-------------|
| search | ./scripts/docs.sh search <library> | Find library ID for a given name |
| docs | ./scripts/docs.sh docs <library> [topic] [--tokens N] | Get documentation for a library |
| help | ./scripts/docs.sh help | Show usage help |
# Search for a library
./scripts/docs.sh search react
./scripts/docs.sh search "next.js"
# Get documentation (automatically resolves library ID)
./scripts/docs.sh docs react hooks
./scripts/docs.sh docs next.js "app router"
./scripts/docs.sh docs tailwindcss utilities
# Get general documentation without topic filter
./scripts/docs.sh docs vue
Find the Context7-compatible library ID for a given library name.
Parameters:
library (required): Library name to search for (e.g., "react", "next.js")Example:
./scripts/docs.sh search react
# Returns: /npm/react, /websites/react_dev, etc.
Get documentation for a library, optionally filtered by topic.
Parameters:
library (required): Library name (will be resolved to ID automatically)topic (optional): Topic to filter documentation (e.g., "hooks", "routing")Example:
# Get React hooks documentation
./scripts/docs.sh docs react hooks
# Get general Next.js documentation
./scripts/docs.sh docs next.js
# Get specific Vue documentation
./scripts/docs.sh docs vue "composition api"
This skill encodes the Context7 two-step workflow:
resolve-library-id, check .opencode/context/research/_library-ids.json for a cached library ID. If found and less than 30 days old, skip the resolve step entirely..opencode/context/research/{library-slug}/ for existing cached docs matching the library and query. If a cached result exists and is less than 7 days old, use it directly — skip the API call entirely._library-ids.json. After fetching, save results to .opencode/context/research/{library-slug}/{query-hash}.md..opencode/context/research/_library-ids.json:
{
"react": { "id": "/npm/react", "resolved": "2026-06-26T00:00:00Z" },
"next.js": { "id": "/vercel/next.js", "resolved": "2026-06-26T00:00:00Z" },
"tailwindcss": { "id": "/tailwindlabs/tailwindcss", "resolved": "2026-06-26T00:00:00Z" }
}
ID cache TTL: 30 days. Library IDs rarely change.
.opencode/context/research/
├── react/
│ ├── hooks-abc123.md
│ ├── server-components-def456.md
│ └── _index.json # maps query → file + timestamp
├── nextjs/
│ ├── app-router-ghi789.md
│ └── _index.json
└── tailwindcss/
└── ...
Cache format (_index.json):
{
"hooks-abc123": { "file": "hooks-abc123.md", "query": "React hooks", "fetched": "2026-06-26T00:00:00Z", "ttl": "7d" }
}
Cache check logic:
library-slug from the library name (lowercase, hyphens, no special chars)query-hash from the query string (first 8 chars of SHA256).opencode/context/research/{library-slug}/_index.json for a matching entryfetched + 7d > now, read the cached file and return its contentContext7 supports thousands of libraries including:
brew tap steipete/tap && brew install mcporternpx mcporterNote: Context7 server configuration is optional. The skill automatically falls back to the Context7 public URL (
https://mcp.context7.com/mcp) if no local server is configured.
CONTEXT7_SERVER: MCP server name (default: context7)CONTEXT7_API_BASE: Direct Context7 REST base URL (default: https://context7.com/api/v2)CONTEXT7_REST_FALLBACK: Enable direct REST fallback when MCP calls fail (default: 1)MCPORTER_TIMEOUT: Timeout in seconds for MCPorter calls (default: 20)--tokens N to control response size when context budget is tightmcporter skill insteadtools
Create valid, type-safe TypeScript tools for OpenCode — generates correct boilerplate, typed interfaces, and handler stubs. Use when building new tools for global config or per-project .opencode/tools/.
testing
Explore multiple solution branches in parallel, evaluate each, and recommend the best path. Use when the user explicitly invokes /ideation tree-of-thoughts or asks for "tree of thought" / "branching exploration".
testing
Run multiple independent reasoning passes and find consensus. Use when the decision is critically important, the stakes are high, or the user explicitly requests "run it multiple times" / "check consistency" / "self-consistency".
testing
Optimization by PROmpting — generate candidate prompt variations, test each against a benchmark, and report the best performer. Use when the user invokes /ideation opro or asks for "prompt optimization" / "OPRO".