semantic-atlas 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.agents/skills/semantic-atlas/SKILL.md +8 -0
  2. package/README.md +192 -244
  3. package/README.zh-CN.md +159 -220
  4. package/dist/cli/run-cli.d.ts.map +1 -1
  5. package/dist/cli/run-cli.js +3 -0
  6. package/dist/cli/run-cli.js.map +1 -1
  7. package/dist/i18n/index.d.ts +12 -0
  8. package/dist/i18n/index.d.ts.map +1 -1
  9. package/dist/i18n/locales/en/cli.d.ts +2 -0
  10. package/dist/i18n/locales/en/cli.d.ts.map +1 -1
  11. package/dist/i18n/locales/en/cli.js +2 -0
  12. package/dist/i18n/locales/en/cli.js.map +1 -1
  13. package/dist/i18n/locales/en/viewer.d.ts +4 -0
  14. package/dist/i18n/locales/en/viewer.d.ts.map +1 -1
  15. package/dist/i18n/locales/en/viewer.js +4 -0
  16. package/dist/i18n/locales/en/viewer.js.map +1 -1
  17. package/dist/i18n/locales/zh-CN/cli.d.ts +2 -0
  18. package/dist/i18n/locales/zh-CN/cli.d.ts.map +1 -1
  19. package/dist/i18n/locales/zh-CN/cli.js +2 -0
  20. package/dist/i18n/locales/zh-CN/cli.js.map +1 -1
  21. package/dist/i18n/locales/zh-CN/viewer.d.ts +4 -0
  22. package/dist/i18n/locales/zh-CN/viewer.d.ts.map +1 -1
  23. package/dist/i18n/locales/zh-CN/viewer.js +4 -0
  24. package/dist/i18n/locales/zh-CN/viewer.js.map +1 -1
  25. package/dist/rendering/flow-projector.js +5 -2
  26. package/dist/rendering/flow-projector.js.map +1 -1
  27. package/dist/rendering/viewer-browser.d.ts.map +1 -1
  28. package/dist/rendering/viewer-browser.js +76 -17
  29. package/dist/rendering/viewer-browser.js.map +1 -1
  30. package/dist/rendering/viewer-layout.d.ts.map +1 -1
  31. package/dist/rendering/viewer-layout.js +81 -13
  32. package/dist/rendering/viewer-layout.js.map +1 -1
  33. package/dist/rendering/viewer-location.d.ts +7 -0
  34. package/dist/rendering/viewer-location.d.ts.map +1 -0
  35. package/dist/rendering/viewer-location.js +16 -0
  36. package/dist/rendering/viewer-location.js.map +1 -0
  37. package/dist/rendering/viewer-page.js +4 -1
  38. package/dist/rendering/viewer-page.js.map +1 -1
  39. package/dist/web/local-web-application.d.ts +1 -0
  40. package/dist/web/local-web-application.d.ts.map +1 -1
  41. package/dist/web/local-web-application.js +14 -0
  42. package/dist/web/local-web-application.js.map +1 -1
  43. package/dist/web/web-command-service.d.ts +1 -0
  44. package/dist/web/web-command-service.d.ts.map +1 -1
  45. package/dist/web/web-command-service.js +4 -2
  46. package/dist/web/web-command-service.js.map +1 -1
  47. package/docs/architecture.md +24 -2
  48. package/docs/evaluation.md +6 -0
  49. package/docs/map-format.md +9 -0
  50. package/docs/product-contract.md +19 -4
  51. package/package.json +1 -1
@@ -162,4 +162,12 @@ YAML 中应维护的声明。`scope: "recorded"` 表示只反映已记录关系
162
162
 
163
163
  ## 7. 交付
164
164
 
165
+ 需要让人查看指定业务流程时,先取得准确流程 ID,再运行
166
+ `semantic-atlas web --project "<name-or-id>" --flow "<flow-id>" --no-open`
167
+ (未登记时替换为单个 `--repo "<absolute-path>"`)。命令先校验目标,再在 `data.url`
168
+ 返回带项目和流程的直达链接;交付这个完整地址,让人打开即看到目标图。
169
+ 已有服务时,可用其地址加 `#project=<project-id>&flow=<flow-id>`,按 URL 参数编码;
170
+ 项目 ID 来自当前服务的项目目录,不能猜首项。链接定位对应服务中的项目与流程,
171
+ 导出的自包含 HTML 也支持同样的 fragment 定位。切图会同步地址,复制当前 URL 即可。
172
+
165
173
  说明当前业务边界、关键依据、代码与流程分别改了什么,以及实际验证。没有业务变化或无需结构性改图时给出简短依据。直接画图提供阅读入口与文件;仅分析时说明建议改动。把已核实的覆盖、尚未调查的范围、资料缺口、未完成的运行验证,以及本地修改与实际合入状态分别讲清楚。当前结果已充分验证后结束,不补画无关业务。
package/README.md CHANGED
@@ -6,322 +6,270 @@
6
6
 
7
7
  English | [简体中文](README.zh-CN.md)
8
8
 
9
- Semantic Atlas 将业务流程图作为人和 AI 协作的一等公民。经确认的流程定义业务应当
10
- 怎样运转,代码负责实现,测试与运行记录用于检查兑现情况。人通过只读画布讨论
11
- 流程、分支与结果,AI 维护 Git 中同一份业务规范与对应实现。
12
- 总览和子图统一为业务流程图;业务归属、源码锚点与查询为 AI 提供调查入口。
9
+ **Business flows are a first-class part of building software with AI.**
13
10
 
14
- 图与代码不一致时,先核对业务决定,区分实现缺陷、图误写与意图变化;不能直接改图
15
- 迁就代码。首次建图仍需调查当前实现,明确区分确认规则、实现现状和待定差异。
16
- The installed Skill activates from business-changing task meaning, so a
17
- repository without a map still receives the same bounded business-understanding
18
- workflow and updates affected business flows in the same branch.
11
+ Semantic Atlas gives people and their coding agents a shared place to understand,
12
+ discuss, and maintain how a business works. People read interactive flow diagrams.
13
+ AI edits the underlying files, finds the relevant code, and keeps both together
14
+ as the business changes.
19
15
 
20
- ## Install
16
+ Use it with a coding agent such as Codex or Claude Code. The product provides a
17
+ read-only flow viewer, a local CLI, and one bundled Skill that guides the agent's
18
+ business investigation, drawing, and maintenance.
21
19
 
22
- Semantic Atlas requires Node.js 24 or later. CI verifies Node.js 24 and 26.
20
+ ## Start With The Business
23
21
 
24
- ```bash
25
- npm install --global semantic-atlas --allow-scripts=semantic-atlas
26
- semantic-atlas --version
27
- ```
22
+ As AI writes more code, people need a way to agree on its intended behavior.
23
+ Business flows make the actors, actions, conditions, and outcomes visible so
24
+ engineers and business teams can review the same decisions.
28
25
 
29
- 全局安装自动接入统一的 `semantic-atlas` Skill,并清理已识别的旧维护 Skill。Codex 与
30
- Claude 使用指向 `~/.agents/skills/semantic-atlas` 的共享入口,同事无需分别维护副本。
31
- `--allow-scripts=semantic-atlas` 允许 npm 12 执行本包的安装步骤,不改变全局 npm 配置。
32
- 普通项目依赖安装不会改动用户级 Skill;主动禁用安装脚本时,可运行 `semantic-atlas setup`。
26
+ **Confirmed flows define the business specification. Code implements it. Tests
27
+ and runtime evidence check whether the implementation delivers it.**
33
28
 
34
- ## Upgrade
29
+ When code and a flow disagree, the agent checks the business decision behind the
30
+ rule. The difference may be an implementation defect, an error in the diagram,
31
+ or a change in requirements. Existing code alone is insufficient reason to
32
+ rewrite an agreed rule. Unresolved differences stay explicit.
35
33
 
36
- ```bash
37
- semantic-atlas upgrade
38
- ```
34
+ For a project without flows, the agent investigates the existing implementation
35
+ and drafts them progressively. It distinguishes confirmed requirements from
36
+ current behavior and open questions, revising earlier work as it learns more.
39
37
 
40
- 旧版在 `check` 阶段提示无法取得单一稳定版本时,重新运行上面的全局安装命令即可更新。
41
- 4.1.1 已支持 npm 12 返回的单项版本数组;更新后继续使用 `upgrade`。
38
+ ## People Read, AI Maintains
42
39
 
43
- `upgrade` resolves npm's current stable version, installs that exact package,
44
- verifies the installed CLI identity, and synchronizes the single managed Skill.
45
-
46
- ### Skill conflicts
40
+ | People | AI |
41
+ | --- | --- |
42
+ | Read and explain the business | Investigate the business and its implementation |
43
+ | Follow branches and open local details | Write and reorganize flow source files |
44
+ | Discuss rules and decide intended behavior | Find relevant code and related business flows |
45
+ | Review changes against the agreed flows | Update flows and code in the same branch |
47
46
 
48
- `setup` 和 `upgrade` 使用同一安装流程。`semantic-atlas` 与
49
- `semantic-atlas-maintenance` 是本产品管理的 Skill 名称;当前管理标记或匹配的
50
- `SKILL.md` 身份可识别旧安装。旧格式会被接管并更新,旧维护入口在新 Skill 生效后移除。
47
+ The browser is a read-only canvas. Distinct node styles identify starting
48
+ points, decisions, outcomes, and steps with deeper flows. Click a step's corner
49
+ icon to enter a deeper flow, then use **Previous level** to return. A small
50
+ information marker identifies notes; click the node body to read them.
51
+ Each declared entry has a **Start** badge and a blue outline so readers can find
52
+ where to begin, including flows with multiple entries.
53
+ **Other flows** opens a cascading menu for direct navigation.
51
54
 
52
- `MANAGED_SKILL_CONFLICT` 表示目标目录实为其他 Skill,或没有可识别的本产品身份。
53
- 该目录会保留。需要让出这个位置时,将错误中的确切目录移到所有 Skill 发现目录之外,
54
- 再运行 `semantic-atlas setup`。`upgrade` 若在 `step: "setup"` 失败,已安装的 CLI 保持,
55
- 处理这个目录后重跑 setup 即可,无需重新安装软件。不要手工伪造管理标记。
55
+ Business readers see the process and its explanations. Code file and method
56
+ references remain available to AI through the source files and CLI.
56
57
 
57
- ## Add A Business Map
58
+ ## Install
58
59
 
59
- A target repository owns only its Git-tracked map documents:
60
+ Requires Node.js 24 or later.
60
61
 
61
- ```text
62
- docs/business-map/*.yaml
62
+ ```bash
63
+ npm install --global semantic-atlas --allow-scripts=semantic-atlas
64
+ semantic-atlas --version
63
65
  ```
64
66
 
65
- Start with one file per stable business domain:
66
-
67
- ```yaml
68
- schemaVersion: 1
69
- map:
70
- id: commerce
71
- title: Commerce
72
- summary: Customer-facing product discovery and purchase.
73
-
74
- nodes:
75
- - id: commerce
76
- kind: domain
77
- name: Commerce
78
- summary: Customer-facing product discovery and purchase.
79
- aliases: []
80
- anchors:
81
- - kind: directory
82
- value: src/commerce
83
- description: Likely source entry point for Commerce behavior.
84
-
85
- relations: []
86
- flows: []
87
- ```
67
+ Global installation also installs the unified `semantic-atlas` Skill. Codex and
68
+ Claude share its entry at `~/.agents/skills/semantic-atlas`; recognized older
69
+ maintenance Skills are removed during setup. The npm 12 `--allow-scripts` option
70
+ allows this package's installation step without changing global npm settings.
88
71
 
89
- The [map format](docs/map-format.md) defines supported concepts, relations,
90
- business flows, anchors, validation rules, and lookup behavior.
72
+ ## Create And Read Your First Flows
91
73
 
92
- For an operation implemented by a known method, bind its symbol to the source
93
- file so the Agent can begin with that declaration:
74
+ Ask your coding agent:
94
75
 
95
- ```yaml
96
- anchors:
97
- - kind: symbol
98
- file: src/orders/place-order.service.ts
99
- value: PlaceOrderService.execute
100
- description: Confirm inventory and create a durable customer order.
101
- ```
76
+ > Use Semantic Atlas to map this project's business so I can explain it to a new
77
+ > teammate.
102
78
 
103
- Queries retain both fields with `resolution: "hint"`; they do not guess a declaration's code line.
104
- A missing local path is marked `missing`. The business-facing Viewer hides source anchors.
105
- The Agent locates the current method using normal repository tools and confirms its behavior.
106
- Existing file references and unbound symbols remain compatible; maintenance
107
- can refine them when current evidence establishes a more precise business entry.
79
+ The agent uses the bundled Skill to investigate and write flow source files in
80
+ `docs/business-map/*.yaml`, alongside the project's code and Git history.
81
+ The [Skill](.agents/skills/semantic-atlas/SKILL.md) contains the drawing and
82
+ maintenance guidance; the [file format](docs/map-format.md) defines the fields.
108
83
 
109
- ## Query And Render
84
+ After the files exist, register the project and open the viewer:
110
85
 
111
86
  ```bash
112
- semantic-atlas validate --repo /path/to/repository
113
- semantic-atlas search "order confirmation notification" --flows --repo /path/to/repository
114
- semantic-atlas flows "engagement.notifications.confirm-order-flow" --repo /path/to/repository
115
- semantic-atlas context "engagement.notifications.send-order-confirmation" --repo /path/to/repository
116
- semantic-atlas render --repo /path/to/repository --output ./business-map.html
117
- semantic-atlas project add /path/to/repository
87
+ semantic-atlas project add /path/to/my-app
118
88
  semantic-atlas project list
119
- semantic-atlas search "order confirmation notification" --flows --project repository
120
89
  semantic-atlas web
121
90
  ```
122
91
 
123
- 登记项目后,可从任意目录使用 `--project <项目名称或ID>` 查询。`project list` 返回名称、
124
- 展示名、ID 与实际路径;名称从仓库目录名派生。重名时用 ID,误拼时返回“你是不是在找”
125
- 的候选,由 AI 判断后明确重试。`validate/search/flows/context/render/web` 支持该参数,
126
- 与显式 `--repo` 互斥。也可直接用 `--repo <路径>`,两项均省略时地图命令只读取当前目录。
127
- 流程与源码保留在同一仓库,锚点相对它解析;不同项目分别查询,不递归混合子项目。
128
-
129
- `validate` checks every map document as one graph. `search` ranks up to five
130
- concepts with stable IDs, query-relative scores, matched fields, and current YAML
131
- maintenance locations. The first candidate's ID appears in `contextFor`: only
132
- that candidate has an attached business summary. It remains a lexical candidate
133
- for the Agent to assess; use another candidate's ID with `context` when needed.
134
-
135
- The shared summary returns unique concept details and source anchors, typed
136
- relations with business reasons, and related flow references with step locations.
137
- It covers direct relations and other recorded users of shared data, interfaces,
138
- and invariants. `scope: "recorded"` marks this as investigation evidence to
139
- confirm in source. It does not establish complete change impact.
140
-
141
- `context` retains exact and partial selectors and adds the selected concept,
142
- ancestor IDs and direct child IDs. Related flows remain summaries;
143
- `flows <id>` expands that flow's full local steps and
144
- transitions. Scenario, parent, step concept and child-flow references use IDs;
145
- concept details and anchors appear once in the same response. Query commands
146
- emit compact versioned JSON with only `repository.root`, without a map-file
147
- inventory. Each item's `map` locates its current YAML declaration. See the
148
- [query contract](docs/map-format.md#context-projection) for fields and limits.
149
- `render` produces a deterministic, self-contained interactive HTML Viewer from
150
- that same normalized map.
151
-
152
- AI 按业务问题直接定位流程:已知编号时直接 `flows <flow-id>`,未知时用
153
- `search "<业务描述>" --flows` 返回相关流程及命中步骤的维护位置。`contextFor` 标明
154
- 第一流程候选的关联摘要;另一个候选更合适时按其流程 ID 读取,或用 `scenarioId`
155
- 查询概念上下文。完整步骤与子流程按需读取,没有必须先读总览的顺序。
156
- 搜索使用业务名称、别名、步骤和说明做词面匹配,AI 仍需判断业务含义,不能把分数当成证据。
157
-
158
- 人通过画布阅读。所有页面统一为流程图;节点角标直接进子流程,多目标先选择。
159
- 正文有备注才打开默认关闭的说明,说明中没有进入按钮。“上一层”沿实际来路返回。
160
- “查看其他流程”按父子流程逐列展开,单项目名不重复显示。源码与 AI 编排理由在界面隐藏。
161
-
162
- AI 根据真实业务决定每张图的范围、平级关系与必要详图。项目可以直接提供多张平级
163
- 业务图,无需共同父图或专门的“业务全貌”图。每张图讲清自己的业务,相关主线不拆散,
164
- 独立业务不强行合并;跨项目环节沿实际业务找源码,软件不自动拼图或推断执行关系。
165
-
166
- 同一流程的 `startsAt` 可写多个真实入口;普通动作可以连接多个无条件后续,表示各条
167
- 路径都成立。带条件的选择继续使用判断节点。CLI 的 `startsAt` 统一返回 ID 列表,
168
- 这是 4.0 的公开结果类型变化;原有单 ID 输入仍可读取。详见[格式](docs/map-format.md)。
169
-
170
- 没有 `flows` 时显示空状态。可运行[订单管理阅读样例](examples/订单管理/README.md)。
171
-
172
- `project add [path]` validates the complete business map and saves its
173
- normalized checkout path in the versioned user-local
174
- `~/.semantic-atlas/projects.json` file. Omitting `path` uses the current
175
- directory. Repeating a valid path is idempotent; a missing or invalid map leaves
176
- the file unchanged.
177
-
178
- `web` starts the same Viewer on a read-only `127.0.0.1` server and opens the
179
- default browser. With neither `--repo` nor `--project`, it reads the registered list from any current
180
- directory. An empty list opens an instructional empty state. The initial page
181
- contains only project names and opaque IDs; it loads and validates a map only
182
- when that project is initially selected or selected later. An unavailable path
183
- stays in the list and does not prevent another project from loading.
184
-
185
- Pass several repositories after one `--repo` option for a temporary session:
92
+ Registered projects are available by name or ID from any working directory.
93
+ Names come from checkout directory names: the example above becomes `my-app`.
94
+ For duplicate names, use the ID returned by `project list`. A misspelled project
95
+ name returns suggestions for the agent to assess and retry explicitly.
96
+
97
+ You can also open repositories for a temporary session:
186
98
 
187
99
  ```bash
188
100
  semantic-atlas web --repo /path/to/api /path/to/frontend --port 4310 --no-open
189
101
  ```
190
102
 
191
- Explicit paths are not saved and are not merged with registered projects. The
192
- browser cannot provide arbitrary repository paths and never receives the saved
193
- paths. Reselecting or refreshing a project reloads its tracked YAML.
194
- Repositories with the same directory name receive deterministic numbered
195
- labels without exposing their parent paths. `Ctrl+C` stops the server.
103
+ Temporary paths are not merged with registered projects and are not saved.
104
+ Each project loads its own files. Reselect or refresh a project to read its latest
105
+ flows; press `Ctrl+C` to stop the server. To read an existing flow collection,
106
+ start here; generating new files is only needed when the relevant flows are absent.
107
+
108
+ To try a fictional flow from a source checkout, see the
109
+ [order-management example](examples/订单管理/README.md).
110
+
111
+ ### Open A Specific Flow
112
+
113
+ ```bash
114
+ semantic-atlas web --project my-app --flow "<flow-id>" --no-open
115
+ ```
196
116
 
197
- ## Language
117
+ The command validates the target and returns its full local URL in `data.url`,
118
+ including `#project=<project-id>&flow=<flow-id>`. The agent gives you that link
119
+ to open the exact diagram. For an unregistered project, use a single
120
+ `--repo /path/to/my-app`. With several registered projects, select one explicitly.
198
121
 
199
- The CLI follows your system language (`LC_ALL`, `LC_MESSAGES`, then `LANG`).
200
- Both the Web Viewer and exported HTML follow your browser's language preferences.
201
- English and Simplified Chinese are supported, with English as the fallback.
202
- No language configuration is required for normal use.
122
+ Switching projects or flows updates the URL. Copy it to reopen the same diagram;
123
+ refresh and browser back/forward restore the target. Unknown targets show a
124
+ clear message. Exported HTML uses the same fragment format with its embedded
125
+ project ID.
203
126
 
204
- See [language selection and adding translations](docs/architecture.md#internationalization)
205
- for implementation details and the optional debugging override.
127
+ ## Let The Business Decide The Diagram
206
128
 
207
- ## Evidence Order
129
+ Each diagram should explain a meaningful business process: who wants what,
130
+ which actions and conditions matter, and how the result is used. A project may
131
+ have several peer flows. Keep a coherent process together, and move a complex
132
+ local part into a deeper flow when that helps the reader understand it.
208
133
 
209
- For a business-changing engineering task:
134
+ The agent chooses boundaries and depth from the business. A flow may cross a
135
+ frontend, backend, background job, and another repository; missing parts of the
136
+ story guide the next investigation. Multiple entry points and parallel paths
137
+ can be expressed when the business has them.
210
138
 
211
- 1. Probe the smallest useful map neighborhood whether or not map files exist.
212
- 2. Use confirmed flows as the business contract; after `MAP_NOT_FOUND`, investigate
213
- the current implementation and build the smallest useful candidate flow.
214
- 3. Trace any related business flow and identify the decisions, branches, and
215
- outcomes that the task can affect.
216
- 4. Check source and tests against the confirmed business rules.
217
- 5. Use business decisions to establish intended behavior and runtime evidence to
218
- establish what actually happened.
219
- 6. Classify discrepancies as implementation defects, flow errors, or changed intent;
220
- never rewrite a confirmed flow merely because code differs.
221
- 7. Implement, verify, and recheck the affected business paths through the
222
- repository's normal engineering workflow.
223
- 8. 业务行为变化时,在同一分支同步代码与流程,一起验证和合入;纯实现调整不强制改图。
139
+ Node text states the concrete action or condition concisely. Notes carry longer
140
+ explanations, lists, and the business reasons behind a rule. The agent reviews
141
+ the source files for complete paths, misplaced fragments, unclear language, and
142
+ agreement with the business before handing them over.
224
143
 
225
- The engineering conclusion distinguishes the intended business contract, actual
226
- implementation, and unresolved differences. Confirmed rules are not rewritten
227
- merely because existing code behaves differently.
144
+ Semantic Atlas manages, searches, validates, and renders these files. The Skill
145
+ teaches how to use those capabilities. The agent decides what to draw and how to
146
+ organize it, using the [flow-design guidance](.agents/skills/semantic-atlas/references/diagram-design.md).
228
147
 
229
- ## Agent Skills
148
+ ## Change The Business And Its Implementation Together
230
149
 
231
- `semantic-atlas setup` 只安装一个 `semantic-atlas` Skill。它根据当前任务先理解业务、
232
- 核实源码与运行证据,再决定实现、编写流程或维护共享资料;相关方法按需读取。
233
- 理解、画图与维护使用同一份业务知识,不再交接给另一个 Skill。
150
+ 1. Locate the relevant business flow and related code.
151
+ 2. Express a changed business rule in the flow before implementing it. When fixing
152
+ code that violates an existing rule, preserve the correct flow.
153
+ 3. Implement and verify the behavior. Check related flows when their conditions,
154
+ outcomes, or collaborators are affected.
155
+ 4. Review and commit the flow and code changes in the same branch.
234
156
 
235
- 所有图都用 `flows` 显式编写。总览交代主要路径与条件,子流程解释具体环节,
236
- `part_of` 继续表达所有权,不作为执行顺序。安装和升级会清理已识别的旧维护 Skill,
237
- 持续提供同一入口。业务资料仍随所属仓库通过 Git 维护。
157
+ Internal refactoring or a comment change can leave the business flow unchanged.
158
+ During a merge, establish the combined business rules first, then check that the
159
+ merged implementation satisfies them.
238
160
 
239
- 业务代码和相关流程在同分支一起修改、检查、评审与合入。合并先确定共同生效的业务规则,再核对最终实现,不机械拼接图文件。只有实现组织变化时无需重画。旧业务文件不要求兼容,
240
- 新版发布后再按新契约重写,当前不迁移其他项目。
161
+ ## Query Business Context For AI
241
162
 
242
- ## Accuracy Observations
163
+ <a id="query-and-render"></a>
243
164
 
244
- 观察与候选工具保留为明确请求下的历史资料操作,不属于普通开发的默认步骤:
165
+ An agent can enter through a known flow or concept ID, or search by business
166
+ intent. It chooses the relevant entry directly; the viewer's hierarchy is for
167
+ human navigation.
245
168
 
246
169
  ```bash
247
- semantic-atlas observe task --stdin --repo /path/to/repository
248
- semantic-atlas observe review --stdin --repo /path/to/repository
249
- semantic-atlas observe maintenance --stdin --repo /path/to/repository
250
- semantic-atlas insights summary --repo /path/to/repository --period 4w
170
+ semantic-atlas search "cancel an order before shipment" --flows --project my-app
171
+ semantic-atlas flows "<flow-id>" --project my-app
172
+ semantic-atlas context "<concept-id>" --project my-app
251
173
  ```
252
174
 
253
- 具体不可变记录与重放语义见[观察契约](docs/observations.md)。
175
+ Use the IDs returned by the query. Results are compact JSON with business rules,
176
+ recorded relationships, related flow references, flow-file locations, and code
177
+ file or symbol anchors. These help the agent find the implementation and the
178
+ flow files affected by a change. Recorded links describe known relationships;
179
+ the agent still traces any missing callers or consumers needed for the task.
180
+
181
+ Search ranks up to five candidates using words in business names, aliases,
182
+ steps, and descriptions. The attached context belongs to the first candidate;
183
+ the agent assesses it and fetches another candidate by ID when appropriate.
184
+ Code symbols are navigation hints, while flow-file line locations point to the
185
+ current declarations to maintain. See the [query contract](docs/map-format.md#context-projection).
254
186
 
255
- ## Reconciliation
187
+ Use `--repo /path/to/my-app` instead of `--project my-app` for an unregistered
188
+ checkout. To validate or export a self-contained interactive HTML file:
256
189
 
257
190
  ```bash
258
- semantic-atlas reconcile status --repo /path/to/repository
259
- semantic-atlas reconcile candidates --repo /path/to/repository
191
+ semantic-atlas validate --project my-app
192
+ semantic-atlas render --project my-app --output ./business-flows.html
260
193
  ```
261
194
 
262
- 这些只读命令查询已有的历史候选,只有明确要求时使用。正常流程维护随代码变化,
263
- 不先生成候选,不等待代码合入。业务仓库只共享版本控制中的资料。
195
+ ## Upgrade
196
+
197
+ ```bash
198
+ semantic-atlas upgrade
199
+ ```
200
+
201
+ This installs the current stable package, verifies the CLI version, and updates
202
+ the bundled Skill together. If an older CLI cannot complete its version check,
203
+ run the global installation command again.
204
+
205
+ <details>
206
+ <summary>Skill installation and conflicts</summary>
207
+
208
+ ### Skill conflicts
209
+
210
+ If installation scripts were disabled, run `semantic-atlas setup`. Installing as
211
+ a project dependency leaves user-level Skills unchanged.
212
+
213
+ `MANAGED_SKILL_CONFLICT` means the destination cannot be identified as a Semantic
214
+ Atlas Skill. Move the reported directory outside agent Skill discovery paths,
215
+ then run `semantic-atlas setup` again. If `upgrade` fails at `step: "setup"`, the
216
+ CLI is already installed; resolve the directory conflict and rerun setup.
217
+
218
+ </details>
264
219
 
265
220
  ## Local Data And Privacy
266
221
 
267
- Business maps stay in the target repository. Accuracy observations stay in
268
- immutable JSON files under a hashed user-local repository partition:
222
+ Flow source files stay in their project repositories. Project registration
223
+ stores local checkout paths in `~/.semantic-atlas/projects.json`. The viewer
224
+ listens on `127.0.0.1`; repository paths stay server-side. Export writes a local
225
+ HTML file to the requested destination. Semantic Atlas works locally without
226
+ an account or telemetry uploads.
227
+
228
+ The CLI follows the terminal's language environment. The viewer and exported
229
+ HTML follow browser language preferences. English and Simplified Chinese are
230
+ supported; see [language selection](docs/architecture.md#internationalization).
269
231
 
270
- ```text
271
- ~/.semantic-atlas/observations/v1/repositories/<repository-id>/
232
+ <details>
233
+ <summary>Optional historical observations and reconciliation</summary>
234
+
235
+ These tools read or record explicit engineering observations. Use them when
236
+ working with retained evidence; ordinary maintenance keeps flows and code
237
+ together in the development branch.
238
+
239
+ ```bash
240
+ semantic-atlas observe task --stdin --repo /path/to/my-app
241
+ semantic-atlas reconcile status --repo /path/to/my-app
242
+ semantic-atlas reconcile candidates --repo /path/to/my-app
272
243
  ```
273
244
 
274
- Observation files contain neither repository paths nor remote URLs. The
275
- separate `~/.semantic-atlas/projects.json` Viewer configuration stores only the
276
- checkout paths the user explicitly registers. Those paths remain server-side
277
- and are never sent to the browser. Semantic Atlas has no remote observation
278
- service, account, telemetry upload, persistent graph database, or automatic
279
- source/map mutation. `setup` and observation commands do not add files to a
280
- target repository; `render` writes only the explicitly requested local output.
281
- `web` binds only to loopback, exposes GET and HEAD, and reads either the
282
- registered list or the explicit temporary `--repo` set.
245
+ See the [observation contract](docs/observations.md) for record formats and
246
+ historical-tool behavior.
247
+
248
+ </details>
283
249
 
284
250
  ## Development
285
251
 
286
- For upstream contributions, forks, and pull requests, start with the
287
- [contribution guide](https://github.com/lzj960515/semantic-atlas/blob/main/CONTRIBUTING.md).
252
+ Read the [contribution guide](https://github.com/lzj960515/semantic-atlas/blob/main/CONTRIBUTING.md)
253
+ for the upstream repository and PR workflow.
288
254
 
289
255
  ```bash
290
256
  pnpm install --frozen-lockfile
291
- pnpm lint
292
- pnpm format:check
293
257
  pnpm release:verify
294
258
  ```
295
259
 
296
- `pnpm lint` runs Oxlint correctness rules and fails on errors or warnings.
297
- `pnpm lint:fix` applies safe lint fixes; `pnpm format` writes Oxfmt formatting,
298
- and `pnpm format:check` checks formatting without changing files. These commands
299
- cover TypeScript source, tests, release and smoke scripts, the bundled Skill
300
- script, and Vitest configuration. Map YAML and Markdown stay outside automatic
301
- formatting. The shared formatter uses two-space indentation, double quotes,
302
- semicolons, trailing commas, and a 100-column print width, while preserving
303
- import order and embedded language content.
304
-
305
- The release-candidate gate runs lint and formatting checks, contract and source
306
- tests, typecheck, build,
307
- rendering checks, packed-tarball privacy checks, an anonymous installed-product
308
- flow, package dry-run, and Git diff validation.
309
-
310
- Publication is a separate operation. After the repository's immutable-release
311
- setting is enabled, a non-prerelease GitHub Release for an annotated version tag
312
- triggers the protected npm workflow. The workflow verifies the specific Release
313
- is immutable in a read-only job before any tag checkout or npm credential
314
- boundary. Only then does the protected publish job repeat the candidate gate
315
- and publish with npm provenance. A separate read-only job verifies public npm
316
- visibility within five minutes and can be rerun without publishing again.
317
-
318
- ## Documentation
260
+ The candidate check covers lint, formatting, tests, types, build, rendering, and
261
+ packaged installation. Public releases use an immutable GitHub Release and the
262
+ protected npm workflow, with npm provenance and independent public-package
263
+ verification. See the [release procedure](https://github.com/lzj960515/semantic-atlas/blob/main/.claude/commands/release.md).
264
+
265
+ ## Further Reading
319
266
 
267
+ - [Unified Skill](.agents/skills/semantic-atlas/SKILL.md)
268
+ - [Flow-design guidance](.agents/skills/semantic-atlas/references/diagram-design.md)
269
+ - [Flow source format and query contract](docs/map-format.md)
320
270
  - [Product contract](docs/product-contract.md)
321
271
  - [Architecture](docs/architecture.md)
322
- - [Map format](docs/map-format.md)
323
- - [Accuracy observations](docs/observations.md)
324
- - [Evaluation](docs/evaluation.md)
272
+ - [Evaluation and its evidence limits](docs/evaluation.md)
325
273
 
326
274
  ## License
327
275