@adamchanadam/agent-handoff-kit 0.3.6 → 0.3.8

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.6`。這是早期可用版本,仍在持續完善中。
3
+ 狀態:目前版本為 `v0.3.8`。這是早期可用版本,仍在持續完善中。
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
 
@@ -18,7 +18,7 @@ Agent Handoff Kit 是 **AI Session 之間的接力棒**。
18
18
  >
19
19
  > AI 會自動引導你選擇使用情境(寫代碼 / 寫報告 / 整理知識庫 / 學寫代碼 / 其他),然後一步一步帶你做第一個任務。本 README 與下方介紹頁是參考對照,不是必讀。
20
20
 
21
- 想先看非技術版介紹,可打開 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 則保留安裝、日常使用與限制。
21
+ 想先看非技術版介紹,可打開 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 項目演進)的完整流程示範。本 README 則保留安裝、日常使用與限制。
22
22
 
23
23
  ## 它解決甚麼問題
24
24
 
@@ -40,11 +40,20 @@ Agent Handoff Kit 是 **AI Session 之間的接力棒**。
40
40
  在你的專案資料夾打開 Terminal,執行:
41
41
 
42
42
  ```bash
43
- npx @adamchanadam/agent-handoff-kit init
43
+ npx --yes @adamchanadam/agent-handoff-kit@latest init
44
44
  ```
45
45
 
46
46
  出現確認問題時,輸入 `yes`。
47
47
 
48
+ 這是本工具建議的正式 `npx` 寫法。不要省略 `--yes` 與 `@latest`;裸寫不帶 `--yes` / `@latest` 的 `npx doctor` 雖然可能由 npm 執行,但不是本工具的建議用戶路徑,容易先出現 npm 自己的安裝提示,造成誤解。
49
+
50
+ 這裡的 `--yes` 只用來回答 npm「是否先下載這個執行工具」的提示;它不是把 Handoff Kit 文件靜默寫入你的項目。真正會建立項目文件的是 `init`,而且工具仍會顯示計劃與確認步驟。
51
+
52
+ 請分清兩層「安裝」:
53
+
54
+ - **項目內的 Kit 文件**:`AGENTS.md`、`dev/SESSION_HANDOFF.md`、`dev/rules/*.md` 等,這些是 `init` 或正式 `upgrade` 管理的交接文件。
55
+ - **電腦用來執行指令的 npm 工具**:`npx` 需要先取得 `@adamchanadam/agent-handoff-kit` 這個執行工具,才有辦法跑 `init`、`upgrade` 或 `doctor`。即使目前資料夾已安裝舊版 Kit 文件,`npx` 仍可能因本機沒有可執行工具而顯示「Need to install the following packages」。判斷點不是資料夾有沒有 `AGENTS.md` 或 `dev/`,而是當下是否已有可執行的 npm 工具。那只是 npm 取得執行工具,不等於 `doctor` 正在安裝或改動你的項目。
56
+
48
57
  安裝完成後,你會看到一段 `Work in ...` 文字。請特別留意:那一段不是給 Terminal 的指令,而是要貼到 AI 對話。
49
58
 
50
59
  ### 二、開工
@@ -95,12 +104,12 @@ START_NEXT_SESSION_PROMPT.txt
95
104
  如要檢查安裝是否完整,可在 Terminal 執行:
96
105
 
97
106
  ```bash
98
- npx @adamchanadam/agent-handoff-kit doctor
107
+ npx --yes @adamchanadam/agent-handoff-kit@latest doctor
99
108
  ```
100
109
 
101
110
  看到 `status: passed`,代表必要文件、基本結構與下次開工提示副本的一致性都通過檢查。
102
111
 
103
- 這個檢查只能確認文件結構,不代表 AI 已理解你的專案。真正開始工作前,仍應要求 AI 先讀入口文件並說明目前狀態。
112
+ `doctor` 只檢查,不會建立或修改項目文件。若你不用 `--yes`,npm 可能先問是否下載 `@adamchanadam/agent-handoff-kit` 來執行指令;那是取得檢查工具,不是安裝 Kit 到目前資料夾。這個檢查只能確認文件結構,不代表 AI 已理解你的專案。真正開始工作前,仍應要求 AI 先讀入口文件並說明目前狀態。
104
113
 
105
114
  ## 會安裝甚麼
106
115
 
@@ -205,13 +214,13 @@ dev/rules/*.md
205
214
  如果你的專案已經裝過舊版 Agent Handoff Kit,或本來已有 `AGENTS.md`、`CLAUDE.md`、`GEMINI.md` 等 AI 記憶文件,可先用最新版安裝工具預演會發生甚麼:
206
215
 
207
216
  ```bash
208
- npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run
217
+ npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run
209
218
  ```
210
219
 
211
220
  確認沒有問題後,再執行:
212
221
 
213
222
  ```bash
214
- npx @adamchanadam/agent-handoff-kit@latest upgrade
223
+ npx --yes @adamchanadam/agent-handoff-kit@latest upgrade
215
224
  ```
216
225
 
217
226
  `@latest` 代表使用 npm 上最新版本的 Agent Handoff Kit。`upgrade` 則負責把專案內已安裝的文件、規則與檢查結構安全更新。升級工具會保留既有檔案;能安全合併時才合併,不能安全合併時會回報衝突,不會靜默覆寫。
@@ -235,11 +244,11 @@ Agent Handoff Kit 同 [Adam-AI-Instructions](https://github.com/prompt-templates
235
244
  - **Adam-AI-Instructions** 負責 AI 在**單一對話**內的做事規矩:語氣、做事優先序、回覆骨架、計算紀律、用語紀律、安全護欄、輸出層分工。屬「AI 應該怎樣答你」的持久基準。
236
245
  - **Agent Handoff Kit** 負責 AI 在**對話之間**的接力:當前狀態、下一步、檔案登記、收工同下次開工。屬「AI 在對話之間怎樣記住你的項目」的持久基準。
237
246
 
238
- 到該 repo 的「五、Prompt 索引」選擇適合你 AI 工具的版本(Claude Cowork、Claude Code、OpenAI Codex、ChatGPT 等),複製對應子目錄的 `prompt.md` 全文,貼入 AI 工具的設定區(例如 Claude Cowork 的 Global Instructions、Claude Code 的 `~/.claude/CLAUDE.md`、ChatGPT 的 Custom Instructions)。然後再在項目資料夾執行 `npx @adamchanadam/agent-handoff-kit init` 安裝本工具。兩者配合就能涵蓋「單次對話質素」加「跨對話接力」兩個維度。
247
+ 到該 repo 的「五、Prompt 索引」選擇適合你 AI 工具的版本(Claude Cowork、Claude Code、OpenAI Codex、ChatGPT 等),複製對應子目錄的 `prompt.md` 全文,貼入 AI 工具的設定區(例如 Claude Cowork 的 Global Instructions、Claude Code 的 `~/.claude/CLAUDE.md`、ChatGPT 的 Custom Instructions)。然後再在項目資料夾執行 `npx --yes @adamchanadam/agent-handoff-kit@latest init` 安裝本工具。兩者配合就能涵蓋「單次對話質素」加「跨對話接力」兩個維度。
239
248
 
240
249
  ## 目前限制
241
250
 
242
- - 目前版本為 `v0.3.6`。
251
+ - 目前版本為 `v0.3.8`。
243
252
  - 這是早期可用版本,仍在持續完善中。
244
253
  - 升級合併屬窄範圍策略,不是完整的複雜合併工具。
245
254
  - `doctor` 能檢查結構,不能代替 AI 對專案內容的理解。
@@ -490,21 +490,22 @@ async function runInstall(command, root, options, version) {
490
490
  && planConflictCount === 0
491
491
  && !projectIndexVersionNeedsInject;
492
492
 
493
- if (isUpgradeNoopAtPlanTime) {
494
- printCard(version, "continuity ready", "o.o");
495
- console.log(`command: ${command}`);
496
- console.log(`current directory: ${process.cwd()}`);
497
- console.log(`selected root: ${root}`);
498
- console.log(`mode: ${mode}`);
493
+ if (isUpgradeNoopAtPlanTime) {
494
+ const noOpHealth = await assessUpgradeNoopHealth(root);
495
+ printCard(version, "continuity ready", "o.o");
496
+ console.log(`command: ${command}`);
497
+ console.log(`current directory: ${process.cwd()}`);
498
+ console.log(`selected root: ${root}`);
499
+ console.log(`mode: ${mode}`);
499
500
  console.log("");
500
501
  console.log(`📋 計劃預覽:create 0 / merge 0 / skip ${planSkipCount} / conflict 0 — 沒有檔案需要建立或合併。`);
501
502
  if (options.dryRun) {
502
- console.log("");
503
- console.log("dry-run: no files written");
504
- }
505
- printUpgradeNoopShortCircuit(version);
506
- return;
507
- }
503
+ console.log("");
504
+ console.log("dry-run: no files written");
505
+ }
506
+ printUpgradeNoopShortCircuit(version, noOpHealth);
507
+ return;
508
+ }
508
509
 
509
510
  // R-031.3 v0.3.3+: For upgrade scenarios, capture pre-upgrade root template version
510
511
  // before the create/merge/inject loops mutate PROJECT_INDEX. This snapshot is later
@@ -888,55 +889,37 @@ function normalizePrompt(text) {
888
889
 
889
890
  function assessHandoffLifecycleConsistency(text) {
890
891
  const fieldValue = fieldValueAfterMarker(text, "lifecycle-conflicts-resolved");
891
- if (fieldValue && /\b(no|blocked|uncertain)\b|否|阻擋|不確定/i.test(fieldValue)) {
892
+ if (isUnresolvedLifecycleFieldValue(fieldValue)) {
892
893
  return { ok: false, reason: "lifecycle field is explicitly unresolved" };
893
894
  }
894
-
895
- const evidenceText = [
896
- extractSectionText(text, "completed-this-session", "Completed This Session"),
897
- extractSectionText(text, "validation-qc", "Validation / QC")
898
- ].join("\n");
899
- const targetText = [
900
- extractSectionText(text, "next-priorities", "Next Priorities"),
901
- extractSectionText(text, "risks-blockers", "Risks / Blockers"),
902
- extractSectionText(text, "next-session-opening-message", "Next Session Opening Message")
903
- ].join("\n");
904
-
905
- const topics = extractLifecycleTopics(evidenceText);
906
- for (const topic of topics) {
907
- if (hasUnresolvedCarryForward(targetText, topic)) {
908
- return { ok: false, reason: `completed topic carried forward unresolved: ${topic}` };
909
- }
895
+ if (isPlaceholderLifecycleFieldValue(fieldValue) && hasSubstantiveHandoffState(text)) {
896
+ return { ok: false, reason: "lifecycle field is still placeholder after handoff content changed" };
910
897
  }
911
-
912
898
  return { ok: true, reason: "" };
913
899
  }
914
900
 
915
- function extractLifecycleTopics(text) {
916
- const topics = new Set();
917
- for (const match of text.matchAll(/`([^`\n]{2,80})`/g)) {
918
- const topic = match[1].trim();
919
- if (!topic || /^dev\/|^docs\/|\.md$|\.txt$|\.json$|^AGENTS\.md$/.test(topic)) continue;
920
- topics.add(topic);
921
- }
922
- return [...topics];
901
+ function isUnresolvedLifecycleFieldValue(value) {
902
+ return /\b(no|blocked|uncertain)\b|否|阻擋|不確定/i.test(value || "");
923
903
  }
924
904
 
925
- function hasUnresolvedCarryForward(text, topic) {
926
- const escaped = escapeRegExp(topic);
927
- const pattern = new RegExp(escaped, "ig");
928
- for (const match of text.matchAll(pattern)) {
929
- const start = Math.max(0, match.index - 180);
930
- const end = Math.min(text.length, match.index + topic.length + 180);
931
- const context = text.slice(start, end);
932
- if (/\b(monitor-only|follow-up scope|blocked|reopened|re-opened|if new evidence|conditional|no-op)\b|只監察|監察|後續範圍|跟進範圍|阻擋|已重開|明確重開|新證據/i.test(context)) {
933
- continue;
934
- }
935
- if (/\b(investigate|reproduce|pending|todo|unresolved|must start|start with read-only|reliability concern remains open|needs investigation)\b|調查|重查|未解|待辦|仍需|未完成|開始.{0,20}核查|先.{0,20}調查/i.test(context)) {
936
- return true;
937
- }
938
- }
939
- return false;
905
+ function isPlaceholderLifecycleFieldValue(value) {
906
+ return !value || /\b(TBD|todo|pending|unverified|unknown|needs-review)\b|待核對|待確認|未核對|未確認/i.test(value);
907
+ }
908
+
909
+ function hasSubstantiveHandoffState(text) {
910
+ const sections = [
911
+ extractSectionText(text, "completed-this-session", "Completed This Session"),
912
+ extractSectionText(text, "validation-qc", "Validation / QC")
913
+ ].join("\n");
914
+ const body = sections.replace(/```[\s\S]*?```/g, "");
915
+ return body.split(/\r?\n/).some((line) => {
916
+ const trimmed = line.trim();
917
+ if (!trimmed || trimmed.startsWith("##") || trimmed.startsWith("<!--")) return false;
918
+ if (/^Record only work actually completed/i.test(trimmed)) return false;
919
+ if (/\bTBD\b|待定|待核對|未適用/i.test(trimmed)) return false;
920
+ const normalized = trimmed.replace(/^[\d.*\-)\s]+/, "").replace(/[`\s#|:\-*/()[\].,;,。;、]/g, "");
921
+ return normalized.length > 20;
922
+ });
940
923
  }
941
924
 
942
925
  function fieldValueAfterMarker(text, fieldId) {
@@ -1301,10 +1284,10 @@ function printVersionAlignment(result) {
1301
1284
  }
1302
1285
  console.log(` 📦 版本:工具 v${cliVersion} / 項目記錄 v${rootVersion} / npm latest v${npmLatest}`);
1303
1286
  if (npmLatest && compareSemver(npmLatest, cliVersion) > 0) {
1304
- console.log(` npm 有新版(v${npmLatest});doctor 只檢查不修改。要升級時先執行:npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run`);
1287
+ console.log(` npm 有新版(v${npmLatest});doctor 只檢查不修改。要升級時先執行:npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run`);
1305
1288
  console.log(" --dry-run 只預覽、不寫入;確認計劃沒問題後,再去掉 --dry-run 正式升級。");
1306
1289
  } else if (cliVersion !== rootVersion) {
1307
- console.log(" 項目內記錄的 Kit 版本與目前工具版本不同;doctor 只檢查不修改。要對齊時先執行:npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run");
1290
+ console.log(" 項目內記錄的 Kit 版本與目前工具版本不同;doctor 只檢查不修改。要對齊時先執行:npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run");
1308
1291
  console.log(" --dry-run 只預覽、不寫入;確認計劃沒問題後,再去掉 --dry-run 正式升級。");
1309
1292
  }
1310
1293
  }
@@ -1312,13 +1295,13 @@ function printVersionAlignment(result) {
1312
1295
  function getVersionAlignmentNextStep(result) {
1313
1296
  const { cliVersion, rootVersion, npmLatest } = result;
1314
1297
  if (npmLatest && compareSemver(npmLatest, cliVersion) > 0) {
1315
- return `檢查已通過,但 npm 有新版 v${npmLatest}。doctor 沒有修改檔案;建議先執行 npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認計劃沒問題後,再去掉 --dry-run 正式升級。`;
1298
+ return `檢查已通過,但 npm 有新版 v${npmLatest}。doctor 沒有修改檔案;建議先執行 npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認計劃沒問題後,再去掉 --dry-run 正式升級。`;
1316
1299
  }
1317
1300
  if (rootVersion === null) {
1318
- return "檢查已通過,但項目版本記錄缺失。doctor 沒有修改檔案;建議先執行 npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認只會補齊工具維護的版本記錄後,再去掉 --dry-run 正式升級。";
1301
+ return "檢查已通過,但項目版本記錄缺失。doctor 沒有修改檔案;建議先執行 npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認只會補齊工具維護的版本記錄後,再去掉 --dry-run 正式升級。";
1319
1302
  }
1320
1303
  if (cliVersion !== rootVersion) {
1321
- return "檢查已通過,但項目版本記錄未與目前工具對齊。doctor 沒有修改檔案;建議先執行 npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認後再去掉 --dry-run 正式升級。";
1304
+ return "檢查已通過,但項目版本記錄未與目前工具對齊。doctor 沒有修改檔案;建議先執行 npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認後再去掉 --dry-run 正式升級。";
1322
1305
  }
1323
1306
  return null;
1324
1307
  }
@@ -1808,14 +1791,15 @@ function compareSemver(left, right) {
1808
1791
  return 0;
1809
1792
  }
1810
1793
 
1811
- function printUpdateNotice(currentVersion, latestVersion) {
1812
- const releaseUrl = "https://github.com/Adamchanadam/agent-handoff-kit/releases/latest";
1813
- const command = "npx @adamchanadam/agent-handoff-kit@latest <command>";
1814
- const lines = [
1815
- `✨ 有新版可用:${currentVersion} -> ${latestVersion}`,
1816
- `如要使用最新版,執行:${command}`,
1817
- "",
1818
- "如果你是全域安裝:",
1794
+ function printUpdateNotice(currentVersion, latestVersion) {
1795
+ const releaseUrl = "https://github.com/Adamchanadam/agent-handoff-kit/releases/latest";
1796
+ const command = "npx --yes @adamchanadam/agent-handoff-kit@latest <command>";
1797
+ const lines = [
1798
+ `✨ 有新版可用:${currentVersion} -> ${latestVersion}`,
1799
+ `如要使用最新版,執行:${command}`,
1800
+ "這只讓 npm 取得執行工具;doctor 只檢查,不會安裝項目文件。",
1801
+ "",
1802
+ "如果你是全域安裝:",
1819
1803
  "npm install -g @adamchanadam/agent-handoff-kit",
1820
1804
  "",
1821
1805
  "完整 release notes:",
@@ -1856,13 +1840,14 @@ function printInstallNextSteps(root, conflictCount) {
1856
1840
  // question: "is this installed and what do I do next?"
1857
1841
  console.log("📋 如何確認安裝完成:");
1858
1842
  console.log("");
1859
- console.log(" 1. 在 Terminal 執行 npx @adamchanadam/agent-handoff-kit doctor,應該見到「status: passed」");
1843
+ console.log(" 1. 在 Terminal 執行 npx --yes @adamchanadam/agent-handoff-kit@latest doctor,應該見到「status: passed」");
1860
1844
  console.log(" 2. 你的 dev/ 資料夾應該有規則、交接與工作紀錄等檔案");
1861
1845
  console.log(" 3. 在你使用的 AI 工具(Claude Code / Codex / Gemini)開新對話,貼下面起步句");
1862
1846
  console.log("");
1863
1847
  console.log("⚠️ 注意:Agent Handoff Kit 是放在項目資料夾內的一組交接檔案。");
1864
1848
  console.log(" 它沒有圖形介面,不會啟動伺服器,也不會自動替你做事;你需要在 AI 對話中使用它。");
1865
- console.log("");
1849
+ console.log(" `npx --yes ...` 只是讓 npm 取得執行工具;不代表 doctor 會安裝或修改項目文件。");
1850
+ console.log("");
1866
1851
  console.log("------------------------------------------------------------");
1867
1852
  console.log("⚠️ 請注意:下面文字不是 Terminal 指令。");
1868
1853
  console.log("📋 請打開你要使用的 AI 工具,新增一段對話,貼上下面一句:");
@@ -1875,11 +1860,11 @@ function printInstallNextSteps(root, conflictCount) {
1875
1860
  console.log("");
1876
1861
  console.log("💡 之後你熟悉流程後,可改用更直接的開工句:");
1877
1862
  console.log(` Work in ${root}. Read AGENTS.md and follow it. Before changing anything, tell me the current state and your recommended next step.`);
1878
- console.log("");
1879
- console.log("🩺 如要檢查安裝是否完整,可在 Terminal 執行:");
1880
- console.log(" npx @adamchanadam/agent-handoff-kit doctor");
1881
- console.log("============================================================");
1882
- }
1863
+ console.log("");
1864
+ console.log("🩺 如要檢查安裝是否完整,可在 Terminal 執行:");
1865
+ console.log(" npx --yes @adamchanadam/agent-handoff-kit@latest doctor");
1866
+ console.log("============================================================");
1867
+ }
1883
1868
 
1884
1869
  // R-031 v0.3.1+: Upgrade substantive next-step block. Distinct from install
1885
1870
  // (`printInstallNextSteps`) because the user is not first-time; pushing them through
@@ -2006,17 +1991,34 @@ async function printWhatsnew(root, toVersion, fromVersionOverride) {
2006
1991
  // short factual message and return. Saves disk (no migration report) + reduces noise
2007
1992
  // (no self-check doctor) + avoids misleading "安裝完成" framing for an idempotent
2008
1993
  // operation where nothing changed.
2009
- function printUpgradeNoopShortCircuit(version) {
2010
- console.log("");
2011
- console.log(`📦 版本:v${version}`);
2012
- console.log("🛠️ 模式:upgrade-existing");
1994
+ async function assessUpgradeNoopHealth(root) {
1995
+ try {
1996
+ const handoffText = await readFile(path.join(root, "dev/SESSION_HANDOFF.md"), "utf8");
1997
+ return { handoffLifecycle: assessHandoffLifecycleConsistency(handoffText) };
1998
+ } catch {
1999
+ return { handoffLifecycle: { ok: false, reason: "dev/SESSION_HANDOFF.md unreadable" } };
2000
+ }
2001
+ }
2002
+
2003
+ function printUpgradeNoopShortCircuit(version, health = { handoffLifecycle: { ok: true } }) {
2004
+ console.log("");
2005
+ console.log(`📦 版本:v${version}`);
2006
+ console.log("🛠️ 模式:upgrade-existing");
2013
2007
  console.log("🔎 剛完成:檢查所有 Kit 檔案的狀態(含 AGENTS.md、dev/SESSION_HANDOFF.md、dev/PROJECT_INDEX.md 等)。");
2014
- console.log("✅ 結果:你已經是最新版本,沒有檔案需要建立或合併;用戶填寫的內容全部保留現狀。");
2015
- console.log("");
2016
- console.log("🚀 下一步:繼續日常使用即可。如要檢查健康狀態,可執行:");
2017
- console.log(" npx @adamchanadam/agent-handoff-kit doctor");
2018
- console.log("");
2019
- }
2008
+ if (health.handoffLifecycle?.ok) {
2009
+ console.log("✅ 結果:你已經是最新版本,沒有檔案需要建立或合併;用戶填寫的內容全部保留現狀。");
2010
+ console.log("");
2011
+ console.log("🚀 下一步:繼續日常使用即可。如要檢查健康狀態,可執行:");
2012
+ console.log(" npx --yes @adamchanadam/agent-handoff-kit@latest doctor");
2013
+ console.log("");
2014
+ return;
2015
+ }
2016
+ console.log("⚠️ 結果:Kit 檔案已是最新版本,沒有檔案需要建立或合併;但交接狀態仍需 AI closeout 核對。");
2017
+ console.log("");
2018
+ console.log("🚀 下一步:先跑 doctor 取得待修項,再把輸出貼給 AI;不要重裝或覆寫用戶內容。");
2019
+ console.log(" npx --yes @adamchanadam/agent-handoff-kit@latest doctor");
2020
+ console.log("");
2021
+ }
2020
2022
 
2021
2023
  function listOrNone(items) {
2022
2024
  if (items.length === 0) return ["- none"];
@@ -2051,14 +2053,27 @@ Commands:
2051
2053
  🔄 upgrade 升級既有 Kit 文件;先用 --dry-run 預演。
2052
2054
  🩺 doctor 檢查必要文件與交接結構是否完整。
2053
2055
 
2054
- After install:
2055
- Do not type the shown "Work in ..." message into Terminal.
2056
- Open your AI tool, start a new chat, and paste it there.
2057
- The default post-install prompt triggers the onboarding pack — AI
2058
- will guide you through scenario selection (coding / research / knowledge /
2059
- learning / other / integrations governance) and walk you through your first task.
2060
- `);
2061
- console.log(`📦 版本:v${version}`);
2062
- console.log(`🛠️ 模式:help ready`);
2063
- console.log(`🚀 下一步:第一次使用先跑 init;既有專案升級用 upgrade --dry-run;要檢查現狀用 doctor。`);
2064
- }
2056
+ After install:
2057
+ Do not type the shown "Work in ..." message into Terminal.
2058
+ Open your AI tool, start a new chat, and paste it there.
2059
+ The default post-install prompt triggers the onboarding pack — AI
2060
+ will guide you through scenario selection (coding / research / knowledge /
2061
+ learning / other / integrations governance) and walk you through your first task.
2062
+
2063
+ Terminal 範例:
2064
+ npx --yes @adamchanadam/agent-handoff-kit@latest init
2065
+ npx --yes @adamchanadam/agent-handoff-kit@latest doctor
2066
+ npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run
2067
+
2068
+ 以上才是建議的 npx 用戶路徑。裸寫不帶 --yes / @latest 的 npx doctor
2069
+ 不是本工具的建議用戶路徑,容易先出現 npm 自己的安裝提示。
2070
+
2071
+ 放在 package 名稱前的 --yes 只讓 npm 取得執行工具,避免額外出現
2072
+ "Need to install" 提示。這不會令 doctor 安裝或修改項目文件;
2073
+ doctor 只檢查目前的 Kit 文件。即使資料夾已有 AGENTS.md 或 dev/,
2074
+ npx 仍可能只是先取得 npm 執行工具。
2075
+ `);
2076
+ console.log(`📦 版本:v${version}`);
2077
+ console.log(`🛠️ 模式:help ready`);
2078
+ console.log(`🚀 下一步:第一次使用先跑 npx --yes ... init;既有專案升級用 npx --yes ... upgrade --dry-run;要檢查現狀用 npx --yes ... doctor。`);
2079
+ }
@@ -0,0 +1,19 @@
1
+ # v0.3.7
2
+
3
+ ## 本版新加了甚麼
4
+
5
+ 修正舊項目執行 `doctor` 時容易誤會的 `npx` 路徑說明。官方示範統一改用 `npx --yes @adamchanadam/agent-handoff-kit@latest ...`,讓 npm 先取得執行工具的提示不再被誤解成 `doctor` 正在安裝或修改項目。
6
+
7
+ ## 對你已有檔案的影響
8
+
9
+ 本版不改動已安裝項目的交接文件結構。`doctor` 仍只做檢查,不會建立或修改項目文件。README、CLI help、新手介紹頁與操作指南會更清楚分開兩件事:項目內的 Kit 文件,以及電腦用來執行命令的 npm 工具。
10
+
11
+ ## 建議下一步
12
+
13
+ 日常檢查請使用:
14
+
15
+ ```bash
16
+ npx --yes @adamchanadam/agent-handoff-kit@latest doctor
17
+ ```
18
+
19
+ 如你已經有舊版 Kit 文件,先跑 `upgrade --dry-run` 預覽,再決定是否正式升級。
@@ -0,0 +1,19 @@
1
+ # v0.3.8
2
+
3
+ ## 本版新加了甚麼
4
+
5
+ 修正舊項目升級時的狀態提示:如果 Kit 檔案已是最新版,但交接文件仍有待核對的 closeout 欄位,`upgrade` 不再說可以繼續日常使用,而會提示先請 AI 修正交接狀態。
6
+
7
+ ## 對你已有檔案的影響
8
+
9
+ 本版不會自動覆寫你的 handoff 內容,也不會替你假裝已完成 closeout。`doctor` 會繼續指出需要修的交接結構;`upgrade` 只負責把「檔案已最新」與「交接狀態仍需核對」分清楚。
10
+
11
+ ## 建議下一步
12
+
13
+ 升級後如看到交接狀態提示,請執行:
14
+
15
+ ```bash
16
+ npx --yes @adamchanadam/agent-handoff-kit@latest doctor
17
+ ```
18
+
19
+ 然後把輸出貼給 AI,請它先做 closeout 狀態核對,不要重裝或覆寫項目文件。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamchanadam/agent-handoff-kit",
3
- "version": "0.3.6",
3
+ "version": "0.3.8",
4
4
  "description": "Lightweight agent harness for project memory, handoff, and multi-session continuity.",
5
5
  "type": "module",
6
6
  "bin": {