You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consolidate step instructions and remove deepwork_jobs.md reference
- Delete deepwork_jobs.md reference file (content moved to step files)
- Reduce step instruction file sizes by consolidating content
- Update generated commands for Claude and Gemini
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@@ -71,96 +71,238 @@ Please ensure these steps have been completed before proceeding.
71
71
72
72
## Objective
73
73
74
-
Generate step instruction files for each step based on the `job.yml` specification created in the define step.
75
-
76
-
**Reference**: See `deepwork_jobs.md` for job structure, step instruction format, and templates.
74
+
Generate the DeepWork job directory structure and instruction files for each step based on the `job.yml` specification created in the previous step.
77
75
78
76
## Task
79
77
80
-
Read the `job.yml` specification and create instruction files to make the job functional.
78
+
Read the `job.yml` specification file and create all the necessary files to make the job functional, including directory structure and step instruction files. Then sync the commands to make them available.
79
+
80
+
### Step 1: Create Directory Structure Using Script
**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:
-`job.yml.example` - Complete job specification example
131
+
-`step_instruction.md.example` - Complete step instruction example
132
+
133
+
**Guidelines for generating instructions:**
134
+
135
+
1.**Use the job description** - The detailed description from job.yml provides crucial context
136
+
2.**Be specific** - Don't write generic instructions; tailor them to the step's purpose
137
+
3.**Provide examples** - Show what good output looks like
138
+
4.**Explain the "why"** - Help the user understand the step's role in the workflow
139
+
5.**Quality over quantity** - Detailed, actionable instructions are better than vague ones
140
+
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
114
141
115
142
### Handling Stop Hooks
116
143
117
-
If step has `stop_hooks`, the instruction file's Quality Criteria section must match what hooks validate. Include the promise pattern: `<promise>✓ Quality Criteria Met</promise>`
144
+
If a step in the job.yml has `stop_hooks` defined, the generated instruction file should:
145
+
146
+
1.**Mirror the quality criteria** - The "Quality Criteria" section should match what the stop hooks will validate
147
+
2.**Be explicit about success** - Help the agent understand when the step is truly complete
148
+
3.**Include the promise pattern** - Mention that `<promise>✓ Quality Criteria Met</promise>` should be included when criteria are met
149
+
150
+
**Example: If the job.yml has:**
151
+
```yaml
152
+
- id: research_competitors
153
+
name: "Research Competitors"
154
+
stop_hooks:
155
+
- prompt: |
156
+
Verify the research meets criteria:
157
+
1. Each competitor has at least 3 data points
158
+
2. Sources are cited
159
+
3. Information is current (within last year)
160
+
```
118
161
119
-
### Step 4: Sync Commands
162
+
**The instruction file should include:**
163
+
```markdown
164
+
## Quality Criteria
165
+
166
+
- Each competitor has at least 3 distinct data points
167
+
- All information is sourced with citations
168
+
- Data is current (from within the last year)
169
+
- When all criteria are met, include `<promise>✓ Quality Criteria Met</promise>` in your response
170
+
```
171
+
172
+
This alignment ensures the AI agent knows exactly what will be validated and can self-check before completing.
173
+
174
+
### Using Supplementary Reference Files
175
+
176
+
Step instructions can include additional `.md` files in the `steps/` directory for detailed examples, templates, or reference material. Reference them using the full path from the project root.
177
+
178
+
See `.deepwork/jobs/deepwork_jobs/steps/supplemental_file_references.md` for detailed documentation and examples.
179
+
180
+
### Step 4: Verify job.yml Location
181
+
182
+
Verify that `job.yml` is in the correct location at `.deepwork/jobs/[job_name]/job.yml`. The define step should have created it there. If for some reason it's not there, you may need to create or move it.
183
+
184
+
### Step 5: Sync Commands
185
+
186
+
Run `deepwork sync` to generate the slash-commands for this job:
120
187
121
188
```bash
122
189
deepwork sync
123
190
```
124
191
125
-
### Step 5: Relay Reload Instructions
192
+
This will:
193
+
- Parse the job definition
194
+
- Generate slash-commands for each step
195
+
- Make the commands available in `.claude/commands/` (or appropriate platform directory)
196
+
197
+
### Step 6: Relay Reload Instructions
198
+
199
+
After running `deepwork sync`, look at the "To use the new commands" section in the output. **Relay these exact reload instructions to the user** so they know how to pick up the new commands. 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).
200
+
201
+
### Step 7: Consider Policies for the New Job
202
+
203
+
After implementing the job, consider whether there are **policies** that would help enforce quality or consistency when working with this job's domain.
204
+
205
+
**What are policies?**
206
+
207
+
Policies are automated guardrails defined in `.deepwork.policy.yml` that trigger when certain files change during an AI session. They help ensure:
208
+
- Documentation stays in sync with code
209
+
- Team guidelines are followed
210
+
- Architectural decisions are respected
211
+
- Quality standards are maintained
212
+
213
+
**When to suggest policies:**
214
+
215
+
Think about the job you just implemented and ask:
216
+
- Does this job produce outputs that other files depend on?
217
+
- Are there documentation files that should be updated when this job's outputs change?
218
+
- Are there quality checks or reviews that should happen when certain files in this domain change?
219
+
- Could changes to the job's output files impact other parts of the project?
220
+
221
+
**Examples of policies that might make sense:**
222
+
223
+
| Job Type | Potential Policy |
224
+
|----------|------------------|
225
+
| API Design | "Update API docs when endpoint definitions change" |
If you identify one or more policies that would benefit the user, explain:
234
+
1. **What the policy would do** - What triggers it and what action it prompts
235
+
2. **Why it would help** - How it prevents common mistakes or keeps things in sync
236
+
3. **What files it would watch** - The trigger patterns
237
+
238
+
Then ask the user:
239
+
240
+
> "Would you like me to create this policy for you? I can run `/deepwork_policy.define` to set it up."
241
+
242
+
If the user agrees, invoke the `/deepwork_policy.define` command to guide them through creating the policy.
243
+
244
+
**Example dialogue:**
245
+
246
+
```
247
+
Based on the competitive_research job you just created, I noticed that when
248
+
competitor analysis files change, it would be helpful to remind you to update
249
+
your strategy documentation.
250
+
251
+
I'd suggest a policy like:
252
+
-**Name**: "Update strategy when competitor analysis changes"
253
+
-**Trigger**: `**/positioning_report.md`
254
+
-**Action**: Prompt to review and update `docs/strategy.md`
255
+
256
+
Would you like me to create this policy? I can run `/deepwork_policy.define` to set it up.
257
+
```
258
+
259
+
**Note:** Not every job needs policies. Only suggest them when they would genuinely help maintain consistency or quality. Don't force policies where they don't make sense.
126
260
127
-
Tell user how to reload commands:
128
-
-**Claude Code**: Type `exit` then run `claude --resume`
129
-
-**Gemini CLI**: Run `/memory refresh`
261
+
## Example Implementation
130
262
131
-
### Step 6: Consider Policies
263
+
For a complete worked example showing a job.yml and corresponding step instruction file, see:
0 commit comments