Skip to content

Commit 5fb9695

Browse files
Copilotncrmro
andcommitted
Fix test for updated make_new_job.sh usage message
- Updated test to expect "Examples:" (plural) instead of "Example:" - All 678 tests now passing Co-authored-by: ncrmro <8276365+ncrmro@users.noreply.github.com>
1 parent 91aaf88 commit 5fb9695

5 files changed

Lines changed: 158 additions & 62 deletions

File tree

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

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,52 @@ Generate the DeepWork job directory structure and instruction files for each ste
3232

3333
Read the `job.yml` specification file and create all the necessary files to make the job functional, including directory structure and step instruction files. Then sync the commands to make them available.
3434

35-
### Step 1: Create Directory Structure Using Script
35+
### Step 1: Determine Installation Scope
3636

37-
Run the `make_new_job.sh` script to create the standard directory structure:
37+
**Ask the user where they want to install this job using structured questions:**
3838

39+
Present two options:
40+
1. **Local** - Install in this project only (`.deepwork/jobs/`)
41+
2. **Global** - Install for all projects in your user config (`~/.config/deepwork/jobs/`)
42+
43+
**Guidance for users:**
44+
- Choose **local** if the job is specific to this project or you want to version control it
45+
- Choose **global** if the job is reusable across multiple projects (e.g., a general "code review" or "documentation" workflow)
46+
47+
### Step 2: Create Directory Structure Using Script
48+
49+
Run the `make_new_job.sh` script to create the standard directory structure with the chosen scope:
50+
51+
**For local installation:**
3952
```bash
40-
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name]
53+
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name] --scope local
4154
```
4255

43-
This creates:
44-
- `.deepwork/jobs/[job_name]/` - Main job directory
45-
- `.deepwork/jobs/[job_name]/steps/` - Step instruction files
46-
- `.deepwork/jobs/[job_name]/hooks/` - Custom validation scripts (with .gitkeep)
47-
- `.deepwork/jobs/[job_name]/templates/` - Example file formats (with .gitkeep)
48-
- `.deepwork/jobs/[job_name]/AGENTS.md` - Job management guidance
49-
50-
**Note**: If the directory already exists (e.g., job.yml was created by define step), you can skip this step or manually create the additional directories:
56+
**For global installation:**
5157
```bash
52-
mkdir -p .deepwork/jobs/[job_name]/hooks .deepwork/jobs/[job_name]/templates
53-
touch .deepwork/jobs/[job_name]/hooks/.gitkeep .deepwork/jobs/[job_name]/templates/.gitkeep
58+
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name] --scope global
5459
```
5560

56-
### Step 2: Read and Validate the Specification
61+
This creates:
62+
- `[scope_path]/[job_name]/` - Main job directory
63+
- `[scope_path]/[job_name]/steps/` - Step instruction files
64+
- `[scope_path]/[job_name]/hooks/` - Custom validation scripts (with .gitkeep)
65+
- `[scope_path]/[job_name]/templates/` - Example file formats (with .gitkeep)
66+
- `[scope_path]/[job_name]/AGENTS.md` - Job management guidance
67+
68+
Where `[scope_path]` is:
69+
- `.deepwork/jobs` for local scope
70+
- `~/.config/deepwork/jobs` (or `$XDG_CONFIG_HOME/deepwork/jobs`) for global scope
71+
72+
**Note**: If the directory already exists (e.g., job.yml was created by define step), you can skip this step or manually create the additional directories in the appropriate scope location.
73+
74+
### Step 3: Read and Validate the Specification
5775

5876
1. **Locate the job.yml file**
59-
- Read `.deepwork/jobs/[job_name]/job.yml` from the review_job_spec step
77+
- Read the job.yml from the review_job_spec step
78+
- The file location depends on the chosen scope:
79+
- Local: `.deepwork/jobs/[job_name]/job.yml`
80+
- Global: `~/.config/deepwork/jobs/[job_name]/job.yml` (or `$XDG_CONFIG_HOME/deepwork/jobs/[job_name]/job.yml`)
6081
- Parse the YAML content
6182

6283
2. **Validate the specification**
@@ -70,9 +91,11 @@ touch .deepwork/jobs/[job_name]/hooks/.gitkeep .deepwork/jobs/[job_name]/templat
7091
- List of all steps with their details
7192
- Understand the workflow structure
7293

73-
### Step 3: Generate Step Instruction Files
94+
### Step 4: Generate Step Instruction Files
7495

75-
For each step in the job.yml, create a comprehensive instruction file at `.deepwork/jobs/[job_name]/steps/[step_id].md`.
96+
For each step in the job.yml, create a comprehensive instruction file at the appropriate scope location:
97+
- Local: `.deepwork/jobs/[job_name]/steps/[step_id].md`
98+
- Global: `~/.config/deepwork/jobs/[job_name]/steps/[step_id].md`
7699

77100
**Template reference**: See `.deepwork/jobs/deepwork_jobs/templates/step_instruction.md.template` for the standard structure.
78101

.deepwork/jobs/deepwork_jobs/make_new_job.sh

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,58 @@ validate_job_name() {
3737
# Main script
3838
main() {
3939
if [[ $# -lt 1 ]]; then
40-
echo "Usage: $0 <job_name>"
40+
echo "Usage: $0 <job_name> [--scope local|global]"
4141
echo ""
4242
echo "Creates the directory structure for a new DeepWork job."
4343
echo ""
4444
echo "Arguments:"
4545
echo " job_name Name of the job (lowercase, underscores allowed)"
46+
echo " --scope Installation scope: 'local' (project) or 'global' (XDG config)"
47+
echo " Default: local"
4648
echo ""
47-
echo "Example:"
49+
echo "Examples:"
4850
echo " $0 competitive_research"
51+
echo " $0 competitive_research --scope global"
4952
exit 1
5053
fi
5154

5255
local job_name="$1"
56+
local scope="local"
57+
58+
# Parse optional --scope argument
59+
if [[ $# -ge 2 ]] && [[ "$2" == "--scope" ]]; then
60+
if [[ $# -ge 3 ]]; then
61+
scope="$3"
62+
if [[ "$scope" != "local" && "$scope" != "global" ]]; then
63+
error "Invalid scope '$scope'. Must be 'local' or 'global'."
64+
fi
65+
else
66+
error "--scope requires a value (local or global)"
67+
fi
68+
fi
69+
5370
validate_job_name "$job_name"
5471

55-
# Determine the base path - look for .deepwork directory
72+
# Determine the base path based on scope
5673
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"
74+
if [[ "$scope" == "global" ]]; then
75+
# Use XDG config directory for global jobs
76+
local xdg_config="${XDG_CONFIG_HOME:-$HOME/.config}"
77+
base_path="${xdg_config}/deepwork/jobs"
6478
mkdir -p "$base_path"
79+
info "Creating global job in $base_path"
80+
else
81+
# Local scope - look for .deepwork directory
82+
if [[ -d ".deepwork/jobs" ]]; then
83+
base_path=".deepwork/jobs"
84+
elif [[ -d "../.deepwork/jobs" ]]; then
85+
base_path="../.deepwork/jobs"
86+
else
87+
# Create from current directory
88+
base_path=".deepwork/jobs"
89+
mkdir -p "$base_path"
90+
fi
91+
info "Creating local job in $base_path"
6592
fi
6693

6794
local job_path="${base_path}/${job_name}"

.deepwork/jobs/deepwork_jobs/steps/implement.md

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,52 @@ Generate the DeepWork job directory structure and instruction files for each ste
88

99
Read the `job.yml` specification file and create all the necessary files to make the job functional, including directory structure and step instruction files. Then sync the commands to make them available.
1010

11-
### Step 1: Create Directory Structure Using Script
11+
### Step 1: Determine Installation Scope
1212

13-
Run the `make_new_job.sh` script to create the standard directory structure:
13+
**Ask the user where they want to install this job using structured questions:**
1414

15+
Present two options:
16+
1. **Local** - Install in this project only (`.deepwork/jobs/`)
17+
2. **Global** - Install for all projects in your user config (`~/.config/deepwork/jobs/`)
18+
19+
**Guidance for users:**
20+
- Choose **local** if the job is specific to this project or you want to version control it
21+
- Choose **global** if the job is reusable across multiple projects (e.g., a general "code review" or "documentation" workflow)
22+
23+
### Step 2: Create Directory Structure Using Script
24+
25+
Run the `make_new_job.sh` script to create the standard directory structure with the chosen scope:
26+
27+
**For local installation:**
1528
```bash
16-
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name]
29+
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name] --scope local
1730
```
1831

19-
This creates:
20-
- `.deepwork/jobs/[job_name]/` - Main job directory
21-
- `.deepwork/jobs/[job_name]/steps/` - Step instruction files
22-
- `.deepwork/jobs/[job_name]/hooks/` - Custom validation scripts (with .gitkeep)
23-
- `.deepwork/jobs/[job_name]/templates/` - Example file formats (with .gitkeep)
24-
- `.deepwork/jobs/[job_name]/AGENTS.md` - Job management guidance
25-
26-
**Note**: If the directory already exists (e.g., job.yml was created by define step), you can skip this step or manually create the additional directories:
32+
**For global installation:**
2733
```bash
28-
mkdir -p .deepwork/jobs/[job_name]/hooks .deepwork/jobs/[job_name]/templates
29-
touch .deepwork/jobs/[job_name]/hooks/.gitkeep .deepwork/jobs/[job_name]/templates/.gitkeep
34+
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name] --scope global
3035
```
3136

32-
### Step 2: Read and Validate the Specification
37+
This creates:
38+
- `[scope_path]/[job_name]/` - Main job directory
39+
- `[scope_path]/[job_name]/steps/` - Step instruction files
40+
- `[scope_path]/[job_name]/hooks/` - Custom validation scripts (with .gitkeep)
41+
- `[scope_path]/[job_name]/templates/` - Example file formats (with .gitkeep)
42+
- `[scope_path]/[job_name]/AGENTS.md` - Job management guidance
43+
44+
Where `[scope_path]` is:
45+
- `.deepwork/jobs` for local scope
46+
- `~/.config/deepwork/jobs` (or `$XDG_CONFIG_HOME/deepwork/jobs`) for global scope
47+
48+
**Note**: If the directory already exists (e.g., job.yml was created by define step), you can skip this step or manually create the additional directories in the appropriate scope location.
49+
50+
### Step 3: Read and Validate the Specification
3351

3452
1. **Locate the job.yml file**
35-
- Read `.deepwork/jobs/[job_name]/job.yml` from the review_job_spec step
53+
- Read the job.yml from the review_job_spec step
54+
- The file location depends on the chosen scope:
55+
- Local: `.deepwork/jobs/[job_name]/job.yml`
56+
- Global: `~/.config/deepwork/jobs/[job_name]/job.yml` (or `$XDG_CONFIG_HOME/deepwork/jobs/[job_name]/job.yml`)
3657
- Parse the YAML content
3758

3859
2. **Validate the specification**
@@ -46,9 +67,11 @@ touch .deepwork/jobs/[job_name]/hooks/.gitkeep .deepwork/jobs/[job_name]/templat
4667
- List of all steps with their details
4768
- Understand the workflow structure
4869

49-
### Step 3: Generate Step Instruction Files
70+
### Step 4: Generate Step Instruction Files
5071

51-
For each step in the job.yml, create a comprehensive instruction file at `.deepwork/jobs/[job_name]/steps/[step_id].md`.
72+
For each step in the job.yml, create a comprehensive instruction file at the appropriate scope location:
73+
- Local: `.deepwork/jobs/[job_name]/steps/[step_id].md`
74+
- Global: `~/.config/deepwork/jobs/[job_name]/steps/[step_id].md`
5275

5376
**Template reference**: See `.deepwork/jobs/deepwork_jobs/templates/step_instruction.md.template` for the standard structure.
5477

.gemini/skills/deepwork_jobs/implement.toml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,52 @@ Generate the DeepWork job directory structure and instruction files for each ste
3232
3333
Read the `job.yml` specification file and create all the necessary files to make the job functional, including directory structure and step instruction files. Then sync the commands to make them available.
3434
35-
### Step 1: Create Directory Structure Using Script
35+
### Step 1: Determine Installation Scope
3636
37-
Run the `make_new_job.sh` script to create the standard directory structure:
37+
**Ask the user where they want to install this job using structured questions:**
3838
39+
Present two options:
40+
1. **Local** - Install in this project only (`.deepwork/jobs/`)
41+
2. **Global** - Install for all projects in your user config (`~/.config/deepwork/jobs/`)
42+
43+
**Guidance for users:**
44+
- Choose **local** if the job is specific to this project or you want to version control it
45+
- Choose **global** if the job is reusable across multiple projects (e.g., a general "code review" or "documentation" workflow)
46+
47+
### Step 2: Create Directory Structure Using Script
48+
49+
Run the `make_new_job.sh` script to create the standard directory structure with the chosen scope:
50+
51+
**For local installation:**
3952
```bash
40-
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name]
53+
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name] --scope local
4154
```
4255
43-
This creates:
44-
- `.deepwork/jobs/[job_name]/` - Main job directory
45-
- `.deepwork/jobs/[job_name]/steps/` - Step instruction files
46-
- `.deepwork/jobs/[job_name]/hooks/` - Custom validation scripts (with .gitkeep)
47-
- `.deepwork/jobs/[job_name]/templates/` - Example file formats (with .gitkeep)
48-
- `.deepwork/jobs/[job_name]/AGENTS.md` - Job management guidance
49-
50-
**Note**: If the directory already exists (e.g., job.yml was created by define step), you can skip this step or manually create the additional directories:
56+
**For global installation:**
5157
```bash
52-
mkdir -p .deepwork/jobs/[job_name]/hooks .deepwork/jobs/[job_name]/templates
53-
touch .deepwork/jobs/[job_name]/hooks/.gitkeep .deepwork/jobs/[job_name]/templates/.gitkeep
58+
.deepwork/jobs/deepwork_jobs/make_new_job.sh [job_name] --scope global
5459
```
5560
56-
### Step 2: Read and Validate the Specification
61+
This creates:
62+
- `[scope_path]/[job_name]/` - Main job directory
63+
- `[scope_path]/[job_name]/steps/` - Step instruction files
64+
- `[scope_path]/[job_name]/hooks/` - Custom validation scripts (with .gitkeep)
65+
- `[scope_path]/[job_name]/templates/` - Example file formats (with .gitkeep)
66+
- `[scope_path]/[job_name]/AGENTS.md` - Job management guidance
67+
68+
Where `[scope_path]` is:
69+
- `.deepwork/jobs` for local scope
70+
- `~/.config/deepwork/jobs` (or `$XDG_CONFIG_HOME/deepwork/jobs`) for global scope
71+
72+
**Note**: If the directory already exists (e.g., job.yml was created by define step), you can skip this step or manually create the additional directories in the appropriate scope location.
73+
74+
### Step 3: Read and Validate the Specification
5775
5876
1. **Locate the job.yml file**
59-
- Read `.deepwork/jobs/[job_name]/job.yml` from the review_job_spec step
77+
- Read the job.yml from the review_job_spec step
78+
- The file location depends on the chosen scope:
79+
- Local: `.deepwork/jobs/[job_name]/job.yml`
80+
- Global: `~/.config/deepwork/jobs/[job_name]/job.yml` (or `$XDG_CONFIG_HOME/deepwork/jobs/[job_name]/job.yml`)
6081
- Parse the YAML content
6182
6283
2. **Validate the specification**
@@ -70,9 +91,11 @@ touch .deepwork/jobs/[job_name]/hooks/.gitkeep .deepwork/jobs/[job_name]/templat
7091
- List of all steps with their details
7192
- Understand the workflow structure
7293
73-
### Step 3: Generate Step Instruction Files
94+
### Step 4: Generate Step Instruction Files
7495
75-
For each step in the job.yml, create a comprehensive instruction file at `.deepwork/jobs/[job_name]/steps/[step_id].md`.
96+
For each step in the job.yml, create a comprehensive instruction file at the appropriate scope location:
97+
- Local: `.deepwork/jobs/[job_name]/steps/[step_id].md`
98+
- Global: `~/.config/deepwork/jobs/[job_name]/steps/[step_id].md`
7699
77100
**Template reference**: See `.deepwork/jobs/deepwork_jobs/templates/step_instruction.md.template` for the standard structure.
78101

tests/shell_script_tests/test_make_new_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_shows_example_in_usage(self, jobs_scripts_dir: Path, project_dir: Path)
5858
script_path = jobs_scripts_dir / "make_new_job.sh"
5959
stdout, stderr, code = run_make_new_job(script_path, project_dir)
6060

61-
assert "Example:" in stdout, "Should show example usage"
61+
assert "Examples:" in stdout, "Should show example usage"
6262

6363

6464
class TestMakeNewJobNameValidation:

0 commit comments

Comments
 (0)