Refactor job discovery to support multiple job folders#210
Merged
Conversation
…ERS env var Job discovery now searches multiple directories instead of only .deepwork/jobs/. The default search path is: 1. <project>/.deepwork/jobs (project-local / user-created jobs) 2. <package>/standard_jobs (built-in jobs shipped with DeepWork) Additional folders can be appended via the DEEPWORK_ADDITIONAL_JOBS_FOLDERS environment variable (colon-delimited list of paths). Standard jobs are no longer copied into .deepwork/jobs/ during install; they are loaded directly from the package source. The sync command removes the legacy .deepwork/jobs/deepwork_jobs copy for migration. https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV
…_dir in MCP - Add `job_dir` field to `ActiveStepInfo` so agents know the absolute path to the job directory (needed to find templates, scripts, etc.) - Remove stale `make_new_job.sh` permission from settings.json template - Update all standard job step instructions to use `<job_dir>/` instead of hardcoded `.deepwork/jobs/deepwork_jobs/` paths - Update AGENTS.md to reflect the single-location model - Update fix_settings quality criterion for stale permission cleanup - Delete the legacy .deepwork/jobs/deepwork_jobs/ directory (migration) - Update mcp_interface.md documentation https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV
These functions copied standard jobs into .deepwork/jobs/ during install, which is no longer done — standard jobs are loaded directly from the package at runtime. https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV
Artifacts from running the test_job_flow workflow which exercised the full job creation pipeline end-to-end. https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 13, 2026
* feat: support multiple job folders with DEEPWORK_ADDITIONAL_JOBS_FOLDERS env var Job discovery now searches multiple directories instead of only .deepwork/jobs/. The default search path is: 1. <project>/.deepwork/jobs (project-local / user-created jobs) 2. <package>/standard_jobs (built-in jobs shipped with DeepWork) Additional folders can be appended via the DEEPWORK_ADDITIONAL_JOBS_FOLDERS environment variable (colon-delimited list of paths). Standard jobs are no longer copied into .deepwork/jobs/ during install; they are loaded directly from the package source. The sync command removes the legacy .deepwork/jobs/deepwork_jobs copy for migration. https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV * fix: remove stale .deepwork/jobs/deepwork_jobs references, expose job_dir in MCP - Add `job_dir` field to `ActiveStepInfo` so agents know the absolute path to the job directory (needed to find templates, scripts, etc.) - Remove stale `make_new_job.sh` permission from settings.json template - Update all standard job step instructions to use `<job_dir>/` instead of hardcoded `.deepwork/jobs/deepwork_jobs/` paths - Update AGENTS.md to reflect the single-location model - Update fix_settings quality criterion for stale permission cleanup - Delete the legacy .deepwork/jobs/deepwork_jobs/ directory (migration) - Update mcp_interface.md documentation https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV * chore: remove unused _inject_standard_job and _inject_deepwork_jobs These functions copied standard jobs into .deepwork/jobs/ during install, which is no longer done — standard jobs are loaded directly from the package at runtime. https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV * style: ruff format https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV * style: migrate str+Enum to StrEnum (UP042) https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV * chore: update coverage to 79.91% from test_job_flow run Artifacts from running the test_job_flow workflow which exercised the full job creation pipeline end-to-end. https://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV --------- Co-authored-by: Claude <noreply@anthropic.com>
The merge queue run timed out at 3 minutes due to API latency. Previous successful runs took ~1.5 minutes, but 3 minutes is too tight for flaky conditions. Increasing to 6 minutes for headroom. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR refactors job discovery to support loading jobs from multiple configurable directories instead of only from
.deepwork/jobs/. It introduces a newdeepwork.core.jobsmodule that centralizes job folder resolution and provides utilities for discovering and loading jobs across all configured sources.Key Changes
New
deepwork.core.jobsmodule: Provides three main functions:get_job_folders(): Returns the ordered list of directories to scan for jobs (project-local, standard, and environment-configured)load_all_jobs(): Discovers and parses all job definitions across all folders, with first-folder-wins deduplicationfind_job_dir(): Locates a specific job by name across all foldersEnvironment variable support: Added
DEEPWORK_ADDITIONAL_JOBS_FOLDERSenvironment variable to allow appending custom job directories (colon-delimited paths)Standard jobs now loaded from package: Standard jobs are no longer copied into
.deepwork/jobs/during installation. Instead, they are loaded directly fromsrc/deepwork/standard_jobs/at runtime via the new job discovery systemUpdated
sync.py:get_job_folders()to discover jobs across all sources_migrate_remove_synced_standard_jobs()to clean up legacy synced standard jobs from existing installationsUpdated
mcp/tools.py:.deepwork/jobs/access withload_all_jobs()andfind_job_dir()self.jobs_dirattribute in favor of dynamic folder discoveryComprehensive test coverage: Added 215 lines of unit tests covering job folder discovery, loading, and finding with various scenarios (duplicates, missing folders, invalid jobs, environment variables)
Implementation Details
deepwork_jobsfolder from existing installationshttps://claude.ai/code/session_01KU818enCNqHLbrqtdyCXUV