Skip to content

Comments

Refactor jobs.yml to support multiple workflows#14

Closed
nhorton wants to merge 27 commits intomainfrom
claude/refactor-jobs-workflows-qQWaK
Closed

Refactor jobs.yml to support multiple workflows#14
nhorton wants to merge 27 commits intomainfrom
claude/refactor-jobs-workflows-qQWaK

Conversation

@nhorton
Copy link
Contributor

@nhorton nhorton commented Jan 13, 2026

  • Introduce workflows array to group related steps together
  • Named workflows represent multi-step processes (e.g., "create" workflow)
  • Anonymous workflows (no name/description) contain standalone steps
  • Update parser to add Workflow dataclass and update JobDefinition
  • Update generator to calculate next/prev steps within workflows
  • Update all job.yml files:
    • deepwork_jobs: "create" workflow (define+implement), standalone refine
    • deepwork_policy: anonymous define workflow
    • add_platform: "add" workflow with 4 sequential steps
  • Update all tests and fixtures to use workflows structure

This provides clearer organization of related steps vs standalone commands.

nhorton and others added 27 commits January 9, 2026 16:01
Major architectural change to use slash-commands instead of skills for job steps.

Changes:
- Updated PlatformConfig to use commands_dir instead of skill_prefix/skill_extension
- Renamed SkillGenerator to CommandGenerator
- Renamed skill-job-step template to command-job-step with YAML frontmatter
- Updated generator to create commands in .claude/commands/ directory
- Updated CLI install to create commands/ directory
- Removed core skills generation (deepwork.define/refine)
- Updated success messages to reflect slash-command usage

Slash-commands are user-invoked (/command-name) and better suited for explicit
workflow step execution than auto-discovered skills.

Tested: Successfully generated and validated slash-command format
Major refactoring to use a sync-based approach where job definitions are
the source of truth and commands are generated build artifacts.

New Architecture:
- .deepwork/config.yml tracks which platforms are configured
- .deepwork/jobs/ contains job definitions (committed, source of truth)
- Platform commands are generated and gitignored (build artifacts)

Changes:

1. Configuration Management:
   - config.yml now tracks list of platforms instead of single platform
   - platforms: [claude, gemini, ...] structure
   - Allows multi-platform support in single project

2. Install Command (install.py):
   - Creates/updates config.yml with platforms list
   - Adds platform to list if not present
   - Calls sync command to generate all commands
   - No longer directly generates files

3. New Sync Command (sync.py):
   - Reads config.yml to get configured platforms
   - Discovers all jobs in .deepwork/jobs/
   - For each platform:
     * Generates core commands (define)
     * Generates all job step commands
   - Can be run anytime to regenerate commands
   - Updates commands when templates or jobs change

4. Generator Updates (generator.py):
   - Added generate_core_commands() method
   - Generates core commands like define.md
   - Templates can be updated and re-synced

5. Core Command Template:
   - command-define.md.jinja: Guide for creating job definitions
   - Explains job structure, validation rules, examples
   - Generated as /define slash-command

Benefits:
- Multi-platform: Easy to support Claude + Gemini in same project
- Single source: Job definitions are the only versioned files
- Always in sync: Run 'deepwork sync' to regenerate from source
- Template updates: Core command improvements propagate via sync
- Git-friendly: Generated commands in gitignore, clean history

Tested:
✓ Install creates config.yml with platforms list
✓ Install calls sync automatically
✓ Sync generates core commands
✓ Sync generates job commands for all jobs
✓ Multiple sync runs work correctly
✓ Proper YAML frontmatter in all commands
…andard

Make jobs commands just be normal jobs
* policies working!

* first policy in place
* Looks great

* fix gitignore
* ci: add GitHub Actions for tests and auto-formatting

Add two workflows:
- tests.yml: Runs linting, type checking, and pytest on PRs
- format.yml: Auto-formats code with ruff and commits changes

* ci: remove ruff from tests, add verification to format workflow

- Remove ruff linting from tests.yml (handled by format.yml)
- Add verification step to format.yml that fails if issues can't be auto-fixed

* ci: fix workflow dependencies and formatting order

- Use uv sync --extra dev to install dev dependencies (pytest, ruff)
- Remove mypy from tests (missing type stubs in codebase)
- Re-run format after auto-fix to catch any changes

* style: auto-format code with ruff

* ci: consolidate workflows into single validate.yml

- Combine tests and format into one file for cleaner job names
- Jobs now appear as "Validate / Format" and "Validate / Tests"
- Uses uv sync --extra dev to properly install dev dependencies

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* multi-agent core

* Fix job.yml path references in deepwork_jobs

- Update define step to create job.yml in .deepwork/jobs/[job_name]/ instead of deepwork/[job_name]/
- Update implement step to verify job.yml location instead of copying from work directory
- Update job.yml quality criteria to check correct path
- Update README.md to use correct command names (deepwork_jobs.define, deepwork_jobs.refine)
- Sync changes to all installed files and generated commands

* more cleanup

* style: auto-format code with ruff

* ci: remove auto-format job, add format check to tests (#8)

Remove the separate format job that auto-committed formatting fixes,
which caused issues with GitHub Actions not re-running after the
auto-merge. Instead, add format checks as a step in the tests job
that will fail if code is not properly formatted.

Co-authored-by: Claude <noreply@anthropic.com>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
* multi-agent core

* Fix job.yml path references in deepwork_jobs

- Update define step to create job.yml in .deepwork/jobs/[job_name]/ instead of deepwork/[job_name]/
- Update implement step to verify job.yml location instead of copying from work directory
- Update job.yml quality criteria to check correct path
- Update README.md to use correct command names (deepwork_jobs.define, deepwork_jobs.refine)
- Sync changes to all installed files and generated commands

* more cleanup

* deepwork_jobs: Define add_platform job specification

Creates a 4-step workflow for adding new AI platforms to DeepWork:
- research: Capture CLI config and hooks documentation
- add_capabilities: Update schema and adapters with new hooks
- implement: Create adapter, templates, tests (100% coverage)
- verify: Ensure installation works correctly

Each step includes quality validation stop hooks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* new jobs are there

* add_platform: Complete research step for Gemini CLI

Document Gemini CLI configuration and hooks system:
- cli_configuration.md: TOML command format, discovery, namespacing
- hooks_system.md: No command-level hooks (only global hooks in settings.json)

Key findings:
- Commands stored in .gemini/commands/ (TOML format)
- No hooks available in slash command definitions
- Global hooks exist but cannot be configured per-command

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* add_platform: Document Gemini CLI hook analysis in adapters.py

No new hooks added to schema - Gemini CLI does not support command-level hooks.

Analysis findings:
- Gemini CLI TOML command files only support 'prompt' and 'description' fields
- Global hooks exist in settings.json but are NOT per-command
- All existing DeepWork hooks (after_agent, before_tool, before_prompt) already
  cover the generic patterns; Gemini just won't support them

Added documentation block in adapters.py explaining hook support by platform.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* add_platform: Implement Gemini CLI platform support

Add full platform support for Gemini CLI:

Adapter (src/deepwork/core/adapters.py):
- GeminiAdapter class with TOML command format
- Subdirectory-based namespacing (job_name/step_id.toml -> /job_name:step_id)
- Empty hook_name_mapping (Gemini has no command-level hooks)
- sync_hooks returns 0 (no-op since hooks are global-only)

Template (src/deepwork/templates/gemini/command-job-step.toml.jinja):
- TOML format with description and prompt fields
- Colon namespacing for command references
- Quality criteria embedded in prompt (since no stop_hooks)

Tests (tests/unit/test_adapters.py):
- 18 new tests for GeminiAdapter
- All adapter tests pass (36 total)
- Full coverage of new GeminiAdapter code

README.md:
- Added Supported Platforms table
- Gemini CLI installation instructions
- Platform-specific notes about hooks and TOML format
- Updated directory structure examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* add_platform: Verify Gemini CLI installation

Verified Gemini CLI platform integration:
- deepwork install --platform gemini completes successfully
- All 8 TOML command files generated correctly
- Proper directory structure with subdirectory namespacing
- Cross-platform compatibility confirmed (Claude still works)
- Both platforms in .deepwork/config.yml

Generated files:
- .gemini/commands/deepwork_jobs/*.toml (3 files)
- .gemini/commands/deepwork_policy/define.toml
- .gemini/commands/add_platform/*.toml (4 files)

Verification report: deepwork/add_platform/verification_complete.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* rest of gemini

* deepwork folders fix

* remove work dir stuff

* be loud on sync issues

* fix command instructions when there is no output

* remove unused reference

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Add command format and hooks support information for planned platforms:
- OpenCode: Markdown commands, no hooks support
- GitHub Copilot CLI: Markdown commands, tool permissions only (no lifecycle hooks)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
- Introduce workflows array to group related steps together
- Named workflows represent multi-step processes (e.g., "create" workflow)
- Anonymous workflows (no name/description) contain standalone steps
- Update parser to add Workflow dataclass and update JobDefinition
- Update generator to calculate next/prev steps within workflows
- Update all job.yml files:
  - deepwork_jobs: "create" workflow (define+implement), standalone refine
  - deepwork_policy: anonymous define workflow
  - add_platform: "add" workflow with 4 sequential steps
- Update all tests and fixtures to use workflows structure

This provides clearer organization of related steps vs standalone commands.
Updates step numbering to reflect workflow structure:
- define is now step 1/2 in "create" workflow
- implement is now step 2/2 in "create" workflow
@ncrmro ncrmro closed this Jan 14, 2026
@nhorton nhorton deleted the claude/refactor-jobs-workflows-qQWaK branch January 15, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants