Skip to content

Commit 3979489

Browse files
committed
feat: add skills section to jobs.yml and enhance workflow documentation
- Add skills schema to job_schema.py with Claude Code SKILL.md format support - Update ClaudeAdapter.sync_skills() to install skills to .claude/skills/ - Update sync.py to collect and sync skills from all jobs - Add parser.py Skill dataclass for skills parsing Enhanced deepwork_jobs job.yml: - Comprehensive description explaining how DeepWork jobs work - Document the define → implement → use workflow - Add deepwork-jobs skill for casual job creation assistance Updated define step instructions: - New section on writing rich workflow context in descriptions - New section on considering skills for jobs - Updated validation rules and quality criteria for skills - Updated stop_hooks to validate skill content quality This enables users to casually ask "Make a new job that does X" and have Claude automatically guide them through the job creation workflow.
1 parent d144e01 commit 3979489

13 files changed

Lines changed: 1131 additions & 75 deletions

File tree

.claude/commands/deepwork_jobs.define.md

Lines changed: 210 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,18 @@ hooks:
1515
2. **Clear Inputs/Outputs**: Does every step have clearly defined inputs and outputs?
1616
3. **Logical Dependencies**: Do step dependencies make sense and avoid circular references?
1717
4. **Concise Summary**: Is the summary under 200 characters and descriptive?
18-
5. **Rich Description**: Does the description provide enough context for future refinement?
19-
6. **Valid Schema**: Does the job.yml follow the required schema (name, version, summary, steps)?
20-
7. **File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`?
18+
5. **Rich Description**: Does the description explain:
19+
- What the workflow accomplishes
20+
- How the steps connect (the workflow flow)
21+
- Any background context or prerequisites users need
22+
- How to use the job effectively
23+
6. **Skills Quality** (if skills are included):
24+
- Does each skill have a clear description explaining when Claude should use it?
25+
- Does the skill content provide comprehensive workflow guidance?
26+
- Does the content explain each step and when to use it?
27+
- Are there domain-specific tips or context included?
28+
7. **Valid Schema**: Does the job.yml follow the required schema (name, version, summary, steps)?
29+
8. **File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`?
2130
2231
If ANY criterion is not met, continue working to address it.
2332
If ALL criteria are satisfied, include `<promise>QUALITY_COMPLETE</promise>` in your response.
@@ -43,15 +52,49 @@ hooks:
4352

4453
## Job Overview
4554

46-
Core commands for managing DeepWork jobs. These commands help you define new multi-step
47-
workflows and refine existing ones.
55+
# DeepWork Jobs Overview
4856

49-
The `define` command guides you through an interactive process to create a new job by
50-
asking detailed questions about your workflow, understanding each step's inputs and outputs,
51-
and generating all necessary files.
57+
DeepWork jobs are multi-step AI workflows that break complex tasks into manageable,
58+
repeatable steps. Each job is defined in a `job.yml` file and consists of:
5259

53-
The `refine` command helps you modify existing jobs safely by understanding what you want
54-
to change, validating the impact, and ensuring consistency across your workflow.
60+
- **Steps**: Individual tasks with clear inputs, outputs, and instructions
61+
- **Dependencies**: Ordering constraints between steps
62+
- **Hooks**: Quality validation loops that ensure outputs meet standards
63+
- **Skills**: Reusable AI capabilities that jobs can install
64+
65+
## How Jobs Work
66+
67+
Jobs follow a **define → implement → use** workflow:
68+
69+
1. **Define** (`/deepwork_jobs.define`): Interactive Q&A to understand your workflow
70+
and create a `job.yml` specification. This captures what each step does, what
71+
inputs it needs, and what outputs it produces.
72+
73+
2. **Implement** (`/deepwork_jobs.implement`): Generates detailed instruction files
74+
for each step based on the spec. Creates the directory structure and syncs
75+
commands to make them available as slash commands.
76+
77+
3. **Use**: Each step becomes a slash command like `/job_name.step_id`. Run steps
78+
in order (respecting dependencies) to complete the workflow.
79+
80+
## Refining Jobs
81+
82+
The `refine` command (`/deepwork_jobs.refine`) helps modify existing jobs safely
83+
by understanding what you want to change, validating the impact, and ensuring
84+
consistency across your workflow.
85+
86+
## Job Structure
87+
88+
Jobs live in `.deepwork/jobs/[job_name]/` with:
89+
- `job.yml` - The job specification
90+
- `steps/` - Instruction files for each step
91+
- `hooks/` - Optional hook scripts and prompts
92+
93+
## Creating Jobs Casually
94+
95+
You can ask Claude to create jobs naturally, like "Make a new job that does X"
96+
or "I need a workflow for Y". Claude will invoke the appropriate commands
97+
automatically.
5598

5699

57100

@@ -141,7 +184,115 @@ After gathering information about all steps:
141184
- Job description (detailed multi-line explanation)
142185
- Version number (start with 1.0.0)
143186

144-
### Step 4: Define Quality Validation (Stop Hooks)
187+
### Step 4: Define Workflow Context in Description
188+
189+
The job's `description` field is crucial for helping users (and AI agents) understand how the job works. A good description should include:
190+
191+
**1. Overview of what the job accomplishes**
192+
- What problem does this workflow solve?
193+
- What's the end result?
194+
195+
**2. How the workflow operates**
196+
- Explain the step-by-step flow: "First... then... finally..."
197+
- Show how outputs from one step feed into the next
198+
- Clarify any branching or optional paths
199+
200+
**3. Background context users need**
201+
- Domain-specific knowledge required
202+
- Prerequisites or setup needed
203+
- Who the intended users are
204+
205+
**4. How to use the job**
206+
- The general usage pattern
207+
- Any tips for getting good results
208+
209+
**Example of a good description:**
210+
211+
```yaml
212+
description: |
213+
# Competitive Research Workflow
214+
215+
This job helps product teams analyze their competitive landscape through
216+
a systematic four-step process.
217+
218+
## How It Works
219+
220+
1. **Identify Competitors** - You provide a market segment and product category.
221+
The job identifies 5-7 key competitors with brief descriptions.
222+
223+
2. **Research Each Competitor** - Deep-dive research on each competitor,
224+
gathering data on features, pricing, positioning, and strategy.
225+
226+
3. **Create Comparison Matrix** - Synthesizes research into a side-by-side
227+
comparison highlighting key differentiators.
228+
229+
4. **Generate Positioning Recommendations** - Based on the analysis, produces
230+
strategic recommendations for how to position against each competitor.
231+
232+
## Prerequisites
233+
234+
- Clear understanding of your own product's value proposition
235+
- Defined target market segment
236+
237+
## Usage Tips
238+
239+
- Run this quarterly to stay current on competitive dynamics
240+
- Steps can be re-run individually if competitors change
241+
```
242+
243+
### Step 5: Consider Skills for the Job
244+
245+
**Skills** are reusable AI capabilities that jobs can install. When defining a job, consider whether skills would enhance the user experience.
246+
247+
**When to suggest skills:**
248+
249+
1. **Workflow guidance** - A skill that explains how the job works and guides users through the process
250+
- Example: A skill that knows when to invoke each step and in what order
251+
- Triggered when users ask about the job or want to start it casually
252+
253+
2. **Domain expertise** - A skill that provides domain-specific knowledge relevant to the job
254+
- Example: A "legal-writing" skill for a contract review job
255+
- Helps Claude give better responses within that domain
256+
257+
3. **Automation helpers** - A skill that automates common patterns
258+
- Example: A skill that knows how to format outputs in a specific way
259+
- Reduces repetitive instructions in individual steps
260+
261+
**Ask the user:**
262+
- "Would you like Claude to understand how to guide users through this workflow casually?"
263+
- "Are there domain-specific capabilities that would help with this job?"
264+
265+
**Skill structure in job.yml:**
266+
267+
```yaml
268+
skills:
269+
- name: my-job-guide
270+
description: |
271+
Use this skill when users ask about [job purpose] or want to
272+
[do the thing the job does]. Triggered by phrases like "..."
273+
user_invocable: false # Model invokes it, not shown in menu
274+
content: |
275+
# Workflow Guide
276+
277+
When users want to [do thing], guide them through:
278+
279+
1. First run `/job_name.step1` - This will...
280+
2. Then run `/job_name.step2` - This will...
281+
282+
## When to Use Each Step
283+
[Explain when each step applies]
284+
285+
## Tips
286+
[Domain-specific guidance]
287+
```
288+
289+
**Best practices for skill content:**
290+
- Explain the workflow clearly with step-by-step guidance
291+
- Include example user phrases that should trigger the skill
292+
- Provide domain context that helps Claude give better responses
293+
- Reference the slash commands users should run
294+
295+
### Step 6: Define Quality Validation (Stop Hooks)
145296
146297
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.
147298
@@ -188,7 +339,7 @@ stop_hooks:
188339

189340
**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).
190341

191-
### Step 5: Create the job.yml Specification
342+
### Step 7: Create the job.yml Specification
192343

193344
Only after you have complete understanding, create the `job.yml` file:
194345

@@ -215,6 +366,25 @@ changelog:
215366
- version: "1.0.0"
216367
changes: "Initial job creation"
217368
369+
# Optional: Skills for workflow guidance or domain expertise
370+
skills:
371+
- name: [job_name]-guide
372+
description: |
373+
Use this skill when users ask about [job purpose] or want to start
374+
the workflow casually. Triggered by phrases like "[example phrases]"
375+
user_invocable: false
376+
content: |
377+
# [Job Name] Workflow Guide
378+
379+
[Explain the workflow and when to use each step]
380+
381+
## Steps
382+
1. Run `/[job_name].[step1_id]` - [what it does]
383+
2. Run `/[job_name].[step2_id]` - [what it does]
384+
385+
## Tips
386+
[Domain-specific guidance]
387+
218388
steps:
219389
- id: [step_id]
220390
name: "[Step Name]"
@@ -256,8 +426,10 @@ steps:
256426
- No circular dependencies
257427
- At least one output per step
258428
- The `summary` should be concise (max 200 chars)
259-
- The `description` should provide rich context for future refinement
429+
- The `description` should provide rich context including workflow explanation and usage guidance
260430
- Include a `changelog` section with an initial entry for version 1.0.0
431+
- Consider adding a `skills` section for workflow guidance or domain expertise
432+
- Skill names use lowercase with hyphens (not underscores)
261433

262434
## Example Dialog
263435

@@ -383,14 +555,18 @@ Before creating the job.yml, ensure:
383555
- Job name: lowercase, underscores, no spaces
384556
- Version: semantic versioning (1.0.0)
385557
- Summary: concise, under 200 characters
386-
- Description: detailed, provides context
558+
- Description: detailed, provides workflow context, explains how to use the job
387559
- Step IDs: unique, descriptive, lowercase with underscores
388560
- Dependencies: must reference existing step IDs
389561
- File inputs: `from_step` must be in dependencies
390562
- At least one output per step
391563
- Outputs can be filenames (e.g., `report.md`) or paths (e.g., `reports/analysis.md`)
392564
- File paths in outputs should match where files will actually be created
393565
- No circular dependencies
566+
- Skills (if included):
567+
- Name: lowercase with hyphens, max 64 chars
568+
- Description: explains when Claude should use this skill
569+
- Content: provides workflow guidance or domain knowledge
394570
395571
## Output Format
396572
@@ -413,7 +589,14 @@ After creating the file:
413589
- All steps have clear inputs and outputs
414590
- Dependencies make logical sense
415591
- Summary is concise and descriptive
416-
- Description provides rich context for future refinement
592+
- Description provides rich context including:
593+
- Workflow explanation (how steps connect)
594+
- Background context users need
595+
- Usage guidance
596+
- Skills (if included) have:
597+
- Clear description of when Claude should invoke them
598+
- Comprehensive content with workflow steps and guidance
599+
- Domain-specific tips where relevant
417600
- Specification is valid YAML and follows the schema
418601
- Ready for implementation step
419602
@@ -459,9 +642,18 @@ Verify the job.yml output meets ALL quality criteria before completing:
459642
2. **Clear Inputs/Outputs**: Does every step have clearly defined inputs and outputs?
460643
3. **Logical Dependencies**: Do step dependencies make sense and avoid circular references?
461644
4. **Concise Summary**: Is the summary under 200 characters and descriptive?
462-
5. **Rich Description**: Does the description provide enough context for future refinement?
463-
6. **Valid Schema**: Does the job.yml follow the required schema (name, version, summary, steps)?
464-
7. **File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`?
645+
5. **Rich Description**: Does the description explain:
646+
- What the workflow accomplishes
647+
- How the steps connect (the workflow flow)
648+
- Any background context or prerequisites users need
649+
- How to use the job effectively
650+
6. **Skills Quality** (if skills are included):
651+
- Does each skill have a clear description explaining when Claude should use it?
652+
- Does the skill content provide comprehensive workflow guidance?
653+
- Does the content explain each step and when to use it?
654+
- Are there domain-specific tips or context included?
655+
7. **Valid Schema**: Does the job.yml follow the required schema (name, version, summary, steps)?
656+
8. **File Created**: Has the job.yml file been created in `.deepwork/jobs/[job_name]/job.yml`?
465657

466658
If ANY criterion is not met, continue working to address it.
467659
If ALL criteria are satisfied, include `<promise>QUALITY_COMPLETE</promise>` in your response.

.claude/commands/deepwork_jobs.implement.md

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,49 @@ hooks:
4747

4848
## Job Overview
4949

50-
Core commands for managing DeepWork jobs. These commands help you define new multi-step
51-
workflows and refine existing ones.
50+
# DeepWork Jobs Overview
5251

53-
The `define` command guides you through an interactive process to create a new job by
54-
asking detailed questions about your workflow, understanding each step's inputs and outputs,
55-
and generating all necessary files.
52+
DeepWork jobs are multi-step AI workflows that break complex tasks into manageable,
53+
repeatable steps. Each job is defined in a `job.yml` file and consists of:
5654

57-
The `refine` command helps you modify existing jobs safely by understanding what you want
58-
to change, validating the impact, and ensuring consistency across your workflow.
55+
- **Steps**: Individual tasks with clear inputs, outputs, and instructions
56+
- **Dependencies**: Ordering constraints between steps
57+
- **Hooks**: Quality validation loops that ensure outputs meet standards
58+
- **Skills**: Reusable AI capabilities that jobs can install
59+
60+
## How Jobs Work
61+
62+
Jobs follow a **define → implement → use** workflow:
63+
64+
1. **Define** (`/deepwork_jobs.define`): Interactive Q&A to understand your workflow
65+
and create a `job.yml` specification. This captures what each step does, what
66+
inputs it needs, and what outputs it produces.
67+
68+
2. **Implement** (`/deepwork_jobs.implement`): Generates detailed instruction files
69+
for each step based on the spec. Creates the directory structure and syncs
70+
commands to make them available as slash commands.
71+
72+
3. **Use**: Each step becomes a slash command like `/job_name.step_id`. Run steps
73+
in order (respecting dependencies) to complete the workflow.
74+
75+
## Refining Jobs
76+
77+
The `refine` command (`/deepwork_jobs.refine`) helps modify existing jobs safely
78+
by understanding what you want to change, validating the impact, and ensuring
79+
consistency across your workflow.
80+
81+
## Job Structure
82+
83+
Jobs live in `.deepwork/jobs/[job_name]/` with:
84+
- `job.yml` - The job specification
85+
- `steps/` - Instruction files for each step
86+
- `hooks/` - Optional hook scripts and prompts
87+
88+
## Creating Jobs Casually
89+
90+
You can ask Claude to create jobs naturally, like "Make a new job that does X"
91+
or "I need a workflow for Y". Claude will invoke the appropriate commands
92+
automatically.
5993

6094

6195
## Prerequisites

0 commit comments

Comments
 (0)