{"id":"a18c1e7c-2736-4c68-a7b5-cc58545c3c73","entityType":"agent","slug":"clawhub-babywhale-code-graph","name":"Code Graph（代码图谱）","canonicalUrl":"https://www.xpersona.co/agent/clawhub-babywhale-code-graph","canonicalPath":"/agent/clawhub-babywhale-code-graph","generatedAt":"2026-10-11T08:40:34.088Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T05:51:45.534Z","emptyReason":null},"description":"一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。 Skill: Code Graph（代码图谱） Owner: babywhale Summary: 一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。 Tags: ai-agent:1.0.1, code-analysis:1.0.1, code-graph:1.0.1, gitnexus:1.0.1, knowledge-graph:1.0.1, latest:1.0.2 Version history: v1.0.2 | 2026-07-15T09:16:40.640Z | user - Removed the file: skill-card.md. - Installation step now specifies installing GitNe","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s179e8009mmyn5bqr2sakbwwyn87eprq:code-graph","sourceUrl":"https://clawhub.ai/babywhale/code-graph","homepage":"https://clawhub.ai/babywhale/skills/code-graph","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/babywhale/code-graph","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/babywhale/skills/code-graph","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。 Skill: Code Graph（代码图谱） Owner: babywhale Summa"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T05:51:45.534Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T05:51:45.534Z","emptyReason":null},"stars":null,"forks":null,"downloads":1141,"packageName":null,"latestVersion":"1.0.2","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T05:51:45.464Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T05:51:45.534Z","lastCrawledAt":"2026-10-11T05:51:45.464Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T05:51:45.464Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.2","createdAt":"2026-07-15T09:16:40.640Z","changelog":"- Removed the file: skill-card.md. - Installation step now specifies installing GitNexus version 1.6.5. - All GitNexus global npm install commands updated to explicitly use @1.6.5 version. - No other workflow or usage changes noted.","fileCount":3,"zipByteSize":4963},{"version":"1.0.1","createdAt":"2026-05-26T07:27:26.279Z","changelog":"- Major rewrite: Skill now provides an automated, stepwise workflow for installing, configuring, and indexing with GitNexus in a single command. - Automatic detection: Each step (project root, Node.js, GitNexus install, MCP config, index status) is checked and only runs if needed, preventing redundancy. - Updated install requirements: Node.js >= 22 is now required; global or `npx`-based installation handled with detailed detection and fallback logic. - Clearer MCP integration: Simplified and clarified MCP configuration for common editors; auto-handling of repeated/failed setup. - More robust troubleshooting: Expanded common error solutions and quick-fix guidance for permissions, environment, indexing, and MCP/editor integration. - Concise language and tool support lists; streamlined usage examples and expected output for improved user clarity.","fileCount":3,"zipByteSize":4895},{"version":"1.0.0","createdAt":"2026-05-26T07:20:48.029Z","changelog":"Initial release of the code-graph skill for building code knowledge graphs with GitNexus. - Enables automatic code structure and dependency analysis for AI agents. - Provides step-by-step workflow: project detection, GitNexus installation, indexing, and MCP configuration for multiple AI platforms. - Documents troubleshooting, supported languages, output locations, and post-indexing graph tools. - Supports semantic and hybrid queries, multi-file refactoring, and impact analysis through MCP interface. - Includes full CLI examples and configurations for OpenCode, Claude, OpenClaw, and Hermes agents.","fileCount":3,"zipByteSize":4147}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s179e8009mmyn5bqr2sakbwwyn87eprq:code-graph","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T08:40:34.086Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-babywhale-code-graph/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T05:51:45.534Z","emptyReason":null},"readme":"Skill: Code Graph（代码图谱）\n\nOwner: babywhale\n\nSummary: 一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。\n\nTags: ai-agent:1.0.1, code-analysis:1.0.1, code-graph:1.0.1, gitnexus:1.0.1, knowledge-graph:1.0.1, latest:1.0.2\n\nVersion history:\n\nv1.0.2 | 2026-07-15T09:16:40.640Z | user\n\n- Removed the file: skill-card.md.\n- Installation step now specifies installing GitNexus version 1.6.5.\n- All GitNexus global npm install commands updated to explicitly use @1.6.5 version.\n- No other workflow or usage changes noted.\n\nv1.0.1 | 2026-05-26T07:27:26.279Z | auto\n\n- Major rewrite: Skill now provides an automated, stepwise workflow for installing, configuring, and indexing with GitNexus in a single command.\n- Automatic detection: Each step (project root, Node.js, GitNexus install, MCP config, index status) is checked and only runs if needed, preventing redundancy.\n- Updated install requirements: Node.js >= 22 is now required; global or `npx`-based installation handled with detailed detection and fallback logic.\n- Clearer MCP integration: Simplified and clarified MCP configuration for common editors; auto-handling of repeated/failed setup.\n- More robust troubleshooting: Expanded common error solutions and quick-fix guidance for permissions, environment, indexing, and MCP/editor integration.\n- Concise language and tool support lists; streamlined usage examples and expected output for improved user clarity.\n\nv1.0.0 | 2026-05-26T07:20:48.029Z | auto\n\nInitial release of the code-graph skill for building code knowledge graphs with GitNexus.\n\n- Enables automatic code structure and dependency analysis for AI agents.\n- Provides step-by-step workflow: project detection, GitNexus installation, indexing, and MCP configuration for multiple AI platforms.\n- Documents troubleshooting, supported languages, output locations, and post-indexing graph tools.\n- Supports semantic and hybrid queries, multi-file refactoring, and impact analysis through MCP interface.\n- Includes full CLI examples and configurations for OpenCode, Claude, OpenClaw, and Hermes agents.\n\nArchive index:\n\nArchive v1.0.2: 3 files, 4963 bytes\n\nFiles: skill-card.md (1826b), SKILL.md (7736b), _meta.json (129b)\n\nFile v1.0.2:SKILL.md\n\n---\r\nname: code-graph\r\ndescription: 一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。\r\n---\r\n\r\n# 代码图谱（GitNexus）\r\n\r\n为当前项目一键完成 GitNexus 安装、MCP 配置和知识图谱构建。**每一步都有跳过检测，已完成的步骤不会重复执行。**\r\n\r\n## 语言支持\r\n\r\nTypeScript、JavaScript、Python、Java、C、C++、C#、Go、Rust、PHP、Swift、Dart、Kotlin、Ruby 等 14 种语言。\r\n\r\n---\r\n\r\n## 执行流程\r\n\r\n**按顺序执行以下步骤。每步先检测当前状态，已完成则跳过。**\r\n\r\n### 第 1 步：定位项目根目录\r\n\r\n`gitnexus analyze` 需在项目根目录下执行。首先检查当前工作目录是否即为项目根目录：\r\n\r\n```bash\r\ngit rev-parse --show-toplevel 2>&1 && echo \"已定位到项目根目录\"\r\n```\r\n\r\n如果 Git 未初始化，则通过常见项目标志文件判断：\r\n\r\n```bash\r\nls package.json 2>&1 || ls pom.xml 2>&1 || ls go.mod 2>&1 || ls Cargo.toml 2>&1 || ls requirements.txt 2>&1 || echo \"未找到项目根目录标志文件\"\r\n```\r\n\r\n- 当前目录即为根目录 → 继续下一步\r\n- 检测到其他目录为根目录 → `cd` 到该目录\r\n- 找不到任何项目标志 → 询问用户项目根目录在哪，或使用 `git init` 初始化\r\n\r\n### 第 2 步：检查 Node.js 环境\r\n\r\n```bash\r\nnode --version\r\n```\r\n\r\n**要求 Node.js >= 22。** 如果版本过低或未安装：\r\n\r\n- 引导用户到 [nodejs.org](https://nodejs.org/) 下载 LTS 版本\r\n- Windows 用户也可用 `winget install OpenJS.NodeJS.LTS` 安装\r\n- 升级完成后重新执行本技能\r\n\r\n### 第 3 步：安装 GitNexus\r\n\r\n注意，gitNexus安装时指定1.6.5版本\r\n\r\n**先检测，再决定是否安装：**\r\n\r\n```bash\r\ngitnexus --version 2>&1\r\n```\r\n\r\n**判断逻辑：**\r\n- 输出类似 `1.x.x` 的版本号 → **已安装，跳过本步骤**，直接进入第 4 步\r\n- 输出 `command not found` 或 `not recognized` → 未安装，执行以下安装\r\n\r\n**安装命令（Windows，推荐全局安装）：**\r\n\r\n```bash\r\nset GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 && npm install -g gitnexus@1.6.5\r\n```\r\n\r\n**安装命令（macOS / Linux）：**\r\n\r\n```bash\r\nGITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 npm install -g gitnexus@1.6.5\r\n```\r\n\r\n> `GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1` 跳过 Dart/Proto 原生语法解析器的编译，安装只需几秒，无需 C++ 工具链。\r\n\r\n**权限不足时的回退方案** — 如果全局安装失败（EACCES / Permission denied），后续命令统一改用 `npx` 前缀：\r\n\r\n```bash\r\nnpx gitnexus analyze    # 代替 gitnexus analyze\r\nnpx gitnexus setup      # 代替 gitnexus setup\r\nnpx gitnexus status     # 代替 gitnexus status\r\n```\r\n\r\n### 第 4 步：配置 MCP 服务\r\n\r\n`gitnexus setup` 自动检测已安装的编辑器并写入 MCP 配置，全局只需执行一次。\r\n\r\n**先检测是否已配置：**\r\n\r\n```bash\r\ngitnexus setup 2>&1\r\n```\r\n\r\n**判断逻辑：**\r\n- 输出包含 `already configured`、`up to date`、`MCP configuration exists` 等字样 → **已配置，跳过**\r\n- 输出包含 `wrote`、`created`、`configured`、`Updated` 等字样 → 配置成功\r\n- 若 `gitnexus` 命令不可用（未全局安装），使用 `npx gitnexus setup`\r\n\r\n> `setup` 是幂等的，重复执行不会产生重复配置，可安全地直接运行。\r\n\r\n### 第 5 步：构建知识图谱\r\n\r\n**先检测当前项目是否已索引：**\r\n\r\n```bash\r\ngitnexus status 2>&1\r\n```\r\n\r\n**判断逻辑：**\r\n- 输出包含 `Indexed`、`symbols`、`up to date`、`fresh` 等字样 → **已索引且是最新的，跳过本步骤**\r\n- 输出包含 `Not indexed`、`No index found`、`unknown` 等字样 → 未索引，执行以下命令\r\n- 如果 `gitnexus` 不可用，改用 `npx gitnexus status`\r\n\r\n**执行索引：**\r\n\r\n```bash\r\ngitnexus analyze\r\n```\r\n\r\n此命令解析整个代码库、解析导入关系、追踪调用链、检测代码社区，在项目根目录生成 `.gitnexus/` 索引（自动加入 `.gitignore`）。优先使用gitnexus analyze进行索引，若出现错误则尝试增加选项。\r\n\r\n**如果需要强制重建（已索引但过期）：**\r\n\r\n```bash\r\ngitnexus analyze --force\r\n```\r\n\r\n**常用选项：**\r\n\r\n| 选项 | 用途 |\r\n|------|------|\r\n| `--embeddings` | 启用语义/向量搜索，速度较慢但搜索更强 |\r\n| `--force` | 强制重建索引（索引过期时使用） |\r\n| `--skip-embeddings` | 跳过嵌入生成，大幅加速（默认行为） |\r\n| `--skip-git` | 允许对非 git 目录构建索引 |\r\n| `--skip-agents-md` | 保留自定义的 CLAUDE.md / AGENTS.md |\r\n| `--verbose` | 输出详细日志，包括被跳过的文件 |\r\n| `--worker-timeout 60` | 大型仓库增加 Worker 超时时间 |\r\n\r\n预期输出：\r\n\r\n```\r\nScanning files... ✓ (1,247 files)\r\nParsing code... ✓ (TypeScript, Python, etc.)\r\nResolving imports... ✓ (3,892 relationships)\r\nTracing calls... ✓ (104 processes)\r\nCreating indexes... ✓\r\nDone! Indexed 30,816 symbols in 12s\r\n```\r\n\r\n### 第 6 步：验证\r\n\r\n```bash\r\ngitnexus status\r\ngitnexus list\r\n```\r\n\r\n`status` 确认当前项目的索引状态，`list` 展示全局所有已索引的仓库。\r\n\r\n---\r\n\r\n## 索引后可用的 MCP 工具\r\n\r\n| 工具 | 用途 |\r\n|------|------|\r\n| `list_repos` | 查看所有已索引的仓库 |\r\n| `query` | 混合搜索（关键词 + 语义），按执行流程分组 |\r\n| `context` | 360° 符号视图（调用者、被调用、所属流程） |\r\n| `impact` | 爆炸半径分析 — 修改某个符号会影响哪些地方 |\r\n| `detect_changes` | Git diff 影响映射 |\r\n| `cypher` | 原始图谱查询语言 |\r\n| `rename` | 多文件协调重命名 |\r\n\r\n**MCP 资源：**\r\n\r\n| 资源 | 用途 |\r\n|------|------|\r\n| `gitnexus://repo/{name}/context` | 代码库概览 + 索引新鲜度检查 |\r\n| `gitnexus://repo/{name}/clusters` | 所有功能聚类 |\r\n| `gitnexus://repo/{name}/processes` | 所有执行流程 |\r\n| `gitnexus://repo/{name}/schema` | 图谱 Schema（Cypher 查询用） |\r\n\r\n---\r\n\r\n## 常见问题排查\r\n\r\n### \"Not inside a git repository\"（不在 git 仓库中）\r\n\r\n```bash\r\ngit init && git add . && git commit -m \"initial\"\r\ngitnexus analyze\r\n```\r\n\r\n或使用 `--skip-git` 跳过 git 检查：\r\n\r\n```bash\r\ngitnexus analyze --skip-git\r\n```\r\n\r\n### \"Permission denied\"（npm install -g 权限不足）\r\n\r\n改用 npx 免安装运行：\r\n\r\n```bash\r\nnpx gitnexus analyze\r\n```\r\n\r\n### \"Already indexed\"（已索引）\r\n\r\n索引已存在且是最新的，无需操作。如需强制重建：\r\n\r\n```bash\r\ngitnexus analyze --force\r\n```\r\n\r\n### \"Node version too old\"（Node 版本过旧）\r\n\r\n需要 Node.js >= 22，升级后重试：\r\n- Windows: `winget install OpenJS.NodeJS.LTS`\r\n- macOS: `brew install node`\r\n- Linux: 使用 [nvm](https://github.com/nvm-sh/nvm)\r\n\r\n### MCP 工具未出现在 Claude Code / Cursor 中\r\n\r\n1. 重新执行 `gitnexus setup`\r\n2. 重启编辑器\r\n3. 确认 gitnexus 在 PATH 中：Windows 用 `where gitnexus`，Unix 用 `which gitnexus`\r\n\r\n### 索引过期（代码变更后）\r\n\r\n```bash\r\ngitnexus analyze    # 增量更新，保留已有嵌入\r\ngitnexus analyze --force  # 完全重建\r\n```\r\n\r\n---\r\n\r\n## 对话示例\r\n\r\n**用户**：\"安装GitNexus\"\r\n\r\n执行：\r\n1. 定位项目根目录\r\n2. `node --version` → 确认 >= 22\r\n3. `gitnexus --version` → 未安装 → `npm install -g gitnexus`\r\n4. `gitnexus setup` → MCP 已配置则跳过\r\n5. `gitnexus status` → 未索引 → `gitnexus analyze`\r\n6. `gitnexus status` → 验证成功\r\n7. 回复用户：\"已索引 N 个符号，生成知识图谱。可通过 context / impact / query 等 MCP 工具查询代码库。\"\n\nFile v1.0.2:_meta.json\n\n{\n  \"ownerId\": \"kn787ypy8qst1csc9zmfk7mqmx87fm55\",\n  \"slug\": \"code-graph\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1784107000640\n}\n\nFile v1.0.2:skill-card.md\n\n## Description:\n\nInstalls GitNexus, configures its MCP service, and builds a code knowledge graph for the current project.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[babywhale](https://clawhub.ai/user/babywhale)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to set up GitNexus for an existing project, configure MCP integration, index the repository, and verify the resulting code knowledge graph.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Fallback and troubleshooting commands may execute unpinned GitNexus packages through npx.\n\nMitigation: Use the pinned global install command or an explicitly pinned `npx gitnexus@1.6.5` command before running setup, status, or analyze.\n\nRisk: The troubleshooting flow can commit all local files with `git add . && git commit`, which may include secrets or private files.\n\nMitigation: Review `.gitignore`, inspect `git status`, and confirm no sensitive files are staged before committing.\n\n## Reference(s):\n\n- [Node.js](https://nodejs.org/)\n- [nvm](https://github.com/nvm-sh/nvm)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown with inline bash code blocks]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Guides project-root detection, Node.js version checks, GitNexus installation, MCP setup, repository indexing, and verification steps.]\n\n## Skill Version(s):\n\n1.0.2 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.1: 3 files, 4895 bytes\n\nFiles: skill-card.md (1945b), SKILL.md (7429b), _meta.json (129b)\n\nFile v1.0.1:SKILL.md\n\n---\nname: code-graph\ndescription: 一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。\n---\n\n# 代码图谱（GitNexus）\n\n为当前项目一键完成 GitNexus 安装、MCP 配置和知识图谱构建。**每一步都有跳过检测，已完成的步骤不会重复执行。**\n\n## 语言支持\n\nTypeScript、JavaScript、Python、Java、C、C++、C#、Go、Rust、PHP、Swift、Dart、Kotlin、Ruby 等 14 种语言。\n\n---\n\n## 执行流程\n\n**按顺序执行以下步骤。每步先检测当前状态，已完成则跳过。**\n\n### 第 1 步：定位项目根目录\n\n`gitnexus analyze` 需在项目根目录下执行。首先检查当前工作目录是否即为项目根目录：\n\n```bash\ngit rev-parse --show-toplevel 2>&1 && echo \"已定位到项目根目录\"\n```\n\n如果 Git 未初始化，则通过常见项目标志文件判断：\n\n```bash\nls package.json 2>&1 || ls pom.xml 2>&1 || ls go.mod 2>&1 || ls Cargo.toml 2>&1 || ls requirements.txt 2>&1 || echo \"未找到项目根目录标志文件\"\n```\n\n- 当前目录即为根目录 → 继续下一步\n- 检测到其他目录为根目录 → `cd` 到该目录\n- 找不到任何项目标志 → 询问用户项目根目录在哪，或使用 `git init` 初始化\n\n### 第 2 步：检查 Node.js 环境\n\n```bash\nnode --version\n```\n\n**要求 Node.js >= 22。** 如果版本过低或未安装：\n\n- 引导用户到 [nodejs.org](https://nodejs.org/) 下载 LTS 版本\n- Windows 用户也可用 `winget install OpenJS.NodeJS.LTS` 安装\n- 升级完成后重新执行本技能\n\n### 第 3 步：安装 GitNexus\n\n**先检测，再决定是否安装：**\n\n```bash\ngitnexus --version 2>&1\n```\n\n**判断逻辑：**\n- 输出类似 `1.x.x` 的版本号 → **已安装，跳过本步骤**，直接进入第 4 步\n- 输出 `command not found` 或 `not recognized` → 未安装，执行以下安装\n\n**安装命令（Windows，推荐全局安装）：**\n\n```bash\nset GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 && npm install -g gitnexus\n```\n\n**安装命令（macOS / Linux）：**\n\n```bash\nGITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 npm install -g gitnexus\n```\n\n> `GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1` 跳过 Dart/Proto 原生语法解析器的编译，安装只需几秒，无需 C++ 工具链。\n\n**权限不足时的回退方案** — 如果全局安装失败（EACCES / Permission denied），后续命令统一改用 `npx` 前缀：\n\n```bash\nnpx gitnexus analyze    # 代替 gitnexus analyze\nnpx gitnexus setup      # 代替 gitnexus setup\nnpx gitnexus status     # 代替 gitnexus status\n```\n\n### 第 4 步：配置 MCP 服务\n\n`gitnexus setup` 自动检测已安装的编辑器并写入 MCP 配置，全局只需执行一次。\n\n**先检测是否已配置：**\n\n```bash\ngitnexus setup 2>&1\n```\n\n**判断逻辑：**\n- 输出包含 `already configured`、`up to date`、`MCP configuration exists` 等字样 → **已配置，跳过**\n- 输出包含 `wrote`、`created`、`configured`、`Updated` 等字样 → 配置成功\n- 若 `gitnexus` 命令不可用（未全局安装），使用 `npx gitnexus setup`\n\n> `setup` 是幂等的，重复执行不会产生重复配置，可安全地直接运行。\n\n### 第 5 步：构建知识图谱\n\n**先检测当前项目是否已索引：**\n\n```bash\ngitnexus status 2>&1\n```\n\n**判断逻辑：**\n- 输出包含 `Indexed`、`symbols`、`up to date`、`fresh` 等字样 → **已索引且是最新的，跳过本步骤**\n- 输出包含 `Not indexed`、`No index found`、`unknown` 等字样 → 未索引，执行以下命令\n- 如果 `gitnexus` 不可用，改用 `npx gitnexus status`\n\n**执行索引：**\n\n```bash\ngitnexus analyze\n```\n\n此命令解析整个代码库、解析导入关系、追踪调用链、检测代码社区，在项目根目录生成 `.gitnexus/` 索引（自动加入 `.gitignore`）。优先使用gitnexus analyze进行索引，若出现错误则尝试增加选项。\n\n**如果需要强制重建（已索引但过期）：**\n\n```bash\ngitnexus analyze --force\n```\n\n**常用选项：**\n\n| 选项 | 用途 |\n|------|------|\n| `--embeddings` | 启用语义/向量搜索，速度较慢但搜索更强 |\n| `--force` | 强制重建索引（索引过期时使用） |\n| `--skip-embeddings` | 跳过嵌入生成，大幅加速（默认行为） |\n| `--skip-git` | 允许对非 git 目录构建索引 |\n| `--skip-agents-md` | 保留自定义的 CLAUDE.md / AGENTS.md |\n| `--verbose` | 输出详细日志，包括被跳过的文件 |\n| `--worker-timeout 60` | 大型仓库增加 Worker 超时时间 |\n\n预期输出：\n\n```\nScanning files... ✓ (1,247 files)\nParsing code... ✓ (TypeScript, Python, etc.)\nResolving imports... ✓ (3,892 relationships)\nTracing calls... ✓ (104 processes)\nCreating indexes... ✓\nDone! Indexed 30,816 symbols in 12s\n```\n\n### 第 6 步：验证\n\n```bash\ngitnexus status\ngitnexus list\n```\n\n`status` 确认当前项目的索引状态，`list` 展示全局所有已索引的仓库。\n\n---\n\n## 索引后可用的 MCP 工具\n\n| 工具 | 用途 |\n|------|------|\n| `list_repos` | 查看所有已索引的仓库 |\n| `query` | 混合搜索（关键词 + 语义），按执行流程分组 |\n| `context` | 360° 符号视图（调用者、被调用、所属流程） |\n| `impact` | 爆炸半径分析 — 修改某个符号会影响哪些地方 |\n| `detect_changes` | Git diff 影响映射 |\n| `cypher` | 原始图谱查询语言 |\n| `rename` | 多文件协调重命名 |\n\n**MCP 资源：**\n\n| 资源 | 用途 |\n|------|------|\n| `gitnexus://repo/{name}/context` | 代码库概览 + 索引新鲜度检查 |\n| `gitnexus://repo/{name}/clusters` | 所有功能聚类 |\n| `gitnexus://repo/{name}/processes` | 所有执行流程 |\n| `gitnexus://repo/{name}/schema` | 图谱 Schema（Cypher 查询用） |\n\n---\n\n## 常见问题排查\n\n### \"Not inside a git repository\"（不在 git 仓库中）\n\n```bash\ngit init && git add . && git commit -m \"initial\"\ngitnexus analyze\n```\n\n或使用 `--skip-git` 跳过 git 检查：\n\n```bash\ngitnexus analyze --skip-git\n```\n\n### \"Permission denied\"（npm install -g 权限不足）\n\n改用 npx 免安装运行：\n\n```bash\nnpx gitnexus analyze\n```\n\n### \"Already indexed\"（已索引）\n\n索引已存在且是最新的，无需操作。如需强制重建：\n\n```bash\ngitnexus analyze --force\n```\n\n### \"Node version too old\"（Node 版本过旧）\n\n需要 Node.js >= 22，升级后重试：\n- Windows: `winget install OpenJS.NodeJS.LTS`\n- macOS: `brew install node`\n- Linux: 使用 [nvm](https://github.com/nvm-sh/nvm)\n\n### MCP 工具未出现在 Claude Code / Cursor 中\n\n1. 重新执行 `gitnexus setup`\n2. 重启编辑器\n3. 确认 gitnexus 在 PATH 中：Windows 用 `where gitnexus`，Unix 用 `which gitnexus`\n\n### 索引过期（代码变更后）\n\n```bash\ngitnexus analyze    # 增量更新，保留已有嵌入\ngitnexus analyze --force  # 完全重建\n```\n\n---\n\n## 对话示例\n\n**用户**：\"安装GitNexus\"\n\n执行：\n1. 定位项目根目录\n2. `node --version` → 确认 >= 22\n3. `gitnexus --version` → 未安装 → `npm install -g gitnexus`\n4. `gitnexus setup` → MCP 已配置则跳过\n5. `gitnexus status` → 未索引 → `gitnexus analyze`\n6. `gitnexus status` → 验证成功\n7. 回复用户：\"已索引 N 个符号，生成知识图谱。可通过 context / impact / query 等 MCP 工具查询代码库。\"\n\nFile v1.0.1:_meta.json\n\n{\n  \"ownerId\": \"kn787ypy8qst1csc9zmfk7mqmx87fm55\",\n  \"slug\": \"code-graph\",\n  \"version\": \"1.0.1\",\n  \"publishedAt\": 1779780446279\n}\n\nFile v1.0.1:skill-card.md\n\n## Description: <br>\nInstalls GitNexus, configures MCP integration, and indexes the current project into a code knowledge graph. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[babywhale](https://clawhub.ai/user/babywhale) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers use this skill to install GitNexus, configure MCP access for supported editors, and create or refresh a project code graph for search, context, impact analysis, and refactoring workflows. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The workflow can install GitNexus globally or run it through npx and can update editor/MCP configuration. <br>\nMitigation: Review npm/npx commands before execution and run the setup only when you want GitNexus installed and configured. <br>\nRisk: Troubleshooting guidance includes a git add/commit example that may stage unintended files. <br>\nMitigation: Review .gitignore and staged files before running any git add or commit commands. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/babywhale/code-graph) <br>\n- [Node.js](https://nodejs.org/) <br>\n- [nvm](https://github.com/nvm-sh/nvm) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Text, Markdown, Shell commands, Configuration guidance] <br>\n**Output Format:** [Markdown with inline bash code blocks] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Guides idempotent setup checks before installation, MCP configuration, indexing, and verification.] <br>\n\n## Skill Version(s): <br>\n1.0.1 (source: server release evidence) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>\n\nArchive v1.0.0: 3 files, 4147 bytes\n\nFiles: skill-card.md (2160b), SKILL.md (5251b), _meta.json (129b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: code-graph\ndescription: 为项目构建代码知识图谱，帮助 AI Agent 理解代码结构和依赖关系。当用户说「用 GitNexus 建图」「索引项目」「建图」「分析代码结构」「让 AI 理解这个项目」时使用。\ncategory: software-development\n---\n\n# code-graph（代码图谱）\n\n为项目构建代码知识图谱，帮助 AI Agent 理解代码结构和依赖关系。\n\n## Workflow\n\n### Step 1 — Detect Project Path\n\n```bash\n# Find the project root (look for package.json or .git)\nfind . -maxdepth 3 -name \"package.json\" ! -path \"*/node_modules/*\" 2>/dev/null | head -5\n# or\nls -la .git 2>/dev/null && echo \"Git repo found\"\n```\n\nIf no project found in current directory, check parent directories or ask user for path.\n\n### Step 2 — Install GitNexus\n\n```bash\n# Global installation (recommended for agent use)\nnpm install -g gitnexus\n\n# Verify installation\ngitnexus --version\n```\n\nOr use without installing:\n```bash\nnpx gitnexus --version  # first run will download\n```\n\n### Step 3 — Navigate to Project Root\n\n```bash\ncd /path/to/project\n```\n\n### Step 4 — Index the Project\n\n```bash\n# Standard indexing (parse code + resolve imports + trace calls + detect communities)\ngitnexus analyze\n\n# With embeddings (enables semantic/vector search — slower but more powerful)\ngitnexus analyze --embeddings\n\n# Force re-index (if already indexed before)\ngitnexus analyze --force\n\n# Skip git tracking (for non-git folders)\ngitnexus analyze --skip-git\n```\n\nExpected output:\n```\nScanning files... ✓ (1,247 files)\nParsing code... ✓ (TypeScript, Java, Python, etc.)\nResolving imports... ✓ (3,892 relationships)\nTracing calls... ✓ (104 processes)\nCreating indexes... ✓\nDone! Indexed 30,816 symbols in 12s\n```\n\n### Step 5 — Configure MCP for AI Agents\n\n```bash\ngitnexus setup\n```\n\nThis detects installed editors and writes MCP config. For OpenCode specifically:\n\n**Manual MCP config** (if `gitnexus setup` doesn't detect OpenCode):\n```bash\n# Start GitNexus MCP server\ngitnexus mcp\n```\n\n**OpenCode MCP config** (~/.config/opencode/mcp.json):\n```json\n{\n  \"mcpServers\": {\n    \"gitnexus\": {\n      \"command\": \"gitnexus\",\n      \"args\": [\"mcp\"]\n    }\n  }\n}\n```\n\n**Claude Code MCP config** (~/.claude/mcp.json):\n```json\n{\n  \"mcpServers\": {\n    \"gitnexus\": {\n      \"command\": \"gitnexus\",\n      \"args\": [\"mcp\"]\n    }\n  }\n}\n```\n\n**OpenClaw MCP config** (~/.openclaw/skills/code-graph/\\_meta.json):\n```json\n{\n  \"name\": \"code-graph\",\n  \"description\": \"为项目构建代码知识图谱\",\n  \"tools\": [\"list_repos\", \"query\", \"context\", \"impact\", \"detect_changes\", \"cypher\", \"rename\"]\n}\n```\nOpenClaw 会自动将 `gitnexus mcp` 的输出作为工具注册，无需额外 MCP config 文件。\n\n**Hermes Agent MCP config** (添加到 `~/.hermes/config.yaml` 的 `mcp.servers` 节):\n```yaml\nmcp:\n  servers:\n    gitnexus:\n      command: \"gitnexus\"\n      args: [\"mcp\"]\n```\n配置后重启 Hermes Agent 即可使用 GitNexus 工具。\n\n### Step 6 — Verify\n\n```bash\n# List indexed repositories\ngitnexus list\n\n# Check index status\ngitnexus status\n\n# Query the knowledge graph\ngitnexus cypher \"MATCH (n:Class) WHERE n.name CONTAINS 'Service' RETURN n LIMIT 10\"\n```\n\n## MCP Tools Available After Indexing\n\n| Tool | Purpose |\n|------|---------|\n| `list_repos` | Discover all indexed repositories |\n| `query` | Hybrid search (keyword + semantic) |\n| `context` | 360° view of a symbol (refs, callers, processes) |\n| `impact` | Blast radius — what breaks if I change X |\n| `detect_changes` | Git-diff impact mapping |\n| `cypher` | Raw graph query language |\n| `rename` | Multi-file coordinated rename |\n\n## Example Usage After Indexing\n\n```\nAgent: \"What does UserService depend on?\"\n→ impact({target: \"UserService\", direction: \"upstream\"})\n\nAgent: \"Find all files related to authentication\"\n→ query({q: \"authentication\", mode: \"hybrid\"})\n\nAgent: \"Show me the call chain from API entry to database\"\n→ context({symbol: \"loginHandler\", depth: 5})\n```\n\n## Troubleshooting\n\n**\"Not inside a git repository\"**\n```bash\ngit init && git add . && git commit -m \"initial\"\n# then retry\ngitnexus analyze\n```\n\n**\"Permission denied\" on npm install -g**\n```bash\n# Use npx instead\nnpx gitnexus analyze\n```\n\n**\"Already indexed, use --force to re-index\"**\n```bash\ngitnexus analyze --force\n```\n\n**\"Node version too old\"**\n```bash\nnode --version  # need >= 18\n# Update Node.js then retry\n```\n\n**MCP not connecting in OpenCode**\n1. Restart OpenCode after running `gitnexus setup`\n2. Check MCP config: `cat ~/.config/opencode/mcp.json`\n3. Verify gitnexus is in PATH: `which gitnexus`\n\n## Language Support\n\nGitNexus supports: TypeScript, JavaScript, Python, Java, C, C++, C#, Go, Rust, PHP, Swift, Dart\n\n## Output Location\n\n- **Per-repo index**: `{project}/.gitnexus/` (auto-gitignored)\n- **Global registry**: `~/.gitnexus/registry.json`\n\n## Conversation Example\n\n**User**: \"用 GitNexus 分析一下这个项目\"\n\n1. `find . -maxdepth 3 -name \"package.json\"` → finds project root\n2. `npm install -g gitnexus`\n3. `cd /path/to/project && gitnexus analyze --embeddings`\n4. `gitnexus setup` (if editor detected)\n5. Report: \"已索引 30,816 个符号，生成知识图谱。AI agent 现在可以查询：context/impact/query 等工具均已可用。\"\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn787ypy8qst1csc9zmfk7mqmx87fm55\",\n  \"slug\": \"code-graph\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1779780048029\n}\n\nFile v1.0.0:skill-card.md\n\n## Description: <br>\n为项目构建代码知识图谱，帮助 AI Agent 理解代码结构和依赖关系。 <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[babywhale](https://clawhub.ai/user/babywhale) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and engineers use this skill to install or run GitNexus, index a project, and configure MCP access so an AI agent can query code structure, dependencies, impact, and symbol context. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The skill can lead an agent to install GitNexus, run project indexing, and write persistent project or user configuration files. <br>\nMitigation: Use it only when the user explicitly wants GitNexus setup; prefer npx or project-scoped use and review changes under .gitnexus, ~/.gitnexus, and agent MCP config paths before accepting them. <br>\nRisk: Troubleshooting guidance includes Git commands such as git init, git add ., and git commit that can alter repository state. <br>\nMitigation: Require user confirmation before running setup or Git commands, inspect staged files before any git add ., and avoid automatic commits. <br>\n\n\n## Reference(s): <br>\n- [ClawHub skill page](https://clawhub.ai/babywhale/code-graph) <br>\n- [ClawHub publisher profile](https://clawhub.ai/user/babywhale) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance] <br>\n**Output Format:** [Markdown guidance with bash commands plus JSON and YAML configuration snippets] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [May instruct the agent to install or invoke GitNexus, index a project into .gitnexus, and update MCP configuration files.] <br>\n\n## Skill Version(s): <br>\n1.0.0 (source: server release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment. <br>","readmeExcerpt":"Skill: Code Graph（代码图谱） Owner: babywhale Summary: 一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。 Tags: ai-agent:1.0.1, code-analysis:1.0.1, code-graph:1.0.1, gitnexus:1.0.1, knowledge-graph:1.0.1, latest:1.0.2 Version history: v1.0.2 | 2026-07-15T09:16:40.640Z | user - Removed the file: skill-card.md. - Installation step now specifies installing GitNe","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"git rev-parse --show-toplevel 2>&1 && echo \"已定位到项目根目录\""},{"language":"bash","snippet":"ls package.json 2>&1 || ls pom.xml 2>&1 || ls go.mod 2>&1 || ls Cargo.toml 2>&1 || ls requirements.txt 2>&1 || echo \"未找到项目根目录标志文件\""},{"language":"bash","snippet":"node --version"},{"language":"bash","snippet":"gitnexus --version 2>&1"},{"language":"bash","snippet":"set GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 && npm install -g gitnexus"},{"language":"bash","snippet":"GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 npm install -g gitnexus"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\r\nname: code-graph\r\ndescription: 一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。\r\n---\r\n\r\n# 代码图谱（GitNexus）\r\n\r\n为当前项目一键完成 GitNexus 安装、MCP 配置和知识图谱构建。**每一步都有跳过检测，已完成的步骤不会重复执行。**\r\n\r\n## 语言支持\r\n\r\nTypeScript、JavaScript、Python、Java、C、C++、C#、Go、Rust、PHP、Swift、Dart、Kotlin、Ruby 等 14 种语言。\r\n\r\n---\r\n\r\n## 执行流程\r\n\r\n**按顺序执行以下步骤。每步先检测当前状态，已完成则跳过。**\r\n\r\n### 第 1 步：定位项目根目录\r\n\r\n`gitnexus analyze` 需在项目根目录下执行。首先检查当前工作目录是否即为项目根目录：\r\n\r\n```bash\r\ngit rev-parse --show-toplevel 2>&1 && echo \"已定位到项目根目录\"\r\n```\r\n\r\n如果 Git 未初始化，则通过常见项目标志文件判断：\r\n\r\n```bash\r\nls package.json 2>&1 || ls pom.xml 2>&1 || ls go.mod 2>&1 || ls Cargo.toml 2>&1 || ls requirements.txt 2>&1 || echo \"未找到项目根目录标志文件\"\r\n```\r\n\r\n- 当前目录即为根目录 → 继续下一步\r\n- 检测到其他目录为根目录 → `cd` 到该目录\r\n- 找不到任何项目标志 → 询问用户项目根目录在哪，或使用 `git init` 初始化\r\n\r\n### 第 2 步：检查 Node.js 环境\r\n\r\n```bash\r\nnode --version\r\n```\r\n\r\n**要求 Node.js >= 22。** 如果版本过低或未安装：\r\n\r\n- 引导用户到 [nodejs.org](https://nodejs.org/) 下载 LTS 版本\r\n- Windows 用户也可用 `winget install OpenJS.NodeJS.LTS` 安装\r\n- 升级完成后重新执行本技能\r\n\r\n### 第 3 步：安装 GitNexus\r\n\r\n注意，gitNexus安装时指定1.6.5版本\r\n\r\n**先检测，再决定是否安装：**\r\n\r\n```bash\r\ngitnexus --version 2>&1\r\n```\r\n\r\n**判断逻辑：**\r\n- 输出类似 `1.x.x` 的版本号 → **已安装，跳过本步骤**，直接进入第 4 步\r\n- 输出 `command not found` 或 `not recognized` → 未安装，执行以下安装\r\n\r\n**安装命令（Windows，推荐全局安装）：**\r\n\r\n```bash\r\nset GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 && npm install -g gitnexus@1.6.5\r\n```\r\n\r\n**安装命令（macOS / Linux）：**\r\n\r\n```bash\r\nGITNEXUS_SKIP_OPTIONAL_GRAMMARS=1 npm install -g gitnexus@1.6.5\r\n```\r\n\r\n> `GITNEXUS_SKIP_OPTIONAL_GRAMMARS=1` 跳过 Dart/Proto 原生语法解析器的编译，安装只需几秒，无需 C++ 工具链。\r\n\r\n**权限不足时的回退方案** — 如果全局安装失败（EACCES / Permission denied），后续命令统一改用 `npx` 前缀：\r\n\r\n```bash\r\nnpx gitnexus analyze    # 代替 gitnexus analyze\r\nnpx gitnexus setup      # 代替 gitnexus setup\r\nnpx gitnexus status     # 代替 gitnexus status\r\n```\r\n\r\n### 第 4 步：配置 MCP 服务\r\n\r\n`gitnexus setup` 自动检测已安装的编辑器并写入 MCP 配置，全局只需执行一次。\r\n\r\n**先检测是否已配置：**\r\n\r\n```bash\r\ngitnexus setup 2>&1\r\n```\r\n\r\n**判断逻辑：**\r\n- 输出包含 `already configured`、`up to date`、`MCP configuration exists` 等字样 → **已配置，跳过**\r\n- 输出包含 `wrote`、`created`、`configured`、`Updated` 等字样 → 配置成功\r\n- 若 `gitnexus` 命令不可用（未全局安装），使用 `npx gitnexus setup`\r\n\r\n> `setup` 是幂等的，重复执行不会产生重复配置，可安全地直接运行。\r\n\r\n### 第 5 步：构建知识图谱\r\n\r\n**先检测当前项目是否已索引：**\r\n\r\n```bash\r\ngitnexus status 2>&1\r\n```\r\n\r\n**判断逻辑：**\r\n- 输出包含 `Indexed`、`symbols`、`up to date`、`fresh` 等字样 → **已索引且是最新的，跳过本步骤**\r\n- 输出包含 `Not indexed`、`No index found`、`unknown` 等字样 → 未索引，执行以下命令\r\n- 如果 `gitnexus` 不可用，改用 `npx gitnexus status`\r\n\r\n**执行索引：**\r\n\r\n```bash\r\ngitnexus analyze\r\n```\r\n\r\n此命令解析整个代码库、解析导入关系、追踪调用链、检测代码社区，在项目根目录生成 `.gitnexus/` 索引（自动加入 `.gitignore`）。优先使用gitnexus analyze进行索引，若出现错误则尝试增加选项。\r\n\r\n**如果需要强制重建（已索引但过期）：**\r\n\r\n```bash\r\ngitnexus analyze --force\r\n```\r\n\r\n**常用选项：**\r\n\r\n| 选项 | 用途 |\r\n|------|------|\r\n| `--embeddings` | 启用语义/向量搜索，速度较慢但搜索更强 |\r\n| `--force` | 强制重建索引（索引过期时使用） |\r\n| `--skip-embeddings` | 跳过嵌入生成，大幅加速（默认行为） |\r\n| `--skip-git` | 允许对非 git 目录构建索引 |\r\n| `--skip-agents-md` | 保留自定义的 CLAUDE.md / AGENTS.md |\r\n| `--verbose` | 输出详细日志，包括被跳过的文件 |\r\n| `--"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn787ypy8qst1csc9zmfk7mqmx87fm55\",\n  \"slug\": \"code-graph\",\n  \"version\": \"1.0.2\",\n  \"publishedAt\": 1784107000640\n}"},{"path":"skill-card.md","content":"## Description:\n\nInstalls GitNexus, configures its MCP service, and builds a code knowledge graph for the current project.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[babywhale](https://clawhub.ai/user/babywhale)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and engineers use this skill to set up GitNexus for an existing project, configure MCP integration, index the repository, and verify the resulting code knowledge graph.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Fallback and troubleshooting commands may execute unpinned GitNexus packages through npx.\n\nMitigation: Use the pinned global install command or an explicitly pinned `npx gitnexus@1.6.5` command before running setup, status, or analyze.\n\nRisk: The troubleshooting flow can commit all local files with `git add . && git commit`, which may include secrets or private files.\n\nMitigation: Review `.gitignore`, inspect `git status`, and confirm no sensitive files are staged before committing.\n\n## Reference(s):\n\n- [Node.js](https://nodejs.org/)\n- [nvm](https://github.com/nvm-sh/nvm)\n\n## Skill Output:\n\n**Output Type(s):** [Text, Markdown, Shell commands, Configuration, Guidance]\n\n**Output Format:** [Markdown with inline bash code blocks]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Guides project-root detection, Node.js version checks, GitNexus installation, MCP setup, repository indexing, and verification steps.]\n\n## Skill Version(s):\n\n1.0.2 (source: server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。 Skill: Code Graph（代码图谱） Owner: babywhale Summary: 一键安装 GitNexus 并为当前项目构建代码知识图谱。当用户说「安装GitNexus」「设置GitNexus」「初始化GitNexus」「配置GitNexus」「用GitNexus建图」「GitNexus一键配置」时使用。 Tags: ai-agent:1.0.1, code-analysis:1.0.1, code-graph:1.0.1, gitnexus:1.0.1, knowledge-graph:1.0.1, latest:1.0.2 Version history: v1.0.2 | 2026-07-15T09:16:40.640Z | user - Removed the file: skill-card.md. - Installation step now specifies installing GitNe","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":937,"uniquenessScore":57,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T05:51:45.534Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T05:51:45.534Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T08:40:34.088Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}