devlog-tracker 0.25.1 → 0.29.2

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.
Files changed (130) hide show
  1. package/README.md +131 -151
  2. package/README.zh-TW.md +235 -0
  3. package/claude/hooks.json +75 -0
  4. package/cli/agents-md.js +15 -8
  5. package/cli/agents-md.test.js +21 -1
  6. package/cli/init.js +6 -4
  7. package/cli/init.test.js +5 -4
  8. package/cli/merge-hooks.js +5 -2
  9. package/cli/merge-hooks.test.js +52 -0
  10. package/cli/platforms/claude.js +55 -0
  11. package/cli/platforms/claude.test.js +178 -0
  12. package/cli/platforms/codex.js +6 -18
  13. package/cli/skills-from-commands.js +32 -0
  14. package/cli/skills-from-commands.test.js +51 -0
  15. package/cli/vendor.js +8 -1
  16. package/cli/vendor.test.js +24 -5
  17. package/codex/hooks/on-pre-tool.sh +3 -3
  18. package/codex/hooks/on-session-end.sh +2 -2
  19. package/codex/hooks/on-session-start.sh +2 -2
  20. package/codex/hooks/on-stop.sh +3 -3
  21. package/codex/hooks/on-user-prompt-submit.sh +2 -2
  22. package/codex/hooks/test-adapters.sh +2 -2
  23. package/commands/checkpoint.md +2 -2
  24. package/commands/clean.md +3 -3
  25. package/commands/compact.md +3 -3
  26. package/commands/continue.md +4 -4
  27. package/commands/keep.md +21 -5
  28. package/commands/lessons-drift.md +4 -4
  29. package/commands/lessons-off.md +3 -3
  30. package/commands/lessons-on.md +3 -3
  31. package/commands/lessons.md +3 -3
  32. package/commands/overview.md +3 -3
  33. package/commands/pause.md +3 -3
  34. package/commands/resume.md +3 -3
  35. package/commands/search.md +22 -0
  36. package/commands/segment-watch.md +3 -3
  37. package/commands/span.md +2 -2
  38. package/commands/start.md +3 -3
  39. package/commands/status.md +5 -4
  40. package/{hooks → core}/scripts/await-open.sh +1 -1
  41. package/{hooks → core}/scripts/checkpoint-set.sh +1 -1
  42. package/{hooks → core}/scripts/clean-devlog.sh +2 -1
  43. package/{hooks → core}/scripts/close-open-round.sh +1 -1
  44. package/{hooks → core}/scripts/compact-devlog.sh +1 -1
  45. package/{hooks → core}/scripts/devlog-lock.sh +17 -1
  46. package/{hooks → core}/scripts/devlog-path.sh +15 -8
  47. package/{hooks → core}/scripts/enforce-devlog.sh +26 -1
  48. package/core/scripts/handoff-file.sh +106 -0
  49. package/{hooks → core}/scripts/keep-move.sh +1 -1
  50. package/{hooks → core}/scripts/kept-list.sh +1 -1
  51. package/core/scripts/lessons-advisory-state.sh +51 -0
  52. package/{hooks → core}/scripts/lessons-append.sh +18 -2
  53. package/core/scripts/lessons-drift-set.sh +46 -0
  54. package/{hooks → core}/scripts/lessons-off.sh +1 -1
  55. package/{hooks → core}/scripts/lessons-on.sh +9 -4
  56. package/{hooks → core}/scripts/lessons-read.sh +1 -1
  57. package/{hooks → core}/scripts/on-tool-failure.sh +1 -1
  58. package/{hooks → core}/scripts/pause-devlog.sh +1 -1
  59. package/core/scripts/project-dir.sh +19 -0
  60. package/{hooks → core}/scripts/resume-devlog.sh +1 -1
  61. package/{hooks → core}/scripts/round-start.sh +52 -17
  62. package/{hooks → core}/scripts/run-tests.sh +1 -1
  63. package/core/scripts/search-devlog.sh +63 -0
  64. package/{hooks → core}/scripts/segment-watch-set.sh +1 -1
  65. package/{hooks → core}/scripts/segment-watch.sh +1 -1
  66. package/{hooks → core}/scripts/session-start-devlog.sh +8 -1
  67. package/{hooks → core}/scripts/span-close.sh +1 -1
  68. package/{hooks → core}/scripts/span-open.sh +1 -1
  69. package/{hooks → core}/scripts/start-devlog.sh +1 -1
  70. package/{hooks → core}/scripts/status-devlog.sh +5 -5
  71. package/{hooks → core}/scripts/tests/test-clean-devlog.sh +12 -0
  72. package/core/scripts/tests/test-cli-init-e2e.sh +68 -0
  73. package/core/scripts/tests/test-devlog-lock.sh +76 -0
  74. package/{hooks → core}/scripts/tests/test-devlog-path.sh +44 -0
  75. package/{hooks → core}/scripts/tests/test-enforce-devlog-files.sh +11 -0
  76. package/core/scripts/tests/test-enforce-devlog-session-handoff.sh +178 -0
  77. package/{hooks → core}/scripts/tests/test-enforce-devlog-workspace.sh +35 -0
  78. package/{hooks → core}/scripts/tests/test-enforce-devlog.sh +174 -0
  79. package/core/scripts/tests/test-handoff-file.sh +98 -0
  80. package/core/scripts/tests/test-lessons-advisory-state.sh +55 -0
  81. package/{hooks → core}/scripts/tests/test-lessons-append.sh +18 -0
  82. package/{hooks → core}/scripts/tests/test-lessons-drift-set.sh +14 -5
  83. package/{hooks → core}/scripts/tests/test-lessons-on-off.sh +16 -6
  84. package/core/scripts/tests/test-project-dir.sh +30 -0
  85. package/{hooks → core}/scripts/tests/test-round-start.sh +247 -13
  86. package/core/scripts/tests/test-search-devlog.sh +126 -0
  87. package/{hooks → core}/scripts/tests/test-session-start-devlog.sh +61 -2
  88. package/{hooks → core}/scripts/tests/test-status-span.sh +3 -3
  89. package/{hooks → core}/scripts/workspace-snapshot.sh +2 -2
  90. package/cursor/hooks/on-pre-tool.sh +2 -2
  91. package/cursor/hooks/on-session-end.sh +2 -2
  92. package/cursor/hooks/on-session-start.sh +2 -2
  93. package/cursor/hooks/on-stop.sh +2 -2
  94. package/cursor/hooks/on-submit-prompt.sh +2 -2
  95. package/cursor/hooks/on-tool-failure.sh +2 -2
  96. package/package.json +5 -4
  97. package/skills/devlog-tracker/SKILL.md +90 -22
  98. package/skills/devlog-tracker/references/checkpoint-mode.md +21 -6
  99. package/skills/devlog-tracker/references/contract.md +83 -0
  100. package/skills/devlog-tracker/references/lessons-mode.md +33 -9
  101. package/skills/devlog-tracker/references/reply-fold.md +1 -1
  102. package/hooks/scripts/lessons-drift-set.sh +0 -42
  103. package/hooks/scripts/tests/test-cli-init-e2e.sh +0 -38
  104. package/hooks/scripts/tests/test-devlog-lock.sh +0 -37
  105. /package/{hooks → core}/scripts/detect-pending-question.sh +0 -0
  106. /package/{hooks → core}/scripts/devlog-md.sh +0 -0
  107. /package/{hooks → core}/scripts/files-snapshot.sh +0 -0
  108. /package/{hooks → core}/scripts/json-field.sh +0 -0
  109. /package/{hooks → core}/scripts/on-session-end.sh +0 -0
  110. /package/{hooks → core}/scripts/on-stop-failure.sh +0 -0
  111. /package/{hooks → core}/scripts/redact-prompt.sh +0 -0
  112. /package/{hooks → core}/scripts/tests/test-await-open.sh +0 -0
  113. /package/{hooks → core}/scripts/tests/test-branch-scoped-integration.sh +0 -0
  114. /package/{hooks → core}/scripts/tests/test-checkpoint-set.sh +0 -0
  115. /package/{hooks → core}/scripts/tests/test-close-open-round.sh +0 -0
  116. /package/{hooks → core}/scripts/tests/test-compact-devlog.sh +0 -0
  117. /package/{hooks → core}/scripts/tests/test-devlog-md.sh +0 -0
  118. /package/{hooks → core}/scripts/tests/test-enforce-devlog-handoff-order.sh +0 -0
  119. /package/{hooks → core}/scripts/tests/test-files-snapshot.sh +0 -0
  120. /package/{hooks → core}/scripts/tests/test-json-field.sh +0 -0
  121. /package/{hooks → core}/scripts/tests/test-keep-move.sh +0 -0
  122. /package/{hooks → core}/scripts/tests/test-kept-list.sh +0 -0
  123. /package/{hooks → core}/scripts/tests/test-lessons-read.sh +0 -0
  124. /package/{hooks → core}/scripts/tests/test-on-interrupt.sh +0 -0
  125. /package/{hooks → core}/scripts/tests/test-redact-prompt.sh +0 -0
  126. /package/{hooks → core}/scripts/tests/test-resume-devlog.sh +0 -0
  127. /package/{hooks → core}/scripts/tests/test-segment-watch-set.sh +0 -0
  128. /package/{hooks → core}/scripts/tests/test-segment-watch.sh +0 -0
  129. /package/{hooks → core}/scripts/tests/test-start-pause-devlog.sh +0 -0
  130. /package/{hooks → core}/scripts/tests/test-workspace-snapshot.sh +0 -0
package/README.md CHANGED
@@ -1,254 +1,234 @@
1
1
  # devlog-tracker
2
2
 
3
- **版本** 0.25.1
3
+ *English | [繁體中文](README.zh-TW.md)*
4
4
 
5
- 在專案中維護一份 `.devlog/devlog.md`,把每一輪對話的請求、決策與結果寫成永久紀錄。對話一 `/clear` 或換 session 就沒了;這份檔案取代那個缺口,讓工作可以中斷再接。沒下過 `/devlog-tracker:start` 時,裝著也不會動任何檔案。
5
+ **Version** 0.29.2
6
6
 
7
- ## 這是什麼
7
+ Maintains a `.devlog/devlog.md` in your project, turning each conversation round's requests, decisions, and outcomes into a permanent record. A conversation disappears the moment you `/clear` or switch sessions; this file fills that gap so work can pause and resume. Nothing is touched until you explicitly run `/devlog-tracker:start` — installing the plugin alone doesn't create or modify any files.
8
8
 
9
- 把「這輪做了什麼、決定了什麼、下一步是什麼」寫進專案內的 `devlog.md`。Stop hook 保證每輪都寫完才放行;沒明確 `/devlog-tracker:start` 前不會建立或改動 `.devlog/`。
9
+ ## What this is
10
10
 
11
- `devlog.md` 只管**跨 session 的交接連續性**(決策軌跡、目前卡點、完成條件、下一步),並作為 **L1**(人觸發 continue/開 session 注入後,agent 只靠 SSOT 接手,且必須把本輪狀態**寫回**本檔)的主入口。不是整個專案的單一真相來源:
11
+ Writes "what this round did, what was decided, what's next" into the project's `devlog.md`. A Stop hook guarantees every round is fully written before it's allowed to end; nothing under `.devlog/` is created or changed before an explicit `/devlog-tracker:start`.
12
12
 
13
- - 程式碼/檔案狀態的真相仍是 git
14
- - 完整逐字過程的真相是對話 transcript(`/clear` 後不存在)
15
- - 設計決策的真相是 `docs/design/*.md`
13
+ `devlog.md` is only responsible for **cross-session handoff continuity** (the decision trail, current blockers, completion criteria, next steps), and serves as the main entry point for **L1** — after a human-triggered continue or a session-start injection, the agent picks up relying solely on this SSOT, and must **write back** this round's state into this file. It is not the single source of truth for the whole project:
16
14
 
17
- 這份檔案只是取代「終端機一 clear 就沒了」的缺口,讓工作可以隨時中斷、隨時接續。L2(無人喚醒)與 L3(跨機共享 `.devlog/`)不在範圍;細節見 [`docs/design/devlog-as-ssot-assessment.md`](docs/design/devlog-as-ssot-assessment.md)。
15
+ - The source of truth for code/file state is still git
16
+ - The source of truth for the full verbatim process is the conversation transcript (gone after `/clear`)
17
+ - The source of truth for design decisions is `docs/design/*.md`
18
18
 
19
- 每輪收尾固定寫 `Summary`/`Reply`(對使用者說過的話)/`Handoff`(含未完成時的 `完成條件`)/`Status`。接手=核對工作區 → 做下一步 → **寫回**;讀而不寫算交接失敗。
19
+ This file simply replaces the gap left by "the terminal clears and it's gone," so work can be interrupted and picked back up at any time. L2 (unattended wake-ups) and L3 (cross-machine shared `.devlog/`) are out of scope; see [`docs/design/devlog-as-ssot-assessment.md`](docs/design/devlog-as-ssot-assessment.md) for details.
20
20
 
21
- ## 安裝
21
+ Every round wraps up with a fixed `Summary`/`Reply` (what was told to the user)/`Handoff` (including `Completion criteria` when unfinished)/`Status`. Picking up work means: check the workspace → do the next step → **write back**; reading without writing counts as a failed handoff.
22
22
 
23
- 作為 Claude Code plugin 安裝(會自動更新):
23
+ ## Install
24
+
25
+ The three platforms are peers, each installed independently; a given project can use one or several, but the same platform should **not** use both the plugin marketplace and `npx init` at once — that fires the hook twice.
26
+
27
+ ### Claude Code
28
+
29
+ **Option 1: plugin marketplace (auto-updates)**
24
30
 
25
31
  ```
26
32
  /plugin marketplace add gogogohuang/devlog-tracker
27
33
  /plugin install devlog-tracker@devlog-tracker
28
34
  ```
29
35
 
30
- ### npx(Cursor/Codex 用)
36
+ Commands are under `/devlog-tracker:*` (e.g. `/devlog-tracker:start`).
31
37
 
32
- Claude Code 請用上面的 `/plugin marketplace add` 安裝方式;這個 CLI 不會設定 Claude Code。
38
+ **Option 2: npx (vendored into the project, version pinnable)**
33
39
 
34
40
  ```bash
35
- npx devlog-tracker init
41
+ npx devlog-tracker init --claude
36
42
  ```
37
43
 
38
- 沒帶 `--codex`/`--cursor` 時會互動式問要裝哪個平台;在沒有 TTY 的環境(例如 CI)且沒帶旗標時,`init` 不會詢問,直接安裝所有支援的平台(codex + cursor)。也可以直接指定:
44
+ Merges the hooks into `.claude/settings.local.json` (not `settings.json` — the merged command paths contain this machine's absolute paths and shouldn't be committed; `settings.local.json` is gitignored by Claude Code by default), and converts `commands/*.md` into `.claude/skills/devlog-<name>/SKILL.md`, invoked with `/devlog-<name>`; it also adds a `<!-- devlog-tracker:begin/end -->` fallback block to `CLAUDE.md`.
45
+
46
+ ### Codex
39
47
 
40
48
  ```bash
41
- npx devlog-tracker init --codex --cursor
49
+ npx devlog-tracker init --codex
42
50
  ```
43
51
 
44
- 會把 `hooks/scripts/`、`codex/hooks/`、`cursor/hooks/`、`skills/`、`commands/`
45
- 複製進專案的 `.devlog-tracker/`,並把對應平台的 `hooks.json` 合併進專案(不覆蓋
46
- 其他工具已設定的 hook)。重新執行 `npx devlog-tracker init` 可以升級到套件目前的
47
- 版本;`npx devlog-tracker status` 可以查目前裝的版本是否落後。
52
+ Merges the `hooks` from `codex/hooks.json` into the project's `.codex/hooks.json`, and generates `.agents/skills/devlog-<name>/SKILL.md` from `commands/*.md`, invoked with `$devlog-<name>` (or picked from `/skills`); it also adds the same kind of fallback block to `AGENTS.md`. Files the older 0.25.0 version wrote to `.codex/prompts/` are cleared out on the next `init` run — Codex doesn't read project-level custom prompts.
48
53
 
49
- 裝 Codex 時,`init` 會從 `.devlog-tracker/commands/*.md` 產生對應的專案 skill 到
50
- `.agents/skills/devlog-<名稱>/SKILL.md`,例如在 Codex 打 `$devlog-start`(或用 `/skills`
51
- 選)啟動追蹤。舊版(0.25.0)寫到 `.codex/prompts/` 的檔案會在重跑 `init` 時清掉——
52
- Codex 不讀專案層級的 custom prompts。也會在專案根目錄的
53
- `AGENTS.md` 加上(或更新)一段以 `<!-- devlog-tracker:begin/end -->` 包住的 fallback
54
- 說明。區塊外的內容不會動,重跑 `init` 只會換掉區塊本身;區塊裡只有相對路徑,可以 commit。
54
+ **Hooks require approval before they run.** Codex requires approval for new or changed hooks; an unapproved hook is silently skipped — **with no warning at all**, so it looks like devlog just isn't recording. This is independent of whether the project is set to `trust_level = "trusted"`; project trust doesn't make hooks active.
55
55
 
56
- 裝完 Codex 之後,第一次還要在 Codex 裡核准這些 hook,否則不會記錄(見下方〈Codex(選用)〉的「hook 需要審核」)。
56
+ - Interactive mode: the first time you open it, Codex prompts that hooks need approval; they only run once approved. A later change to hook configuration (e.g. re-running `init` and changing paths or commands) may require approval again.
57
+ - Non-interactive `codex exec` (CI, scripts): unapproved hooks are silently skipped. `--dangerously-bypass-hook-trust` lets them run, but that flag skips trust checks for *all* hooks, so it's only appropriate for automation environments where you've already vetted the hook sources yourself.
58
+ - To confirm it's working: after `start`, send a message and check whether `.devlog/.round-current.md` shows this round's User Input skeleton; if not, the hook didn't run.
57
59
 
58
- `init` 會把這台機器專屬的絕對路徑寫進 `.codex/hooks.json`、`.cursor/hooks.json` 與
59
- `.devlog-tracker/env.sh`。如果你把這些檔案 commit 進 git,每位隊友都要在自己的機器上
60
- 跑一次 `npx devlog-tracker init`(路徑每台機器不同);或者改成把 `.devlog-tracker/` 與
61
- 產生出來的 hooks.json 加進 `.gitignore`。
60
+ Codex currently has no equivalent to "user interrupted" (Claude Code's `PostToolUseFailure`/`is_interrupt`) or "this round ended abnormally" (`StopFailure`); these two detailed states won't be marked `INTERRUPTED` on Codex, but the core enforcement mechanism (the `Stop` event blocking unfinished rounds) is unaffected.
62
61
 
63
- ### Cursor(選用)
62
+ ### Cursor
64
63
 
65
- Claude Code 仍是主要安裝方式。若要在 Cursor workspace 使用,先設定
66
- `DEVLOG_TRACKER_ROOT` 為本 plugin 的絕對路徑,再把 `cursor/hooks.json` 的
67
- `hooks` 合併進專案 `.cursor/hooks.json`。也可以把整個 `cursor/hooks/` 與
68
- `hooks/scripts/` vendoring 到專案,並調整 command 路徑;兩者的相對目錄必須維持可用。
64
+ ```bash
65
+ npx devlog-tracker init --cursor
66
+ ```
69
67
 
70
- Cursor cloud agent 不執行 `sessionStart`,因此不會自動注入接手摘要;其他已設定的
71
- hook 仍依 Cursor 支援的事件執行。
68
+ Merges the `hooks` from `cursor/hooks.json` into the project's `.cursor/hooks.json`. Cursor has no slash-command surface, so once hooks are installed, follow the steps in `commands/*.md` to run the corresponding scripts manually. Cursor's cloud agent doesn't run `sessionStart`, so it won't auto-inject a handoff summary; other configured hooks still run on whichever events Cursor supports.
72
69
 
73
- Cursor 沒有 `/devlog-tracker:*` slash 指令面;hooks 裝好後,請用與 Claude commands
74
- 相同的腳本(`commands/*.md` 會優先讀 `CLAUDE_PLUGIN_ROOT`,否則讀
75
- `DEVLOG_TRACKER_ROOT`):
70
+ ### All three platforms
76
71
 
77
72
  ```bash
78
- export DEVLOG_TRACKER_ROOT=/absolute/path/to/devlog-tracker
79
- export CLAUDE_PROJECT_DIR="$(pwd)"
80
- bash "$DEVLOG_TRACKER_ROOT/hooks/scripts/start-devlog.sh"
81
- bash "$DEVLOG_TRACKER_ROOT/hooks/scripts/status-devlog.sh"
82
- bash "$DEVLOG_TRACKER_ROOT/hooks/scripts/segment-watch-set.sh" 600
83
- bash "$DEVLOG_TRACKER_ROOT/hooks/scripts/checkpoint-set.sh" 20
84
- # pause / span-open / span-close / compact / keep-move / clean / resume:見 commands/*.md
73
+ npx devlog-tracker init
85
74
  ```
86
75
 
87
- ### Codex(選用)
88
-
89
- Claude Code 仍是主要安裝方式。若要在 Codex CLI 使用,先設定
90
- `DEVLOG_TRACKER_ROOT` 為本 plugin 的絕對路徑,再把 `codex/hooks.json` 的
91
- `hooks` 合併進專案(或 `~/.codex/`)的 `hooks.json`。也可以把整個 `codex/hooks/` 與
92
- `hooks/scripts/` vendoring 到專案,並調整 command 路徑;兩者的相對目錄必須維持可用。
93
-
94
- **hook 需要審核才會執行。** Codex 對新增或有變動的 hook 要求先審核;沒核准的 hook 會被
95
- 直接略過,而且**沒有任何警告**,看起來就像 devlog 沒在記錄。這跟專案有沒有設成
96
- `trust_level = "trusted"` 是兩回事,專案信任不會讓 hook 生效。
76
+ Without `--claude`/`--codex`/`--cursor`, it interactively asks which platform(s) to install; in an environment without a TTY (e.g. CI) and no flags given, `init` skips the prompt and installs all three platforms directly. You can also combine flags, e.g. `npx devlog-tracker init --claude --codex`.
97
77
 
98
- - 互動模式:第一次開啟時 Codex 會提示有 hook 需要審核,核准後才會執行。之後 hook 的設定
99
- 有變動(例如重跑 `init` 讓路徑或指令改變)也可能要再核准一次。
100
- - 非互動的 `codex exec`(CI、腳本):未審核的 hook 會被靜默略過。`--dangerously-bypass-hook-trust`
101
- 可以讓它們跑起來,但那個旗標會略過所有 hook 的信任檢查,只適合已經自己確認過 hook 來源的
102
- 自動化環境。
103
- - 想確認有沒有生效:`start` 之後送一則訊息,看 `.devlog/.round-current.md` 有沒有出現這一輪的
104
- User Input skeleton;沒有就代表 hook 沒被執行。
78
+ Copies `core/scripts/`, `claude/hooks.json`, `codex/hooks/`, `cursor/hooks/`, `skills/`, and `commands/` into the project's `.devlog-tracker/`. Re-running `npx devlog-tracker init` upgrades to the package's current version; `npx devlog-tracker status` checks whether the installed version is behind.
105
79
 
106
- Codex 目前沒有對應「使用者中斷」(Claude Code 的 `PostToolUseFailure`/
107
- `is_interrupt`)與「這輪異常結束」(`StopFailure`)的事件,這兩種細節狀態在
108
- Codex 上不會被標記成 `INTERRUPTED`;核心強制記錄機制(`Stop` 事件擋住未寫完的
109
- 輪次)不受影響。
80
+ `init` writes this machine's absolute paths into each platform's hooks config and into `.devlog-tracker/env.sh`. If you commit these files to git, each teammate needs to run `npx devlog-tracker init` on their own machine (paths differ per machine); alternatively, add `.devlog-tracker/` and the generated hooks config files to `.gitignore`.
110
81
 
111
- Codex 使用 `$devlog-<名稱>`(例如 `$devlog-start`)執行指令;它們會讀與 Claude
112
- commands 相同的內容。若使用的 Codex 環境沒有載入專案 skills,仍可直接使用以下腳本(`commands/*.md` 會優先讀 `CLAUDE_PLUGIN_ROOT`,否則讀
113
- `DEVLOG_TRACKER_ROOT`):
82
+ To install manually (without npx), set `DEVLOG_TRACKER_ROOT` to this plugin's absolute path, and merge the `hooks` from the matching platform's `hooks.json` into the project config; `commands/*.md` prefers `DEVLOG_TRACKER_ROOT`, falling back to `CLAUDE_PLUGIN_ROOT`:
114
83
 
115
84
  ```bash
116
85
  export DEVLOG_TRACKER_ROOT=/absolute/path/to/devlog-tracker
117
- export CLAUDE_PROJECT_DIR="$(pwd)"
118
- bash "$DEVLOG_TRACKER_ROOT/hooks/scripts/start-devlog.sh"
119
- bash "$DEVLOG_TRACKER_ROOT/hooks/scripts/status-devlog.sh"
120
- bash "$DEVLOG_TRACKER_ROOT/hooks/scripts/segment-watch-set.sh" 600
121
- bash "$DEVLOG_TRACKER_ROOT/hooks/scripts/checkpoint-set.sh" 20
122
- # pause / span-open / span-close / compact / keep-move / clean / resume:見 commands/*.md
86
+ export DEVLOG_PROJECT_DIR="$(pwd)"
87
+ bash "$DEVLOG_TRACKER_ROOT/core/scripts/start-devlog.sh"
88
+ bash "$DEVLOG_TRACKER_ROOT/core/scripts/status-devlog.sh"
89
+ bash "$DEVLOG_TRACKER_ROOT/core/scripts/segment-watch-set.sh" 600
90
+ bash "$DEVLOG_TRACKER_ROOT/core/scripts/checkpoint-set.sh" 20
91
+ # pause / span-open / span-close / compact / keep-move / clean / resume: see commands/*.md
123
92
  ```
124
93
 
125
- ## 快速開始
94
+ ## Quick start
126
95
 
127
- 在專案裡下一次:
96
+ Run once in your project (pick whichever matches your install method):
128
97
 
129
98
  ```
130
- /devlog-tracker:start
99
+ /devlog-tracker:start # Claude Code plugin
100
+ /devlog-start # npx init --claude
101
+ $devlog-start # npx init --codex
131
102
  ```
132
103
 
133
- 之後正常跟 Claude 對話即可,每一輪結束前都會被強制檢查、補上 `.devlog/devlog.md` 的紀錄。`/clear` 之後 context 是空的;要接著做上一題,下 `/devlog-tracker:continue`。暫停、歸檔、具名搬走、狀態與 span 見下方指令表(完整 namespace,plugin 名稱是 `devlog-tracker`)。
104
+ After that, just converse normally — every round is enforced-checked and `.devlog/devlog.md` gets updated before it can end. After `/clear`, context is empty; to pick up prior work, run the matching `continue` command. See the command table below for pause, archive, named export, status, and span.
134
105
 
135
- ## 指令
106
+ ## Commands
136
107
 
137
- | 指令 | 做什麼 |
108
+ The table below uses the plugin's `/devlog-tracker:*` namespace; `npx init --claude` installs `/devlog-<name>`, and `npx init --codex` installs `$devlog-<name>` — the command content is the same.
109
+
110
+ | Command | What it does |
138
111
  |---|---|
139
- | `/devlog-tracker:start` | 跑腳本建立 `.devlog/.enabled`(缺的 state 檔會補上,已有門檻不重置)。讀檔對進度,不自動開工。`.devlog/` 含 prompt,會建議加進 `.gitignore`,要你同意才改。 |
140
- | `/devlog-tracker:continue` | 讀 `.devlog/devlog.md`,核對最後一輪 Handoff「工作區」後再依下一步接著做。`/clear` 之後要接續用這個。細節見 [`docs/design/continue.md`](docs/design/continue.md)。 |
141
- | `/devlog-tracker:pause` | 暫停強制記錄,歷史檔不動,之後可再 `start`。 |
142
- | `/devlog-tracker:compact` | 腳本把較舊的 `DONE` 輪次搬到 `devlog.archive.md`(Checkpoint 與未完成輪留在主檔)。 |
143
- | `/devlog-tracker:keep` | 掃全檔分主題,一次列出建議,確認後把各段各自搬走成 `devlog.<name>.md`(並在主檔留一個 `## Kept 索引` 指標行,含一句主題描述);也可抽出一段或合併成全部歷史一檔。不是 compact。細節見 [`docs/design/keep.md`](docs/design/keep.md)。 |
144
- | `/devlog-tracker:overview` | 讀完所有已 keep 的 `devlog.<name>.md`,整合成跨主題總覽,並列出看起來該進 `CLAUDE.md` 的規範候選。純讀取,不核對工作區、不等確認、不寫檔。細節見 [`docs/design/keep.md`](docs/design/keep.md) Kept index。 |
145
- | `/devlog-tracker:resume <name>` | 讀具名保存檔的最後一輪與 Handoff,核對「工作區」後提出接續;新工作仍寫回主 `devlog.md`。 |
146
- | `/devlog-tracker:clean` | 無條件清空 `devlog.md`(含專案摘要與所有 Round 歷史),不搬移、不備份、不可復原;執行前一定會先問,要明確回覆「清空」才動手。只留目前開著的那一輪,重編成 `## Round 1`。 |
147
- | `/devlog-tracker:status` | 查看強制記錄開關、Span、Checkpoint、Segment Watch、Lessons Mode 工作區漂移計數與最後一輪 Status。 |
148
- | `/devlog-tracker:span` | 開啟或關閉自動續接長任務使用的 Span Mode(不要手寫 `.span-open` JSON)。 |
149
- | `/devlog-tracker:segment-watch <時間長度>` | 調整 Segment Watch 的沉默門檻(預設 10 分鐘)。專案還沒 `/devlog-tracker:start` 時回報 `NOT_STARTED`,不會建立任何檔案。 |
150
- | `/devlog-tracker:checkpoint <輪數>` | 調整 Checkpoint Mode 的沉默門檻(預設 20 輪)。專案還沒 start 時回報 `NOT_STARTED`。 |
151
- | `/devlog-tracker:lessons-on` | 開啟預設關閉的 Lessons Mode(隸屬主開關,沒 `start` 過會拒絕)。細節見 [`docs/design/lessons-mode.md`](docs/design/lessons-mode.md)。 |
152
- | `/devlog-tracker:lessons-off` | 關閉 Lessons Mode,不動任何已寫的 `devlog.lessons.*.md` 或索引。 |
153
- | `/devlog-tracker:lessons [<topic>]` | 沒給 topic:印 `## Lessons 索引`。給 topic:印該主題檔全文。純讀取,不核對工作區、不等確認。 |
154
- | `/devlog-tracker:lessons-drift <次數>` | 調整 Lessons Mode「工作區漂移重複發生」機制性提醒的門檻(預設 3 次)。隸屬 Lessons Mode,沒開會回報 `LESSONS_NOT_ENABLED`。 |
155
-
156
- ## 強制記錄開著之後
112
+ | `/devlog-tracker:start` | Runs a script that creates `.devlog/.enabled` (missing state files are backfilled; existing thresholds aren't reset). Reads the file to check progress; doesn't auto-start work. `.devlog/` contains a prompt suggesting adding it to `.gitignore`, and only edits it with your consent. |
113
+ | `/devlog-tracker:continue` | Reads `.devlog/devlog.md`, checks the last round's Handoff "Workspace" section, then continues per its next step. Use this after `/clear` to resume. See [`docs/design/continue.md`](docs/design/continue.md). |
114
+ | `/devlog-tracker:pause` | Pauses enforced recording; history files are untouched, and you can `start` again later. |
115
+ | `/devlog-tracker:compact` | A script moves older `DONE` rounds into `devlog.archive.md` (Checkpoints and unfinished rounds stay in the main file). |
116
+ | `/devlog-tracker:keep` | Scans the whole file, groups it by topic, lists suggestions at once, then — after confirmation — moves each section out into its own `devlog.<name>.md` (leaving a `## Kept index` pointer line with a one-sentence topic description in the main file); can also extract a single section or merge everything into one history file. Not the same as compact. See [`docs/design/keep.md`](docs/design/keep.md). |
117
+ | `/devlog-tracker:overview` | Reads all kept `devlog.<name>.md` files and merges them into a cross-topic overview, plus a list of candidate rules that look like they belong in `CLAUDE.md`. Read-only — no workspace check, no confirmation, no writes. See the Kept index section of [`docs/design/keep.md`](docs/design/keep.md). |
118
+ | `/devlog-tracker:search <keyword>` | Case-insensitive string search across `devlog.md`/`devlog.archive.md`/kept `devlog.<name>.md`/`devlog.lessons.<topic>.md`; Claude answers in its own words from the hits (with file/heading/line as evidence). Read-only — no workspace check, no confirmation, no writes. |
119
+ | `/devlog-tracker:resume <name>` | Reads the last round and Handoff of a named saved file, checks the "Workspace" section, and proposes how to continue; new work is still written back to the main `devlog.md`. |
120
+ | `/devlog-tracker:clean` | Unconditionally clears `devlog.md` (including the project summary and all Round history) — no move, no backup, not reversible; it always asks first, and only proceeds once you explicitly reply "clear". Keeps only the currently open round, renumbered as `## Round 1`. |
121
+ | `/devlog-tracker:status` | Shows whether enforced recording is on, Span, Checkpoint, Segment Watch, the Lessons Mode workspace-drift count, and the last round's Status. |
122
+ | `/devlog-tracker:span` | Turns Span Mode on/off, used for auto-continuing long-running tasks (don't hand-edit the `.span-open` JSON). |
123
+ | `/devlog-tracker:segment-watch <duration>` | Adjusts Segment Watch's silence threshold (default 10 minutes). Reports `NOT_STARTED` and creates no files if the project hasn't run `/devlog-tracker:start`. |
124
+ | `/devlog-tracker:checkpoint <rounds>` | Adjusts Checkpoint Mode's silence threshold (default 20 rounds). Reports `NOT_STARTED` if the project hasn't started. |
125
+ | `/devlog-tracker:lessons-on` | Turns on Lessons Mode, which is off by default (subordinate to the main switch; refuses if `start` hasn't run). See [`docs/design/lessons-mode.md`](docs/design/lessons-mode.md). |
126
+ | `/devlog-tracker:lessons-off` | Turns off Lessons Mode; doesn't touch any already-written `devlog.lessons.*.md` files or the index. |
127
+ | `/devlog-tracker:lessons [<topic>]` | No topic given: prints the `## Lessons index`. Topic given: prints that topic file's full content. Read-only — no workspace check, no confirmation. |
128
+ | `/devlog-tracker:lessons-drift <count>` | Adjusts the threshold for Lessons Mode's "recurring workspace drift" mechanical reminder (default 3). Subordinate to Lessons Mode; reports `LESSONS_NOT_ENABLED` if it's off. |
129
+
130
+ ## Once enforced recording is on
157
131
 
158
132
  ```mermaid
159
133
  sequenceDiagram
160
- participant U as 使用者
134
+ participant U as User
161
135
  participant H as Hooks
162
136
  participant C as Claude
163
137
  participant D as .devlog/devlog.md
164
138
 
165
- U->>H: 送出訊息
166
- H->>D: 先寫 Round skeleton(User Input + IN_PROGRESS)
167
- C->>D: 補 Summary / Reply / Handoff,改 Status
168
- C->>H: 這一輪要結束
169
- alt 沒寫完、標題是空的,或 Status 不合法
170
- H-->>C: 擋住,要求補寫
171
- else 寫完了
172
- H-->>C: 放行
139
+ U->>H: Send message
140
+ H->>D: Write the Round skeleton first (User Input + IN_PROGRESS)
141
+ C->>D: Fill in Summary / Reply / Handoff, update Status
142
+ C->>H: This round wants to end
143
+ alt Not written, headings empty, or Status invalid
144
+ H-->>C: Block, require completion
145
+ else Fully written
146
+ H-->>C: Allow
173
147
  end
174
148
  ```
175
149
 
176
- 每一輪固定:
150
+ Every round has these fixed sections:
177
151
 
178
- - **`User Input`** — 送出原文優先(hook 寫入;Claude 不要改寫),常見 token 會遮罩
179
- - **`Summary`** — 給人掃的結論
180
- - **`Reply`** — 這輪對使用者說過/答應過的話
181
- - **`Handoff`** — 給下一輪接手(決策/檔案/工作區/現況/完成條件/下一步)
182
- - **`Status`** — `DONE` / `IN_PROGRESS` / `BLOCKED` / `INTERRUPTED` 四選一
152
+ - **`User Input`** — the raw submitted text takes priority (written by the hook; Claude shouldn't rewrite it), common tokens are masked
153
+ - **`Summary`** — a conclusion a human can scan
154
+ - **`Reply`** — what was said/promised to the user this round
155
+ - **`Handoff`** — for the next round to pick up (decisions / files / workspace / current state / completion criteria / next steps)
156
+ - **`Status`** — one of `DONE` / `IN_PROGRESS` / `BLOCKED` / `INTERRUPTED`
183
157
 
184
- 其中「工作區」是收尾時的 git 快照,進行中/卡住必寫;`DONE` 若「檔案」有內容(宣稱動過/commit 過檔案)也必寫。「完成條件」在進行中/卡住必寫。
158
+ "Workspace" is a git snapshot taken at wrap-up time; required whenever in progress or blocked. `DONE` also requires it if "Files" has content (claiming files were touched/committed). "Completion criteria" is required whenever in progress or blocked.
185
159
 
186
- Stop hook 會做這些事:
160
+ The Stop hook does the following:
187
161
 
188
- 1. 確認 `Summary`/`Reply`/`Handoff` 標題底下有內容、Status 是上述四值之一;Handoff 小節順序為 決策 → 檔案 → 工作區 → 現況 → 完成條件 → 下一步
189
- 2. 進行中/卡住時有「完成條件」與「下一步」;「下一步」不是純黑名單空話(例如整節只寫「繼續完成」;字串比對,非語意評分,細節見 [`docs/design/next-step-blacklist.md`](docs/design/next-step-blacklist.md));進行中另做輕量可執行檢查;卡住時「現況」或「下一步」須含缺件句式
190
- 3. 機器核對「工作區」是否跟收尾當下的 git 狀態逐字相符(進行中/卡住一律核對,`DONE` 只在「檔案」非空時核對),避免「已 commit 完成」卻其實沒 commit 這類宣稱跟實際不符
162
+ 1. Confirms `Summary`/`Reply`/`Handoff` headings have content underneath, and Status is one of the four values above; Handoff subsections must be in the order Decisions → Files → Workspace → Current state → Completion criteria → Next steps
163
+ 2. In-progress/blocked rounds must have "Completion criteria" and "Next steps"; "Next steps" can't be pure blacklisted filler (e.g. a section that just says "continue finishing up" — string matching, not semantic scoring; see [`docs/design/next-step-blacklist.md`](docs/design/next-step-blacklist.md)); in-progress rounds get an additional lightweight actionability check; blocked rounds require "Current state" or "Next steps" to contain a missing-piece phrasing
164
+ 3. Machine-verifies that "Workspace" matches the actual git state at wrap-up time, verbatim (always checked when in progress/blocked; only checked for `DONE` when "Files" is non-empty) — this catches claims like "already committed" that don't actually match reality
191
165
 
192
- `#### 檔案` 非空時同樣機器核對:commit 區塊要跟該次 commit 的實際內容逐字相符,未 commit 的區塊只要求宣稱的路徑真的存在變更(不要求涵蓋全部,避免把跨輪殘留算成這輪漏列)。
166
+ When `#### Files` is non-empty, it's likewise machine-verified: the commit section must match that commit's actual content verbatim; for uncommitted sections, it only requires that the claimed paths actually have changes (not full coverage, so leftovers from a previous round aren't counted as missing from this one).
193
167
 
194
- 細節見 [`docs/design/summary-handoff.md`](docs/design/summary-handoff.md)、[`docs/design/devlog-as-ssot-assessment.md`](docs/design/devlog-as-ssot-assessment.md)、[`docs/design/files-verify.md`](docs/design/files-verify.md) 和 SKILL.md。
168
+ See [`docs/design/summary-handoff.md`](docs/design/summary-handoff.md), [`docs/design/devlog-as-ssot-assessment.md`](docs/design/devlog-as-ssot-assessment.md), [`docs/design/files-verify.md`](docs/design/files-verify.md), and SKILL.md for details.
195
169
 
196
- ## Hook 會自動做的事
170
+ ## What the hooks do automatically
197
171
 
198
- 正常規則是「一則使用者訊息 = 一輪,結束前一定要寫完 Summary/Reply/Handoff/Status」。下面四個機制各自放寬這條規則的不同一塊,彼此正交、可以同時存在:
172
+ The normal rule is "one user message = one round, and Summary/Reply/Handoff/Status must be fully written before it ends." The four mechanisms below each relax a different slice of that rule; they're orthogonal and can coexist:
199
173
 
200
- | 機制 | 放寬的是 | 解決的問題 |
174
+ | Mechanism | What it relaxes | What problem it solves |
201
175
  |---|---|---|
202
- | **Span Mode** | 「每次自動喚醒算不算一輪」 | `/loop`、Workflow 這類被自己排程反覆喚醒、不是使用者手動打字觸發的長任務,每個自動 tick 都強制寫完整 Round,會逼出大量沒意義的紀錄,甚至卡住整條自動化流程 |
203
- | **Checkpoint Mode** | 「有沒有跨輪的摘要路標」 | 一般互動對話每輪都正常寫,但輪數一多,翻閱的人要逐輪爬完才知道整體進度 |
204
- | **Reply Fold** | 「一問一答算不算兩輪」 | Claude 用純文字提問、下一則訊息其實是在回答時,預設邏輯(每個 `UserPromptSubmit` 開新 Round)會把這組問答硬拆成兩個不相關的 Round |
205
- | **Segment Watch** | 「一輪內部要不要留階段性痕跡」 | 一輪做很久(先探索、再決策、再實作、再驗證),憋到最後才寫一次,中途 crash 會把整個過程全部遺失 |
176
+ | **Span Mode** | Whether each automatic wake-up counts as a round | Long-running tasks driven by their own schedule (`/loop`, Workflow) rather than a user typing — forcing a full Round on every automatic tick produces a flood of meaningless records, or even stalls the whole automation |
177
+ | **Checkpoint Mode** | Whether there's a cross-round summary waypoint | Normal interactive conversation writes every round fine, but once the round count grows, reviewers have to crawl through every round to see overall progress; each checkpoint uses a fixed **Decisions / Open questions / Failed attempts** layout so SessionStart injection surfaces blockers quickly |
178
+ | **Reply Fold** | Whether a question-and-answer counts as two rounds | When Claude ends with a plain-text question and the next message is really the answer, the default logic (every `UserPromptSubmit` opens a new Round) would hard-split that Q&A into two unrelated rounds |
179
+ | **Segment Watch** | Whether a round leaves intermediate traces internally | A round that takes a long time (explore, then decide, then implement, then verify) and only writes once at the very end loses the whole process if it crashes partway |
206
180
 
207
- 以下是各機制實際觸發時的行為:
181
+ Here's how each mechanism actually behaves when triggered:
208
182
 
209
- #### 自動接續
183
+ #### Auto-continue
210
184
 
211
- `SessionStart` hook 在開新 session、resume、`/compact`、`/fork` 時,注入最後一個 Checkpoint(若有)、`## Kept 索引`(若有,不是具名檔內容)加上最近兩輪的 Summary / Handoff / Status,不是整份檔。`/clear` 是真的清空,不注入;要接續請 `/devlog-tracker:continue`(先核對「工作區」再做下一步)。細節見 [`docs/design/continue.md`](docs/design/continue.md)。
185
+ The `SessionStart` hook, on new session / resume / `/compact` / `/fork`, first injects the branch-scoped `.devlog/handoff.md` snapshot when non-empty, then the last Checkpoint (if any — including its `### 待解問題` section for open blockers), the `## Kept index` (if any — not the named files' content), plus the last two rounds' Summary / Handoff / Status — not the whole file. Stop overwrites the handoff file on `IN_PROGRESS`/`BLOCKED` closes and deletes it on `DONE`. `/clear` truly clears everything and injects nothing; to continue, use `/devlog-tracker:continue` (which checks "Workspace" first, then proceeds). See [`docs/design/continue.md`](docs/design/continue.md) and [`docs/design/session-handoff-file.md`](docs/design/session-handoff-file.md).
212
186
 
213
- #### 同輪工作區漂移偵測
187
+ #### Same-round workspace-drift detection
214
188
 
215
- 同一條對話送出下一則訊息時,`UserPromptSubmit` 會拿上一輪 Handoff 的「工作區」跟目前 git 狀態比對;不符就注入提示,並讓 `PreToolUse` 擋住非 devlog 工具,直到這一輪補上含實際快照的 `### 段落`(唯讀的 `git status`/`diff`/`log`/`show`/`rev-parse` 不受影響,方便自行核對)。Span 安靜 tick、task-notification 與 `DONE` 不擋。細節見 [`docs/design/continue.md`](docs/design/continue.md) 與 [`docs/design/segment-watch.md`](docs/design/segment-watch.md)。
189
+ When the next message in the same conversation is sent, `UserPromptSubmit` compares the previous round's Handoff "Workspace" against the current git state; on a mismatch, it injects a notice and has `PreToolUse` block non-devlog tools until this round adds a `### Segment` containing an actual snapshot (read-only `git status`/`diff`/`log`/`show`/`rev-parse` are unaffected, so you can check for yourself). Quiet Span ticks, task-notifications, and `DONE` aren't blocked. See [`docs/design/continue.md`](docs/design/continue.md) and [`docs/design/segment-watch.md`](docs/design/segment-watch.md).
216
190
 
217
- #### 意外中斷
191
+ #### Unexpected interruption
218
192
 
219
- 非 usage 的 API 錯誤、SessionEnd、殘留的 `.round-open` 會把開著的 Round 標成 `INTERRUPTED`。usage 用光不算中斷。中途取消(例如 Esc)通常是在**下一則訊息**或**下次 SessionStart(startup / resume / clear / fork)**才補上;`PostToolUseFailure` 的 `is_interrupt` 若有觸發,只是 best-effort,不能當成一定會立刻蓋章。`Status` 下面會多一行 `[reason: ...]` 內部代號方便之後 debug(例如 `dangling:next_prompt`);中斷當下如果是卡在等 `AskUserQuestion` 的回答,Summary/Handoff 會直接說明,不會寫成「意外」。細節見 [`docs/design/recording-moments.md`](docs/design/recording-moments.md)。
193
+ Non-usage API errors, SessionEnd, and a leftover `.round-open` mark an open Round as `INTERRUPTED`. Running out of usage doesn't count as an interruption. A mid-task cancel (e.g. Esc) is usually only recorded on the **next message** or the **next SessionStart** (startup / resume / clear / fork); `PostToolUseFailure`'s `is_interrupt`, when it fires, is best-effort only and can't be relied on to stamp this immediately. A `[reason: ...]` internal code is appended below `Status` for later debugging (e.g. `dangling:next_prompt`); if the interruption happened while waiting on an `AskUserQuestion` answer, Summary/Handoff will say so directly rather than being recorded as an "unexpected" interruption. See [`docs/design/recording-moments.md`](docs/design/recording-moments.md).
220
194
 
221
- #### 段落記錄
195
+ #### Segment recording
222
196
 
223
- 長輪不要憋到最後,邊做邊寫 `### 段落`。同一輪連續約 10 分鐘沒改 `.round-current.md`,`PreToolUse` hook 會擋住下一個工具;先 Read 再 Edit/StrReplace 追加一段(不要 Write 覆寫整檔)。門檻可用 `/devlog-tracker:segment-watch <時間長度>` 調整。Claude Code subagent/dynamic workflow(PreToolUse 帶 `agent_id`)不套用父輪這道閥。細節見 [`docs/design/segment-watch.md`](docs/design/segment-watch.md)。
197
+ Don't hold a long round until the very end — write `### Segment` entries as you go. If `.round-current.md` hasn't been touched for about 10 minutes within the same round, the `PreToolUse` hook blocks the next tool call; Read first, then Edit/StrReplace to append a segment (don't Write over the whole file). The threshold is adjustable with `/devlog-tracker:segment-watch <duration>`. Claude Code subagents/dynamic workflows (`PreToolUse` carrying `agent_id`) don't apply this gate from the parent round. See [`docs/design/segment-watch.md`](docs/design/segment-watch.md).
224
198
 
225
199
  #### Checkpoint Mode
226
200
 
227
- 累積約 20 輪沒寫跨輪摘要,`Stop` hook 會要求補一段 `## Checkpoint`(門檻可調)。細節見 [`docs/design/checkpoint-mode.md`](docs/design/checkpoint-mode.md)。
201
+ After roughly 20 rounds without a cross-round summary, the `Stop` hook requires a new `## Checkpoint(Round X-Y)` block (threshold adjustable). Content is structured, not free prose — three subsections under the heading:
202
+
203
+ - **`### 決策`** — decisions made in that stretch
204
+ - **`### 待解問題`** — still-open blockers (primary handoff cue for the next session)
205
+ - **`### 失敗嘗試`** — approaches tried and abandoned, so the next agent doesn't repeat them
206
+
207
+ Hook detection is unchanged (only the `## Checkpoint` heading is verified, not subsection quality). Authoring rules: [`skills/devlog-tracker/references/checkpoint-mode.md`](skills/devlog-tracker/references/checkpoint-mode.md); design: [`docs/design/checkpoint-mode.md`](docs/design/checkpoint-mode.md).
228
208
 
229
209
  #### Span Mode
230
210
 
231
- `/loop`、Workflow 這類自動續接的長任務,不必每個 tick 都寫完整 Round,用 tick 計數當安全閥;崩潰最多漏記固定數量的 tick,不是整段。細節見 [`docs/design/span-mode.md`](docs/design/span-mode.md)。
211
+ Long-running auto-continuing tasks (`/loop`, Workflow) don't need a full Round on every tick; a tick counter acts as the safety valve, so a crash loses at most a fixed number of ticks, not the whole span. See [`docs/design/span-mode.md`](docs/design/span-mode.md).
232
212
 
233
213
  #### Reply Fold
234
214
 
235
- Claude 用純文字結尾提出問題、下一則訊息才拿到答案時,不用開新 Round——提問前先手動記一段問題原文再跑 `await-open.sh` 標記,下一則訊息(答案)就會自動折進同一個 Round 當一段 `### 段落`,不是拆成兩個不相關的 Round。連續多輪一問一答(例如 grilling)時,中途每題只記問題段落,不必每題重寫 Summary/Reply/Handoff/Status,等整場問答真正結束才收尾一次。`AskUserQuestion` 在同一 turn 內問答,不用 fold,但仍要用 `### 段落(AskUserQuestion)` 記下問題與答案。背景 task-notification(子 agent 完成通知)也會自動走同一套折疊機制,不留原始 XML,只記精簡摘要。細節見 [`docs/design/reply-fold.md`](docs/design/reply-fold.md)。
215
+ When Claude ends a turn with a plain-text question and the next message is the answer, there's no need to open a new Round — record the question text manually first, run `await-open.sh` to mark it, and the next message (the answer) automatically folds into the same Round as a `### Segment`, instead of splitting into two unrelated Rounds. During a long back-and-forth (e.g. grilling), only the question is logged per turn mid-way; Summary/Reply/Handoff/Status don't need to be rewritten every turn — wrap up once when the whole Q&A actually ends. `AskUserQuestion` asks and answers within the same turn, so it doesn't need folding, but still records the question and answer in a `### Segment (AskUserQuestion)`. Background task-notifications (subagent completion notices) also go through this same folding mechanism automatically, keeping only a condensed summary rather than the raw XML. See [`docs/design/reply-fold.md`](docs/design/reply-fold.md).
236
216
 
237
- #### 分支各自的 devlog 檔
217
+ #### Per-branch devlog files
238
218
 
239
- 同一個工作目錄裡切換分支時,主檔會依目前 checkout 的分支自動分開:`main`/`master` 繼續用 `.devlog/devlog.md`,其他分支各自用 `.devlog/devlog.<branch>.md`(斜線轉成 `-`)。另開一個 `git worktree`(不同目錄)本來就有自己獨立的 `.devlog/`,不受這個機制影響。第一次在某分支偵測到還沒有專屬檔案、且 `devlog.md` 已有內容時,會把它改名(非複製)成該分支的檔案。細節見 [`docs/design/branch-scoped-devlog.md`](docs/design/branch-scoped-devlog.md)。
219
+ Switching branches within the same working directory automatically splits the main file by the checked-out branch: `main`/`master` keeps using `.devlog/devlog.md`, while other branches each use `.devlog/devlog.<branch>.md` (slashes converted to `-`). A separate `git worktree` (a different directory) already has its own independent `.devlog/` and is unaffected by this mechanism. The first time a branch is detected without its own file while `devlog.md` already has content, it gets renamed (not copied) into that branch's file. See [`docs/design/branch-scoped-devlog.md`](docs/design/branch-scoped-devlog.md).
240
220
 
241
- #### Lessons Mode(預設關閉,不自動)
221
+ #### Lessons Mode (off by default, not automatic)
242
222
 
243
- 開著時,Status 從 `BLOCKED` 解開、明顯繞路,或工作區漂移累積達門檻(預設 3 次,`/devlog-tracker:lessons-drift <次數>` 可調)才考慮記一筆開發歷程教訓,per-topic 存成 `devlog.lessons.<topic>.md`,`devlog.md` 只留標題索引。三種訊號都完全不 hook 強制寫入本身、不是知識庫(架構決策仍在 `docs/design/*.md`)。細節見 [`docs/design/lessons-mode.md`](docs/design/lessons-mode.md)。
223
+ When enabled, a development-lesson entry is only considered when a `BLOCKED` status resolves, an obvious detour happens, or workspace drift accumulates to a threshold (default 3, adjustable via `/devlog-tracker:lessons-drift <count>`); it's stored per-topic as `devlog.lessons.<topic>.md`, with `devlog.md` keeping only a heading index. None of the three signals are enforced by a hook themselves, and this isn't a knowledge base (architectural decisions still live in `docs/design/*.md`). See [`docs/design/lessons-mode.md`](docs/design/lessons-mode.md).
244
224
 
245
- ## 測試
225
+ ## Tests
246
226
 
247
227
  ```
248
- bash hooks/scripts/run-tests.sh
228
+ bash core/scripts/run-tests.sh
249
229
  ```
250
230
 
251
- 含 Cursor adapter。
231
+ Includes the Cursor adapter.
252
232
 
253
233
  ## License
254
234