@adamchanadam/agent-handoff-kit 0.3.28 → 0.3.29

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.28`。這是早期可用版本,仍在持續完善中。
3
+ 狀態:目前版本為 `v0.3.29`。這是早期可用版本,仍在持續完善中。
4
4
 
5
5
  ![Agent Handoff Kit 主視覺](https://raw.githubusercontent.com/Adamchanadam/agent-handoff-kit/main/images/agent-handoff-kit-main-visual2.png)
6
6
 
@@ -8,9 +8,17 @@ Agent Handoff Kit 是 **AI 對話之間的接力棒**。
8
8
 
9
9
  它只處理一件狹窄但重要的事:AI 跨對話失憶。每次開新對話,AI 往往不記得你上次做到哪裡,也認不出中途新建的文件、你引入的參考資料、哪些檔案是真源。這套工具把進度、下一步、風險、檔案登記與下次開工提示寫進固定文件,讓下一個 AI 工具能接得上上一棒。
10
10
 
11
- > 🚀 **第一次用?你不需要先讀本 README 或任何文件。**
12
- >
13
- > 安裝完成後,打開能讀寫本機專案資料夾的 AI agent。若 AI 已經在正確專案資料夾內,只需輸入:
11
+ > 🚀 **第一次用?你不需要先讀本 README 或任何文件。**
12
+ >
13
+ > 最簡單做法:在你要安裝或升級的資料夾打開能讀寫本機資料夾的 AI agent,貼上:
14
+ >
15
+ > ```text
16
+ > 請讀取 https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.html,並在這個資料夾安裝或升級 Agent Handoff Kit。
17
+ > ```
18
+ >
19
+ > AI 會先顯示目前資料夾並請你確認;未確認前不應安裝或升級。
20
+ >
21
+ > 安裝完成後,打開能讀寫本機專案資料夾的 AI agent。若 AI 已經在正確專案資料夾內,只需輸入:
14
22
  >
15
23
  > ```text
16
24
  > Start Agent Handoff
@@ -26,7 +34,7 @@ Agent Handoff Kit 是 **AI 對話之間的接力棒**。
26
34
  >
27
35
  > AI 會依 `AGENTS.md` 打開專案內的 `START_NEXT_SESSION_PROMPT.txt`。第一次安裝後,該檔會帶它載入新手引導;之後每次收工後,該檔會改成下一次接力需要的真實狀態。本 README 與下方介紹頁是參考對照,不是必讀。
28
36
 
29
- 想先看非技術版介紹,可打開 GitHub Pages 上的 [`agent-handoff-kit-intro.html`](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-intro.html) —— 新手 60 秒入門。看完想看實際操作示範,可開 [`agent-handoff-kit-guide.html`](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-guide.html) —— 三個日常情境的完整流程示範。本 README 則保留安裝、日常使用與限制。
37
+ 想先看非技術版介紹,可打開 GitHub Pages 上的 [`agent-handoff-kit-intro.html`](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-intro.html) —— 新手 60 秒入門。看完想看實際操作示範,可開 [`agent-handoff-kit-guide.html`](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-guide.html) —— 三個日常情境的完整流程示範。若想讓 AI 代你判斷安裝或升級,給 AI 讀 [`agent-handoff-kit-ai-install.html`](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.html)。本 README 則保留安裝、日常使用與限制。
30
38
 
31
39
  ## 它解決甚麼問題
32
40
 
@@ -45,7 +53,7 @@ Agent Handoff Kit 是 **AI 對話之間的接力棒**。
45
53
 
46
54
  ![Agent Handoff Kit 新手流程](https://raw.githubusercontent.com/Adamchanadam/agent-handoff-kit/main/images/agent-handoff-kit-new-user-flow.png)
47
55
 
48
- 這張圖是給第一次使用的人看的流程摘要:先在專案資料夾安裝,然後在能讀寫本機資料夾的 AI 對話輸入 `Start Agent Handoff` 或「開工」;AI 會依 `AGENTS.md` 打開 `START_NEXT_SESSION_PROMPT.txt` 進入新手引導。準備結束本輪工作時說「收工」,讓 AI 留下下一次能接上的交接。
56
+ 這張圖是給第一次使用的人看的流程摘要:先在目標資料夾讓 AI 讀安裝指令頁,或手動執行 `npx --yes @adamchanadam/agent-handoff-kit@latest init`;安裝完成後,在能讀寫本機資料夾的 AI 對話輸入 `Start Agent Handoff` 或「開工」。AI 會依 `AGENTS.md` 打開 `START_NEXT_SESSION_PROMPT.txt` 進入新手引導。準備結束本輪工作時說「收工」,讓 AI 留下下一次能接上的交接。
49
57
 
50
58
  ### 適用工具
51
59
 
@@ -53,9 +61,19 @@ Agent Handoff Kit 適合能讀寫本機專案資料夾的 agentic AI 工具,
53
61
 
54
62
  它不適合普通 web chat AI,例如沒有本機檔案讀寫能力的 ChatGPT、Claude、Gemini 網頁版。上載檔案或貼上交接內容不能取代本工具需要的本機讀寫能力;這類工具不能可靠維護專案內的交接文件。
55
63
 
56
- ### 一、安裝
57
-
58
- 在你的專案資料夾打開終端機,執行:
64
+ ### 一、安裝
65
+
66
+ 最簡單做法,是在目標資料夾打開能讀寫本機資料夾的 AI agent,貼上:
67
+
68
+ ```text
69
+ 請讀取 https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.html,並在這個資料夾安裝或升級 Agent Handoff Kit。
70
+ ```
71
+
72
+ AI 應先顯示目前資料夾的絕對路徑,問你是否就是要安裝或升級的資料夾;確認後才判斷要執行 `init`、`upgrade --dry-run`、`upgrade` 或停在衝突狀態。
73
+
74
+ 如你想手動安裝,才用下面的終端機指令。
75
+
76
+ 在你的專案資料夾打開終端機,執行:
59
77
 
60
78
  ```bash
61
79
  npx --yes @adamchanadam/agent-handoff-kit@latest init
@@ -71,13 +89,15 @@ npx --yes @adamchanadam/agent-handoff-kit@latest init
71
89
 
72
90
  安裝成功後,先做 AI 對話,不必立刻跑 `doctor`。`doctor` 是之後不確定狀態、升級後驗收,或 AI 要排錯時才需要用的檢查工具。
73
91
 
74
- ### 常見入口
75
-
76
- | 你現在的狀態 | 建議指令 |
77
- |---|---|
78
- | 第一次在新資料夾使用 | `npx --yes @adamchanadam/agent-handoff-kit@latest init` |
79
- | 已安裝舊版,或已有 AI 記憶文件 | `npx --yes @adamchanadam/agent-handoff-kit@latest upgrade` |
80
- | 不確定是否安裝完整,或升級後想檢查 | `npx --yes @adamchanadam/agent-handoff-kit@latest doctor` |
92
+ ### 手動入口
93
+
94
+ 如果你不用 AI 代判斷安裝或升級,才直接使用下表指令。
95
+
96
+ | 你現在的狀態 | 手動指令 |
97
+ |---|---|
98
+ | 第一次在新資料夾使用 | `npx --yes @adamchanadam/agent-handoff-kit@latest init` |
99
+ | 已安裝舊版,或已有 AI 記憶文件 | `npx --yes @adamchanadam/agent-handoff-kit@latest upgrade` |
100
+ | 不確定是否安裝完整,或升級後想檢查 | `npx --yes @adamchanadam/agent-handoff-kit@latest doctor` |
81
101
 
82
102
  ### 已安裝舊版,或已有 AI 記憶文件?
83
103
 
@@ -259,6 +279,8 @@ scan for unbridged governance documents
259
279
 
260
280
  這個掃描只列出候選與缺口,不會一邊掃描一邊自動修改。若你同意其中某個建議,可以再叫 AI 按建議補丁更新索引、同步登記或相關流程。若涉及刪除、改名、合併真源,AI 只會列出合併、引用或退役建議,等你明確確認。
261
281
 
282
+ 這裡的「接入 Agent Handoff Kit」只指文件接合:避免重要文件變成下一個 AI 不知道要讀、不知道要更新的孤兒文件。若你想保存一條長期有效的做法,例如「以後都用這個 API 調用方式」、「把今次錯誤變成日後機制」、「這條工具使用方法要跨 session 生效」,請直接說「把這件事轉成長期機制」或「寫入長期治理」。AI 應把這類內容分流到規則包、項目索引、同步登記、決策紀錄或驗收檢查;不應只寫入 `dev/SESSION_LOG.md`、`dev/SESSION_HANDOFF.md` 或 `START_NEXT_SESSION_PROMPT.txt`。
283
+
262
284
  ## 外部工具治理
263
285
 
264
286
  如你的項目涉及外部工具(例如 Notion、Google Drive、Slack、Linear、GitHub 等),Agent Handoff Kit 提供跨對話的治理紀律,確保 AI 在不同對話之間能穩定使用這些工具。
@@ -284,6 +306,7 @@ scan for unbridged governance documents
284
306
  | 準備發佈說明 | 發佈規則;真正發佈、上傳或建立版本前必須再讀安全規則 |
285
307
  | 改規則、改流程、整理交接 | AI 治理規則;先找既有真源,不盲目新增規則 |
286
308
  | 新建重要文件後想避免變孤兒 | AI 治理規則;說「把 <檔案> 接入 Agent Handoff Kit」,讓 AI 檢查索引、同步責任、相關流程與重複真源風險 |
309
+ | 把錯誤經驗、API 用法或工具用法變成日後都有效的機制 | AI 治理規則;說「轉成長期機制」或「寫入長期治理」,讓 AI 找正確持久位置,不只留在 session log 或 handoff |
287
310
 
288
311
  原則是只讀當前任務需要的規則,不是每次讀全部文件。
289
312
 
@@ -314,11 +337,11 @@ Agent Handoff Kit 可與 [Adam-AI-Instructions](https://github.com/prompt-templa
314
337
  - **Adam-AI-Instructions** 負責 AI 在**單一對話**內的做事規矩:語氣、做事優先序、回覆骨架、計算紀律、用語紀律、安全護欄、輸出層分工。屬「AI 應該怎樣答你」的持久基準。
315
338
  - **Agent Handoff Kit** 負責 AI 在**對話之間**的接力:當前狀態、下一步、檔案登記、收工同下次開工。屬「AI 在對話之間怎樣記住你的項目」的持久基準。
316
339
 
317
- 到該倉庫的「五、提示詞索引」選擇適合你 AI 工具的版本(Claude Cowork、Claude Code、OpenAI Codex、ChatGPT 等),複製對應子目錄的 `prompt.md` 全文,貼入 AI 工具設定。然後再在項目資料夾執行 `npx --yes @adamchanadam/agent-handoff-kit@latest init` 安裝本工具。兩者配合,就能同時照顧單次對話的做事規矩,以及不同對話之間的項目接力。
340
+ 到該倉庫的「五、提示詞索引」選擇適合你 AI 工具的版本(Claude Cowork、Claude Code、OpenAI Codex、ChatGPT 等),複製對應子目錄的 `prompt.md` 全文,貼入 AI 工具設定。然後在項目資料夾打開能讀寫本機資料夾的 AI agent,請它讀 `https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.html` 並在這個資料夾安裝或升級本工具;如你想手動處理,才執行 `npx --yes @adamchanadam/agent-handoff-kit@latest init`。兩者配合,就能同時照顧單次對話的做事規矩,以及不同對話之間的項目接力。
318
341
 
319
342
  ## 目前限制
320
343
 
321
- - 目前版本為 `v0.3.28`;正式安裝請以 npm registry `latest` 顯示為準。
344
+ - 目前版本為 `v0.3.29`;正式安裝請以 npm registry `latest` 顯示為準。
322
345
  - 這是早期可用版本,仍在持續完善中。
323
346
  - 升級合併屬窄範圍策略,不是完整的複雜合併工具。
324
347
  - `doctor` 能檢查結構,不能代替 AI 對專案內容的理解。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamchanadam/agent-handoff-kit",
3
- "version": "0.3.28",
3
+ "version": "0.3.29",
4
4
  "description": "Lightweight agent harness for project memory, handoff, and multi-session continuity.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,6 +9,7 @@ Use for governance rules, prompts, agent instructions, handoff systems, startup/
9
9
  - User asks to change AI behavior, project governance, prompts, handoff, startup, closeout, or tool-use rules.
10
10
  - A change affects `AGENTS.md`, `dev/*`, rule packs, installer templates, or durable workflow docs.
11
11
  - User asks to "治理打通", "把文件接入 Agent Handoff Kit", "接入 Agent Handoff Kit", "掃描未接入 Agent Handoff Kit 的重要文件", "bridge governance", "connect this document to governance", or scan for unbridged governance documents.
12
+ - User asks to make something long-term, cross-session, reusable, "寫入長期治理", "轉成長期機制", "之後都要遵守", or says future sessions should remember an API / MCP / tool-use pattern.
12
13
 
13
14
  ## Rules
14
15
 
@@ -21,6 +22,7 @@ Use for governance rules, prompts, agent instructions, handoff systems, startup/
21
22
  7. When a task uses external skills, subagents, demo workspaces, or another tool's closeout, treat those flows as subordinate to the active root's Agent Handoff Kit governance. The active root still needs the `runtime-core/AGENTS.core.md` persistence gate decision; do not duplicate the gate thresholds in this pack.
22
23
  8. For long-running projects, maintain `dev/PROJECT_DECISIONS.md` per R-028 closeout discipline (see `runtime-core/AGENTS.core.md` closeout maintenance trigger check): capture major decisions when they happen, run the short trigger check at every closeout, and do full long-term maintenance only when a hard trigger, semantic trigger, or 10-closeout backstop applies. Short single-task projects keep this as a no-op default; users are not expected to edit this file manually.
23
24
  9. Governance bridge is a triggered review, not a default startup scan. Use it when an important file, source-of-truth document, runbook, production guide, workflow, checklist, stock list, or similar durable document may need to be connected to project governance.
25
+ 10. Content-based trigger: long-term governance routing is content-based, not trigger-only. Even if the user does not say "轉成長期機制" or "寫入長期治理", treat a statement as durable governance when it says future sessions must follow it, when it corrects a recurring AI mistake, or when it defines a reusable API / MCP / tool-use pattern. Do not persist long-term governance knowledge only in `dev/SESSION_LOG.md`, `dev/SESSION_HANDOFF.md`, or `START_NEXT_SESSION_PROMPT.txt`; those surfaces may be compressed, archived, or regenerated.
24
26
 
25
27
  ## Governance Bridge Workflow
26
28
 
@@ -37,6 +39,23 @@ Use this workflow when the user asks for governance bridge / 治理打通 / 把
37
39
 
38
40
  For repo-wide scans, report candidates as candidates. Do not fail ordinary docs merely because they are not indexed; only durable files that future agents need to discover, update, or distinguish from drafts should be bridged.
39
41
 
42
+ ## Long-term Governance Routing
43
+
44
+ Use this workflow when the user asks to write something into long-term governance, turn an experience into a mechanism, make a rule apply across sessions, or when the content itself clearly has durable force.
45
+
46
+ 1. Classify the knowledge before writing:
47
+ - Current task state, next action, unresolved risk, or startup-needed fact -> `dev/SESSION_HANDOFF.md`.
48
+ - Chronological evidence or validation trace -> `dev/SESSION_LOG.md`.
49
+ - File maps, command maps, API reference locations, tool capability maps, and external source coordinates -> `dev/PROJECT_INDEX.md`.
50
+ - Sync obligations or external mirror duties -> `dev/DOC_SYNC_REGISTRY.md`.
51
+ - Durable decisions, architecture trade-offs, research-derived rationale, and long-term lessons -> `dev/PROJECT_DECISIONS.md`.
52
+ - Reusable procedures, recurring mistake prevention, API / MCP / tool-use rules -> the relevant rule pack, registered reference, or QA check.
53
+ - API / MCP / tool-use patterns -> project index / registered reference / integrations pack, depending on scope.
54
+ 2. If the knowledge is reusable but no existing home fits, propose the smallest new registered reference or rule-pack patch. New runbooks remain last resort.
55
+ 3. If the knowledge was first captured in `SESSION_LOG` or handoff for short-term continuity, promote it to the correct durable home before claiming it is long-term.
56
+ 4. Add or update a QA check when the same failure class could recur and can be tested.
57
+ 5. Keep governance bridge wording reserved for document orphan prevention. Do not relabel non-file governance as "file connected to Agent Handoff Kit".
58
+
40
59
  Output format:
41
60
 
42
61
  - Status: bridged / partially bridged / unbridged / blocked.
@@ -53,6 +72,7 @@ Output format:
53
72
  - Confirm old overlapping wording was retired or marked legacy.
54
73
  - Confirm any new durable file is reachable from `dev/PROJECT_INDEX.md` and does not rely only on a one-session handoff note.
55
74
  - Confirm reusable operating procedure knowledge is not stored only in `dev/SESSION_HANDOFF.md`, `dev/SESSION_LOG.md`, or a decision narrative when it belongs in a pack or registered reference.
75
+ - Confirm long-term governance knowledge is promoted out of `dev/SESSION_LOG.md`, `dev/SESSION_HANDOFF.md`, and `START_NEXT_SESSION_PROMPT.txt` when it should survive log archive or prompt regeneration.
56
76
  - For governance bridge work, confirm the target file, project index, sync registry, related workflow, handoff/log role split, and duplicate-source risk were all checked or explicitly marked not applicable.
57
77
  - Before claiming completion, apply the active root's core persistence gate and record the result only when that gate selects a checkpoint or full closeout; do not assume child or demo workspaces cover the parent/root workspace.
58
78
  - For long-running projects, confirm `dev/PROJECT_DECISIONS.md` retains its four H2 sections in order (Evolution Timeline / Decisions Archive / Architecture Choices / Insights & Learnings) and that the closeout maintenance trigger check was recorded, with full maintenance applied where its trigger conditions were met.
@@ -11,7 +11,8 @@ Read only the packs needed for the current task.
11
11
  | Sources, evidence, comparison, fact finding | `dev/rules/research.md` | source handling and uncertainty |
12
12
  | Governance, prompts, agents, handoff, startup/closeout, skills | `dev/rules/agent-governance.md` | governance changes and boundary control |
13
13
  | Governance bridge / 治理打通 / 把文件接入 Agent Handoff Kit / 接入 Agent Handoff Kit / 掃描未接入 Agent Handoff Kit 的重要文件 / bridge governance / connect this document to governance / scan for unbridged governance documents | `dev/rules/agent-governance.md` | connect important files, source-of-truth documents, runbooks, workflows, checklists, and guides to the project index, sync registry, handoff/log roles, and related workflows without creating duplicate sources of truth |
14
- | Release, publish, deploy, tag, hotfix, GA | `dev/rules/release.md` | release verification and evidence |
14
+ | Long-term governance routing / 寫入長期治理 / 轉成長期機制 / 之後都要遵守 / 跨 session 有效 / future sessions should remember / always use this API or MCP pattern | `dev/rules/agent-governance.md` | classify durable non-file knowledge by role and store it in the right home: rule pack, registered reference, project index, sync registry, project decisions, or QA check; do not leave reusable governance only in session log or handoff |
15
+ | Release, publish, deploy, tag, hotfix, GA | `dev/rules/release.md` | release verification and evidence |
15
16
  | External notes, knowledge base, Notion, Obsidian, Google Drive | `dev/rules/knowledge.md` | external knowledge source integration |
16
17
  | External tool integrations (Connector / MCP / Plugin / Skill) — declared in `## Installed Integrations`; tasks involving Notion / Google Drive / Slack / Linear / Dropbox / HubSpot / GitHub / etc. external read-write | `dev/rules/integrations.md` | Connector-first default + credential separation + multi-layer source-of-truth + cross-session resilience |
17
18
  | Reply format, language, output schema | `dev/rules/communication.md` | user-facing response rules |