changed context7 to cli

This commit is contained in:
bchanot 2026-04-09 14:31:24 +02:00
parent ebae42cdef
commit a8c416fdc1
6 changed files with 45 additions and 35 deletions

View File

@ -80,8 +80,10 @@ bash link.sh
# 3. Install prerequisites + all plugins (detects OS, reads pinned versions from plugins.lock.json) # 3. Install prerequisites + all plugins (detects OS, reads pinned versions from plugins.lock.json)
bash install-plugins.sh bash install-plugins.sh
# 4. Add Context7 API key (free at upstash.com) — manual step # 4. Context7 CLI (optional — for fast-evolving libs like Next.js, React, Prisma)
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_KEY npm install -g ctx7
ctx7 setup --claude # configures MCP + rules for Claude Code (OAuth login)
# Or use standalone: ctx7 docs /vercel/next.js "middleware"
# 5. Verify setup # 5. Verify setup
bash doctor.sh bash doctor.sh
@ -224,7 +226,7 @@ gsd # then inside the session:
| Command | Plugin | Description | | Command | Plugin | Description |
|---|---|---| |---|---|---|
| `/pr-review-toolkit:review-pr` | pr-review-toolkit | Multi-agent PR review (6 specialized agents) | | `/pr-review-toolkit:review-pr` | pr-review-toolkit | Multi-agent PR review (6 specialized agents) |
| `/context7:docs <lib>` | context7 | Manual doc lookup for a specific library | | `/context7:docs <lib>` | context7 | Manual doc lookup for a specific library (via ctx7 CLI) |
--- ---
@ -375,7 +377,7 @@ Warns if ruflo is active with no multi-agent signal, or if GSD v2 CLI is not ins
| gsd v2 ↔ ruflo | ⚠️ Overlap | Sequential (GSD) vs parallel swarm (ruflo). Pick based on need. | | gsd v2 ↔ ruflo | ⚠️ Overlap | Sequential (GSD) vs parallel swarm (ruflo). Pick based on need. |
| superpowers ↔ gsd v2 | ✅ Complementary | Single-session engine + multi-session CLI = no conflict | | superpowers ↔ gsd v2 | ✅ Complementary | Single-session engine + multi-session CLI = no conflict |
| superpowers ↔ gstack | ✅ Complementary | Used together by orchestrators | | superpowers ↔ gstack | ✅ Complementary | Used together by orchestrators |
| context7 ↔ any | ✅ Independent | Doc lookup MCP — always safe to combine | | context7 ↔ any | ✅ Independent | Doc lookup CLI (ctx7) — always safe to combine |
### Recommended sets by project type ### Recommended sets by project type
@ -420,7 +422,7 @@ Run `/plugin-check` anytime to get a recommendation for the current project type
| **pr-review-toolkit** | 🔄 TOGGLE | ~300 tokens | PR review sessions | claude-code-plugins | | **pr-review-toolkit** | 🔄 TOGGLE | ~300 tokens | PR review sessions | claude-code-plugins |
| **frontend-design** | 🔄 TOGGLE | ~200 tokens | Any project with a UI | claude-code-plugins | | **frontend-design** | 🔄 TOGGLE | ~200 tokens | Any project with a UI | claude-code-plugins |
| **ui-ux-pro-max** | 🔄 TOGGLE | ~400 tokens | Design system, color/typography choices | ui-ux-pro-max-skill | | **ui-ux-pro-max** | 🔄 TOGGLE | ~400 tokens | Design system, color/typography choices | ui-ux-pro-max-skill |
| **Context7 MCP** | 🔄 TOGGLE | ~200 tokens | Fast-evolving libs (Next.js, React, Prisma…) | MCP manual | | **Context7 CLI** | 🔄 TOGGLE | ~200 tokens | Fast-evolving libs (Next.js, React, Prisma…) | npm (ctx7) + optional ctx7 setup --claude |
**Rule:** toggle plugins are OFF by default. `/plugin-check` signals when to enable them. **Rule:** toggle plugins are OFF by default. `/plugin-check` signals when to enable them.
If you use `/init-project` or `/ship-feature`, plugin-check runs automatically as STEP 0 If you use `/init-project` or `/ship-feature`, plugin-check runs automatically as STEP 0

View File

@ -22,7 +22,10 @@ claude plugin list 2>/dev/null || echo "plugin-list-unavailable"
ls $HOME/.claude/skills/gstack/skills/ 2>/dev/null | wc -l || echo "0" ls $HOME/.claude/skills/gstack/skills/ 2>/dev/null | wc -l || echo "0"
# MCP servers # MCP servers
claude mcp list 2>/dev/null | grep -E "context7|ruflo" || echo "no-mcp" claude mcp list 2>/dev/null | grep -E "ruflo" || echo "no-mcp"
# Context7 CLI
command -v ctx7 &>/dev/null && ctx7 --version 2>/dev/null | head -1 || echo "ctx7-not-installed"
# Standalone CLIs # Standalone CLIs
command -v gsd &>/dev/null && gsd --version 2>/dev/null | head -1 || echo "gsd-not-installed" command -v gsd &>/dev/null && gsd --version 2>/dev/null | head -1 || echo "gsd-not-installed"
@ -130,7 +133,7 @@ ACTION REQUIRED? YES / NO
| superpowers ↔ gsd v2 | ✅ Complementary | Superpowers = single-session execution. GSD v2 = multi-session CLI orchestration. No conflict. | | superpowers ↔ gsd v2 | ✅ Complementary | Superpowers = single-session execution. GSD v2 = multi-session CLI orchestration. No conflict. |
| superpowers ↔ gstack | ✅ Complementary | Used together in /init-project and /ship-feature. Superpowers = engine, GStack = full-product skills. | | superpowers ↔ gstack | ✅ Complementary | Used together in /init-project and /ship-feature. Superpowers = engine, GStack = full-product skills. |
| superpowers ↔ ruflo | ⚠️ Overlap | Both can orchestrate agent sub-tasks. Together only for advanced hybrid setups. | | superpowers ↔ ruflo | ⚠️ Overlap | Both can orchestrate agent sub-tasks. Together only for advanced hybrid setups. |
| context7 ↔ any | ✅ Independent | Doc lookup MCP, no workflow overlap. Always safe to combine. | | context7 ↔ any | ✅ Independent | Doc lookup CLI (ctx7), no workflow overlap. Always safe to combine. |
| plugin-dev ↔ superpowers | ⚠️ Minor overlap | Superpowers can create skills too. Keep plugin-dev only when actively building new plugins/skills. | | plugin-dev ↔ superpowers | ⚠️ Minor overlap | Superpowers can create skills too. Keep plugin-dev only when actively building new plugins/skills. |
| frontend-design ↔ gstack | ✅ Complementary | GStack = deploy/QA layer; frontend-design = UI quality layer. Different concerns. | | frontend-design ↔ gstack | ✅ Complementary | GStack = deploy/QA layer; frontend-design = UI quality layer. Different concerns. |
| pr-review-toolkit ↔ superpowers | ✅ Complementary | superpowers:requesting-code-review and /pr-review-toolkit:review-pr cover different review styles. | | pr-review-toolkit ↔ superpowers | ✅ Complementary | superpowers:requesting-code-review and /pr-review-toolkit:review-pr cover different review styles. |
@ -243,8 +246,9 @@ RULE: IF `complex-arch` signal (multiple services, event bus, distributed system
- Total passive cost > 5500t (~50% of Pro session budget) - Total passive cost > 5500t (~50% of Pro session budget)
- **Next.js/React 18+/Prisma/Supabase detected + context7 not configured** - **Next.js/React 18+/Prisma/Supabase detected + context7 not configured**
→ Risk: Claude may generate code using outdated APIs (App Router changes frequently) → Risk: Claude may generate code using outdated APIs (App Router changes frequently)
→ Fix: `claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key KEY` → Fix: `npm install -g ctx7 && ctx7 setup --claude`
→ Free key: https://upstash.com → Or standalone: `ctx7 docs /vercel/next.js "middleware"`
→ Free higher rate limits: `ctx7 login` (OAuth) or API key from context7.com/dashboard
→ Type "force" to proceed without context7 (not recommended for fast-evolving libs) → Type "force" to proceed without context7 (not recommended for fast-evolving libs)
Never modify files. If action required → stop and wait. If not → say "proceed". Never modify files. If action required → stop and wait. If not → say "proceed".

View File

@ -163,9 +163,9 @@ else
fi fi
if detect_context7; then if detect_context7; then
pass "Context7 MCP configured" pass "Context7 CLI (ctx7) installed"
else else
info "Context7 MCP not configured (optional — needed for fast-evolving libs)" info "Context7 CLI not installed (optional — needed for fast-evolving libs: npm install -g ctx7)"
fi fi
if detect_gsd; then if detect_gsd; then

View File

@ -348,21 +348,29 @@ install_plugin "ui-ux-pro-max" "ui-ux-pro-max-skill"
echo "" echo ""
# ============================================================ # ============================================================
# STEP 6 — CONTEXT7 MCP (manual — requires API key) # STEP 6 — CONTEXT7 CLI (ctx7)
# ============================================================ # ============================================================
echo "── Step 7: Context7 MCP ─────────────────────────────────────" echo "── Step 7: Context7 CLI ─────────────────────────────────────"
echo "" echo ""
if claude mcp list 2>/dev/null | grep -q "context7"; then if command -v ctx7 &>/dev/null; then
ok "Context7 MCP already configured" ok "ctx7 already installed ($(ctx7 --version 2>/dev/null | head -1 || echo 'installed'))"
else else
warn "Context7 requires a free API key — cannot auto-install" CTX7_VER=$(pinned_version "ctx7")
echo "" if [ "$CTX7_VER" != "latest" ]; then
echo " Steps:" info "Installing ctx7@${CTX7_VER} (pinned in plugins.lock.json)..."
echo " 1. Get a free key at https://upstash.com" npm install -g "ctx7@${CTX7_VER}"
echo " 2. Run:" else
echo " claude mcp add --scope user context7 -- \\" info "Installing ctx7@latest (consider pinning in plugins.lock.json)..."
echo " npx -y @upstash/context7-mcp --api-key YOUR_KEY" npm install -g ctx7
echo "" fi
command -v ctx7 &>/dev/null && ok "ctx7 installed ($(ctx7 --version 2>/dev/null | head -1))" \
|| err "ctx7 install failed — run manually: npm install -g ctx7"
fi
# Suggest setup for Claude Code integration (optional — ctx7 also works standalone)
if command -v ctx7 &>/dev/null; then
info "Run 'ctx7 setup --claude' to configure Context7 for Claude Code"
info "Or use ctx7 standalone: ctx7 docs /vercel/next.js \"middleware\""
info "Free higher rate limits: ctx7 login (OAuth) or --api-key from context7.com/dashboard"
fi fi
# ============================================================ # ============================================================
@ -385,7 +393,7 @@ echo " 🔄 plugin-dev — create plugins/skills (~100 tokens) [clau
echo " 🔄 pr-review-toolkit — /pr-review-toolkit:review-pr (~300 tokens) [claude-code-plugins]" echo " 🔄 pr-review-toolkit — /pr-review-toolkit:review-pr (~300 tokens) [claude-code-plugins]"
echo " 🔄 frontend-design — UI design skill (~200 tokens) [claude-code-plugins]" echo " 🔄 frontend-design — UI design skill (~200 tokens) [claude-code-plugins]"
echo " 🔄 ui-ux-pro-max — user scope (~400 tokens)" echo " 🔄 ui-ux-pro-max — user scope (~400 tokens)"
echo " 🔄 context7 MCP — see Step 7 above (~200 tokens)" echo " 🔄 context7 CLI — ctx7 (npm global, standalone or MCP setup)"
echo " 🔄 ruflo MCP — see Step 5 above (~500-1500 tokens, enterprise only)" echo " 🔄 ruflo MCP — see Step 5 above (~500-1500 tokens, enterprise only)"
echo "" echo ""
echo " All plugins installed at: user scope (~/.claude/plugins/)" echo " All plugins installed at: user scope (~/.claude/plugins/)"

View File

@ -59,17 +59,8 @@ detect_uiux_pro_max() {
} }
detect_context7() { detect_context7() {
# Fast check: read ~/.claude.json (MCP config) without spawning the claude CLI # Context7 CLI (ctx7) — installed globally via npm
local cfg="$HOME/.claude.json" command -v ctx7 &>/dev/null
if [ -f "$cfg" ]; then
grep -q "context7" "$cfg" 2>/dev/null && return 0
fi
# Fallback: ~/.mcp.json (project-scoped MCP config at user level)
local mcp="$HOME/.mcp.json"
if [ -f "$mcp" ]; then
grep -q "context7" "$mcp" 2>/dev/null && return 0
fi
return 1
} }
detect_ruflo() { detect_ruflo() {

View File

@ -19,5 +19,10 @@
"source": "npm:ruflo", "source": "npm:ruflo",
"version": "3.5.58", "version": "3.5.58",
"note": "Enterprise multi-agent MCP server (formerly claude-flow). Requires manual MCP config after install. Check latest at https://www.npmjs.com/package/ruflo before updating." "note": "Enterprise multi-agent MCP server (formerly claude-flow). Requires manual MCP config after install. Check latest at https://www.npmjs.com/package/ruflo before updating."
},
"ctx7": {
"source": "npm:ctx7",
"version": "latest",
"note": "Context7 CLI \u2014 doc lookup for fast-evolving libs. Install: npm install -g ctx7. Setup for Claude Code: ctx7 setup --claude. Standalone: ctx7 docs /vercel/next.js \"middleware\"."
} }
} }