From jaan-to
Fetches and caches library documentation via Context7 MCP. Auto-detects from tech.md stack or explicit arguments. Use when needing technical docs.
npx claudepluginhub parhumm/jaan-to --plugin jaan-toThis skill is limited to using the following tools:
> Fetch and cache library documentation via Context7 MCP.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Fetch and cache library documentation via Context7 MCP.
$JAAN_CONTEXT_DIR/tech.md — Tech stack for library auto-detection
#current-stack, #frameworks$JAAN_LEARN_DIR/jaan-to-dev-docs-fetch.learn.md — Past lessons (loaded in Pre-Execution)${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md — Language resolution protocolArguments: $ARGUMENTS
[library-names...] — Explicit library names (e.g., fastapi react nextjs)$JAAN_CONTEXT_DIR/tech.mdIf no input and no tech.md, ask: "Which libraries do you need documentation for?"
MANDATORY — Read and execute ALL steps in: ${CLAUDE_PLUGIN_ROOT}/docs/extending/pre-execution-protocol.md
Skill name: dev-docs-fetch
Execute: Step 0 (Init Guard) → A (Load Lessons) → B (Resolve Template) → C (Offer Template Seeding)
Also read context files if available:
$JAAN_CONTEXT_DIR/tech.md — Know the tech stack for library detectionRead and apply language protocol: ${CLAUDE_PLUGIN_ROOT}/docs/extending/language-protocol.md
Override field for this skill: language_dev-docs-fetch
Language exception: Library names, Context7 IDs, package names, and cache file paths are NOT affected by this setting — always English.
Target: <10,000 tokens per execution
If $ARGUMENTS provided: Extract library names directly:
/jaan-to:dev-docs-fetch fastapi openai → ["fastapi", "openai"]/jaan-to:dev-docs-fetch react → ["react"]If no arguments (auto-detection):
$JAAN_CONTEXT_DIR/tech.md #current-stack sectionNo hardcoded library tiers. This skill is tech-agnostic — it reads whatever stack is declared in tech.md and resolves via Context7's search.
For each library to check, determine cache status:
Cache path: $JAAN_OUTPUTS_DIR/dev/docs/context7/{library-name}.md
CACHE_DIR="$JAAN_OUTPUTS_DIR/dev/docs/context7"
mkdir -p "$CACHE_DIR"
For each library (e.g., fastapi):
CACHE_FILE="$CACHE_DIR/fastapi.md"
if [ -f "$CACHE_FILE" ]; then
FRESH=$(find "$CACHE_FILE" -mtime -7 -print 2>/dev/null)
if [ -n "$FRESH" ]; then
echo "FRESH"
else
if [ "$(uname)" = "Darwin" ]; then
MTIME=$(stat -f %m "$CACHE_FILE")
else
MTIME=$(stat -c %Y "$CACHE_FILE")
fi
NOW=$(date +%s)
DAYS=$(( ($NOW - $MTIME) / 86400 ))
echo "STALE ($DAYS days)"
fi
else
echo "MISSING"
fi
Build lists:
Present summary:
Cache Status:
✓ Fresh (N): lib1, lib2 (will skip)
↻ Stale (N): lib3 (X days old)
⬇ Missing (N): lib4, lib5
Will fetch: N libraries (stale + missing)
Use AskUserQuestion:
Do NOT proceed to Phase 2 without explicit approval.
For each library in the fetch list:
Use mcp__context7__resolve-library-id:
Input:
libraryName: "{name}"
Expected Output:
Context7-compatible library ID (e.g., /tiangolo/fastapi)
Error handling — Library not found:
⚠️ Library "{name}" not found in Context7
Options:
retry <name> — Try different library name
skip — Continue without this library
Wait for user input before proceeding.
For each resolved library:
Use mcp__context7__get-library-docs:
Input:
context7CompatibleLibraryID: "{resolved-id}"
mode: "code"
topic: (optional, extracted from task context)
Mode selection:
mode="code" (API references + code examples)mode="info" if task mentions: architecture, concepts, design patterns, how it worksTopic extraction (optional): Extract specific topic from task description if mentioned:
topic="middleware"topic="hooks"
If no specific topic, omit the topic parameter.Error handling — API failure:
❌ Context7 API error for "{name}"
Fallback Strategy:
Stale cache available: {name}.md ({age} days old)
Use stale cache? (better than nothing)
Options:
use-stale — Use stale cache
skip — Continue without this library
retry — Try again
Error handling — Network timeout: Retry up to 3 times. After 3 failures, offer skip or use-stale.
For each successfully fetched library:
File path: $JAAN_OUTPUTS_DIR/dev/docs/context7/{library-name}.md
Naming convention: Lowercase, hyphenated, match package name.
Examples: fastapi.md, python-telegram-bot.md, nextjs.md
Handle created date:
created date, update updatedcreated and updated to todayWrite file with YAML frontmatter:
---
title: {Library Name} Documentation
library_id: {context7-compatible-library-id}
type: context7-reference
created: {YYYY-MM-DD}
updated: {YYYY-MM-DD}
context7_mode: {code|info}
topic: {topic_if_specified|null}
tags: [context7, {library-name}, technical-reference]
source: Context7 MCP
cache_ttl: 7 days
---
{Full Context7 markdown response}
Verify each write:
ls -lh "$JAAN_OUTPUTS_DIR/dev/docs/context7/{library-name}.md"
Documentation Fetch Complete
Fetched (N):
✅ lib1.md (code mode, XX KB)
✅ lib2.md (info mode, topic: hooks, XX KB)
Cached - Fresh (N):
✓ lib3.md (X days old)
Skipped (N):
⚠️ lib4 (not found in Context7)
Storage: $JAAN_OUTPUTS_DIR/dev/docs/context7/
Total libraries available: N
Next step: Documentation ready for use in planning and implementation phases.
Context-aware recommendations:
/jaan-to:backend-scaffold or /jaan-to:dev-tech-plan/jaan-to:frontend-scaffold/jaan-to:qa-test-generateUse AskUserQuestion:
If "Learn from this": Run /jaan-to:learn-add dev-docs-fetch "{feedback}"
$JAAN_OUTPUTS_DIR/dev/docs/context7/.mcp.json for Claude Code, ~/.codex/config.toml for Codex)(standalone — callable from any skill's Phase 1)
|
v
dev-docs-fetch
|
v
dev-tech-plan, backend-scaffold, frontend-scaffold, etc.
$JAAN_* environment variables throughout$JAAN_LEARN_DIR