From 3697809c11640b6bde08de431524622f32160f1e Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Sun, 5 Apr 2026 14:04:33 +0900 Subject: [PATCH] docs(hooks): update hook inventory to match current 52 hooks - Session: 23 -> 24 (add legacyPluginToast) - Tool Guard: 12 -> 14 (add bashFileReadGuard, readImageResizer, todoDescriptionOverride, webfetchRedirectGuard) - Transform: 4 -> 5 (add toolPairValidator) - Remove deleted dirs: anthropic-image-context, beast-mode-system - Add new dirs: legacy-plugin-toast, todo-description-override, tool-pair-validator, webfetch-redirect-guard --- src/hooks/AGENTS.md | 25 +++++++++++++------ .../AGENTS.md | 2 +- src/hooks/atlas/AGENTS.md | 2 +- src/hooks/claude-code-hooks/AGENTS.md | 2 +- src/hooks/keyword-detector/AGENTS.md | 2 +- src/hooks/ralph-loop/AGENTS.md | 2 +- src/hooks/rules-injector/AGENTS.md | 2 +- src/hooks/session-recovery/AGENTS.md | 2 +- .../todo-continuation-enforcer/AGENTS.md | 2 +- 9 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/hooks/AGENTS.md b/src/hooks/AGENTS.md index e7dfc4e2c..4fa832ff1 100644 --- a/src/hooks/AGENTS.md +++ b/src/hooks/AGENTS.md @@ -1,25 +1,24 @@ -# src/hooks/ — 48 Lifecycle Hooks +# src/hooks/ — 52 Lifecycle Hooks -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW -48 hooks across dedicated modules and standalone files. Three-tier composition: Core(39) + Continuation(7) + Skill(2). All hooks follow `createXXXHook(deps) → HookFunction` factory pattern. +52 hooks across dedicated modules and standalone files. Three-tier composition: Core(43) + Continuation(7) + Skill(2). All hooks follow `createXXXHook(deps) → HookFunction` factory pattern. ## HOOK TIERS -### Tier 1: Session Hooks (23) — `create-session-hooks.ts` +### Tier 1: Session Hooks (24) — `create-session-hooks.ts` ## STRUCTURE ``` hooks/ +├── agent-usage-reminder/ # Reminds about available agents ├── atlas/ # Main orchestration (757 lines) ├── anthropic-context-window-limit-recovery/ # Auto-summarize ├── anthropic-effort/ # Reasoning effort level adjustment -├── anthropic-image-context/ # Image context handling for Anthropic ├── auto-slash-command/ # Detects /command patterns ├── auto-update-checker/ # Plugin update check ├── background-notification/ # OS notification -├── beast-mode-system/ # Beast mode system prompt injection ├── category-skill-reminder/ # Reminds of category skills ├── claude-code-hooks/ # settings.json compat layer ├── comment-checker/ # Prevents AI slop @@ -34,6 +33,7 @@ hooks/ ├── interactive-bash-session/ # Tmux session management ├── json-error-recovery/ # JSON parse error correction ├── keyword-detector/ # ultrawork/search/analyze modes +├── legacy-plugin-toast/ # Legacy plugin name migration toast ├── model-fallback/ # Provider-level model fallback ├── no-hephaestus-non-gpt/ # Block Hephaestus from non-GPT ├── no-sisyphus-gpt/ # Block Sisyphus from GPT @@ -54,7 +54,10 @@ hooks/ ├── think-mode/ # Dynamic thinking budget ├── thinking-block-validator/ # Ensures valid ├── todo-continuation-enforcer/ # Force TODO completion +├── todo-description-override/ # Override todo descriptions +├── tool-pair-validator/ # Validate tool pair usage ├── unstable-agent-babysitter/ # Monitor unstable agent behavior +├── webfetch-redirect-guard/ # Guard webfetch redirect behavior ├── write-existing-file-guard/ # Require Read before Write └── index.ts # Hook aggregation + registration ``` @@ -84,8 +87,9 @@ hooks/ | noSisyphusGpt | chat.message | Block Sisyphus from using GPT models (toast warning) | | noHephaestusNonGpt | chat.message | Block Hephaestus from using non-GPT models | | runtimeFallback | event | Auto-switch models on API provider errors | +| legacyPluginToast | chat.message | Show toast when legacy plugin name detected | -### Tier 2: Tool Guard Hooks (12) — `create-tool-guard-hooks.ts` +### Tier 2: Tool Guard Hooks (14) — `create-tool-guard-hooks.ts` | Hook | Event | Purpose | |------|-------|---------| @@ -97,10 +101,14 @@ hooks/ | rulesInjector | tool.execute.before | Conditional rules injection (AGENTS.md, config) | | tasksTodowriteDisabler | tool.execute.before | Disable TodoWrite when task system active | | writeExistingFileGuard | tool.execute.before | Require Read before Write on existing files | +| bashFileReadGuard | tool.execute.before | Guard bash commands that read files | +| readImageResizer | tool.execute.after | Resize large images for context efficiency | +| todoDescriptionOverride | tool.execute.before | Override todo item descriptions | +| webfetchRedirectGuard | tool.execute.before | Guard webfetch redirect behavior | | hashlineReadEnhancer | tool.execute.after | Enhance Read output with line hashes | | jsonErrorRecovery | tool.execute.after | Detect JSON parse errors, inject correction reminder | -### Tier 3: Transform Hooks (4) — `create-transform-hooks.ts` +### Tier 3: Transform Hooks (5) — `create-transform-hooks.ts` | Hook | Event | Purpose | |------|-------|---------| @@ -108,6 +116,7 @@ hooks/ | keywordDetector | messages.transform | Detect ultrawork/search/analyze modes | | contextInjectorMessagesTransform | messages.transform | Inject AGENTS.md/README.md into context | | thinkingBlockValidator | messages.transform | Validate thinking block structure | +| toolPairValidator | messages.transform | Validate tool call/result pairs | ### Tier 4: Continuation Hooks (7) — `create-continuation-hooks.ts` diff --git a/src/hooks/anthropic-context-window-limit-recovery/AGENTS.md b/src/hooks/anthropic-context-window-limit-recovery/AGENTS.md index e0dbdf693..d2dcffd41 100644 --- a/src/hooks/anthropic-context-window-limit-recovery/AGENTS.md +++ b/src/hooks/anthropic-context-window-limit-recovery/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/anthropic-context-window-limit-recovery/ — Multi-Strategy Context Recovery -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW diff --git a/src/hooks/atlas/AGENTS.md b/src/hooks/atlas/AGENTS.md index ef1efe739..06ee3fa3a 100644 --- a/src/hooks/atlas/AGENTS.md +++ b/src/hooks/atlas/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/atlas/ — Master Boulder Orchestrator -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW diff --git a/src/hooks/claude-code-hooks/AGENTS.md b/src/hooks/claude-code-hooks/AGENTS.md index b1870b88b..735aca5eb 100644 --- a/src/hooks/claude-code-hooks/AGENTS.md +++ b/src/hooks/claude-code-hooks/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/claude-code-hooks/ — Claude Code Compatibility -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW diff --git a/src/hooks/keyword-detector/AGENTS.md b/src/hooks/keyword-detector/AGENTS.md index 8477df502..2f9fc2f88 100644 --- a/src/hooks/keyword-detector/AGENTS.md +++ b/src/hooks/keyword-detector/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/keyword-detector/ — Mode Keyword Injection -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW diff --git a/src/hooks/ralph-loop/AGENTS.md b/src/hooks/ralph-loop/AGENTS.md index 679e6a578..ef51288b9 100644 --- a/src/hooks/ralph-loop/AGENTS.md +++ b/src/hooks/ralph-loop/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/ralph-loop/ — Self-Referential Dev Loop -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW diff --git a/src/hooks/rules-injector/AGENTS.md b/src/hooks/rules-injector/AGENTS.md index a1c3b71ae..720464973 100644 --- a/src/hooks/rules-injector/AGENTS.md +++ b/src/hooks/rules-injector/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/rules-injector/ — Conditional Rules Injection -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW diff --git a/src/hooks/session-recovery/AGENTS.md b/src/hooks/session-recovery/AGENTS.md index 9c35e7871..65a747320 100644 --- a/src/hooks/session-recovery/AGENTS.md +++ b/src/hooks/session-recovery/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/session-recovery/ — Auto Session Error Recovery -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW diff --git a/src/hooks/todo-continuation-enforcer/AGENTS.md b/src/hooks/todo-continuation-enforcer/AGENTS.md index afcb5f3ac..4d45d198c 100644 --- a/src/hooks/todo-continuation-enforcer/AGENTS.md +++ b/src/hooks/todo-continuation-enforcer/AGENTS.md @@ -1,6 +1,6 @@ # src/hooks/todo-continuation-enforcer/ — Boulder Continuation Mechanism -**Generated:** 2026-03-06 +**Generated:** 2026-04-05 ## OVERVIEW