SuperAPI AI 工具集

understand-chat

通用与其它

查看项目

更新于 10-15 22:16

技能介绍

用途:当需要就某个代码库提问、或借助知识图谱理解代码时使用。它通过读取项目根目录的 .understand-anything/knowledge-graph.json 来回答与代码库相关的问题。

主要能力:知识图谱包含 project(名称、描述、语言、框架、分析时间、git 提交哈希)、nodes(id、type、name、filePath、summary、tags、complexity 等)、edges(source、target、type、direction、weight)、layers 和 tour。节点类型涵盖代码类(file、function、class、module、concept)、非代码类(config、document、service、table、endpoint、pipeline、schema、resource)以及领域知识类(domain、flow、step、article、entity、topic、claim、source)。边类型包括 imports、contains、calls、depends_on、configures、documents、deploys、triggers、contains_flow、flow_step、related、cites。

使用方式:先确认知识图谱文件存在,若不存在则提示用户先运行 /understand。仅读取 project 元数据获取上下文;用 Grep 在图中搜索查询关键词,匹配 name、summary、tags 字段并记录节点 id;再按 id 在 edges 中查找上下游连接,得到 1 跳子图;同时查看 layers 判断所属架构层。最后仅依据相关子图作答,引用具体文件、函数和关系,说明相关层及原因。若查询无匹配节点,应说明并建议图中相关术语。

限制:依赖已生成的知识图谱文件;需避免把整个图读入上下文,应先用 Grep 定位再按需读取。其余细节暂未提供。