Skip to content

Commit d954a52

Browse files
committed
Bump version to 0.2.0 and update documentation
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
1 parent 2c7ad3f commit d954a52

File tree

4 files changed

+82
-5
lines changed

4 files changed

+82
-5
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ All notable changes to DeepWork will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.2.0] - 2026-01-16
9+
10+
### Added
11+
- Cross-platform hook wrapper system for writing hooks once and running on multiple platforms
12+
- `wrapper.py`: Normalizes input/output between Claude Code and Gemini CLI
13+
- `claude_hook.sh` and `gemini_hook.sh`: Platform-specific shell wrappers
14+
- `policy_check.py`: Cross-platform policy evaluation hook
15+
- Platform documentation in `doc/platform/` with:
16+
- Claude Code hooks reference and learnings
17+
- Gemini CLI hooks reference and learnings
18+
- Event mapping, tool mapping, and decision value documentation
19+
- 46 new tests for the hook wrapper system
20+
21+
### Changed
22+
- Updated `README.md` project structure to include hooks directory
23+
- Updated `doc/architecture.md` with cross-platform hook wrapper documentation
24+
- Enhanced `src/deepwork/hooks/__init__.py` with wrapper exports and documentation
25+
826
## [0.1.2] - 2026-01-15
927

1028
### Added
@@ -49,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4967

5068
Initial version.
5169

70+
[0.2.0]: https://github.com/anthropics/deepwork/releases/tag/v0.2.0
5271
[0.1.2]: https://github.com/anthropics/deepwork/releases/tag/v0.1.2
5372
[0.1.1]: https://github.com/anthropics/deepwork/releases/tag/v0.1.1
5473
[0.1.0]: https://github.com/anthropics/deepwork/releases/tag/v0.1.0

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,18 @@ deepwork/
209209
│ │ ├── parser.py # Job definition parsing
210210
│ │ ├── detector.py # Platform detection
211211
│ │ └── generator.py # Skill file generation
212+
│ ├── hooks/ # Cross-platform hook wrappers
213+
│ │ ├── wrapper.py # Input/output normalization
214+
│ │ ├── claude_hook.sh # Claude Code adapter
215+
│ │ └── gemini_hook.sh # Gemini CLI adapter
212216
│ ├── templates/ # Jinja2 templates
213217
│ │ ├── claude/ # Claude Code templates
214218
│ │ └── gemini/ # Gemini CLI templates
215219
│ ├── schemas/ # JSON schemas
216220
│ └── utils/ # Utilities (fs, yaml, git, validation)
217221
├── tests/
218-
│ ├── unit/ # Unit tests (147 tests)
219-
│ ├── integration/ # Integration tests (19 tests)
222+
│ ├── unit/ # Unit tests
223+
│ ├── integration/ # Integration tests
220224
│ └── fixtures/ # Test fixtures
221225
└── doc/ # Documentation
222226
```

doc/architecture.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ deepwork/ # DeepWork tool repository
4848
│ │ ├── parser.py # Job definition parsing
4949
│ │ ├── policy_parser.py # Policy definition parsing
5050
│ │ └── hooks_syncer.py # Hook syncing to platforms
51-
│ ├── hooks/ # Hook evaluation modules
51+
│ ├── hooks/ # Hook system and cross-platform wrappers
5252
│ │ ├── __init__.py
53-
│ │ └── evaluate_policies.py # Policy evaluation CLI
53+
│ │ ├── wrapper.py # Cross-platform input/output normalization
54+
│ │ ├── claude_hook.sh # Shell wrapper for Claude Code
55+
│ │ ├── gemini_hook.sh # Shell wrapper for Gemini CLI
56+
│ │ ├── policy_check.py # Cross-platform policy evaluation hook
57+
│ │ └── evaluate_policies.py # Legacy policy evaluation CLI
5458
│ ├── templates/ # Command templates for each platform
5559
│ │ ├── claude/
5660
│ │ │ └── command-job-step.md.jinja
@@ -1064,6 +1068,56 @@ The hooks are installed to `.claude/settings.json` during `deepwork sync`:
10641068
}
10651069
```
10661070

1071+
### Cross-Platform Hook Wrapper System
1072+
1073+
The `hooks/` module provides a wrapper system that allows writing hooks once in Python and running them on multiple platforms. This normalizes the differences between Claude Code and Gemini CLI hook systems.
1074+
1075+
**Architecture:**
1076+
```
1077+
┌─────────────────┐ ┌─────────────────┐
1078+
│ Claude Code │ │ Gemini CLI │
1079+
│ (Stop event) │ │ (AfterAgent) │
1080+
└────────┬────────┘ └────────┬────────┘
1081+
│ │
1082+
▼ ▼
1083+
┌─────────────────┐ ┌─────────────────┐
1084+
│ claude_hook.sh │ │ gemini_hook.sh │
1085+
│ (shell wrapper) │ │ (shell wrapper) │
1086+
└────────┬────────┘ └────────┬────────┘
1087+
│ │
1088+
└───────────┬───────────┘
1089+
1090+
┌─────────────────┐
1091+
│ wrapper.py │
1092+
│ (normalization) │
1093+
└────────┬────────┘
1094+
1095+
┌─────────────────┐
1096+
│ Python Hook │
1097+
│ (common logic) │
1098+
└─────────────────┘
1099+
```
1100+
1101+
**Key normalizations:**
1102+
- Event names: `Stop``AfterAgent`, `PreToolUse``BeforeTool`, `UserPromptSubmit``BeforeAgent`
1103+
- Tool names: `Write``write_file`, `Bash``shell`, `Read``read_file`
1104+
- Decision values: `block``deny` for Gemini CLI
1105+
- Environment variables: `CLAUDE_PROJECT_DIR``GEMINI_PROJECT_DIR`
1106+
1107+
**Usage:**
1108+
```python
1109+
from deepwork.hooks.wrapper import HookInput, HookOutput, run_hook, Platform
1110+
1111+
def my_hook(input: HookInput) -> HookOutput:
1112+
if input.event == NormalizedEvent.AFTER_AGENT:
1113+
return HookOutput(decision="block", reason="Complete X first")
1114+
return HookOutput()
1115+
1116+
# Called via: claude_hook.sh mymodule or gemini_hook.sh mymodule
1117+
```
1118+
1119+
See `doc/platform/` for detailed platform-specific hook documentation.
1120+
10671121
### Policy Schema
10681122

10691123
Policies are validated against a JSON Schema:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "deepwork"
3-
version = "0.1.2"
3+
version = "0.2.0"
44
description = "Framework for enabling AI agents to perform complex, multi-step work tasks"
55
readme = "README.md"
66
requires-python = ">=3.11"

0 commit comments

Comments
 (0)