Skip to content

Commit bb4e1a6

Browse files
committed
Improve learn command with conciseness criteria and shared file extraction
Updates to the learn command: - Simplified working folder identification (use conversation history, fall back to git diff) - Added quality criteria for instruction conciseness (no redundancy/verbosity) - Added Step 4b for extracting shared/lengthy content into referenced files - Instructions can now reference shared files in steps/shared/ directory This helps keep job instructions maintainable and DRY.
1 parent 08129db commit bb4e1a6

6 files changed

Lines changed: 176 additions & 40 deletions

File tree

.claude/commands/deepwork_jobs.learn.md

Lines changed: 51 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ hooks:
1414
1. **Conversation Analyzed**: Did you review the conversation for DeepWork job executions?
1515
2. **Confusion Identified**: Did you identify points of confusion, errors, or inefficiencies?
1616
3. **Instructions Improved**: Were job instructions updated to address identified issues?
17-
4. **Bespoke Learnings Captured**: Were run-specific learnings added to AGENTS.md?
18-
5. **File References Used**: Do AGENTS.md entries reference other files where appropriate?
19-
6. **Working Folder Correct**: Is AGENTS.md in the correct working folder for the job?
20-
7. **Generalizable Separated**: Are generalizable improvements in instructions, not AGENTS.md?
21-
8. **Sync Complete**: Has `deepwork sync` been run if instructions were modified?
17+
4. **Instructions Concise**: Are instructions free of redundancy and unnecessary verbosity?
18+
5. **Shared Content Extracted**: Is lengthy/duplicated content extracted into referenced files?
19+
6. **Bespoke Learnings Captured**: Were run-specific learnings added to AGENTS.md?
20+
7. **File References Used**: Do AGENTS.md entries reference other files where appropriate?
21+
8. **Working Folder Correct**: Is AGENTS.md in the correct working folder for the job?
22+
9. **Generalizable Separated**: Are generalizable improvements in instructions, not AGENTS.md?
23+
10. **Sync Complete**: Has `deepwork sync` been run if instructions were modified?
2224
2325
If ANY criterion is not met, continue working to address it.
2426
If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.
@@ -79,9 +81,8 @@ Analyze the conversation history to extract learnings and improvements, then app
7981
- Note the order of execution
8082

8183
2. **Identify the working folder**
82-
- Find where outputs were created during job execution
83-
- This is typically specified in the job's working directory
84-
- Common patterns: project root, `./output/`, or job-specific directories
84+
- Should be clear from conversation history where work was done
85+
- If unclear, run `git diff` to see where changes were made on the branch
8586

8687
3. **If no job was specified**, ask the user:
8788
- "Which DeepWork job would you like me to learn from?"
@@ -150,15 +151,46 @@ For each generalizable learning:
150151
- Clarify ambiguous instructions
151152
- Update quality criteria if needed
152153

153-
3. **Preserve instruction structure**
154+
3. **Keep instructions concise**
155+
- Avoid redundancy - don't repeat the same guidance in multiple places
156+
- Be direct - remove verbose explanations that don't add value
157+
- Prefer bullet points over paragraphs where appropriate
158+
159+
4. **Preserve instruction structure**
154160
- Keep existing sections (Objective, Task, Process, Output Format, Quality Criteria)
155161
- Add to appropriate sections rather than restructuring
156162
- Maintain consistency with other steps
157163

158-
4. **Track changes for changelog**
164+
5. **Track changes for changelog**
159165
- Note what was changed and why
160166
- Prepare changelog entry for job.yml
161167

168+
### Step 4b: Extract Shared Content into Referenced Files
169+
170+
Review all instruction files for the job and identify content that:
171+
- Appears in multiple step instructions (duplicated)
172+
- Is lengthy and could be extracted for clarity
173+
- Would benefit from being maintained in one place
174+
175+
**Extract to shared files:**
176+
177+
1. **Create shared files** in `.deepwork/jobs/[job_name]/steps/shared/`
178+
- `conventions.md` - Coding/formatting conventions used across steps
179+
- `examples.md` - Common examples referenced by multiple steps
180+
- `schemas.md` - Data structures or formats used throughout
181+
182+
2. **Reference from instructions** using markdown includes or explicit references:
183+
```markdown
184+
## Conventions
185+
186+
Follow the conventions defined in `shared/conventions.md`.
187+
```
188+
189+
3. **Benefits of extraction:**
190+
- Single source of truth - update once, applies everywhere
191+
- Shorter instruction files - easier to read and maintain
192+
- Consistent guidance across steps
193+
162194
### Step 5: Create/Update AGENTS.md (Bespoke Learnings)
163195

164196
The AGENTS.md file captures project-specific knowledge that helps future agent runs.
@@ -285,6 +317,8 @@ When adding entries to AGENTS.md, prefer these patterns:
285317
- Points of confusion and inefficiency are identified
286318
- Learnings are correctly classified (generalizable vs bespoke)
287319
- Job instructions updated for generalizable improvements
320+
- Instructions are concise - no redundancy or unnecessary verbosity
321+
- Shared/lengthy content extracted into referenced files where appropriate
288322
- AGENTS.md created/updated with bespoke learnings
289323
- File references used instead of duplicating content
290324
- AGENTS.md is in the correct working folder
@@ -415,11 +449,13 @@ Verify the learning process meets ALL quality criteria before completing:
415449
1. **Conversation Analyzed**: Did you review the conversation for DeepWork job executions?
416450
2. **Confusion Identified**: Did you identify points of confusion, errors, or inefficiencies?
417451
3. **Instructions Improved**: Were job instructions updated to address identified issues?
418-
4. **Bespoke Learnings Captured**: Were run-specific learnings added to AGENTS.md?
419-
5. **File References Used**: Do AGENTS.md entries reference other files where appropriate?
420-
6. **Working Folder Correct**: Is AGENTS.md in the correct working folder for the job?
421-
7. **Generalizable Separated**: Are generalizable improvements in instructions, not AGENTS.md?
422-
8. **Sync Complete**: Has `deepwork sync` been run if instructions were modified?
452+
4. **Instructions Concise**: Are instructions free of redundancy and unnecessary verbosity?
453+
5. **Shared Content Extracted**: Is lengthy/duplicated content extracted into referenced files?
454+
6. **Bespoke Learnings Captured**: Were run-specific learnings added to AGENTS.md?
455+
7. **File References Used**: Do AGENTS.md entries reference other files where appropriate?
456+
8. **Working Folder Correct**: Is AGENTS.md in the correct working folder for the job?
457+
9. **Generalizable Separated**: Are generalizable improvements in instructions, not AGENTS.md?
458+
10. **Sync Complete**: Has `deepwork sync` been run if instructions were modified?
423459

424460
If ANY criterion is not met, continue working to address it.
425461
If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.

.deepwork/jobs/deepwork_jobs/job.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@ steps:
9595
1. **Conversation Analyzed**: Did you review the conversation for DeepWork job executions?
9696
2. **Confusion Identified**: Did you identify points of confusion, errors, or inefficiencies?
9797
3. **Instructions Improved**: Were job instructions updated to address identified issues?
98-
4. **Bespoke Learnings Captured**: Were run-specific learnings added to AGENTS.md?
99-
5. **File References Used**: Do AGENTS.md entries reference other files where appropriate?
100-
6. **Working Folder Correct**: Is AGENTS.md in the correct working folder for the job?
101-
7. **Generalizable Separated**: Are generalizable improvements in instructions, not AGENTS.md?
102-
8. **Sync Complete**: Has `deepwork sync` been run if instructions were modified?
98+
4. **Instructions Concise**: Are instructions free of redundancy and unnecessary verbosity?
99+
5. **Shared Content Extracted**: Is lengthy/duplicated content extracted into referenced files?
100+
6. **Bespoke Learnings Captured**: Were run-specific learnings added to AGENTS.md?
101+
7. **File References Used**: Do AGENTS.md entries reference other files where appropriate?
102+
8. **Working Folder Correct**: Is AGENTS.md in the correct working folder for the job?
103+
9. **Generalizable Separated**: Are generalizable improvements in instructions, not AGENTS.md?
104+
10. **Sync Complete**: Has `deepwork sync` been run if instructions were modified?
103105
104106
If ANY criterion is not met, continue working to address it.
105107
If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.

.deepwork/jobs/deepwork_jobs/steps/learn.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ Analyze the conversation history to extract learnings and improvements, then app
1818
- Note the order of execution
1919

2020
2. **Identify the working folder**
21-
- Find where outputs were created during job execution
22-
- This is typically specified in the job's working directory
23-
- Common patterns: project root, `./output/`, or job-specific directories
21+
- Should be clear from conversation history where work was done
22+
- If unclear, run `git diff` to see where changes were made on the branch
2423

2524
3. **If no job was specified**, ask the user:
2625
- "Which DeepWork job would you like me to learn from?"
@@ -89,15 +88,46 @@ For each generalizable learning:
8988
- Clarify ambiguous instructions
9089
- Update quality criteria if needed
9190

92-
3. **Preserve instruction structure**
91+
3. **Keep instructions concise**
92+
- Avoid redundancy - don't repeat the same guidance in multiple places
93+
- Be direct - remove verbose explanations that don't add value
94+
- Prefer bullet points over paragraphs where appropriate
95+
96+
4. **Preserve instruction structure**
9397
- Keep existing sections (Objective, Task, Process, Output Format, Quality Criteria)
9498
- Add to appropriate sections rather than restructuring
9599
- Maintain consistency with other steps
96100

97-
4. **Track changes for changelog**
101+
5. **Track changes for changelog**
98102
- Note what was changed and why
99103
- Prepare changelog entry for job.yml
100104

105+
### Step 4b: Extract Shared Content into Referenced Files
106+
107+
Review all instruction files for the job and identify content that:
108+
- Appears in multiple step instructions (duplicated)
109+
- Is lengthy and could be extracted for clarity
110+
- Would benefit from being maintained in one place
111+
112+
**Extract to shared files:**
113+
114+
1. **Create shared files** in `.deepwork/jobs/[job_name]/steps/shared/`
115+
- `conventions.md` - Coding/formatting conventions used across steps
116+
- `examples.md` - Common examples referenced by multiple steps
117+
- `schemas.md` - Data structures or formats used throughout
118+
119+
2. **Reference from instructions** using markdown includes or explicit references:
120+
```markdown
121+
## Conventions
122+
123+
Follow the conventions defined in `shared/conventions.md`.
124+
```
125+
126+
3. **Benefits of extraction:**
127+
- Single source of truth - update once, applies everywhere
128+
- Shorter instruction files - easier to read and maintain
129+
- Consistent guidance across steps
130+
101131
### Step 5: Create/Update AGENTS.md (Bespoke Learnings)
102132

103133
The AGENTS.md file captures project-specific knowledge that helps future agent runs.
@@ -224,6 +254,8 @@ When adding entries to AGENTS.md, prefer these patterns:
224254
- Points of confusion and inefficiency are identified
225255
- Learnings are correctly classified (generalizable vs bespoke)
226256
- Job instructions updated for generalizable improvements
257+
- Instructions are concise - no redundancy or unnecessary verbosity
258+
- Shared/lengthy content extracted into referenced files where appropriate
227259
- AGENTS.md created/updated with bespoke learnings
228260
- File references used instead of duplicating content
229261
- AGENTS.md is in the correct working folder

.gemini/commands/deepwork_jobs/learn.toml

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ Analyze the conversation history to extract learnings and improvements, then app
5050
- Note the order of execution
5151
5252
2. **Identify the working folder**
53-
- Find where outputs were created during job execution
54-
- This is typically specified in the job's working directory
55-
- Common patterns: project root, `./output/`, or job-specific directories
53+
- Should be clear from conversation history where work was done
54+
- If unclear, run `git diff` to see where changes were made on the branch
5655
5756
3. **If no job was specified**, ask the user:
5857
- "Which DeepWork job would you like me to learn from?"
@@ -121,15 +120,46 @@ For each generalizable learning:
121120
- Clarify ambiguous instructions
122121
- Update quality criteria if needed
123122
124-
3. **Preserve instruction structure**
123+
3. **Keep instructions concise**
124+
- Avoid redundancy - don't repeat the same guidance in multiple places
125+
- Be direct - remove verbose explanations that don't add value
126+
- Prefer bullet points over paragraphs where appropriate
127+
128+
4. **Preserve instruction structure**
125129
- Keep existing sections (Objective, Task, Process, Output Format, Quality Criteria)
126130
- Add to appropriate sections rather than restructuring
127131
- Maintain consistency with other steps
128132
129-
4. **Track changes for changelog**
133+
5. **Track changes for changelog**
130134
- Note what was changed and why
131135
- Prepare changelog entry for job.yml
132136
137+
### Step 4b: Extract Shared Content into Referenced Files
138+
139+
Review all instruction files for the job and identify content that:
140+
- Appears in multiple step instructions (duplicated)
141+
- Is lengthy and could be extracted for clarity
142+
- Would benefit from being maintained in one place
143+
144+
**Extract to shared files:**
145+
146+
1. **Create shared files** in `.deepwork/jobs/[job_name]/steps/shared/`
147+
- `conventions.md` - Coding/formatting conventions used across steps
148+
- `examples.md` - Common examples referenced by multiple steps
149+
- `schemas.md` - Data structures or formats used throughout
150+
151+
2. **Reference from instructions** using markdown includes or explicit references:
152+
```markdown
153+
## Conventions
154+
155+
Follow the conventions defined in `shared/conventions.md`.
156+
```
157+
158+
3. **Benefits of extraction:**
159+
- Single source of truth - update once, applies everywhere
160+
- Shorter instruction files - easier to read and maintain
161+
- Consistent guidance across steps
162+
133163
### Step 5: Create/Update AGENTS.md (Bespoke Learnings)
134164
135165
The AGENTS.md file captures project-specific knowledge that helps future agent runs.
@@ -256,6 +286,8 @@ When adding entries to AGENTS.md, prefer these patterns:
256286
- Points of confusion and inefficiency are identified
257287
- Learnings are correctly classified (generalizable vs bespoke)
258288
- Job instructions updated for generalizable improvements
289+
- Instructions are concise - no redundancy or unnecessary verbosity
290+
- Shared/lengthy content extracted into referenced files where appropriate
259291
- AGENTS.md created/updated with bespoke learnings
260292
- File references used instead of duplicating content
261293
- AGENTS.md is in the correct working folder

src/deepwork/standard_jobs/deepwork_jobs/job.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,13 @@ steps:
9595
1. **Conversation Analyzed**: Did you review the conversation for DeepWork job executions?
9696
2. **Confusion Identified**: Did you identify points of confusion, errors, or inefficiencies?
9797
3. **Instructions Improved**: Were job instructions updated to address identified issues?
98-
4. **Bespoke Learnings Captured**: Were run-specific learnings added to AGENTS.md?
99-
5. **File References Used**: Do AGENTS.md entries reference other files where appropriate?
100-
6. **Working Folder Correct**: Is AGENTS.md in the correct working folder for the job?
101-
7. **Generalizable Separated**: Are generalizable improvements in instructions, not AGENTS.md?
102-
8. **Sync Complete**: Has `deepwork sync` been run if instructions were modified?
98+
4. **Instructions Concise**: Are instructions free of redundancy and unnecessary verbosity?
99+
5. **Shared Content Extracted**: Is lengthy/duplicated content extracted into referenced files?
100+
6. **Bespoke Learnings Captured**: Were run-specific learnings added to AGENTS.md?
101+
7. **File References Used**: Do AGENTS.md entries reference other files where appropriate?
102+
8. **Working Folder Correct**: Is AGENTS.md in the correct working folder for the job?
103+
9. **Generalizable Separated**: Are generalizable improvements in instructions, not AGENTS.md?
104+
10. **Sync Complete**: Has `deepwork sync` been run if instructions were modified?
103105
104106
If ANY criterion is not met, continue working to address it.
105107
If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.

src/deepwork/standard_jobs/deepwork_jobs/steps/learn.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ Analyze the conversation history to extract learnings and improvements, then app
1818
- Note the order of execution
1919

2020
2. **Identify the working folder**
21-
- Find where outputs were created during job execution
22-
- This is typically specified in the job's working directory
23-
- Common patterns: project root, `./output/`, or job-specific directories
21+
- Should be clear from conversation history where work was done
22+
- If unclear, run `git diff` to see where changes were made on the branch
2423

2524
3. **If no job was specified**, ask the user:
2625
- "Which DeepWork job would you like me to learn from?"
@@ -89,15 +88,46 @@ For each generalizable learning:
8988
- Clarify ambiguous instructions
9089
- Update quality criteria if needed
9190

92-
3. **Preserve instruction structure**
91+
3. **Keep instructions concise**
92+
- Avoid redundancy - don't repeat the same guidance in multiple places
93+
- Be direct - remove verbose explanations that don't add value
94+
- Prefer bullet points over paragraphs where appropriate
95+
96+
4. **Preserve instruction structure**
9397
- Keep existing sections (Objective, Task, Process, Output Format, Quality Criteria)
9498
- Add to appropriate sections rather than restructuring
9599
- Maintain consistency with other steps
96100

97-
4. **Track changes for changelog**
101+
5. **Track changes for changelog**
98102
- Note what was changed and why
99103
- Prepare changelog entry for job.yml
100104

105+
### Step 4b: Extract Shared Content into Referenced Files
106+
107+
Review all instruction files for the job and identify content that:
108+
- Appears in multiple step instructions (duplicated)
109+
- Is lengthy and could be extracted for clarity
110+
- Would benefit from being maintained in one place
111+
112+
**Extract to shared files:**
113+
114+
1. **Create shared files** in `.deepwork/jobs/[job_name]/steps/shared/`
115+
- `conventions.md` - Coding/formatting conventions used across steps
116+
- `examples.md` - Common examples referenced by multiple steps
117+
- `schemas.md` - Data structures or formats used throughout
118+
119+
2. **Reference from instructions** using markdown includes or explicit references:
120+
```markdown
121+
## Conventions
122+
123+
Follow the conventions defined in `shared/conventions.md`.
124+
```
125+
126+
3. **Benefits of extraction:**
127+
- Single source of truth - update once, applies everywhere
128+
- Shorter instruction files - easier to read and maintain
129+
- Consistent guidance across steps
130+
101131
### Step 5: Create/Update AGENTS.md (Bespoke Learnings)
102132

103133
The AGENTS.md file captures project-specific knowledge that helps future agent runs.
@@ -224,6 +254,8 @@ When adding entries to AGENTS.md, prefer these patterns:
224254
- Points of confusion and inefficiency are identified
225255
- Learnings are correctly classified (generalizable vs bespoke)
226256
- Job instructions updated for generalizable improvements
257+
- Instructions are concise - no redundancy or unnecessary verbosity
258+
- Shared/lengthy content extracted into referenced files where appropriate
227259
- AGENTS.md created/updated with bespoke learnings
228260
- File references used instead of duplicating content
229261
- AGENTS.md is in the correct working folder

0 commit comments

Comments
 (0)