Loading...
Loading...
Compare original and translation side by side
"你不是在写代码文档。你是在为下一个接手的 AI 建立思维基础。"
.nexus-map/"You are not writing code documentation. You are building a cognitive foundation for the next AI that takes over this project."
.nexus-map/[!IMPORTANT] 在 PROFILE、REASON、OBJECT、BENCHMARK 完成前,不得产出最终。.nexus-map/这不是为了形式完整,而是为了防止 AI 把第一眼假设直接写成结论。最终产物必须建立在脚本输出、仓库结构、反证挑战和回查验证之上。
concept_model.jsonimplementedcode_pathplanned/inferredcode_path[!IMPORTANT] You must not produce the finaluntil PROFILE, REASON, OBJECT, and BENCHMARK are completed..nexus-map/This is not for formal completeness, but to prevent the AI from directly writing first-glance assumptions as conclusions. The final output must be based on script outputs, repository structure, counterevidence challenges, and review verification.
concept_model.jsoncode_pathimplementedplanned/inferredcode_path| 场景 | 调用 |
|---|---|
| 用户提供本地 repo 路径,希望 AI 理解其架构 | ✅ |
需要生成 | ✅ |
| 用户说「帮我分析项目」「建立项目知识库」「让 AI 了解这个仓库」 | ✅ |
运行环境无 shell 执行能力(纯 API 调用模式,无 | ❌ |
| 宿主机无本地 Python 3.10+ | ❌ |
目标仓库无任何已知语言源文件( | ❌ |
用户只想查询某个特定文件/函数 → 直接用 | ❌ |
| Scenario | Call |
|---|---|
| User provides a local repo path and wants the AI to understand its architecture | ✅ |
Need to generate | ✅ |
| User says "help me analyze the project", "build a project knowledge base", "let the AI understand this repository" | ✅ |
No shell execution capability in the runtime environment (pure API call mode, no | ❌ |
| No local Python 3.10+ on the host machine | ❌ |
No known language source files in the target repository (none of | ❌ |
User only wants to query a specific file/function → directly use | ❌ |
| 前提 | 检查方式 |
|---|---|
| 目标路径存在 | |
| Python 3.10+ | |
| 脚本依赖已安装 | |
| 有 shell 执行能力 | Agent 环境支持 |
git.git| Prerequisite | Check Method |
|---|---|
| Target path exists | |
| Python 3.10+ | |
| Script dependencies installed | |
| Shell execution capability | Agent environment supports |
git.gitrepo_path: 目标仓库的本地绝对路径(必填)scripts/languages.jsonmodule-only coverage--add-extension .templ=templ--add-query templ struct "(component_declaration ...)"--add-query <LANG> <TYPE> <QUERY_STRING><TYPE>structimports--language-config <JSON_FILE>references/05-language-customization.mdrepo_path: Local absolute path of the target repository (required)scripts/languages.jsonmodule-only coverage--add-extension .templ=templ--add-query templ struct "(component_declaration ...)"--add-query <LANG> <TYPE> <QUERY_STRING><TYPE>structimports--language-config <JSON_FILE>references/05-language-customization.md.nexus-map/
├── INDEX.md ← AI 冷启动主入口(< 2000 tokens)
├── arch/
│ ├── systems.md ← 系统边界 + 代码位置
│ ├── dependencies.md ← Mermaid 依赖图 + 时序图
│ └── test_coverage.md ← 静态测试面:测试文件、覆盖到的核心模块、证据缺口
├── concepts/
│ ├── concept_model.json ← Schema V1 机器可读图谱
│ └── domains.md ← 核心领域概念说明
├── hotspots/
│ └── git_forensics.md ← Git 热点 + 耦合对分析
└── raw/
├── ast_nodes.json ← Tree-sitter 解析原始数据
├── git_stats.json ← Git 热点与耦合数据
└── file_tree.txt ← 过滤后的文件树generated_byverified_atprovenanceconcept_model.jsonlabeltitletitlelabelprovenancemodule-only coverageconfigured-but-unavailable.nexus-map/
├── INDEX.md ← AI cold-start main entry (< 2000 tokens)
├── arch/
│ ├── systems.md ← System boundaries + code locations
│ ├── dependencies.md ← Mermaid dependency graph + sequence diagram
│ └── test_coverage.md ← Static test surface: test files, covered core modules, evidence gaps
├── concepts/
│ ├── concept_model.json ← Schema V1 machine-readable graph
│ └── domains.md ← Core domain concept explanations
├── hotspots/
│ └── git_forensics.md ← Git hotspots + coupling pair analysis
└── raw/
├── ast_nodes.json ← Tree-sitter parsed raw data
├── git_stats.json ← Git hotspot and coupling data
└── file_tree.txt ← Filtered file treegenerated_byverified_atprovenanceconcept_model.jsonlabeltitletitlelabelprovenancemodule-only coverageconfigured-but-unavailablescripts/query_graph.pyraw/ast_nodes.jsonast_nodes.jsonscripts/query_graph.pyraw/ast_nodes.jsonast_nodes.jsonundefinedundefinedundefinedundefined| 阶段 | 推荐查询 | 用途 |
|---|---|---|
| REASON | | 用扇入/扇出数据验证核心系统假说,而不是仅凭目录名猜测 |
| OBJECT | | 验证边界假设,查看真实上下游依赖;叠加 git 热度和耦合度 |
| EMIT | | 生成 |
| 开发中 | | Bug 调查、修改影响评估、重构分析 |
定位:是"地图",.nexus-map/是"放大镜"。地图帮你定位大方向,放大镜帮你看清局部细节。query_graph.py
五个查询模式的详细使用场景与实战案例,见。references/06-query-guide.md
| Phase | Recommended Query | Purpose |
|---|---|---|
| REASON | | Verify core system hypotheses using fan-in/fan-out data instead of guessing based on directory names |
| OBJECT | | Verify boundary assumptions, view real upstream and downstream dependencies; overlay git heat and coupling degree |
| EMIT | | Provide data support for generating |
| During Development | | Bug investigation, modification impact assessment, refactoring analysis |
Positioning:is the "map", and.nexus-map/is the "magnifying glass". The map helps you locate the general direction, while the magnifying glass helps you see local details clearly.query_graph.py
Detailed usage scenarios and practical cases for the five query modes can be found in.references/06-query-guide.md
AGENTS.mdCLAUDE.md如果仓库中存在 .nexus-map/INDEX.md,开始任务前必须先阅读它恢复全局上下文。
如果任务需要判断局部结构、依赖关系、影响半径或边界归属,优先回读 nexus-mapper skill 的按需查询说明,并使用 query_graph.py 基于 .nexus-map/raw/ast_nodes.json 做验证;不要重新猜结构。
当一次任务改变了项目的结构认知时,应在交付前评估是否同步更新 .nexus-map。结构认知包括:系统边界、入口、依赖关系、测试面、语言支持、路线图或阶段性进度事实。纯局部实现细节默认不更新。
不要把 .nexus-map 视为静态文档;它是项目记忆的一部分。新对话优先读取,重要变更后按需同步。.nexus-mapAGENTS.mdCLAUDE.mdIf .nexus-map/INDEX.md exists in the repository, you must read it first to restore global context before starting any task.
If a task requires judging local structure, dependency relationships, impact radius, or boundary attribution, prioritize reviewing the on-demand query instructions of the nexus-mapper skill and use query_graph.py to verify based on .nexus-map/raw/ast_nodes.json; do not re-guess the structure.
When a task changes the project's structural cognition, evaluate whether to synchronously update .nexus-map before delivery. Structural cognition includes: system boundaries, entry points, dependency relationships, test surfaces, language support, roadmaps, or phased progress facts. Pure local implementation details do not require updates by default.
Do not treat .nexus-map as static documentation; it is part of the project's memory. New conversations should read it first, and it should be updated on demand after important changes..nexus-map[!IMPORTANT] 进入每个阶段前必须对应 reference,不得跳过。 各阶段详细步骤、完成检查清单与边界场景处理均在 reference 中定义。read_file
[Skill 激活时] → read_file references/01-probe-protocol.md (阶段步骤蓝图)
[REASON 前] → read_file references/03-edge-cases.md (边界场景检查)
[OBJECT 前] → read_file references/04-object-framework.md (三维度质疑模板)
[EMIT 前] → read_file references/02-output-schema.md (Schema 校验规范)[!IMPORTANT] You mustthe corresponding reference before entering each phase; do not skip it. Detailed steps, completion checklists, and boundary scenario handling for each phase are defined in the references.read_file
[When Skill is activated] → read_file references/01-probe-protocol.md (Phase step blueprint)
[Before REASON] → read_file references/03-edge-cases.md (Boundary scenario check)
[Before OBJECT] → read_file references/04-object-framework.md (3-dimensional questioning template)
[Before EMIT] → read_file references/02-output-schema.md (Schema verification specifications)Q1: 我对系统结构的把握还不够扎实
Q2: xxx 目录的职责暂时没有直接证据Q1: git_stats 显示 tasks/analysis_tasks.py 变更 21 次(high risk),
但 HYPOTHESIS 认为编排入口是 evolution/detective_loop.py。
矛盾:若 detective_loop 是入口,为何 analysis_tasks 热度更高?
证据线索: git_stats.json hotspots[0].path
验证计划: view tasks/analysis_tasks.py 的 class 定义 + import 树Q1: My grasp of the system structure is not solid enough
Q2: The responsibility of the xxx directory has no direct evidence for nowQ1: git_stats shows that tasks/analysis_tasks.py has been changed 21 times (high risk),
but the HYPOTHESIS considers evolution/detective_loop.py as the orchestration entry point.
Contradiction: If detective_loop is the entry point, why is analysis_tasks more frequently modified?
Evidence Clue: git_stats.json hotspots[0].path
Verification Plan: View the class definition + import tree of tasks/analysis_tasks.pyimplementedcode_path[!IMPORTANT] 写入前,必须先区分节点是concept_model.json、implemented还是planned。 只有inferred节点允许写入implemented,且必须亲手验证存在。code_path
undefined[!IMPORTANT] Before writing to, you must first distinguish whether a node isconcept_model.json,implemented, orplanned. Onlyinferrednodes are allowed to haveimplementedwritten, and you must personally verify its existence.code_path
undefined
对于 `planned` 或 `inferred` 节点,使用:
```json
{
"implementation_status": "planned",
"code_path": null,
"evidence_path": "docs/architecture.md",
"evidence_gap": "仓库中未发现 src/agents/monarch/,仅在设计文档中出现"
}code_pathimplementation_statusplanned/inferredcode_path: "PLANNED"
For `planned` or `inferred` nodes, use:
```json
{
"implementation_status": "planned",
"code_path": null,
"evidence_path": "docs/architecture.md",
"evidence_gap": "src/agents/monarch/ not found in the repository, only mentioned in design documents"
}code_pathimplementation_statusplanned/inferredcode_path: "PLANNED".nexus-map/.tmp/.tmp/.tmp/| 状态 | 处理方式 |
|---|---|
| 直接继续 |
| 询问用户:「是否覆盖?[y/n]」 |
| 「检测到未完成分析,将重新生成」,直接继续 |
.nexus-map/.tmp/.tmp/.tmp/| Status | Handling Method |
|---|---|
| Proceed directly |
| Ask the user: "Overwrite? [y/n]" |
| "Incomplete analysis detected, will regenerate", proceed directly |
INDEX.mdevidence gapunknownINDEX.mdevidence gapunknown避免只写:待确认 · 可能是 · 疑似 · 也许 · 待定 · 暂不清楚 · 需要进一步 · 不确定
避免只写:pending · maybe · possibly · perhaps · TBD · to be confirmedunknown: 未发现直接证据表明 api/ 是主入口,当前仅能确认 cli.py 被 README 引用evidence gap: 仓库没有 git 历史,因此 hotspots 部分跳过Avoid writing only: to be confirmed · may be · suspected · perhaps · pending · unclear · need further · uncertain
Avoid writing only: pending · maybe · possibly · perhaps · TBD · to be confirmedunknown: No direct evidence found indicating api/ is the main entry; currently only confirmed that cli.py is referenced in READMEevidence gap: No git history in the repository, so the hotspots section is skipped[!IMPORTANT] 默认只运行本 Skill 自带脚本和必要的只读检查。不要因为“想更懂仓库”就执行目标仓库里的构建脚本、测试脚本或自定义命令。
extract_ast.pygit_detective.pynpm installpnpm devpython main.pydocker compose up.env[!IMPORTANT] By default, only run scripts included with this Skill and necessary read-only checks. Do not execute build scripts, test scripts, or custom commands in the target repository just because "you want to understand the repository better".
extract_ast.pygit_detective.pynpm installpnpm devpython main.pydocker compose up.env[!IMPORTANT] 如果 AST 覆盖不完整,或者某部分依赖图/系统边界来自人工阅读而非脚本产出,必须在最终文件中显式标注 provenance。
dependencies.mdinferred from file tree/manual inspectiondomains.mdsystems.mdINDEX.mdunsupported language downgradeverified_at[!IMPORTANT] If AST coverage is incomplete, or if part of the dependency graph/system boundary comes from manual reading rather than script output, you must explicitly mark the provenance in the final file.
dependencies.mdinferred from file tree/manual inspectiondomains.mdsystems.mdINDEX.mdunsupported language downgradeverified_atundefinedundefined<repo_path>/.nexus-map/raw/ast_nodes.json
<repo_path>/.nexus-map/raw/ast_nodes.json
<repo_path>/.nexus-map/raw/ast_nodes.json
<repo_path>/.nexus-map/raw/ast_nodes.json
<repo_path>/.nexus-map/raw/ast_nodes.json
<repo_path>/.nexus-map/raw/ast_nodes.json
<repo_path>/.nexus-map/raw/ast_nodes.json
**依赖安装(首次使用)**:
```bash
pip install -r $SKILL_DIR/scripts/requirements.txt<repo_path>/.nexus-map/raw/ast_nodes.json
**Dependency Installation (First Use)**:
```bash
pip install -r $SKILL_DIR/scripts/requirements.txtimplementedcode_pathplanned/inferredimplementation_status + evidence_path + evidence_gapresponsibilityINDEX.mdarch/test_coverage.mdcode_pathimplementedplanned/inferredimplementation_status + evidence_path + evidence_gapresponsibilityINDEX.mdarch/test_coverage.md