From 606dcfac12cb7bf91ed000dd5e27e25d09a80fda Mon Sep 17 00:00:00 2001 From: Ralph Chang Date: Sun, 26 Apr 2026 13:36:49 +0800 Subject: [PATCH] docs: fix hook names and prompt tags in documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix outdated hook names: prompt:before → experimental.chat.system.transform - Fix outdated hook names: tool.execute.before → (removed, file tracking is in tool.execute.after) - Fix outdated hook names: compaction:before → experimental.session.compacting - Add missing event hook documentation - Fix README example to show correct tag instead of --- AGENTS.md | 14 ++++++++------ README.md | 18 ++++++++---------- docs/architecture.md | 14 ++++++++------ 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index ab1d3e5..bcf4b25 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -261,24 +261,26 @@ export default { ## Plugin Hooks -### `prompt:before` +### `experimental.chat.system.transform` Injects workspace memory and hot session state into system prompt. -### `tool.execute.before` - -Tracks active files (read, grep, edit, write actions). - ### `tool.execute.after` +- Tracks active files (read, grep, edit, write actions) - Tracks open errors from failed commands - Clears errors when commands succeed - Ignores `exitCode === undefined` -### `compaction:before` +### `experimental.session.compacting` Extracts workspace memory candidates from conversation, applies quality gate and deduplication. +### `event` + +- `session.compacted`: Promote session decisions to workspace memory +- `session.deleted`: Clean up session state files + ## Debugging & Testing ### Manual Testing Steps diff --git a/README.md b/README.md index d8a48e5..c7c58c0 100644 --- a/README.md +++ b/README.md @@ -93,21 +93,19 @@ Automatically tracks current session context: Injected into system prompt: ``` -- [decision] Use npm cache for plugin loading... +- [decision] Use npm cache for plugin loading, not npm link +- [project] This repo uses opencode-agenthub plugin system +- [reference] Storage: ~/.local/share/opencode-working-memory/workspaces/{hash}/ ---- - -- [project] This repo uses opencode-agenthub plugin system -- [decision] Memory V2 uses three-layer architecture - - -Active Files: + +active_files: - src/plugin.ts (edit, 18x) - tests/plugin.test.ts (edit, 5x) - src/extractors.ts (grep, 3x) - -Open Errors: (none) +open_errors: +- [typecheck] TS2345: Argument of type 'string' is not assignable... + ``` ## Quality Guarantees diff --git a/docs/architecture.md b/docs/architecture.md index 46dd71c..a682039 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -207,25 +207,27 @@ Delegate task tracking to OpenCode's native features. The plugin hooks into OpenCode lifecycle events: -### `prompt:before` +### `experimental.chat.system.transform` Injects workspace memory and hot session state into system prompt. -### `tool.execute.before` - -Tracks active files (read, grep, edit, write actions). - ### `tool.execute.after` +- Tracks active files (read, grep, edit, write actions) - Tracks open errors from failed commands - Clears errors when commands succeed - Ignores `exitCode === undefined` (successful commands without explicit exit codes) -### `compaction:before` +### `experimental.session.compacting` Extracts workspace memory candidates from conversation. Applies quality gate, deduplication, and source priority. +### `event` (session.compacted, session.deleted) + +- `session.compacted`: Promote session decisions to workspace memory +- `session.deleted`: Clean up session state files + ## Quality Guarantees ### No False Positive Errors