deepwork 0.4.0__py3-none-any.whl → 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- deepwork/__init__.py +1 -1
- deepwork/cli/hook.py +3 -4
- deepwork/cli/install.py +70 -117
- deepwork/cli/main.py +2 -2
- deepwork/cli/serve.py +133 -0
- deepwork/cli/sync.py +93 -58
- deepwork/core/adapters.py +91 -98
- deepwork/core/generator.py +19 -386
- deepwork/core/hooks_syncer.py +1 -1
- deepwork/core/parser.py +270 -1
- deepwork/hooks/README.md +0 -44
- deepwork/hooks/__init__.py +3 -6
- deepwork/hooks/check_version.sh +54 -21
- deepwork/mcp/__init__.py +23 -0
- deepwork/mcp/quality_gate.py +347 -0
- deepwork/mcp/schemas.py +263 -0
- deepwork/mcp/server.py +253 -0
- deepwork/mcp/state.py +422 -0
- deepwork/mcp/tools.py +394 -0
- deepwork/schemas/job.schema.json +347 -0
- deepwork/schemas/job_schema.py +27 -239
- deepwork/standard_jobs/deepwork_jobs/doc_specs/job_spec.md +9 -15
- deepwork/standard_jobs/deepwork_jobs/job.yml +146 -46
- deepwork/standard_jobs/deepwork_jobs/steps/define.md +100 -33
- deepwork/standard_jobs/deepwork_jobs/steps/errata.md +154 -0
- deepwork/standard_jobs/deepwork_jobs/steps/fix_jobs.md +207 -0
- deepwork/standard_jobs/deepwork_jobs/steps/fix_settings.md +177 -0
- deepwork/standard_jobs/deepwork_jobs/steps/implement.md +22 -138
- deepwork/standard_jobs/deepwork_jobs/steps/iterate.md +221 -0
- deepwork/standard_jobs/deepwork_jobs/steps/learn.md +2 -26
- deepwork/standard_jobs/deepwork_jobs/steps/test.md +154 -0
- deepwork/standard_jobs/deepwork_jobs/templates/job.yml.template +2 -0
- deepwork/templates/claude/AGENTS.md +38 -0
- deepwork/templates/claude/settings.json +16 -0
- deepwork/templates/claude/skill-deepwork.md.jinja +37 -0
- deepwork/templates/gemini/skill-deepwork.md.jinja +37 -0
- deepwork-0.7.0.dist-info/METADATA +317 -0
- deepwork-0.7.0.dist-info/RECORD +64 -0
- deepwork/cli/rules.py +0 -32
- deepwork/core/command_executor.py +0 -190
- deepwork/core/pattern_matcher.py +0 -271
- deepwork/core/rules_parser.py +0 -559
- deepwork/core/rules_queue.py +0 -321
- deepwork/hooks/rules_check.py +0 -759
- deepwork/schemas/rules_schema.py +0 -135
- deepwork/standard_jobs/deepwork_jobs/steps/review_job_spec.md +0 -208
- deepwork/standard_jobs/deepwork_jobs/templates/doc_spec.md.example +0 -86
- deepwork/standard_jobs/deepwork_rules/hooks/capture_prompt_work_tree.sh +0 -38
- deepwork/standard_jobs/deepwork_rules/hooks/global_hooks.yml +0 -8
- deepwork/standard_jobs/deepwork_rules/hooks/user_prompt_submit.sh +0 -16
- deepwork/standard_jobs/deepwork_rules/job.yml +0 -49
- deepwork/standard_jobs/deepwork_rules/rules/.gitkeep +0 -13
- deepwork/standard_jobs/deepwork_rules/rules/api-documentation-sync.md.example +0 -10
- deepwork/standard_jobs/deepwork_rules/rules/readme-documentation.md.example +0 -10
- deepwork/standard_jobs/deepwork_rules/rules/security-review.md.example +0 -11
- deepwork/standard_jobs/deepwork_rules/rules/skill-md-validation.md +0 -46
- deepwork/standard_jobs/deepwork_rules/rules/source-test-pairing.md.example +0 -13
- deepwork/standard_jobs/deepwork_rules/steps/define.md +0 -249
- deepwork/templates/claude/skill-job-meta.md.jinja +0 -77
- deepwork/templates/claude/skill-job-step.md.jinja +0 -251
- deepwork/templates/gemini/skill-job-meta.toml.jinja +0 -76
- deepwork/templates/gemini/skill-job-step.toml.jinja +0 -162
- deepwork-0.4.0.dist-info/METADATA +0 -381
- deepwork-0.4.0.dist-info/RECORD +0 -71
- {deepwork-0.4.0.dist-info → deepwork-0.7.0.dist-info}/WHEEL +0 -0
- {deepwork-0.4.0.dist-info → deepwork-0.7.0.dist-info}/entry_points.txt +0 -0
- {deepwork-0.4.0.dist-info → deepwork-0.7.0.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# Fix Job Definitions
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
|
|
5
|
+
Update all job.yml files and step instructions in `.deepwork/jobs/` to the current DeepWork format. This step migrates deprecated fields, removes references to deleted steps, and ensures all jobs are compatible with the MCP-based workflow system.
|
|
6
|
+
|
|
7
|
+
## Task
|
|
8
|
+
|
|
9
|
+
Audit and repair all job definitions, migrating from legacy formats to current specifications.
|
|
10
|
+
|
|
11
|
+
### Step 1: Inventory All Jobs
|
|
12
|
+
|
|
13
|
+
List all jobs in the project:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ls -la .deepwork/jobs/
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
For each job directory, you'll need to check and potentially fix the `job.yml` file.
|
|
20
|
+
|
|
21
|
+
### Step 1.5: Process Jobs in Parallel
|
|
22
|
+
|
|
23
|
+
**For each job** (except `deepwork_jobs` which should be updated via `deepwork install`), kick off a sub-agent to audit and repair that job's `job.yml` file. The sub-agent should:
|
|
24
|
+
|
|
25
|
+
1. Read the job's `job.yml` file
|
|
26
|
+
2. Check for and fix all issues described in Steps 2-6 below
|
|
27
|
+
3. Validate the YAML is still valid after changes
|
|
28
|
+
4. Report what was changed
|
|
29
|
+
|
|
30
|
+
**Run sub-agents in parallel** - one for each job to speed up the process.
|
|
31
|
+
|
|
32
|
+
**Example prompt for sub-agent:**
|
|
33
|
+
```
|
|
34
|
+
Audit and repair the job at `.deepwork/jobs/[job_name]/job.yml`:
|
|
35
|
+
1. Remove any `exposed: true` fields from steps
|
|
36
|
+
2. Migrate `stop_hooks` to `hooks.after_agent` format
|
|
37
|
+
3. Remove references to deleted steps (like `review_job_spec`)
|
|
38
|
+
4. Fix orphaned steps by adding them to workflows
|
|
39
|
+
5. Bump version and add changelog entry if changes were made
|
|
40
|
+
6. Validate YAML syntax
|
|
41
|
+
|
|
42
|
+
Report what changes were made.
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Step 2: Remove `exposed` Field
|
|
46
|
+
|
|
47
|
+
The `exposed` field on steps no longer has any effect in MCP-based DeepWork. Steps are now only accessible through workflows.
|
|
48
|
+
|
|
49
|
+
**Find and remove:**
|
|
50
|
+
```yaml
|
|
51
|
+
steps:
|
|
52
|
+
- id: some_step
|
|
53
|
+
exposed: true # REMOVE THIS LINE
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
If a step was `exposed: true` and is not in any workflow, it should either:
|
|
57
|
+
1. Be added to a workflow, OR
|
|
58
|
+
2. Be removed from the job entirely
|
|
59
|
+
|
|
60
|
+
### Step 3: Migrate `stop_hooks` to `hooks.after_agent`
|
|
61
|
+
|
|
62
|
+
The `stop_hooks` field is deprecated. Migrate to the new `hooks` structure:
|
|
63
|
+
|
|
64
|
+
**Before (deprecated):**
|
|
65
|
+
```yaml
|
|
66
|
+
steps:
|
|
67
|
+
- id: my_step
|
|
68
|
+
stop_hooks:
|
|
69
|
+
- prompt: "Verify the output meets quality standards"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**After (current format):**
|
|
73
|
+
```yaml
|
|
74
|
+
steps:
|
|
75
|
+
- id: my_step
|
|
76
|
+
hooks:
|
|
77
|
+
after_agent:
|
|
78
|
+
- prompt: "Verify the output meets quality standards"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Step 4: Remove References to Deleted Steps
|
|
82
|
+
|
|
83
|
+
Check for references to steps that no longer exist in the standard jobs:
|
|
84
|
+
|
|
85
|
+
**Steps that have been removed:**
|
|
86
|
+
- `review_job_spec` - Was removed from `deepwork_jobs` in v1.0.1
|
|
87
|
+
|
|
88
|
+
**What to fix:**
|
|
89
|
+
- Remove from workflow `steps` arrays
|
|
90
|
+
- Update `from_step` references in inputs
|
|
91
|
+
- Update `dependencies` arrays
|
|
92
|
+
|
|
93
|
+
**Example fix:**
|
|
94
|
+
```yaml
|
|
95
|
+
# Before
|
|
96
|
+
workflows:
|
|
97
|
+
- name: new_job
|
|
98
|
+
steps:
|
|
99
|
+
- define
|
|
100
|
+
- review_job_spec # REMOVE
|
|
101
|
+
- implement
|
|
102
|
+
|
|
103
|
+
steps:
|
|
104
|
+
- id: implement
|
|
105
|
+
inputs:
|
|
106
|
+
- file: job.yml
|
|
107
|
+
from_step: review_job_spec # CHANGE TO: define
|
|
108
|
+
dependencies:
|
|
109
|
+
- review_job_spec # CHANGE TO: define
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Step 5: Fix Orphaned Steps
|
|
113
|
+
|
|
114
|
+
Steps not included in any workflow cannot be invoked via the MCP interface.
|
|
115
|
+
|
|
116
|
+
**How to handle orphaned steps depends on whether the job has ANY workflows defined:**
|
|
117
|
+
|
|
118
|
+
#### Case A: Job has NO workflows defined
|
|
119
|
+
|
|
120
|
+
If the job has no `workflows:` section at all (or it's empty), create a **single workflow with the same name as the job** containing all steps in their defined order:
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
# For a job named "my_job" with steps: step_a, step_b, step_c
|
|
124
|
+
workflows:
|
|
125
|
+
- name: my_job # Same name as the job
|
|
126
|
+
summary: "Runs the complete my_job workflow"
|
|
127
|
+
steps:
|
|
128
|
+
- step_a
|
|
129
|
+
- step_b
|
|
130
|
+
- step_c
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
This preserves the original intent of the job as a sequential workflow.
|
|
134
|
+
|
|
135
|
+
#### Case B: Job has SOME workflows defined
|
|
136
|
+
|
|
137
|
+
If the job already has one or more workflows defined, but some steps are not included in any of them, create a **separate single-step workflow for each orphaned step** with the same name as the step:
|
|
138
|
+
|
|
139
|
+
```yaml
|
|
140
|
+
# Existing workflows stay as-is, add new ones for orphans
|
|
141
|
+
workflows:
|
|
142
|
+
- name: existing_workflow
|
|
143
|
+
summary: "..."
|
|
144
|
+
steps: [...]
|
|
145
|
+
|
|
146
|
+
# Add for each orphaned step:
|
|
147
|
+
- name: orphaned_step_name # Same name as the step
|
|
148
|
+
summary: "Runs the orphaned_step_name step"
|
|
149
|
+
steps:
|
|
150
|
+
- orphaned_step_name
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
This ensures all steps remain accessible via the MCP interface while preserving the existing workflow structure.
|
|
154
|
+
|
|
155
|
+
### Step 6: Update Version Numbers
|
|
156
|
+
|
|
157
|
+
If you made significant changes to a job, bump its version number:
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
# Bump patch version for minor fixes
|
|
161
|
+
version: "1.0.0" -> version: "1.0.1"
|
|
162
|
+
|
|
163
|
+
# Add changelog entry
|
|
164
|
+
changelog:
|
|
165
|
+
- version: "1.0.1"
|
|
166
|
+
changes: "Migrated to current DeepWork format; removed deprecated fields"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Common Issues and Fixes
|
|
170
|
+
|
|
171
|
+
### Issue: Step references non-existent step in `from_step`
|
|
172
|
+
```
|
|
173
|
+
Error: Step 'implement' has file input from 'review_job_spec' but 'review_job_spec' is not in dependencies
|
|
174
|
+
```
|
|
175
|
+
**Fix:** Update `from_step` to reference a step that still exists.
|
|
176
|
+
|
|
177
|
+
### Issue: Workflow references non-existent step
|
|
178
|
+
```
|
|
179
|
+
Error: Workflow 'new_job' references non-existent step 'review_job_spec'
|
|
180
|
+
```
|
|
181
|
+
**Fix:** Remove the step from the workflow's `steps` array.
|
|
182
|
+
|
|
183
|
+
### Issue: Orphaned step warning
|
|
184
|
+
```
|
|
185
|
+
Warning: Job 'my_job' has steps not included in any workflow: standalone_step
|
|
186
|
+
```
|
|
187
|
+
**Fix:**
|
|
188
|
+
- If the job has NO workflows: Create one workflow named `my_job` with all steps in order
|
|
189
|
+
- If the job has SOME workflows: Add a `standalone_step` workflow containing just that step
|
|
190
|
+
|
|
191
|
+
## Jobs to Check
|
|
192
|
+
|
|
193
|
+
For each job in `.deepwork/jobs/`, check:
|
|
194
|
+
|
|
195
|
+
| Check | What to Look For |
|
|
196
|
+
|-------|------------------|
|
|
197
|
+
| `exposed` field | Remove from all steps |
|
|
198
|
+
| `stop_hooks` | Migrate to `hooks.after_agent` |
|
|
199
|
+
| Workflow steps | Remove references to deleted steps |
|
|
200
|
+
| Dependencies | Update to valid step IDs |
|
|
201
|
+
| File inputs | Update `from_step` references |
|
|
202
|
+
| Version | Bump if changes were made |
|
|
203
|
+
|
|
204
|
+
## Important Notes
|
|
205
|
+
|
|
206
|
+
1. **Preserve custom logic** - When migrating hooks, preserve the prompt content
|
|
207
|
+
2. **Test after changes** - Validate YAML syntax after each job fix to catch errors early
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Fix Settings Files
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
|
|
5
|
+
Clean up `.claude/settings.json` and related configuration files, removing legacy artifacts from prior DeepWork versions. This step ensures the Claude Code settings are free of deprecated permissions, duplicate hooks, and hardcoded paths.
|
|
6
|
+
|
|
7
|
+
## Task
|
|
8
|
+
|
|
9
|
+
Audit and repair the `.claude/settings.json` file, removing gunk accumulated from older DeepWork implementations.
|
|
10
|
+
|
|
11
|
+
### Step 1: Create Backup
|
|
12
|
+
|
|
13
|
+
Before making any changes, create a backup:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
cp .claude/settings.json .claude/settings.json.backup
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Step 2: Inventory DeepWork Jobs
|
|
20
|
+
|
|
21
|
+
First, get the list of jobs that exist in `.deepwork/jobs/`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ls .deepwork/jobs/
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Note these job names - you will use them to identify which `Skill(...)` entries to remove.
|
|
28
|
+
|
|
29
|
+
### Step 3: Remove DeepWork Skill Permissions
|
|
30
|
+
|
|
31
|
+
Look for and **remove** `Skill(...)` permission entries that match DeepWork jobs. Only remove entries where the skill name matches a job in `.deepwork/jobs/`.
|
|
32
|
+
|
|
33
|
+
**What to look for:**
|
|
34
|
+
```json
|
|
35
|
+
"permissions": {
|
|
36
|
+
"allow": [
|
|
37
|
+
"Skill(deepwork_jobs)", // Remove if 'deepwork_jobs' is in .deepwork/jobs/
|
|
38
|
+
"Skill(deepwork_jobs.define)", // Remove - matches job_name.step pattern
|
|
39
|
+
"Skill(competitive_research)", // Remove if 'competitive_research' is in .deepwork/jobs/
|
|
40
|
+
"Skill(my_custom_skill)", // KEEP - not a DeepWork job
|
|
41
|
+
...
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**IMPORTANT:** Only remove skills that:
|
|
47
|
+
- Exactly match a job name in `.deepwork/jobs/` (e.g., `Skill(job_name)`)
|
|
48
|
+
- Match the pattern `job_name.step_name` where `job_name` is in `.deepwork/jobs/`
|
|
49
|
+
|
|
50
|
+
**DO NOT remove** skills that don't match DeepWork jobs - the user may have created these manually for other purposes.
|
|
51
|
+
|
|
52
|
+
### Step 4: Remove Duplicate Hooks
|
|
53
|
+
|
|
54
|
+
Check for duplicate hook entries in the `hooks` section. Prior versions sometimes added the same hook multiple times.
|
|
55
|
+
|
|
56
|
+
**Example of duplicates to consolidate:**
|
|
57
|
+
```json
|
|
58
|
+
"hooks": {
|
|
59
|
+
"UserPromptSubmit": [
|
|
60
|
+
{
|
|
61
|
+
"matcher": "",
|
|
62
|
+
"hooks": [{ "type": "command", "command": "some_command" }]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"matcher": "",
|
|
66
|
+
"hooks": [{ "type": "command", "command": "some_command" }] // DUPLICATE
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Keep only one instance of each unique hook.
|
|
73
|
+
|
|
74
|
+
### Step 5: Remove Hardcoded User Paths
|
|
75
|
+
|
|
76
|
+
Search for and remove any hardcoded paths that reference specific user directories:
|
|
77
|
+
|
|
78
|
+
**Patterns to find and remove:**
|
|
79
|
+
- `/Users/username/.local/pipx/venvs/deepwork/bin/python`
|
|
80
|
+
- `/home/username/.local/...`
|
|
81
|
+
- Any path containing a specific username
|
|
82
|
+
|
|
83
|
+
These should either be removed or replaced with relative paths.
|
|
84
|
+
|
|
85
|
+
### Step 6: Remove DeepWork Rules Hooks (Fully Deprecated)
|
|
86
|
+
|
|
87
|
+
DeepWork Rules have been completely removed from the system. Remove ALL hooks related to rules:
|
|
88
|
+
|
|
89
|
+
**Hooks to remove entirely:**
|
|
90
|
+
- Any hook with command `deepwork hook rules_check`
|
|
91
|
+
- Any hook with command containing `rules_check`
|
|
92
|
+
- Any hook referencing `.deepwork/jobs/deepwork_rules/hooks/`
|
|
93
|
+
- Any hook referencing `.deepwork/rules/`
|
|
94
|
+
|
|
95
|
+
**Also remove these permissions if present:**
|
|
96
|
+
- `Skill(deepwork_rules)`
|
|
97
|
+
- `Skill(deepwork_rules.define)`
|
|
98
|
+
- `Bash(rm -rf .deepwork/tmp/rules/queue/*.json)`
|
|
99
|
+
|
|
100
|
+
### Step 7: Remove Other Deprecated Commands
|
|
101
|
+
|
|
102
|
+
Remove hooks referencing other deprecated DeepWork commands:
|
|
103
|
+
|
|
104
|
+
**Commands to remove:**
|
|
105
|
+
- `deepwork hook *` - The entire hook subcommand is deprecated
|
|
106
|
+
- References to any `.deepwork/jobs/*/hooks/` scripts
|
|
107
|
+
|
|
108
|
+
### Step 8: Clean Up Empty Sections
|
|
109
|
+
|
|
110
|
+
If after cleanup any sections are empty, consider removing them:
|
|
111
|
+
|
|
112
|
+
```json
|
|
113
|
+
// Remove if empty:
|
|
114
|
+
"hooks": {
|
|
115
|
+
"Stop": [] // Remove this empty array
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Step 9: Validate JSON
|
|
120
|
+
|
|
121
|
+
After all edits, ensure the file is valid JSON:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
python -c "import json; json.load(open('.claude/settings.json'))"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
If there are syntax errors, fix them before proceeding.
|
|
128
|
+
|
|
129
|
+
## Example Before/After
|
|
130
|
+
|
|
131
|
+
### Before (with gunk):
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"hooks": {
|
|
135
|
+
"UserPromptSubmit": [
|
|
136
|
+
{ "matcher": "", "hooks": [{ "type": "command", "command": ".deepwork/jobs/deepwork_rules/hooks/user_prompt_submit.sh" }] },
|
|
137
|
+
{ "matcher": "", "hooks": [{ "type": "command", "command": ".deepwork/jobs/deepwork_rules/hooks/user_prompt_submit.sh" }] }
|
|
138
|
+
],
|
|
139
|
+
"Stop": [
|
|
140
|
+
{ "matcher": "", "hooks": [{ "type": "command", "command": "deepwork hook rules_check" }] }
|
|
141
|
+
],
|
|
142
|
+
"SubagentStop": [
|
|
143
|
+
{ "matcher": "", "hooks": [{ "type": "command", "command": "/Users/tyler/.local/pipx/venvs/deepwork/bin/python -m deepwork.hooks.rules_check" }] }
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
"permissions": {
|
|
147
|
+
"allow": [
|
|
148
|
+
"Skill(competitive_research)",
|
|
149
|
+
"Skill(competitive_research.discover_competitors)",
|
|
150
|
+
"Skill(deepwork_jobs)",
|
|
151
|
+
"Skill(deepwork_jobs.define)",
|
|
152
|
+
"Read(./.deepwork/**)",
|
|
153
|
+
"WebSearch"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### After (cleaned):
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"hooks": {},
|
|
163
|
+
"permissions": {
|
|
164
|
+
"allow": [
|
|
165
|
+
"Read(./.deepwork/**)",
|
|
166
|
+
"WebSearch"
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Important Notes
|
|
173
|
+
|
|
174
|
+
1. **Don't remove non-DeepWork permissions** - Keep permissions like `WebSearch`, `Read(...)`, `Bash(...)` that aren't related to old DeepWork skills
|
|
175
|
+
2. **Preserve `make_new_job.sh`** - Keep any `Bash(...)` permission referencing `make_new_job.sh` (e.g., `Bash(.deepwork/jobs/deepwork_jobs/scripts/make_new_job.sh *)`) - this is a current DeepWork script
|
|
176
|
+
3. **Be conservative** - If unsure whether something is legacy, ask the user
|
|
177
|
+
4. **Document changes** - Note what was removed for the final summary
|
|
@@ -2,37 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Objective
|
|
4
4
|
|
|
5
|
-
Generate
|
|
5
|
+
Generate step instruction files for each step based on the `job.yml` specification from the define step.
|
|
6
6
|
|
|
7
7
|
## Task
|
|
8
8
|
|
|
9
|
-
Read the `job.yml` specification file
|
|
9
|
+
Read the `job.yml` specification file created by the define step and generate comprehensive instruction files for each step. The define step has already created the job directory structure.
|
|
10
10
|
|
|
11
|
-
### Step 1:
|
|
12
|
-
|
|
13
|
-
Run the `make_new_job.sh` script to create the standard directory structure:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name]
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
This creates:
|
|
20
|
-
- `.deepwork/jobs/[job_name]/` - Main job directory
|
|
21
|
-
- `.deepwork/jobs/[job_name]/steps/` - Step instruction files
|
|
22
|
-
- `.deepwork/jobs/[job_name]/hooks/` - Custom validation scripts (with .gitkeep)
|
|
23
|
-
- `.deepwork/jobs/[job_name]/templates/` - Example file formats (with .gitkeep)
|
|
24
|
-
- `.deepwork/jobs/[job_name]/AGENTS.md` - Job management guidance
|
|
25
|
-
|
|
26
|
-
**Note**: If the directory already exists (e.g., job.yml was created by define step), you can skip this step or manually create the additional directories:
|
|
27
|
-
```bash
|
|
28
|
-
mkdir -p .deepwork/jobs/[job_name]/hooks .deepwork/jobs/[job_name]/templates
|
|
29
|
-
touch .deepwork/jobs/[job_name]/hooks/.gitkeep .deepwork/jobs/[job_name]/templates/.gitkeep
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Step 2: Read and Validate the Specification
|
|
11
|
+
### Step 1: Read and Validate the Specification
|
|
33
12
|
|
|
34
13
|
1. **Locate the job.yml file**
|
|
35
|
-
- Read `.deepwork/jobs/[job_name]/job.yml` from the
|
|
14
|
+
- Read `.deepwork/jobs/[job_name]/job.yml` from the define step
|
|
36
15
|
- Parse the YAML content
|
|
37
16
|
|
|
38
17
|
2. **Validate the specification**
|
|
@@ -46,7 +25,7 @@ touch .deepwork/jobs/[job_name]/hooks/.gitkeep .deepwork/jobs/[job_name]/templat
|
|
|
46
25
|
- List of all steps with their details
|
|
47
26
|
- Understand the workflow structure
|
|
48
27
|
|
|
49
|
-
### Step
|
|
28
|
+
### Step 2: Generate Step Instruction Files
|
|
50
29
|
|
|
51
30
|
For each step in the job.yml, create a comprehensive instruction file at `.deepwork/jobs/[job_name]/steps/[step_id].md`.
|
|
52
31
|
|
|
@@ -71,11 +50,11 @@ For each step in the job.yml, create a comprehensive instruction file at `.deepw
|
|
|
71
50
|
6. **Align with stop hooks** - If the step has `stop_hooks` defined, ensure the quality criteria in the instruction file match the validation criteria in the hooks
|
|
72
51
|
7. **Ask structured questions** - When a step has user inputs, the instructions MUST explicitly tell the agent to "ask structured questions" using the AskUserQuestion tool to gather that information. Never use generic phrasing like "ask the user" - always use "ask structured questions"
|
|
73
52
|
|
|
74
|
-
### Handling
|
|
53
|
+
### Handling Quality Hooks
|
|
75
54
|
|
|
76
|
-
If a step in the job.yml has `
|
|
55
|
+
If a step in the job.yml has `hooks.after_agent` defined, the generated instruction file should:
|
|
77
56
|
|
|
78
|
-
1. **Mirror the quality criteria** - The "Quality Criteria" section should match what the
|
|
57
|
+
1. **Mirror the quality criteria** - The "Quality Criteria" section should match what the hooks will validate
|
|
79
58
|
2. **Be explicit about success** - Help the agent understand when the step is truly complete
|
|
80
59
|
3. **Include the promise pattern** - Mention that `<promise>✓ Quality Criteria Met</promise>` should be included when criteria are met
|
|
81
60
|
|
|
@@ -83,12 +62,13 @@ If a step in the job.yml has `stop_hooks` defined, the generated instruction fil
|
|
|
83
62
|
```yaml
|
|
84
63
|
- id: research_competitors
|
|
85
64
|
name: "Research Competitors"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
65
|
+
hooks:
|
|
66
|
+
after_agent:
|
|
67
|
+
- prompt: |
|
|
68
|
+
Verify the research meets criteria:
|
|
69
|
+
1. Each competitor has at least 3 data points
|
|
70
|
+
2. Sources are cited
|
|
71
|
+
3. Information is current (within last year)
|
|
92
72
|
```
|
|
93
73
|
|
|
94
74
|
**The instruction file should include:**
|
|
@@ -109,86 +89,11 @@ Step instructions can include additional `.md` files in the `steps/` directory f
|
|
|
109
89
|
|
|
110
90
|
See `.deepwork/jobs/deepwork_jobs/steps/supplemental_file_references.md` for detailed documentation and examples.
|
|
111
91
|
|
|
112
|
-
### Step
|
|
113
|
-
|
|
114
|
-
Verify that `job.yml` is in the correct location at `.deepwork/jobs/[job_name]/job.yml`. The define and review_job_spec steps should have created and validated it. If for some reason it's not there, you may need to create or move it.
|
|
115
|
-
|
|
116
|
-
### Step 5: Sync Skills
|
|
117
|
-
|
|
118
|
-
Run `deepwork sync` to generate the skills for this job:
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
deepwork sync
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
This will:
|
|
125
|
-
- Parse the job definition
|
|
126
|
-
- Generate skills for each step
|
|
127
|
-
- Make the skills available in `.claude/skills/` (or appropriate platform directory)
|
|
128
|
-
|
|
129
|
-
### Step 6: Relay Reload Instructions
|
|
130
|
-
|
|
131
|
-
After running `deepwork sync`, look at the "To use the new skills" section in the output. **Relay these exact reload instructions to the user** so they know how to pick up the new skills. Don't just reference the sync output - tell them directly what they need to do (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code, or "Run '/memory refresh'" for Gemini CLI).
|
|
132
|
-
|
|
133
|
-
### Step 7: Consider Rules for the New Job
|
|
134
|
-
|
|
135
|
-
After implementing the job, consider whether there are **rules** that would help enforce quality or consistency when working with this job's domain.
|
|
136
|
-
|
|
137
|
-
**What are rules?**
|
|
138
|
-
|
|
139
|
-
Rules are automated guardrails stored as markdown files in `.deepwork/rules/` that trigger when certain files change during an AI session. They help ensure:
|
|
140
|
-
- Documentation stays in sync with code
|
|
141
|
-
- Team guidelines are followed
|
|
142
|
-
- Architectural decisions are respected
|
|
143
|
-
- Quality standards are maintained
|
|
92
|
+
### Step 3: Verify Files
|
|
144
93
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
- Does this job produce outputs that other files depend on?
|
|
149
|
-
- Are there documentation files that should be updated when this job's outputs change?
|
|
150
|
-
- Are there quality checks or reviews that should happen when certain files in this domain change?
|
|
151
|
-
- Could changes to the job's output files impact other parts of the project?
|
|
152
|
-
|
|
153
|
-
**Examples of rules that might make sense:**
|
|
154
|
-
|
|
155
|
-
| Job Type | Potential Rule |
|
|
156
|
-
|----------|----------------|
|
|
157
|
-
| API Design | "Update API docs when endpoint definitions change" |
|
|
158
|
-
| Database Schema | "Review migrations when schema files change" |
|
|
159
|
-
| Competitive Research | "Update strategy docs when competitor analysis changes" |
|
|
160
|
-
| Feature Development | "Update changelog when feature files change" |
|
|
161
|
-
| Configuration Management | "Update install guide when config files change" |
|
|
162
|
-
|
|
163
|
-
**How to offer rule creation:**
|
|
164
|
-
|
|
165
|
-
If you identify one or more rules that would benefit the user, explain:
|
|
166
|
-
1. **What the rule would do** - What triggers it and what action it prompts
|
|
167
|
-
2. **Why it would help** - How it prevents common mistakes or keeps things in sync
|
|
168
|
-
3. **What files it would watch** - The trigger patterns
|
|
169
|
-
|
|
170
|
-
Then ask the user:
|
|
171
|
-
|
|
172
|
-
> "Would you like me to create this rule for you? I can run `/deepwork_rules.define` to set it up."
|
|
173
|
-
|
|
174
|
-
If the user agrees, invoke the `/deepwork_rules.define` command to guide them through creating the rule.
|
|
175
|
-
|
|
176
|
-
**Example dialogue:**
|
|
177
|
-
|
|
178
|
-
```
|
|
179
|
-
Based on the competitive_research job you just created, I noticed that when
|
|
180
|
-
competitor analysis files change, it would be helpful to remind you to update
|
|
181
|
-
your strategy documentation.
|
|
182
|
-
|
|
183
|
-
I'd suggest a rule like:
|
|
184
|
-
- **Name**: "Update strategy when competitor analysis changes"
|
|
185
|
-
- **Trigger**: `**/positioning_report.md`
|
|
186
|
-
- **Action**: Prompt to review and update `docs/strategy.md`
|
|
187
|
-
|
|
188
|
-
Would you like me to create this rule? I can run `/deepwork_rules.define` to set it up.
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
**Note:** Not every job needs rules. Only suggest them when they would genuinely help maintain consistency or quality. Don't force rules where they don't make sense.
|
|
94
|
+
Verify that all files are in their correct locations:
|
|
95
|
+
- `job.yml` at `.deepwork/jobs/[job_name]/job.yml` (created by define step)
|
|
96
|
+
- Step instruction files at `.deepwork/jobs/[job_name]/steps/[step_id].md`
|
|
192
97
|
|
|
193
98
|
## Example Implementation
|
|
194
99
|
|
|
@@ -205,34 +110,13 @@ For a complete worked example showing a job.yml and corresponding step instructi
|
|
|
205
110
|
5. **Use context** - The job description provides valuable context for each step
|
|
206
111
|
6. **Be specific** - Tailor instructions to the specific step, not generic advice
|
|
207
112
|
|
|
208
|
-
## Validation Before Sync
|
|
209
|
-
|
|
210
|
-
Before running `deepwork sync`, verify:
|
|
211
|
-
- All directories exist
|
|
212
|
-
- `job.yml` is in place
|
|
213
|
-
- All step instruction files exist (one per step)
|
|
214
|
-
- No file system errors
|
|
215
|
-
|
|
216
113
|
## Completion Checklist
|
|
217
114
|
|
|
218
115
|
Before marking this step complete, ensure:
|
|
219
|
-
- [ ] job.yml validated and
|
|
116
|
+
- [ ] job.yml validated and in job directory
|
|
220
117
|
- [ ] All step instruction files created
|
|
221
118
|
- [ ] Each instruction file is complete and actionable
|
|
222
|
-
- [ ] `deepwork sync` executed successfully
|
|
223
|
-
- [ ] Skills generated in platform directory
|
|
224
|
-
- [ ] User informed to follow reload instructions from `deepwork sync`
|
|
225
|
-
- [ ] Considered whether rules would benefit this job (Step 7)
|
|
226
|
-
- [ ] If rules suggested, offered to run `/deepwork_rules.define`
|
|
227
119
|
|
|
228
|
-
##
|
|
120
|
+
## Note: Workflow Availability
|
|
229
121
|
|
|
230
|
-
-
|
|
231
|
-
- All instruction files are complete (not stubs)
|
|
232
|
-
- Instructions are specific and actionable
|
|
233
|
-
- Output examples are provided in each instruction file
|
|
234
|
-
- Quality criteria defined for each step
|
|
235
|
-
- Steps with user inputs explicitly use "ask structured questions" phrasing
|
|
236
|
-
- Sync completed successfully
|
|
237
|
-
- Skills available for use
|
|
238
|
-
- Thoughtfully considered relevant rules for the job domain
|
|
122
|
+
Once the job.yml and step instruction files are created, the workflow is immediately available through the DeepWork MCP server. The MCP server reads job definitions directly from `.deepwork/jobs/` - no separate sync or installation step is required.
|