SuperAPI AI 工具集

nexus-mapper

通用与其它

查看项目

更新于 10-15 22:11

技能介绍

用途:nexus-mapper 指导 AI Agent 对本地 Git 仓库执行系统性探测,产出 .nexus-map/ 分层知识库,供后续 AI 会话冷启动理解架构、系统边界、依赖与变更热点。适用于用户提供本地 repo 路径、需要生成 INDEX.md 或要求建立项目知识库的场景;无 shell 执行能力、无 Python 3.10+、仓库无已知语言源文件或仅查询单个文件/函数时不适用。

主要能力:按文件扩展名自动 dispatch,内置 30+ 语言(Python、JavaScript、TypeScript、TSX、Bash、Java、Go、Rust、C#、C/C++、Kotlin、Ruby、Swift、Scala、PHP、Lua、Elixir、GDScript、Dart、Haskell、Clojure、SQL、Proto、Solidity、Vue、Svelte、R、Perl 等),语言配置存于 scripts/languages.json。输出 .nexus-map/ 目录,含 INDEX.md(冷启动主入口,<2000 tokens)、arch/(systems.md、dependencies.md、test_coverage.md)、concepts/(concept_model.json、domains.md)、hotspots/git_forensics.md、raw/(ast_nodes.json、git_stats.json、file_tree.txt)。

使用方式:前提检查包括目标路径存在、python --version >= 3.10、python -c "import tree_sitter" 无报错、Agent 支持 run_command。首次安装依赖:pip install -r $SKILL_DIR/scripts/requirements.txt。基础用法:python $SKILL_DIR/scripts/extract_ast.py <repo_path> [--max-nodes 500] --file-tree-out <repo_path>/.nexus-map/raw/file_tree.txt > <repo_path>/.nexus-map/raw/ast_nodes.json。支持 --exclude-dirs、--use-gitignore/--no-gitignore、--add-extension、--add-query、--language-config 等参数。查询工具:python $SKILL_DIR/scripts/query_graph.py <ast_nodes.json> --file/--who-imports/--impact/--hub-analysis/--summary。

限制:git 历史为加分项,缺失时跳过热点分析并记录降级探测;非 AST 支持的依赖须标注 inferred;implemented 节点必须有真实 code_path;EMIT 采用 .tmp/ 原子写入;默认禁止执行目标仓库的构建、测试或自定义命令;遇 .env、密钥只记录存在与用途,不抄出具体值。