Skip to content

Commit 8c12662

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 2425d18 commit 8c12662

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-15
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.1] - 2026-01-15
927

1028
### Added
@@ -41,5 +59,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4159

4260
Initial version.
4361

62+
[0.2.0]: https://github.com/anthropics/deepwork/releases/tag/v0.2.0
4463
[0.1.1]: https://github.com/anthropics/deepwork/releases/tag/v0.1.1
4564
[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
@@ -208,14 +208,18 @@ deepwork/
208208
│ │ ├── parser.py # Job definition parsing
209209
│ │ ├── detector.py # Platform detection
210210
│ │ └── generator.py # Skill file generation
211+
│ ├── hooks/ # Cross-platform hook wrappers
212+
│ │ ├── wrapper.py # Input/output normalization
213+
│ │ ├── claude_hook.sh # Claude Code adapter
214+
│ │ └── gemini_hook.sh # Gemini CLI adapter
211215
│ ├── templates/ # Jinja2 templates
212216
│ │ ├── claude/ # Claude Code templates
213217
│ │ └── gemini/ # Gemini CLI templates
214218
│ ├── schemas/ # JSON schemas
215219
│ └── utils/ # Utilities (fs, yaml, git, validation)
216220
├── tests/
217-
│ ├── unit/ # Unit tests (147 tests)
218-
│ ├── integration/ # Integration tests (19 tests)
221+
│ ├── unit/ # Unit tests
222+
│ ├── integration/ # Integration tests
219223
│ └── fixtures/ # Test fixtures
220224
└── doc/ # Documentation
221225
```

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
@@ -1060,6 +1064,56 @@ The hooks are installed to `.claude/settings.json` during `deepwork sync`:
10601064
}
10611065
```
10621066

1067+
### Cross-Platform Hook Wrapper System
1068+
1069+
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.
1070+
1071+
**Architecture:**
1072+
```
1073+
┌─────────────────┐ ┌─────────────────┐
1074+
│ Claude Code │ │ Gemini CLI │
1075+
│ (Stop event) │ │ (AfterAgent) │
1076+
└────────┬────────┘ └────────┬────────┘
1077+
│ │
1078+
▼ ▼
1079+
┌─────────────────┐ ┌─────────────────┐
1080+
│ claude_hook.sh │ │ gemini_hook.sh │
1081+
│ (shell wrapper) │ │ (shell wrapper) │
1082+
└────────┬────────┘ └────────┬────────┘
1083+
│ │
1084+
└───────────┬───────────┘
1085+
1086+
┌─────────────────┐
1087+
│ wrapper.py │
1088+
│ (normalization) │
1089+
└────────┬────────┘
1090+
1091+
┌─────────────────┐
1092+
│ Python Hook │
1093+
│ (common logic) │
1094+
└─────────────────┘
1095+
```
1096+
1097+
**Key normalizations:**
1098+
- Event names: `Stop``AfterAgent`, `PreToolUse``BeforeTool`, `UserPromptSubmit``BeforeAgent`
1099+
- Tool names: `Write``write_file`, `Bash``shell`, `Read``read_file`
1100+
- Decision values: `block``deny` for Gemini CLI
1101+
- Environment variables: `CLAUDE_PROJECT_DIR``GEMINI_PROJECT_DIR`
1102+
1103+
**Usage:**
1104+
```python
1105+
from deepwork.hooks.wrapper import HookInput, HookOutput, run_hook, Platform
1106+
1107+
def my_hook(input: HookInput) -> HookOutput:
1108+
if input.event == NormalizedEvent.AFTER_AGENT:
1109+
return HookOutput(decision="block", reason="Complete X first")
1110+
return HookOutput()
1111+
1112+
# Called via: claude_hook.sh mymodule or gemini_hook.sh mymodule
1113+
```
1114+
1115+
See `doc/platform/` for detailed platform-specific hook documentation.
1116+
10631117
### Policy Schema
10641118

10651119
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.1"
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)