Skip to content

Commit fa26516

Browse files
authored
Merge branch 'main' into claude/require-compares-to-field-fwDHp
2 parents 82463ca + 3afaeba commit fa26516

4 files changed

Lines changed: 141 additions & 61 deletions

File tree

AGENTS.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# DeepWork - Agent Instructions
2+
3+
This file contains critical instructions for AI agents working on this codebase.
4+
5+
## CRITICAL: Job Type Classification
6+
7+
When creating or modifying jobs in this repository, you MUST understand which type of job you are working with. There are exactly **three types of jobs**, each with a specific location and purpose.
8+
9+
### 1. Standard Jobs (`src/deepwork/standard_jobs/`)
10+
11+
**What they are**: Core jobs that are part of the DeepWork framework itself. These get automatically installed to every target repository when users run `deepwork install`.
12+
13+
**Location**: `src/deepwork/standard_jobs/[job_name]/`
14+
15+
**Current standard jobs**:
16+
- `deepwork_jobs` - Core job management (define, implement, learn)
17+
- `deepwork_rules` - Rules enforcement system
18+
19+
**Editing rules**:
20+
- Source of truth is ALWAYS in `src/deepwork/standard_jobs/`
21+
- NEVER edit the installed copies in `.deepwork/jobs/` directly
22+
- After editing, run `deepwork install --platform claude` to sync
23+
24+
### 2. Library Jobs (`library_jobs/`)
25+
26+
**What they are**: Example or reusable jobs that any repository is welcome to use, but are NOT auto-installed. Users must explicitly copy or import these into their projects.
27+
28+
**Location**: `library_jobs/[job_name]/`
29+
30+
**Examples** (potential):
31+
- Competitive research workflows
32+
- Code review processes
33+
- Documentation generation
34+
- Release management
35+
36+
**Editing rules**:
37+
- Edit directly in `library_jobs/[job_name]/`
38+
- These are templates/examples for users to adopt
39+
- Should be well-documented and self-contained
40+
41+
### 3. Bespoke/Repo Jobs (`.deepwork/jobs/`)
42+
43+
**What they are**: Jobs that are ONLY for this specific repository (the DeepWork repo itself). These are not distributed to users and exist only for internal development workflows.
44+
45+
**Location**: `.deepwork/jobs/[job_name]/` (but NOT if the job also exists in `src/deepwork/standard_jobs/`)
46+
47+
**Identifying bespoke jobs**: A job in `.deepwork/jobs/` is bespoke ONLY if it does NOT have a corresponding directory in `src/deepwork/standard_jobs/`.
48+
49+
**Editing rules**:
50+
- Edit directly in `.deepwork/jobs/[job_name]/`
51+
- These are private to this repository
52+
- Run `deepwork sync` after changes to regenerate skills
53+
54+
## IMPORTANT: When Creating New Jobs
55+
56+
Before creating any new job, you MUST determine which type it should be. **If there is any ambiguity**, ask the user a structured question to clarify:
57+
58+
```
59+
Which type of job should this be?
60+
1. Standard Job - Part of the DeepWork framework, auto-installed to all users
61+
2. Library Job - Reusable example that users can optionally adopt
62+
3. Bespoke Job - Only for this repository's internal workflows
63+
```
64+
65+
### Decision Guide
66+
67+
| Question | If Yes → |
68+
|----------|----------|
69+
| Should this be installed automatically when users run `deepwork install`? | Standard Job |
70+
| Is this a reusable pattern that other repos might want to copy? | Library Job |
71+
| Is this only useful for developing DeepWork itself? | Bespoke Job |
72+
73+
## File Structure Summary
74+
75+
```
76+
deepwork/
77+
├── src/deepwork/standard_jobs/ # Standard jobs (source of truth)
78+
│ ├── deepwork_jobs/
79+
│ └── deepwork_rules/
80+
├── library_jobs/ # Library/example jobs
81+
│ └── [example_job]/
82+
└── .deepwork/jobs/ # Installed standard jobs + bespoke jobs
83+
├── deepwork_jobs/ # ← Installed copy, NOT source of truth
84+
├── deepwork_rules/ # ← Installed copy, NOT source of truth
85+
└── [bespoke_job]/ # ← Source of truth for bespoke only
86+
```

CHANGELOG.md

Lines changed: 34 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,32 @@ 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.5.0] - 2026-01-18
8+
## [0.3.0] - 2026-01-18
99

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+
- `rules_check.py`: Cross-platform rule evaluation hook
15+
- Platform documentation in `doc/platforms/` with hook references and learnings
16+
- Claude Code platform documentation (`doc/platforms/claude/`)
17+
- `update.job` for maintaining standard jobs (#41)
18+
- `make_new_job.sh` script and templates directory for job scaffolding (#37)
19+
- Default rules template file created during `deepwork install` (#42)
20+
- Full e2e test suite: define → implement → execute workflow (#45)
21+
- Automated tests for all shell scripts and hook wrappers (#40)
22+
- Rules system v2 with frontmatter markdown format in `.deepwork/rules/`
23+
- Detection modes: trigger/safety (default), set (bidirectional), pair (directional)
24+
- Action types: prompt (show instructions), command (run idempotent commands)
25+
- Variable pattern matching with `{path}` (multi-segment) and `{name}` (single-segment)
26+
- Queue system in `.deepwork/tmp/rules/queue/` for state tracking and deduplication
27+
- New core modules:
28+
- `pattern_matcher.py`: Variable pattern matching with regex-based capture
29+
- `rules_queue.py`: Queue system for rule state persistence
30+
- `command_executor.py`: Command action execution with variable substitution
31+
- Updated `rules_check.py` hook to use v2 system with queue-based deduplication
32+
33+
### Changed
1034
- **BREAKING**: Refactored "commands" terminology to "skills" throughout the codebase
1135
- Directory structure changed from `.claude/commands/` to `.claude/skills/`
1236
- Directory structure changed from `.gemini/commands/` to `.gemini/skills/`
@@ -20,63 +44,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2044
- Hidden steps use `user-invocable: false` in YAML frontmatter instead
2145
- The `exposed` field in job.yml now controls the `user-invocable` frontmatter setting
2246
- CLI output messages updated to use "skills" terminology
23-
24-
### Migration Guide
25-
- Run `deepwork install --platform claude` to regenerate skills in the new location
26-
- Remove old `.claude/commands/` and `.gemini/commands/` directories manually
27-
- Update any custom code that imports `CommandGenerator` or `CommandLifecycleHook`
28-
29-
## [0.4.1] - 2026-01-18
47+
- Standardized on "ask structured questions" phrasing across all jobs (#48)
48+
- deepwork_jobs bumped to v0.5.0, deepwork_rules to v0.2.0
49+
- Documentation updated with v2 rules examples and configuration
3050

3151
### Fixed
52+
- Stop hooks now properly return blocking JSON (#38)
53+
- Various CI workflow fixes (#35, #46, #47, #51, #52)
3254
- Command rule errors now include promise skip instructions with the exact rule name
3355
- Previously, failed command rules only showed "Command failed" with no guidance
3456
- Now each failed rule shows: `To skip, include <promise>Rule Name</promise> in your response`
3557
- This allows agents to understand how to proceed when a command rule fails
3658

37-
38-
## [0.4.0] - 2026-01-16
39-
40-
### Added
41-
- Rules system v2 with frontmatter markdown format in `.deepwork/rules/`
42-
- Detection modes: trigger/safety (default), set (bidirectional), pair (directional)
43-
- Action types: prompt (show instructions), command (run idempotent commands)
44-
- Variable pattern matching with `{path}` (multi-segment) and `{name}` (single-segment)
45-
- Queue system in `.deepwork/tmp/rules/queue/` for state tracking and deduplication
46-
- New core modules:
47-
- `pattern_matcher.py`: Variable pattern matching with regex-based capture
48-
- `rules_queue.py`: Queue system for rule state persistence
49-
- `command_executor.py`: Command action execution with variable substitution
50-
- Updated `rules_check.py` hook to use v2 system with queue-based deduplication
51-
52-
### Changed
53-
- Documentation updated with v2 rules examples and configuration
54-
5559
### Removed
5660
- v1 rules format (`.deepwork.rules.yml`) - now only v2 frontmatter markdown format is supported
5761

58-
## [0.3.0] - 2026-01-16
59-
60-
### Added
61-
- Cross-platform hook wrapper system for writing hooks once and running on multiple platforms
62-
- `wrapper.py`: Normalizes input/output between Claude Code and Gemini CLI
63-
- `claude_hook.sh` and `gemini_hook.sh`: Platform-specific shell wrappers
64-
- `rules_check.py`: Cross-platform rule evaluation hook
65-
- Platform documentation in `doc/platforms/` with hook references and learnings
66-
- Claude Code platform documentation (`doc/platforms/claude/`)
67-
- `update.job` for maintaining standard jobs (#41)
68-
- `make_new_job.sh` script and templates directory for job scaffolding (#37)
69-
- Default rules template file created during `deepwork install` (#42)
70-
- Full e2e test suite: define → implement → execute workflow (#45)
71-
- Automated tests for all shell scripts and hook wrappers (#40)
72-
73-
### Changed
74-
- Standardized on "ask structured questions" phrasing across all jobs (#48)
75-
- deepwork_jobs bumped to v0.5.0, deepwork_rules to v0.2.0
76-
77-
### Fixed
78-
- Stop hooks now properly return blocking JSON (#38)
79-
- Various CI workflow fixes (#35, #46, #47, #51, #52)
62+
### Migration Guide
63+
- Run `deepwork install --platform claude` to regenerate skills in the new location
64+
- Remove old `.claude/commands/` and `.gemini/commands/` directories manually
65+
- Update any custom code that imports `CommandGenerator` or `CommandLifecycleHook`
8066

8167
## [0.1.1] - 2026-01-15
8268

@@ -114,8 +100,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
114100

115101
Initial version.
116102

117-
[0.4.1]: https://github.com/anthropics/deepwork/releases/tag/0.4.1
118-
[0.4.0]: https://github.com/anthropics/deepwork/releases/tag/0.4.0
119103
[0.3.0]: https://github.com/anthropics/deepwork/releases/tag/0.3.0
120104
[0.1.1]: https://github.com/anthropics/deepwork/releases/tag/0.1.1
121105
[0.1.0]: https://github.com/anthropics/deepwork/releases/tag/0.1.0

claude.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ deepwork/
4242
│ │ ├── claude/
4343
│ │ ├── gemini/
4444
│ │ └── copilot/
45-
│ ├── standard_jobs/ # Built-in job definitions
46-
│ │ └── deepwork_jobs/
45+
│ ├── standard_jobs/ # Built-in job definitions (auto-installed)
46+
│ │ ├── deepwork_jobs/
47+
│ │ └── deepwork_rules/
4748
│ ├── schemas/ # Job definition schemas
4849
│ └── utils/ # Utilities (fs, git, yaml, validation)
50+
├── library_jobs/ # Reusable example jobs (not auto-installed)
4951
├── tests/ # Test suite
5052
├── doc/ # Documentation
5153
└── doc/architecture.md # Detailed architecture document
@@ -182,16 +184,24 @@ my-project/
182184
6. **No Auto-Commit**: DO NOT automatically commit changes to git. Let the user review and commit changes themselves.
183185
7. **Documentation Sync**: CRITICAL - When making implementation changes, always update `doc/architecture.md` and `README.md` to reflect those changes. The architecture document must stay in sync with the actual codebase (terminology, file paths, structure, behavior, etc.).
184186

185-
## CRITICAL: Editing Standard Jobs
187+
## CRITICAL: Job Types and Where to Edit
188+
189+
**See `AGENTS.md` for the complete job classification guide.** This repository has THREE types of jobs:
190+
191+
| Type | Location | Purpose |
192+
|------|----------|---------|
193+
| **Standard Jobs** | `src/deepwork/standard_jobs/` | Framework core, auto-installed to users |
194+
| **Library Jobs** | `library_jobs/` | Reusable examples users can adopt |
195+
| **Bespoke Jobs** | `.deepwork/jobs/` (if not in standard_jobs) | This repo's internal workflows only |
196+
197+
### Editing Standard Jobs
186198

187199
**Standard jobs** (like `deepwork_jobs` and `deepwork_rules`) are bundled with DeepWork and installed to user projects. They exist in THREE locations:
188200

189201
1. **Source of truth**: `src/deepwork/standard_jobs/[job_name]/` - The canonical source files
190202
2. **Installed copy**: `.deepwork/jobs/[job_name]/` - Installed by `deepwork install`
191203
3. **Generated skills**: `.claude/skills/[job_name].[step].md` - Generated from installed jobs
192204

193-
### Editing Workflow for Standard Jobs
194-
195205
**NEVER edit files in `.deepwork/jobs/` or `.claude/skills/` for standard jobs directly!**
196206

197207
Instead, follow this workflow:
@@ -205,13 +215,13 @@ Instead, follow this workflow:
205215

206216
3. **Verify** the changes propagated correctly to all locations
207217

208-
### How to Identify Standard Jobs
218+
### How to Identify Job Types
209219

210-
Standard jobs are defined in `src/deepwork/standard_jobs/`. Currently:
211-
- `deepwork_jobs` - Core job management commands (define, implement, refine)
212-
- `deepwork_rules` - Rules enforcement system
220+
- **Standard jobs**: Exist in `src/deepwork/standard_jobs/` (currently: `deepwork_jobs`, `deepwork_rules`)
221+
- **Library jobs**: Exist in `library_jobs/`
222+
- **Bespoke jobs**: Exist ONLY in `.deepwork/jobs/` with no corresponding standard_jobs entry
213223

214-
If a job exists in `src/deepwork/standard_jobs/`, it is a standard job and MUST be edited there.
224+
**When creating a new job, always clarify which type it should be.** If uncertain, ask the user.
215225

216226
## Success Metrics
217227

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.5.0"
3+
version = "0.3.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)