/ 目录 / 演练场 / Understand-Anything
● 社区 Lum1104 ⚡ 即开即用

Understand-Anything

作者 Lum1104 · Lum1104/Understand-Anything

任意代码库的可视化入门——结构图和领域知识图谱,教会你理解系统,而不只是画出来。

Understand-Anything 将代码库和知识库转化为可交互的图谱。双层视图:结构层(文件/函数/类)和领域层(业务流程/数据流)。包含语义搜索(「什么处理了 auth?」)、变更影响分析和自适应详细程度。专为新成员入职和架构理解而设计,而非单纯的漂亮图片。

为什么要用

核心特性

实时演示

实际使用效果

就绪

安装

选择你的客户端

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

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "understand-anything-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Lum1104/Understand-Anything",
        "~/.claude/skills/understand-anything"
      ],
      "_inferred": true
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "understand-anything-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Lum1104/Understand-Anything",
        "~/.claude/skills/understand-anything"
      ],
      "_inferred": true
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "understand-anything-skill": {
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Lum1104/Understand-Anything",
        "~/.claude/skills/understand-anything"
      ],
      "_inferred": true
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "understand-anything-skill",
      "command": "git",
      "args": [
        "clone",
        "https://github.com/Lum1104/Understand-Anything",
        "~/.claude/skills/understand-anything"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "understand-anything-skill": {
      "command": {
        "path": "git",
        "args": [
          "clone",
          "https://github.com/Lum1104/Understand-Anything",
          "~/.claude/skills/understand-anything"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add understand-anything-skill -- git clone https://github.com/Lum1104/Understand-Anything ~/.claude/skills/understand-anything

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: Understand-Anything

帮助新工程师入职一个 20 万行的代码库

👤 负责入职的技术负责人,或独立采用项目的开发者 ⏱ ~60 min intermediate

何时使用: 接手新仓库,你有一周时间让自己高效起来。

前置条件
  • Skill 已安装 — git clone https://github.com/Lum1104/Understand-Anything ~/.claude/skills/understand-anything
步骤
  1. 索引仓库
    Use understand-anything. Build the structural graph for ./repo and the domain graph from /docs.✓ 已复制
    → 图谱统计(节点数、边数、密度)
  2. 找到核心接缝
    Highlight the 5 most-connected modules — likely architectural seams.✓ 已复制
    → 带理由的排名列表
  3. 追踪一个功能
    Walk me through 'create checkout' end-to-end across structural + domain graphs.✓ 已复制
    → 经过节点的注释路径;解释业务和技术层面的跳转

结果: 几天而非几周就能高效产出;有针对性地阅读,而非蛮力刷代码。

注意事项
  • 图谱太密无法阅读 — 按目录或功能过滤;技能支持自适应详细程度
搭配使用: filesystem

开 PR 前预测变更影响

👤 即将修改共享代码的开发者 ⏱ ~25 min intermediate

何时使用: 你即将重构一个「感觉很核心」的模块。

步骤
  1. 定义变更
    Use understand-anything. I'll change the signature of calculateTax(price, region) to add a customer_class. What breaks?✓ 已复制
    → 需要更新的调用方和测试列表
  2. 可视化影响范围
    Show me the subgraph touched by this change.✓ 已复制
    → 高亮显示的子图,每条边附有严重程度
  3. 规划 PR
    Propose a PR sequence that minimizes review surface — which files first?✓ 已复制
    → 带理由的有序文件列表

结果: PR 大小适合人工审查,而非一个 1500 行的庞然大物。

注意事项
  • 图谱遗漏了仅运行时存在的调用方(反射、动态分发) — 用函数名进行 grep 交叉验证;另外列出运行时调用方

将 wiki 转化为知识图谱

👤 拥有庞大 wiki 的研究人员/团队 ⏱ ~45 min intermediate

何时使用: 你的团队有 200 页 wiki,没人能找到任何东西。

步骤
  1. 录入页面
    Use understand-anything. Build a knowledge graph from /wiki/. Extract entities and implicit relationships.✓ 已复制
    → 图谱含实体类型和关系类型
  2. 找到死结
    Which entities are referenced but never defined?✓ 已复制
    → 需要补充页面的存根主题列表
  3. 建议重组方案
    Based on cluster structure, propose a 5-section TOC.✓ 已复制
    → 各分区列表及对应页面分配

结果: 真正可导航的 wiki。

注意事项
  • 隐式关系产生噪音(每个页面都提到「API」) — 调整提取器的停用词列表;技能为常见噪音词提供了配置接口
搭配使用: filesystem

组合

与其他 MCP 搭配,撬动十倍杠杆

understand-anything-skill + filesystem

持久化生成的图谱供团队复用

Save the graph to .claude/graphs/ and check in. Refresh on each main merge.✓ 已复制
understand-anything-skill + git-mcp-idosal

无需本地克隆,直接为远程公开仓库构建图谱

Use gitmcp for the repo source; pipe into understand-anything to build the graph in memory.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
build_structural_graph repo_path, languages? 接触新仓库的第一步 0
build_domain_graph docs_path 与结构图配合使用,获得完整视图 0
semantic_search intent_query 「什么处理了 X?」——按含义查找 0
impact_analysis node_id, change_kind PR 前的变更影响评估 0
feature_walkthrough feature_name 入职 / 学习模式 0

成本与限制

运行它的成本

API 配额
无——本地技能
每次调用 Token 数
图谱构建成本低;查询返回 200–1500 token,具体取决于子图大小
费用
免费
提示
每次 main 分支合并后构建一次并缓存;大型重构后再重建

安全

权限、密钥、影响范围

最小权限: filesystem-read
凭据存储:
数据出站:

故障排查

常见错误与修复

大型仓库构建缓慢

传入 --include 和 --exclude 限制范围;跳过 generated/vendor 目录

跨语言调用缺失

技能最适合单语言仓库;多语言项目请分别构建图谱再手动关联

领域图谱为空

/docs 路径的内容未被提取器识别;尝试使用 /README + /design-docs

输出太密无法阅读

降低详细程度;或过滤到某功能子图,而非全图视图

替代方案

Understand-Anything 对比其他方案

替代方案何时用它替代权衡
graphify-skill你想要更轻量的代码图谱技能领域图谱能力较弱
Sourcegraph你需要企业级代码搜索和图形化界面付费;配置成本高

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills