Skip to content

Commit 0f33388

Browse files
committed
deepwork_job reworked with the expert
1 parent 4ff7c6c commit 0f33388

18 files changed

Lines changed: 600 additions & 1677 deletions

File tree

.claude/skills/deepwork_jobs.define/SKILL.md

Lines changed: 33 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -24,117 +24,54 @@ agent: deepwork-jobs
2424

2525
## Objective
2626

27-
Create a `job.yml` specification file by thoroughly understanding the user's workflow requirements through structured questions.
27+
Create a `job.yml` specification file that defines the structure of a new DeepWork job by understanding the user's workflow requirements through interactive questions.
2828

2929
## Task
3030

31-
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.**
31+
Guide the user through defining a job specification by asking structured questions. The output is **only** the `job.yml` file - step instruction files are created in the `implement` step.
3232

33-
The output of this step is **only** the `job.yml` file. Step instruction files are created in the `implement` step.
33+
### Process
3434

35-
### Step 1: Understand the Job Purpose
35+
1. **Understand the job purpose**
36+
- Ask structured questions about the overall goal, domain, and frequency
37+
- Understand what success looks like and who the audience is
38+
- Identify the major phases of the workflow
3639

37-
Ask structured questions to understand what the user wants to accomplish:
40+
2. **Detect document-oriented workflows**
41+
- Look for patterns: "report", "summary", "monthly", "for stakeholders"
42+
- If detected, offer to create a doc spec for consistent quality
43+
- Use `.deepwork/doc_specs/job_spec.md` as a reference example
3844

39-
1. **What is the overall goal of this workflow?**
40-
- What complex task are they trying to accomplish?
41-
- What domain is this in? (e.g., research, marketing, development, reporting)
45+
3. **Define each step**
46+
- For each phase, gather: purpose, inputs, outputs, dependencies
47+
- Ask about output file paths and organization
48+
- Consider whether steps need agent delegation
4249

43-
2. **What does success look like?**
44-
- What's the final deliverable or outcome?
45-
- Who is the audience for the output?
50+
4. **Validate the workflow**
51+
- Summarize the complete workflow
52+
- Check for gaps in inputs/outputs between steps
53+
- Confirm job name, summary, and version
4654

47-
3. **What are the major phases?**
48-
- What are the distinct stages from start to finish?
49-
- Are there any dependencies between phases?
55+
5. **Create the job specification**
56+
- Run `make_new_job.sh` to create directory structure:
57+
```bash
58+
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name]
59+
```
60+
- Create `job.yml` at `.deepwork/jobs/[job_name]/job.yml`
5061

51-
### Step 2: Detect Document-Oriented Workflows
62+
### Key Guidelines
5263

53-
Check for document-focused patterns in the user's description:
54-
- Keywords: "report", "summary", "document", "monthly", "quarterly"
55-
- Final deliverable is a specific document type
56-
- Recurring documents with consistent structure
57-
58-
**If detected**, inform the user and ask if they want to:
59-
- Create a doc spec for consistent document quality
60-
- Use an existing doc spec from `.deepwork/doc_specs/`
61-
- Skip doc spec and proceed with simple outputs
62-
63-
See the expert's documentation on doc specs for the full schema and examples.
64-
65-
### Step 3: Define Each Step
66-
67-
For each major phase, gather:
68-
69-
1. **Step Purpose**: What does this step accomplish?
70-
2. **Inputs**: User parameters or files from previous steps
71-
3. **Outputs**: Files or artifacts produced (see Work Product Guidelines below)
72-
4. **Dependencies**: Which previous steps must complete first?
73-
5. **Quality Criteria**: What makes a good vs. bad output?
74-
6. **Agent Delegation**: Should this step run in a forked context?
75-
76-
#### Work Product Storage Guidelines
77-
78-
Job outputs belong in the main repository directory structure, not in dot-directories.
79-
80-
**Good patterns**:
81-
```
82-
competitive_research/competitors_list.md
83-
operations/reports/2026-01/spending_analysis.md
84-
```
85-
86-
**Avoid**:
87-
```
88-
.deepwork/outputs/report.md # Hidden in dot-directory
89-
output.md # Too generic
90-
```
91-
92-
**Date in paths**: Include for periodic outputs (monthly reports), omit for living documents.
93-
94-
**Supporting materials**: Place in `_dataroom` folder as peer to final output:
95-
```
96-
operations/reports/2026-01/spending_analysis.md
97-
operations/reports/2026-01/spending_analysis_dataroom/
98-
raw_data.csv
99-
notes.md
100-
```
101-
102-
### Step 4: Validate the Workflow
103-
104-
After gathering all information:
105-
106-
1. **Review the flow** - Summarize and show how outputs feed into the next step
107-
2. **Check for gaps** - Missing inputs, unused outputs, circular dependencies
108-
3. **Confirm details** - Job name, summary (max 200 chars), description, version
109-
110-
### Step 5: Create the Job Specification
111-
112-
**First, create the directory structure**:
113-
```bash
114-
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name]
115-
```
116-
117-
**Then create `job.yml`** at `.deepwork/jobs/[job_name]/job.yml`
118-
119-
Refer to the expert for the complete job.yml schema. Key validation rules:
120-
- Job name: lowercase, underscores only, no spaces
121-
- Version: semantic versioning (start with 1.0.0)
122-
- Summary: max 200 characters
123-
- File inputs: `from_step` must be in dependencies
124-
- At least one output per step
125-
126-
**Templates**:
127-
- `.deepwork/jobs/deepwork_jobs/templates/job.yml.template` - Structure
128-
- `.deepwork/jobs/deepwork_jobs/templates/job.yml.example` - Complete example
64+
- **Ask structured questions** using the AskUserQuestion tool
65+
- **Work products go in main repo**, not `.deepwork/` (for discoverability)
66+
- **Use dates in paths** for periodic outputs that accumulate
67+
- **Use `_dataroom` folders** for supporting materials
68+
- Reference templates in `.deepwork/jobs/deepwork_jobs/templates/`
12969

13070
## Output
13171

132-
The validated `job.yml` file at `.deepwork/jobs/[job_name]/job.yml`.
72+
Create `.deepwork/jobs/[job_name]/job.yml` following the doc spec at `.deepwork/doc_specs/job_spec.md`.
13373

134-
After creating the file:
135-
1. Inform the user that the specification is complete
136-
2. Recommend they review the job.yml file
137-
3. Tell them to run `/deepwork_jobs.review_job_spec` next
74+
After creating the file, tell the user to run `/deepwork_jobs.review_job_spec` next.
13875

13976

14077
### Job Context

.claude/skills/deepwork_jobs.implement/SKILL.md

Lines changed: 37 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -28,108 +28,65 @@ Before proceeding, confirm these steps are complete:
2828

2929
## Objective
3030

31-
Generate the DeepWork job directory structure and instruction files for each step based on the validated `job.yml` specification.
31+
Generate the step instruction files for each step based on the validated `job.yml` specification, then sync to create the slash commands.
3232

3333
## Task
3434

35-
Read the `job.yml` specification and create all necessary files to make the job functional.
35+
Read the job.yml and create comprehensive instruction files for each step.
3636

37-
### Step 1: Create Directory Structure
37+
### Process
3838

39-
Run the setup script:
40-
```bash
41-
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name]
42-
```
39+
1. **Create directory structure** (if needed)
40+
```bash
41+
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name]
42+
```
4343

44-
This creates:
45-
- `.deepwork/jobs/[job_name]/steps/` - Step instruction files
46-
- `.deepwork/jobs/[job_name]/hooks/` - Validation scripts
47-
- `.deepwork/jobs/[job_name]/templates/` - Example file formats
48-
- `.deepwork/jobs/[job_name]/AGENTS.md` - Job management guidance
44+
2. **Read and validate the specification**
45+
- Read `.deepwork/jobs/[job_name]/job.yml`
46+
- Extract job name, description, and step details
47+
- Understand the workflow structure
4948

50-
**Note**: If directory already exists from define step, create missing subdirectories manually.
49+
3. **Generate step instruction files**
50+
- Create `.deepwork/jobs/[job_name]/steps/[step_id].md` for each step
51+
- Use templates in `.deepwork/jobs/deepwork_jobs/templates/` as reference
52+
- Each file must include: Objective, Task, Process, Output Format, Quality Criteria
5153

52-
### Step 2: Read and Validate the Specification
54+
4. **Sync skills**
55+
```bash
56+
deepwork sync
57+
```
5358

54-
1. Read `.deepwork/jobs/[job_name]/job.yml`
55-
2. Validate structure (name, version, summary, description, steps)
56-
3. Check dependencies are valid and non-circular
57-
4. Extract step details for instruction generation
59+
5. **Consider rules for the new job**
60+
- Think about whether rules would help maintain quality
61+
- If relevant, explain and offer to run `/deepwork_rules.define`
5862

59-
### Step 3: Generate Step Instruction Files
63+
### Instruction File Guidelines
6064

61-
Create `.deepwork/jobs/[job_name]/steps/[step_id].md` for each step.
65+
- **Be specific** - tailor to each step's purpose, not generic advice
66+
- **Provide examples** - show what good output looks like
67+
- **Include quality criteria** - how to verify the step is complete
68+
- **Use "ask structured questions"** - for steps that gather user input
69+
- **Align with hooks** - if step has hooks, match the validation criteria
6270

63-
**Templates**:
64-
- `.deepwork/jobs/deepwork_jobs/templates/step_instruction.md.template` - Structure
65-
- `.deepwork/jobs/deepwork_jobs/templates/step_instruction.md.example` - Complete example
71+
### Templates Available
6672

67-
**Guidelines**:
68-
69-
1. **Use the job description** - It provides crucial context
70-
2. **Be specific** - Tailor instructions to each step's purpose
71-
3. **Provide examples** - Show what good output looks like
72-
4. **Explain the "why"** - Help understand the step's role in the workflow
73-
5. **Ask structured questions** - When a step has user inputs, MUST use this phrase
74-
6. **Align with hooks** - If step has `hooks` defined, match quality criteria
75-
76-
**Handling Hooks**:
77-
78-
If a step has hooks defined, the instruction file should:
79-
- Mirror the quality criteria that hooks will validate
80-
- Be explicit about what success looks like
81-
- Mention the `<promise>Quality Criteria Met</promise>` pattern when criteria are met
82-
83-
### Step 4: Verify job.yml Location
84-
85-
Confirm `job.yml` exists at `.deepwork/jobs/[job_name]/job.yml`.
86-
87-
### Step 5: Sync Skills
88-
89-
Run:
90-
```bash
91-
deepwork sync
92-
```
93-
94-
This generates skills for each step in `.claude/skills/` (or platform-specific directory).
95-
96-
### Step 6: Consider Rules
97-
98-
After implementing, consider whether **rules** would help enforce quality.
99-
100-
**What are rules?**
101-
Automated guardrails in `.deepwork/rules/` that trigger when files change.
102-
103-
**When to suggest rules**:
104-
- Job produces outputs that other files depend on
105-
- Documentation should stay in sync with outputs
106-
- Quality checks should happen when certain files change
107-
108-
**Examples**:
109-
| Job Type | Potential Rule |
110-
|----------|----------------|
111-
| API Design | Update docs when endpoints change |
112-
| Database Schema | Review migrations when schema changes |
113-
| Competitive Research | Update strategy when analysis changes |
114-
115-
If a rule would help, explain what it would do and offer to run `/deepwork_rules.define`.
73+
- `job.yml.template` - Job specification structure
74+
- `step_instruction.md.template` - Step instruction file structure
75+
- `agents.md.template` - AGENTS.md file structure
76+
- Examples: `job.yml.example`, `step_instruction.md.example`
11677

11778
## Completion Checklist
11879

119-
Before marking complete:
120-
- [ ] job.yml validated and in place
121-
- [ ] All step instruction files created (complete, not stubs)
80+
- [ ] All step instruction files created (not stubs)
12281
- [ ] Instructions are specific and actionable
12382
- [ ] Output examples provided
124-
- [ ] Quality criteria defined for each step
125-
- [ ] User input steps use "ask structured questions"
83+
- [ ] Quality criteria defined
12684
- [ ] `deepwork sync` executed successfully
127-
- [ ] Skills available in platform directory
128-
- [ ] Considered relevant rules for job domain
85+
- [ ] Rules considered (suggest if genuinely helpful)
12986

13087
## Output
13188

132-
Complete step instruction files at `.deepwork/jobs/[job_name]/steps/` and synced skills.
89+
Complete instruction files in `.deepwork/jobs/[job_name]/steps/` and synced skills in `.claude/skills/`.
13390

13491

13592
### Job Context
@@ -171,29 +128,6 @@ Use branch format: `deepwork/deepwork_jobs-[instance]-YYYYMMDD`
171128
- Do NOT proceed without required inputs; ask the user if any are missing
172129
- Do NOT modify files outside the scope of this step's defined outputs
173130

174-
## Quality Validation
175-
176-
**Before completing this step, you MUST have your work reviewed against the quality criteria below.**
177-
178-
Use a sub-agent (Haiku model) to review your work against these criteria:
179-
180-
**Criteria (all must be satisfied)**:
181-
1. **Directory Structure**: Is `.deepwork/jobs/[job_name]/` created correctly?
182-
2. **Complete Instructions**: Are ALL step instruction files complete (not stubs or placeholders)?
183-
3. **Specific & Actionable**: Are instructions tailored to each step's purpose, not generic?
184-
4. **Output Examples**: Does each instruction file show what good output looks like?
185-
5. **Quality Criteria**: Does each instruction file define quality criteria for its outputs?
186-
6. **Ask Structured Questions**: Do step instructions that gather user input explicitly use the phrase "ask structured questions"?
187-
7. **Sync Complete**: Has `deepwork sync` been run successfully?
188-
8. **Commands Available**: Are the slash-commands generated in `.claude/commands/`?
189-
9. **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.
190-
**Review Process**:
191-
1. Once you believe your work is complete, spawn a sub-agent using Haiku to review your work against the quality criteria above
192-
2. The sub-agent should examine your outputs and verify each criterion is met
193-
3. If the sub-agent identifies valid issues, fix them
194-
4. Have the sub-agent review again until all valid feedback has been addressed
195-
5. Only mark the step complete when the sub-agent confirms all criteria are satisfied
196-
197131
## On Completion
198132

199133
1. Verify outputs are created

0 commit comments

Comments
 (0)