deepwork 0.4.0__py3-none-any.whl → 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- deepwork/__init__.py +1 -1
- deepwork/cli/hook.py +3 -4
- deepwork/cli/install.py +70 -117
- deepwork/cli/main.py +2 -2
- deepwork/cli/serve.py +133 -0
- deepwork/cli/sync.py +93 -58
- deepwork/core/adapters.py +91 -98
- deepwork/core/generator.py +19 -386
- deepwork/core/hooks_syncer.py +1 -1
- deepwork/core/parser.py +270 -1
- deepwork/hooks/README.md +0 -44
- deepwork/hooks/__init__.py +3 -6
- deepwork/hooks/check_version.sh +54 -21
- deepwork/mcp/__init__.py +23 -0
- deepwork/mcp/quality_gate.py +347 -0
- deepwork/mcp/schemas.py +263 -0
- deepwork/mcp/server.py +253 -0
- deepwork/mcp/state.py +422 -0
- deepwork/mcp/tools.py +394 -0
- deepwork/schemas/job.schema.json +347 -0
- deepwork/schemas/job_schema.py +27 -239
- deepwork/standard_jobs/deepwork_jobs/doc_specs/job_spec.md +9 -15
- deepwork/standard_jobs/deepwork_jobs/job.yml +146 -46
- deepwork/standard_jobs/deepwork_jobs/steps/define.md +100 -33
- deepwork/standard_jobs/deepwork_jobs/steps/errata.md +154 -0
- deepwork/standard_jobs/deepwork_jobs/steps/fix_jobs.md +207 -0
- deepwork/standard_jobs/deepwork_jobs/steps/fix_settings.md +177 -0
- deepwork/standard_jobs/deepwork_jobs/steps/implement.md +22 -138
- deepwork/standard_jobs/deepwork_jobs/steps/iterate.md +221 -0
- deepwork/standard_jobs/deepwork_jobs/steps/learn.md +2 -26
- deepwork/standard_jobs/deepwork_jobs/steps/test.md +154 -0
- deepwork/standard_jobs/deepwork_jobs/templates/job.yml.template +2 -0
- deepwork/templates/claude/AGENTS.md +38 -0
- deepwork/templates/claude/settings.json +16 -0
- deepwork/templates/claude/skill-deepwork.md.jinja +37 -0
- deepwork/templates/gemini/skill-deepwork.md.jinja +37 -0
- deepwork-0.7.0.dist-info/METADATA +317 -0
- deepwork-0.7.0.dist-info/RECORD +64 -0
- deepwork/cli/rules.py +0 -32
- deepwork/core/command_executor.py +0 -190
- deepwork/core/pattern_matcher.py +0 -271
- deepwork/core/rules_parser.py +0 -559
- deepwork/core/rules_queue.py +0 -321
- deepwork/hooks/rules_check.py +0 -759
- deepwork/schemas/rules_schema.py +0 -135
- deepwork/standard_jobs/deepwork_jobs/steps/review_job_spec.md +0 -208
- deepwork/standard_jobs/deepwork_jobs/templates/doc_spec.md.example +0 -86
- deepwork/standard_jobs/deepwork_rules/hooks/capture_prompt_work_tree.sh +0 -38
- deepwork/standard_jobs/deepwork_rules/hooks/global_hooks.yml +0 -8
- deepwork/standard_jobs/deepwork_rules/hooks/user_prompt_submit.sh +0 -16
- deepwork/standard_jobs/deepwork_rules/job.yml +0 -49
- deepwork/standard_jobs/deepwork_rules/rules/.gitkeep +0 -13
- deepwork/standard_jobs/deepwork_rules/rules/api-documentation-sync.md.example +0 -10
- deepwork/standard_jobs/deepwork_rules/rules/readme-documentation.md.example +0 -10
- deepwork/standard_jobs/deepwork_rules/rules/security-review.md.example +0 -11
- deepwork/standard_jobs/deepwork_rules/rules/skill-md-validation.md +0 -46
- deepwork/standard_jobs/deepwork_rules/rules/source-test-pairing.md.example +0 -13
- deepwork/standard_jobs/deepwork_rules/steps/define.md +0 -249
- deepwork/templates/claude/skill-job-meta.md.jinja +0 -77
- deepwork/templates/claude/skill-job-step.md.jinja +0 -251
- deepwork/templates/gemini/skill-job-meta.toml.jinja +0 -76
- deepwork/templates/gemini/skill-job-step.toml.jinja +0 -162
- deepwork-0.4.0.dist-info/METADATA +0 -381
- deepwork-0.4.0.dist-info/RECORD +0 -71
- {deepwork-0.4.0.dist-info → deepwork-0.7.0.dist-info}/WHEEL +0 -0
- {deepwork-0.4.0.dist-info → deepwork-0.7.0.dist-info}/entry_points.txt +0 -0
- {deepwork-0.4.0.dist-info → deepwork-0.7.0.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://deepwork.dev/schemas/job.schema.json",
|
|
4
|
+
"title": "DeepWork Job Definition",
|
|
5
|
+
"description": "Schema for DeepWork job.yml files. Jobs are multi-step workflows executed by AI agents.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["name", "version", "summary", "steps"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"name": {
|
|
11
|
+
"type": "string",
|
|
12
|
+
"pattern": "^[a-z][a-z0-9_]*$",
|
|
13
|
+
"description": "Job name (lowercase letters, numbers, underscores, must start with letter). Example: 'competitive_research'"
|
|
14
|
+
},
|
|
15
|
+
"version": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
18
|
+
"description": "Semantic version (e.g., '1.0.0')"
|
|
19
|
+
},
|
|
20
|
+
"summary": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"maxLength": 200,
|
|
24
|
+
"description": "Brief one-line summary of what this job accomplishes. Used in skill descriptions."
|
|
25
|
+
},
|
|
26
|
+
"description": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"minLength": 1,
|
|
29
|
+
"description": "Detailed multi-line description of the job's purpose, process, and goals"
|
|
30
|
+
},
|
|
31
|
+
"workflows": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"description": "Named workflows that group steps into multi-step sequences. Workflows define execution order.",
|
|
34
|
+
"items": {
|
|
35
|
+
"$ref": "#/$defs/workflow"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"changelog": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"description": "Version history documenting changes to the job definition",
|
|
41
|
+
"items": {
|
|
42
|
+
"$ref": "#/$defs/changelogEntry"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"steps": {
|
|
46
|
+
"type": "array",
|
|
47
|
+
"minItems": 1,
|
|
48
|
+
"description": "List of steps in the job. Each step becomes a skill/command.",
|
|
49
|
+
"items": {
|
|
50
|
+
"$ref": "#/$defs/step"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"$defs": {
|
|
55
|
+
"stepId": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"pattern": "^[a-z][a-z0-9_]*$",
|
|
58
|
+
"description": "Step identifier (lowercase letters, numbers, underscores, must start with letter)"
|
|
59
|
+
},
|
|
60
|
+
"workflow": {
|
|
61
|
+
"type": "object",
|
|
62
|
+
"required": ["name", "summary", "steps"],
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"description": "A named workflow grouping steps into a sequence",
|
|
65
|
+
"properties": {
|
|
66
|
+
"name": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"pattern": "^[a-z][a-z0-9_]*$",
|
|
69
|
+
"description": "Workflow name (lowercase letters, numbers, underscores)"
|
|
70
|
+
},
|
|
71
|
+
"summary": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"minLength": 1,
|
|
74
|
+
"maxLength": 200,
|
|
75
|
+
"description": "Brief one-line summary of what this workflow accomplishes"
|
|
76
|
+
},
|
|
77
|
+
"steps": {
|
|
78
|
+
"type": "array",
|
|
79
|
+
"minItems": 1,
|
|
80
|
+
"description": "Ordered list of step entries. Each entry is either a step ID (string) or an array of step IDs for concurrent execution.",
|
|
81
|
+
"items": {
|
|
82
|
+
"$ref": "#/$defs/workflowStepEntry"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"workflowStepEntry": {
|
|
88
|
+
"oneOf": [
|
|
89
|
+
{
|
|
90
|
+
"$ref": "#/$defs/stepId"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "array",
|
|
94
|
+
"minItems": 1,
|
|
95
|
+
"description": "Array of step IDs that can be executed concurrently",
|
|
96
|
+
"items": {
|
|
97
|
+
"$ref": "#/$defs/stepId"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"changelogEntry": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"required": ["version", "changes"],
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"properties": {
|
|
107
|
+
"version": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
110
|
+
"description": "Version number for this change"
|
|
111
|
+
},
|
|
112
|
+
"changes": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"minLength": 1,
|
|
115
|
+
"description": "Description of changes made in this version"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"step": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"required": ["id", "name", "description", "instructions_file", "outputs"],
|
|
122
|
+
"additionalProperties": false,
|
|
123
|
+
"description": "A single step in a job, representing one unit of work",
|
|
124
|
+
"properties": {
|
|
125
|
+
"id": {
|
|
126
|
+
"$ref": "#/$defs/stepId",
|
|
127
|
+
"description": "Unique step identifier within this job"
|
|
128
|
+
},
|
|
129
|
+
"name": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"minLength": 1,
|
|
132
|
+
"description": "Human-readable display name for the step"
|
|
133
|
+
},
|
|
134
|
+
"description": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"minLength": 1,
|
|
137
|
+
"description": "Description of what this step does. Used in skill descriptions."
|
|
138
|
+
},
|
|
139
|
+
"instructions_file": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"minLength": 1,
|
|
142
|
+
"description": "Path to instructions markdown file (relative to job directory). Example: 'steps/research.md'"
|
|
143
|
+
},
|
|
144
|
+
"inputs": {
|
|
145
|
+
"type": "array",
|
|
146
|
+
"description": "List of inputs required by this step (user parameters or files from previous steps)",
|
|
147
|
+
"items": {
|
|
148
|
+
"$ref": "#/$defs/stepInput"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"outputs": {
|
|
152
|
+
"type": "array",
|
|
153
|
+
"minItems": 1,
|
|
154
|
+
"description": "List of output files/directories produced by this step",
|
|
155
|
+
"items": {
|
|
156
|
+
"$ref": "#/$defs/stepOutput"
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"dependencies": {
|
|
160
|
+
"type": "array",
|
|
161
|
+
"description": "List of step IDs this step depends on. Dependencies must complete before this step runs.",
|
|
162
|
+
"items": {
|
|
163
|
+
"type": "string"
|
|
164
|
+
},
|
|
165
|
+
"default": []
|
|
166
|
+
},
|
|
167
|
+
"hooks": {
|
|
168
|
+
"$ref": "#/$defs/hooks",
|
|
169
|
+
"description": "Lifecycle hooks for validation and actions at different points in step execution"
|
|
170
|
+
},
|
|
171
|
+
"stop_hooks": {
|
|
172
|
+
"type": "array",
|
|
173
|
+
"description": "DEPRECATED: Use hooks.after_agent instead. Legacy stop hooks for quality validation loops.",
|
|
174
|
+
"items": {
|
|
175
|
+
"$ref": "#/$defs/hookAction"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"exposed": {
|
|
179
|
+
"type": "boolean",
|
|
180
|
+
"description": "If true, step is user-invocable in menus/commands. If false, step is hidden (only reachable via workflows or dependencies). Default: false",
|
|
181
|
+
"default": false
|
|
182
|
+
},
|
|
183
|
+
"hidden": {
|
|
184
|
+
"type": "boolean",
|
|
185
|
+
"description": "If true, step is hidden from menus. Alias for exposed: false. Default: false",
|
|
186
|
+
"default": false
|
|
187
|
+
},
|
|
188
|
+
"quality_criteria": {
|
|
189
|
+
"type": "array",
|
|
190
|
+
"description": "Declarative quality criteria for evaluating step outputs. Rendered with standard evaluation framing.",
|
|
191
|
+
"items": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"minLength": 1
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"agent": {
|
|
197
|
+
"type": "string",
|
|
198
|
+
"minLength": 1,
|
|
199
|
+
"description": "Agent type for this step (e.g., 'general-purpose'). When set, the skill uses context forking and delegates to the specified agent type."
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"stepInput": {
|
|
204
|
+
"oneOf": [
|
|
205
|
+
{
|
|
206
|
+
"$ref": "#/$defs/userParameterInput"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"$ref": "#/$defs/fileInput"
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
"userParameterInput": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"required": ["name", "description"],
|
|
216
|
+
"additionalProperties": false,
|
|
217
|
+
"description": "A user-provided parameter input that will be requested at runtime",
|
|
218
|
+
"properties": {
|
|
219
|
+
"name": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"minLength": 1,
|
|
222
|
+
"description": "Parameter name (used as variable name)"
|
|
223
|
+
},
|
|
224
|
+
"description": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"minLength": 1,
|
|
227
|
+
"description": "Description shown to user when requesting this input"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"fileInput": {
|
|
232
|
+
"type": "object",
|
|
233
|
+
"required": ["file", "from_step"],
|
|
234
|
+
"additionalProperties": false,
|
|
235
|
+
"description": "A file input from a previous step's output",
|
|
236
|
+
"properties": {
|
|
237
|
+
"file": {
|
|
238
|
+
"type": "string",
|
|
239
|
+
"minLength": 1,
|
|
240
|
+
"description": "File name to consume from the source step's outputs"
|
|
241
|
+
},
|
|
242
|
+
"from_step": {
|
|
243
|
+
"type": "string",
|
|
244
|
+
"minLength": 1,
|
|
245
|
+
"description": "Step ID that produces this file. Must be in the dependencies list."
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"stepOutput": {
|
|
250
|
+
"oneOf": [
|
|
251
|
+
{
|
|
252
|
+
"type": "string",
|
|
253
|
+
"minLength": 1,
|
|
254
|
+
"description": "Simple output file path (backward compatible format)"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"$ref": "#/$defs/outputWithDocSpec"
|
|
258
|
+
}
|
|
259
|
+
]
|
|
260
|
+
},
|
|
261
|
+
"outputWithDocSpec": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"required": ["file"],
|
|
264
|
+
"additionalProperties": false,
|
|
265
|
+
"description": "Output file with optional document specification reference",
|
|
266
|
+
"properties": {
|
|
267
|
+
"file": {
|
|
268
|
+
"type": "string",
|
|
269
|
+
"minLength": 1,
|
|
270
|
+
"description": "Output file path"
|
|
271
|
+
},
|
|
272
|
+
"doc_spec": {
|
|
273
|
+
"type": "string",
|
|
274
|
+
"pattern": "^\\.deepwork/doc_specs/[a-z][a-z0-9_-]*\\.md$",
|
|
275
|
+
"description": "Path to doc spec file defining the expected document structure. Example: '.deepwork/doc_specs/report.md'"
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
"hooks": {
|
|
280
|
+
"type": "object",
|
|
281
|
+
"additionalProperties": false,
|
|
282
|
+
"description": "Lifecycle hooks triggered at different points in step execution",
|
|
283
|
+
"properties": {
|
|
284
|
+
"after_agent": {
|
|
285
|
+
"type": "array",
|
|
286
|
+
"description": "Hooks triggered after the agent finishes. Used for quality validation loops.",
|
|
287
|
+
"items": {
|
|
288
|
+
"$ref": "#/$defs/hookAction"
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
"before_tool": {
|
|
292
|
+
"type": "array",
|
|
293
|
+
"description": "Hooks triggered before a tool is used. Used for pre-action checks.",
|
|
294
|
+
"items": {
|
|
295
|
+
"$ref": "#/$defs/hookAction"
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"before_prompt": {
|
|
299
|
+
"type": "array",
|
|
300
|
+
"description": "Hooks triggered when user submits a prompt. Used for input validation.",
|
|
301
|
+
"items": {
|
|
302
|
+
"$ref": "#/$defs/hookAction"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"hookAction": {
|
|
308
|
+
"type": "object",
|
|
309
|
+
"description": "A hook action - exactly one of: prompt (inline text), prompt_file (external file), or script (shell script)",
|
|
310
|
+
"oneOf": [
|
|
311
|
+
{
|
|
312
|
+
"required": ["prompt"],
|
|
313
|
+
"additionalProperties": false,
|
|
314
|
+
"properties": {
|
|
315
|
+
"prompt": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"minLength": 1,
|
|
318
|
+
"description": "Inline prompt text for validation/action"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"required": ["prompt_file"],
|
|
324
|
+
"additionalProperties": false,
|
|
325
|
+
"properties": {
|
|
326
|
+
"prompt_file": {
|
|
327
|
+
"type": "string",
|
|
328
|
+
"minLength": 1,
|
|
329
|
+
"description": "Path to prompt file (relative to job directory)"
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"required": ["script"],
|
|
335
|
+
"additionalProperties": false,
|
|
336
|
+
"properties": {
|
|
337
|
+
"script": {
|
|
338
|
+
"type": "string",
|
|
339
|
+
"minLength": 1,
|
|
340
|
+
"description": "Path to shell script (relative to job directory)"
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
deepwork/schemas/job_schema.py
CHANGED
|
@@ -1,247 +1,35 @@
|
|
|
1
|
-
"""JSON Schema
|
|
1
|
+
"""JSON Schema loader for job definitions.
|
|
2
2
|
|
|
3
|
+
This module loads the job.schema.json file and provides it as a Python dict
|
|
4
|
+
for use with jsonschema validation.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
from pathlib import Path
|
|
3
9
|
from typing import Any
|
|
4
10
|
|
|
5
11
|
# Supported lifecycle hook events (generic names, mapped to platform-specific by adapters)
|
|
6
12
|
# These values must match SkillLifecycleHook enum in adapters.py
|
|
7
13
|
LIFECYCLE_HOOK_EVENTS = ["after_agent", "before_tool", "before_prompt"]
|
|
8
14
|
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"required": ["prompt_file"],
|
|
26
|
-
"properties": {
|
|
27
|
-
"prompt_file": {
|
|
28
|
-
"type": "string",
|
|
29
|
-
"minLength": 1,
|
|
30
|
-
"description": "Path to prompt file (relative to job directory)",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
"additionalProperties": False,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"required": ["script"],
|
|
37
|
-
"properties": {
|
|
38
|
-
"script": {
|
|
39
|
-
"type": "string",
|
|
40
|
-
"minLength": 1,
|
|
41
|
-
"description": "Path to shell script (relative to job directory)",
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
"additionalProperties": False,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
}
|
|
15
|
+
# Path to the JSON schema file
|
|
16
|
+
_SCHEMA_FILE = Path(__file__).parent / "job.schema.json"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _load_schema() -> dict[str, Any]:
|
|
20
|
+
"""Load the JSON schema from file."""
|
|
21
|
+
with open(_SCHEMA_FILE) as f:
|
|
22
|
+
return json.load(f)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# Load the schema at module import time
|
|
26
|
+
JOB_SCHEMA: dict[str, Any] = _load_schema()
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def get_schema_path() -> Path:
|
|
30
|
+
"""Get the path to the JSON schema file.
|
|
48
31
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
"required": ["name", "version", "summary", "steps"],
|
|
54
|
-
"properties": {
|
|
55
|
-
"name": {
|
|
56
|
-
"type": "string",
|
|
57
|
-
"pattern": "^[a-z][a-z0-9_]*$",
|
|
58
|
-
"description": "Job name (lowercase letters, numbers, underscores, must start with letter)",
|
|
59
|
-
},
|
|
60
|
-
"version": {
|
|
61
|
-
"type": "string",
|
|
62
|
-
"pattern": r"^\d+\.\d+\.\d+$",
|
|
63
|
-
"description": "Semantic version (e.g., 1.0.0)",
|
|
64
|
-
},
|
|
65
|
-
"summary": {
|
|
66
|
-
"type": "string",
|
|
67
|
-
"minLength": 1,
|
|
68
|
-
"maxLength": 200,
|
|
69
|
-
"description": "Brief one-line summary of what this job accomplishes",
|
|
70
|
-
},
|
|
71
|
-
"description": {
|
|
72
|
-
"type": "string",
|
|
73
|
-
"minLength": 1,
|
|
74
|
-
"description": "Detailed multi-line description of the job's purpose, process, and goals",
|
|
75
|
-
},
|
|
76
|
-
"changelog": {
|
|
77
|
-
"type": "array",
|
|
78
|
-
"description": "Version history and changes to the job",
|
|
79
|
-
"items": {
|
|
80
|
-
"type": "object",
|
|
81
|
-
"required": ["version", "changes"],
|
|
82
|
-
"properties": {
|
|
83
|
-
"version": {
|
|
84
|
-
"type": "string",
|
|
85
|
-
"pattern": r"^\d+\.\d+\.\d+$",
|
|
86
|
-
"description": "Version number for this change",
|
|
87
|
-
},
|
|
88
|
-
"changes": {
|
|
89
|
-
"type": "string",
|
|
90
|
-
"minLength": 1,
|
|
91
|
-
"description": "Description of changes made in this version",
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
"additionalProperties": False,
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
"steps": {
|
|
98
|
-
"type": "array",
|
|
99
|
-
"minItems": 1,
|
|
100
|
-
"description": "List of steps in the job",
|
|
101
|
-
"items": {
|
|
102
|
-
"type": "object",
|
|
103
|
-
"required": ["id", "name", "description", "instructions_file", "outputs"],
|
|
104
|
-
"properties": {
|
|
105
|
-
"id": {
|
|
106
|
-
"type": "string",
|
|
107
|
-
"pattern": "^[a-z][a-z0-9_]*$",
|
|
108
|
-
"description": "Step ID (unique within job)",
|
|
109
|
-
},
|
|
110
|
-
"name": {
|
|
111
|
-
"type": "string",
|
|
112
|
-
"minLength": 1,
|
|
113
|
-
"description": "Human-readable step name",
|
|
114
|
-
},
|
|
115
|
-
"description": {
|
|
116
|
-
"type": "string",
|
|
117
|
-
"minLength": 1,
|
|
118
|
-
"description": "Step description",
|
|
119
|
-
},
|
|
120
|
-
"instructions_file": {
|
|
121
|
-
"type": "string",
|
|
122
|
-
"minLength": 1,
|
|
123
|
-
"description": "Path to instructions file (relative to job directory)",
|
|
124
|
-
},
|
|
125
|
-
"inputs": {
|
|
126
|
-
"type": "array",
|
|
127
|
-
"description": "List of inputs (user parameters or files from previous steps)",
|
|
128
|
-
"items": {
|
|
129
|
-
"type": "object",
|
|
130
|
-
"oneOf": [
|
|
131
|
-
{
|
|
132
|
-
"required": ["name", "description"],
|
|
133
|
-
"properties": {
|
|
134
|
-
"name": {
|
|
135
|
-
"type": "string",
|
|
136
|
-
"description": "Input parameter name",
|
|
137
|
-
},
|
|
138
|
-
"description": {
|
|
139
|
-
"type": "string",
|
|
140
|
-
"description": "Input parameter description",
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
"additionalProperties": False,
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
"required": ["file", "from_step"],
|
|
147
|
-
"properties": {
|
|
148
|
-
"file": {
|
|
149
|
-
"type": "string",
|
|
150
|
-
"description": "File name from previous step",
|
|
151
|
-
},
|
|
152
|
-
"from_step": {
|
|
153
|
-
"type": "string",
|
|
154
|
-
"description": "Step ID that produces this file",
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
"additionalProperties": False,
|
|
158
|
-
},
|
|
159
|
-
],
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
"outputs": {
|
|
163
|
-
"type": "array",
|
|
164
|
-
"description": "List of output files/directories, optionally with document type references",
|
|
165
|
-
"items": {
|
|
166
|
-
"oneOf": [
|
|
167
|
-
{
|
|
168
|
-
"type": "string",
|
|
169
|
-
"minLength": 1,
|
|
170
|
-
"description": "Simple output file path (backward compatible)",
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"type": "object",
|
|
174
|
-
"required": ["file"],
|
|
175
|
-
"properties": {
|
|
176
|
-
"file": {
|
|
177
|
-
"type": "string",
|
|
178
|
-
"minLength": 1,
|
|
179
|
-
"description": "Output file path",
|
|
180
|
-
},
|
|
181
|
-
"doc_spec": {
|
|
182
|
-
"type": "string",
|
|
183
|
-
"pattern": r"^\.deepwork/doc_specs/[a-z][a-z0-9_-]*\.md$",
|
|
184
|
-
"description": "Path to doc spec file",
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
"additionalProperties": False,
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
"dependencies": {
|
|
193
|
-
"type": "array",
|
|
194
|
-
"description": "List of step IDs this step depends on",
|
|
195
|
-
"items": {
|
|
196
|
-
"type": "string",
|
|
197
|
-
},
|
|
198
|
-
"default": [],
|
|
199
|
-
},
|
|
200
|
-
"hooks": {
|
|
201
|
-
"type": "object",
|
|
202
|
-
"description": "Lifecycle hooks for this step, keyed by event type",
|
|
203
|
-
"properties": {
|
|
204
|
-
"after_agent": {
|
|
205
|
-
"type": "array",
|
|
206
|
-
"description": "Hooks triggered after the agent finishes (quality validation)",
|
|
207
|
-
"items": HOOK_ACTION_SCHEMA,
|
|
208
|
-
},
|
|
209
|
-
"before_tool": {
|
|
210
|
-
"type": "array",
|
|
211
|
-
"description": "Hooks triggered before a tool is used",
|
|
212
|
-
"items": HOOK_ACTION_SCHEMA,
|
|
213
|
-
},
|
|
214
|
-
"before_prompt": {
|
|
215
|
-
"type": "array",
|
|
216
|
-
"description": "Hooks triggered when user submits a prompt",
|
|
217
|
-
"items": HOOK_ACTION_SCHEMA,
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
"additionalProperties": False,
|
|
221
|
-
},
|
|
222
|
-
# DEPRECATED: Use hooks.after_agent instead
|
|
223
|
-
"stop_hooks": {
|
|
224
|
-
"type": "array",
|
|
225
|
-
"description": "DEPRECATED: Use hooks.after_agent instead. Stop hooks for quality validation loops.",
|
|
226
|
-
"items": HOOK_ACTION_SCHEMA,
|
|
227
|
-
},
|
|
228
|
-
"exposed": {
|
|
229
|
-
"type": "boolean",
|
|
230
|
-
"description": "If true, skill is user-invocable in menus. Default: false (hidden from menus).",
|
|
231
|
-
"default": False,
|
|
232
|
-
},
|
|
233
|
-
"quality_criteria": {
|
|
234
|
-
"type": "array",
|
|
235
|
-
"description": "Declarative quality criteria. Rendered with standard evaluation framing.",
|
|
236
|
-
"items": {
|
|
237
|
-
"type": "string",
|
|
238
|
-
"minLength": 1,
|
|
239
|
-
},
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
"additionalProperties": False,
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
"additionalProperties": False,
|
|
247
|
-
}
|
|
32
|
+
Returns:
|
|
33
|
+
Path to job.schema.json
|
|
34
|
+
"""
|
|
35
|
+
return _SCHEMA_FILE
|
|
@@ -23,7 +23,7 @@ quality_criteria:
|
|
|
23
23
|
- name: Input Consistency
|
|
24
24
|
description: "File inputs with `from_step` must reference a step that is in the dependencies array"
|
|
25
25
|
- name: Output Paths
|
|
26
|
-
description: "Outputs must be valid filenames or paths within the main repo
|
|
26
|
+
description: "Outputs must be valid filenames or paths within the main repo directory structure, never in dot-directories like `.deepwork/`. Use specific, descriptive paths that lend themselves to glob patterns (e.g., `competitive_research/acme_corp/swot.md` or `operations/reports/2026-01/spending_analysis.md`). Parameterized paths like `[competitor_name]/` are encouraged for per-entity outputs. Avoid generic names (`output.md`, `analysis.md`) and transient-sounding paths (`temp/`, `draft.md`). Supporting materials for a final output should go in a peer `_dataroom` folder (e.g., `spending_analysis_dataroom/`)."
|
|
27
27
|
- name: Concise Instructions
|
|
28
28
|
description: "The content of the file, particularly the description, must not have excessively redundant information. It should be concise and to the point given that extra tokens will confuse the AI."
|
|
29
29
|
---
|
|
@@ -82,14 +82,19 @@ steps:
|
|
|
82
82
|
|
|
83
83
|
## Optional Fields
|
|
84
84
|
|
|
85
|
-
###
|
|
85
|
+
### Agent Delegation
|
|
86
|
+
|
|
87
|
+
When a step should be executed by a specific agent type, use the `agent` field. This automatically sets `context: fork` in the generated skill.
|
|
86
88
|
|
|
87
89
|
```yaml
|
|
88
90
|
steps:
|
|
89
|
-
- id:
|
|
90
|
-
|
|
91
|
+
- id: research_step
|
|
92
|
+
agent: general-purpose # Delegates to the general-purpose agent
|
|
91
93
|
```
|
|
92
94
|
|
|
95
|
+
Available agent types:
|
|
96
|
+
- `general-purpose` - Standard agent for multi-step tasks
|
|
97
|
+
|
|
93
98
|
### Quality Hooks
|
|
94
99
|
|
|
95
100
|
```yaml
|
|
@@ -109,17 +114,6 @@ steps:
|
|
|
109
114
|
- script: hooks/run_tests.sh
|
|
110
115
|
```
|
|
111
116
|
|
|
112
|
-
### Stop Hooks (Legacy)
|
|
113
|
-
|
|
114
|
-
```yaml
|
|
115
|
-
steps:
|
|
116
|
-
- id: step_id
|
|
117
|
-
stop_hooks:
|
|
118
|
-
- prompt: "Validation prompt..."
|
|
119
|
-
- prompt_file: hooks/check.md
|
|
120
|
-
- script: hooks/validate.sh
|
|
121
|
-
```
|
|
122
|
-
|
|
123
117
|
## Validation Rules
|
|
124
118
|
|
|
125
119
|
1. **No circular dependencies**: Step A cannot depend on Step B if Step B depends on Step A
|