deepwork 0.5.1__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.
Files changed (66) hide show
  1. deepwork/__init__.py +1 -1
  2. deepwork/cli/hook.py +3 -4
  3. deepwork/cli/install.py +70 -117
  4. deepwork/cli/main.py +2 -2
  5. deepwork/cli/serve.py +133 -0
  6. deepwork/cli/sync.py +93 -58
  7. deepwork/core/adapters.py +91 -102
  8. deepwork/core/generator.py +19 -386
  9. deepwork/core/hooks_syncer.py +1 -1
  10. deepwork/core/parser.py +270 -1
  11. deepwork/hooks/README.md +0 -44
  12. deepwork/hooks/__init__.py +3 -6
  13. deepwork/hooks/check_version.sh +54 -21
  14. deepwork/mcp/__init__.py +23 -0
  15. deepwork/mcp/quality_gate.py +347 -0
  16. deepwork/mcp/schemas.py +263 -0
  17. deepwork/mcp/server.py +253 -0
  18. deepwork/mcp/state.py +422 -0
  19. deepwork/mcp/tools.py +394 -0
  20. deepwork/schemas/job.schema.json +347 -0
  21. deepwork/schemas/job_schema.py +27 -239
  22. deepwork/standard_jobs/deepwork_jobs/doc_specs/job_spec.md +9 -15
  23. deepwork/standard_jobs/deepwork_jobs/job.yml +146 -46
  24. deepwork/standard_jobs/deepwork_jobs/steps/define.md +100 -33
  25. deepwork/standard_jobs/deepwork_jobs/steps/errata.md +154 -0
  26. deepwork/standard_jobs/deepwork_jobs/steps/fix_jobs.md +207 -0
  27. deepwork/standard_jobs/deepwork_jobs/steps/fix_settings.md +177 -0
  28. deepwork/standard_jobs/deepwork_jobs/steps/implement.md +22 -138
  29. deepwork/standard_jobs/deepwork_jobs/steps/iterate.md +221 -0
  30. deepwork/standard_jobs/deepwork_jobs/steps/learn.md +2 -26
  31. deepwork/standard_jobs/deepwork_jobs/steps/test.md +154 -0
  32. deepwork/standard_jobs/deepwork_jobs/templates/job.yml.template +2 -0
  33. deepwork/templates/claude/settings.json +16 -0
  34. deepwork/templates/claude/skill-deepwork.md.jinja +37 -0
  35. deepwork/templates/gemini/skill-deepwork.md.jinja +37 -0
  36. deepwork-0.7.0.dist-info/METADATA +317 -0
  37. deepwork-0.7.0.dist-info/RECORD +64 -0
  38. deepwork/cli/rules.py +0 -32
  39. deepwork/core/command_executor.py +0 -190
  40. deepwork/core/pattern_matcher.py +0 -271
  41. deepwork/core/rules_parser.py +0 -559
  42. deepwork/core/rules_queue.py +0 -321
  43. deepwork/hooks/rules_check.py +0 -759
  44. deepwork/schemas/rules_schema.py +0 -135
  45. deepwork/standard_jobs/deepwork_jobs/steps/review_job_spec.md +0 -208
  46. deepwork/standard_jobs/deepwork_jobs/templates/doc_spec.md.example +0 -86
  47. deepwork/standard_jobs/deepwork_rules/hooks/capture_prompt_work_tree.sh +0 -38
  48. deepwork/standard_jobs/deepwork_rules/hooks/global_hooks.yml +0 -8
  49. deepwork/standard_jobs/deepwork_rules/hooks/user_prompt_submit.sh +0 -16
  50. deepwork/standard_jobs/deepwork_rules/job.yml +0 -49
  51. deepwork/standard_jobs/deepwork_rules/rules/.gitkeep +0 -13
  52. deepwork/standard_jobs/deepwork_rules/rules/api-documentation-sync.md.example +0 -10
  53. deepwork/standard_jobs/deepwork_rules/rules/readme-documentation.md.example +0 -10
  54. deepwork/standard_jobs/deepwork_rules/rules/security-review.md.example +0 -11
  55. deepwork/standard_jobs/deepwork_rules/rules/skill-md-validation.md +0 -46
  56. deepwork/standard_jobs/deepwork_rules/rules/source-test-pairing.md.example +0 -13
  57. deepwork/standard_jobs/deepwork_rules/steps/define.md +0 -249
  58. deepwork/templates/claude/skill-job-meta.md.jinja +0 -77
  59. deepwork/templates/claude/skill-job-step.md.jinja +0 -235
  60. deepwork/templates/gemini/skill-job-meta.toml.jinja +0 -76
  61. deepwork/templates/gemini/skill-job-step.toml.jinja +0 -162
  62. deepwork-0.5.1.dist-info/METADATA +0 -381
  63. deepwork-0.5.1.dist-info/RECORD +0 -72
  64. {deepwork-0.5.1.dist-info → deepwork-0.7.0.dist-info}/WHEEL +0 -0
  65. {deepwork-0.5.1.dist-info → deepwork-0.7.0.dist-info}/entry_points.txt +0 -0
  66. {deepwork-0.5.1.dist-info → deepwork-0.7.0.dist-info}/licenses/LICENSE.md +0 -0
@@ -0,0 +1,317 @@
1
+ Metadata-Version: 2.4
2
+ Name: deepwork
3
+ Version: 0.7.0
4
+ Summary: Framework for enabling AI agents to perform complex, multi-step work tasks
5
+ Project-URL: Homepage, https://github.com/deepwork/deepwork
6
+ Project-URL: Documentation, https://github.com/deepwork/deepwork#readme
7
+ Project-URL: Repository, https://github.com/deepwork/deepwork
8
+ Project-URL: Issues, https://github.com/deepwork/deepwork/issues
9
+ Author: DeepWork Contributors
10
+ License: Business Source License 1.1
11
+ License-File: LICENSE.md
12
+ Keywords: agents,ai,automation,cli,workflow
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: Other/Proprietary License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: aiofiles>=24.0.0
22
+ Requires-Dist: click>=8.1.0
23
+ Requires-Dist: fastmcp>=2.0
24
+ Requires-Dist: gitpython>=3.1.0
25
+ Requires-Dist: jinja2>=3.1.0
26
+ Requires-Dist: jsonschema>=4.17.0
27
+ Requires-Dist: mcp>=1.0.0
28
+ Requires-Dist: pydantic>=2.0
29
+ Requires-Dist: pyyaml>=6.0
30
+ Requires-Dist: rich>=13.0.0
31
+ Provides-Extra: dev
32
+ Requires-Dist: mypy>=1.0; extra == 'dev'
33
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
34
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
35
+ Requires-Dist: pytest-mock>=3.10; extra == 'dev'
36
+ Requires-Dist: pytest>=7.0; extra == 'dev'
37
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
38
+ Requires-Dist: types-aiofiles; extra == 'dev'
39
+ Requires-Dist: types-pyyaml; extra == 'dev'
40
+ Description-Content-Type: text/markdown
41
+
42
+ # Teach Claude to Automate *Anything*
43
+
44
+ Triage email, give feedback to your team, make tutorials/documentation, QA your product every day, do competitive research... *anything*.
45
+
46
+ ## Install
47
+ ```bash
48
+ brew tap unsupervisedcom/deepwork && brew install deepwork
49
+ ```
50
+
51
+ Then in your project folder (must be a Git repository):
52
+ ```bash
53
+ deepwork install
54
+ claude
55
+ ```
56
+
57
+ > **Note:** DeepWork requires a Git repository. If your folder isn't already a repo, run `git init` first.
58
+
59
+ Now inside claude, define your first job using the `/deepwork_jobs` command. Ex.
60
+ ```
61
+ /deepwork_jobs Make a job for doing competitive research. It will take the URL of the competitor as an input, and should make report including a SWOT analysis for that competitor.
62
+ ```
63
+
64
+ See below for additional installation options
65
+
66
+ DeepWork is an open-source plugin for Claude Code (and other CLI agents). It:
67
+ - teaches Claude to follow strict workflows consistently
68
+ - makes it easy for you to define them
69
+ - learns and updates automatically
70
+
71
+ ## Example
72
+
73
+ You can make a DeepWork job that uses Claude Code to automatically run a deep competitive research workflow. To do this you:
74
+ - Run `/deepwork_jobs` in Claude Code and select `define`
75
+ - Explain your process _e.g. "Go look at my company's website and social channels to capture any new developments, look at our existing list of competitors, do broad web searches to identify any new competitiors, and then do deep research on each competitor and produce a comprehensive set of md reports including a summary report for me._
76
+
77
+ Deepwork will ask you questions to improve the plan and make a hardened automation workflow. This usually takes ~10 minutes.
78
+
79
+ When this is done, it will create a .yml file that details the plan and then will use templates to document how Claude should execute each individual step in the workflow. This usually takes 2-5 minutes.
80
+
81
+ After that, it will create a new skill for you in Claude, something like `/competitive_research` that you can run at any time (or automate).
82
+
83
+ Running that `/competitive_research` command will get you output that looks something like this:
84
+ ```
85
+ deepwork-output/competitive_research/
86
+ ├── competitors.md # Who they are, what they do
87
+ ├── competitor_profiles/ # Deep dive on each
88
+ ├── primary_research.md # What they say about themselves
89
+ └── strategic_overview.md # Your positioning recommendations
90
+ ```
91
+
92
+ You only have to build a skill once. Then: run it whenever you need it.
93
+
94
+ _Note: all of these skills are composable. You can call skills inside of other jobs. As an example, you could create a `make_comparison_document` skill and call it at the end of the `/competitive_research` skill — automating the process of going from research to having final breifings and materials on competitiors for your sales team._
95
+
96
+ ---
97
+
98
+ ## Who This Is For
99
+
100
+ **If you can use Claude Code and describe a process, you can automate it.**
101
+
102
+ | You | What You'd Automate |
103
+ |-----|---------------------|
104
+ | **Founders** | Competitive research, automatically discover bugs/issues and open tickets, reports or investor updates pulling from multiple sources |
105
+ | **Ops** | Daily briefs, SEO analysis, git summaries |
106
+ | **Product Managers** | Tutorial writing, QA reports, simulated user testing, updating process docs or sales materials |
107
+ | **Engineers** | Automate standup summary, git summaries, reports |
108
+ | **Data/Analytics** | Pull data from multiple sources, ETL, create custom reports and dashboards |
109
+
110
+ One user used DeepWork to automatically research email performance across hundreds of millions of marketing emails. It accessed data from a data warehouse, came up with research questions, queried to answer those questions, and then produced a several page, comprehensive report. The process ran autonomously for ~90 minutes and produced a report better than internal dashboards that had been refined for months.
111
+
112
+ DeepWork is a free, open-source tool — if you're already paying for a Claude Max subscription, each of these automations costs you nothing additional.
113
+
114
+ Similar to how vibe coding makes easier for anyone to produce software, this is **vibe automation**: describe what you want, let it run, and then iterate on what works.
115
+
116
+ ---
117
+
118
+ ## Quick Start
119
+
120
+ ### 1. Install
121
+
122
+ ```bash
123
+ brew tap unsupervisedcom/deepwork
124
+ brew install deepwork
125
+ ```
126
+
127
+ Then in any project folder (must be a Git repository):
128
+
129
+ ```bash
130
+ deepwork install
131
+ ```
132
+
133
+ > **Note:** If your folder isn't a Git repo yet, run `git init` first.
134
+
135
+ **After install, load Claude.** Then verify you see this command: `/deepwork_jobs`
136
+
137
+ ### 2. Define Your First Workflow
138
+
139
+ Start simple—something you do manually in 15-30 minutes. Here's an example:
140
+
141
+ ```
142
+ /deepwork_jobs write a tutorial for how to use a new feature we just launched
143
+ ```
144
+
145
+ DeepWork asks you questions (this usually takes about 10 minutes) then writes the steps. You're creating a **reusable skill** — after you do this process you can run that skill any time you want without repeating this process.
146
+
147
+ ### 3. Run It
148
+
149
+ Once the skill is created, type the name of your job (e.g. `/tutorial`) in Claude and you'll see the skill show up in your suggestions (e.g. `/tutorial_writer`).
150
+
151
+ Hit enter to run the skill. Claude will follow the workflow step by step.
152
+
153
+ ## Some Examples of What Other People Are Building with DeepWork
154
+ =======
155
+ To start the process, just run:
156
+
157
+ ```
158
+ /deepwork_jobs
159
+ ```
160
+
161
+ | Workflow | What It Does | Why it matters|
162
+ |----------|--------------|--------------|
163
+ | **Email triage** | Scan inbox, categorize, archive, and draft replies | Save time processing email |
164
+ | **Competitive research** | Track competitors weekly, generate diff reports | Fast feedback on how your competition is changing |
165
+ | **Tutorial writer** | Turn your expertise into docs | Rapidly build docs, guides, etc. |
166
+ | **SaaS user audit** | Quarterly audit of who has access to various services | Save money on forgotten SaaS licenses |
167
+
168
+ ---
169
+
170
+ ## Why It Works Well
171
+
172
+ **1. Strict workflows** — Claude follows step-by-step instructions with quality checks. No more going off-script.
173
+
174
+ **2. Easy to define** — Describe what you want in plain English. DeepWork knows how to ask you the right questions to refine your plan.
175
+ ```
176
+ /deepwork_jobs
177
+ ```
178
+
179
+ **3. Learns automatically** — Run `/deepwork_jobs.learn` (or ask claude to `run the deepwork learn job`) after any job to automatically capture what worked and improve for next time.
180
+
181
+ **4. All work happens on Git branches** — Every change can be version-controlled and tracked. You can roll-back to prior versions of the skill or keep skills in-sync and up-to-date across your team.
182
+
183
+ ---
184
+
185
+ ## Supported Platforms
186
+
187
+ | Platform | Status | Notes |
188
+ |----------|--------|-------|
189
+ | **Claude Code** | Full Support | Recommended. Quality hooks, best DX. |
190
+ | **Gemini CLI** | Partial Support | TOML format, global hooks only |
191
+ | OpenCode | Planned | |
192
+ | GitHub Copilot CLI | Planned | |
193
+ | Others | Planned | We are nailing Claude and Gemini first, then adding others according ot demand |
194
+
195
+ **Tip:** Use the terminal (Claude Code CLI), not the VS Code extension. The terminal has full feature support.
196
+
197
+ ---
198
+
199
+ ## Browser Automation
200
+
201
+ For workflows that need to interact with websites, you can use any browser automation tool that works in Claude Code. We generally recommend [Claude in Chrome](https://www.anthropic.com/claude-in-chrome).
202
+
203
+ **⚠️ Safety note:** Browser automation is still something models can be hit-or-miss on. We recommend using a dedicated Chrome profile for automation.
204
+
205
+ ---
206
+
207
+ ## Troubleshooting
208
+
209
+ Here are some known issues that affect some early users — we're working on improving normal performance on these, but here are some known workarounds.
210
+
211
+ ### Slash Commands don't appear after install
212
+
213
+ Exit Claude completely and restart.
214
+
215
+ ### Stop hooks firing unexpectedly
216
+
217
+ Occasionally, especially after updating a job or running the `deepwork_jobs learn` process after completing a task, Claude will get confused about which workflow it's running checks for. For now, if stop hooks fire when they shouldn't, you can either:
218
+ - Ask claude `do we need to address any of these stop hooks or can we ignore them for now?`
219
+ - Ignore the stop hooks and keep going until the workflow steps are complete
220
+ - Run the `/clear` command to start a new context window (you'll have to re-run the job after this)
221
+
222
+ ### Claude "just does the task" instead of using DeepWork
223
+
224
+ If Claude attempts to bypass the workflow and do the task on it's own, tell it explicitly to use the skill. You can also manually run the step command:
225
+ ```
226
+ /your_job
227
+ ```
228
+
229
+ Tip: Don't say things like "can you do X" while in **defining** a new `/deepwork_jobs` — Claude has a bias towards action and workarounds and may abandon the skill creation workflow and attempt to do your task as a one off. Instead, say something like "create a workflow that..."
230
+
231
+ ### If you can't solve your issues using the above and need help
232
+
233
+ Send [@tylerwillis](https://x.com/tylerwillis) a message on X.
234
+
235
+ ---
236
+
237
+ <details>
238
+ <summary><strong>Advanced: Directory Structure</strong></summary>
239
+
240
+ ```
241
+ your-project/
242
+ ├── .deepwork/
243
+ │ ├── config.yml # Platform configuration
244
+ │ └── jobs/ # Job definitions
245
+ │ └── job_name/
246
+ │ ├── job.yml # Job metadata
247
+ │ └── steps/ # Step instructions
248
+ ├── .claude/ # Generated Claude skills
249
+ │ └── skills/
250
+ └── deepwork-output/ # Job outputs (gitignored)
251
+ ```
252
+
253
+ </details>
254
+
255
+ <details>
256
+ <summary><strong>Alternative Installation Methods</strong></summary>
257
+
258
+ **Prerequisites** (for non-Homebrew installs): Python 3.11+, Git
259
+
260
+ Homebrew is recommended, but you can also use:
261
+
262
+ ```bash
263
+ # uv (Recommended)
264
+ uv tool install deepwork
265
+
266
+ # pipx
267
+ pipx install deepwork
268
+
269
+ # pip
270
+ pip install deepwork
271
+ ```
272
+
273
+ Then in your project folder (in terminal, not in Claude Code):
274
+
275
+ ```bash
276
+ deepwork install
277
+ ```
278
+
279
+ </details>
280
+
281
+ <details>
282
+ <summary><strong>Advanced: Nix Flakes</strong></summary>
283
+
284
+ ```bash
285
+ # Development environment
286
+ nix develop
287
+
288
+ # Install from flake
289
+ nix profile install github:Unsupervisedcom/deepwork
290
+
291
+ # Run without installing
292
+ nix run github:Unsupervisedcom/deepwork -- --help
293
+ ```
294
+
295
+ </details>
296
+
297
+ ---
298
+
299
+ ## License
300
+
301
+ Business Source License 1.1 (BSL 1.1). Free for non-competing use. Converts to Apache 2.0 on January 14, 2030.
302
+
303
+ See [LICENSE.md](LICENSE.md) for details.
304
+
305
+ ---
306
+
307
+ ## Feedback
308
+
309
+ We're iterating fast. [Open an issue](https://github.com/Unsupervisedcom/deepwork/issues) or reach out on Twitter [@tylerwillis](https://twitter.com/tylerwillis).
310
+
311
+ ---
312
+
313
+ *DeepWork is in active development. Expect rough edges—and rapid improvement.*
314
+
315
+ ---
316
+
317
+ <sub>Inspired by [GitHub's spec-kit](https://github.com/github/spec-kit)</sub>
@@ -0,0 +1,64 @@
1
+ deepwork/__init__.py,sha256=0Hf2rcJ94XxP2GKJUYlgAhlfagnYfpRIaqt-nM7kzgQ,748
2
+ deepwork/cli/__init__.py,sha256=3SqmfcP2xqutiCYAbajFDJTjr2pOLydqTN0NN-FTsIE,33
3
+ deepwork/cli/hook.py,sha256=ATZJLV-J_GAHyly24lVIMvpsEY1o_-njbFrqrYg1NoM,2059
4
+ deepwork/cli/install.py,sha256=yrtT5k8x2CgUtdvNwjPJcSbaqKblC9cF1kGspYJXjTQ,13846
5
+ deepwork/cli/main.py,sha256=InzlQcFoY0aQrY13cK1k6aI7nbF5XOMBNcqf8qCmegU,616
6
+ deepwork/cli/serve.py,sha256=GGc1gkVkFG3X_1B1qVxB7nPQ3yVfO_hgCJVexPD6_1A,3192
7
+ deepwork/cli/sync.py,sha256=DAmV6EcFEK5XgCW_mYxVjGwxvTg1LrGc5PZe7-Wza0s,8877
8
+ deepwork/core/__init__.py,sha256=1g869QuwsYzNjQONneng2OMc6HKt-tlBCaxJbMMfoho,36
9
+ deepwork/core/adapters.py,sha256=PfQFcp8m5wC4b5SM7PpUjtXBcMaIE5UmWoJ4-NYEDhI,21178
10
+ deepwork/core/detector.py,sha256=PThpFLH-ZVL8UqjVdGSnGA0mFbhc6_rp6V3_Yzw97kI,2466
11
+ deepwork/core/doc_spec_parser.py,sha256=DF1B3Ku9XHxTjRN12b1DatkwTa0HlwpPbeJCL4teobU,5739
12
+ deepwork/core/generator.py,sha256=LE11uECWduyUw3V1FaZVDVCEom2veEd7ibeFt4XHdiY,3559
13
+ deepwork/core/hooks_syncer.py,sha256=LR89s_50KqzcPX5KmARxy9Ju3SUEUzrZhRx2cCz301A,7482
14
+ deepwork/core/parser.py,sha256=_x7LN_KnOgV6inUFgbeCIRHWohURgUKdFuNf165-vJ4,20945
15
+ deepwork/hooks/README.md,sha256=V1sBcgbnF-BDL3wxcyayzL91cANsrjx6eMriLpQk9UA,3655
16
+ deepwork/hooks/__init__.py,sha256=biE0wPFmUcuV5YtwffbNUxMZb7s1SQ_mS7PuiSPyXQc,1904
17
+ deepwork/hooks/check_version.sh,sha256=X6fw97pMk6Yu1-w5UDzvZtKmpKVzsh1cum_RWp3b90g,10032
18
+ deepwork/hooks/claude_hook.sh,sha256=ViV8Cc9eLRwsyZ7T1tNP-kK3leAmFjbcjOOSU3NN-eE,1321
19
+ deepwork/hooks/gemini_hook.sh,sha256=eUczJ3VUL5-q5Ic8V_WYpn5Ff_m2oliJ0FXMWaHi9jM,1316
20
+ deepwork/hooks/wrapper.py,sha256=HX_LtS5vfv-ZUhtR5jZqZCNBe90QPwW4ij9q-aRqbic,12956
21
+ deepwork/mcp/__init__.py,sha256=cqnLb_PW8ouGHOI-fw52efwVkFjRS0ttMZi_bVgNSVs,720
22
+ deepwork/mcp/quality_gate.py,sha256=sURtwC3CaoWEZXHK_d68B__WEnyaPKIEZgPM9Hg3VQc,11340
23
+ deepwork/mcp/schemas.py,sha256=IusmeXK8TMLbiuxbIaYBMQy4zBvGveDWqOi-TJpftIY,10124
24
+ deepwork/mcp/server.py,sha256=iXw35DW9dUhXhleY0LV2yP3wbNS_aRY1uIZu9SNrSB8,9228
25
+ deepwork/mcp/state.py,sha256=DcUt6j6zczfMTihkwDamFkHjouROCHiX31lSYZSaD0M,13721
26
+ deepwork/mcp/tools.py,sha256=-pROXOeK1Gc7UgZ-TZH1yo49z6Rr0ZoND7yCGOZDso4,13449
27
+ deepwork/schemas/__init__.py,sha256=PpydKb_oaTv8lYapN_nV-Tl_OUCoSM_okvsEJ8gNTpI,41
28
+ deepwork/schemas/doc_spec_schema.py,sha256=qByBtd86vQaLNsLfMr4iwVdpmyowvVLzYOnXY7RnqLY,2049
29
+ deepwork/schemas/job.schema.json,sha256=a5gPAyoaBtVnu7U7aNa9iL2g5Bwa1S8Atjo6rD10l50,11095
30
+ deepwork/schemas/job_schema.py,sha256=FT9Xn3Em85YEc2aTu71TGzdmunNhIztRymSG5N4vuhs,925
31
+ deepwork/standard_jobs/deepwork_jobs/AGENTS.md,sha256=Y6I4jZ8DfN0RFY3UF5bgQRZvL7wQD9P0lgE7EZM6CGI,2252
32
+ deepwork/standard_jobs/deepwork_jobs/job.yml,sha256=wQgbjblsDCWmaKWoBM81HuFX0aBsWtXv8c-dKTfQ-6g,12268
33
+ deepwork/standard_jobs/deepwork_jobs/make_new_job.sh,sha256=JArfFU9lEaJPRsXRL3rU1IMt2p6Bq0s2C9f98aJ7Mxg,3878
34
+ deepwork/standard_jobs/deepwork_jobs/doc_specs/job_spec.md,sha256=n9s70pSOjG1p6YX_72-TZ16pKIHaljeM2LnwOlrAfo0,7317
35
+ deepwork/standard_jobs/deepwork_jobs/steps/define.md,sha256=K0eKBDze7CKwC8uKBwTOXLT7Ya46g3GdGxyqyn3CfVI,19856
36
+ deepwork/standard_jobs/deepwork_jobs/steps/errata.md,sha256=1SjLCLc8xHlxGzFXZHn9Ch2tDTxZOyKKQ-B7RI651jw,4807
37
+ deepwork/standard_jobs/deepwork_jobs/steps/fix_jobs.md,sha256=OHFX1ZuBjo_gWyFfC_HICay6J6eNZrm2IxzGT3IPxec,6074
38
+ deepwork/standard_jobs/deepwork_jobs/steps/fix_settings.md,sha256=SJqeO_wuxcr7IzwFSlf3CmZ5ILivbvQK8YyYUc-FD4E,5361
39
+ deepwork/standard_jobs/deepwork_jobs/steps/implement.md,sha256=6RVnS5sJpyrtGFhti5c2Dfzy6obvGJHWPHe3Hrc9SbM,5731
40
+ deepwork/standard_jobs/deepwork_jobs/steps/iterate.md,sha256=JQkP-RMlbsnLpA3YH_yULUgHTOQx2ilSqI2gRsjPBhc,8405
41
+ deepwork/standard_jobs/deepwork_jobs/steps/learn.md,sha256=moPKLTtYK4TGMTWmBKZO-OX__l52Cri3B6ecMoFB9kM,11630
42
+ deepwork/standard_jobs/deepwork_jobs/steps/supplemental_file_references.md,sha256=uKDEwB3TxMLK-Zim3QQfkvaW5W6AVWHjWnH25aY6wCw,1478
43
+ deepwork/standard_jobs/deepwork_jobs/steps/test.md,sha256=MNoVqo9CC-lnvWvllkOtIRopHvYMSR8yJrMZa02x1i0,6816
44
+ deepwork/standard_jobs/deepwork_jobs/templates/agents.md.template,sha256=SUJL862C6-DnT9lK3sNIZ5T2wVgXN4YRph4FrKtFnLo,739
45
+ deepwork/standard_jobs/deepwork_jobs/templates/doc_spec.md.template,sha256=OXpkFTsEm4CVkJQmx7f6rUZ9My5rHeY_ncaygARjEpA,764
46
+ deepwork/standard_jobs/deepwork_jobs/templates/job.yml.example,sha256=roRi6sIGFGmPCkoVW26HfuTBjAO8-pPsxI5-Gfg3rc0,2361
47
+ deepwork/standard_jobs/deepwork_jobs/templates/job.yml.template,sha256=rlanRupKN73XUR48nF93Mm4pdL35Wa4IeZSKQs7QEWo,1912
48
+ deepwork/standard_jobs/deepwork_jobs/templates/step_instruction.md.example,sha256=HXcjVaQz2HsDiA4ClnIeLvysVOGrFJ_5Tr-pm6dhdwc,2706
49
+ deepwork/standard_jobs/deepwork_jobs/templates/step_instruction.md.template,sha256=6n9jFFuda4r549Oo-LBPKixFD3NvDl5MwEg5V7ItQBg,1286
50
+ deepwork/templates/__init__.py,sha256=APvjx_u7eRUerw9yA_fJ1ZqCzYA-FWUCV9HCz0RgjOc,50
51
+ deepwork/templates/claude/AGENTS.md,sha256=7ickAhY8fNWhNCXPMG5nm6Jmv-XJvDM0PKC41EiQKyU,1828
52
+ deepwork/templates/claude/settings.json,sha256=jdaMq_vXnOA-Gto8pXAawIO09egV_-rTIX3DyJJr8RQ,401
53
+ deepwork/templates/claude/skill-deepwork.md.jinja,sha256=3ZXerM_RipAGmEbubsrVB0NLGID5MP-SBCcPJvRWpmg,1487
54
+ deepwork/templates/gemini/skill-deepwork.md.jinja,sha256=LGe6wEnG1_XGU6NkOV0oDm7lG1w4s7B3EnQddlnsER4,1491
55
+ deepwork/utils/__init__.py,sha256=AtvE49IFI8Rg36O4cNIlzB-oxvkW3apFgXExn8GSk6s,38
56
+ deepwork/utils/fs.py,sha256=TbkcGGqck4lborFerbBLrpVMDUz3E5ZaW6X0_B2t76k,4821
57
+ deepwork/utils/git.py,sha256=J4tAB1zE6-WMAEHbarevhmSvvPLkeKBpiRv1UxUVwYk,3748
58
+ deepwork/utils/validation.py,sha256=SyFg9fIu1JCDMbssQgJRCTUNToDNcINccn8lje-tjts,851
59
+ deepwork/utils/yaml_utils.py,sha256=INHhOmzC38fh7HYKLrq7vmS3dcuNsigH7_U71erS-hw,3127
60
+ deepwork-0.7.0.dist-info/METADATA,sha256=DXJFmPAwoz51ydikLv-kQEiKFf6NOFeeqr0oxeAeb3k,12368
61
+ deepwork-0.7.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
62
+ deepwork-0.7.0.dist-info/entry_points.txt,sha256=RhJBySzm619kh-yIdsAyfFXInAlY8Jm-39FLIBcOj2s,51
63
+ deepwork-0.7.0.dist-info/licenses/LICENSE.md,sha256=W0EtJVYf0cQ_awukOCW1ETwNSpV2RKqnAGfoOjyz_K8,4126
64
+ deepwork-0.7.0.dist-info/RECORD,,
deepwork/cli/rules.py DELETED
@@ -1,32 +0,0 @@
1
- """Rules command for DeepWork CLI."""
2
-
3
- import click
4
- from rich.console import Console
5
-
6
- from deepwork.core.rules_queue import RulesQueue
7
-
8
- console = Console()
9
-
10
-
11
- @click.group()
12
- def rules() -> None:
13
- """Manage DeepWork rules and queue."""
14
- pass
15
-
16
-
17
- @rules.command(name="clear_queue")
18
- def clear_queue() -> None:
19
- """
20
- Clear all entries from the rules queue.
21
-
22
- Removes all JSON files from .deepwork/tmp/rules/queue/.
23
- This is useful for resetting the queue between tests or after
24
- manual verification of rule states.
25
- """
26
- queue = RulesQueue()
27
- count = queue.clear()
28
-
29
- if count == 0:
30
- console.print("[yellow]Queue is already empty[/yellow]")
31
- else:
32
- console.print(f"[green]Cleared {count} queue entry/entries[/green]")
@@ -1,190 +0,0 @@
1
- """Execute command actions for rules."""
2
-
3
- import shlex
4
- import subprocess
5
- from dataclasses import dataclass
6
- from pathlib import Path
7
-
8
- from deepwork.core.rules_parser import CommandAction
9
-
10
-
11
- @dataclass
12
- class CommandResult:
13
- """Result of executing a command."""
14
-
15
- success: bool
16
- exit_code: int
17
- stdout: str
18
- stderr: str
19
- command: str # The actual command that was run
20
-
21
-
22
- def substitute_command_variables(
23
- command_template: str,
24
- file: str | None = None,
25
- files: list[str] | None = None,
26
- repo_root: Path | None = None,
27
- ) -> str:
28
- """
29
- Substitute template variables in a command string.
30
-
31
- Variables:
32
- - {file} - Single file path
33
- - {files} - Space-separated file paths
34
- - {repo_root} - Repository root directory
35
-
36
- Args:
37
- command_template: Command string with {var} placeholders
38
- file: Single file path (for run_for: each_match)
39
- files: List of file paths (for run_for: all_matches)
40
- repo_root: Repository root path
41
-
42
- Returns:
43
- Command string with variables substituted
44
- """
45
- result = command_template
46
-
47
- if file is not None:
48
- # Quote file path to prevent command injection
49
- result = result.replace("{file}", shlex.quote(file))
50
-
51
- if files is not None:
52
- # Quote each file path individually
53
- quoted_files = " ".join(shlex.quote(f) for f in files)
54
- result = result.replace("{files}", quoted_files)
55
-
56
- if repo_root is not None:
57
- result = result.replace("{repo_root}", shlex.quote(str(repo_root)))
58
-
59
- return result
60
-
61
-
62
- def execute_command(
63
- command: str,
64
- cwd: Path | None = None,
65
- timeout: int = 60,
66
- ) -> CommandResult:
67
- """
68
- Execute a command and capture output.
69
-
70
- Args:
71
- command: Command string to execute
72
- cwd: Working directory (defaults to current directory)
73
- timeout: Timeout in seconds
74
-
75
- Returns:
76
- CommandResult with execution details
77
- """
78
- try:
79
- # Run command as shell to support pipes, etc.
80
- result = subprocess.run(
81
- command,
82
- shell=True,
83
- cwd=cwd,
84
- capture_output=True,
85
- text=True,
86
- timeout=timeout,
87
- )
88
-
89
- return CommandResult(
90
- success=result.returncode == 0,
91
- exit_code=result.returncode,
92
- stdout=result.stdout,
93
- stderr=result.stderr,
94
- command=command,
95
- )
96
-
97
- except subprocess.TimeoutExpired:
98
- return CommandResult(
99
- success=False,
100
- exit_code=-1,
101
- stdout="",
102
- stderr=f"Command timed out after {timeout} seconds",
103
- command=command,
104
- )
105
- except Exception as e:
106
- return CommandResult(
107
- success=False,
108
- exit_code=-1,
109
- stdout="",
110
- stderr=str(e),
111
- command=command,
112
- )
113
-
114
-
115
- def run_command_action(
116
- action: CommandAction,
117
- trigger_files: list[str],
118
- repo_root: Path | None = None,
119
- ) -> list[CommandResult]:
120
- """
121
- Run a command action for the given trigger files.
122
-
123
- Args:
124
- action: CommandAction configuration
125
- trigger_files: Files that triggered the rule
126
- repo_root: Repository root path
127
-
128
- Returns:
129
- List of CommandResult (one per command execution)
130
- """
131
- results: list[CommandResult] = []
132
-
133
- if action.run_for == "each_match":
134
- # Run command for each file individually
135
- for file_path in trigger_files:
136
- command = substitute_command_variables(
137
- action.command,
138
- file=file_path,
139
- repo_root=repo_root,
140
- )
141
- result = execute_command(command, cwd=repo_root)
142
- results.append(result)
143
-
144
- elif action.run_for == "all_matches":
145
- # Run command once with all files
146
- command = substitute_command_variables(
147
- action.command,
148
- files=trigger_files,
149
- repo_root=repo_root,
150
- )
151
- result = execute_command(command, cwd=repo_root)
152
- results.append(result)
153
-
154
- return results
155
-
156
-
157
- def all_commands_succeeded(results: list[CommandResult]) -> bool:
158
- """Check if all command executions succeeded."""
159
- return all(r.success for r in results)
160
-
161
-
162
- def format_command_errors(
163
- results: list[CommandResult],
164
- rule_name: str | None = None,
165
- ) -> str:
166
- """Format detailed error messages from failed commands.
167
-
168
- Args:
169
- results: List of command execution results
170
- rule_name: Optional rule name to include in error message
171
-
172
- Returns:
173
- Formatted error message with command, exit code, stdout, and stderr
174
- """
175
- errors: list[str] = []
176
- for result in results:
177
- if not result.success:
178
- parts: list[str] = []
179
- if rule_name:
180
- parts.append(f"Rule: {rule_name}")
181
- parts.append(f"Command: {result.command}")
182
- parts.append(f"Exit code: {result.exit_code}")
183
- if result.stdout and result.stdout.strip():
184
- parts.append(f"Stdout:\n{result.stdout.strip()}")
185
- if result.stderr and result.stderr.strip():
186
- parts.append(f"Stderr:\n{result.stderr.strip()}")
187
- if not result.stdout.strip() and not result.stderr.strip():
188
- parts.append("(no output)")
189
- errors.append("\n".join(parts))
190
- return "\n\n".join(errors)