deepwork 0.1.0__tar.gz → 0.1.1__tar.gz

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.
Files changed (132) hide show
  1. {deepwork-0.1.0 → deepwork-0.1.1}/.claude/commands/deepwork_jobs.define.md +4 -3
  2. {deepwork-0.1.0 → deepwork-0.1.1}/.claude/commands/deepwork_jobs.implement.md +10 -11
  3. deepwork-0.1.1/.claude/commands/deepwork_jobs.learn.md +499 -0
  4. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_jobs/job.yml +24 -19
  5. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_jobs/steps/implement.md +4 -6
  6. deepwork-0.1.1/.deepwork/jobs/deepwork_jobs/steps/learn.md +346 -0
  7. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork.policy.yml +29 -1
  8. {deepwork-0.1.0 → deepwork-0.1.1}/.gemini/commands/deepwork_jobs/define.toml +4 -3
  9. {deepwork-0.1.0 → deepwork-0.1.1}/.gemini/commands/deepwork_jobs/implement.toml +10 -11
  10. deepwork-0.1.1/.gemini/commands/deepwork_jobs/learn.toml +438 -0
  11. {deepwork-0.1.0 → deepwork-0.1.1}/.gemini/commands/deepwork_jobs/refine.toml +2 -2
  12. {deepwork-0.1.0 → deepwork-0.1.1}/.github/workflows/cla.yml +4 -8
  13. deepwork-0.1.1/CHANGELOG.md +41 -0
  14. {deepwork-0.1.0 → deepwork-0.1.1/CLA/version_1}/CLA.md +1 -1
  15. {deepwork-0.1.0/.github → deepwork-0.1.1/CLA/version_1}/CLA_SIGNATORIES.md +2 -4
  16. {deepwork-0.1.0 → deepwork-0.1.1}/CONTRIBUTING.md +4 -4
  17. {deepwork-0.1.0 → deepwork-0.1.1}/PKG-INFO +51 -128
  18. {deepwork-0.1.0 → deepwork-0.1.1}/README.md +50 -127
  19. {deepwork-0.1.0 → deepwork-0.1.1}/pyproject.toml +1 -1
  20. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/cli/sync.py +9 -0
  21. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/core/adapters.py +17 -0
  22. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/core/policy_parser.py +10 -0
  23. deepwork-0.1.1/src/deepwork/hooks/evaluate_policies.py +376 -0
  24. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/schemas/policy_schema.py +10 -0
  25. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/standard_jobs/deepwork_jobs/job.yml +24 -19
  26. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/standard_jobs/deepwork_jobs/steps/define.md +6 -0
  27. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/standard_jobs/deepwork_jobs/steps/implement.md +10 -6
  28. deepwork-0.1.1/src/deepwork/standard_jobs/deepwork_jobs/steps/learn.md +346 -0
  29. deepwork-0.1.1/src/deepwork/standard_jobs/deepwork_jobs/steps/supplemental_file_references.md +40 -0
  30. deepwork-0.1.0/src/deepwork/standard_jobs/deepwork_policy/hooks/capture_work_tree.sh → deepwork-0.1.1/src/deepwork/standard_jobs/deepwork_policy/hooks/capture_prompt_work_tree.sh +3 -2
  31. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/standard_jobs/deepwork_policy/hooks/policy_stop_hook.sh +3 -19
  32. deepwork-0.1.1/src/deepwork/standard_jobs/deepwork_policy/hooks/user_prompt_submit.sh +16 -0
  33. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/standard_jobs/deepwork_policy/steps/define.md +22 -1
  34. {deepwork-0.1.0 → deepwork-0.1.1}/tests/integration/test_install_flow.py +2 -2
  35. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_policy_parser.py +49 -0
  36. {deepwork-0.1.0 → deepwork-0.1.1}/uv.lock +1 -1
  37. deepwork-0.1.0/.claude/commands/deepwork_jobs.refine.md +0 -595
  38. deepwork-0.1.0/.deepwork/jobs/deepwork_jobs/steps/refine.md +0 -447
  39. deepwork-0.1.0/.github/CLA_SETUP.md +0 -171
  40. deepwork-0.1.0/CHANGELOG.md +0 -12
  41. deepwork-0.1.0/src/deepwork/hooks/evaluate_policies.py +0 -159
  42. deepwork-0.1.0/src/deepwork/standard_jobs/deepwork_jobs/steps/refine.md +0 -447
  43. deepwork-0.1.0/src/deepwork/standard_jobs/deepwork_policy/hooks/get_changed_files.sh +0 -30
  44. deepwork-0.1.0/src/deepwork/standard_jobs/deepwork_policy/hooks/user_prompt_submit.sh +0 -17
  45. {deepwork-0.1.0 → deepwork-0.1.1}/.claude/commands/AGENTS.md +0 -0
  46. {deepwork-0.1.0 → deepwork-0.1.1}/.claude/commands/add_platform.add_capabilities.md +0 -0
  47. {deepwork-0.1.0 → deepwork-0.1.1}/.claude/commands/add_platform.implement.md +0 -0
  48. {deepwork-0.1.0 → deepwork-0.1.1}/.claude/commands/add_platform.research.md +0 -0
  49. {deepwork-0.1.0 → deepwork-0.1.1}/.claude/commands/add_platform.verify.md +0 -0
  50. {deepwork-0.1.0 → deepwork-0.1.1}/.claude/commands/deepwork_policy.define.md +0 -0
  51. {deepwork-0.1.0 → deepwork-0.1.1}/.claude/settings.json +0 -0
  52. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/.gitignore +0 -0
  53. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/config.yml +0 -0
  54. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/add_platform/job.yml +0 -0
  55. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/add_platform/steps/add_capabilities.md +0 -0
  56. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/add_platform/steps/implement.md +0 -0
  57. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/add_platform/steps/research.md +0 -0
  58. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/add_platform/steps/verify.md +0 -0
  59. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_jobs/steps/define.md +0 -0
  60. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_policy/hooks/capture_work_tree.sh +0 -0
  61. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_policy/hooks/get_changed_files.sh +0 -0
  62. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_policy/hooks/global_hooks.yml +0 -0
  63. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_policy/hooks/policy_stop_hook.sh +0 -0
  64. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_policy/hooks/user_prompt_submit.sh +0 -0
  65. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_policy/job.yml +0 -0
  66. {deepwork-0.1.0 → deepwork-0.1.1}/.deepwork/jobs/deepwork_policy/steps/define.md +0 -0
  67. {deepwork-0.1.0 → deepwork-0.1.1}/.gemini/commands/add_platform/add_capabilities.toml +0 -0
  68. {deepwork-0.1.0 → deepwork-0.1.1}/.gemini/commands/add_platform/implement.toml +0 -0
  69. {deepwork-0.1.0 → deepwork-0.1.1}/.gemini/commands/add_platform/research.toml +0 -0
  70. {deepwork-0.1.0 → deepwork-0.1.1}/.gemini/commands/add_platform/verify.toml +0 -0
  71. {deepwork-0.1.0 → deepwork-0.1.1}/.gemini/commands/deepwork_policy/define.toml +0 -0
  72. {deepwork-0.1.0 → deepwork-0.1.1}/.github/workflows/release.yml +0 -0
  73. {deepwork-0.1.0 → deepwork-0.1.1}/.github/workflows/validate.yml +0 -0
  74. {deepwork-0.1.0 → deepwork-0.1.1}/.gitignore +0 -0
  75. {deepwork-0.1.0 → deepwork-0.1.1}/LICENSE.md +0 -0
  76. {deepwork-0.1.0 → deepwork-0.1.1}/claude.md +0 -0
  77. {deepwork-0.1.0 → deepwork-0.1.1}/doc/architecture.md +0 -0
  78. {deepwork-0.1.0 → deepwork-0.1.1}/doc/platforms/gemini/cli_configuration.md +0 -0
  79. {deepwork-0.1.0 → deepwork-0.1.1}/doc/platforms/gemini/hooks_system.md +0 -0
  80. {deepwork-0.1.0 → deepwork-0.1.1}/job_library/README.md +0 -0
  81. {deepwork-0.1.0 → deepwork-0.1.1}/shell.nix +0 -0
  82. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/__init__.py +0 -0
  83. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/cli/__init__.py +0 -0
  84. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/cli/install.py +0 -0
  85. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/cli/main.py +0 -0
  86. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/core/__init__.py +0 -0
  87. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/core/detector.py +0 -0
  88. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/core/generator.py +0 -0
  89. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/core/hooks_syncer.py +0 -0
  90. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/core/parser.py +0 -0
  91. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/hooks/__init__.py +0 -0
  92. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/schemas/__init__.py +0 -0
  93. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/schemas/job_schema.py +0 -0
  94. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/standard_jobs/deepwork_policy/hooks/global_hooks.yml +0 -0
  95. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/standard_jobs/deepwork_policy/job.yml +0 -0
  96. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/templates/__init__.py +0 -0
  97. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/templates/claude/command-job-step.md.jinja +0 -0
  98. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/templates/gemini/command-job-step.toml.jinja +0 -0
  99. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/utils/__init__.py +0 -0
  100. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/utils/fs.py +0 -0
  101. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/utils/git.py +0 -0
  102. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/utils/validation.py +0 -0
  103. {deepwork-0.1.0 → deepwork-0.1.1}/src/deepwork/utils/yaml_utils.py +0 -0
  104. {deepwork-0.1.0 → deepwork-0.1.1}/tests/__init__.py +0 -0
  105. {deepwork-0.1.0 → deepwork-0.1.1}/tests/conftest.py +0 -0
  106. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/jobs/complex_job/job.yml +0 -0
  107. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/jobs/complex_job/steps/comparative_report.md +0 -0
  108. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/jobs/complex_job/steps/identify_competitors.md +0 -0
  109. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/jobs/complex_job/steps/primary_research.md +0 -0
  110. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/jobs/complex_job/steps/secondary_research.md +0 -0
  111. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/jobs/invalid_job/job.yml +0 -0
  112. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/jobs/simple_job/job.yml +0 -0
  113. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/jobs/simple_job/steps/single_step.md +0 -0
  114. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/policies/empty_policy.yml +0 -0
  115. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/policies/instructions/security_review.md +0 -0
  116. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/policies/invalid_missing_instructions.yml +0 -0
  117. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/policies/invalid_missing_trigger.yml +0 -0
  118. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/policies/multiple_policies.yml +0 -0
  119. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/policies/policy_with_instructions_file.yml +0 -0
  120. {deepwork-0.1.0 → deepwork-0.1.1}/tests/fixtures/policies/valid_policy.yml +0 -0
  121. {deepwork-0.1.0 → deepwork-0.1.1}/tests/integration/test_full_workflow.py +0 -0
  122. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_adapters.py +0 -0
  123. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_detector.py +0 -0
  124. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_evaluate_policies.py +0 -0
  125. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_fs.py +0 -0
  126. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_generator.py +0 -0
  127. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_git.py +0 -0
  128. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_hooks_syncer.py +0 -0
  129. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_parser.py +0 -0
  130. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_stop_hooks.py +0 -0
  131. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_validation.py +0 -0
  132. {deepwork-0.1.0 → deepwork-0.1.1}/tests/unit/test_yaml_utils.py +0 -0
@@ -44,14 +44,15 @@ hooks:
44
44
  ## Job Overview
45
45
 
46
46
  Core commands for managing DeepWork jobs. These commands help you define new multi-step
47
- workflows and refine existing ones.
47
+ workflows and learn from running them.
48
48
 
49
49
  The `define` command guides you through an interactive process to create a new job by
50
50
  asking detailed questions about your workflow, understanding each step's inputs and outputs,
51
51
  and generating all necessary files.
52
52
 
53
- The `refine` command helps you modify existing jobs safely by understanding what you want
54
- to change, validating the impact, and ensuring consistency across your workflow.
53
+ The `learn` command reflects on conversations where DeepWork jobs were run, identifies
54
+ confusion or inefficiencies, and improves job instructions. It also captures bespoke
55
+ learnings specific to the current run into AGENTS.md files in the working folder.
55
56
 
56
57
 
57
58
 
@@ -48,14 +48,15 @@ hooks:
48
48
  ## Job Overview
49
49
 
50
50
  Core commands for managing DeepWork jobs. These commands help you define new multi-step
51
- workflows and refine existing ones.
51
+ workflows and learn from running them.
52
52
 
53
53
  The `define` command guides you through an interactive process to create a new job by
54
54
  asking detailed questions about your workflow, understanding each step's inputs and outputs,
55
55
  and generating all necessary files.
56
56
 
57
- The `refine` command helps you modify existing jobs safely by understanding what you want
58
- to change, validating the impact, and ensuring consistency across your workflow.
57
+ The `learn` command reflects on conversations where DeepWork jobs were run, identifies
58
+ confusion or inefficiencies, and improves job instructions. It also captures bespoke
59
+ learnings specific to the current run into AGENTS.md files in the working folder.
59
60
 
60
61
 
61
62
  ## Prerequisites
@@ -230,11 +231,9 @@ This will:
230
231
  - Generate slash-commands for each step
231
232
  - Make the commands available in `.claude/commands/` (or appropriate platform directory)
232
233
 
233
- ### Step 6: Reload Commands
234
+ ### Step 6: Relay Reload Instructions
234
235
 
235
- Instruct the user to reload commands in their current session:
236
- - Run `/reload` command (if available)
237
- - Or restart the Claude session
236
+ 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).
238
237
 
239
238
  ### Step 7: Consider Policies for the New Job
240
239
 
@@ -460,7 +459,7 @@ After running `deepwork sync`, the following slash-commands are now available:
460
459
 
461
460
  ## Next Steps
462
461
 
463
- 1. **Reload commands**: Run `/reload` or restart your Claude session
462
+ 1. **Reload commands**: [Include the specific reload instructions from the `deepwork sync` output here]
464
463
  2. **Start the workflow**: Run `/[job_name].[first_step_id]` to begin
465
464
  3. **Test the job**: Try executing the first step to ensure everything works
466
465
 
@@ -487,7 +486,7 @@ Before marking this step complete, ensure:
487
486
  - [ ] Each instruction file is complete and actionable
488
487
  - [ ] `deepwork sync` executed successfully
489
488
  - [ ] Commands generated in platform directory
490
- - [ ] User informed of next steps (reload commands)
489
+ - [ ] User informed to follow reload instructions from `deepwork sync`
491
490
  - [ ] implementation_summary.md created
492
491
  - [ ] Considered whether policies would benefit this job (Step 7)
493
492
  - [ ] If policies suggested, offered to run `/deepwork_policy.define`
@@ -578,13 +577,13 @@ After completing this step:
578
577
  2. **Inform the user**:
579
578
  - Step 2 of 3 is complete
580
579
  - Outputs created: implementation_summary.md
581
- - Ready to proceed to next step: `/deepwork_jobs.refine`
580
+ - Ready to proceed to next step: `/deepwork_jobs.learn`
582
581
 
583
582
  ## Next Step
584
583
 
585
584
  To continue the workflow, run:
586
585
  ```
587
- /deepwork_jobs.refine
586
+ /deepwork_jobs.learn
588
587
  ```
589
588
 
590
589
  ---
@@ -0,0 +1,499 @@
1
+ ---
2
+ description: Reflect on conversation to improve job instructions and capture learnings
3
+ hooks:
4
+ Stop:
5
+ - hooks:
6
+ - type: prompt
7
+ prompt: |
8
+ You must evaluate whether Claude has met all the below quality criteria for the request.
9
+
10
+ ## Quality Criteria
11
+
12
+ Verify the learning process meets ALL quality criteria before completing:
13
+
14
+ 1. **Conversation Analyzed**: Did you review the conversation for DeepWork job executions?
15
+ 2. **Confusion Identified**: Did you identify points of confusion, errors, or inefficiencies?
16
+ 3. **Instructions Improved**: Were job instructions updated to address identified issues?
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?
24
+
25
+ If ANY criterion is not met, continue working to address it.
26
+ If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.
27
+
28
+
29
+ ## Instructions
30
+
31
+ Review the conversation and determine if ALL quality criteria above have been satisfied.
32
+ Look for evidence that each criterion has been addressed.
33
+
34
+ If the agent has included `<promise>✓ Quality Criteria Met</promise>` in their response AND
35
+ all criteria appear to be met, respond with: {"ok": true}
36
+
37
+ If criteria are NOT met AND the promise tag is missing, respond with:
38
+ {"ok": false, "reason": "Continue working. [specific feedback on what's wrong]"}
39
+ ---
40
+
41
+ # deepwork_jobs.learn
42
+
43
+ **Standalone command** in the **deepwork_jobs** job - can be run anytime
44
+
45
+ **Summary**: DeepWork job management commands
46
+
47
+ ## Job Overview
48
+
49
+ Core commands for managing DeepWork jobs. These commands help you define new multi-step
50
+ workflows and learn from running them.
51
+
52
+ The `define` command guides you through an interactive process to create a new job by
53
+ asking detailed questions about your workflow, understanding each step's inputs and outputs,
54
+ and generating all necessary files.
55
+
56
+ The `learn` command reflects on conversations where DeepWork jobs were run, identifies
57
+ confusion or inefficiencies, and improves job instructions. It also captures bespoke
58
+ learnings specific to the current run into AGENTS.md files in the working folder.
59
+
60
+
61
+
62
+ ## Instructions
63
+
64
+ # Learn from Job Execution
65
+
66
+ ## Objective
67
+
68
+ Think deeply about this task. Reflect on the current conversation to identify learnings from DeepWork job executions, improve job instructions with generalizable insights, and capture bespoke (run-specific) learnings in AGENTS.md files in the appropriate working folder.
69
+
70
+ ## Task
71
+
72
+ Analyze the conversation history to extract learnings and improvements, then apply them appropriately:
73
+ - **Generalizable learnings** → Update job instruction files
74
+ - **Bespoke learnings** (specific to this run) → Add to AGENTS.md in working folder
75
+
76
+ ### Step 1: Analyze Conversation for Job Executions
77
+
78
+ 1. **Scan the conversation** for DeepWork slash commands that were run
79
+ - Look for patterns like `/job_name.step_id`
80
+ - Identify which jobs and steps were executed
81
+ - Note the order of execution
82
+
83
+ 2. **Identify the working folder**
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
86
+
87
+ 3. **If no job was specified**, ask the user:
88
+ - "Which DeepWork job would you like me to learn from?"
89
+ - List available jobs from `.deepwork/jobs/`
90
+
91
+ ### Step 2: Identify Points of Confusion and Inefficiency
92
+
93
+ Review the conversation for:
94
+
95
+ 1. **Confusion signals**
96
+ - Questions the agent asked that shouldn't have been necessary
97
+ - Misunderstandings about what a step required
98
+ - Incorrect outputs that needed correction
99
+ - Ambiguous instructions that led to wrong interpretations
100
+
101
+ 2. **Inefficiency signals**
102
+ - Extra steps or iterations that were needed
103
+ - Information that had to be repeated
104
+ - Context that was missing from instructions
105
+ - Dependencies that weren't clear
106
+
107
+ 3. **Error patterns**
108
+ - Failed validations and why they failed
109
+ - Quality criteria that were misunderstood
110
+ - Edge cases that weren't handled
111
+
112
+ 4. **Success patterns**
113
+ - What worked particularly well
114
+ - Efficient approaches worth preserving
115
+ - Good examples that could be added to instructions
116
+
117
+ ### Step 3: Classify Learnings
118
+
119
+ For each learning identified, determine if it is:
120
+
121
+ **Generalizable** (should improve instructions):
122
+ - Would help ANY future run of this job
123
+ - Addresses unclear or missing guidance
124
+ - Fixes incorrect assumptions in instructions
125
+ - Adds helpful examples or context
126
+ - Examples:
127
+ - "Step instructions should mention that X format is required"
128
+ - "Quality criteria should include checking for Y"
129
+ - "Add example of correct output format"
130
+
131
+ **Bespoke** (should go in AGENTS.md):
132
+ - Specific to THIS project/codebase/run
133
+ - Depends on local conventions or structure
134
+ - References specific files or paths
135
+ - Would not apply to other uses of this job
136
+ - Examples:
137
+ - "In this codebase, API endpoints are in `src/api/`"
138
+ - "This project uses camelCase for function names"
139
+ - "The main config file is at `config/settings.yml`"
140
+
141
+ ### Step 4: Update Job Instructions (Generalizable Learnings)
142
+
143
+ For each generalizable learning:
144
+
145
+ 1. **Locate the instruction file**
146
+ - Path: `.deepwork/jobs/[job_name]/steps/[step_id].md`
147
+
148
+ 2. **Make targeted improvements**
149
+ - Add missing context or clarification
150
+ - Include helpful examples
151
+ - Clarify ambiguous instructions
152
+ - Update quality criteria if needed
153
+
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**
160
+ - Keep existing sections (Objective, Task, Process, Output Format, Quality Criteria)
161
+ - Add to appropriate sections rather than restructuring
162
+ - Maintain consistency with other steps
163
+
164
+ 5. **Track changes for changelog**
165
+ - Note what was changed and why
166
+ - Prepare changelog entry for job.yml
167
+
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
+
194
+ ### Step 5: Create/Update AGENTS.md (Bespoke Learnings)
195
+
196
+ The AGENTS.md file captures project-specific knowledge that helps future agent runs.
197
+
198
+ 1. **Determine the correct location**
199
+ - Place AGENTS.md in the working folder where job outputs live
200
+ - This ensures the knowledge is available when working in that context
201
+ - If uncertain, place at the project root
202
+
203
+ 2. **Use file references where possible**
204
+ - Instead of duplicating information, reference source files
205
+ - This keeps AGENTS.md in sync as the codebase evolves
206
+ - Pattern: "See `path/to/file.ext` for [description]"
207
+
208
+ 3. **AGENTS.md structure**:
209
+
210
+ ```markdown
211
+ # Project Context for [Job Name]
212
+
213
+ ## Codebase Structure
214
+
215
+ <!-- Reference files rather than duplicating content -->
216
+ - Project structure: See `README.md` for overview
217
+ - API documentation: See `docs/api.md`
218
+ - Configuration: See `config/README.md`
219
+
220
+ ## Conventions
221
+
222
+ ### Naming Conventions
223
+ - [Convention]: See example in `path/to/example.ext:LINE`
224
+
225
+ ### File Organization
226
+ - [Pattern]: Reference `path/to/pattern/`
227
+
228
+ ## Job-Specific Context
229
+
230
+ ### [Job Name]
231
+
232
+ #### [Step Name]
233
+ - [Learning]: Reference `relevant/file.ext`
234
+ - [Context]: [Brief explanation with file reference]
235
+
236
+ ## Known Issues and Workarounds
237
+
238
+ - [Issue]: [Workaround with file reference if applicable]
239
+
240
+ ## Last Updated
241
+ - Date: [YYYY-MM-DD]
242
+ - From conversation about: [Brief description]
243
+ ```
244
+
245
+ 4. **Writing entries**
246
+ - Be concise but specific
247
+ - Always prefer file references over inline content
248
+ - Use line numbers when referencing specific code: `file.ext:42`
249
+ - Group related learnings together
250
+
251
+ ### Step 6: Update Job Version and Changelog
252
+
253
+ If instruction files were modified:
254
+
255
+ 1. **Bump version in job.yml**
256
+ - Patch version (0.0.x) for instruction improvements
257
+ - Minor version (0.x.0) if quality criteria changed
258
+
259
+ 2. **Add changelog entry**
260
+ ```yaml
261
+ - version: "[new_version]"
262
+ changes: "Improved [step] instructions based on execution learnings: [brief description]"
263
+ ```
264
+
265
+ ### Step 7: Sync and Summarize
266
+
267
+ 1. **Run deepwork sync** (if instructions were modified)
268
+ ```bash
269
+ deepwork sync
270
+ ```
271
+
272
+ 2. **Create learning_summary.md** in the working folder:
273
+ ```markdown
274
+ # Learning Summary
275
+
276
+ ## Job Analyzed
277
+ - Job: [job_name]
278
+ - Steps executed: [list of steps]
279
+
280
+ ## Generalizable Improvements Made
281
+ - [Step]: [What was improved]
282
+
283
+ ## Bespoke Learnings Captured
284
+ - Location: [path to AGENTS.md]
285
+ - Entries added: [list of entries]
286
+
287
+ ## Files Modified
288
+ - [List of files changed]
289
+
290
+ ## Recommendations
291
+ - [Any additional suggestions]
292
+ ```
293
+
294
+ 3. **If commands were regenerated**, look at the "To use the new commands" section in the `deepwork sync` output and **relay these exact reload instructions to the user** (e.g., "Type 'exit' then run 'claude --resume'" for Claude Code)
295
+
296
+ ## File Reference Patterns
297
+
298
+ When adding entries to AGENTS.md, prefer these patterns:
299
+
300
+ **Good (references)**:
301
+ ```markdown
302
+ - API endpoints follow REST conventions. See `src/api/routes.ts` for examples.
303
+ - Error handling pattern: See `src/utils/errors.ts:15-30`
304
+ - Configuration schema: Defined in `config/schema.json`
305
+ ```
306
+
307
+ **Avoid (duplicating)**:
308
+ ```markdown
309
+ - API endpoints should return JSON with this format: { status: ..., data: ... }
310
+ - Error handling should use try/catch with custom error classes
311
+ - Configuration requires these fields: name, version, ...
312
+ ```
313
+
314
+ ## Quality Criteria
315
+
316
+ - Conversation has been analyzed for job executions
317
+ - Points of confusion and inefficiency are identified
318
+ - Learnings are correctly classified (generalizable vs bespoke)
319
+ - 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
322
+ - AGENTS.md created/updated with bespoke learnings
323
+ - File references used instead of duplicating content
324
+ - AGENTS.md is in the correct working folder
325
+ - learning_summary.md documents all changes
326
+ - When all criteria are met, include `<promise>✓ Quality Criteria Met</promise>`
327
+
328
+ ## Example Dialog
329
+
330
+ ```
331
+ User: /deepwork_jobs.learn
332
+
333
+ Claude: I'll analyze this conversation for learnings from DeepWork job executions.
334
+
335
+ **Conversation Analysis**
336
+
337
+ I found the following job executions:
338
+ 1. `/competitive_research.identify_competitors` - Completed
339
+ 2. `/competitive_research.research_competitors` - Completed with 2 iterations
340
+ 3. `/competitive_research.comparative_analysis` - Completed
341
+
342
+ **Identified Issues**
343
+
344
+ 1. **Confusion in step 2**: The instructions didn't specify that competitor research should include pricing information. This caused an extra iteration.
345
+
346
+ 2. **Missing context**: The agent had to ask about the industry focus, which should have been carried forward from step 1.
347
+
348
+ **Classification**
349
+
350
+ - Generalizable: Add pricing to research requirements in instructions
351
+ - Bespoke: This project focuses on B2B SaaS in the HR tech space
352
+
353
+ **Actions Taken**
354
+
355
+ 1. Updated `.deepwork/jobs/competitive_research/steps/research_competitors.md`:
356
+ - Added "Include pricing information (tiers, models, approximate ranges)" to research requirements
357
+ - Added note about carrying forward industry context from previous step
358
+
359
+ 2. Created `./competitive_research_output/AGENTS.md`:
360
+ ```markdown
361
+ # Project Context for Competitive Research
362
+
363
+ ## Job-Specific Context
364
+
365
+ ### competitive_research
366
+
367
+ #### Industry Focus
368
+ - Domain: B2B SaaS, HR Technology sector
369
+ - See `identify_competitors_output.md` for market definition
370
+
371
+ #### Competitors Identified
372
+ - Reference: `competitor_list.md` for full details
373
+
374
+ ## Last Updated
375
+ - Date: 2024-01-15
376
+ - From conversation about: Initial competitive analysis run
377
+ ```
378
+
379
+ 3. Updated job.yml version to 1.0.1 with changelog entry
380
+
381
+ 4. Ran `deepwork sync`
382
+
383
+ **Summary**
384
+
385
+ Created `learning_summary.md` documenting all changes. To get the updated commands, type 'exit' then run 'claude --resume'.
386
+ ```
387
+
388
+ ## Handling Edge Cases
389
+
390
+ **No job executions found**:
391
+ - Ask user which job they'd like to analyze
392
+ - Or offer to review available jobs
393
+
394
+ **Multiple jobs executed**:
395
+ - Analyze each job separately
396
+ - Create separate AGENTS.md entries or files as appropriate
397
+
398
+ **AGENTS.md already exists**:
399
+ - Read existing content
400
+ - Append new learnings to appropriate sections
401
+ - Update "Last Updated" section
402
+
403
+ **No issues found**:
404
+ - Document what worked well
405
+ - Consider if any successful patterns should be added to instructions as examples
406
+
407
+ **Sensitive information**:
408
+ - Never include secrets, credentials, or PII in AGENTS.md
409
+ - Reference config files instead of including values
410
+
411
+
412
+ ## Inputs
413
+
414
+ ### User Parameters
415
+
416
+ Please gather the following information from the user:
417
+ - **job_name**: Name of the job that was run (optional - will auto-detect from conversation)
418
+
419
+
420
+ ## Work Branch Management
421
+
422
+ All work for this job should be done on a dedicated work branch:
423
+
424
+ 1. **Check current branch**:
425
+ - If already on a work branch for this job (format: `deepwork/deepwork_jobs-[instance]-[date]`), continue using it
426
+ - If on main/master, create a new work branch
427
+
428
+ 2. **Create work branch** (if needed):
429
+ ```bash
430
+ git checkout -b deepwork/deepwork_jobs-[instance]-$(date +%Y%m%d)
431
+ ```
432
+ Replace `[instance]` with a descriptive identifier (e.g., `acme`, `q1-launch`, etc.)
433
+
434
+ ## Output Requirements
435
+
436
+ Create the following output(s):
437
+ - `learning_summary.md`
438
+ Ensure all outputs are:
439
+ - Well-formatted and complete
440
+ - Ready for review or use by subsequent steps
441
+
442
+ ## Quality Validation Loop
443
+
444
+ This step uses an iterative quality validation loop. After completing your work, stop hook(s) will evaluate whether the outputs meet quality criteria. If criteria are not met, you will be prompted to continue refining.
445
+
446
+ ### Quality Criteria
447
+ Verify the learning process meets ALL quality criteria before completing:
448
+
449
+ 1. **Conversation Analyzed**: Did you review the conversation for DeepWork job executions?
450
+ 2. **Confusion Identified**: Did you identify points of confusion, errors, or inefficiencies?
451
+ 3. **Instructions Improved**: Were job instructions updated to address identified issues?
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?
459
+
460
+ If ANY criterion is not met, continue working to address it.
461
+ If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.
462
+
463
+
464
+ ### Completion Promise
465
+
466
+ To signal that all quality criteria have been met, include this tag in your final response:
467
+
468
+ ```
469
+ <promise>✓ Quality Criteria Met</promise>
470
+ ```
471
+
472
+ **Important**: Only include this promise tag when you have verified that ALL quality criteria above are satisfied. The validation loop will continue until this promise is detected.
473
+
474
+ ## Completion
475
+
476
+ After completing this step:
477
+
478
+ 1. **Verify outputs**: Confirm all required files have been created
479
+
480
+ 2. **Inform the user**:
481
+ - The learn command is complete
482
+ - Outputs created: learning_summary.md
483
+ - This command can be run again anytime to make further changes
484
+
485
+ ## Command Complete
486
+
487
+ This is a standalone command that can be run anytime. The outputs are ready for use.
488
+
489
+ Consider:
490
+ - Reviewing the outputs
491
+ - Running `deepwork sync` if job definitions were changed
492
+ - Re-running this command later if further changes are needed
493
+
494
+ ---
495
+
496
+ ## Context Files
497
+
498
+ - Job definition: `.deepwork/jobs/deepwork_jobs/job.yml`
499
+ - Step instructions: `.deepwork/jobs/deepwork_jobs/steps/learn.md`
@@ -1,20 +1,23 @@
1
1
  name: deepwork_jobs
2
- version: "0.1.0"
2
+ version: "0.2.0"
3
3
  summary: "DeepWork job management commands"
4
4
  description: |
5
5
  Core commands for managing DeepWork jobs. These commands help you define new multi-step
6
- workflows and refine existing ones.
6
+ workflows and learn from running them.
7
7
 
8
8
  The `define` command guides you through an interactive process to create a new job by
9
9
  asking detailed questions about your workflow, understanding each step's inputs and outputs,
10
10
  and generating all necessary files.
11
11
 
12
- The `refine` command helps you modify existing jobs safely by understanding what you want
13
- to change, validating the impact, and ensuring consistency across your workflow.
12
+ The `learn` command reflects on conversations where DeepWork jobs were run, identifies
13
+ confusion or inefficiencies, and improves job instructions. It also captures bespoke
14
+ learnings specific to the current run into AGENTS.md files in the working folder.
14
15
 
15
16
  changelog:
16
17
  - version: "0.1.0"
17
18
  changes: "Initial version"
19
+ - version: "0.2.0"
20
+ changes: "Replaced refine command with learn command for conversation-driven improvement"
18
21
 
19
22
  steps:
20
23
  - id: define
@@ -74,29 +77,31 @@ steps:
74
77
  If ANY criterion is not met, continue working to address it.
75
78
  If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.
76
79
 
77
- - id: refine
78
- name: "Refine Existing Job"
79
- description: "Modify an existing job definition"
80
- instructions_file: steps/refine.md
80
+ - id: learn
81
+ name: "Learn from Job Execution"
82
+ description: "Reflect on conversation to improve job instructions and capture learnings"
83
+ instructions_file: steps/learn.md
81
84
  inputs:
82
85
  - name: job_name
83
- description: "Name of the job to refine"
86
+ description: "Name of the job that was run (optional - will auto-detect from conversation)"
84
87
  outputs:
85
- - job.yml
88
+ - learning_summary.md
86
89
  dependencies: []
87
90
  hooks:
88
91
  after_agent:
89
92
  - prompt: |
90
- Verify the refinement meets ALL quality criteria before completing:
93
+ Verify the learning process meets ALL quality criteria before completing:
91
94
 
92
- 1. **Job Consistency**: Do the changes maintain overall job consistency?
93
- 2. **Valid Dependencies**: Are all step dependencies logically valid (no circular refs)?
94
- 3. **Semantic Versioning**: Was the version bumped appropriately (major/minor/patch)?
95
- 4. **Changelog Updated**: Is the changelog updated with a description of changes?
96
- 5. **User Understanding**: Does the user understand the impact of the changes?
97
- 6. **Breaking Changes**: Were any breaking changes clearly communicated?
98
- 7. **Files Updated**: Are all affected files (job.yml, step files) updated?
99
- 8. **Sync Complete**: Has `deepwork sync` been run to regenerate commands?
95
+ 1. **Conversation Analyzed**: Did you review the conversation for DeepWork job executions?
96
+ 2. **Confusion Identified**: Did you identify points of confusion, errors, or inefficiencies?
97
+ 3. **Instructions Improved**: Were job instructions updated to address identified issues?
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?
100
105
 
101
106
  If ANY criterion is not met, continue working to address it.
102
107
  If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.