From cc6c321b5781890306ebad82c2a47f72483766a8 Mon Sep 17 00:00:00 2001 From: vitya Date: Sun, 24 May 2026 23:36:04 +0300 Subject: [PATCH] feat(session-handoff): add PostToolUse commit-detector hook [v0.3.0] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hooks live in skills/session-handoff/hooks/: - commit-detector.ps1 Windows/PowerShell - commit-detector.sh POSIX (python3 for JSON parsing) - README.md opt-in instructions, cross-platform settings.json snippets, smoke procedure Hook reads PostToolUse stdin, detects substantive `git commit` (prefix not in meta/docs/style/chore + fix typo, AND body >200 chars OR files >3). On hit, emits hookSpecificOutput.additionalContext so Claude Code surfaces a system reminder next iteration. Silent skip on --amend, failed commits, non-git cwd, trivial prefix, below thresholds. install.sh deliberately does NOT mutate settings.json — opt-in via the README hook config snippet, applied once per machine. SKILL.md body mentions the hook as an optional alternative to the agent-side behavioral heuristic. Bump 0.2.1 -> 0.3.0 MINOR (new opt-in capability, backward-compatible — SKILL keeps working without the hook). Deferred (separate follow-ups if needed): - live-hook e2e smoke (would interfere with current session commits) - rebase/cherry-pick batch deduplication Closes [session-handoff-posttooluse-hook] (partial: stdin smoke, live-hook deferred). Co-Authored-By: Claude Opus 4.7 (1M context) --- .tasks/STATUS.md | 2 +- .tasks/session-handoff-posttooluse-hook.md | 38 ++++++++ skills/session-handoff/SKILL.md | 3 +- skills/session-handoff/hooks/README.md | 91 +++++++++++++++++++ .../session-handoff/hooks/commit-detector.ps1 | 69 ++++++++++++++ .../session-handoff/hooks/commit-detector.sh | 73 +++++++++++++++ 6 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 .tasks/session-handoff-posttooluse-hook.md create mode 100644 skills/session-handoff/hooks/README.md create mode 100644 skills/session-handoff/hooks/commit-detector.ps1 create mode 100644 skills/session-handoff/hooks/commit-detector.sh diff --git a/.tasks/STATUS.md b/.tasks/STATUS.md index 2bd6185..0f9cb64 100644 --- a/.tasks/STATUS.md +++ b/.tasks/STATUS.md @@ -1,5 +1,5 @@ # Task Board -_Updated: 2026-05-24 (session-handoff: install + bootstrap-template-extend + hermes-mapping 🟢; 3 из 7 кластера закрыто.)_ +_Updated: 2026-05-24 (session-handoff: 3 baseline 🟢, posttooluse-hook + existing-projects-upgrade → 🔴.)_