build-graph

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Build Graph

构建图谱

Build or incrementally update the persistent code knowledge graph for this repository.
构建或增量更新当前仓库的持久化代码知识图谱。

Steps

步骤

  1. Check graph status by calling the
    list_graph_stats_tool
    MCP tool.
    • If the graph has never been built (last_updated is null), proceed with a full build.
    • If the graph exists, proceed with an incremental update.
  2. Build the graph by calling the
    build_or_update_graph_tool
    MCP tool:
    • For first-time setup:
      build_or_update_graph_tool(full_rebuild=True)
    • For updates:
      build_or_update_graph_tool()
      (incremental by default)
  3. Verify by calling
    list_graph_stats_tool
    again and report the results:
    • Number of files parsed
    • Number of nodes and edges created
    • Languages detected
    • Any errors encountered
  1. 检查图谱状态:调用
    list_graph_stats_tool
    MCP工具。
    • 若图谱从未构建(last_updated为null),则执行完整构建。
    • 若图谱已存在,则执行增量更新。
  2. 构建图谱:调用
    build_or_update_graph_tool
    MCP工具:
    • 首次设置:
      build_or_update_graph_tool(full_rebuild=True)
    • 更新操作:
      build_or_update_graph_tool()
      (默认增量更新)
  3. 验证:再次调用
    list_graph_stats_tool
    并报告结果:
    • 已解析文件数量
    • 创建的节点和边数量
    • 检测到的编程语言
    • 遇到的任何错误

When to Use

使用场景

  • First time setting up the graph for a repository
  • After major refactoring or branch switches
  • If the graph seems stale or out of sync
  • The graph auto-updates via hooks on edit/commit, so manual builds are rarely needed
  • 首次为仓库设置图谱时
  • 完成重大重构或分支切换后
  • 图谱显示过时或不同步时
  • 图谱会在编辑/提交时通过钩子自动更新,因此很少需要手动构建

Notes

注意事项

  • The graph is stored as a SQLite database (
    .code-review-graph/graph.db
    ) in the repo root
  • Binary files, generated files, and patterns in
    .code-review-graphignore
    are skipped
  • Supported languages: Python, TypeScript/JavaScript, Vue, Go, Rust, Java, Scala, C#, Ruby, Kotlin, Swift, PHP, Solidity, C/C++
  • 图谱存储在仓库根目录的SQLite数据库(
    .code-review-graph/graph.db
    )中
  • 二进制文件、生成文件以及
    .code-review-graphignore
    中指定的模式会被跳过
  • 支持的语言:Python、TypeScript/JavaScript、Vue、Go、Rust、Java、Scala、C#、Ruby、Kotlin、Swift、PHP、Solidity、C/C++