Skip to content

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Jan 16, 2026

No description provided.

This commit introduces a comprehensive hook wrapper system that allows
writing hooks once in Python and running them on both Claude Code and
Gemini CLI platforms.

Changes:

Documentation (doc/platform/):
- Add README explaining platform documentation purpose
- Add Claude Code hooks reference with input/output schemas
- Add Gemini CLI hooks reference with input/output schemas
- Add learnings files for capturing platform-specific behaviors

Hook Wrapper System (src/deepwork/hooks/):
- Add wrapper.py with cross-platform input/output normalization
- Add claude_hook.sh shell wrapper for Claude Code
- Add gemini_hook.sh shell wrapper for Gemini CLI
- Add policy_check.py as cross-platform policy evaluation hook
- Add README with usage documentation
- Update __init__.py with exports and documentation

Testing:
- Add test_hook_wrapper.py with 35 unit tests for normalization
- Add test_hook_wrappers.py with 11 integration tests for shell scripts
- All 304 tests pass

The wrapper system normalizes:
- Event names (Stop/AfterAgent -> after_agent)
- Tool names (Write/write_file -> write_file)
- Decision values (block -> deny for Gemini)
- JSON structure differences between platforms
Version bump:
- 0.1.1 -> 0.2.0 (new feature: cross-platform hook wrapper system)

Documentation updates:
- README.md: Add hooks directory to project structure, remove outdated test counts
- doc/architecture.md: Add cross-platform hook wrapper architecture section
  with ASCII diagram and usage examples
- CHANGELOG.md: Add 0.2.0 release notes with new features
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.

3 participants