deepwork 0.1.1__py3-none-any.whl → 0.3.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 (59) hide show
  1. deepwork/cli/install.py +121 -32
  2. deepwork/cli/sync.py +20 -20
  3. deepwork/core/adapters.py +88 -51
  4. deepwork/core/command_executor.py +173 -0
  5. deepwork/core/generator.py +148 -31
  6. deepwork/core/hooks_syncer.py +51 -25
  7. deepwork/core/parser.py +8 -0
  8. deepwork/core/pattern_matcher.py +271 -0
  9. deepwork/core/rules_parser.py +511 -0
  10. deepwork/core/rules_queue.py +321 -0
  11. deepwork/hooks/README.md +181 -0
  12. deepwork/hooks/__init__.py +77 -1
  13. deepwork/hooks/claude_hook.sh +55 -0
  14. deepwork/hooks/gemini_hook.sh +55 -0
  15. deepwork/hooks/rules_check.py +514 -0
  16. deepwork/hooks/wrapper.py +363 -0
  17. deepwork/schemas/job_schema.py +14 -1
  18. deepwork/schemas/rules_schema.py +103 -0
  19. deepwork/standard_jobs/deepwork_jobs/AGENTS.md +60 -0
  20. deepwork/standard_jobs/deepwork_jobs/job.yml +41 -56
  21. deepwork/standard_jobs/deepwork_jobs/make_new_job.sh +134 -0
  22. deepwork/standard_jobs/deepwork_jobs/steps/define.md +29 -63
  23. deepwork/standard_jobs/deepwork_jobs/steps/implement.md +62 -263
  24. deepwork/standard_jobs/deepwork_jobs/steps/learn.md +4 -62
  25. deepwork/standard_jobs/deepwork_jobs/templates/agents.md.template +32 -0
  26. deepwork/standard_jobs/deepwork_jobs/templates/job.yml.example +73 -0
  27. deepwork/standard_jobs/deepwork_jobs/templates/job.yml.template +56 -0
  28. deepwork/standard_jobs/deepwork_jobs/templates/step_instruction.md.example +82 -0
  29. deepwork/standard_jobs/deepwork_jobs/templates/step_instruction.md.template +58 -0
  30. deepwork/standard_jobs/deepwork_rules/hooks/global_hooks.yml +8 -0
  31. deepwork/standard_jobs/deepwork_rules/job.yml +39 -0
  32. deepwork/standard_jobs/deepwork_rules/rules/.gitkeep +13 -0
  33. deepwork/standard_jobs/deepwork_rules/rules/api-documentation-sync.md.example +10 -0
  34. deepwork/standard_jobs/deepwork_rules/rules/readme-documentation.md.example +10 -0
  35. deepwork/standard_jobs/deepwork_rules/rules/security-review.md.example +11 -0
  36. deepwork/standard_jobs/deepwork_rules/rules/skill-md-validation.md +45 -0
  37. deepwork/standard_jobs/deepwork_rules/rules/source-test-pairing.md.example +13 -0
  38. deepwork/standard_jobs/deepwork_rules/steps/define.md +249 -0
  39. deepwork/templates/claude/skill-job-meta.md.jinja +70 -0
  40. deepwork/templates/claude/skill-job-step.md.jinja +198 -0
  41. deepwork/templates/gemini/skill-job-meta.toml.jinja +76 -0
  42. deepwork/templates/gemini/skill-job-step.toml.jinja +147 -0
  43. {deepwork-0.1.1.dist-info → deepwork-0.3.0.dist-info}/METADATA +54 -24
  44. deepwork-0.3.0.dist-info/RECORD +62 -0
  45. deepwork/core/policy_parser.py +0 -295
  46. deepwork/hooks/evaluate_policies.py +0 -376
  47. deepwork/schemas/policy_schema.py +0 -78
  48. deepwork/standard_jobs/deepwork_policy/hooks/global_hooks.yml +0 -8
  49. deepwork/standard_jobs/deepwork_policy/hooks/policy_stop_hook.sh +0 -56
  50. deepwork/standard_jobs/deepwork_policy/job.yml +0 -35
  51. deepwork/standard_jobs/deepwork_policy/steps/define.md +0 -195
  52. deepwork/templates/claude/command-job-step.md.jinja +0 -210
  53. deepwork/templates/gemini/command-job-step.toml.jinja +0 -169
  54. deepwork-0.1.1.dist-info/RECORD +0 -41
  55. /deepwork/standard_jobs/{deepwork_policy → deepwork_rules}/hooks/capture_prompt_work_tree.sh +0 -0
  56. /deepwork/standard_jobs/{deepwork_policy → deepwork_rules}/hooks/user_prompt_submit.sh +0 -0
  57. {deepwork-0.1.1.dist-info → deepwork-0.3.0.dist-info}/WHEEL +0 -0
  58. {deepwork-0.1.1.dist-info → deepwork-0.3.0.dist-info}/entry_points.txt +0 -0
  59. {deepwork-0.1.1.dist-info → deepwork-0.3.0.dist-info}/licenses/LICENSE.md +0 -0
@@ -1,12 +1,12 @@
1
1
  name: deepwork_jobs
2
- version: "0.2.0"
2
+ version: "0.5.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
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
- asking detailed questions about your workflow, understanding each step's inputs and outputs,
9
+ asking structured questions about your workflow, understanding each step's inputs and outputs,
10
10
  and generating all necessary files.
11
11
 
12
12
  The `learn` command reflects on conversations where DeepWork jobs were run, identifies
@@ -18,6 +18,12 @@ changelog:
18
18
  changes: "Initial version"
19
19
  - version: "0.2.0"
20
20
  changes: "Replaced refine command with learn command for conversation-driven improvement"
21
+ - version: "0.3.0"
22
+ changes: "Added make_new_job.sh script and templates directory; updated instructions to reference templates instead of inline examples"
23
+ - version: "0.4.0"
24
+ changes: "Removed implementation_summary and learning_summary outputs; simplified step outputs"
25
+ - version: "0.5.0"
26
+ changes: "Standardized on 'ask structured questions' phrasing for user input; Updated quality criteria hooks to verify phrase usage; Added guidance in implement.md to use phrase in generated instructions"
21
27
 
22
28
  steps:
23
29
  - id: define
@@ -30,21 +36,15 @@ steps:
30
36
  outputs:
31
37
  - job.yml
32
38
  dependencies: []
33
- hooks:
34
- after_agent:
35
- - prompt: |
36
- Verify the job.yml output meets ALL quality criteria before completing:
37
-
38
- 1. **User Understanding**: Did you fully understand the user's workflow through interactive Q&A?
39
- 2. **Clear Inputs/Outputs**: Does every step have clearly defined inputs and outputs?
40
- 3. **Logical Dependencies**: Do step dependencies make sense and avoid circular references?
41
- 4. **Concise Summary**: Is the summary under 200 characters and descriptive?
42
- 5. **Rich Description**: Does the description provide enough context for future refinement?
43
- 6. **Valid Schema**: Does the job.yml follow the required schema (name, version, summary, steps)?
44
- 7. **File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`?
45
-
46
- If ANY criterion is not met, continue working to address it.
47
- If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.
39
+ quality_criteria:
40
+ - "**User Understanding**: Did the agent fully understand the user's workflow by asking structured questions?"
41
+ - "**Structured Questions Used**: Did the agent ask structured questions (using the AskUserQuestion tool) to gather user input?"
42
+ - "**Clear Inputs/Outputs**: Does every step have clearly defined inputs and outputs?"
43
+ - "**Logical Dependencies**: Do step dependencies make sense and avoid circular references?"
44
+ - "**Concise Summary**: Is the summary under 200 characters and descriptive?"
45
+ - "**Rich Description**: Does the description provide enough context for future refinement?"
46
+ - "**Valid Schema**: Does the job.yml follow the required schema (name, version, summary, steps)?"
47
+ - "**File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`?"
48
48
 
49
49
  - id: implement
50
50
  name: "Implement Job Steps"
@@ -54,54 +54,39 @@ steps:
54
54
  - file: job.yml
55
55
  from_step: define
56
56
  outputs:
57
- - implementation_summary.md
57
+ - steps/
58
58
  dependencies:
59
59
  - define
60
- hooks:
61
- after_agent:
62
- - prompt: |
63
- Verify the implementation meets ALL quality criteria before completing:
64
-
65
- 1. **Directory Structure**: Is `.deepwork/jobs/[job_name]/` created correctly?
66
- 2. **Complete Instructions**: Are ALL step instruction files complete (not stubs or placeholders)?
67
- 3. **Specific & Actionable**: Are instructions tailored to each step's purpose, not generic?
68
- 4. **Output Examples**: Does each instruction file show what good output looks like?
69
- 5. **Quality Criteria**: Does each instruction file define quality criteria for its outputs?
70
- 6. **Sync Complete**: Has `deepwork sync` been run successfully?
71
- 7. **Commands Available**: Are the slash-commands generated in `.claude/commands/`?
72
- 8. **Summary Created**: Has `implementation_summary.md` been created?
73
- 9. **Policies Considered**: Have you thought about whether policies would benefit this job?
74
- - If relevant policies were identified, did you explain them and offer to run `/deepwork_policy.define`?
75
- - Not every job needs policies - only suggest when genuinely helpful.
76
-
77
- If ANY criterion is not met, continue working to address it.
78
- If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.
60
+ quality_criteria:
61
+ - "**Directory Structure**: Is `.deepwork/jobs/[job_name]/` created correctly?"
62
+ - "**Complete Instructions**: Are ALL step instruction files complete (not stubs or placeholders)?"
63
+ - "**Specific & Actionable**: Are instructions tailored to each step's purpose, not generic?"
64
+ - "**Output Examples**: Does each instruction file show what good output looks like?"
65
+ - "**Quality Criteria**: Does each instruction file define quality criteria for its outputs?"
66
+ - "**Ask Structured Questions**: Do step instructions that gather user input explicitly use the phrase \"ask structured questions\"?"
67
+ - "**Sync Complete**: Has `deepwork sync` been run successfully?"
68
+ - "**Commands Available**: Are the slash-commands generated in `.claude/commands/`?"
69
+ - "**Rules Considered**: Has the agent thought about whether rules would benefit this job? If relevant rules were identified, did they explain them and offer to run `/deepwork_rules.define`? Not every job needs rules - only suggest when genuinely helpful."
79
70
 
80
71
  - id: learn
81
72
  name: "Learn from Job Execution"
82
73
  description: "Reflect on conversation to improve job instructions and capture learnings"
83
74
  instructions_file: steps/learn.md
75
+ exposed: true
84
76
  inputs:
85
77
  - name: job_name
86
78
  description: "Name of the job that was run (optional - will auto-detect from conversation)"
87
79
  outputs:
88
- - learning_summary.md
80
+ - AGENTS.md
89
81
  dependencies: []
90
- hooks:
91
- after_agent:
92
- - prompt: |
93
- Verify the learning process meets ALL quality criteria before completing:
94
-
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?
105
-
106
- If ANY criterion is not met, continue working to address it.
107
- If ALL criteria are satisfied, include `<promise>✓ Quality Criteria Met</promise>` in your response.
82
+ quality_criteria:
83
+ - "**Conversation Analyzed**: Did the agent review the conversation for DeepWork job executions?"
84
+ - "**Confusion Identified**: Did the agent identify points of confusion, errors, or inefficiencies?"
85
+ - "**Instructions Improved**: Were job instructions updated to address identified issues?"
86
+ - "**Instructions Concise**: Are instructions free of redundancy and unnecessary verbosity?"
87
+ - "**Shared Content Extracted**: Is lengthy/duplicated content extracted into referenced files?"
88
+ - "**Bespoke Learnings Captured**: Were run-specific learnings added to AGENTS.md?"
89
+ - "**File References Used**: Do AGENTS.md entries reference other files where appropriate?"
90
+ - "**Working Folder Correct**: Is AGENTS.md in the correct working folder for the job?"
91
+ - "**Generalizable Separated**: Are generalizable improvements in instructions, not AGENTS.md?"
92
+ - "**Sync Complete**: Has `deepwork sync` been run if instructions were modified?"
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # make_new_job.sh - Create directory structure for a new DeepWork job
4
+ #
5
+ # Usage: ./make_new_job.sh <job_name>
6
+ #
7
+
8
+ set -euo pipefail
9
+
10
+ # Color output helpers
11
+ RED='\033[0;31m'
12
+ GREEN='\033[0;32m'
13
+ YELLOW='\033[1;33m'
14
+ NC='\033[0m' # No Color
15
+
16
+ info() {
17
+ echo -e "${GREEN}[INFO]${NC} $1"
18
+ }
19
+
20
+ warn() {
21
+ echo -e "${YELLOW}[WARN]${NC} $1"
22
+ }
23
+
24
+ error() {
25
+ echo -e "${RED}[ERROR]${NC} $1"
26
+ exit 1
27
+ }
28
+
29
+ # Validate job name format
30
+ validate_job_name() {
31
+ local name="$1"
32
+ if [[ ! "$name" =~ ^[a-z][a-z0-9_]*$ ]]; then
33
+ error "Invalid job name '$name'. Must be lowercase, start with a letter, and contain only letters, numbers, and underscores."
34
+ fi
35
+ }
36
+
37
+ # Main script
38
+ main() {
39
+ if [[ $# -lt 1 ]]; then
40
+ echo "Usage: $0 <job_name>"
41
+ echo ""
42
+ echo "Creates the directory structure for a new DeepWork job."
43
+ echo ""
44
+ echo "Arguments:"
45
+ echo " job_name Name of the job (lowercase, underscores allowed)"
46
+ echo ""
47
+ echo "Example:"
48
+ echo " $0 competitive_research"
49
+ exit 1
50
+ fi
51
+
52
+ local job_name="$1"
53
+ validate_job_name "$job_name"
54
+
55
+ # Determine the base path - look for .deepwork directory
56
+ local base_path
57
+ if [[ -d ".deepwork/jobs" ]]; then
58
+ base_path=".deepwork/jobs"
59
+ elif [[ -d "../.deepwork/jobs" ]]; then
60
+ base_path="../.deepwork/jobs"
61
+ else
62
+ # Create from current directory
63
+ base_path=".deepwork/jobs"
64
+ mkdir -p "$base_path"
65
+ fi
66
+
67
+ local job_path="${base_path}/${job_name}"
68
+
69
+ # Check if job already exists
70
+ if [[ -d "$job_path" ]]; then
71
+ error "Job '$job_name' already exists at $job_path"
72
+ fi
73
+
74
+ info "Creating job directory structure for '$job_name'..."
75
+
76
+ # Create main job directory and subdirectories
77
+ mkdir -p "$job_path"
78
+ mkdir -p "$job_path/steps"
79
+ mkdir -p "$job_path/hooks"
80
+ mkdir -p "$job_path/templates"
81
+
82
+ # Add .gitkeep files to empty directories
83
+ touch "$job_path/hooks/.gitkeep"
84
+ touch "$job_path/templates/.gitkeep"
85
+
86
+ # Create AGENTS.md file
87
+ cat > "$job_path/AGENTS.md" << 'EOF'
88
+ # Job Management
89
+
90
+ This folder and its subfolders are managed using the `deepwork_jobs` slash commands.
91
+
92
+ ## Recommended Commands
93
+
94
+ - `/deepwork_jobs.define` - Create or modify the job.yml specification
95
+ - `/deepwork_jobs.implement` - Generate step instruction files from the specification
96
+ - `/deepwork_jobs.learn` - Improve instructions based on execution learnings
97
+
98
+ ## Directory Structure
99
+
100
+ ```
101
+ .
102
+ ├── AGENTS.md # This file - project context and guidance
103
+ ├── job.yml # Job specification (created by /deepwork_jobs.define)
104
+ ├── steps/ # Step instruction files (created by /deepwork_jobs.implement)
105
+ │ └── *.md # One file per step
106
+ ├── hooks/ # Custom validation scripts and prompts
107
+ │ └── *.md|*.sh # Hook files referenced in job.yml
108
+ └── templates/ # Example file formats and templates
109
+ └── *.md|*.yml # Templates referenced in step instructions
110
+ ```
111
+
112
+ ## Editing Guidelines
113
+
114
+ 1. **Use slash commands** for structural changes (adding steps, modifying job.yml)
115
+ 2. **Direct edits** are fine for minor instruction tweaks
116
+ 3. **Run `/deepwork_jobs.learn`** after executing job steps to capture improvements
117
+ 4. **Run `deepwork sync`** after any changes to regenerate commands
118
+ EOF
119
+
120
+ info "Created directory structure:"
121
+ echo " $job_path/"
122
+ echo " ├── AGENTS.md"
123
+ echo " ├── steps/"
124
+ echo " ├── hooks/.gitkeep"
125
+ echo " └── templates/.gitkeep"
126
+
127
+ echo ""
128
+ info "Next steps:"
129
+ echo " 1. Run '/deepwork_jobs.define' to create the job.yml specification"
130
+ echo " 2. Run '/deepwork_jobs.implement' to generate step instructions"
131
+ echo " 3. Run 'deepwork sync' to create slash commands"
132
+ }
133
+
134
+ main "$@"
@@ -6,13 +6,15 @@ Create a `job.yml` specification file that defines the structure of a new DeepWo
6
6
 
7
7
  ## Task
8
8
 
9
- Guide the user through defining a job specification by asking clarifying questions. **Do not attempt to create the specification without first fully understanding the user's needs.**
9
+ Guide the user through defining a job specification by asking structured questions. **Do not attempt to create the specification without first fully understanding the user's needs.**
10
+
11
+ **Important**: Use the AskUserQuestion tool to ask structured questions when gathering information from the user. This provides a better user experience with clear options and guided choices.
10
12
 
11
13
  The output of this step is **only** the `job.yml` file - a complete specification of the workflow. The actual step instruction files will be created in the next step (`implement`).
12
14
 
13
15
  ### Step 1: Understand the Job Purpose
14
16
 
15
- Start by asking questions to understand what the user wants to accomplish:
17
+ Start by asking structured questions to understand what the user wants to accomplish:
16
18
 
17
19
  1. **What is the overall goal of this workflow?**
18
20
  - What complex task are they trying to accomplish?
@@ -31,7 +33,7 @@ Start by asking questions to understand what the user wants to accomplish:
31
33
 
32
34
  ### Step 2: Define Each Step
33
35
 
34
- For each major phase they mentioned, ask detailed questions:
36
+ For each major phase they mentioned, ask structured questions to gather details:
35
37
 
36
38
  1. **Step Purpose**
37
39
  - What exactly does this step accomplish?
@@ -92,7 +94,7 @@ After gathering information about all steps:
92
94
 
93
95
  For each step, consider whether it would benefit from **quality validation loops**. Stop hooks allow the AI agent to iteratively refine its work until quality criteria are met.
94
96
 
95
- **Ask the user about quality validation:**
97
+ **Ask structured questions about quality validation:**
96
98
  - "Are there specific quality criteria that must be met for this step?"
97
99
  - "Would you like the agent to validate its work before completing?"
98
100
  - "What would make you send the work back for revision?"
@@ -135,68 +137,31 @@ stop_hooks:
135
137
 
136
138
  **Encourage prompt-based hooks** - They leverage the AI's ability to understand context and make nuanced quality judgments. Script hooks are best for objective checks (syntax, format, tests).
137
139
 
138
- ### Step 5: Create the job.yml Specification
139
-
140
- Only after you have complete understanding, create the `job.yml` file:
140
+ ### Step 5: Create the Job Directory and Specification
141
141
 
142
- **File Location**: `.deepwork/jobs/[job_name]/job.yml`
142
+ Only after you have complete understanding, create the job directory and `job.yml` file:
143
143
 
144
- (Where `[job_name]` is the name of the NEW job you're creating, e.g., `.deepwork/jobs/competitive_research/job.yml`)
144
+ **First, create the directory structure** using the `make_new_job.sh` script:
145
145
 
146
- **Format**:
147
- ```yaml
148
- name: [job_name]
149
- version: "1.0.0"
150
- summary: "[Brief one-line summary of what this job accomplishes]"
151
- description: |
152
- [Detailed multi-line description of the job's purpose, process, and goals.
153
-
154
- This should explain:
155
- - What problem this workflow solves
156
- - What the overall process looks like
157
- - What the end result will be
158
- - Who the intended users are
159
- - Any important context about the workflow]
160
-
161
- changelog:
162
- - version: "1.0.0"
163
- changes: "Initial job creation"
164
-
165
- steps:
166
- - id: [step_id]
167
- name: "[Step Name]"
168
- description: "[What this step does]"
169
- instructions_file: steps/[step_id].md
170
- inputs:
171
- - name: [param_name]
172
- description: "[What user needs to provide]"
173
- # OR for file inputs from previous steps:
174
- # - file: [filename_or_path]
175
- # from_step: [previous_step_id]
176
- outputs:
177
- - [output_filename_or_path] # e.g., "report.md" or "reports/analysis.md"
178
- dependencies: [] # List of step IDs that must complete first
179
- # Optional: Quality validation hooks
180
- stop_hooks:
181
- - prompt: |
182
- Verify this step's output meets quality criteria:
183
- 1. [Criterion 1]
184
- 2. [Criterion 2]
185
- If ALL criteria are met, include `<promise>✓ Quality Criteria Met</promise>`.
186
-
187
- - id: [another_step]
188
- name: "[Another Step]"
189
- description: "[What this step does]"
190
- instructions_file: steps/[another_step].md
191
- inputs:
192
- - file: [output_filename_or_path]
193
- from_step: [step_id]
194
- outputs:
195
- - [another_output_path]
196
- dependencies:
197
- - [step_id] # This step requires the previous step
146
+ ```bash
147
+ .deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name]
198
148
  ```
199
149
 
150
+ This creates:
151
+ - `.deepwork/jobs/[job_name]/` - Main job directory
152
+ - `.deepwork/jobs/[job_name]/steps/` - For step instruction files
153
+ - `.deepwork/jobs/[job_name]/hooks/` - For custom validation scripts
154
+ - `.deepwork/jobs/[job_name]/templates/` - For example file formats
155
+ - `.deepwork/jobs/[job_name]/AGENTS.md` - Job management guidance
156
+
157
+ **Then create the job.yml file** at `.deepwork/jobs/[job_name]/job.yml`
158
+
159
+ (Where `[job_name]` is the name of the NEW job you're creating, e.g., `competitive_research`)
160
+
161
+ **Template reference**: See `.deepwork/jobs/deepwork_jobs/templates/job.yml.template` for the standard structure.
162
+
163
+ **Complete example**: See `.deepwork/jobs/deepwork_jobs/templates/job.yml.example` for a fully worked example.
164
+
200
165
  **Important**:
201
166
  - Use lowercase with underscores for job name and step IDs
202
167
  - Ensure file inputs reference steps in dependencies
@@ -318,11 +283,11 @@ Run `/deepwork_jobs.implement` to generate the instruction files for each step b
318
283
  ## Important Guidelines
319
284
 
320
285
  1. **Focus on specification only** - Don't create instruction files yet
321
- 2. **Ask clarifying questions** - Never skip the discovery phase
286
+ 2. **Ask structured questions** - Never skip the discovery phase; use the AskUserQuestion tool
322
287
  3. **Rich context in description** - This helps with future refinement
323
288
  4. **Validate understanding** - Summarize and confirm before creating
324
289
  5. **Use examples** - Help users understand what good specifications look like
325
- 6. **Understand file organization** - Always ask where outputs should be saved and if subdirectories are needed
290
+ 6. **Understand file organization** - Always ask structured questions about where outputs should be saved and if subdirectories are needed
326
291
 
327
292
  ## Validation Rules
328
293
 
@@ -356,6 +321,7 @@ After creating the file:
356
321
 
357
322
  ## Quality Criteria
358
323
 
324
+ - Asked structured questions to fully understand user requirements
359
325
  - User fully understands what job they're creating
360
326
  - All steps have clear inputs and outputs
361
327
  - Dependencies make logical sense