Skip to content

feat(git-pilot)!: redesign hook output and behavioral contract#8

Merged
moukrea merged 3 commits into
mainfrom
feat/git-pilot-v3-hook-redesign
Feb 27, 2026
Merged

feat(git-pilot)!: redesign hook output and behavioral contract#8
moukrea merged 3 commits into
mainfrom
feat/git-pilot-v3-hook-redesign

Conversation

@moukrea
Copy link
Copy Markdown
Owner

@moukrea moukrea commented Feb 27, 2026

Summary

  • Switch all hooks from systemMessage to additionalContext — hooks now provide facts that Claude reasons about, instead of user-facing warnings that never reached Claude's context
  • Consolidate behavioral contract into CLAUDE.md — removed duplicated rules from workflow skill, added Rule 10 hook-response map that maps every hook context pattern to the correct Claude action
  • Simplify all hook output — session-stop reduced from 50+ lines (full commit dumps) to max 5 concise fact lines; all hooks now emit single-line [git-pilot] prefixed facts
  • Add 94 bats tests — full test coverage for session-start (24), session-stop (21), post-bash (15), post-write (14), and prompt-context (20)
  • Bump version to 3.0.0 (breaking: output field rename, rule renumbering, skill simplification)
  • Remove TECHNICAL-SPEC.md — implementation complete, spec no longer needed in repo

Breaking Changes

  • Hook output field changed from systemMessage to additionalContext across session-start, session-stop, post-bash, post-write, and prompt-context hooks
  • CLAUDE.md rules renumbered: old Rule 1 (hook compliance) removed and absorbed into new "How hooks work" intro + Rule 10
  • git-pilot-workflow SKILL.md reduced to a lightweight CLAUDE.md reference (no longer contains behavioral rules)

Test plan

  • 94 new bats tests all pass
  • bash -n syntax check passes for all scripts
  • No hook output contains anti-pattern strings (AskUserQuestion, You MUST, STOP and, Do not proceed, Execute this command immediately)
  • All hooks use additionalContext exclusively (no systemMessage)
  • 174/178 total tests pass (4 pre-existing failures unrelated to changes)

BREAKING CHANGE: hook output field changed from systemMessage to
additionalContext across all hooks. CLAUDE.md rules renumbered (old
Rule 1 removed, new Rule 10 added). git-pilot-workflow SKILL.md no
longer contains behavioral rules.
@moukrea moukrea merged commit 9f0310c into main Feb 27, 2026
1 check passed
@moukrea moukrea deleted the feat/git-pilot-v3-hook-redesign branch February 27, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant