From bb9f73ddaa337eecbb0758ddf430e11dc8ad9f55 Mon Sep 17 00:00:00 2001 From: alexsoyes Date: Thu, 5 Nov 2026 14:14:55 +0800 Subject: [PATCH 1/3] fix(framework): name lifecycle hooks --- plugins/aidd-context/hooks/hooks.json | 3 ++- .../skills/08-hook-generate/actions/02-write-hook.md | 2 ++ .../skills/08-hook-generate/actions/03-validate.md | 2 ++ .../skills/08-hook-generate/references/tool-paths.md | 2 ++ plugins/aidd-telemetry/hooks/hooks.json | 3 +++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/aidd-context/hooks/hooks.json b/plugins/aidd-context/hooks/hooks.json index 76b2fb90b..bf03b4c98 100644 --- a/plugins/aidd-context/hooks/hooks.json +++ b/plugins/aidd-context/hooks/hooks.json @@ -5,7 +5,8 @@ "hooks": [ { "type": "command", - "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/update_memory.js" + "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/update_memory.js", + "statusMessage": "AIDD Context: sync project memory" } ] } diff --git a/plugins/aidd-context/skills/08-hook-generate/actions/02-write-hook.md b/plugins/aidd-context/skills/08-hook-generate/actions/02-write-hook.md index fbddc89c1..62160d417 100644 --- a/plugins/aidd-context/skills/08-hook-generate/actions/02-write-hook.md +++ b/plugins/aidd-context/skills/08-hook-generate/actions/02-write-hook.md @@ -15,6 +15,7 @@ The updated target file per tool, any script written, and the list of paths touc 1. **Script.** If the action needs a backing script ([hook-authoring.md](../references/hook-authoring.md)): copy [hook-script-template.sh](../assets/hook-script-template.sh), fill the logic, place it in the scope's script directory ([tool-paths.md](../references/tool-paths.md)), and make it executable. One script can back every tool. 2. **Entry.** Per confirmed tool, fill [hook-template.json](../assets/hook-template.json) from [tool-paths.md](../references/tool-paths.md), using that tool's shape and stripping the scaffold. - Point the handler at the script by absolute path or an approved `${VAR}`. + - For each Claude Code or Codex handler, including shared plugin hooks, add a concise, nonempty `statusMessage` describing its action. Codex also uses it to identify the hook during review. Do not add this field to other tool formats without confirmed support. 3. **Merge.** For each tool, read the target file and append the entry to the moment's list under the right key for the scope ([tool-paths.md](../references/tool-paths.md)). Preserve every sibling, never overwrite. 4. **Validate.** Run the merge check and write-target validation ([tool-paths.md](../references/tool-paths.md)). @@ -23,3 +24,4 @@ The updated target file per tool, any script written, and the list of paths touc - Each target file is valid after the merge. - The new entry is present in each, and every prior sibling survives. - A script-backed handler's script exists at its path and is executable. +- Each new Claude Code or Codex handler has a nonempty, action-specific `statusMessage`. diff --git a/plugins/aidd-context/skills/08-hook-generate/actions/03-validate.md b/plugins/aidd-context/skills/08-hook-generate/actions/03-validate.md index ac660ec00..c188d5aab 100644 --- a/plugins/aidd-context/skills/08-hook-generate/actions/03-validate.md +++ b/plugins/aidd-context/skills/08-hook-generate/actions/03-validate.md @@ -16,8 +16,10 @@ A short pass or fail line per tool, plus the script. 2. **Moment.** Confirm the event name is the right one for that tool's moment, and the matcher is well-formed ([tool-paths.md](../references/tool-paths.md)). 3. **Blocking.** If the hook blocks, confirm the moment can block on that tool ([tool-paths.md](../references/tool-paths.md)). 4. **Script.** For a script-backed handler, confirm the script exists, is executable, and reads stdin and signals per the contract. +5. **Name.** Confirm each new Claude Code or Codex handler, including shared plugin hooks, has a nonempty `statusMessage` describing its action. ## Test - Each target file parses with the entry under the correct key. - Each event name matches the tool's moment, and any blocking hook sits on a moment that can block. +- Each new Claude Code or Codex handler has a nonempty, action-specific `statusMessage`. diff --git a/plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md b/plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md index 9de4db3db..b2a046a58 100644 --- a/plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md +++ b/plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md @@ -44,6 +44,8 @@ Each tool exposes more moments than these. For the full list, read the tool's do A Claude `settings.json` and a plugin or standalone `hooks/hooks.json` both wrap the event map under a top-level `hooks` key, so the file is `{ "hooks": { "": [ ... ] } }`. A Codex `config.toml` uses a `[hooks]` table instead. +Set `statusMessage` on each Claude Code or Codex handler, including shared plugin hooks. It describes the action while the hook runs, and Codex uses it as the review-list title. Use a concise, specific message. This field is not documented for Cursor or Copilot hooks; omit it from their own formats unless confirmed. Sources read 2026-11-05: [Claude Code hooks](https://code.claude.com/docs/en/hooks), [Codex hooks](https://learn.chatgpt.com/docs/hooks), [Cursor hooks](https://cursor.com/docs/hooks), [Copilot hooks](https://docs.github.com/en/copilot/reference/hooks-reference). + ## Scopes per tool Ask the user which scope, then write the matching file. A `-` means the tool has no such scope. diff --git a/plugins/aidd-telemetry/hooks/hooks.json b/plugins/aidd-telemetry/hooks/hooks.json index c2554092e..9e8c7f266 100644 --- a/plugins/aidd-telemetry/hooks/hooks.json +++ b/plugins/aidd-telemetry/hooks/hooks.json @@ -6,6 +6,7 @@ { "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/session-start.cjs", + "statusMessage": "AIDD Telemetry: carry session task", "timeout": 10 } ] @@ -15,6 +16,7 @@ { "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/catch-up.cjs", + "statusMessage": "AIDD Telemetry: update measurement ledger", "async": true, "timeout": 120 } @@ -27,6 +29,7 @@ { "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/prompt-gate.cjs", + "statusMessage": "AIDD Telemetry: check task declaration", "timeout": 30 } ] From 59ab0979fe1a96073028f7ba73d36697272e367b Mon Sep 17 00:00:00 2001 From: alexsoyes Date: Thu, 5 Nov 2026 14:18:57 +0800 Subject: [PATCH 2/3] fix(telemetry): clarify the Claude session hook --- plugins/aidd-telemetry/hooks/hooks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/aidd-telemetry/hooks/hooks.json b/plugins/aidd-telemetry/hooks/hooks.json index 9e8c7f266..2e1e9144e 100644 --- a/plugins/aidd-telemetry/hooks/hooks.json +++ b/plugins/aidd-telemetry/hooks/hooks.json @@ -6,7 +6,7 @@ { "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/session-start.cjs", - "statusMessage": "AIDD Telemetry: carry session task", + "statusMessage": "AIDD Telemetry: carry Claude session task", "timeout": 10 } ] From 455991e70f78c4c29a13fab47ff4d69fb1f77519 Mon Sep 17 00:00:00 2001 From: alexsoyes Date: Fri, 6 Nov 2026 07:52:35 +0800 Subject: [PATCH 3/3] docs(aidd-context): clarify generated hook scope --- .../skills/08-hook-generate/actions/02-write-hook.md | 2 +- .../aidd-context/skills/08-hook-generate/actions/03-validate.md | 2 +- .../skills/08-hook-generate/references/tool-paths.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/aidd-context/skills/08-hook-generate/actions/02-write-hook.md b/plugins/aidd-context/skills/08-hook-generate/actions/02-write-hook.md index 62160d417..f506b6f48 100644 --- a/plugins/aidd-context/skills/08-hook-generate/actions/02-write-hook.md +++ b/plugins/aidd-context/skills/08-hook-generate/actions/02-write-hook.md @@ -15,7 +15,7 @@ The updated target file per tool, any script written, and the list of paths touc 1. **Script.** If the action needs a backing script ([hook-authoring.md](../references/hook-authoring.md)): copy [hook-script-template.sh](../assets/hook-script-template.sh), fill the logic, place it in the scope's script directory ([tool-paths.md](../references/tool-paths.md)), and make it executable. One script can back every tool. 2. **Entry.** Per confirmed tool, fill [hook-template.json](../assets/hook-template.json) from [tool-paths.md](../references/tool-paths.md), using that tool's shape and stripping the scaffold. - Point the handler at the script by absolute path or an approved `${VAR}`. - - For each Claude Code or Codex handler, including shared plugin hooks, add a concise, nonempty `statusMessage` describing its action. Codex also uses it to identify the hook during review. Do not add this field to other tool formats without confirmed support. + - For each Claude Code or Codex handler, add a concise, nonempty `statusMessage` describing its action. Codex also uses it to identify the hook during review. Do not add this field to other tool formats without confirmed support. 3. **Merge.** For each tool, read the target file and append the entry to the moment's list under the right key for the scope ([tool-paths.md](../references/tool-paths.md)). Preserve every sibling, never overwrite. 4. **Validate.** Run the merge check and write-target validation ([tool-paths.md](../references/tool-paths.md)). diff --git a/plugins/aidd-context/skills/08-hook-generate/actions/03-validate.md b/plugins/aidd-context/skills/08-hook-generate/actions/03-validate.md index c188d5aab..156371eb6 100644 --- a/plugins/aidd-context/skills/08-hook-generate/actions/03-validate.md +++ b/plugins/aidd-context/skills/08-hook-generate/actions/03-validate.md @@ -16,7 +16,7 @@ A short pass or fail line per tool, plus the script. 2. **Moment.** Confirm the event name is the right one for that tool's moment, and the matcher is well-formed ([tool-paths.md](../references/tool-paths.md)). 3. **Blocking.** If the hook blocks, confirm the moment can block on that tool ([tool-paths.md](../references/tool-paths.md)). 4. **Script.** For a script-backed handler, confirm the script exists, is executable, and reads stdin and signals per the contract. -5. **Name.** Confirm each new Claude Code or Codex handler, including shared plugin hooks, has a nonempty `statusMessage` describing its action. +5. **Name.** Confirm each new Claude Code or Codex handler has a nonempty `statusMessage` describing its action. ## Test diff --git a/plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md b/plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md index b2a046a58..f74d8f8d6 100644 --- a/plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md +++ b/plugins/aidd-context/skills/08-hook-generate/references/tool-paths.md @@ -44,7 +44,7 @@ Each tool exposes more moments than these. For the full list, read the tool's do A Claude `settings.json` and a plugin or standalone `hooks/hooks.json` both wrap the event map under a top-level `hooks` key, so the file is `{ "hooks": { "": [ ... ] } }`. A Codex `config.toml` uses a `[hooks]` table instead. -Set `statusMessage` on each Claude Code or Codex handler, including shared plugin hooks. It describes the action while the hook runs, and Codex uses it as the review-list title. Use a concise, specific message. This field is not documented for Cursor or Copilot hooks; omit it from their own formats unless confirmed. Sources read 2026-11-05: [Claude Code hooks](https://code.claude.com/docs/en/hooks), [Codex hooks](https://learn.chatgpt.com/docs/hooks), [Cursor hooks](https://cursor.com/docs/hooks), [Copilot hooks](https://docs.github.com/en/copilot/reference/hooks-reference). +Set `statusMessage` on each Claude Code or Codex handler. It describes the action while the hook runs, and Codex uses it as the review-list title. Use a concise, specific message. This field is not documented for Cursor or Copilot hooks; omit it from their own formats unless confirmed. Sources: [Claude Code hooks](https://code.claude.com/docs/en/hooks), [Codex hooks](https://learn.chatgpt.com/docs/hooks), [Cursor hooks](https://cursor.com/docs/hooks), [Copilot hooks](https://docs.github.com/en/copilot/reference/hooks-reference). ## Scopes per tool