Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"hooks": [
{
"type": "command",
"command": ".deepwork/jobs/deepwork_rules/hooks/user_prompt_submit.sh"
"command": "deepwork hook user_prompt_submit"
}
]
}
Expand Down
38 changes: 0 additions & 38 deletions .deepwork/jobs/deepwork_rules/hooks/capture_prompt_work_tree.sh

This file was deleted.

5 changes: 4 additions & 1 deletion .deepwork/jobs/deepwork_rules/hooks/global_hooks.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# DeepWork Rules Hooks Configuration
# Maps lifecycle events to hook scripts or Python modules
#
# All hooks use Python modules for cross-platform compatibility (Windows, macOS, Linux).
# The module syntax ensures hooks work regardless of how DeepWork was installed.

UserPromptSubmit:
- user_prompt_submit.sh
- module: deepwork.hooks.user_prompt_submit

Stop:
- module: deepwork.hooks.rules_check
16 changes: 0 additions & 16 deletions .deepwork/jobs/deepwork_rules/hooks/user_prompt_submit.sh

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build Windows Executable

on:
release:
types: [published]
# Allow manual trigger for testing
workflow_dispatch:
inputs:
upload_to_release:
description: 'Upload to latest release'
type: boolean
default: false

permissions:
contents: write

jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -e .

- name: Build Windows executable
run: |
pyinstaller scripts/deepwork.spec --distpath dist --clean -y

- name: Test executable
run: |
.\dist\deepwork.exe --version
.\dist\deepwork.exe --help

- name: Rename executable for release
run: |
Move-Item dist\deepwork.exe dist\deepwork-windows-x64.exe

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: deepwork-windows-x64
path: dist/deepwork-windows-x64.exe

- name: Upload to Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: dist/deepwork-windows-x64.exe
tag_name: ${{ github.event.release.tag_name }}

- name: Upload to Latest Release (manual)
if: github.event_name == 'workflow_dispatch' && inputs.upload_to_release
run: |
# Get latest release tag
$latestTag = gh release list --limit 1 --json tagName -q '.[0].tagName'
Write-Host "Uploading to release: $latestTag"
gh release upload $latestTag dist/deepwork-windows-x64.exe --clobber
env:
GH_TOKEN: ${{ github.token }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ env/
# PyInstaller
*.manifest
*.spec
# But keep our build spec file
!scripts/deepwork.spec

# Unit test / coverage reports
htmlcov/
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

### Removed

## [0.6.0] - 2026-01-26

### Added
- Windows support for Claude Code integration
- PyInstaller spec for building standalone Windows executable (`deepwork.exe`)
- PowerShell installer script that downloads and adds DeepWork to PATH
- GitHub Actions workflow for automated Windows builds on release
- Windows installation documentation at `doc/installation/windows.md`
- Cross-platform Python hook modules replacing bash scripts
- `capture_prompt.py` - Git work tree state capture
- `user_prompt_submit.py` - User prompt submission hook
- `hook_entry.py` - Direct Python entry point for hooks
- New tests for cross-platform hook functionality

### Changed
- Hooks now use `deepwork hook <name>` command format instead of bash wrapper scripts
- `global_hooks.yml` updated to use Python modules for cross-platform compatibility
- `hooks_syncer.py` now generates forward-slash paths for bash compatibility on all platforms

### Removed
- Bash hook scripts (`user_prompt_submit.sh`, `capture_prompt_work_tree.sh`) replaced by Python modules

## [0.5.1] - 2026-01-24

### Added
Expand Down
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ To start the process, just run:

| Platform | Status | Notes |
|----------|--------|-------|
| **Claude Code** | Full Support | Recommended. Quality hooks, rules, best DX. |
| **Claude Code** | Full Support | Recommended. Works on Windows, macOS, Linux. Quality hooks, rules, best DX. |
| **Gemini CLI** | Partial Support | TOML format, global hooks only |
| OpenCode | Planned | |
| GitHub Copilot CLI | Planned | |
| Others | Planned | We are nailing Claude and Gemini first, then adding others according ot demand |
| Others | Planned | We are nailing Claude and Gemini first, then adding others according to demand |

**Tip:** Use the terminal (Claude Code CLI), not the VS Code extension. The terminal has full feature support.

Expand Down Expand Up @@ -236,6 +236,38 @@ deepwork install

</details>

<details>
<summary><strong>Windows Installation</strong></summary>

DeepWork fully supports Windows with Claude Code. Install using PowerShell:

```powershell
# Option 1: Download and run the installer (recommended)
Invoke-WebRequest -Uri "https://github.com/unsupervisedcom/deepwork/releases/latest/download/install-windows.ps1" -OutFile install-windows.ps1
.\install-windows.ps1

# Option 2: Using pip (requires Python 3.11+)
pip install deepwork

# Option 3: Using pipx
pipx install deepwork
```

Then in your project folder:

```powershell
deepwork install
```

**Requirements:**
- Windows 10 or later
- Git for Windows (provides Git Bash for hook execution)
- Claude Code installed via npm or winget

See [doc/installation/windows.md](doc/installation/windows.md) for detailed instructions and troubleshooting.

</details>

<details>
<summary><strong>Advanced: Automated Rules</strong></summary>

Expand Down
48 changes: 21 additions & 27 deletions doc/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ deepwork/ # DeepWork tool repository
│ │ ├── rules_queue.py # Rule state queue system
│ │ ├── command_executor.py # Command action execution
│ │ └── hooks_syncer.py # Hook syncing to platforms
│ ├── hooks/ # Hook system and cross-platform wrappers
│ ├── hooks/ # Hook system (cross-platform Python modules)
│ │ ├── __init__.py
│ │ ├── wrapper.py # Cross-platform input/output normalization
│ │ ├── claude_hook.sh # Shell wrapper for Claude Code
│ │ ├── gemini_hook.sh # Shell wrapper for Gemini CLI
│ │ ├── capture_prompt.py # Git work tree state capture
│ │ ├── user_prompt_submit.py # User prompt submission hook
│ │ └── rules_check.py # Cross-platform rule evaluation hook
│ ├── templates/ # Skill templates for each platform
│ │ ├── claude/
Expand All @@ -74,10 +74,8 @@ deepwork/ # DeepWork tool repository
│ │ ├── job.yml
│ │ ├── steps/
│ │ │ └── define.md
│ │ └── hooks/ # Hook scripts
│ │ ├── global_hooks.yml
│ │ ├── user_prompt_submit.sh
│ │ └── capture_prompt_work_tree.sh
│ │ └── hooks/ # Hook configuration (Python modules)
│ │ └── global_hooks.yml
│ ├── schemas/ # Definition schemas
│ │ ├── job_schema.py
│ │ ├── doc_spec_schema.py # Doc spec schema definition
Expand Down Expand Up @@ -311,10 +309,8 @@ my-project/ # User's project (target)
│ │ ├── job.yml
│ │ ├── steps/
│ │ │ └── define.md
│ │ └── hooks/ # Hook scripts (installed from standard_jobs)
│ │ ├── global_hooks.yml
│ │ ├── user_prompt_submit.sh
│ │ └── capture_prompt_work_tree.sh
│ │ └── hooks/ # Hook configuration (uses Python modules)
│ │ └── global_hooks.yml
│ ├── competitive_research/
│ │ ├── job.yml # Job metadata
│ │ └── steps/
Expand Down Expand Up @@ -1126,19 +1122,19 @@ This prevents re-prompting for the same rule violation within a session.

### Hook Integration

The v2 rules system uses the cross-platform hook wrapper:
The v2 rules system uses cross-platform Python modules:

```
src/deepwork/hooks/
├── wrapper.py # Cross-platform input/output normalization
├── rules_check.py # Rule evaluation hook (v2)
├── claude_hook.sh # Claude Code shell wrapper
└── gemini_hook.sh # Gemini CLI shell wrapper
├── wrapper.py # Cross-platform input/output normalization
├── rules_check.py # Rule evaluation hook (v2)
├── user_prompt_submit.py # Prompt submission hook
└── capture_prompt.py # Git work tree state capture
```

Hooks are called via the shell wrappers:
Hooks are called via the `deepwork hook` CLI command, which works on all platforms (Windows, macOS, Linux):
```bash
claude_hook.sh deepwork.hooks.rules_check
deepwork hook rules_check
```

The hooks are installed to `.claude/settings.json` during `deepwork sync`:
Expand All @@ -1153,9 +1149,9 @@ The hooks are installed to `.claude/settings.json` during `deepwork sync`:
}
```

### Cross-Platform Hook Wrapper System
### Cross-Platform Hook System

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.
The `hooks/` module provides Python-based hooks that work on all platforms (Windows, macOS, Linux). Hooks are invoked via the `deepwork hook <name>` CLI command, which normalizes differences between Claude Code and Gemini CLI.

**Architecture:**
```
Expand All @@ -1165,12 +1161,10 @@ The `hooks/` module provides a wrapper system that allows writing hooks once in
└────────┬────────┘ └────────┬────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ claude_hook.sh │ │ gemini_hook.sh │
│ (shell wrapper) │ │ (shell wrapper) │
└────────┬────────┘ └────────┬────────┘
│ │
└───────────┬───────────┘
┌─────────────────────────────────────────┐
│ deepwork hook <name> │
│ (cross-platform CLI command) │
└────────────────────┬────────────────────┘
┌─────────────────┐
│ wrapper.py │
Expand Down Expand Up @@ -1198,7 +1192,7 @@ def my_hook(input: HookInput) -> HookOutput:
return HookOutput(decision="block", reason="Complete X first")
return HookOutput()

# Called via: claude_hook.sh mymodule or gemini_hook.sh mymodule
# Called via: deepwork hook mymodule
```

See `doc/platforms/` for detailed platform-specific hook documentation.
Expand Down
Loading
Loading