@adamchanadam/agent-handoff-kit 0.3.57 → 0.3.59
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.en.md +2 -2
- package/README.md +2 -2
- package/bin/agent-handoff-kit.mjs +163 -37
- package/bin/migration-baselines/official-origin-catalog.json +386 -1
- package/package.json +1 -1
- package/packs/agent-governance.md +1 -0
- package/packs/onboarding.md +4 -4
- package/runtime-core/AGENTS.core.md +3 -3
- package/runtime-core/PROJECT_INDEX.md +1 -1
- package/runtime-core/RULE_PACKS.md +1 -1
- package/runtime-core/SESSION_HANDOFF.md +1 -1
- package/runtime-core/START_NEXT_SESSION_PROMPT.txt +1 -1
package/README.en.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[繁體中文](README.md) · [Getting started](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-intro.en.html) · [Practical guide](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-guide.en.html) · [AI install page](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.en.html)
|
|
4
4
|
|
|
5
|
-
Source package version: `v0.3.
|
|
5
|
+
Source package version: `v0.3.59`. npm `@latest` and GitHub Release are verified by post-publish readback.
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<img src="https://raw.githubusercontent.com/Adamchanadam/agent-handoff-kit/main/images/agent-handoff-kit-promo-30s.gif" alt="Agent Handoff Kit overview animation" width="720">
|
|
@@ -97,7 +97,7 @@ If the AI is not yet pointed at the project folder, use the path-bearing startup
|
|
|
97
97
|
Work in <your project folder>. Read AGENTS.md first, then Start Agent Handoff. Before changing anything, tell me the current state and your recommended next step.
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
A first installation
|
|
100
|
+
A first installation marks onboarding as pending. If you only say `Start Agent Handoff` or `開工` after installing, and you do not provide a clear task in the same message, the AI should show the startup card and enter a short first-use welcome. Upgrades of existing projects do not reset that flow. When your goal and the available facts are clear, the AI may give a brief first-use frame and then begin the first safe task action.
|
|
101
101
|
|
|
102
102
|
For ordinary daily startup, the AI reads `dev/SESSION_HANDOFF.md` first. Inside the same folder it does not reread `START_NEXT_SESSION_PROMPT.txt` or `dev/SESSION_LOG.md` during normal startup. The prompt copy is only for an AI that has not yet been pointed at the project folder.
|
|
103
103
|
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
English: [README.en.md](README.en.md) · [Getting started](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-intro.en.html) · [Practical guide](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-guide.en.html) · [AI install page](https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.en.html)
|
|
4
4
|
|
|
5
|
-
原始碼套件版本:`v0.3.
|
|
5
|
+
原始碼套件版本:`v0.3.59`。npm `@latest` 與 GitHub Release 以發佈後讀回為準。
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<img src="https://raw.githubusercontent.com/Adamchanadam/agent-handoff-kit/main/images/agent-handoff-kit-promo-30s.gif" alt="Agent Handoff Kit 功能簡介動畫" width="720">
|
|
@@ -97,7 +97,7 @@ Start Agent Handoff
|
|
|
97
97
|
Work in <你的專案資料夾>. Read AGENTS.md first, then Start Agent Handoff. Before changing anything, tell me the current state and your recommended next step.
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
第一次安裝會把新手引導標記為待使用。若你安裝後只說 `Start Agent Handoff` 或「開工」,而沒有同句給出清楚任務,AI 應顯示開工卡並進入簡短新手歡迎引導;升級既有項目則不會重置這個流程。你已清楚描述目標和現有資料時,AI 可先用很短的新手框架說明工作節奏,再開始第一個安全步驟。日常「開工」先讀 `dev/SESSION_HANDOFF.md`;同一資料夾內不會再重讀 `START_NEXT_SESSION_PROMPT.txt` 或 `dev/SESSION_LOG.md`。提示副本只供尚未指向專案資料夾的 AI 接入。
|
|
101
101
|
|
|
102
102
|
「開工,繼續 <任務>」、「<項目> 開工」或 `Start Agent Handoff and continue <task>` 會直接接力。只有語句明顯可能指現實世界的開業、輪班或其他無關事件時,AI 才作一次簡短確認。
|
|
103
103
|
|
|
@@ -70,7 +70,7 @@ const requiredAnchors = [
|
|
|
70
70
|
"continuity ready",
|
|
71
71
|
"推薦下一步",
|
|
72
72
|
"Start Agent Handoff",
|
|
73
|
-
"
|
|
73
|
+
"First-use exception: when `dev/SESSION_HANDOFF.md` says `First-use guidance state: eligible`",
|
|
74
74
|
"Direct ordinary tasks do not show the card",
|
|
75
75
|
"Reachable is not the same as ingested",
|
|
76
76
|
"Proportionate Work Loop",
|
|
@@ -740,7 +740,11 @@ async function runInstall(command, root, options, version) {
|
|
|
740
740
|
await validateTransactionRoot(root, [], { createMissingRoot: false });
|
|
741
741
|
if (options.dryRun) await assertDryRunHasNoPendingTransaction(root);
|
|
742
742
|
else {
|
|
743
|
-
await
|
|
743
|
+
if (await isIgnorableCompletedCreateOnlyInitLock(root)) {
|
|
744
|
+
console.log("⚠️ stale completed init lock ignored: current files match the create-only install journal; lock remains as historical evidence.");
|
|
745
|
+
} else {
|
|
746
|
+
await recoverInterruptedTransaction(root);
|
|
747
|
+
}
|
|
744
748
|
if (command === "upgrade" && process.env.AGENT_HANDOFF_KIT_QA_RECOVER_ONLY === "1") {
|
|
745
749
|
console.log("QA recovery-only path completed; no new upgrade transaction was started.");
|
|
746
750
|
return;
|
|
@@ -873,6 +877,10 @@ async function executeInstallTransaction(command, root, mode, plan, version, can
|
|
|
873
877
|
// The user has confirmed writes. Create and revalidate a missing root only
|
|
874
878
|
// now, immediately before transaction artifacts are prepared.
|
|
875
879
|
await validateTransactionRoot(root, plan, { createMissingRoot: true });
|
|
880
|
+
if (isDirectNoClobberCreateInstall(command, plan, outputs, preflight.archiveMigrations)) {
|
|
881
|
+
await executeDirectNoClobberCreateInstall(command, root, mode, plan, version, outputs);
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
876
884
|
const transaction = await prepareTransaction(root, command, version, outputs, mode, plan, preflight.archiveMigrations);
|
|
877
885
|
try {
|
|
878
886
|
await injectBeforeLockRevalidationDrift(root, transaction.journal);
|
|
@@ -1004,6 +1012,52 @@ async function executeInstallTransaction(command, root, mode, plan, version, can
|
|
|
1004
1012
|
}
|
|
1005
1013
|
}
|
|
1006
1014
|
|
|
1015
|
+
function isDirectNoClobberCreateInstall(command, plan, outputs, archiveMigrations = []) {
|
|
1016
|
+
return ["init", "upgrade"].includes(command)
|
|
1017
|
+
&& archiveMigrations.length === 0
|
|
1018
|
+
&& outputs.length > 0
|
|
1019
|
+
&& outputs.every((output) => !output.before && output.beforeHash === null)
|
|
1020
|
+
&& plan.every((item) => item.action === "create" || item.action === "skip");
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
async function executeDirectNoClobberCreateInstall(command, root, mode, plan, version, outputs) {
|
|
1024
|
+
for (const output of outputs) {
|
|
1025
|
+
const current = await readOptionalBuffer(output.targetAbs);
|
|
1026
|
+
if (current) throw new Error(`${output.targetRel}: target appeared before create-only install write; no overwrite attempted`);
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
for (const output of outputs) {
|
|
1030
|
+
await mkdir(path.dirname(output.targetAbs), { recursive: true });
|
|
1031
|
+
await writeFile(output.targetAbs, output.after, { mode: 0o600, flag: "wx" });
|
|
1032
|
+
const written = await readOptionalBuffer(output.targetAbs);
|
|
1033
|
+
if (!written || sha256(written) !== output.afterHash) {
|
|
1034
|
+
throw new Error(`${output.targetRel}: create-only install readback failed`);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
const doctorStatus = await runDoctor(root, version, {
|
|
1039
|
+
silentCard: true,
|
|
1040
|
+
context: "post-fresh-install-project-health",
|
|
1041
|
+
skipVersionRegistryLookup: true
|
|
1042
|
+
});
|
|
1043
|
+
if (doctorStatus !== "passed") {
|
|
1044
|
+
throw new Error("post-install doctor failed; create-only install is incomplete");
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
const created = outputs.map((item) => item.targetRel);
|
|
1048
|
+
printCard(version, "continuity ready", "o.o");
|
|
1049
|
+
printInstallSummary(version, command, mode, root, {
|
|
1050
|
+
created: created.length,
|
|
1051
|
+
merged: 0,
|
|
1052
|
+
skipped: plan.filter((item) => item.action === "skip").length,
|
|
1053
|
+
conflicts: 0,
|
|
1054
|
+
directCreateOnly: true
|
|
1055
|
+
});
|
|
1056
|
+
console.log("✅ create-only install:只建立缺少檔案,沒有覆寫既有內容,也沒有建立 migration transaction。");
|
|
1057
|
+
console.log("✅ project health: passed");
|
|
1058
|
+
printInstallNextSteps(root, 0, mode, plan.filter((item) => item.action === "skip").length, { directCreateOnly: true });
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1007
1061
|
async function buildInstallTransactionPreflight(command, root, plan, version, options = {}) {
|
|
1008
1062
|
const outputs = options.candidateOutputs ?? await buildTransactionOutputs(command, root, plan, version, {
|
|
1009
1063
|
allowActiveTransaction: options.allowActiveTransaction === true
|
|
@@ -1261,11 +1315,12 @@ async function synchronizeFormalUserRulesTransactionState(command, root, byTarge
|
|
|
1261
1315
|
if (!routerOutput) return;
|
|
1262
1316
|
|
|
1263
1317
|
let prior = null;
|
|
1264
|
-
if (command === "upgrade") {
|
|
1318
|
+
if (command === "upgrade" && routerOutput.before) {
|
|
1265
1319
|
// The old formal reader is the sole authority for whether a prior router
|
|
1266
1320
|
// is eligible for transition. A path, title, or directory never grants
|
|
1267
1321
|
// this authority.
|
|
1268
|
-
|
|
1322
|
+
const allowActiveTransaction = options.allowActiveTransaction === true || await isIgnorableCompletedCreateOnlyInitLock(root);
|
|
1323
|
+
prior = await readFormalUserRules({ root, allowActiveTransaction });
|
|
1269
1324
|
}
|
|
1270
1325
|
|
|
1271
1326
|
let agentOutput = byTarget.get("AGENTS.md");
|
|
@@ -2418,6 +2473,44 @@ function processIsAlive(pid) {
|
|
|
2418
2473
|
try { process.kill(pid, 0); return true; } catch { return false; }
|
|
2419
2474
|
}
|
|
2420
2475
|
|
|
2476
|
+
async function isIgnorableCompletedCreateOnlyInitLock(root) {
|
|
2477
|
+
const lockPath = path.join(root, "dev", "governance_migrations", ".upgrade.lock");
|
|
2478
|
+
let lock;
|
|
2479
|
+
try {
|
|
2480
|
+
lock = JSON.parse(await readFile(lockPath, "utf8"));
|
|
2481
|
+
} catch {
|
|
2482
|
+
return false;
|
|
2483
|
+
}
|
|
2484
|
+
if (!lock || typeof lock !== "object" || Array.isArray(lock) || typeof lock.id !== "string" || typeof lock.journal !== "string"
|
|
2485
|
+
|| lock.command !== "init" || typeof lock.host !== "string" || !Number.isInteger(lock.pid) || lock.pid <= 0) {
|
|
2486
|
+
return false;
|
|
2487
|
+
}
|
|
2488
|
+
if (lock.host !== hostname() || processIsAlive(lock.pid)) return false;
|
|
2489
|
+
const journalPath = path.resolve(root, lock.journal);
|
|
2490
|
+
if (!isInside(root, journalPath)) return false;
|
|
2491
|
+
let journal;
|
|
2492
|
+
try {
|
|
2493
|
+
journal = JSON.parse(await readFile(journalPath, "utf8"));
|
|
2494
|
+
} catch {
|
|
2495
|
+
return false;
|
|
2496
|
+
}
|
|
2497
|
+
if (journal.command !== "init" || !["prepared", "committing", "committed"].includes(journal.state)) return false;
|
|
2498
|
+
if ((journal.archiveMigrations ?? []).length > 0) return false;
|
|
2499
|
+
let validated;
|
|
2500
|
+
try {
|
|
2501
|
+
validated = await validateRecoveryJournal(root, journal, journalPath, lock.id);
|
|
2502
|
+
} catch {
|
|
2503
|
+
return false;
|
|
2504
|
+
}
|
|
2505
|
+
if (validated.length === 0) return false;
|
|
2506
|
+
if (!validated.every(({ entry }) => entry.existed === false && entry.beforeHash === null && entry.backupRel === null)) return false;
|
|
2507
|
+
for (const { entry, targetAbs } of validated) {
|
|
2508
|
+
const current = await readOptionalBuffer(targetAbs);
|
|
2509
|
+
if (!current || sha256(current) !== entry.afterHash) return false;
|
|
2510
|
+
}
|
|
2511
|
+
return true;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2421
2514
|
async function assertDryRunHasNoPendingTransaction(root) {
|
|
2422
2515
|
const lockPath = path.join(root, "dev", "governance_migrations", ".upgrade.lock");
|
|
2423
2516
|
try {
|
|
@@ -2426,6 +2519,7 @@ async function assertDryRunHasNoPendingTransaction(root) {
|
|
|
2426
2519
|
if (error?.code === "ENOENT") return;
|
|
2427
2520
|
throw error;
|
|
2428
2521
|
}
|
|
2522
|
+
if (await isIgnorableCompletedCreateOnlyInitLock(root)) return;
|
|
2429
2523
|
throw new Error("dry-run blocked: an unresolved transaction requires a non-dry-run recovery; no files written");
|
|
2430
2524
|
}
|
|
2431
2525
|
|
|
@@ -2494,6 +2588,21 @@ async function runDoctor(root, version, options = {}) {
|
|
|
2494
2588
|
console.log(`\nhistorical transaction receipt authority checks: 0`);
|
|
2495
2589
|
console.log("not-applicable committed transaction journals are receipts only when no active lock exists");
|
|
2496
2590
|
|
|
2591
|
+
const userRulesResult = await checkFormalUserRules(root, { ...options, expectedFormalUserRules: formalUserRulesWitness });
|
|
2592
|
+
console.log(`\nformal user-rules checks: ${userRulesResult.checked}`);
|
|
2593
|
+
console.log(`${userRulesResult.ok ? "ok" : "missing"} AGENTS.md -> ${USER_RULES_ROUTER_PATH} (accepted user-rule bytes and order)`);
|
|
2594
|
+
if (!userRulesResult.ok) console.log(` missing: ${userRulesResult.finding}`);
|
|
2595
|
+
if (!userRulesResult.ok) {
|
|
2596
|
+
printDoctorSummary(version, root, "needs-fix", {
|
|
2597
|
+
checked: rows.length + historicalReceiptChecks + userRulesResult.checked,
|
|
2598
|
+
failedKind: "formal user-rules checks",
|
|
2599
|
+
failedCount: 1,
|
|
2600
|
+
nextStep: formalUserRulesRepairNextStep(userRulesResult.finding)
|
|
2601
|
+
});
|
|
2602
|
+
process.exitCode = 1;
|
|
2603
|
+
return "failed";
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2497
2606
|
const anchorRows = await checkRequiredAnchors(root);
|
|
2498
2607
|
const acceptedPreservedAnchorRows = anchorRows.filter((row) => !row.ok && acceptedRuntimeTargets.has(row.target));
|
|
2499
2608
|
const anchorFailures = anchorRows.filter((row) => !row.ok && !acceptedRuntimeTargets.has(row.target));
|
|
@@ -2512,7 +2621,7 @@ async function runDoctor(root, version, options = {}) {
|
|
|
2512
2621
|
if (anchorFailures.length > 0) {
|
|
2513
2622
|
printAnchorRepairGuidance(anchorFailures, options.context);
|
|
2514
2623
|
printDoctorSummary(version, root, "needs-fix", {
|
|
2515
|
-
checked: rows.length + historicalReceiptChecks + anchorRows.length,
|
|
2624
|
+
checked: rows.length + historicalReceiptChecks + userRulesResult.checked + anchorRows.length,
|
|
2516
2625
|
failedKind: "anchor checks",
|
|
2517
2626
|
failedCount: anchorFailures.length,
|
|
2518
2627
|
nextStep: anchorRepairNextStep(options.context)
|
|
@@ -2535,7 +2644,7 @@ async function runDoctor(root, version, options = {}) {
|
|
|
2535
2644
|
|
|
2536
2645
|
if (schemaFailures.length > 0) {
|
|
2537
2646
|
printDoctorSummary(version, root, "needs-fix", {
|
|
2538
|
-
checked: rows.length + historicalReceiptChecks + anchorRows.length + schemaRows.length,
|
|
2647
|
+
checked: rows.length + historicalReceiptChecks + userRulesResult.checked + anchorRows.length + schemaRows.length,
|
|
2539
2648
|
failedKind: "schema checks",
|
|
2540
2649
|
failedCount: schemaFailures.length,
|
|
2541
2650
|
nextStep: "把這段 doctor 輸出貼給 AI,請它先修交接結構,不要直接重裝覆蓋。"
|
|
@@ -2547,21 +2656,6 @@ async function runDoctor(root, version, options = {}) {
|
|
|
2547
2656
|
console.log(` accepted preservation: ${row.target} remains runtime-readable only through the same transaction acceptance witness`);
|
|
2548
2657
|
}
|
|
2549
2658
|
|
|
2550
|
-
const userRulesResult = await checkFormalUserRules(root, { ...options, expectedFormalUserRules: formalUserRulesWitness });
|
|
2551
|
-
console.log(`\nformal user-rules checks: ${userRulesResult.checked}`);
|
|
2552
|
-
console.log(`${userRulesResult.ok ? "ok" : "missing"} AGENTS.md -> ${USER_RULES_ROUTER_PATH} (accepted user-rule bytes and order)`);
|
|
2553
|
-
if (!userRulesResult.ok) console.log(` missing: ${userRulesResult.finding}`);
|
|
2554
|
-
if (!userRulesResult.ok) {
|
|
2555
|
-
printDoctorSummary(version, root, "needs-fix", {
|
|
2556
|
-
checked: rows.length + historicalReceiptChecks + anchorRows.length + schemaRows.length + userRulesResult.checked,
|
|
2557
|
-
failedKind: "formal user-rules checks",
|
|
2558
|
-
failedCount: 1,
|
|
2559
|
-
nextStep: "不要重跑 upgrade 或覆寫用戶規則;先還原或重新以完整接受紀錄登記 dev/USER_RULES.md 及其 user rule bytes。"
|
|
2560
|
-
});
|
|
2561
|
-
process.exitCode = 1;
|
|
2562
|
-
return "failed";
|
|
2563
|
-
}
|
|
2564
|
-
|
|
2565
2659
|
const bridgeFailures = await validateBridgeTexts(async (relative) => readOptionalText(path.join(root, relative)));
|
|
2566
2660
|
console.log(`\nbridge checks: 2`);
|
|
2567
2661
|
console.log(`${bridgeFailures.length === 0 ? "ok" : "missing"} CLAUDE.md / GEMINI.md (active one-hop AGENTS.md bridges)`);
|
|
@@ -2754,7 +2848,7 @@ function byteWitness(bytes) {
|
|
|
2754
2848
|
async function hasActiveTransactionLock(root) {
|
|
2755
2849
|
try {
|
|
2756
2850
|
await lstat(path.join(root, "dev", "governance_migrations", ".upgrade.lock"));
|
|
2757
|
-
return
|
|
2851
|
+
return !(await isIgnorableCompletedCreateOnlyInitLock(root));
|
|
2758
2852
|
} catch (error) {
|
|
2759
2853
|
if (error?.code === "ENOENT") return false;
|
|
2760
2854
|
throw error;
|
|
@@ -2769,7 +2863,8 @@ async function checkFormalUserRules(root, options = {}) {
|
|
|
2769
2863
|
return { ok: true, checked: 0, finding: null };
|
|
2770
2864
|
}
|
|
2771
2865
|
try {
|
|
2772
|
-
const
|
|
2866
|
+
const allowActiveTransaction = options.allowActiveTransaction === true || await isIgnorableCompletedCreateOnlyInitLock(root);
|
|
2867
|
+
const state = await readFormalUserRules({ root, allowActiveTransaction });
|
|
2773
2868
|
if (options.expectedFormalUserRules) assertFormalUserRulesReadback(state, options.expectedFormalUserRules);
|
|
2774
2869
|
if (typeof options.captureFormalUserRules === "function") options.captureFormalUserRules(state);
|
|
2775
2870
|
return { ok: true, checked: 1, finding: null, state };
|
|
@@ -3070,7 +3165,7 @@ function printDoctorSummary(version, root, mode, details) {
|
|
|
3070
3165
|
}
|
|
3071
3166
|
} else {
|
|
3072
3167
|
console.log(`status: failed (${details.failedCount} ${details.failedKind} failed)`);
|
|
3073
|
-
console.log(`⚠️ 檢查未通過:${details.failedKind === "missing files" ? "有必要檔案不存在。" : details.failedKind === "anchor checks" ? "有檔案存在,但內容缺少必要段落。" : details.failedKind === "schema checks" ? "交接或索引文件結構不完整。" : details.failedKind === "research decision trace checks" ? "研究導向決策缺少可追溯來源鏈。" : details.failedKind === "handoff temperature boundary checks" ? "當前交接內容混入一次性或歷史證據。" : "下次開工提示副本與 handoff 真源不同。"}`);
|
|
3168
|
+
console.log(`⚠️ 檢查未通過:${details.failedKind === "missing files" ? "有必要檔案不存在。" : details.failedKind === "formal user-rules checks" ? "AGENTS.md 與 dev/USER_RULES.md 的接受見證不一致。" : details.failedKind === "anchor checks" ? "有檔案存在,但內容缺少必要段落。" : details.failedKind === "schema checks" ? "交接或索引文件結構不完整。" : details.failedKind === "research decision trace checks" ? "研究導向決策缺少可追溯來源鏈。" : details.failedKind === "handoff temperature boundary checks" ? "當前交接內容混入一次性或歷史證據。" : "下次開工提示副本與 handoff 真源不同。"}`);
|
|
3074
3169
|
}
|
|
3075
3170
|
console.log("");
|
|
3076
3171
|
console.log(`📦 版本:v${version}`);
|
|
@@ -3079,6 +3174,14 @@ function printDoctorSummary(version, root, mode, details) {
|
|
|
3079
3174
|
console.log(`🚀 下一步:${details.nextStep}`);
|
|
3080
3175
|
}
|
|
3081
3176
|
|
|
3177
|
+
function formalUserRulesRepairNextStep(finding) {
|
|
3178
|
+
const reason = String(finding ?? "");
|
|
3179
|
+
if (reason.includes("AGENTS.md managed core does not match")) {
|
|
3180
|
+
return "不要手動補 AGENTS.md managed core anchor,也不要覆寫 dev/USER_RULES.md。先還原 AGENTS.md 到已接受的 managed core,或用正式 upgrade transaction 重新建立完整 user-rules 接受紀錄。";
|
|
3181
|
+
}
|
|
3182
|
+
return "不要重跑 upgrade、不要手動覆寫 AGENTS.md managed core 或用戶規則;先還原或重新以完整接受紀錄登記 dev/USER_RULES.md 及其 user rule bytes。";
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3082
3185
|
// Anchor failures mean a required file is missing fixed Kit text. The fix is a
|
|
3083
3186
|
// content repair the CLI deliberately does NOT perform itself: every anchor-checked
|
|
3084
3187
|
// file outside the bounded upgrade-merge set is preserved verbatim (R-016), so
|
|
@@ -3185,7 +3288,9 @@ function handoffStateLines(text, markerId, headingTitle) {
|
|
|
3185
3288
|
function isOwnedOpeningLifecycleBoilerplate(line) {
|
|
3186
3289
|
return /^Resume the current objective\. A plain `Start Agent Handoff` \/ `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery/i.test(line)
|
|
3187
3290
|
|| /^A fresh install only makes guidance available; it does not force onboarding\./i.test(line)
|
|
3188
|
-
|| /^
|
|
3291
|
+
|| /^First-use exception: when this handoff says `First-use guidance state: eligible`/i.test(line)
|
|
3292
|
+
|| /^Load onboarding only when I explicitly ask for guidance or no executable objective remains after state reading\./i.test(line)
|
|
3293
|
+
|| /^Upgrade never resets consumed \/ not_applicable first-use state back to eligible\./i.test(line);
|
|
3189
3294
|
}
|
|
3190
3295
|
|
|
3191
3296
|
function stripResolvedNegatedActionClauses(line) {
|
|
@@ -3537,6 +3642,15 @@ async function buildPlan(root, command, version = null) {
|
|
|
3537
3642
|
action: "skip",
|
|
3538
3643
|
reason: "no pre-existing formal user-rules state; router path does not imply legacy ownership"
|
|
3539
3644
|
});
|
|
3645
|
+
} else if (!routerText && declaresFormalEntry && await canCreateMissingFormalUserRulesRouter(root, agentsText)) {
|
|
3646
|
+
plan.push({
|
|
3647
|
+
sourceRel,
|
|
3648
|
+
targetRel,
|
|
3649
|
+
sourceAbs,
|
|
3650
|
+
targetAbs,
|
|
3651
|
+
action: "create",
|
|
3652
|
+
reason: "complete interrupted first-install formal user-rules router without inferring user-rule ownership"
|
|
3653
|
+
});
|
|
3540
3654
|
} else if (!routerText || !declaresFormalEntry) {
|
|
3541
3655
|
plan.push({
|
|
3542
3656
|
sourceRel,
|
|
@@ -3583,6 +3697,13 @@ async function buildPlan(root, command, version = null) {
|
|
|
3583
3697
|
return plan;
|
|
3584
3698
|
}
|
|
3585
3699
|
|
|
3700
|
+
async function canCreateMissingFormalUserRulesRouter(root, agentsText) {
|
|
3701
|
+
if (!agentsText || countText(agentsText, FORMAL_USER_RULES_ENTRY_ANCHOR) !== 1) return false;
|
|
3702
|
+
if (await exists(path.join(root, "dev", "user_rules"))) return false;
|
|
3703
|
+
const health = assessAgentsMdHealth(agentsText);
|
|
3704
|
+
return health.state === "clean" && hasRequiredAnchor("AGENTS.md", agentsText);
|
|
3705
|
+
}
|
|
3706
|
+
|
|
3586
3707
|
async function readTemplateSource(command, sourceRel, targetRel, sourceAbs) {
|
|
3587
3708
|
return readFile(sourceAbs, "utf8");
|
|
3588
3709
|
}
|
|
@@ -3943,7 +4064,7 @@ function mergeOnboardingScenarioALabel(targetText) {
|
|
|
3943
4064
|
|
|
3944
4065
|
function mergeOnboardingDecisionFirstPolicy(targetText, sourceText) {
|
|
3945
4066
|
const legacySignalLine = "- equivalent Chinese user phrases such as \"新手\", \"教我用\", \"我剛安裝\", \"點開始\", \"開工\", \"能力\", or \"能做甚麼\"";
|
|
3946
|
-
const currentSignalBoundary = "- equivalent Chinese user phrases such as \"新手\", \"教我用\", \"我剛安裝\", \"點開始\", \"能力\", or \"能做甚麼\"\n\n### Continuity startup boundary\n\n`Start Agent Handoff` / \"開工\" starts continuity and reads the minimum current handoff state; it is not an onboarding signal. A plain startup stops after its status card and recommended next action; a loaded objective alone does not authorize work. A same-message concrete task may begin normally. Only when no executable objective remains after state reading should the AI ask one concise question or offer the guided onboarding path. Explicit requests such as \"新手,教我用\" enter onboarding directly.";
|
|
4067
|
+
const currentSignalBoundary = "- equivalent Chinese user phrases such as \"新手\", \"教我用\", \"我剛安裝\", \"點開始\", \"能力\", or \"能做甚麼\"\n\n### Continuity startup boundary\n\n`Start Agent Handoff` / \"開工\" starts continuity and reads the minimum current handoff state; it is not an onboarding signal by itself. A plain startup normally stops after its status card and recommended next action; a loaded objective alone does not authorize work. First-use eligible plain startup is the exception: when the handoff says `First-use guidance state: eligible`, the active objective is empty / `TBD`, and the user did not provide a same-message concrete task, enter onboarding instead of ending status-only. A same-message concrete task may begin normally. Only when no executable objective remains after state reading should the AI ask one concise question or offer the guided onboarding path. Explicit requests such as \"新手,教我用\" enter onboarding directly.";
|
|
3947
4068
|
let working = targetText;
|
|
3948
4069
|
let startupBoundaryChanged = false;
|
|
3949
4070
|
if (working.includes(legacySignalLine) && !working.includes("### Continuity startup boundary")) {
|
|
@@ -3975,7 +4096,7 @@ function mergeOnboardingDecisionFirstPolicy(targetText, sourceText) {
|
|
|
3975
4096
|
const replacements = [
|
|
3976
4097
|
[
|
|
3977
4098
|
"Use this transient pack for first-time Agent Handoff Kit users, vague first messages, or fresh-install sessions where the user has not yet chosen a working scenario.",
|
|
3978
|
-
"Use this transient pack for first-time Agent Handoff Kit users who request guidance, or when the user's first-task intent remains genuinely unresolved after reading the available project state."
|
|
4099
|
+
"Use this transient pack for first-time Agent Handoff Kit users after a fresh install, users who request guidance, or when the user's first-task intent remains genuinely unresolved after reading the available project state."
|
|
3979
4100
|
],
|
|
3980
4101
|
[
|
|
3981
4102
|
"- The first user message is short and vague.",
|
|
@@ -5304,9 +5425,10 @@ function printLastCloseout(result) {
|
|
|
5304
5425
|
}
|
|
5305
5426
|
}
|
|
5306
5427
|
|
|
5307
|
-
// R-031.2 v0.3.2+: Project age assessment. Reads the oldest
|
|
5308
|
-
//
|
|
5309
|
-
//
|
|
5428
|
+
// R-031.2 v0.3.2+: Project age assessment. Reads the oldest historical migration
|
|
5429
|
+
// folder timestamp when one exists. Fresh installs intentionally do not create
|
|
5430
|
+
// migration artifacts, so project age can be unknown. Read-only; doctor remains
|
|
5431
|
+
// side-effect-free (no new write logic).
|
|
5310
5432
|
async function assessProjectAge(root) {
|
|
5311
5433
|
const migrationsDir = path.join(root, "dev/governance_migrations");
|
|
5312
5434
|
try {
|
|
@@ -5327,7 +5449,7 @@ function parseMigrationDirectoryDate(name) {
|
|
|
5327
5449
|
|
|
5328
5450
|
function printProjectAge(result) {
|
|
5329
5451
|
if (!result.firstInstall) {
|
|
5330
|
-
console.log(" 🌱 項目首次安裝距今:未知(
|
|
5452
|
+
console.log(" 🌱 項目首次安裝距今:未知(fresh install 不建立 migration 交易目錄;升級後才會有 timestamp)");
|
|
5331
5453
|
return;
|
|
5332
5454
|
}
|
|
5333
5455
|
const today = new Date();
|
|
@@ -5631,6 +5753,8 @@ function printInstallSummary(version, command, mode, root, counts) {
|
|
|
5631
5753
|
console.log(`🔎 剛完成:${command} 命令;create ${counts.created} / merge ${counts.merged} / skip ${counts.skipped} / conflict ${counts.conflicts}。`);
|
|
5632
5754
|
if (counts.conflicts > 0) {
|
|
5633
5755
|
console.log(conflictRepairNextStepLine("🚀", "工具已停手,沒有覆寫 conflict 檔案。"));
|
|
5756
|
+
} else if (counts.directCreateOnly) {
|
|
5757
|
+
console.log("🚀 下一步:本次只補齊缺少檔案並已通過 doctor;不用做 migration 清理。");
|
|
5634
5758
|
} else if (command === "upgrade") {
|
|
5635
5759
|
console.log("🚀 下一步:本次提交已先經同一輪正式 doctor 讀回;請留意下方提交與健康結果。");
|
|
5636
5760
|
} else if (counts.skipped > 0) {
|
|
@@ -5781,10 +5905,11 @@ function printCard(version, status, eyes) {
|
|
|
5781
5905
|
console.log("");
|
|
5782
5906
|
}
|
|
5783
5907
|
|
|
5784
|
-
function printInstallNextSteps(root, conflictCount, mode = "first-install", skippedCount = 0) {
|
|
5908
|
+
function printInstallNextSteps(root, conflictCount, mode = "first-install", skippedCount = 0, options = {}) {
|
|
5785
5909
|
console.log("");
|
|
5786
5910
|
console.log("============================================================");
|
|
5787
|
-
|
|
5911
|
+
const needsPartialRepairStep = skippedCount > 0 && options.directCreateOnly !== true;
|
|
5912
|
+
if (needsPartialRepairStep) {
|
|
5788
5913
|
console.log("⚠️ 已補齊缺少檔案,但仍要檢查入口連接");
|
|
5789
5914
|
} else {
|
|
5790
5915
|
console.log("✅ 安裝完成:下一步請在 AI 對話中操作");
|
|
@@ -5796,7 +5921,7 @@ function printInstallNextSteps(root, conflictCount, mode = "first-install", skip
|
|
|
5796
5921
|
console.log(conflictRepairNextStepLine());
|
|
5797
5922
|
console.log("");
|
|
5798
5923
|
}
|
|
5799
|
-
if (
|
|
5924
|
+
if (needsPartialRepairStep) {
|
|
5800
5925
|
console.log("你原本已有部分 AI 記憶檔,工具已保留它們,沒有覆寫。");
|
|
5801
5926
|
console.log("下一步先不要開始新任務;請在終端機執行以下預演,讓工具檢查能否安全補入口連接:");
|
|
5802
5927
|
console.log(" npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run");
|
|
@@ -5808,7 +5933,7 @@ function printInstallNextSteps(root, conflictCount, mode = "first-install", skip
|
|
|
5808
5933
|
}
|
|
5809
5934
|
console.log("------------------------------------------------------------");
|
|
5810
5935
|
console.log("⚠️ 下面這句不是終端機指令。");
|
|
5811
|
-
console.log("📋
|
|
5936
|
+
console.log("📋 不用再留在終端機;請打開能讀寫此資料夾的 AI agent。若 AI 已在此資料夾內,新增對話後輸入:");
|
|
5812
5937
|
console.log(" 例如 Claude Code、OpenAI Codex、Gemini CLI、Google Antigravity。");
|
|
5813
5938
|
console.log(" 普通 web chat AI 若不能讀寫本機資料夾,並不適合使用本工具。");
|
|
5814
5939
|
console.log("------------------------------------------------------------");
|
|
@@ -5820,7 +5945,8 @@ function printInstallNextSteps(root, conflictCount, mode = "first-install", skip
|
|
|
5820
5945
|
console.log("------------------------------------------------------------");
|
|
5821
5946
|
console.log("");
|
|
5822
5947
|
console.log("🚀 AI 會依 AGENTS.md 先讀取權威交接狀態。START_NEXT_SESSION_PROMPT.txt 只是給尚未指向此資料夾的 AI 使用的生成鏡像。");
|
|
5823
|
-
console.log("
|
|
5948
|
+
console.log(" 首次安裝後,若你只說 Start Agent Handoff 或「開工」,AI 會顯示開工卡並進入簡短新手歡迎引導;升級不會重置新手流程。");
|
|
5949
|
+
console.log(" 若同一句已給出明確任務,AI 可先用很短的新手框架說明工作節奏,再開始第一個安全步驟。");
|
|
5824
5950
|
console.log(" 收工可說「Wrap up Agent Handoff」/「收工」;「開工,繼續 <任務>」會直接接力。");
|
|
5825
5951
|
console.log("============================================================");
|
|
5826
5952
|
}
|
|
@@ -5958,7 +6084,7 @@ Commands:
|
|
|
5958
6084
|
例如 Claude Code、OpenAI Codex、Gemini CLI、Google Antigravity。
|
|
5959
6085
|
普通 web chat AI 若不能讀寫本機資料夾,並不適合使用本工具。
|
|
5960
6086
|
AI 已在項目根目錄時,依 AGENTS.md 判斷意圖;只有接力、收工或依賴既有狀態的任務才讀交接狀態,
|
|
5961
|
-
不會再重讀 START_NEXT_SESSION_PROMPT.txt
|
|
6087
|
+
不會再重讀 START_NEXT_SESSION_PROMPT.txt。第一次安裝會把新手引導標記為待使用;若只說 Start Agent Handoff 或「開工」且沒有同句明確任務,AI 會進入簡短新手歡迎;升級不會重置。
|
|
5962
6088
|
用「Wrap up Agent Handoff」/「收工」保存交接;「<項目名> 開工」是明確接力。
|
|
5963
6089
|
只有語句確實可能指現實工作、活動或其他語境時,AI 才問一條精簡確認問題。
|
|
5964
6090
|
|
|
@@ -12026,6 +12026,356 @@
|
|
|
12026
12026
|
"canonicalSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef"
|
|
12027
12027
|
}
|
|
12028
12028
|
}
|
|
12029
|
+
},
|
|
12030
|
+
"0.3.57": {
|
|
12031
|
+
"source": {
|
|
12032
|
+
"npm": {
|
|
12033
|
+
"spec": "@adamchanadam/agent-handoff-kit@0.3.57",
|
|
12034
|
+
"shasum": "dbc736542999277dc6f73a4f5f23d88587d23bfd",
|
|
12035
|
+
"integrity": "sha512-8VRGpNlfpFR5LPsxm81/RGvFcIpSCXIteGo18ix0UeCZYOs2DIwT9ZYHPTF+MJln/0um9oNuS5EjXAGg6V7O8w==",
|
|
12036
|
+
"entryCount": 34,
|
|
12037
|
+
"gitHead": "1233909c0746287ab26222f9b76dd216ce659424"
|
|
12038
|
+
},
|
|
12039
|
+
"git": {
|
|
12040
|
+
"tag": "v0.3.57",
|
|
12041
|
+
"directObject": "1233909c0746287ab26222f9b76dd216ce659424",
|
|
12042
|
+
"peeledCommit": null,
|
|
12043
|
+
"commit": "1233909c0746287ab26222f9b76dd216ce659424"
|
|
12044
|
+
},
|
|
12045
|
+
"githubRelease": {
|
|
12046
|
+
"tag": "v0.3.57",
|
|
12047
|
+
"publishedAt": "2026-08-04T12:50:14Z"
|
|
12048
|
+
},
|
|
12049
|
+
"sourceDivergence": {
|
|
12050
|
+
"status": "same-commit",
|
|
12051
|
+
"npmGitHead": "1233909c0746287ab26222f9b76dd216ce659424",
|
|
12052
|
+
"remoteTagCommit": "1233909c0746287ab26222f9b76dd216ce659424"
|
|
12053
|
+
}
|
|
12054
|
+
},
|
|
12055
|
+
"manifest": {
|
|
12056
|
+
"AGENTS.md": {
|
|
12057
|
+
"state": "present",
|
|
12058
|
+
"contentId": "effc2b7606f098d48cf46f0c1fcbd2f312f9dd2d804b194106bb421acbe89915",
|
|
12059
|
+
"rawSha256": "1f1d11ab484adefc8388bee2796720abb64adc708561bb4dbbf9860d366c9a9e",
|
|
12060
|
+
"normalizedSha256": "1f1d11ab484adefc8388bee2796720abb64adc708561bb4dbbf9860d366c9a9e",
|
|
12061
|
+
"canonicalSha256": "1f1d11ab484adefc8388bee2796720abb64adc708561bb4dbbf9860d366c9a9e"
|
|
12062
|
+
},
|
|
12063
|
+
"CLAUDE.md": {
|
|
12064
|
+
"state": "present",
|
|
12065
|
+
"contentId": "7a2cf08a1171762ebcb53f43036a2170655379416945258b9c85d4b189ecaecf",
|
|
12066
|
+
"rawSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
|
|
12067
|
+
"normalizedSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
|
|
12068
|
+
"canonicalSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad"
|
|
12069
|
+
},
|
|
12070
|
+
"GEMINI.md": {
|
|
12071
|
+
"state": "present",
|
|
12072
|
+
"contentId": "36da47034bb2ce6c760ddbbbbd49dccc1d17665dbb18bec56ffa3b26bac1c135",
|
|
12073
|
+
"rawSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
|
|
12074
|
+
"normalizedSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
|
|
12075
|
+
"canonicalSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986"
|
|
12076
|
+
},
|
|
12077
|
+
"START_NEXT_SESSION_PROMPT.txt": {
|
|
12078
|
+
"state": "present",
|
|
12079
|
+
"contentId": "44b4f01258bdf76c1478e5dc0b1e9d88d196bbb3ae790edd07497f0cca26b8bd",
|
|
12080
|
+
"rawSha256": "d49b3d79b2eaf00ed60970c633eaea60ec6ee288ec135303a5e215cc6cb08bde",
|
|
12081
|
+
"normalizedSha256": "d49b3d79b2eaf00ed60970c633eaea60ec6ee288ec135303a5e215cc6cb08bde",
|
|
12082
|
+
"canonicalSha256": "ab27d779af955d419c0f4290bd85d9d842182be04570ffffb0a725331a6cf409"
|
|
12083
|
+
},
|
|
12084
|
+
"dev/SESSION_HANDOFF.md": {
|
|
12085
|
+
"state": "present",
|
|
12086
|
+
"contentId": "7a273d19af7f2e13fcf514f54d04815bba7cdaf2265af3ce80da168faeec84f7",
|
|
12087
|
+
"rawSha256": "c9dc59b5c6f8ec315bbc7443957540d5b29991b4e9dfebe1fd767403f8926000",
|
|
12088
|
+
"normalizedSha256": "c9dc59b5c6f8ec315bbc7443957540d5b29991b4e9dfebe1fd767403f8926000",
|
|
12089
|
+
"canonicalSha256": "96b45a24a5eb0f39086e199a8eb36a5794f9595fe9253138e7a3c2eb99278178"
|
|
12090
|
+
},
|
|
12091
|
+
"dev/SESSION_LOG.md": {
|
|
12092
|
+
"state": "present",
|
|
12093
|
+
"contentId": "7b6184ee4dabe89f504a894c3d4803f012d962c7af53c7f29801a8fb28d9d51c",
|
|
12094
|
+
"rawSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
|
|
12095
|
+
"normalizedSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
|
|
12096
|
+
"canonicalSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47"
|
|
12097
|
+
},
|
|
12098
|
+
"dev/PROJECT_INDEX.md": {
|
|
12099
|
+
"state": "present",
|
|
12100
|
+
"contentId": "c2ff51ecd87013f6301a0697d9bc2937eac218cf684ae39341a282250ec46897",
|
|
12101
|
+
"rawSha256": "d477f13e0b633090b278e1c7f222eee99eaedeca16a957ee326c6a425340f65e",
|
|
12102
|
+
"normalizedSha256": "8bb613b640ae1d00b4ae3b0b9d9cd6cf6e7c12ae1c29fe5513af0abae4250b50",
|
|
12103
|
+
"canonicalSha256": "8fd316fca77004a94404582a5152c2bbdcf89610b52e7c0fdbfb0076c5cdd759"
|
|
12104
|
+
},
|
|
12105
|
+
"dev/DOC_SYNC_REGISTRY.md": {
|
|
12106
|
+
"state": "present",
|
|
12107
|
+
"contentId": "f6545b524dc440d3563041e04a05caff4229863f6cae2a39127f85a29a120249",
|
|
12108
|
+
"rawSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
|
|
12109
|
+
"normalizedSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
|
|
12110
|
+
"canonicalSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6"
|
|
12111
|
+
},
|
|
12112
|
+
"dev/RULE_PACKS.md": {
|
|
12113
|
+
"state": "present",
|
|
12114
|
+
"contentId": "a92986fcb4f7630e533bacf114d096e8e655973de297ff972a1bf1de5610af4b",
|
|
12115
|
+
"rawSha256": "a3e433884fc6bf26448acfa79ba106acaaafe5b4bdb212cb8ce6dc4aaea2faaf",
|
|
12116
|
+
"normalizedSha256": "a3e433884fc6bf26448acfa79ba106acaaafe5b4bdb212cb8ce6dc4aaea2faaf",
|
|
12117
|
+
"canonicalSha256": "a3e433884fc6bf26448acfa79ba106acaaafe5b4bdb212cb8ce6dc4aaea2faaf"
|
|
12118
|
+
},
|
|
12119
|
+
"dev/PROJECT_DECISIONS.md": {
|
|
12120
|
+
"state": "present",
|
|
12121
|
+
"contentId": "3aae993bd5b85bf6b1d1d458f1bcf82c7d3105c843f053ffa13553bb5931b8c4",
|
|
12122
|
+
"rawSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
|
|
12123
|
+
"normalizedSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
|
|
12124
|
+
"canonicalSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e"
|
|
12125
|
+
},
|
|
12126
|
+
"dev/rules/safety.md": {
|
|
12127
|
+
"state": "present",
|
|
12128
|
+
"contentId": "dd6bcf74722d038f76d202e2044a6583a6e6ad107fbb010520e513eec799ff4a",
|
|
12129
|
+
"rawSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
|
|
12130
|
+
"normalizedSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
|
|
12131
|
+
"canonicalSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0"
|
|
12132
|
+
},
|
|
12133
|
+
"dev/rules/coding.md": {
|
|
12134
|
+
"state": "present",
|
|
12135
|
+
"contentId": "1c6deb9a5a281c13e97b0ac96079e9e1beccbd1ff106186e7a6ac78c0eeb75c2",
|
|
12136
|
+
"rawSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
|
|
12137
|
+
"normalizedSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
|
|
12138
|
+
"canonicalSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4"
|
|
12139
|
+
},
|
|
12140
|
+
"dev/rules/writing.md": {
|
|
12141
|
+
"state": "present",
|
|
12142
|
+
"contentId": "ceee5412520ba860e6b40de46bb164e2ce3919d2197d5fadb926198eb7dddd3b",
|
|
12143
|
+
"rawSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
|
|
12144
|
+
"normalizedSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
|
|
12145
|
+
"canonicalSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593"
|
|
12146
|
+
},
|
|
12147
|
+
"dev/rules/research.md": {
|
|
12148
|
+
"state": "present",
|
|
12149
|
+
"contentId": "4414f9c82c6d04ad49d7446f4b0740055242f425ef5b00391d9c8c78c96c0f66",
|
|
12150
|
+
"rawSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
|
|
12151
|
+
"normalizedSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
|
|
12152
|
+
"canonicalSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104"
|
|
12153
|
+
},
|
|
12154
|
+
"dev/rules/agent-governance.md": {
|
|
12155
|
+
"state": "present",
|
|
12156
|
+
"contentId": "107acfbfc85910c97a369e043edd6d467f85bdf3cf560d07ee844d27cf01bcc9",
|
|
12157
|
+
"rawSha256": "9693c7eee22536b3b90e47a1e8b7e669292b9896b6e05266ea36f7e0dd366845",
|
|
12158
|
+
"normalizedSha256": "9693c7eee22536b3b90e47a1e8b7e669292b9896b6e05266ea36f7e0dd366845",
|
|
12159
|
+
"canonicalSha256": "9693c7eee22536b3b90e47a1e8b7e669292b9896b6e05266ea36f7e0dd366845"
|
|
12160
|
+
},
|
|
12161
|
+
"dev/rules/release.md": {
|
|
12162
|
+
"state": "present",
|
|
12163
|
+
"contentId": "b0a0c9dea88016185f4093f9be4ce3c0e29904222e21dd1fa1735fcc1bb7e744",
|
|
12164
|
+
"rawSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
|
|
12165
|
+
"normalizedSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
|
|
12166
|
+
"canonicalSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7"
|
|
12167
|
+
},
|
|
12168
|
+
"dev/rules/knowledge.md": {
|
|
12169
|
+
"state": "present",
|
|
12170
|
+
"contentId": "e6f5795c7ebaba7b05f04d971b2942b5a0394a3babb44f64a1cc591c9a08cb86",
|
|
12171
|
+
"rawSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c",
|
|
12172
|
+
"normalizedSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c",
|
|
12173
|
+
"canonicalSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c"
|
|
12174
|
+
},
|
|
12175
|
+
"dev/rules/communication.md": {
|
|
12176
|
+
"state": "present",
|
|
12177
|
+
"contentId": "34fd0034cbc75dad43f789b86a414763f01916dda4d59876db9c4d8d92ae6a87",
|
|
12178
|
+
"rawSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
|
|
12179
|
+
"normalizedSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
|
|
12180
|
+
"canonicalSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591"
|
|
12181
|
+
},
|
|
12182
|
+
"dev/rules/closeout.md": {
|
|
12183
|
+
"state": "present",
|
|
12184
|
+
"contentId": "0d0c85ac4318670d9ffba85e46cc709ee3b0a9bcb0ad7586079859f98e0a1c72",
|
|
12185
|
+
"rawSha256": "45b8019de97dd730380af9c211da92b541580797a66694b9b4188bed49e999b6",
|
|
12186
|
+
"normalizedSha256": "45b8019de97dd730380af9c211da92b541580797a66694b9b4188bed49e999b6",
|
|
12187
|
+
"canonicalSha256": "45b8019de97dd730380af9c211da92b541580797a66694b9b4188bed49e999b6"
|
|
12188
|
+
},
|
|
12189
|
+
"dev/rules/onboarding.md": {
|
|
12190
|
+
"state": "present",
|
|
12191
|
+
"contentId": "e67b34ca3eb5e3aac6e36aa3a3929daae0c881e803badb6d22d5837fc37588ab",
|
|
12192
|
+
"rawSha256": "ae0ab942b86e216e29e8996f17947442d7568910b84899b6df2b836b1fcdbed3",
|
|
12193
|
+
"normalizedSha256": "ae0ab942b86e216e29e8996f17947442d7568910b84899b6df2b836b1fcdbed3",
|
|
12194
|
+
"canonicalSha256": "ae0ab942b86e216e29e8996f17947442d7568910b84899b6df2b836b1fcdbed3"
|
|
12195
|
+
},
|
|
12196
|
+
"dev/rules/integrations.md": {
|
|
12197
|
+
"state": "present",
|
|
12198
|
+
"contentId": "a8fc1099da28f511bf9fed5eaf629ca10fb409299b0aed4d233a45fc7701f284",
|
|
12199
|
+
"rawSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef",
|
|
12200
|
+
"normalizedSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef",
|
|
12201
|
+
"canonicalSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef"
|
|
12202
|
+
}
|
|
12203
|
+
}
|
|
12204
|
+
},
|
|
12205
|
+
"0.3.58": {
|
|
12206
|
+
"source": {
|
|
12207
|
+
"npm": {
|
|
12208
|
+
"spec": "@adamchanadam/agent-handoff-kit@0.3.58",
|
|
12209
|
+
"shasum": "8e953af266c08867bdc286930f58579b0d45eec7",
|
|
12210
|
+
"integrity": "sha512-vt/hVtLMAv4zgoZ1AupPyOeMMF8/RavO2iGosO0KbLT+Obe0gbPI0huTdNN6s5p3+03Bw//Iie+Zkl7ZOFq3tQ==",
|
|
12211
|
+
"entryCount": 34,
|
|
12212
|
+
"gitHead": "69ea4b88f6be2c1dee9b43cadadc6c0b0a9c9108"
|
|
12213
|
+
},
|
|
12214
|
+
"git": {
|
|
12215
|
+
"tag": "v0.3.58",
|
|
12216
|
+
"directObject": "69ea4b88f6be2c1dee9b43cadadc6c0b0a9c9108",
|
|
12217
|
+
"peeledCommit": null,
|
|
12218
|
+
"commit": "69ea4b88f6be2c1dee9b43cadadc6c0b0a9c9108"
|
|
12219
|
+
},
|
|
12220
|
+
"githubRelease": {
|
|
12221
|
+
"tag": "v0.3.58",
|
|
12222
|
+
"publishedAt": "2026-08-07T19:51:02Z"
|
|
12223
|
+
},
|
|
12224
|
+
"sourceDivergence": {
|
|
12225
|
+
"status": "same-commit",
|
|
12226
|
+
"npmGitHead": "69ea4b88f6be2c1dee9b43cadadc6c0b0a9c9108",
|
|
12227
|
+
"remoteTagCommit": "69ea4b88f6be2c1dee9b43cadadc6c0b0a9c9108"
|
|
12228
|
+
}
|
|
12229
|
+
},
|
|
12230
|
+
"manifest": {
|
|
12231
|
+
"AGENTS.md": {
|
|
12232
|
+
"state": "present",
|
|
12233
|
+
"contentId": "6799395074579fc07ec832545aa68abd4ad105c30c19f7980721fca5ae4a6256",
|
|
12234
|
+
"rawSha256": "06892df11eabdf13599e525d40a79f2b072d47b68b6c265b9417de36fa22f840",
|
|
12235
|
+
"normalizedSha256": "06892df11eabdf13599e525d40a79f2b072d47b68b6c265b9417de36fa22f840",
|
|
12236
|
+
"canonicalSha256": "06892df11eabdf13599e525d40a79f2b072d47b68b6c265b9417de36fa22f840"
|
|
12237
|
+
},
|
|
12238
|
+
"CLAUDE.md": {
|
|
12239
|
+
"state": "present",
|
|
12240
|
+
"contentId": "7a2cf08a1171762ebcb53f43036a2170655379416945258b9c85d4b189ecaecf",
|
|
12241
|
+
"rawSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
|
|
12242
|
+
"normalizedSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad",
|
|
12243
|
+
"canonicalSha256": "9e326c3c1ab08fbcd23b28cd398561c17d851a59997842e0f4f97ff3473ff0ad"
|
|
12244
|
+
},
|
|
12245
|
+
"GEMINI.md": {
|
|
12246
|
+
"state": "present",
|
|
12247
|
+
"contentId": "36da47034bb2ce6c760ddbbbbd49dccc1d17665dbb18bec56ffa3b26bac1c135",
|
|
12248
|
+
"rawSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
|
|
12249
|
+
"normalizedSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986",
|
|
12250
|
+
"canonicalSha256": "b6e8bfc51ba751fec2acd1719c4459b41524f013e0464a5573de7f66d436c986"
|
|
12251
|
+
},
|
|
12252
|
+
"START_NEXT_SESSION_PROMPT.txt": {
|
|
12253
|
+
"state": "present",
|
|
12254
|
+
"contentId": "de01669f2989762269e57b8f71decc55d58effa649a245136efa6dc1434b78a9",
|
|
12255
|
+
"rawSha256": "cc2c9fa0592f09924f764f3326184a29b43ac02594a50c5de8d65edf0a43e182",
|
|
12256
|
+
"normalizedSha256": "cc2c9fa0592f09924f764f3326184a29b43ac02594a50c5de8d65edf0a43e182",
|
|
12257
|
+
"canonicalSha256": "b1b9ad0cb5f3a374542a43b6c2c938e1e5d39dd42b91d12a4a74206f5f187113"
|
|
12258
|
+
},
|
|
12259
|
+
"dev/SESSION_HANDOFF.md": {
|
|
12260
|
+
"state": "present",
|
|
12261
|
+
"contentId": "df3d7d3bed1b51793910643d74b2391bbd79686acd1537b87f0d332548a35399",
|
|
12262
|
+
"rawSha256": "34985da5f3e23667234f5da3177af216b07cb7a8976ce1326e28b1a84080bec6",
|
|
12263
|
+
"normalizedSha256": "34985da5f3e23667234f5da3177af216b07cb7a8976ce1326e28b1a84080bec6",
|
|
12264
|
+
"canonicalSha256": "e64a5a0b9dd1b4bcade6bb0bae4870b5ab7d2fa550a826e957a53d853a5e032f"
|
|
12265
|
+
},
|
|
12266
|
+
"dev/SESSION_LOG.md": {
|
|
12267
|
+
"state": "present",
|
|
12268
|
+
"contentId": "7b6184ee4dabe89f504a894c3d4803f012d962c7af53c7f29801a8fb28d9d51c",
|
|
12269
|
+
"rawSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
|
|
12270
|
+
"normalizedSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47",
|
|
12271
|
+
"canonicalSha256": "fb6bfd7026a15f87a54cfa64fbd69f032538b0c3193372876a3722fb997a3a47"
|
|
12272
|
+
},
|
|
12273
|
+
"dev/PROJECT_INDEX.md": {
|
|
12274
|
+
"state": "present",
|
|
12275
|
+
"contentId": "c2ff51ecd87013f6301a0697d9bc2937eac218cf684ae39341a282250ec46897",
|
|
12276
|
+
"rawSha256": "561bf9be0f264b5e9a96a9748cb0eaa5eaae22254d187262fd31b5f7f6d4e838",
|
|
12277
|
+
"normalizedSha256": "561bf9be0f264b5e9a96a9748cb0eaa5eaae22254d187262fd31b5f7f6d4e838",
|
|
12278
|
+
"canonicalSha256": "8fd316fca77004a94404582a5152c2bbdcf89610b52e7c0fdbfb0076c5cdd759"
|
|
12279
|
+
},
|
|
12280
|
+
"dev/DOC_SYNC_REGISTRY.md": {
|
|
12281
|
+
"state": "present",
|
|
12282
|
+
"contentId": "f6545b524dc440d3563041e04a05caff4229863f6cae2a39127f85a29a120249",
|
|
12283
|
+
"rawSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
|
|
12284
|
+
"normalizedSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6",
|
|
12285
|
+
"canonicalSha256": "56807afee836d3ce19cabb1d020ef37168880a405b5eb8c6d7347e25e94c36e6"
|
|
12286
|
+
},
|
|
12287
|
+
"dev/RULE_PACKS.md": {
|
|
12288
|
+
"state": "present",
|
|
12289
|
+
"contentId": "9e9643115e4abef66f2c52510c0c63ce0f4a978ceb0ed5655b7c9c07a4f98c39",
|
|
12290
|
+
"rawSha256": "5715644cf26aa64fa42bf2173e02cadeff1731d6ea1647cfcde4bbf0915f4230",
|
|
12291
|
+
"normalizedSha256": "5715644cf26aa64fa42bf2173e02cadeff1731d6ea1647cfcde4bbf0915f4230",
|
|
12292
|
+
"canonicalSha256": "5715644cf26aa64fa42bf2173e02cadeff1731d6ea1647cfcde4bbf0915f4230"
|
|
12293
|
+
},
|
|
12294
|
+
"dev/PROJECT_DECISIONS.md": {
|
|
12295
|
+
"state": "present",
|
|
12296
|
+
"contentId": "3aae993bd5b85bf6b1d1d458f1bcf82c7d3105c843f053ffa13553bb5931b8c4",
|
|
12297
|
+
"rawSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
|
|
12298
|
+
"normalizedSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e",
|
|
12299
|
+
"canonicalSha256": "c2fbfb759a36145a92750226d0f7585d49ce0fa4bf1cfde474988ce510dc455e"
|
|
12300
|
+
},
|
|
12301
|
+
"dev/rules/safety.md": {
|
|
12302
|
+
"state": "present",
|
|
12303
|
+
"contentId": "dd6bcf74722d038f76d202e2044a6583a6e6ad107fbb010520e513eec799ff4a",
|
|
12304
|
+
"rawSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
|
|
12305
|
+
"normalizedSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0",
|
|
12306
|
+
"canonicalSha256": "685e501bb8a8cf721dd742312c9160a46a1066a4a875235eaaf579c1c8e72ab0"
|
|
12307
|
+
},
|
|
12308
|
+
"dev/rules/coding.md": {
|
|
12309
|
+
"state": "present",
|
|
12310
|
+
"contentId": "1c6deb9a5a281c13e97b0ac96079e9e1beccbd1ff106186e7a6ac78c0eeb75c2",
|
|
12311
|
+
"rawSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
|
|
12312
|
+
"normalizedSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4",
|
|
12313
|
+
"canonicalSha256": "79e96a709d7e9ccc629a0e35f88fde72522cccb71a0e7bd103b02ab7a5a1e7f4"
|
|
12314
|
+
},
|
|
12315
|
+
"dev/rules/writing.md": {
|
|
12316
|
+
"state": "present",
|
|
12317
|
+
"contentId": "ceee5412520ba860e6b40de46bb164e2ce3919d2197d5fadb926198eb7dddd3b",
|
|
12318
|
+
"rawSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
|
|
12319
|
+
"normalizedSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593",
|
|
12320
|
+
"canonicalSha256": "106376ae5c4eb703cab471efe2b285e1b0de5e35c2460977731fec2662c24593"
|
|
12321
|
+
},
|
|
12322
|
+
"dev/rules/research.md": {
|
|
12323
|
+
"state": "present",
|
|
12324
|
+
"contentId": "4414f9c82c6d04ad49d7446f4b0740055242f425ef5b00391d9c8c78c96c0f66",
|
|
12325
|
+
"rawSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
|
|
12326
|
+
"normalizedSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104",
|
|
12327
|
+
"canonicalSha256": "b282a48392250b570651f5e2e80c59d6c247617d08db35331d1e7538747a2104"
|
|
12328
|
+
},
|
|
12329
|
+
"dev/rules/agent-governance.md": {
|
|
12330
|
+
"state": "present",
|
|
12331
|
+
"contentId": "769598d86da84670a47fe895e3403b5f2f320e09e3cfe24d38dfdab8c79d0de4",
|
|
12332
|
+
"rawSha256": "dec490620ad85ba459204e17b29faa756e8374197ed1f5e7a9bcfcae7e2ca1ed",
|
|
12333
|
+
"normalizedSha256": "dec490620ad85ba459204e17b29faa756e8374197ed1f5e7a9bcfcae7e2ca1ed",
|
|
12334
|
+
"canonicalSha256": "dec490620ad85ba459204e17b29faa756e8374197ed1f5e7a9bcfcae7e2ca1ed"
|
|
12335
|
+
},
|
|
12336
|
+
"dev/rules/release.md": {
|
|
12337
|
+
"state": "present",
|
|
12338
|
+
"contentId": "b0a0c9dea88016185f4093f9be4ce3c0e29904222e21dd1fa1735fcc1bb7e744",
|
|
12339
|
+
"rawSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
|
|
12340
|
+
"normalizedSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7",
|
|
12341
|
+
"canonicalSha256": "cb01295a69be627564307bb8475f1a6e6438fae79d910ef3e318e7fcb8ced8a7"
|
|
12342
|
+
},
|
|
12343
|
+
"dev/rules/knowledge.md": {
|
|
12344
|
+
"state": "present",
|
|
12345
|
+
"contentId": "e6f5795c7ebaba7b05f04d971b2942b5a0394a3babb44f64a1cc591c9a08cb86",
|
|
12346
|
+
"rawSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c",
|
|
12347
|
+
"normalizedSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c",
|
|
12348
|
+
"canonicalSha256": "efeed5a4eef59f2ce59852832dddcd0447b2308a76fd01dd7a44ee6a16abb74c"
|
|
12349
|
+
},
|
|
12350
|
+
"dev/rules/communication.md": {
|
|
12351
|
+
"state": "present",
|
|
12352
|
+
"contentId": "34fd0034cbc75dad43f789b86a414763f01916dda4d59876db9c4d8d92ae6a87",
|
|
12353
|
+
"rawSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
|
|
12354
|
+
"normalizedSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591",
|
|
12355
|
+
"canonicalSha256": "8622edcc31d76d12699ee3bb6c95ff74ad5f0e962fa063d4ad0146cfa083d591"
|
|
12356
|
+
},
|
|
12357
|
+
"dev/rules/closeout.md": {
|
|
12358
|
+
"state": "present",
|
|
12359
|
+
"contentId": "0d0c85ac4318670d9ffba85e46cc709ee3b0a9bcb0ad7586079859f98e0a1c72",
|
|
12360
|
+
"rawSha256": "45b8019de97dd730380af9c211da92b541580797a66694b9b4188bed49e999b6",
|
|
12361
|
+
"normalizedSha256": "45b8019de97dd730380af9c211da92b541580797a66694b9b4188bed49e999b6",
|
|
12362
|
+
"canonicalSha256": "45b8019de97dd730380af9c211da92b541580797a66694b9b4188bed49e999b6"
|
|
12363
|
+
},
|
|
12364
|
+
"dev/rules/onboarding.md": {
|
|
12365
|
+
"state": "present",
|
|
12366
|
+
"contentId": "3989b14439cd64894d9cad444e73e35d0a5c1c67e85991819111483d1df67124",
|
|
12367
|
+
"rawSha256": "ffd0f2337cf1f5998d94ede375af920a0f14e9662ee6b50ca8b568511ac9d5d8",
|
|
12368
|
+
"normalizedSha256": "ffd0f2337cf1f5998d94ede375af920a0f14e9662ee6b50ca8b568511ac9d5d8",
|
|
12369
|
+
"canonicalSha256": "ffd0f2337cf1f5998d94ede375af920a0f14e9662ee6b50ca8b568511ac9d5d8"
|
|
12370
|
+
},
|
|
12371
|
+
"dev/rules/integrations.md": {
|
|
12372
|
+
"state": "present",
|
|
12373
|
+
"contentId": "a8fc1099da28f511bf9fed5eaf629ca10fb409299b0aed4d233a45fc7701f284",
|
|
12374
|
+
"rawSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef",
|
|
12375
|
+
"normalizedSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef",
|
|
12376
|
+
"canonicalSha256": "7e51039d57c7c424dbb2c74f9c5ac022193346354593ffa4979008112a2bf8ef"
|
|
12377
|
+
}
|
|
12378
|
+
}
|
|
12029
12379
|
}
|
|
12030
12380
|
},
|
|
12031
12381
|
"contents": {
|
|
@@ -12833,7 +13183,42 @@
|
|
|
12833
13183
|
"targetRel": "dev/rules/closeout.md",
|
|
12834
13184
|
"canonicalSha256": "45b8019de97dd730380af9c211da92b541580797a66694b9b4188bed49e999b6",
|
|
12835
13185
|
"text": "# Closeout Pack\n\n## Scope\n\nThis pack is the single detailed contract for full Agent Handoff Kit closeout. Load it only for clear end-of-session or handoff intent. It does not authorize Git, release, publish, deployment, deletion, permission, or cleanup actions.\n\n## Required Reads\n\nRead the current `dev/SESSION_HANDOFF.md`, `dev/SESSION_LOG.md`, `dev/PROJECT_INDEX.md`, and `dev/DOC_SYNC_REGISTRY.md`. Read `dev/PROJECT_DECISIONS.md`, integration rules, or another pack only when its closeout trigger or the session's actual work requires it.\n\n## Write Contract\n\nUse Kit markers as machine boundaries: `ack:section:*`, `ack:field:*`, `ack:log-entry:start/end`, and managed-core BEGIN/END. Human headings may be localized; markers may not be removed or translated.\n\n- Current state, objective, recommended next action, active risk, blocker, required reading, workspace identity, and sync status belong in `dev/SESSION_HANDOFF.md`.\n- Chronological work and evidence disposition belong in `dev/SESSION_LOG.md`.\n- File / command / source / capability maps belong in `dev/PROJECT_INDEX.md`.\n- Recurring sync obligations belong in `dev/DOC_SYNC_REGISTRY.md`.\n- Long-term evolution, architectural rationale, and accumulated learning belong in `dev/PROJECT_DECISIONS.md` when triggered.\n- Reusable procedures belong in the relevant pack, registered reference, or QA check.\n- `START_NEXT_SESSION_PROMPT.txt` is generated only from the handoff opening-message block.\n\nDo not copy the full opening message into `dev/SESSION_LOG.md` or any third current governance file. The log records that the mirror was regenerated and verified, plus an evidence reference when useful.\n\n## Full Closeout\n\nFull closeout is differential. Reuse a completed task check only when its recorded root, task input, tool identity, commit / artifact identity, and required file hashes still match the current state. Do not rerun task QA that is already bound to unchanged identity. Do rerun checks affected by closeout writes, gates that are incomplete or indeterminate, closeout-specific checks, and the final `closeout-status` read-back. If a closeout attempt is interrupted, stopped, aborted, times out, or hits a spawn / transport error, resume at the first incomplete or indeterminate gate; do not restart from the beginning unless the root, input, tool identity, commit, artifact, or relevant hash changed.\n\n1. Reconcile `dev/SESSION_HANDOFF.md`; never append a new current-state snapshot beneath an old one. Verify durable anchors, then rewrite or explicitly confirm every closeout-reconciled section.\n2. Reconcile lifecycle state across `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message`. Completed or verified work cannot remain unresolved unless explicitly reclassified as monitor-only, follow-up scope, blocked, or reopened with its missing evidence or trigger.\n The bundled doctor is a mechanical floor for required lifecycle markers and readable sections only. The semantic lifecycle gate is `agent-handoff-kit closeout-status`; when it blocks, use its first `Resolved [...]` / `Carry-forward [...]` pair to repair the handoff, not a separate project workaround, repeated doctor runs, or a broader governance rewrite. Read all five sections as a whole before marking the lifecycle field resolved. For governance, release, or another project-defined high-risk completion, use the project's independent semantic review gate in addition to `closeout-status`.\n3. Make `Next Priorities` name one recommended next action and a short reason unless blocked or a real user decision is required.\n4. Complete the persistence-routing, handoff-sufficiency, `Closeout outcome`, and `Project-required persistence` fields. The next agent must be able to continue from `AGENTS.md`, the handoff, the project index when needed, and routed packs without searching old log history. `complete` is allowed only when all required writes/read-backs and any project-required persistence succeeded; use `not_required` only when that persistence is genuinely not required. If a required commit, push, release record, or equivalent persistence is blocked or not authorized, set both fields to `blocked` with the exact boundary.\n5. Add one concise log entry for work actually performed. Record evidence disposition and the prompt-mirror verification result; omit the full opening message by design.\n6. Update the project index and sync registry only when their owned maps or obligations changed. Record each applicable sync target as `confirmed`, `unverified`, `pending`, `blocked`, or `not_applicable`.\n7. Record the actual root, Git root, branch, commit, worktrees / parallel workspaces, uncommitted changes, and unresolved drift. Do not clean or change them without separate authorization.\n8. If the session used external tools or helper processes, apply the integrations and safety ownership rules. Close only task-owned resources. Retain shared, user-owned, other-agent-owned, system, or ambiguous resources unless separately authorized; state visibility limits.\n9. Run the short maintenance trigger check below and record its result in the log.\n10. Mark first-use guidance `consumed` after the first successfully completed task or first full closeout. Upgrade must never reset `consumed` or `not_applicable` to `eligible`.\n11. Regenerate `START_NEXT_SESSION_PROMPT.txt` from the sole fenced handoff opening-message block. Run the project's fixed prompt-mirror checker or perform an equivalent anchored read-back that verifies marker, heading, fence, full-copy uniqueness, and normalized content equality.\n12. Run available project-specific closeout checks. Do not run a separate bundled `doctor`: the `closeout-status` command below performs the one required fresh doctor read-back. Do not treat an external update-check failure as local closeout failure. Fix state or mirror failures before claiming handoff ready.\n13. Run `agent-handoff-kit closeout-status --root <project root>` after the handoff and prompt read-back. It performs the one required fresh doctor read-back and its output is the only final card source: copy its status faithfully. A nonzero result means the closeout is blocked; do not replace it with a success summary.\n\n## Maintenance Trigger Check\n\nEvery full closeout runs this short check; full maintenance runs only when triggered.\n\n- SESSION_LOG: trigger when the main log reaches at least 11 entries, exceeds 1500 lines, or the 10-closeout backstop is due. Keep recent safety-buffer entries; collapse only content already absorbed by an authoritative home. Archive older raw entries to `dev/SESSION_LOG_archive/archive_<batch>_<low_date>_to_<high_date>.md` and maintain `INDEX.md`. Port unique narrative before collapsing it.\n- PROJECT_DECISIONS: trigger when a decisions-like handoff section has at least 30 entries; retain the newest 8–22 in the hot tier and move older decisions into the decisions archive. Also write substantive task evolution, a multi-option architectural choice with rationale, or a cross-session learning when observed.\n- Backstop: every 10 closeouts, run the full long-term maintenance pass even when no semantic trigger is obvious. If the count cannot be determined confidently at the boundary, treat the backstop as due.\n\nIf no trigger applies, record one no-op reason. Handoff carries continuity; log and project decisions carry trace and long-term narrative.\n\n## Opening Message And Card\n\nThe handoff opening-message block is authoritative. It must name the absolute root, route the agent through `AGENTS.md` and the handoff, state the current objective and boundary, and avoid instructing the next agent to redo completed work. It must not require SESSION_LOG as an ordinary startup read.\n\nUse `agent-handoff-kit closeout-status --root <project root>` after the required read-backs. It renders the verified version when available and otherwise `version unverified`; never print the literal placeholder `v<version>`, hand-compose a substitute card, or use `handoff saved` unless the command reports `status: complete`.\n\n```text\n /\\_/\\ Agent Handoff Kit v<version>\n ( -.- ) handoff saved\n > ^ <\n\nstatus: complete\n✅ Done: <completed summary>\n🔎 QC: <validation summary>\n📌 Handoff: opening message ready\n⚠️ Boundary: <important boundary or none>\n```\n\nFor `status: blocked`, the command instead says `handoff blocked`; retain that status, blocker reason, and human explanation: `這不是失敗;只是還有事未保存、未提交、未驗證或需要處理。先照 Blocker 行處理,不要把本輪當作已完成交接。` Then give the short local-root entry `Start Agent Handoff` / `開工` and the path-bearing fallback for an agent not yet pointed at the root. Do not hand-compose a third stateful prompt in the final response.\n\n## Stop Conditions\n\nDo not claim closeout complete when any required write or read-back failed, lifecycle state conflicts remain, the mirror is stale or duplicated, the root is uncertain, mandatory sync is unclassified, `closeout-status` is nonzero, or required Git persistence was explicitly part of the project's closeout contract but did not succeed. State the exact blocker and leave the project in an honest resumable state.\n"
|
|
13186
|
+
},
|
|
13187
|
+
"effc2b7606f098d48cf46f0c1fcbd2f312f9dd2d804b194106bb421acbe89915": {
|
|
13188
|
+
"targetRel": "AGENTS.md",
|
|
13189
|
+
"canonicalSha256": "1f1d11ab484adefc8388bee2796720abb64adc708561bb4dbbf9860d366c9a9e",
|
|
13190
|
+
"text": "<!-- BEGIN Agent Handoff Kit managed core -->\n# Agent Handoff Kit Core Runtime\n\nThis is the small always-read contract. Detailed task and closeout procedures live in routed packs.\n\n## 1. Intent And Startup\n\nClassify the user's visible intent before loading project state. For explicit continuity, closeout, or a task whose next action depends on persisted project state, read `dev/SESSION_HANDOFF.md` first; it is the current-state authority. A direct ordinary or stateless task does not read the handoff merely because the project root is known. If the message is genuinely unresolved and the handoff can resolve it, read the handoff before asking the user.\n\nDo not read `dev/SESSION_LOG.md` during ordinary startup; it is trace-back evidence only. Do not read `START_NEXT_SESSION_PROMPT.txt` in addition to the handoff when already operating in the project root; that file is a portable generated mirror for an agent that has not yet been pointed at the root.\n\nRoute intent in this order:\n\n1. Clear closeout intent routes directly to `dev/rules/closeout.md`.\n2. Clear continuity intent such as \"開工\", \"Start Agent Handoff\", \"開始接力\", or \"continue handoff\" resumes the minimum current state from the handoff. A plain continuity message with no same-message task or explicit long-run instruction authorizes only that recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out wording such as \"unless you object I will start\". A concrete objective found only in loaded state is not authority to complete it. A same-message task may begin normally. An explicit instruction such as \"開工,繼續做到下一個 blocker\" or \"開工,繼續完成目前目標\" may continue under the normal task and safety rules.\n3. A direct ordinary task begins without a startup card or onboarding ceremony. Read only the sources and packs required by that task.\n4. Explicit guidance requests such as \"I'm new\", \"teach me\", \"help me start\", \"新手\", \"教我用\", or \"點開始\" may load `dev/rules/onboarding.md`. A fresh install or short message only makes guidance available; it never overrides a concrete objective. If no executable objective remains after state reading, ask one concise question or offer guided onboarding.\n\nTreat a phrase as ambiguous only when its ordinary meaning may genuinely refer to a real-world shift, event, or unrelated context. `開工,繼續 <task>`, `<project> 開工`, and `Start Agent Handoff and continue <task>` are continuity commands, not ambiguous phrases.\n\nDuring explicit continuity startup, the only optional presentation effect beyond state recovery and card/status is a user-visible task/conversation title update, when the active runtime safely supports current-thread title control. Current-title readback is useful when available to avoid overwriting an already informative title, but it is not required when the tool safely targets the calling/current thread. If title control is exposed only through a bounded runtime tool-discovery mechanism, use that discovery once with a narrow title/rename/current-thread query before deciding the control is unavailable; then call only the discovered safe current-thread title tool. Do not list or inspect unrelated threads solely for naming, and do not create, fork, navigate, message, archive, pin, or otherwise manage tasks as part of startup title naming. Do not title from the raw continuity trigger or before handoff-derived startup facts are final. First derive the startup card's current objective, risk/boundary, and recommended next action; then choose and apply any title update as the last presentation side effect before returning the startup response. Replace only a generic or stale title, or update once when the main objective clearly changes; keep an informative title when readback proves it is already relevant, and do not rename for tests, reviews, or small substeps. Use `<project name>|<primary action>` from facts already loaded for startup: a concrete same-message task first, otherwise the loaded current objective plus recommended next action. Within those facts, select one concrete primary action in this order: the same-message task; the loaded current objective; the recommended next action. The continuity trigger itself and generic phrases such as `Start Agent Handoff`, `開工`, `開始交接工作`, or `開始工作交接` are not primary actions. If the loaded facts do not provide both a concrete project name and a concrete primary action, skip the title update. Do not read `dev/PROJECT_INDEX.md`, files, network, or other state solely to name the title. The title must not contain progress, completion, status, task/session IDs, absolute paths, secrets, or unverified facts. If safe current-thread title control is unavailable after the bounded discovery above, skip silently. The title is display-only; it is not project state, permission, progress, completion evidence, a health result, or a source of truth, and it does not authorize project/file writes, network activity, external task work, or continuation beyond the startup boundary.\n\nRead `dev/PROJECT_INDEX.md` when the task needs its file, command, integration, workspace, or source map. Read `dev/RULE_PACKS.md` when a task pack must be selected. Read `dev/DOC_SYNC_REGISTRY.md` before durable cross-file or external synchronization and during closeout. Pack loading is normally silent; explain it only when it changes risk, requires a user decision, or materially affects the next action.\n\nIf the user supplies the portable startup prompt, use it to locate the root, then trust the handoff over the mirror. If the root is unclear or mismatched, stop and ask for the intended root before reading or editing project state. Missing required governance files are a repair condition, not permission to invent a parallel structure.\n\nBefore a non-trivial task, identify and read the required local and external truth sources or mark them blocked. Reachable is not the same as ingested. Search hits, truncated output, summaries, and status claims do not replace the relevant source content.\n\nProbe an integration only immediately before a task uses it, when the handoff explicitly identifies it as a dependency for the current objective, or when the user requests an integration health check. `TBD`, examples, blank rows, and undeclared placeholders are not installed integrations. Record `Last Verified` only after a real probe and through the normal persistence gate. Never write integration status merely because a session started.\n\nShow the startup card only for explicit continuity startup. For a plain continuity message, show the card after the minimum state recovery and end the turn; its recommended next action is advice, not permission to act. An explicit same-message task or long-run continuation may combine the card with its first useful action. Direct ordinary tasks do not show the card. If onboarding is explicitly requested, combine any card and guidance in one response.\n\nFor explicit bare continuity startup, after the handoff is read, the startup card may read only the bounded version evidence from `dev/PROJECT_INDEX.md`: the unique stable-semver `| Agent Handoff Kit template version | X.Y.Z | ... |` row inside the unique real `## Stack` section. Do not route on, summarize, or load any other Project Index content for startup, title, permissions, packs, health, or task work. Missing, unreadable, malformed, duplicate, prerelease, or out-of-Stack-only version evidence prints `version unverified`; the turn remains status-only with zero writes. A direct ordinary or stateless task does not read the handoff or Project Index merely to fill a card or version.\n\n```text\n /\\_/\\ Agent Handoff Kit v<version>\n ( o.o ) continuity ready\n > ^ <\n\n🔎 交接狀態:<loaded / new install / resumed>\n📌 目前目標:<current objective>\n⚠️ 注意事項:<important boundary or none>\n🚀 推薦下一步:<one action + reason>\n```\n\nUse the full product name, plain user language, and one recommended next action. Never print the literal placeholder `v<version>`.\n\n## 2. Proportionate Work Loop\n\nApply PLAN → READ → CHANGE → QC internally and in proportion to task state and risk. Do not make the user watch governance ceremony that does not help the task.\n\nIn every user-facing reply, lead with ordinary language: state the result and its practical effect, then the next action when one helps. Put exact commands, errors, hashes, and detailed evidence after that; brevity must not hide uncertainty or safety risk.\n\n- Simple answers, pure conversation or creation with no durable state, and low-risk tasks with an obvious target may proceed directly with proportionate reading and checking.\n- Non-trivial work reads relevant sources before changing them.\n- High-risk work states scope, impact, acceptance, and required confirmation before writes.\n- External skill flows, subagents, task plans, demo workspaces, and another tool's finish step do not replace the active root's persistence decision.\n- Materially changed Markdown governance artifacts must be indexed, synchronized, consolidated into their authoritative home, or explicitly classified as temporary / one-time evidence. Other durable formats follow the same human governance rule, but the bundled doctor does not claim to scan them.\n\n## 2.1 Persistence Gate\n\nChoose exactly one tier after a task:\n\n1. No persistence: no durable fact was produced. One-off answers, transient output, active unapproved drafts, and routine rerunnable checks normally use this tier.\n2. Lightweight checkpoint: a durable fact affects future action while the session continues or may be interrupted. This is the default for ongoing sessions. Write only its smallest correct home; do not regenerate the startup mirror or perform full closeout.\n3. Full closeout: explicit end-of-session / handoff intent, a real day / tool-session boundary, or a state where the current agent cannot continue and the next agent must take over. Ordinary external-tool use, a completed release / governance subtask, or a durable note during an ongoing session is not by itself a full closeout trigger. Load `dev/rules/closeout.md` only when this tier is selected.\n\nRoute current objective, next action, active risk, blocker, and startup-needed facts to `dev/SESSION_HANDOFF.md`; chronological evidence to `dev/SESSION_LOG.md`; maps to `dev/PROJECT_INDEX.md`; sync obligations to `dev/DOC_SYNC_REGISTRY.md`; long-term rationale to `dev/PROJECT_DECISIONS.md`; and reusable procedures to the relevant pack, registered reference, or QA check. Do not store the same task contract or reusable rule in several homes.\n\nExternal effects are never implied permission for commit, push, publish, release, deployment, cleanup, or another workspace write. Record verified external impact through the relevant integrations, release, safety, and closeout contracts without exposing private content or secrets.\n\n## 2.2 Upgrade Completion\n\nThe CLI owns upgrade truth. An upgrade is complete only when:\n\n1. The root is not newer than the CLI and every target passes read-only classification.\n2. Conflict produces zero governance-target and version writes.\n3. Staged outputs pass the offline migration acceptance gate: root boundary, structure, cross-file invariants, preservation hashes, and version transition.\n4. The recoverable transaction commits without an unresolved journal; only a failure caused by this transaction triggers rollback.\n5. Whole-project `doctor` reports project health separately. Pre-existing or unrelated health failures do not convert a correct migration into a destructive rollback; new migration-caused blockers do.\n6. The migration report records attempted version, committed version, transaction state, actions, redacted reasons, and backup locations without credential values.\n\nDo not use \"upgrade completed\" to mean \"the entire project is healthy\". Report `migration committed` and `project health` separately. Conflict, incomplete recovery, failed migration acceptance, and future-version roots are not completed upgrades.\n\n## 3. Safety Baseline\n\nDo not delete, reset, overwrite user-owned content, bulk-move, publish, change permissions, or perform another irreversible or external action without the required explicit authorization.\n\nNamed prohibited destructive commands in `dev/rules/safety.md` remain prohibited even when requested. Never use a weaker pack or local instruction to bypass core safety.\n\nVerify the selected root and real target boundaries before writes. Do not follow a link, junction, mount, or computed path outside the confirmed root. Do not expose credential values in output, reports, backups, tests, or logs. Permission or lock failure is a stop condition, not permission to elevate or switch to a riskier command.\n\nDo not modify unrelated files or erase unexpected user changes. Do not claim completion without read-back evidence and proportionate checks.\n\n## 4. Closeout Trigger\n\nClear end-of-session or handoff intent such as \"收工\", \"Wrap up Agent Handoff\", \"closeout\", \"wrap up\", or \"handoff\" triggers full closeout, not a chat-only summary. Load `dev/rules/closeout.md` and follow its complete contract. `收工,記得 <handoff requirement>` and equivalent closeout-plus-instruction phrases are clear closeout intent. Ask one concise confirmation only when the phrase genuinely refers to an unrelated real-world closing or shift.\n\nThe always-enforced closeout invariants are:\n\n1. Current state lives in `dev/SESSION_HANDOFF.md`; trace evidence lives in `dev/SESSION_LOG.md`.\n2. Completed, pending, risk, validation, and opening-message lifecycle states agree.\n3. `START_NEXT_SESSION_PROMPT.txt` is regenerated from the sole authoritative handoff block and no third full copy is retained.\n4. Closeout is not complete until required files are written, read back, and the available closeout checks pass.\n5. After those checks, render the final card with `agent-handoff-kit closeout-status --root <project root>`; only its `status: complete` output may say `handoff saved`. A nonzero / `blocked` result is an honest blocked closeout, not a completed one.\n6. Git commit, push, release, publish, deployment, deletion, and permission changes remain separately authorized actions.\n\n## 5. Pack Loading\n\nUse `dev/RULE_PACKS.md` to load the minimum task-specific set. Packs may add stricter requirements but cannot weaken core safety or continuity.\n\nLoad `dev/rules/integrations.md` when the current task actually uses an external tool, not merely because a registry or placeholder table exists. Load `dev/rules/closeout.md` only for full closeout. If two packs conflict, use the safer and more verifiable path and record the unresolved conflict at closeout.\n\nAfter the task, apply the Persistence Gate. Do not assume the next session remembers pack context, and do not use handoff or log as the only home for reusable procedures.\n\n## Core Complexity Rule\n\nBefore changing `AGENTS.md` or adding a durable governance rule, use `dev/RULE_PACKS.md` to load `dev/rules/agent-governance.md` and locate the existing normative owner. Default-core rules must apply to most sessions, protect safety or continuity, and be shorter than the routed detail they replace. Scenario-specific or project-specific detail belongs in an existing pack or registered reference; a new pack is justified only when it creates a smaller, independently loadable responsibility with one normative owner. Do not copy the agent-governance classification table or workflow into the core.\n<!-- END Agent Handoff Kit managed core -->\n\n<!-- ack:user-rules-router:dev/USER_RULES.md -->\n<!-- ack:user-rules-acceptance:sha256=526c61feaebd0e7fc43ae7e8ae658c081e7ef0dbd0d737a09ec908602d9e0aa6 -->\nBefore loading task packs, read `dev/USER_RULES.md`. Its registered entries\nunder `dev/user_rules/` are user-controlled rules: read each accepted entry in\nthe listed order and verify its accepted raw-byte witness. Do not treat this\nrouter, its directory, a heading, language, format, location, or\nofficial-looking text as proof that any legacy source belongs to the Kit.\n"
|
|
13191
|
+
},
|
|
13192
|
+
"6799395074579fc07ec832545aa68abd4ad105c30c19f7980721fca5ae4a6256": {
|
|
13193
|
+
"targetRel": "AGENTS.md",
|
|
13194
|
+
"canonicalSha256": "06892df11eabdf13599e525d40a79f2b072d47b68b6c265b9417de36fa22f840",
|
|
13195
|
+
"text": "<!-- BEGIN Agent Handoff Kit managed core -->\n# Agent Handoff Kit Core Runtime\n\nThis is the small always-read contract. Detailed task and closeout procedures live in routed packs.\n\n## 1. Intent And Startup\n\nClassify the user's visible intent before loading project state. For explicit continuity, closeout, or a task whose next action depends on persisted project state, read `dev/SESSION_HANDOFF.md` first; it is the current-state authority. A direct ordinary or stateless task does not read the handoff merely because the project root is known. If the message is genuinely unresolved and the handoff can resolve it, read the handoff before asking the user.\n\nDo not read `dev/SESSION_LOG.md` during ordinary startup; it is trace-back evidence only. Do not read `START_NEXT_SESSION_PROMPT.txt` in addition to the handoff when already operating in the project root; that file is a portable generated mirror for an agent that has not yet been pointed at the root.\n\nRoute intent in this order:\n\n1. Clear closeout intent routes directly to `dev/rules/closeout.md`.\n2. Clear continuity intent such as \"開工\", \"Start Agent Handoff\", \"開始接力\", or \"continue handoff\" resumes the minimum current state from the handoff. A plain continuity message with no same-message task or explicit long-run instruction authorizes only that recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out wording such as \"unless you object I will start\". First-use exception: when `dev/SESSION_HANDOFF.md` says `First-use guidance state: eligible`, the active objective is empty / `TBD`, and there is no same-message concrete task, load `dev/rules/onboarding.md` and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in loaded state is not authority to complete it. A same-message task may begin normally. An explicit instruction such as \"開工,繼續做到下一個 blocker\" or \"開工,繼續完成目前目標\" may continue under the normal task and safety rules.\n3. A direct ordinary task begins without a startup card or onboarding ceremony. Read only the sources and packs required by that task.\n4. Explicit guidance requests such as \"I'm new\", \"teach me\", \"help me start\", \"新手\", \"教我用\", or \"點開始\" may load `dev/rules/onboarding.md`. A fresh install marks first-use guidance as `eligible`, so the first unresolved startup must enter onboarding; upgrade must not reset `consumed` or `not_applicable` back to `eligible`. A short message in a non-eligible root only makes guidance available; it never overrides a concrete objective. If no executable objective remains after state reading, ask one concise question or offer guided onboarding.\n\nTreat a phrase as ambiguous only when its ordinary meaning may genuinely refer to a real-world shift, event, or unrelated context. `開工,繼續 <task>`, `<project> 開工`, and `Start Agent Handoff and continue <task>` are continuity commands, not ambiguous phrases.\n\nDuring explicit continuity startup, the only optional presentation effect beyond state recovery and card/status is a user-visible task/conversation title update, when the active runtime safely supports current-thread title control. Current-title readback is useful when available to avoid overwriting an already informative title, but it is not required when the tool safely targets the calling/current thread. If title control is exposed only through a bounded runtime tool-discovery mechanism, use that discovery once with a narrow title/rename/current-thread query before deciding the control is unavailable; then call only the discovered safe current-thread title tool. Do not list or inspect unrelated threads solely for naming, and do not create, fork, navigate, message, archive, pin, or otherwise manage tasks as part of startup title naming. Do not title from the raw continuity trigger or before handoff-derived startup facts are final. First derive the startup card's current objective, risk/boundary, and recommended next action; then choose and apply any title update as the last presentation side effect before returning the startup response. Replace only a generic or stale title, or update once when the main objective clearly changes; keep an informative title when readback proves it is already relevant, and do not rename for tests, reviews, or small substeps. Use `<project name>|<primary action>` from facts already loaded for startup: a concrete same-message task first, otherwise the loaded current objective plus recommended next action. Within those facts, select one concrete primary action in this order: the same-message task; the loaded current objective; the recommended next action. The continuity trigger itself and generic phrases such as `Start Agent Handoff`, `開工`, `開始交接工作`, or `開始工作交接` are not primary actions. If the loaded facts do not provide both a concrete project name and a concrete primary action, skip the title update. Do not read `dev/PROJECT_INDEX.md`, files, network, or other state solely to name the title. The title must not contain progress, completion, status, task/session IDs, absolute paths, secrets, or unverified facts. If safe current-thread title control is unavailable after the bounded discovery above, skip silently. The title is display-only; it is not project state, permission, progress, completion evidence, a health result, or a source of truth, and it does not authorize project/file writes, network activity, external task work, or continuation beyond the startup boundary.\n\nRead `dev/PROJECT_INDEX.md` when the task needs its file, command, integration, workspace, or source map. Read `dev/RULE_PACKS.md` when a task pack must be selected. Read `dev/DOC_SYNC_REGISTRY.md` before durable cross-file or external synchronization and during closeout. Pack loading is normally silent; explain it only when it changes risk, requires a user decision, or materially affects the next action.\n\nIf the user supplies the portable startup prompt, use it to locate the root, then trust the handoff over the mirror. If the root is unclear or mismatched, stop and ask for the intended root before reading or editing project state. Missing required governance files are a repair condition, not permission to invent a parallel structure.\n\nBefore a non-trivial task, identify and read the required local and external truth sources or mark them blocked. Reachable is not the same as ingested. Search hits, truncated output, summaries, and status claims do not replace the relevant source content.\n\nProbe an integration only immediately before a task uses it, when the handoff explicitly identifies it as a dependency for the current objective, or when the user requests an integration health check. `TBD`, examples, blank rows, and undeclared placeholders are not installed integrations. Record `Last Verified` only after a real probe and through the normal persistence gate. Never write integration status merely because a session started.\n\nShow the startup card only for explicit continuity startup. For a plain continuity message, show the card after the minimum state recovery and end the turn; its recommended next action is advice, not permission to act. The first-use exception above replaces that status-only stop with onboarding only when the handoff state is `eligible`, the objective is empty / `TBD`, and there is no same-message concrete task. An explicit same-message task or long-run continuation may combine the card with its first useful action. Direct ordinary tasks do not show the card. If onboarding is explicitly requested or first-use onboarding is triggered, combine any card and guidance in one response.\n\nFor explicit bare continuity startup, after the handoff is read, the startup card may read only the bounded version evidence from `dev/PROJECT_INDEX.md`: the unique stable-semver `| Agent Handoff Kit template version | X.Y.Z | ... |` row inside the unique real `## Stack` section. Do not route on, summarize, or load any other Project Index content for startup, title, permissions, packs, health, or task work. Missing, unreadable, malformed, duplicate, prerelease, or out-of-Stack-only version evidence prints `version unverified`; the turn remains status-only with zero writes. A direct ordinary or stateless task does not read the handoff or Project Index merely to fill a card or version.\n\n```text\n /\\_/\\ Agent Handoff Kit v<version>\n ( o.o ) continuity ready\n > ^ <\n\n🔎 交接狀態:<loaded / new install / resumed>\n📌 目前目標:<current objective>\n⚠️ 注意事項:<important boundary or none>\n🚀 推薦下一步:<one action + reason>\n```\n\nUse the full product name, plain user language, and one recommended next action. Never print the literal placeholder `v<version>`.\n\n## 2. Proportionate Work Loop\n\nApply PLAN → READ → CHANGE → QC internally and in proportion to task state and risk. Do not make the user watch governance ceremony that does not help the task.\n\nIn every user-facing reply, lead with ordinary language: state the result and its practical effect, then the next action when one helps. Put exact commands, errors, hashes, and detailed evidence after that; brevity must not hide uncertainty or safety risk.\n\n- Simple answers, pure conversation or creation with no durable state, and low-risk tasks with an obvious target may proceed directly with proportionate reading and checking.\n- Non-trivial work reads relevant sources before changing them.\n- High-risk work states scope, impact, acceptance, and required confirmation before writes.\n- External skill flows, subagents, task plans, demo workspaces, and another tool's finish step do not replace the active root's persistence decision.\n- Materially changed Markdown governance artifacts must be indexed, synchronized, consolidated into their authoritative home, or explicitly classified as temporary / one-time evidence. Other durable formats follow the same human governance rule, but the bundled doctor does not claim to scan them.\n\n## 2.1 Persistence Gate\n\nChoose exactly one tier after a task:\n\n1. No persistence: no durable fact was produced. One-off answers, transient output, active unapproved drafts, and routine rerunnable checks normally use this tier.\n2. Lightweight checkpoint: a durable fact affects future action while the session continues or may be interrupted. This is the default for ongoing sessions. Write only its smallest correct home; do not regenerate the startup mirror or perform full closeout.\n3. Full closeout: explicit end-of-session / handoff intent, a real day / tool-session boundary, or a state where the current agent cannot continue and the next agent must take over. Ordinary external-tool use, a completed release / governance subtask, or a durable note during an ongoing session is not by itself a full closeout trigger. Load `dev/rules/closeout.md` only when this tier is selected.\n\nRoute current objective, next action, active risk, blocker, and startup-needed facts to `dev/SESSION_HANDOFF.md`; chronological evidence to `dev/SESSION_LOG.md`; maps to `dev/PROJECT_INDEX.md`; sync obligations to `dev/DOC_SYNC_REGISTRY.md`; long-term rationale to `dev/PROJECT_DECISIONS.md`; and reusable procedures to the relevant pack, registered reference, or QA check. Do not store the same task contract or reusable rule in several homes.\n\nExternal effects are never implied permission for commit, push, publish, release, deployment, cleanup, or another workspace write. Record verified external impact through the relevant integrations, release, safety, and closeout contracts without exposing private content or secrets.\n\n## 2.2 Upgrade Completion\n\nThe CLI owns upgrade truth. An upgrade is complete only when:\n\n1. The root is not newer than the CLI and every target passes read-only classification.\n2. Conflict produces zero governance-target and version writes.\n3. Staged outputs pass the offline migration acceptance gate: root boundary, structure, cross-file invariants, preservation hashes, and version transition.\n4. The recoverable transaction commits without an unresolved journal; only a failure caused by this transaction triggers rollback.\n5. Whole-project `doctor` reports project health separately. Pre-existing or unrelated health failures do not convert a correct migration into a destructive rollback; new migration-caused blockers do.\n6. The migration report records attempted version, committed version, transaction state, actions, redacted reasons, and backup locations without credential values.\n\nDo not use \"upgrade completed\" to mean \"the entire project is healthy\". Report `migration committed` and `project health` separately. Conflict, incomplete recovery, failed migration acceptance, and future-version roots are not completed upgrades.\n\n## 3. Safety Baseline\n\nDo not delete, reset, overwrite user-owned content, bulk-move, publish, change permissions, or perform another irreversible or external action without the required explicit authorization.\n\nNamed prohibited destructive commands in `dev/rules/safety.md` remain prohibited even when requested. Never use a weaker pack or local instruction to bypass core safety.\n\nVerify the selected root and real target boundaries before writes. Do not follow a link, junction, mount, or computed path outside the confirmed root. Do not expose credential values in output, reports, backups, tests, or logs. Permission or lock failure is a stop condition, not permission to elevate or switch to a riskier command.\n\nDo not modify unrelated files or erase unexpected user changes. Do not claim completion without read-back evidence and proportionate checks.\n\n## 4. Closeout Trigger\n\nClear end-of-session or handoff intent such as \"收工\", \"Wrap up Agent Handoff\", \"closeout\", \"wrap up\", or \"handoff\" triggers full closeout, not a chat-only summary. Load `dev/rules/closeout.md` and follow its complete contract. `收工,記得 <handoff requirement>` and equivalent closeout-plus-instruction phrases are clear closeout intent. Ask one concise confirmation only when the phrase genuinely refers to an unrelated real-world closing or shift.\n\nThe always-enforced closeout invariants are:\n\n1. Current state lives in `dev/SESSION_HANDOFF.md`; trace evidence lives in `dev/SESSION_LOG.md`.\n2. Completed, pending, risk, validation, and opening-message lifecycle states agree.\n3. `START_NEXT_SESSION_PROMPT.txt` is regenerated from the sole authoritative handoff block and no third full copy is retained.\n4. Closeout is not complete until required files are written, read back, and the available closeout checks pass.\n5. After those checks, render the final card with `agent-handoff-kit closeout-status --root <project root>`; only its `status: complete` output may say `handoff saved`. A nonzero / `blocked` result is an honest blocked closeout, not a completed one.\n6. Git commit, push, release, publish, deployment, deletion, and permission changes remain separately authorized actions.\n\n## 5. Pack Loading\n\nUse `dev/RULE_PACKS.md` to load the minimum task-specific set. Packs may add stricter requirements but cannot weaken core safety or continuity.\n\nLoad `dev/rules/integrations.md` when the current task actually uses an external tool, not merely because a registry or placeholder table exists. Load `dev/rules/closeout.md` only for full closeout. If two packs conflict, use the safer and more verifiable path and record the unresolved conflict at closeout.\n\nAfter the task, apply the Persistence Gate. Do not assume the next session remembers pack context, and do not use handoff or log as the only home for reusable procedures.\n\n## Core Complexity Rule\n\nBefore changing `AGENTS.md` or adding a durable governance rule, use `dev/RULE_PACKS.md` to load `dev/rules/agent-governance.md` and locate the existing normative owner. Default-core rules must apply to most sessions, protect safety or continuity, and be shorter than the routed detail they replace. Scenario-specific or project-specific detail belongs in an existing pack or registered reference; a new pack is justified only when it creates a smaller, independently loadable responsibility with one normative owner. Do not copy the agent-governance classification table or workflow into the core.\n<!-- END Agent Handoff Kit managed core -->\n\n<!-- ack:user-rules-router:dev/USER_RULES.md -->\n<!-- ack:user-rules-acceptance:sha256=bad364a671d6ee88a98620bd2bb0b697f5bdadee8c25f4bba39bd1c5e3a0efe3 -->\nBefore loading task packs, read `dev/USER_RULES.md`. Its registered entries\nunder `dev/user_rules/` are user-controlled rules: read each accepted entry in\nthe listed order and verify its accepted raw-byte witness. Do not treat this\nrouter, its directory, a heading, language, format, location, or\nofficial-looking text as proof that any legacy source belongs to the Kit.\n"
|
|
13196
|
+
},
|
|
13197
|
+
"de01669f2989762269e57b8f71decc55d58effa649a245136efa6dc1434b78a9": {
|
|
13198
|
+
"targetRel": "START_NEXT_SESSION_PROMPT.txt",
|
|
13199
|
+
"canonicalSha256": "b1b9ad0cb5f3a374542a43b6c2c938e1e5d39dd42b91d12a4a74206f5f187113",
|
|
13200
|
+
"text": "Work in <ROOT>.\n\nIf the root does not match the handoff, stop and ask for confirmation. Do not read dev/SESSION_LOG.md during ordinary startup. Read dev/PROJECT_INDEX.md, dev/RULE_PACKS.md, dev/DOC_SYNC_REGISTRY.md, and task packs only when the current task requires them.\n\nResume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out execution wording. First-use exception: when this handoff says `First-use guidance state: eligible`, the current objective is empty / `TBD`, and there is no same-message concrete task, load onboarding and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. Upgrade never resets consumed / not_applicable first-use state back to eligible."
|
|
13201
|
+
},
|
|
13202
|
+
"df3d7d3bed1b51793910643d74b2391bbd79686acd1537b87f0d332548a35399": {
|
|
13203
|
+
"targetRel": "dev/SESSION_HANDOFF.md",
|
|
13204
|
+
"canonicalSha256": "e64a5a0b9dd1b4bcade6bb0bae4870b5ab7d2fa550a826e957a53d853a5e032f",
|
|
13205
|
+
"text": "# Session Handoff\n\nLast Updated: TBD\n\n<!-- ack:section:durable-anchors -->\n## Durable Anchors\n\nStable facts that should survive across sessions. Update only when they change, but verify they still match reality at closeout.\n\n1. Project root and boundary: TBD\n2. Product/system identity: TBD\n3. Governance model: TBD\n4. Source-of-truth ownership: TBD\n5. Release / publish boundary: TBD\n6. Installed Integrations registry: `dev/PROJECT_INDEX.md` `## Installed Integrations` is the declaration source. Probe only immediately before actual use, when the current objective names an integration dependency, or when the user asks for a health check. Credential values never appear in `dev/*`; record references only.\n\n<!-- ack:section:closeout-reconciled-state -->\n## Closeout-Reconciled State\n\nThis is the current-state area. At every full closeout, rewrite or explicitly confirm every section below. Do not append a new state snapshot under an old one.\n\n<!-- ack:section:current-baseline -->\n## Current Baseline\n\n1. Project root: TBD\n2. Product/system state: TBD\n3. Governance state: TBD\n4. Source-of-truth notes: TBD\n<!-- ack:field:first-use-guidance-state -->\n5. First-use guidance state: eligible\n\n<!-- ack:section:task-understanding-summary -->\n## Task Understanding Summary\n\n<!-- ack:field:user-intent -->\n- User intent: TBD\n<!-- ack:field:task-essence -->\n- Task essence: TBD\n- User value: TBD\n<!-- ack:field:success-criteria -->\n- Success criteria: TBD\n- Key background already read: TBD\n- Background still unread or blocked: TBD\n- Non-goals / boundaries: TBD\n\n<!-- ack:section:active-objective -->\n## Active Objective\n\nTBD\n\n<!-- ack:section:completed-this-session -->\n## Completed This Session\n\nRecord only work actually completed in the current session.\n\n1. TBD\n\n<!-- ack:section:next-priorities -->\n## Next Priorities\n\nRecommended next step: TBD — reason: TBD\n\n1. TBD\n\n<!-- ack:section:next-task-required-reading -->\n## Next Task Required Reading\n\nBefore acting on the next task, read or mark blocked:\n\n| Source | Why required | Status |\n|---|---|---|\n| TBD | TBD | pending |\n\n<!-- ack:section:risks-blockers -->\n## Risks / Blockers\n\n1. TBD\n\n<!-- ack:section:validation-qc -->\n## Validation / QC\n\n- Checks run this session: TBD\n- Checks not run and why: TBD\n- Handoff evidence location: TBD\n\n<!-- ack:section:workspace-identity -->\n## Workspace Identity\n\nExpected project root: TBD\nGit root: TBD\nBranch: TBD\nCommit: TBD\nWorktree / parallel workspace status: TBD\nUncommitted changes summary: TBD\n\n<!-- ack:section:sync-status -->\n## Sync Status\n\nUse statuses from `dev/DOC_SYNC_REGISTRY.md`: `confirmed`, `unverified`, `pending`, `blocked`, `not_applicable`.\n\n- Project index: TBD\n- Doc sync registry: TBD\n- Public docs / README: TBD\n- External knowledge tools: TBD\n\n<!-- ack:section:state-reconciliation-check -->\n## State Reconciliation Check\n\nAt full closeout, complete this check after updating the state sections above.\n\n- Reconciled at: TBD\n<!-- ack:field:state-sections-rewritten-or-confirmed -->\n- State sections rewritten or confirmed current: TBD\n<!-- ack:field:stale-snapshots-left -->\n- Stale snapshots left in this handoff: TBD\n<!-- ack:field:lifecycle-conflicts-resolved -->\n- Completed / pending / risk / opening-message lifecycle conflicts resolved or explicitly reclassified: TBD\n<!-- ack:field:persistence-routing-checked -->\n- Persistence routing checked: TBD\n<!-- ack:field:closeout-outcome -->\n- Closeout outcome: not_started — full closeout has not yet been assessed.\n<!-- ack:field:project-required-persistence -->\n- Project-required persistence: not_assessed — state whether this project's required Git or other persistence completed, is not required, or is blocked.\n<!-- ack:field:recommended-next-step-explicit -->\n- Recommended next step is explicit and reasoned: TBD\n<!-- ack:field:opening-message-matches-current-state -->\n- Opening message matches current state: TBD\n<!-- ack:field:next-ai-can-continue -->\n- Next AI can continue from `AGENTS.md`, this handoff, `dev/PROJECT_INDEX.md`, and needed rule packs without searching old log history: TBD\n\nIf any answer is no, blocked, or uncertain, fix this handoff before declaring handoff ready. `Closeout outcome: complete` is allowed only when required writes, read-backs and project-required persistence are complete. If project-required persistence is blocked, use `Closeout outcome: blocked` and state the blocker; it is not a completed closeout.\n\nLifecycle consistency rule: compare `Completed This Session`, `Validation / QC`, `Next Priorities`, `Risks / Blockers`, and `Next Session Opening Message` as full content, including renamed or paraphrased work. 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. Doctor catches only mechanical contradictions and unresolved fields; its green result is not semantic proof. Recommended next-step rule: `Next Priorities` must name the single recommended next action and a short reason before listing additional options, unless the next action is blocked or genuinely requires a user decision. Persistence routing rule: one-time delivery instructions, historical validation evidence, old hashes, old version facts, and incident notes must stay in trace evidence unless they still affect the next action.\n\nCloseout-card rule: `closeout-status` reads only these existing handoff fields plus fresh doctor / mirror results; it does not create another persistence authority. Its `complete` card is the only permitted source for the user-facing `handoff saved` wording. A nonzero / `blocked` result must be shown as blocked, never summarized as completed.\n\n<!-- ack:section:handoff-sufficiency-check -->\n## Handoff Sufficiency Check\n\nCan the next AI continue from `AGENTS.md`, this handoff, and only the project index / rule packs required by the next task, without searching old log history?\n\nAnswer: TBD\nIf no, update this handoff before closeout.\n\nContinuity rule: this file carries current state and next action. `dev/SESSION_LOG.md` carries recent evidence only. Archive old detail only when needed; do not create an archive directory by default.\n\n<!-- ack:section:next-session-opening-message -->\n## Next Session Opening Message\n\nThis fenced block is the authoritative agent-managed startup content. At closeout, regenerate `START_NEXT_SESSION_PROMPT.txt` from this block. If the two differ, trust this block and rewrite the convenience copy. User-facing closeout output should show `Start Agent Handoff` / `開工` as the primary next-session entry, plus the path-bearing fallback when the next AI is not yet pointed at this project root; do not hand-write a separate stateful prompt in the final response.\n\n📋 Next session: agent-managed startup content below\n\n```text\nWork in <ROOT>.\n\nIf the root does not match the handoff, stop and ask for confirmation. Do not read dev/SESSION_LOG.md during ordinary startup. Read dev/PROJECT_INDEX.md, dev/RULE_PACKS.md, dev/DOC_SYNC_REGISTRY.md, and task packs only when the current task requires them.\n\nResume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out execution wording. First-use exception: when this handoff says `First-use guidance state: eligible`, the current objective is empty / `TBD`, and there is no same-message concrete task, load onboarding and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. Upgrade never resets consumed / not_applicable first-use state back to eligible.\n```\n"
|
|
13206
|
+
},
|
|
13207
|
+
"9e9643115e4abef66f2c52510c0c63ce0f4a978ceb0ed5655b7c9c07a4f98c39": {
|
|
13208
|
+
"targetRel": "dev/RULE_PACKS.md",
|
|
13209
|
+
"canonicalSha256": "5715644cf26aa64fa42bf2173e02cadeff1731d6ea1647cfcde4bbf0915f4230",
|
|
13210
|
+
"text": "# Rule Packs Router\n\nRead only the packs needed for the current task.\n\n| Task signal | Pack | Purpose |\n|---|---|---|\n| Clear end-of-session or handoff intent: \"收工\" / \"wrap up\" / \"closeout\" / \"handoff\" / \"Wrap up Agent Handoff\", including closeout plus a handoff instruction | `dev/rules/closeout.md` | <!-- ack:route:closeout --> full closeout, lifecycle reconciliation, maintenance triggers, prompt regeneration, read-back, and honest stop conditions |\n| Explicit onboarding requests: \"I'm new\" / \"new user\" / \"teach me\" / \"help me start\" / \"how do I start\" / \"show me how\" / \"getting started\" / \"what can agent handoff kit do\"; or genuinely unresolved intent after current state has been read. Also recognize equivalent Chinese phrases such as \"新手\", \"教我用\", \"點開始\", and \"能力\". A fresh install with `First-use guidance state: eligible` enters onboarding when no executable objective remains; upgrade never resets consumed / not_applicable first-use state. `Start Agent Handoff` / \"開工\" is continuity. | `dev/rules/onboarding.md` | <!-- ack:route:onboarding --> infer when sufficient and begin a concrete task directly; ask one concise question or offer guided scenarios only when the user requests guidance or first-use state is eligible with no executable objective |\n| Destructive file operations, shell writes, Git state changes, package managers, installers, deploy, release, cloud tools, external APIs, credentials, locked files, permission errors | `dev/rules/safety.md` | safety checks for data loss, external systems, secrets, and high-risk operations |\n| Code, tests, build, package manager, SDK, CLI, API | `dev/rules/coding.md` | development workflow and verification |\n| Draft, edit, style, publication content | `dev/rules/writing.md` | writing workflow and tone control |\n| Sources, evidence, comparison, fact finding | `dev/rules/research.md` | source handling and uncertainty |\n| Governance, prompts, agents, handoff, startup/closeout, skills | `dev/rules/agent-governance.md` | governance changes and boundary control |\n| Governance bridge / bridge governance / connect this document to governance / scan for unbridged governance documents. Also recognize equivalent Chinese user phrases such as \"治理打通\", \"把文件接入 Agent Handoff Kit\", \"接入 Agent Handoff Kit\", and \"掃描未接入 Agent Handoff Kit 的重要文件\". | `dev/rules/agent-governance.md` | <!-- ack:route:governance-bridge --> 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 |\n| Long-term governance routing / future sessions should remember / always use this API or MCP pattern. Also recognize equivalent Chinese user phrases such as \"寫入長期治理\", \"轉成長期機制\", \"之後都要遵守\", and \"跨 session 有效\". | `dev/rules/agent-governance.md` | <!-- ack:route:long-term-governance --> 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 |\n| Release, publish, deploy, tag, hotfix, GA | `dev/rules/release.md` | release verification and evidence |\n| External notes, knowledge base, Notion, Obsidian, Google Drive | `dev/rules/knowledge.md` | external knowledge source integration |\n| A task that actually uses an external Connector / MCP / Plugin / Skill; a handoff that declares one as a current-task dependency; or an explicit integration health check | `dev/rules/integrations.md` | <!-- ack:route:integration-use --> capability verification immediately before use, credential separation, source-of-truth boundaries, fallback, and cross-session resilience; registry placeholders alone do not load or probe |\n| Runtime-controlled tool operation / browser UI validation / visual QA / screenshot / local HTML validation / file:// blocked / `file://` blocked / localhost fallback / Chrome / Playwright / DevTools / desktop app automation / crawler or scraper / notebook or data runtime / raw CLI, SDK, tool server, MCP, plugin, or local helper operation | `dev/rules/integrations.md` + `dev/rules/safety.md` (add `dev/rules/coding.md` only when changing code, tests, or project scripts) | <!-- ack:route:runtime-tool --> verify the active runtime capability, current schema, official docs, or registered tool operation reference before invocation; for local HTML / app validation, a blocked `file://` surface must route to a registered operation reference or short-lived localhost fallback before declaring blocked; preserve ownership and cleanup boundaries |\n| External tool resource pressure / stale MCP process / plugin service leak / browser automation left running / cache growth after external tools / slowdown after MCP, plugin, browser, crawler, notebook, or local helper services | `dev/rules/integrations.md` + `dev/rules/safety.md` | <!-- ack:route:resource-closeout --> ownership-based external-tool resource closeout; task-owned cleanup allowed; shared or ambiguous remediation requires exact evidence and confirmation |\n| Reply format, language, output schema | `dev/rules/communication.md` | user-facing response rules |\n\n## Routing Rule\n\nLoad the minimum set. If uncertain, load the narrower pack first. Pack selection is normally silent; state it only when it changes risk or user action. If a task clearly involves safety risk plus another domain, load `dev/rules/safety.md` with the relevant domain pack. Packs can add stricter rules, but cannot weaken core safety or continuity.\n"
|
|
13211
|
+
},
|
|
13212
|
+
"769598d86da84670a47fe895e3403b5f2f320e09e3cfe24d38dfdab8c79d0de4": {
|
|
13213
|
+
"targetRel": "dev/rules/agent-governance.md",
|
|
13214
|
+
"canonicalSha256": "dec490620ad85ba459204e17b29faa756e8374197ed1f5e7a9bcfcae7e2ca1ed",
|
|
13215
|
+
"text": "# Agent Governance Pack\n\n## Scope\n\nUse for governance rules, prompts, agent instructions, handoff systems, startup/closeout behavior, skills, and rule packs.\n\n## Load When\n\n- User asks to change AI behavior, project governance, prompts, handoff, startup, closeout, or tool-use rules.\n- A change affects `AGENTS.md`, `dev/*`, rule packs, installer templates, or durable workflow docs.\n- User asks to bridge governance, connect a document to governance, scan for unbridged governance documents, or uses equivalent Chinese phrases such as \"治理打通\", \"把文件接入 Agent Handoff Kit\", \"接入 Agent Handoff Kit\", or \"掃描未接入 Agent Handoff Kit 的重要文件\".\n- User asks to make something long-term, cross-session, reusable, future sessions should remember an API / MCP / tool-use pattern, or uses equivalent Chinese phrases such as \"寫入長期治理\", \"轉成長期機制\", or \"之後都要遵守\".\n- The task creates or materially changes Markdown documents, generated outputs, specifications, runbooks, checklists, guides, source-of-truth files, or research artifacts that future agents may need to discover.\n\n## Rules\n\n1. Locate the existing source of truth before adding a rule.\n2. Prefer merge, replace, or registry rows over append-only rule growth.\n3. Keep public runtime rules generic; project-specific incidents belong in logs, runbooks, or project index.\n4. Do not let development-only workspace rules enter public runtime.\n5. Check complexity budget before adding default-core behavior.\n6. Before creating durable workflow, runbook, or instruction files, first classify the knowledge type and verify whether an existing home can carry it without a new file: current state belongs in `dev/SESSION_HANDOFF.md`; trace evidence belongs in `dev/SESSION_LOG.md`; file / command / reference maps belong in `dev/PROJECT_INDEX.md`; sync obligations belong in `dev/DOC_SYNC_REGISTRY.md`; reusable operating procedures belong in the relevant rule pack or registered reference. New runbooks are last resort only.\n7. 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.\n8. 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.\n9. 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.\n10. Content-based trigger: long-term governance routing is content-based, not trigger-only. Even if the user does not use explicit governance-routing phrases, 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.\n11. Mid-task changes to product goals, requirements, development checklists, acceptance rules, exclusions, priorities, or scope are task contract changes. Before writing them, check whether the same contract already lives in a spec, backlog, issue list, README, runbook, project index entry, or handoff section. Merge into the existing authoritative home, then leave only a pointer or current-state summary elsewhere.\n12. New Markdown or generated documents are not automatically harmless. After creating or materially changing them, classify each artifact before completion: source of truth, reference, runbook, workflow, checklist, public document, generated output, one-time evidence, draft, or temporary. Durable artifacts must be discoverable from `dev/PROJECT_INDEX.md` or intentionally tied to a registered sync / source-of-truth row. Temporary or one-time evidence must be labeled as such in the task record or closeout so future agents do not treat it as hidden current state.\n13. Do not create a new document to hold a rule, requirement, checklist, or process if an existing authoritative document can carry it. Merge into the existing home or make the new document explicitly subordinate. If two files now carry the same durable instruction, resolve the duplicate by choosing one authoritative home and pointing the other to it.\n\n## Governance Bridge Workflow\n\nUse this workflow when the user asks for governance bridge, connect this document to governance, asks to scan for unbridged governance documents, or uses equivalent Chinese phrases such as \"治理打通\", \"把文件接入 Agent Handoff Kit\", \"接入 Agent Handoff Kit\", or \"掃描未接入 Agent Handoff Kit 的重要文件\".\n\n1. Identify the target. If the user named a file, inspect that file and its surrounding directory. If no file is named, run a bounded repo scan for likely durable documents such as source-of-truth files, runbooks, workflows, guides, checklists, stock lists, production guides, and rules.\n2. Check the target file itself: it should state its role, scope, update trigger, owner or responsible workflow when known, and what must not be inferred from it.\n3. Check `dev/PROJECT_INDEX.md`: the file should be discoverable with its role and \"read when\" condition. Source-of-truth or reference files should appear in Fact Base, External Sources, Directory Map, Entry Points, or another existing indexed home that fits the project.\n4. Check `dev/DOC_SYNC_REGISTRY.md`: future same-type changes should have a matching change type or an explicit reason no durable sync rule is needed.\n5. Check related workflows, guides, runbooks, or rule packs: if a process creates or updates the file, that process should say when to update the file or its index row.\n6. Check `dev/SESSION_HANDOFF.md`: only current state, recommended next action with reason, unresolved risk, blocker, or a startup-needed fact should be in handoff. Do not copy whole documents or old evidence into handoff.\n7. Check `dev/SESSION_LOG.md`: this session's bridge review, validation, and evidence can be logged when it affects future action, but log entries must not become current state.\n8. Search for duplicate source-of-truth risk. If another file has the same durable role, recommend merge, reference, or retire options; do not delete, rename, or move files without explicit approval.\n\nFor 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.\n\nOutput format:\n\n- Status: bridged / partially bridged / unbridged / blocked.\n- Use bridged only when every applicable governance link is present. If only `dev/PROJECT_INDEX.md` or `dev/SESSION_LOG.md` was updated, report partially bridged.\n- Already bridged: list the governance links that are present.\n- Gaps: list missing links and why they matter for the next agent.\n- Not applicable: list skipped layers with a reason.\n- Suggested patches: list exact files and sections to update.\n- Manual decisions: list duplicates, naming choices, deletion, renaming, external sync, or ownership questions requiring user confirmation.\n- Acceptance: give one concrete check that proves the bridge is complete.\n\n## Generated Artifact Governance Workflow\n\nUse this workflow whenever the current task creates or materially changes Markdown documents or other durable artifacts, even if the user did not explicitly ask for governance bridge.\n\n1. List the artifacts created or materially changed in this task.\n2. Classify each artifact: source of truth, reference, runbook, workflow, checklist, public document, generated output, one-time evidence, draft, or temporary.\n3. For source-of-truth, reference, runbook, workflow, checklist, public document, and reusable generated output, update `dev/PROJECT_INDEX.md` so the file is discoverable with a role and read condition.\n4. For artifacts that require future mirror, external index, publication, or repeated sync, update `dev/DOC_SYNC_REGISTRY.md` or record why no durable sync rule applies.\n5. For one-time evidence, draft, or temporary files, record that classification in `dev/SESSION_LOG.md` or the task summary, and do not promote it to current handoff unless it affects the next action.\n6. Search for duplicate source-of-truth risk before keeping a new document. If another file already owns the same rule, requirement, checklist, or process, merge into that file or make the new document explicitly subordinate.\n7. Before claiming completion, explicitly confirm the artifacts created or materially changed in this task have been classified, indexed, synchronized, consolidated, or marked temporary through the steps above. You may also run the available project governance check and `agent-handoff-kit doctor` for scoped Kit / typed registered-surface checks, but doctor does not discover unregistered ordinary workspace files and cannot replace explicit changed-artifact review.\n\n## Long-term Governance Routing\n\nUse 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.\n\n1. Classify the knowledge before writing:\n - Current task contract changes, including product goals, requirements, development checklists, acceptance rules, exclusions, priorities, or scope -> the existing authoritative spec / backlog / issue / runbook when one exists; otherwise `dev/SESSION_HANDOFF.md` current-state sections.\n - Current task state, recommended next action with reason, unresolved risk, or startup-needed fact -> `dev/SESSION_HANDOFF.md`.\n - Chronological evidence or validation trace -> `dev/SESSION_LOG.md`.\n - File maps, command maps, API reference locations, tool capability maps, and external source coordinates -> `dev/PROJECT_INDEX.md`.\n - Sync obligations or external mirror duties -> `dev/DOC_SYNC_REGISTRY.md`.\n - Durable decisions, architecture trade-offs, research-derived rationale, and long-term lessons -> `dev/PROJECT_DECISIONS.md`.\n - Reusable procedures, recurring mistake prevention, API / MCP / tool-use rules -> the relevant rule pack, registered reference, or QA check.\n - API / MCP / tool-use patterns -> project index / registered reference / integrations pack, depending on scope.\n2. 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.\n3. 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.\n4. Add or update a QA check when the same failure class could recur and can be tested.\n5. Keep governance bridge wording reserved for document orphan prevention. Do not relabel non-file governance as \"file connected to Agent Handoff Kit\".\n\n## Checks\n\n- Verify affected files are indexed or intentionally installed templates.\n- Check `dev/DOC_SYNC_REGISTRY.md` for governance, closeout/startup, and README sync rows.\n- Confirm old overlapping wording was retired or marked legacy.\n- Confirm any new durable file is reachable from `dev/PROJECT_INDEX.md` and does not rely only on a one-session handoff note.\n- Confirm every Markdown document or generated artifact created in this task is indexed, synced, consolidated, or explicitly classified as draft / temporary / one-time evidence.\n- Confirm no new file has become a parallel source for an existing rule, requirement, checklist, or process.\n- 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.\n- 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.\n- 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.\n- For governance bridge work, run bounded searches for the target path/name and the relevant artifact class or sync-change type across the project index, sync registry, related workflows, and current rule owners. If the target is tied to generated outputs, also inspect the workflow or production guide that creates those outputs. Search evidence is a check, not a second source of truth.\n- 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.\n- 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.\n\n## Closeout\n\nRecord the changed rule home, reason, complexity impact, retired wording, and follow-up checks.\n"
|
|
13216
|
+
},
|
|
13217
|
+
"3989b14439cd64894d9cad444e73e35d0a5c1c67e85991819111483d1df67124": {
|
|
13218
|
+
"targetRel": "dev/rules/onboarding.md",
|
|
13219
|
+
"canonicalSha256": "ffd0f2337cf1f5998d94ede375af920a0f14e9662ee6b50ca8b568511ac9d5d8",
|
|
13220
|
+
"text": "# Onboarding Pack\n\n## Scope\n\nUse this transient pack for first-time Agent Handoff Kit users after a fresh install, users who request guidance, or when the user's first-task intent remains genuinely unresolved after reading the available project state.\n\nThe goal is to help the user complete a small first task without requiring them to read README, guide pages, `AGENTS.md`, or internal Kit rules first. After the onboarding walk-through finishes, unload this pack and continue with the regular scenario pack such as coding, research, writing, knowledge, or integrations.\n\n## Load When\n\n### Explicit onboarding signal keywords\n\nLoad this pack when the user message contains an onboarding signal such as:\n\n- \"I'm new\" / \"new user\"\n- \"teach me\" / \"help me start\" / \"help me get started\"\n- \"first time\" / \"first-time\" when the user also asks for guidance\n- \"how do I start\" / \"show me how\" / \"getting started\"\n- \"what can agent handoff kit do\"\n- vague project intent such as \"I want to do a project\"\n- equivalent Chinese user phrases such as \"新手\", \"教我用\", \"點開始\", \"能力\", or \"能做甚麼\"\n\n`I just installed` / \"我剛安裝\" is a first-use signal. When `SESSION_HANDOFF` says `First-use guidance state: eligible` and no executable objective remains, load this pack and give the first-use welcome. It does not override a same-message concrete task with enough material facts.\n\n### Continuity startup boundary\n\n`Start Agent Handoff` / \"開工\" starts continuity and reads the minimum current handoff state; it is not an onboarding signal by itself. A plain startup normally stops after its status card and recommended next action; a loaded objective alone does not authorize work. First-use eligible plain startup is the exception: when the handoff says `First-use guidance state: eligible`, the active objective is empty / `TBD`, and the user did not provide a same-message concrete task, enter onboarding instead of ending status-only. A same-message concrete task may begin normally. Only when no executable objective remains after state reading should the AI ask one concise question or offer the guided onboarding path. Explicit requests such as \"新手,教我用\" enter onboarding directly.\n\n### Implicit signals\n\n- The first user message is short and still genuinely vague after available project state is read.\n- `SESSION_HANDOFF` first-use guidance state is `eligible`, Active Objective is empty / `TBD`, and the user has not supplied a concrete objective with enough material facts. This is the fresh-install welcome path and should not be skipped as an ordinary status-only startup.\n- The user asks a generic capability question instead of giving a concrete task.\n- The user appears unfamiliar with the workflow, for example asking what the AI should do rather than giving an objective.\n\n## Discipline\n\n### 1. Do not assume prior reading\n\nThe user may start directly from an AI conversation. Explain only the minimum needed for the current step. Do not teach internal file structure, pack names, release identifiers, maintenance rules, or implementation details unless the user asks.\n\n### 2. Infer first; offer scenario choice only when needed\n\nInfer when sufficient; ask only when unresolved. Read the user's message together with the available handoff and project state before deciding whether a chooser is needed.\n\nWhen the user has already supplied a concrete, actionable objective and enough material facts, infer the closest working scenario, state the assumption briefly, load the regular task pack(s), and begin the first safe action. Do not require an A-F reply, repeat questions whose answers are already available, or reduce a concrete request to a generic minimum task.\n\nOnly show the scenario chooser when the user's intent remains genuinely unresolved or the user asks for guided onboarding. In that case, combine the startup card and chooser into one complete response. Do not print a partial startup card first or repeat the card.\n\nThis routing decision never removes a safety gate. High-risk, external, permission, cost, publishing, and irreversible actions still require the normal plan and explicit confirmation before execution.\n\nThe library contains six scenarios. Treat them as an internal inference library. When choices are genuinely required, show only the two or three most relevant options; use a short open question when no responsible shortlist can be inferred. Do not display all six merely because the library contains them.\n\n- **A. Build systems, tools, platforms, websites, or apps**: the user wants AI help to create or maintain a working project.\n- **B. Organize research or write a report**: the user has sources, notes, articles, presentations, or a report goal.\n- **C. Organize local files, Notion, Google Drive, or a knowledge base**: the user wants source, reference, mirror, and draft material kept clear.\n- **D. Learn to code**: the user is a technical beginner and wants a small guided exercise.\n- **E. Custom scenario**: the user has another goal.\n- **F. Review installed external tools and design governance**: the user already has Connectors, MCPs, Plugins, Skills, or browser / notebook / crawler tools and wants a safe operating model.\n\n### 3. Guided 5-step walk-through pattern\n\nUse this five-step path only after the user selects guided onboarding or when clarification is genuinely needed:\n\n1. Confirm project context: folder, existing material, current tools, source locations, and whether external tools are already connected.\n2. Explain in three plain points how Agent Handoff Kit helps this scenario.\n3. Ask for the first concrete task scope, offering at most two or three genuinely relevant options.\n4. Suggest one minimum viable task that can usually be completed in 10-15 minutes.\n5. Wait for user confirmation, then transition to the regular work loop.\n\n### 4. Ask only for missing information\n\nSkip any guided step already answered by the user or available project state. When a step is still needed, advance one step at a time and:\n\n- state what the AI will do,\n- state what the user needs to answer or confirm,\n- answer questions before continuing,\n- let the user skip or change the step.\n\n### 5. Keep the first task small\n\nThe first task should be a preview, a short draft, a small classification sample, a dry-run, or another bounded result. Do not begin with broad refactors, bulk file moves, publishing, deployment, or destructive operations.\n\n### 6. Transition after onboarding\n\nAfter the walk-through:\n\n- load the regular pack(s) for the chosen task,\n- unload this transient onboarding pack,\n- enter the PLAN -> READ -> CHANGE -> QC -> PERSIST work loop,\n- record the first-task scope in `SESSION_HANDOFF` when the persistence gate requires it.\n\n## Application Scenario Library\n\nEach scenario is a fallback guidance template, not a mandatory questionnaire. The model may skip answered steps, infer the route when evidence is sufficient, and adapt wording while preserving intent, tone, and safety boundaries.\n\n### Scenario A. Build systems, tools, platforms, websites, or apps\n\nStep A.1: ask for the project folder, current stack if known, whether git exists, and whether GitHub, Linear, Slack, Notion, Google Drive, or other external tools are connected.\n\nStep A.2: explain that Kit helps the AI remember project state across sessions, avoid silent risky commands, and record what changed at closeout.\n\nStep A.3: offer task choices such as fix a bug, add a feature, organize code, add tests, write README, or prepare a first commit.\n\nStep A.4: suggest a small first task, such as a short README section, one failing test investigation, or a dry-run plan.\n\nStep A.5: after confirmation, load the relevant coding / writing / safety packs and begin the normal work loop.\n\n### Scenario B. Organize research or write a report\n\nStep B.1: ask for the topic, existing source locations, intended reader, and whether Notion, Google Drive, or another source tool is connected.\n\nStep B.2: explain that Kit separates source evidence from inference, records source locations, and preserves progress across sessions.\n\nStep B.3: offer task choices such as outline sections, register sources, summarize one source, draft a subsection, or review an existing draft.\n\nStep B.4: suggest a small first task, such as a 5-7 heading outline with one sentence per section.\n\nStep B.5: after confirmation, load research / writing / knowledge packs and begin the normal work loop.\n\n### Scenario C. Organize local files, Notion, Google Drive, or a knowledge base\n\nStep C.1: ask what needs organizing: local folder, Notion database, Google Drive folder, or mixed sources. Ask which external tools are connected or unknown.\n\nStep C.2: explain that Kit separates source of truth, references, mirrors, and drafts, and that risky file operations require dry-run and confirmation.\n\nStep C.3: offer task choices such as scan and classify files, design a folder structure, draft a Notion schema, write a dry-run script, or align local references with an external index.\n\nStep C.4: suggest a small first task, such as classifying a bounded sample without moving files.\n\nStep C.5: after confirmation, load knowledge / safety / integrations packs as needed.\n\n### Scenario D. Learn to code\n\nStep D.1: ask which direction the user wants: small automation, web page, Python tool, Git / GitHub basics, or another beginner task. Ask whether any relevant tools are already installed.\n\nStep D.2: explain that Kit keeps learning progress across sessions, keeps risky operations explicit, and lets the user review each small change.\n\nStep D.3: offer one small exercise, such as a dry-run file renamer, a one-page HTML example, or a tiny Python script.\n\nStep D.4: keep the exercise small enough to explain line by line.\n\nStep D.5: after confirmation, load coding / safety packs and begin the normal work loop.\n\n### Scenario E. Custom scenario\n\nStep E.1: use any facts already provided, then ask only for missing information that materially affects the first safe action. Do not ask about technical comfort unless it changes the delivery approach.\n\nStep E.2: explain how Kit helps the chosen scenario using continuity, safety, and source / artifact governance.\n\nStep E.3: offer task choices tailored to the user's answer.\n\nStep E.4: suggest one minimum viable first task.\n\nStep E.5: after confirmation, load the appropriate regular pack combination.\n\n### Scenario F. External-tool governance\n\nUse this scenario when the user already has external tools installed or asks how to use them safely across sessions. This scenario does not teach installation. It records declarations, boundaries, verification, and safe use.\n\nStep F.1: collect installed external tools by category: Connectors, MCPs, Plugins, Skills, browser automation, crawlers, notebooks, or local helper services. If the user does not know the category, ask for names only and classify them.\n\nStep F.2: explain credential separation: Kit files record tool names, project usage, access scope, and credential reference location only. They must never store API keys, OAuth tokens, secrets, or credential values.\n\nStep F.3: map source-of-truth architecture: source of truth, index, persistent mirror, and working draft. Make each layer's write boundary explicit.\n\nStep F.4: when authorized, write the declaration into `PROJECT_INDEX` `## Installed Integrations` and cross-reference relevant External Sources `via` values.\n\nStep F.5: verify current availability using runtime-exposed tool schemas, official docs, or versioned local runbooks. Mark unavailable tools as blocked / unverified instead of guessing.\n\n## Cross-reference to guide.html\n\nWhen the user asks for a fuller example, mention `agent-handoff-kit-guide.html` as an optional reference. The guide is not required reading.\n\n- Case A aligns with Scenario A plus parts of Scenario C.\n- Case B aligns with Scenario B plus Scenario F.\n- Case C aligns with long-running project evolution.\n\n## Tone Discipline\n\nUse plain user-facing language. Avoid internal jargon in onboarding replies unless the user asks for implementation details.\n\n- Say \"project registry\" before exposing `PROJECT_INDEX`.\n- Say \"wrap up\" or the user's own closeout phrase before exposing closeout internals.\n- Say \"next-session startup message\" only when discussing the persisted handoff file.\n- Say \"working mode\" before exposing \"rule pack\".\n- Say \"risky command\" before exposing \"destructive operation\".\n\nKeep user-facing explanations self-contained. For the public product's Chinese surfaces, use steady written Traditional Chinese and avoid Cantonese spoken characters. Inside this AI-facing pack, keep instructions in English and use Chinese only as quoted user phrases that the runtime must recognize.\n\n## Closeout\n\nAfter onboarding finishes:\n\n1. Confirm that the user knows the next practical action, how to start a later session, and how to request closeout.\n2. Update `SESSION_HANDOFF` only when the persistence gate says the first-task scope or next action is durable.\n3. Record next priorities only when they affect a later session.\n4. Do not paste a separate stateful opening message in chat. The persisted `SESSION_HANDOFF` opening-message block remains authoritative.\n5. Unload this pack and continue with the relevant regular pack(s).\n6. Mark `ack:field:first-use-guidance-state` as `consumed` after the first guided task begins or the first full closeout completes. Never reset `consumed` or `not_applicable` to `eligible` during upgrade.\n\nIn a later session, reload onboarding only when the user gives a fresh onboarding signal or asks to restart the walk-through. Otherwise enter the normal work loop.\n\n## Anti-patterns\n\n| Anti-pattern | Why it is wrong | Correct approach |\n|---|---|---|\n| Treating a genuinely vague first message as a specific task | The user may be trying to learn the workflow or choose a scenario. | Ask one concise question or show the two or three most relevant scenarios only when intent remains unresolved. |\n| Making the first task broad | A first-time user needs rhythm and confidence before large changes. | Suggest one 10-15 minute minimum viable task. |\n| Explaining Kit internals before the user needs them | Internal labels increase cognitive load. | Explain the visible effect in plain language. |\n| Assuming the user read README or guide pages | Many users start directly in an AI chat. | Surface only the concepts needed for the next step. |\n| Keeping onboarding loaded after the first task starts | Onboarding is transient and will distract from normal task work. | Unload onboarding and load the regular pack(s). |\n| Forcing the chooser or all five guided steps after the objective is already concrete | The user must repeat known information and the AI shifts technical work back to the user. | Infer the scenario, state the assumption, and begin the first safe action; ask only for missing facts or required risk approval. |\n| Assuming no Connector, MCP, Plugin, or Skill exists | Paste-only fallback creates the wrong operating model for users who already connected tools. | Ask a lightweight external-tool question in step 1, or use Scenario F. |\n"
|
|
12836
13221
|
}
|
|
12837
13222
|
},
|
|
12838
|
-
"catalogDigestSha256": "
|
|
13223
|
+
"catalogDigestSha256": "d8a21cb48911eda6fe9e0d647d5d964adc848904415d307f37e95f29854f7101"
|
|
12839
13224
|
}
|
package/package.json
CHANGED
|
@@ -95,6 +95,7 @@ Use this workflow when the user asks to write something into long-term governanc
|
|
|
95
95
|
- 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.
|
|
96
96
|
- 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.
|
|
97
97
|
- 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.
|
|
98
|
+
- For governance bridge work, run bounded searches for the target path/name and the relevant artifact class or sync-change type across the project index, sync registry, related workflows, and current rule owners. If the target is tied to generated outputs, also inspect the workflow or production guide that creates those outputs. Search evidence is a check, not a second source of truth.
|
|
98
99
|
- 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.
|
|
99
100
|
- 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.
|
|
100
101
|
|
package/packs/onboarding.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Scope
|
|
4
4
|
|
|
5
|
-
Use this transient pack for first-time Agent Handoff Kit users who request guidance, or when the user's first-task intent remains genuinely unresolved after reading the available project state.
|
|
5
|
+
Use this transient pack for first-time Agent Handoff Kit users after a fresh install, users who request guidance, or when the user's first-task intent remains genuinely unresolved after reading the available project state.
|
|
6
6
|
|
|
7
7
|
The goal is to help the user complete a small first task without requiring them to read README, guide pages, `AGENTS.md`, or internal Kit rules first. After the onboarding walk-through finishes, unload this pack and continue with the regular scenario pack such as coding, research, writing, knowledge, or integrations.
|
|
8
8
|
|
|
@@ -20,16 +20,16 @@ Load this pack when the user message contains an onboarding signal such as:
|
|
|
20
20
|
- vague project intent such as "I want to do a project"
|
|
21
21
|
- equivalent Chinese user phrases such as "新手", "教我用", "點開始", "能力", or "能做甚麼"
|
|
22
22
|
|
|
23
|
-
`I just installed` / "我剛安裝"
|
|
23
|
+
`I just installed` / "我剛安裝" is a first-use signal. When `SESSION_HANDOFF` says `First-use guidance state: eligible` and no executable objective remains, load this pack and give the first-use welcome. It does not override a same-message concrete task with enough material facts.
|
|
24
24
|
|
|
25
25
|
### Continuity startup boundary
|
|
26
26
|
|
|
27
|
-
`Start Agent Handoff` / "開工" starts continuity and reads the minimum current handoff state; it is not an onboarding signal. A plain startup stops after its status card and recommended next action; a loaded objective alone does not authorize work. A same-message concrete task may begin normally. Only when no executable objective remains after state reading should the AI ask one concise question or offer the guided onboarding path. Explicit requests such as "新手,教我用" enter onboarding directly.
|
|
27
|
+
`Start Agent Handoff` / "開工" starts continuity and reads the minimum current handoff state; it is not an onboarding signal by itself. A plain startup normally stops after its status card and recommended next action; a loaded objective alone does not authorize work. First-use eligible plain startup is the exception: when the handoff says `First-use guidance state: eligible`, the active objective is empty / `TBD`, and the user did not provide a same-message concrete task, enter onboarding instead of ending status-only. A same-message concrete task may begin normally. Only when no executable objective remains after state reading should the AI ask one concise question or offer the guided onboarding path. Explicit requests such as "新手,教我用" enter onboarding directly.
|
|
28
28
|
|
|
29
29
|
### Implicit signals
|
|
30
30
|
|
|
31
31
|
- The first user message is short and still genuinely vague after available project state is read.
|
|
32
|
-
- `SESSION_HANDOFF` first-use guidance state is `eligible`, Active Objective is empty
|
|
32
|
+
- `SESSION_HANDOFF` first-use guidance state is `eligible`, Active Objective is empty / `TBD`, and the user has not supplied a concrete objective with enough material facts. This is the fresh-install welcome path and should not be skipped as an ordinary status-only startup.
|
|
33
33
|
- The user asks a generic capability question instead of giving a concrete task.
|
|
34
34
|
- The user appears unfamiliar with the workflow, for example asking what the AI should do rather than giving an objective.
|
|
35
35
|
|
|
@@ -11,9 +11,9 @@ Do not read `dev/SESSION_LOG.md` during ordinary startup; it is trace-back evide
|
|
|
11
11
|
Route intent in this order:
|
|
12
12
|
|
|
13
13
|
1. Clear closeout intent routes directly to `dev/rules/closeout.md`.
|
|
14
|
-
2. Clear continuity intent such as "開工", "Start Agent Handoff", "開始接力", or "continue handoff" resumes the minimum current state from the handoff. A plain continuity message with no same-message task or explicit long-run instruction authorizes only that recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out wording such as "unless you object I will start". A concrete objective found only in loaded state is not authority to complete it. A same-message task may begin normally. An explicit instruction such as "開工,繼續做到下一個 blocker" or "開工,繼續完成目前目標" may continue under the normal task and safety rules.
|
|
14
|
+
2. Clear continuity intent such as "開工", "Start Agent Handoff", "開始接力", or "continue handoff" resumes the minimum current state from the handoff. A plain continuity message with no same-message task or explicit long-run instruction authorizes only that recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out wording such as "unless you object I will start". First-use exception: when `dev/SESSION_HANDOFF.md` says `First-use guidance state: eligible`, the active objective is empty / `TBD`, and there is no same-message concrete task, load `dev/rules/onboarding.md` and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in loaded state is not authority to complete it. A same-message task may begin normally. An explicit instruction such as "開工,繼續做到下一個 blocker" or "開工,繼續完成目前目標" may continue under the normal task and safety rules.
|
|
15
15
|
3. A direct ordinary task begins without a startup card or onboarding ceremony. Read only the sources and packs required by that task.
|
|
16
|
-
4. Explicit guidance requests such as "I'm new", "teach me", "help me start", "新手", "教我用", or "點開始" may load `dev/rules/onboarding.md`. A fresh install or short message only makes guidance available; it never overrides a concrete objective. If no executable objective remains after state reading, ask one concise question or offer guided onboarding.
|
|
16
|
+
4. Explicit guidance requests such as "I'm new", "teach me", "help me start", "新手", "教我用", or "點開始" may load `dev/rules/onboarding.md`. A fresh install marks first-use guidance as `eligible`, so the first unresolved startup must enter onboarding; upgrade must not reset `consumed` or `not_applicable` back to `eligible`. A short message in a non-eligible root only makes guidance available; it never overrides a concrete objective. If no executable objective remains after state reading, ask one concise question or offer guided onboarding.
|
|
17
17
|
|
|
18
18
|
Treat a phrase as ambiguous only when its ordinary meaning may genuinely refer to a real-world shift, event, or unrelated context. `開工,繼續 <task>`, `<project> 開工`, and `Start Agent Handoff and continue <task>` are continuity commands, not ambiguous phrases.
|
|
19
19
|
|
|
@@ -27,7 +27,7 @@ Before a non-trivial task, identify and read the required local and external tru
|
|
|
27
27
|
|
|
28
28
|
Probe an integration only immediately before a task uses it, when the handoff explicitly identifies it as a dependency for the current objective, or when the user requests an integration health check. `TBD`, examples, blank rows, and undeclared placeholders are not installed integrations. Record `Last Verified` only after a real probe and through the normal persistence gate. Never write integration status merely because a session started.
|
|
29
29
|
|
|
30
|
-
Show the startup card only for explicit continuity startup. For a plain continuity message, show the card after the minimum state recovery and end the turn; its recommended next action is advice, not permission to act. An explicit same-message task or long-run continuation may combine the card with its first useful action. Direct ordinary tasks do not show the card. If onboarding is explicitly requested, combine any card and guidance in one response.
|
|
30
|
+
Show the startup card only for explicit continuity startup. For a plain continuity message, show the card after the minimum state recovery and end the turn; its recommended next action is advice, not permission to act. The first-use exception above replaces that status-only stop with onboarding only when the handoff state is `eligible`, the objective is empty / `TBD`, and there is no same-message concrete task. An explicit same-message task or long-run continuation may combine the card with its first useful action. Direct ordinary tasks do not show the card. If onboarding is explicitly requested or first-use onboarding is triggered, combine any card and guidance in one response.
|
|
31
31
|
|
|
32
32
|
For explicit bare continuity startup, after the handoff is read, the startup card may read only the bounded version evidence from `dev/PROJECT_INDEX.md`: the unique stable-semver `| Agent Handoff Kit template version | X.Y.Z | ... |` row inside the unique real `## Stack` section. Do not route on, summarize, or load any other Project Index content for startup, title, permissions, packs, health, or task work. Missing, unreadable, malformed, duplicate, prerelease, or out-of-Stack-only version evidence prints `version unverified`; the turn remains status-only with zero writes. A direct ordinary or stateless task does not read the handoff or Project Index merely to fill a card or version.
|
|
33
33
|
|
|
@@ -6,7 +6,7 @@ Purpose: give a stateless AI a compact map of the project before it reads or edi
|
|
|
6
6
|
|
|
7
7
|
| Field | Value | Last verified |
|
|
8
8
|
|---|---|---|
|
|
9
|
-
| Agent Handoff Kit template version | 0.3.
|
|
9
|
+
| Agent Handoff Kit template version | 0.3.59 | current template version |
|
|
10
10
|
| Runtime | TBD | TBD |
|
|
11
11
|
| Framework | TBD | TBD |
|
|
12
12
|
| Package manager | TBD | TBD |
|
|
@@ -5,7 +5,7 @@ Read only the packs needed for the current task.
|
|
|
5
5
|
| Task signal | Pack | Purpose |
|
|
6
6
|
|---|---|---|
|
|
7
7
|
| Clear end-of-session or handoff intent: "收工" / "wrap up" / "closeout" / "handoff" / "Wrap up Agent Handoff", including closeout plus a handoff instruction | `dev/rules/closeout.md` | <!-- ack:route:closeout --> full closeout, lifecycle reconciliation, maintenance triggers, prompt regeneration, read-back, and honest stop conditions |
|
|
8
|
-
| Explicit onboarding requests: "I'm new" / "new user" / "teach me" / "help me start" / "how do I start" / "show me how" / "getting started" / "what can agent handoff kit do"; or genuinely unresolved intent after current state has been read. Also recognize equivalent Chinese phrases such as "新手", "教我用", "點開始", and "能力". A fresh install
|
|
8
|
+
| Explicit onboarding requests: "I'm new" / "new user" / "teach me" / "help me start" / "how do I start" / "show me how" / "getting started" / "what can agent handoff kit do"; or genuinely unresolved intent after current state has been read. Also recognize equivalent Chinese phrases such as "新手", "教我用", "點開始", and "能力". A fresh install with `First-use guidance state: eligible` enters onboarding when no executable objective remains; upgrade never resets consumed / not_applicable first-use state. `Start Agent Handoff` / "開工" is continuity. | `dev/rules/onboarding.md` | <!-- ack:route:onboarding --> infer when sufficient and begin a concrete task directly; ask one concise question or offer guided scenarios only when the user requests guidance or first-use state is eligible with no executable objective |
|
|
9
9
|
| Destructive file operations, shell writes, Git state changes, package managers, installers, deploy, release, cloud tools, external APIs, credentials, locked files, permission errors | `dev/rules/safety.md` | safety checks for data loss, external systems, secrets, and high-risk operations |
|
|
10
10
|
| Code, tests, build, package manager, SDK, CLI, API | `dev/rules/coding.md` | development workflow and verification |
|
|
11
11
|
| Draft, edit, style, publication content | `dev/rules/writing.md` | writing workflow and tone control |
|
|
@@ -156,5 +156,5 @@ Work in <absolute project root>. Read AGENTS.md, then dev/SESSION_HANDOFF.md. Tr
|
|
|
156
156
|
|
|
157
157
|
If the root does not match the handoff, stop and ask for confirmation. Do not read dev/SESSION_LOG.md during ordinary startup. Read dev/PROJECT_INDEX.md, dev/RULE_PACKS.md, dev/DOC_SYNC_REGISTRY.md, and task packs only when the current task requires them.
|
|
158
158
|
|
|
159
|
-
Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out execution wording. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules.
|
|
159
|
+
Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out execution wording. First-use exception: when this handoff says `First-use guidance state: eligible`, the current objective is empty / `TBD`, and there is no same-message concrete task, load onboarding and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. Upgrade never resets consumed / not_applicable first-use state back to eligible.
|
|
160
160
|
```
|
|
@@ -2,4 +2,4 @@ Work in <absolute project root>. Read AGENTS.md, then dev/SESSION_HANDOFF.md. Tr
|
|
|
2
2
|
|
|
3
3
|
If the root does not match the handoff, stop and ask for confirmation. Do not read dev/SESSION_LOG.md during ordinary startup. Read dev/PROJECT_INDEX.md, dev/RULE_PACKS.md, dev/DOC_SYNC_REGISTRY.md, and task packs only when the current task requires them.
|
|
4
4
|
|
|
5
|
-
Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out execution wording. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules.
|
|
5
|
+
Resume the current objective. A plain `Start Agent Handoff` / `開工` with no same-message task or explicit long-run instruction only authorizes minimum state recovery, one optional display-only current-thread title update when safely supported, the startup card, the current objective/risk/recommended next action, and then the end of the turn. It does not authorize task-specific reads, research, plans, protocols, preflight, file searches, sub-agents, QA, packaging, project-file writes, network access, other external actions, or opt-out execution wording. First-use exception: when this handoff says `First-use guidance state: eligible`, the current objective is empty / `TBD`, and there is no same-message concrete task, load onboarding and include a short first-use welcome plus the most relevant guided choices in the same response instead of ending status-only. A concrete objective found only in this handoff is not authority to complete the objective. A same-message task may begin normally; an explicit instruction such as `開工,繼續做到下一個 blocker` or `開工,繼續完成目前目標` may continue under the normal task and safety rules. Upgrade never resets consumed / not_applicable first-use state back to eligible.
|