nexus-mapper
Generate a persistent .nexus-map/ knowledge base that lets any AI session instantly understand a codebase's architecture, systems, dependencies, and change hotspots. Use when starting work on an unfamiliar repository, onboarding with AI-assisted context, preparing for a major refactoring initiative, or enabling reliable cold-start AI sessions across a team. Produces INDEX.md, systems.md, concept_model.json, git_forensics.md and more. Requires shell execution and Python 3.10+. For ad-hoc file queries or instant impact analysis during active development, use nexus-query instead.
npx skills add majiayu000/claude-skill-registry --skill nexus-mapper --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# nexus-mapper — AI 项目探测协议 本 Skill 指导 AI Agent 使用 **PROBE 五阶段协议**,对任意本地 Git 仓库执行系统性探测,产出 `.nexus-map/` 分层知识库。 --- ## 何时调用 / 何时不调用 | 场景 | 调用 | | ------------------------------------------------------------------- | :---: | | 用户提供本地 repo 路径,希望 AI 理解其架构 | 是 | | 需要生成 `.nexus-map/INDEX.md` 供后续 AI 会话冷启动 | 是 | | 用户说「帮我分析项目」「建立项目知识库」「让 AI 了解这个仓库」 | 是 | | 运行环境无 shell 执行能力(纯 API 调用模式,无 `run_command` 工具) | 否 | | 宿主机无本地 Python 3.10+ | 否 | | 目标仓库无任何已知语言源文件(`.py/.ts/.java/.go/.rs/.cpp` 等均无) | 否 | | 用户只想查询某个特定文件/函数 → 直接用 `view_file` / `grep_search` | 否 | --- ## 前提检查 缺失项要显式告知用户;需要降级等时及时提醒用户,经过同意才能继续。 | 前提 | 检查方式 | | ----------------- | --------------------------------------- | | 目标路径存在 | `$repo_path` 可访问 | | Python 3.10+ | `python --version` >= 3.10 | | 脚本依赖已安装 | `python -c "import tree_sitter"` 无报错 | | 有 shell 执行能力 | Agent 环境支持 `run_command` 工具调用 | `git` 历史是加分项,不是硬阻塞项。没有 `.git` 或历史过少时,跳过热点分析,并在输出中明确记录这是一次降级探测。 --- ## 输入契约 ``` repo_path: 目标仓库的本地绝对路径(必填) ``` **语言支持**:自动按文件扩展名 dispatch,语言配置(扩展名映射 + Tree-sitter 查询)存储在 `scripts/languages.json`。当前已接入 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/Sv
- 何时调用 / 何时不调用
- 前提检查
- 输入契约
- 输出格式
- PROBE 阶段门控
- 执行守则
- 守则1: OBJECT 拒绝形式主义
- 守则2: implemented 节点必须有真实 codepath
- 守则3: EMIT 原子性
- 守则4: INDEX.md 的角色——冷启动路由器,而非静态字典
- 守则5: 最小执行面与敏感信息保护
- 守则6: 降级与人工推断必须显式可见
- 不确定性表达规范
- 脚本工具链
BENCHMARK 阶段验证方式 ls $repo_path/src/nexus/application/weaving/ # 目录存在 → 节点有效 ls $repo_path/src/nexus/application/nonexist/ # [!ERROR] → 修正或删除此节点 PROFILE 阶段 — 基础用法 python $SKILL_DIR/scripts/extract_ast.py <repo_path> [--max-nodes 500] \ pip install -r $SKILL_DIR/scripts/requirements.txt python $SKILL_DIR/scripts/query_graph.py <ast_nodes.json> --file <path> # 文件骨架 python $SKILL_DIR/scripts/query_graph.py <ast_nodes.json> --who-imports <mod> # 反向依赖 python $SKILL_DIR/scripts/query_graph.py <ast_nodes.json> --impact <path> # 影响半径 python $SKILL_DIR/scripts/query_graph.py <ast_nodes.json> --impact <path> --git-stats <git_stats.json>
What does the nexus-mapper skill do?
Generate a persistent .nexus-map/ knowledge base that lets any AI session instantly understand a codebase's architecture, systems, dependencies, and change hotspots. Use when starting work on an unfamiliar repository, onboarding with AI-assisted context, preparing for a major refactoring initiative, or enabling reliable cold-start AI sessions across a team. Produces INDEX.md, systems.md, concept_model.json, git_forensics.md and more. Requires shell execution and Python 3.10+. For ad-hoc file queries or instant impact analysis during active development, use nexus-query instead.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill nexus-mapper --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
