適用情境
- 要為真實 codebase 畫架構圖
- 需要節點可追溯到檔案與行號
- 要做 PR review 或架構 delta 比較
流程總覽
flowchart LR
A[1. 開啟 repo] --> B[2. 代理讀碼取證]
B --> C[3. 帶證據寫候選]
C --> D[4. finalize --repo-root]
步驟 1:開啟 repo
在 repo 根目錄工作,讓 --repo-root 與證據路徑一致。
步驟 2:代理讀碼取證
Analyze this repository, then use archify to create a high-level runtime architecture diagram.
Show 8–12 core components, one primary path, external dependencies, and trust boundaries.
Put supporting detail in cards instead of adding more edges.
代理會讀 Repository authoring 指引並追蹤請求的行為。
步驟 3:帶證據寫候選
證據-backed 節點標 SRC n,對應 Git 驗證過的檔案與行號,釘選單一公開 commit;一般節點保持無來源。
步驟 4:finalize(含 repo-root)
node bin/archify.mjs finalize architecture candidate.json output.html --repo-root <repo-root> --quality showcase --json
失敗時讀 receipt 修連接鄰域後重跑完整 finalize;非零結束永遠不是成功。