@adamchanadam/agent-handoff-kit 0.3.6 → 0.3.7
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 +18 -9
- package/bin/agent-handoff-kit.mjs +51 -36
- package/docs/whatsnew/v0.3.7.md +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Handoff Kit
|
|
2
2
|
|
|
3
|
-
狀態:目前版本為 `v0.3.
|
|
3
|
+
狀態:目前版本為 `v0.3.7`。這是早期可用版本,仍在持續完善中。
|
|
4
4
|
|
|
5
5
|

|
|
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) ——
|
|
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
|
-
|
|
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.
|
|
251
|
+
- 目前版本為 `v0.3.7`。
|
|
243
252
|
- 這是早期可用版本,仍在持續完善中。
|
|
244
253
|
- 升級合併屬窄範圍策略,不是完整的複雜合併工具。
|
|
245
254
|
- `doctor` 能檢查結構,不能代替 AI 對專案內容的理解。
|
|
@@ -1301,10 +1301,10 @@ function printVersionAlignment(result) {
|
|
|
1301
1301
|
}
|
|
1302
1302
|
console.log(` 📦 版本:工具 v${cliVersion} / 項目記錄 v${rootVersion} / npm latest v${npmLatest}`);
|
|
1303
1303
|
if (npmLatest && compareSemver(npmLatest, cliVersion) > 0) {
|
|
1304
|
-
console.log(` npm 有新版(v${npmLatest});doctor 只檢查不修改。要升級時先執行:npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run`);
|
|
1304
|
+
console.log(` npm 有新版(v${npmLatest});doctor 只檢查不修改。要升級時先執行:npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run`);
|
|
1305
1305
|
console.log(" --dry-run 只預覽、不寫入;確認計劃沒問題後,再去掉 --dry-run 正式升級。");
|
|
1306
1306
|
} else if (cliVersion !== rootVersion) {
|
|
1307
|
-
console.log(" 項目內記錄的 Kit 版本與目前工具版本不同;doctor 只檢查不修改。要對齊時先執行:npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run");
|
|
1307
|
+
console.log(" 項目內記錄的 Kit 版本與目前工具版本不同;doctor 只檢查不修改。要對齊時先執行:npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run");
|
|
1308
1308
|
console.log(" --dry-run 只預覽、不寫入;確認計劃沒問題後,再去掉 --dry-run 正式升級。");
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
|
@@ -1312,13 +1312,13 @@ function printVersionAlignment(result) {
|
|
|
1312
1312
|
function getVersionAlignmentNextStep(result) {
|
|
1313
1313
|
const { cliVersion, rootVersion, npmLatest } = result;
|
|
1314
1314
|
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 正式升級。`;
|
|
1315
|
+
return `檢查已通過,但 npm 有新版 v${npmLatest}。doctor 沒有修改檔案;建議先執行 npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認計劃沒問題後,再去掉 --dry-run 正式升級。`;
|
|
1316
1316
|
}
|
|
1317
1317
|
if (rootVersion === null) {
|
|
1318
|
-
return "檢查已通過,但項目版本記錄缺失。doctor 沒有修改檔案;建議先執行 npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認只會補齊工具維護的版本記錄後,再去掉 --dry-run 正式升級。";
|
|
1318
|
+
return "檢查已通過,但項目版本記錄缺失。doctor 沒有修改檔案;建議先執行 npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認只會補齊工具維護的版本記錄後,再去掉 --dry-run 正式升級。";
|
|
1319
1319
|
}
|
|
1320
1320
|
if (cliVersion !== rootVersion) {
|
|
1321
|
-
return "檢查已通過,但項目版本記錄未與目前工具對齊。doctor 沒有修改檔案;建議先執行 npx @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認後再去掉 --dry-run 正式升級。";
|
|
1321
|
+
return "檢查已通過,但項目版本記錄未與目前工具對齊。doctor 沒有修改檔案;建議先執行 npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run。--dry-run 只預覽、不寫入;確認後再去掉 --dry-run 正式升級。";
|
|
1322
1322
|
}
|
|
1323
1323
|
return null;
|
|
1324
1324
|
}
|
|
@@ -1808,14 +1808,15 @@ function compareSemver(left, right) {
|
|
|
1808
1808
|
return 0;
|
|
1809
1809
|
}
|
|
1810
1810
|
|
|
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
|
-
"
|
|
1811
|
+
function printUpdateNotice(currentVersion, latestVersion) {
|
|
1812
|
+
const releaseUrl = "https://github.com/Adamchanadam/agent-handoff-kit/releases/latest";
|
|
1813
|
+
const command = "npx --yes @adamchanadam/agent-handoff-kit@latest <command>";
|
|
1814
|
+
const lines = [
|
|
1815
|
+
`✨ 有新版可用:${currentVersion} -> ${latestVersion}`,
|
|
1816
|
+
`如要使用最新版,執行:${command}`,
|
|
1817
|
+
"這只讓 npm 取得執行工具;doctor 只檢查,不會安裝項目文件。",
|
|
1818
|
+
"",
|
|
1819
|
+
"如果你是全域安裝:",
|
|
1819
1820
|
"npm install -g @adamchanadam/agent-handoff-kit",
|
|
1820
1821
|
"",
|
|
1821
1822
|
"完整 release notes:",
|
|
@@ -1856,13 +1857,14 @@ function printInstallNextSteps(root, conflictCount) {
|
|
|
1856
1857
|
// question: "is this installed and what do I do next?"
|
|
1857
1858
|
console.log("📋 如何確認安裝完成:");
|
|
1858
1859
|
console.log("");
|
|
1859
|
-
console.log(" 1. 在 Terminal 執行 npx @adamchanadam/agent-handoff-kit doctor,應該見到「status: passed」");
|
|
1860
|
+
console.log(" 1. 在 Terminal 執行 npx --yes @adamchanadam/agent-handoff-kit@latest doctor,應該見到「status: passed」");
|
|
1860
1861
|
console.log(" 2. 你的 dev/ 資料夾應該有規則、交接與工作紀錄等檔案");
|
|
1861
1862
|
console.log(" 3. 在你使用的 AI 工具(Claude Code / Codex / Gemini)開新對話,貼下面起步句");
|
|
1862
1863
|
console.log("");
|
|
1863
1864
|
console.log("⚠️ 注意:Agent Handoff Kit 是放在項目資料夾內的一組交接檔案。");
|
|
1864
1865
|
console.log(" 它沒有圖形介面,不會啟動伺服器,也不會自動替你做事;你需要在 AI 對話中使用它。");
|
|
1865
|
-
console.log("");
|
|
1866
|
+
console.log(" `npx --yes ...` 只是讓 npm 取得執行工具;不代表 doctor 會安裝或修改項目文件。");
|
|
1867
|
+
console.log("");
|
|
1866
1868
|
console.log("------------------------------------------------------------");
|
|
1867
1869
|
console.log("⚠️ 請注意:下面文字不是 Terminal 指令。");
|
|
1868
1870
|
console.log("📋 請打開你要使用的 AI 工具,新增一段對話,貼上下面一句:");
|
|
@@ -1875,11 +1877,11 @@ function printInstallNextSteps(root, conflictCount) {
|
|
|
1875
1877
|
console.log("");
|
|
1876
1878
|
console.log("💡 之後你熟悉流程後,可改用更直接的開工句:");
|
|
1877
1879
|
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
|
-
}
|
|
1880
|
+
console.log("");
|
|
1881
|
+
console.log("🩺 如要檢查安裝是否完整,可在 Terminal 執行:");
|
|
1882
|
+
console.log(" npx --yes @adamchanadam/agent-handoff-kit@latest doctor");
|
|
1883
|
+
console.log("============================================================");
|
|
1884
|
+
}
|
|
1883
1885
|
|
|
1884
1886
|
// R-031 v0.3.1+: Upgrade substantive next-step block. Distinct from install
|
|
1885
1887
|
// (`printInstallNextSteps`) because the user is not first-time; pushing them through
|
|
@@ -2012,11 +2014,11 @@ function printUpgradeNoopShortCircuit(version) {
|
|
|
2012
2014
|
console.log("🛠️ 模式:upgrade-existing");
|
|
2013
2015
|
console.log("🔎 剛完成:檢查所有 Kit 檔案的狀態(含 AGENTS.md、dev/SESSION_HANDOFF.md、dev/PROJECT_INDEX.md 等)。");
|
|
2014
2016
|
console.log("✅ 結果:你已經是最新版本,沒有檔案需要建立或合併;用戶填寫的內容全部保留現狀。");
|
|
2015
|
-
console.log("");
|
|
2016
|
-
console.log("🚀 下一步:繼續日常使用即可。如要檢查健康狀態,可執行:");
|
|
2017
|
-
console.log(" npx @adamchanadam/agent-handoff-kit doctor");
|
|
2018
|
-
console.log("");
|
|
2019
|
-
}
|
|
2017
|
+
console.log("");
|
|
2018
|
+
console.log("🚀 下一步:繼續日常使用即可。如要檢查健康狀態,可執行:");
|
|
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
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
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` 預覽,再決定是否正式升級。
|