SuperAPI AI 工具集

cartograph

通用与其它

查看项目

更新于 10-16 07:23

技能介绍

Cartograph 用于为代码库生成结构化地图,提取 surfaces(页面/入口点)、features(可独立能力)、entities(数据对象与关系)、operations、flows、compartments(逻辑文件分组)、invariants 与技术栈清单,并附带代码健康度指标。

工作流默认执行 Full Scan,包含 Discover、Extract、Analyze、Assemble 四步。若消息明确要求,则切换到 Add Invariant 或 Standalone Verify 流程。

主要能力:Discover 读取 package.json、schema、路由/页面、server actions、组件与 lib/services,检测技术栈并收集非生成文件清单;Extract 并行提取 surfaces、entities 与 relationships、features、operations、flows、compartments、File Tree Weights、Compartment Dependencies;Analyze 评估 co-location、DRYness、Dead Code,并在仓库根存在 cartograph-invariants.md 时验证 invariants;Assemble 将结果合并写入 .cartograph/mapping.json,并生成 codeHealth。

用法:通过消息触发,默认完整扫描;需新增不变量时说 add invariant / new invariant;需验证时说 verify / check invariants / run invariants。

限制:invariants 仅在仓库根存在 cartograph-invariants.md 时运行,否则省略该键;需排除 generated/、node_modules/、.next/、dist/;每个非生成文件须至少归入一个 compartment;File Tree Weights 中权重须合计为 1.0;低于 100 分的指标必须给出具体 findings,否则视为输出缺陷。未提供的收费、平台、安装命令等信息暂未提供。