@adamchanadam/agent-handoff-kit 0.3.36 → 0.3.37

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agent Handoff Kit
2
2
 
3
- 狀態:目前版本為 `v0.3.36`。這是早期可用版本,仍在持續完善中。
3
+ 狀態:目前版本為 `v0.3.37`。
4
4
 
5
5
  <p align="center">
6
6
  <img src="https://raw.githubusercontent.com/Adamchanadam/agent-handoff-kit/main/images/agent-handoff-kit-promo-30s.gif" alt="Agent Handoff Kit 功能簡介動畫" width="720">
@@ -8,11 +8,11 @@
8
8
 
9
9
  Agent Handoff Kit 是 **AI 對話之間的接力棒**。
10
10
 
11
- 它只處理一件狹窄但重要的事:AI 跨對話失憶。每次開新對話,AI 往往不記得你上次做到哪裡,也認不出中途新建的文件、你引入的參考資料、哪些檔案是真源。這套工具把進度、下一步、風險、檔案登記與下次開工提示寫進固定文件,讓下一個 AI 工具能接得上上一棒。
11
+ 它只處理一件狹窄但重要的事:AI 跨對話失憶。每次開新對話,AI 往往不記得你上次做到哪裡,也認不出中途新建的文件、你引入的參考資料、哪份文件才是最新依據。這套工具把進度、下一步、風險、檔案登記與下次開工提示寫進固定文件,讓下一個 AI 工具能接得上上一棒。
12
12
 
13
- 📌 使用時,你只需要說明目的;確認資料夾、判斷安裝或升級、執行指令和檢查結果,交給能讀寫本機資料夾的 AI 處理。
14
-
15
- ## 🚀 三步上手
13
+ 📌 使用時,你只需要說明目的;確認資料夾、判斷安裝或升級、執行指令和檢查結果,交給能讀寫本機資料夾的 AI 處理。
14
+
15
+ ## 🚀 三步上手
16
16
 
17
17
  第一次用,不需要先讀完整 README,也不需要研究終端機指令。只做三件事:
18
18
 
@@ -39,27 +39,27 @@ Agent Handoff Kit 是 **AI 對話之間的接力棒**。
39
39
 
40
40
  | 入口 | 用途 |
41
41
  |---|---|
42
- | `README.md` | 正式用途、安裝路徑、限制與安全邊界。 |
42
+ | `README.md` | 正式用途、安裝路徑與安全邊界。 |
43
43
  | [`agent-handoff-kit-intro.html`](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-intro.html) | 非技術版 60 秒入門與宣傳動畫。 |
44
44
  | [`agent-handoff-kit-guide.html`](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-guide.html) | 三個實操情景,示範開工、工作、收工。 |
45
45
  | [`agent-handoff-kit-ai-install.html`](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.html) | 給 AI 讀的安裝與升級指令頁。 |
46
46
 
47
- repo 內的 `scripts/`、`test-fixtures/`、`docs/qa/` 和部分設計文件,是維護者用來測試升級、安全合併和發佈品質的材料。普通用戶不需要閱讀,也不會被 npm 安裝到你的項目;npm package 只包含實際執行需要的核心檔案。
48
-
49
- 維護者請看 [`MAINTAINERS.md`](MAINTAINERS.md)。
47
+ 這個公開 repo 保留使用、安裝、入門、GitHub Pages 與 npm 執行所需內容。日常使用時,你只需要從上面四個入口開始。
50
48
 
51
49
  ## 🔎 它解決甚麼問題
52
50
 
53
- 用 AI 做長期項目,常見四個問題:
51
+ 用 AI 做長期項目,常見五個問題:
54
52
 
55
53
  | 問題 | Agent Handoff Kit 怎樣處理 |
56
54
  |---|---|
57
55
  | 新 AI 不知做到哪 | 用 `dev/SESSION_HANDOFF.md` 保存目前狀態、下一步、風險與驗收。 |
58
- | 新建檔案、參考資料變孤兒 | 你可以叫 AI 把文件接入 Agent Handoff Kit,用 `dev/PROJECT_INDEX.md` 與 `dev/DOC_SYNC_REGISTRY.md` 登記檔案角色、真源與同步責任。 |
59
- | 不同 AI 工具入口不同 | 同時安裝 `AGENTS.md`、`CLAUDE.md`、`GEMINI.md`,全部指向同一套開工流程;Antigravity CLI 會讀工作資料夾內的 `AGENTS.md` 與 `GEMINI.md`。 |
60
- | AI 可能亂改、亂刪或誤發佈 | 內置安全規則;高風險操作必須先講計劃,破壞性指令與未批准發佈一律禁止。 |
61
-
62
- 它不是聊天機器人,也不是開發框架。它比較像一本固定放在專案內的交接簿。
56
+ | 新建檔案、參考資料變孤兒 | 你可以叫 AI 把文件接入 Agent Handoff Kit,記低每份文件的用途、哪份作準、何時要同步。 |
57
+ | 不同 AI 工具入口不同 | 同時安裝 `AGENTS.md`、`CLAUDE.md`、`GEMINI.md`,全部指向同一套開工流程;Antigravity CLI 會讀工作資料夾內的 `AGENTS.md` 與 `GEMINI.md`。 |
58
+ | AI 可能亂改、亂刪或誤發佈 | 內置安全規則;高風險操作必須先講計劃,破壞性指令與未批准發佈一律禁止。 |
59
+ | 外部工具用完後殘留或亂清理 | 使用 MCP、browser、自動化工具、notebook 或 helper server 後,AI 會按 ownership 判斷:本任務資源可收口,不明或共享資源先回報證據並等你確認。 |
60
+
61
+
62
+ 它不是聊天機器人,也不是開發框架。它比較像一本固定放在專案內的交接簿。
63
63
 
64
64
  ## 🧰 適用工具
65
65
 
@@ -145,9 +145,9 @@ AI 會處理檢查,不會把「檢查通過」誤當成已理解你的專案
145
145
  |---|---|
146
146
  | 寫程式 / 修錯誤 | 先讀項目索引、相關檔案,再改動和測試。 |
147
147
  | 寫文章 / README / 社交帖文 | 先確認讀者、目的、語氣和發布位置。 |
148
- | 查資料 / 比較工具 | 分清已驗證事實、來源摘要和 AI 推論。 |
148
+ | 查資料 / 比較工具 | 分清已驗證事實、來源摘要和 AI 的判斷。 |
149
149
  | 刪檔 / Git / 發佈 / npm | 高風險操作必須先說明影響,並等你確認。 |
150
- | Notion / Google Drive 等外部工具 | 先核對目前工具 schema 或官方文件;機密不寫入項目文件。 |
150
+ | Notion / Google Drive 等外部工具 | 先核對目前工具說明或官方文件;用後按資源歸屬安全收口;機密不寫入項目文件。 |
151
151
 
152
152
  你只要用日常話說目的,例如「幫我改 README」、「幫我查這個工具是否適合」、「把這份文件接入 Agent Handoff Kit」。AI 會自己判斷要用哪些規則。
153
153
 
@@ -169,24 +169,26 @@ AI 應先判斷這條規則應放在哪裡:是一次性備忘、下次交接
169
169
  | 結束本輪工作 | 「收工」 |
170
170
  | 讓新文件不變成孤兒 | 「把這份文件接入 Agent Handoff Kit,讓下次 AI 知道何時要讀、何時要更新。」 |
171
171
  | 掃描可能被遺漏的重要文件 | 「掃描未接入 Agent Handoff Kit 的重要文件。」 |
172
- | 把錯誤經驗保存成日後機制 | 「把今次錯誤變成日後機制,寫入長期治理。」 |
173
- | 讓 API / 工具用法之後都生效 | 「以後都用這個 API 調用方式,跨 session 生效。」 |
174
- | 使用外部工具,例如 Notion、Google Drive、GitHub | 「這個項目會用到這些外部工具,請記住哪些能直接使用,機密不要寫入項目文件。」 |
175
-
176
- 這個掃描只列出候選與缺口,不會自動修改;是否接入、合併或退役由你確認。
172
+ | 讓 AI 下次避免同類錯誤 | 「把今次錯誤整理成日後工作規則,讓下次 AI 知道要怎樣避免。」 |
173
+ | 讓 API / 工具用法下次仍生效 | 「以後都用這個 API 調用方式,之後開新對話也要沿用。」 |
174
+ | 使用外部工具,例如 Notion、Google Drive、GitHub | 「這個項目會用到這些外部工具,請記住哪些能直接使用,機密不要寫入項目文件。」 |
175
+ | 長任務用了 MCP、browser 或自動化工具 | 「收工時請顯示外部工具資源收口結果:已關閉哪些本任務資源,哪些因歸屬不明而保留並列證據。」 |
177
176
 
178
- 長期機制不應只寫入 `dev/SESSION_LOG.md`,也不只留在 session log 或 handoff;AI 應放入合適的長期治理位置。
177
+ 掃描重要文件時,AI 只會先列出可能需要接入的文件與原因,不會自動修改;是否接入、合併或退役由你確認。
178
+
179
+ 需要長期保留的規則,AI 應寫入合適的項目文件,而不是只留在當次對話摘要。
179
180
 
180
- 如涉及刪除、改名、合併真源、發佈、上傳或權限變更,AI 應先說明影響並等你確認。
181
+ 如涉及刪除、改名、合併權威文件、發佈、上傳或權限變更,AI 應先說明影響並等你確認。
181
182
 
182
183
  ## 🛡️ 安全護欄
183
184
 
184
185
  就算你不懂代碼,這套工具也會要求 AI 在高風險操作前停下來講清楚。
185
186
 
186
- - 禁止破壞性指令:例如 `rm -rf`、`git reset --hard`、強制推送、系統根路徑操作。
187
- - 機密保護:`.env`、API key、token 不可印出、不可提交、不可上傳。
188
- - 查證不猜:使用第三方服務、Connector、MCP、CLI、API 或 plugin API 前,先核對目前工具 schema、官方文件或有版本日期的本地 runbook;查不到就標示未核實。
189
- - 權限不足就停手:檔案被鎖或沒有權限時,輸出手動操作清單,不嘗試繞過。
187
+ - 禁止破壞性指令:例如 `rm -rf`、`git reset --hard`、強制推送、系統根路徑操作。
188
+ - 機密保護:`.env`、API key、token 不可印出、不可提交、不可上傳。
189
+ - 查證不猜:使用第三方服務、Connector、MCP、CLI、API 或 plugin API 前,先核對目前工具說明、官方文件或已驗證的本地操作說明;查不到就標示未核實。
190
+ - 外部工具安全收口:用完 MCP、browser、自動化工具、notebook 或 helper server 後,AI 只可自動關閉能證明屬於本任務的資源;不明、共享、使用者或其他 AI agent 可能擁有的程序與暫存資料,必須先回報並等你確認。
191
+ - 權限不足就停手:檔案被鎖或沒有權限時,輸出手動操作清單,不嘗試繞過。
190
192
  - 發佈需明確批准:建立版本標籤、GitHub Release、npm publish、部署或上傳,都不能因「準備好了」而自動執行。
191
193
 
192
194
  ## 🔗 可選配合:Adam-AI-Instructions
@@ -196,13 +198,4 @@ Agent Handoff Kit 可與 [Adam-AI-Instructions](https://github.com/prompt-templa
196
198
  - **Adam-AI-Instructions** 負責 AI 在**單一對話**內的做事規矩:語氣、做事優先序、回覆骨架、計算紀律、用語紀律、安全護欄、輸出層分工。屬「AI 應該怎樣答你」的持久基準。
197
199
  - **Agent Handoff Kit** 負責 AI 在**對話之間**的接力:當前狀態、下一步、檔案登記、收工同下次開工。屬「AI 在對話之間怎樣記住你的項目」的持久基準。
198
200
 
199
- 這是可選配合,不影響 Agent Handoff Kit 的安裝和日常使用。想使用時,到該倉庫選擇適合你 AI 工具的版本,貼入 AI 工具設定即可。
200
-
201
- ## ⚠️ 目前限制
202
-
203
- - 目前版本為 `v0.3.36`;正式安裝請以 npm registry `latest` 顯示為準。
204
- - 這是早期可用版本,仍在持續完善中。
205
- - 升級合併屬窄範圍策略,不是完整的複雜合併工具。
206
- - `doctor` 能檢查結構,不能代替 AI 對專案內容的理解。
207
- - 未取得明確批准前,不應因安裝成功而自動建立新版本、發佈或上傳任何內容。
208
-
201
+ 這是可選配合,不影響 Agent Handoff Kit 的安裝和日常使用。想使用時,到該倉庫選擇適合你 AI 工具的版本,貼入 AI 工具設定即可。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamchanadam/agent-handoff-kit",
3
- "version": "0.3.36",
3
+ "version": "0.3.37",
4
4
  "description": "Lightweight agent harness for project memory, handoff, and multi-session continuity.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -123,15 +123,16 @@ Closeout Write Contract: before writing `dev/SESSION_HANDOFF.md`, `dev/SESSION_L
123
123
 
124
124
  1. Reconcile `dev/SESSION_HANDOFF.md`. Do not append a new state snapshot under old state. Verify `Durable Anchors`, then rewrite or explicitly confirm every section under `Closeout-Reconciled State`.
125
125
  2. Add a concise entry to `dev/SESSION_LOG.md` with work actually completed this session and the exact next-session opening message.
126
- 3. Update `dev/PROJECT_INDEX.md` if files, stack, commands, entry points, workspace identity, or durable document map changed.
127
- 4. Check `dev/DOC_SYNC_REGISTRY.md` and record required sync status.
128
- 5. Record unresolved drift risk, active worktree, parallel workspace, uncommitted changes, or blocked verification.
129
- 6. Complete the `State Reconciliation Check`: it must state when reconciliation happened, which state sections were rewritten or confirmed current, whether stale snapshots remain, whether the `Persistence routing checked` field is complete, whether completed / pending / risk / opening-message lifecycle conflicts were resolved, whether the recommended next step is explicit and reasoned, and whether the opening message matches current state. In the same step, run the handoff lifecycle consistency check before declaring handoff ready: compare `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message`. A completed or verified item must not remain as an unresolved next priority, active risk, or startup instruction unless it is explicitly reclassified as monitor-only, follow-up scope, blocked, or reopened with the missing evidence or trigger condition stated.
130
- 7. Run the handoff sufficiency check: the next AI should be able to continue from `AGENTS.md`, `dev/SESSION_HANDOFF.md`, `dev/PROJECT_INDEX.md`, and needed rule packs without searching old log history.
131
- 8. If either check fails, fix `dev/SESSION_HANDOFF.md` first; do not push current-state responsibility into `dev/SESSION_LOG.md`.
132
- 9. Regenerate `START_NEXT_SESSION_PROMPT.txt` from the fenced opening message in `dev/SESSION_HANDOFF.md`, then read it back or run the project's prompt mirror check before declaring closeout ready. `dev/SESSION_HANDOFF.md` is authoritative; `START_NEXT_SESSION_PROMPT.txt` is the stateful startup prompt that the next local agent must read. During an active session, do not regenerate it just to silence `doctor`; normal `doctor` may warn about drift, but closeout must make the copy match before handoff is declared ready.
133
- 10. Show a short closeout card, then provide the next-session startup entry in a fenced `text` code block. Primary entry, when the next local AI agent is already opened at this project root: `Start Agent Handoff` / `開工`. Fallback entry, when the next AI agent is not yet pointed at the project root: `Work in <project root>. Read AGENTS.md first, then Start Agent Handoff. Before changing anything, tell me the current state and your recommended next step.` Do not compose a separate stateful final-response prompt; the final response points to the persisted prompt file, not a third source of truth.
134
- 11. Run the closeout maintenance trigger check. This is a short required check, not a full maintenance pass every time. Record the result in the new `dev/SESSION_LOG.md` entry under `Log maintenance`.
126
+ 3. Update `dev/PROJECT_INDEX.md` if files, stack, commands, entry points, workspace identity, or durable document map changed.
127
+ 4. Check `dev/DOC_SYNC_REGISTRY.md` and record required sync status.
128
+ 5. Record unresolved drift risk, active worktree, parallel workspace, uncommitted changes, or blocked verification.
129
+ 6. If this session used external tools such as Connectors, MCPs, plugins, browser automation, DevTools, Playwright, crawlers, notebooks, local helper services, or task-created helper processes, run an ownership-based external-tool resource closeout check before declaring closeout ready. Report task-owned or agent-managed resources that were closed or cleaned, observable resources released when the runtime exposes counts / memory / temp size, retained shared / user-owned / other-agent-owned / system-level / unknown resources with redacted evidence, and any runtime visibility limits. Do not terminate, delete, disable, or reconfigure shared or ambiguous resources without explicit user confirmation under `dev/rules/integrations.md` and `dev/rules/safety.md`.
130
+ 7. Complete the `State Reconciliation Check`: it must state when reconciliation happened, which state sections were rewritten or confirmed current, whether stale snapshots remain, whether the `Persistence routing checked` field is complete, whether completed / pending / risk / opening-message lifecycle conflicts were resolved, whether the recommended next step is explicit and reasoned, and whether the opening message matches current state. In the same step, run the handoff lifecycle consistency check before declaring handoff ready: compare `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message`. A completed or verified item must not remain as an unresolved next priority, active risk, or startup instruction unless it is explicitly reclassified as monitor-only, follow-up scope, blocked, or reopened with the missing evidence or trigger condition stated.
131
+ 8. Run the handoff sufficiency check: the next AI should be able to continue from `AGENTS.md`, `dev/SESSION_HANDOFF.md`, `dev/PROJECT_INDEX.md`, and needed rule packs without searching old log history.
132
+ 9. If either check fails, fix `dev/SESSION_HANDOFF.md` first; do not push current-state responsibility into `dev/SESSION_LOG.md`.
133
+ 10. Regenerate `START_NEXT_SESSION_PROMPT.txt` from the fenced opening message in `dev/SESSION_HANDOFF.md`, then read it back or run the project's prompt mirror check before declaring closeout ready. `dev/SESSION_HANDOFF.md` is authoritative; `START_NEXT_SESSION_PROMPT.txt` is the stateful startup prompt that the next local agent must read. During an active session, do not regenerate it just to silence `doctor`; normal `doctor` may warn about drift, but closeout must make the copy match before handoff is declared ready.
134
+ 11. Show a short closeout card, then provide the next-session startup entry in a fenced `text` code block. Primary entry, when the next local AI agent is already opened at this project root: `Start Agent Handoff` / `開工`. Fallback entry, when the next AI agent is not yet pointed at the project root: `Work in <project root>. Read AGENTS.md first, then Start Agent Handoff. Before changing anything, tell me the current state and your recommended next step.` Do not compose a separate stateful final-response prompt; the final response points to the persisted prompt file, not a third source of truth.
135
+ 12. Run the closeout maintenance trigger check. This is a short required check, not a full maintenance pass every time. Record the result in the new `dev/SESSION_LOG.md` entry under `Log maintenance`.
135
136
 
136
137
  Hard triggers:
137
138