graph-search

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Search Code Knowledge Graph

搜索代码知识图谱

Search
.gauntlet/graph.db
for code entities by name.
通过名称搜索
.gauntlet/graph.db
中的代码实体。

Steps

步骤

  1. Accept query: Get the search term from the user.
  2. Run the query script:
    bash
    python3 ${CLAUDE_PLUGIN_ROOT}/scripts/graph_query.py \
        --action search --query "<term>" --limit 20
    Optional filters:
    • --kind Function
      to search only functions
    • --kind Class
      to search only classes
  3. Display results: Show qualified name, file path, line numbers, and relevance score for each match.
  4. Offer to read: Ask if the user wants to read the top result's source file.
  1. 接收查询:获取用户输入的搜索词。
  2. 运行查询脚本
    bash
    python3 ${CLAUDE_PLUGIN_ROOT}/scripts/graph_query.py \
        --action search --query "<term>" --limit 20
    可选筛选条件:
    • --kind Function
      :仅搜索函数
    • --kind Class
      :仅搜索类
  3. 展示结果:显示每个匹配项的限定名称、文件路径、行号和相关性评分。
  4. 提供读取选项:询问用户是否要读取排名第一的结果对应的源文件。

Query Intelligence

查询智能

The search engine detects query patterns:
  • PascalCase (e.g.,
    UserService
    ): boosts Class and Type results
  • snake_case (e.g.,
    get_users
    ): boosts Function results
  • Dotted path (e.g.,
    app.models.User
    ): boosts qualified name matches
搜索引擎可识别查询模式:
  • PascalCase(例如:
    UserService
    ):提升类和类型结果的权重
  • snake_case(例如:
    get_users
    ):提升函数结果的权重
  • 点路径(例如:
    app.models.User
    ):提升限定名称匹配的权重

Prerequisites

前置条件

The graph must be built first. If
.gauntlet/graph.db
does not exist, suggest running the
graph-build
skill.
必须先构建图谱。如果
.gauntlet/graph.db
不存在,建议运行
graph-build
技能。