/ 目錄 / 演練場 / Nexus-skills
● 社群 Haaaiawd ⚡ 即開即用

Nexus-skills

作者 Haaaiawd · Haaaiawd/Nexus-skills

程式碼庫智慧技能 — 建立持久性 .nexus-map/ 知識庫,並查詢檔案結構、相依關係與變更影響範圍。

Nexus Skills 讓 Claude Code 與其他代理具備程式碼庫感知能力。執行一次即可產生包含檔案結構、相依關係圖與呼叫點的 .nexus-map/ 知識庫。之後,像「修改這個函式會造成哪些影響?」這類查詢就能得到精確的答案,而非猜測。特別適合用於大型或陌生的程式庫。

為什麼要用

核心特性

即時演示

實際使用效果

nexus-skill.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "nexus-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Haaaiawd/Nexus-skills",
        "~/.claude/skills/Nexus-skills"
      ],
      "_inferred": true
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "nexus-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Haaaiawd/Nexus-skills",
        "~/.claude/skills/Nexus-skills"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "nexus-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Haaaiawd/Nexus-skills",
        "~/.claude/skills/Nexus-skills"
      ],
      "_inferred": true
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "nexus-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Haaaiawd/Nexus-skills",
        "~/.claude/skills/Nexus-skills"
      ],
      "_inferred": true
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "nexus-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Haaaiawd/Nexus-skills",
        "~/.claude/skills/Nexus-skills"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "nexus-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/Haaaiawd/Nexus-skills",
          "~/.claude/skills/Nexus-skills"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add nexus-skill -- git clone https://github.com/Haaaiawd/Nexus-skills ~/.claude/skills/Nexus-skills

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: Nexus-skills

如何快速熟悉陌生的程式碼庫

👤 加入新團隊或接手程式碼庫的工程師 ⏱ ~60 min intermediate

何時使用: 第一天進入從未接觸過的程式庫;希望在進行修改前先有一份全覽地圖。

前置條件
  • Skill installed — git clone https://github.com/Haaaiawd/Nexus-skills ~/.claude/skills/nexus-skills
步驟
  1. 建立知識庫
    Use nexus-skills to scan this repo and build .nexus-map/.✓ 已複製
    → 顯示進度輸出並產生知識庫檔案
  2. 取得整體概覽
    Using .nexus-map, tell me: entry points, top 10 most-imported modules, and any orphaned files.✓ 已複製
    → 對應實際檔案的程式庫概覽
  3. 深入特定子系統
    Show me the payments subsystem — files, dependencies, external calls.✓ 已複製
    → 聚焦的子系統檢視

結果: 在一小時內建立對程式庫的實際理解。

注意事項
  • 大型合併後知識庫可能過時 — 執行 nexus update;支援增量更新,速度快

修改核心函式前確認影響範圍

👤 即將修改廣泛使用之工具函式的工程師 ⏱ ~30 min intermediate

何時使用: 打算重新命名或變更函式簽名,並想查看所有呼叫點。

前置條件
  • .nexus-map/ already built — 每個程式庫執行一次;之後採增量更新
步驟
  1. 查詢影響範圍
    What calls formatCurrency(), and what would break if I change the signature to accept a locale?✓ 已複製
    → 列出呼叫點及各呼叫方可能的中斷模式
  2. 產生遷移方案
    Produce the minimal diff across all call sites to add the new locale param with a sensible default.✓ 已複製
    → 跨多檔案的修補檔

結果: 在已知影響範圍的情況下完成變更,並備妥修補差異。

找出無效程式碼與未使用的匯出

👤 在重構前進行整理的工程師 ⏱ ~40 min intermediate

何時使用: 重構前想確認哪些程式碼真正未被使用。

步驟
  1. 查詢知識庫
    Using .nexus-map, list files with no imports from elsewhere, and exports with no external references.✓ 已複製
    → 依信心程度排序的候選清單
  2. 進行驗證
    For the top 10 candidates, double-check by searching for string-based usage (reflection, dynamic imports).✓ 已複製
    → 過濾後的清單並附帶誤判說明

結果: 一份可實際交付的無效程式碼刪除清單。

注意事項
  • 動態 import 在靜態分析下看似無效程式碼 — 刪除前務必執行字串型態的全文搜尋

組合

與其他 MCP 搭配,撬動十倍槓桿

安全性影響查詢:受汙染的輸入資料會流向哪裡?

Using nexus-map, trace every call path from the /ingest endpoint into the DB layer. Then OWASP review those paths.✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
build_map repo_root 每個程式庫初始化時執行一次 compute (local)
update_map changed_files 大型合併後執行 compute (local)
query_structure question 回答結構相關問題時 Claude tokens
change_impact symbol or file 進行重大變更前 Claude tokens
dead_code - 重構前的整理清理 Claude tokens

成本與限制

運行它的成本

API 配額
None
每次呼叫 Token 數
知識庫建立為本機運算(速度快);查詢會消耗 Claude tokens
費用
Free
提示
建立一次,頻繁查詢。僅在程式庫整體結構發生重大變化時才重新建立。

安全

權限、密鑰、影響範圍

憑證儲存: 不需要憑證。.nexus-map/ 預設儲存於本機。
資料出站: 知識庫建立在本機執行。查詢時會將知識庫片段傳送至 Claude。

故障排查

常見錯誤與修復

Map build crashes on monorepos

改為針對各個套件分別執行,而非從根目錄執行;nexus 支援 scope 旗標

Queries return stale results after edits

對已變更的檔案執行 nexus update;增量更新的成本很低

Language not recognized

查閱 nexus 文件中支援的語言清單;某些框架需要明確設定解析器

替代方案

Nexus-skills 對比其他方案

替代方案何時用它替代權衡
SourceGraph / Cody需要在組織規模下使用託管式程式碼智慧服務需付費;非本機方案
tree-sitter + custom queries需要完全掌控解析行為需要投入大量建置時間

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills