AI-readable install page · v0.3.66

繁體中文版本

Instructions for an AI
to install or upgrade safely.

This page is for an agentic AI that can read and write the local folder and run terminal commands. The user should not have to choose an npm command or diagnose a conflict. Read this page before acting in the folder.

Version note: this page is aligned with v0.3.66. @latest means the version currently available from the npm registry.

The user only needs to paste this

Please read https://adamchanadam.github.io/agent-handoff-kit/agent-handoff-kit-ai-install.en.html, and install or upgrade Agent Handoff Kit in this folder.

The AI must give this report when it finishes

Before running any npx command, remember this section. After installation or upgrade, the AI must not say only “completed” or paste only terminal output. It must explain the result and next step to the user in the following format.

Completion-report template: ✅ Installation completed. 📁 Current folder: <absolute path>. 🩺 doctor passed. ⚠️ The next step is not a terminal command; in an AI conversation that can read and write this folder, enter Start Agent Handoff or “開工”. Only if the AI has not yet been pointed at this folder, use: Work in <absolute path>. Read AGENTS.md first, then Start Agent Handoff. Before changing anything, tell me the current state and your recommended next step.

The AI must confirm the current folder first

  1. Show the absolute path of the current working folder.
  2. Ask: “Is this the folder where you want Agent Handoff Kit installed or upgraded?”
  3. If the user cannot confirm, stop with zero writes. Do not run init, upgrade, or doctor.
  4. Only after confirmation, inspect whether the folder already has AGENTS.md, CLAUDE.md, GEMINI.md, START_NEXT_SESSION_PROMPT.txt, or dev/.
Safety boundary: do not delete files, overwrite conflicts, handle credentials, run git commit, run git push, run git tag, run npm publish, or create a GitHub Release.

Decide how to install

Case 1: nothing is installed

If none of AGENTS.md, CLAUDE.md, GEMINI.md, START_NEXT_SESSION_PROMPT.txt, or dev/ exists, use a fresh install.

npx --yes @adamchanadam/agent-handoff-kit@latest init --yes --root .

Case 2: Kit or AI memory files already exist

If any Kit file or existing AI memory file exists, preview the upgrade first. Do not overwrite directly.

npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --dry-run --root .
Only when the preview reports no conflict: run the confirmed upgrade.
npx --yes @adamchanadam/agent-handoff-kit@latest upgrade --yes --root .
If the preview reports a conflict: stop and keep zero writes. The user does not need to judge technical differences or choose an npm command. The AI that can read and write this folder must read the CLI output, the conflicting files, and the formal sources, ask the user before making repair writes, then merge the project-specific content with the new Kit requirements. An unknown local hash is only evidence that the content exists and was not swapped; it is not permission for Kit to understand or overwrite it. After the merge, rerun upgrade --dry-run, then validate with doctor and hash/readback evidence. Report to the Kit maintainer only if the evidence shows Kit misclassified an unchanged formal old file. Do not reinstall or replace whole files to bypass the conflict.

Verify after completion

This version also strengthens everyday rule-writing boundaries. When the user later asks to add a durable rule, follow Governance Write Boundary in the installed dev/rules/agent-governance.md to find an existing writable home, protect official prose, and verify the reading route. This does not automatically reconcile older local rules already mixed into official prose; handle those conflicts through the authorized merge flow above.

Report the migration result separately from whole-project health. A changed version number alone is not completion evidence. Existing handoff content is preserved. At the next real closeout, the AI should use the updated rules to reconcile the overall outcome, subtask, resume point, and source-reading gaps, rather than inventing project state during the upgrade.

  1. Read back the same operation's root, CLI version, complete terminal outcome, and health result. Reuse that operation's doctor result without another run only when the process exits successfully, installation is complete or the upgrade is committed (or confirmed unnecessary), no transaction remains unresolved, health explicitly passes, and no relevant files have changed or become uncertain afterwards. Preserve all warnings. A version number, a success message somewhere in the output, or an old conversation record is insufficient.
  2. Do not reuse an earlier pass after failure, interruption, incomplete output, or later relevant file changes. If an upgrade transaction is unresolved, first follow the CLI recovery guidance using upgrade --yes --root ., then verify the complete terminal outcome; do not delete the lock or substitute a standalone doctor for recovery. Run the command below when no transaction is unresolved but valid health evidence is still missing, or when the user separately requests a check.
npx --yes @adamchanadam/agent-handoff-kit@latest doctor --root .

The same-operation result proves that local health check, not a fresh lookup of npm's latest version. A latest-version claim still requires npm registry readback and comparison with the actual CLI and installed versions; a successful preview does not replace completed installation or upgrade. This rule does not remove checks separately required by formal closeout or independent acceptance.

  1. If doctor passes, read AGENTS.md, then follow the Start Agent Handoff startup flow to connect this folder.
  2. If doctor fails, stop and explain the failed items. Do not reinstall over the project.
  3. If doctor only reports that the convenience copy START_NEXT_SESSION_PROMPT.txt is behind, explain that it will be regenerated at formal closeout; do not reinstall because of this.

AI response format

This section is the checklist for the completion-report contract at the top of the page. After acting, the AI must not say only “completed” or paste only terminal output. It must explain the result and next step to the user in short, plain language.

Completion-report template:

✅ Installation completed. 📁 Current folder: <absolute path>. 🩺 doctor passed. Do not remain in the terminal for the next step; in an AI conversation that can read and write this folder, enter Start Agent Handoff or “開工”. Only if the AI has not yet been pointed at the folder, use: Work in <absolute path>. Read AGENTS.md first, then Start Agent Handoff. Before changing anything, tell me the current state and your recommended next step.