From 4d46ef03e50d76ab88319b9817a4bee6981cf5a1 Mon Sep 17 00:00:00 2001 From: pot-ai-to Date: Fri, 2 Jan 2026 17:28:55 +0000 Subject: [PATCH] refactor(kai-history-system): reorganize pack to match v2.0 standard structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move hook files from src/ to src/hooks/ directory - Move config from root config/ to src/config/ directory - Move lib files to src/hooks/lib/ for proper organization - Update README.md file paths to reflect new structure - Update INSTALL.md copy commands for new file locations - Maintain all import paths and functionality - Ensure compatibility with kai-hook-system pack This reorganization aligns kai-history-system with the PAI Pack Template v2.0 specification which requires all source code in src/ subdirectories. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- Packs/kai-history-system/INSTALL.md | 12 ++++++------ Packs/kai-history-system/README.md | 12 ++++++------ .../{ => src}/config/settings-hooks.json | 0 .../src/{ => hooks}/capture-all-events.ts | 0 .../src/{ => hooks}/capture-session-summary.ts | 0 .../src/{ => hooks}/lib/metadata-extraction.ts | 0 .../kai-history-system/src/{ => hooks}/stop-hook.ts | 0 .../src/{ => hooks}/subagent-stop-hook.ts | 0 8 files changed, 12 insertions(+), 12 deletions(-) rename Packs/kai-history-system/{ => src}/config/settings-hooks.json (100%) rename Packs/kai-history-system/src/{ => hooks}/capture-all-events.ts (100%) rename Packs/kai-history-system/src/{ => hooks}/capture-session-summary.ts (100%) rename Packs/kai-history-system/src/{ => hooks}/lib/metadata-extraction.ts (100%) rename Packs/kai-history-system/src/{ => hooks}/stop-hook.ts (100%) rename Packs/kai-history-system/src/{ => hooks}/subagent-stop-hook.ts (100%) diff --git a/Packs/kai-history-system/INSTALL.md b/Packs/kai-history-system/INSTALL.md index ffbd09aead..8f11064e99 100644 --- a/Packs/kai-history-system/INSTALL.md +++ b/Packs/kai-history-system/INSTALL.md @@ -103,13 +103,13 @@ Copy all TypeScript files from this pack's `src/` directory to your hooks direct ```bash # Copy hook files -cp src/capture-all-events.ts $PAI_DIR/hooks/ -cp src/stop-hook.ts $PAI_DIR/hooks/ -cp src/subagent-stop-hook.ts $PAI_DIR/hooks/ -cp src/capture-session-summary.ts $PAI_DIR/hooks/ +cp src/hooks/capture-all-events.ts $PAI_DIR/hooks/ +cp src/hooks/stop-hook.ts $PAI_DIR/hooks/ +cp src/hooks/subagent-stop-hook.ts $PAI_DIR/hooks/ +cp src/hooks/capture-session-summary.ts $PAI_DIR/hooks/ # Copy library files -cp src/lib/metadata-extraction.ts $PAI_DIR/hooks/lib/ +cp src/hooks/lib/metadata-extraction.ts $PAI_DIR/hooks/lib/ # Verify all files are in place ls -la $PAI_DIR/hooks/*.ts @@ -120,7 +120,7 @@ ls -la $PAI_DIR/hooks/lib/*.ts ## Step 3: Register Hooks in settings.json -Merge the hook configuration from `config/settings-hooks.json` into your `~/.claude/settings.json`. +Merge the hook configuration from `src/config/settings-hooks.json` into your `~/.claude/settings.json`. **For existing installations:** Add the history hooks alongside your existing hooks in `~/.claude/settings.json`. diff --git a/Packs/kai-history-system/README.md b/Packs/kai-history-system/README.md index 44f56a70b2..d99d899633 100644 --- a/Packs/kai-history-system/README.md +++ b/Packs/kai-history-system/README.md @@ -24,12 +24,12 @@ keywords: [history, documentation, memory, capture, hooks, sessions, learnings, | Component | File | Purpose | |-----------|------|---------| -| Universal event capture | `src/capture-all-events.ts` | Log all events to JSONL for audit trail | -| Stop hook | `src/stop-hook.ts` | Capture main agent completions and learnings | -| Subagent stop hook | `src/subagent-stop-hook.ts` | Route subagent outputs by type | -| Session summary | `src/capture-session-summary.ts` | Summarize sessions at close | -| Metadata extraction lib | `src/lib/metadata-extraction.ts` | Extract agent instance metadata | -| Hook config | `config/settings-hooks.json` | Claude Code hook registration template | +| Universal event capture | `src/hooks/capture-all-events.ts` | Log all events to JSONL for audit trail | +| Stop hook | `src/hooks/stop-hook.ts` | Capture main agent completions and learnings | +| Subagent stop hook | `src/hooks/subagent-stop-hook.ts` | Route subagent outputs by type | +| Session summary | `src/hooks/capture-session-summary.ts` | Summarize sessions at close | +| Metadata extraction lib | `src/hooks/lib/metadata-extraction.ts` | Extract agent instance metadata | +| Hook config | `src/config/settings-hooks.json` | Claude Code hook registration template | **Summary:** - **Files created:** 6 + history directory structure diff --git a/Packs/kai-history-system/config/settings-hooks.json b/Packs/kai-history-system/src/config/settings-hooks.json similarity index 100% rename from Packs/kai-history-system/config/settings-hooks.json rename to Packs/kai-history-system/src/config/settings-hooks.json diff --git a/Packs/kai-history-system/src/capture-all-events.ts b/Packs/kai-history-system/src/hooks/capture-all-events.ts similarity index 100% rename from Packs/kai-history-system/src/capture-all-events.ts rename to Packs/kai-history-system/src/hooks/capture-all-events.ts diff --git a/Packs/kai-history-system/src/capture-session-summary.ts b/Packs/kai-history-system/src/hooks/capture-session-summary.ts similarity index 100% rename from Packs/kai-history-system/src/capture-session-summary.ts rename to Packs/kai-history-system/src/hooks/capture-session-summary.ts diff --git a/Packs/kai-history-system/src/lib/metadata-extraction.ts b/Packs/kai-history-system/src/hooks/lib/metadata-extraction.ts similarity index 100% rename from Packs/kai-history-system/src/lib/metadata-extraction.ts rename to Packs/kai-history-system/src/hooks/lib/metadata-extraction.ts diff --git a/Packs/kai-history-system/src/stop-hook.ts b/Packs/kai-history-system/src/hooks/stop-hook.ts similarity index 100% rename from Packs/kai-history-system/src/stop-hook.ts rename to Packs/kai-history-system/src/hooks/stop-hook.ts diff --git a/Packs/kai-history-system/src/subagent-stop-hook.ts b/Packs/kai-history-system/src/hooks/subagent-stop-hook.ts similarity index 100% rename from Packs/kai-history-system/src/subagent-stop-hook.ts rename to Packs/kai-history-system/src/hooks/subagent-stop-hook.ts