Skip to content

Commit 8302839

Browse files
ncrmroclaude
andauthored
feat(standard_jobs): add engineer standard job (#287)
* feat(standard_jobs): add engineer standard job Domain-agnostic engineering execution job with two workflows: - implement: 6-step workflow (translate_issue -> initialize_branch -> red_tests -> green_implementation -> finalize_pr -> product_sync) - doctor: 3-step workflow validating agent.md and context files Enforces TDD discipline, PR synchronization, artifact generation, CODEOWNERS-based reviewer assignment, and product traceability per bundled RFC 2119 requirements specification. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(engineer): apply review feedback — trim step files, update docs - Trim step instructions by 33% (1218→816 lines): remove redundant quality criteria sections, domain adaptation tables (already in common_job_info), and verbose objective/task preambles - Fix requirements.md: correct "REQUIRED" keyword usage, clarify CI agent responsibility, add audience statement and section headings - Update CLAUDE.md and doc/architecture.md to list engineer standard job - Add .deepreview config for holistic job definition review Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(engineer): address PR review comments Align documentation with implementation: - Fix domain adaptation table references to say they live in common_job_info, not in step instructions (job.yml, AGENTS.md, doc/architecture.md) - Standardize PR section references to `## Demo` and `## Handoff` across requirements.md, job.yml, and finalize_pr.md - Add deepwork_reviews to standard jobs list in repo AGENTS.md - Include requirements.md in .deepreview match set - Update .deepreview step instruction quality criteria to match actual file structure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f373643 commit 8302839

16 files changed

Lines changed: 961 additions & 3 deletions

AGENTS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ When creating or modifying jobs in this repository, you MUST understand which ty
3939

4040
**Current standard jobs**:
4141
- `deepwork_jobs` - Core job management (define, implement, learn)
42+
- `engineer` - Domain-agnostic engineering execution (implement, doctor)
43+
- `deepwork_reviews` - DeepWork job review and quality control workflows
4244

4345
**Editing rules**:
4446
- Source of truth is ALWAYS in `src/deepwork/standard_jobs/`
@@ -104,7 +106,8 @@ deepwork/
104106
│ ├── hooks/ # Hook scripts and wrappers
105107
│ ├── standard_jobs/ # Built-in job definitions (auto-discovered at runtime)
106108
│ │ ├── deepwork_jobs/
107-
│ │ └── deepwork_reviews/
109+
│ │ ├── deepwork_reviews/
110+
│ │ └── engineer/
108111
│ ├── review/ # DeepWork Reviews system (.deepreview pipeline)
109112
│ ├── schemas/ # Definition schemas (deepreview, doc_spec)
110113
│ └── utils/ # Utilities (fs, git, yaml, validation)
@@ -221,7 +224,7 @@ Each step:
221224

222225
### How to Identify Job Types
223226

224-
- **Standard jobs**: Exist in `src/deepwork/standard_jobs/` (currently: `deepwork_jobs`, `deepwork_reviews`)
227+
- **Standard jobs**: Exist in `src/deepwork/standard_jobs/` (currently: `deepwork_jobs`, `deepwork_reviews`, `engineer`)
225228
- **Library jobs**: Exist in `library/jobs/`
226229
- **Bespoke jobs**: Exist ONLY in `.deepwork/jobs/` with no corresponding standard_jobs entry
227230

@@ -242,3 +245,4 @@ Each step:
242245
5. **Type Safety**: Use type hints for better code quality
243246
6. **No Auto-Commit**: DO NOT automatically commit changes to git. Let the user review and commit changes themselves.
244247
7. **Documentation Sync**: When making implementation changes, always update `doc/architecture.md` and `README.md` to reflect those changes. The architecture document must stay in sync with the actual codebase.
248+
8. **Succinctness**: Jobs, documentation, and code MUST be succinct. Avoid verbose preambles, redundant explanations, and duplicated content. Step instructions should contain only what the agent needs to act — not philosophy, not quality criteria already enforced by the workflow runtime, and not domain tables already in `common_job_info`. If it can be said in one sentence, do not use three.

doc/architecture.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ deepwork/ # DeepWork tool repository
6565
│ │ └── gemini_hook.sh # Shell wrapper for Gemini CLI
6666
│ ├── standard_jobs/ # Built-in job definitions
6767
│ │ ├── deepwork_jobs/
68-
│ │ └── deepwork_reviews/
68+
│ │ ├── deepwork_reviews/
69+
│ │ └── engineer/
6970
│ ├── review/ # DeepWork Reviews system
7071
│ │ ├── config.py # .deepreview config parsing + data models
7172
│ │ ├── discovery.py # Find .deepreview files in project tree
@@ -617,6 +618,18 @@ DeepWork includes a built-in job called `deepwork_reviews` for managing `.deepre
617618
- **`add_document_update_rule`** workflow: `analyze_dependencies` → `apply_rule`
618619
- Adds a review rule to keep a specific documentation file up-to-date when related source files change
619620
621+
### Standard Job: `engineer`
622+
623+
DeepWork includes a built-in job called `engineer` for domain-agnostic engineering execution. It provides:
624+
625+
**Workflows**:
626+
- **`implement`** workflow: `translate_issue` → `initialize_branch` → `red_tests` → `green_implementation` → `finalize_pr` → `product_sync`
627+
- Drives engineering work from product issue through PR merge with TDD discipline, PR synchronization, and product traceability
628+
- **`doctor`** workflow: `check_agent_md` → `check_context` → `doctor_report`
629+
- Validates that agent.md and domain context files are present, linked, and valid
630+
631+
The job is domain-agnostic — its `common_job_info` includes a domain adaptation table for software, hardware/CAD, firmware, and documentation projects that step instructions reference. An RFC 2119 requirements specification is bundled as `requirements.md`.
632+
620633
### MCP-Based Workflow Execution
621634
622635
Users invoke workflows through the `/deepwork` skill, which uses MCP tools:
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
job_definition_review:
2+
description: "Review job.yml, requirements.md, and step instructions for correctness, completeness, and coherence as a holistic workflow."
3+
match:
4+
include:
5+
- "job.yml"
6+
- "steps/*.md"
7+
- "requirements.md"
8+
review:
9+
strategy: matches_together
10+
instructions: |
11+
Review this DeepWork job definition (job.yml), its requirements (requirements.md),
12+
and its step instruction files (steps/*.md) holistically. Check that they form a
13+
coherent, well-structured workflow that an AI agent can execute reliably.
14+
15+
## Reference Material
16+
17+
For reference on correct job structure and best practices, read the following files from your plugin:
18+
- `job.yml.template` — canonical job.yml structure with all supported fields
19+
- `job.yml.example` — a complete working example (competitive research job)
20+
- `step_instruction.md.template` — expected structure for step instruction files
21+
- `research_report_job_best_practices.md` — design patterns for report-type jobs
22+
23+
## What to Check
24+
25+
### 1. job.yml Structure
26+
- Has required fields: `name`, `version`, `summary`, `workflows`, `steps`
27+
- `name` is lowercase with underscores only
28+
- `summary` is concise (under 200 characters) and descriptive enough to let a user know what the job does
29+
- `version` follows semantic versioning (e.g., "1.0.0")
30+
- `common_job_info_provided_to_all_steps_at_runtime` provides useful shared context (problem domain, terminology, conventions, constraints)
31+
32+
### 2. Workflow Coherence
33+
- Each workflow's steps form a logical sequence toward a clear goal
34+
- Step dependencies are declared correctly (no missing or extraneous deps)
35+
- No circular dependencies exist
36+
37+
### 3. Input/Output Chain
38+
- Each step has at least one output
39+
- File inputs reference outputs from steps listed in that step's dependencies
40+
- `from_step` values match actual step IDs that produce the referenced file
41+
- The output chain creates a logical data flow through the workflow
42+
- Intermediate outputs that are not meant to be persisted should be in .deepwork/tmp (and the name should indicate that)
43+
- Final outputs follow project conventions (not hidden in dot-directories, descriptive names, appropriate use of subdirectories)
44+
45+
### 4. Step Instructions Match job.yml
46+
- Every step defined in job.yml has a corresponding instruction file
47+
- Step instruction content aligns with the step's described purpose
48+
- Instructions reference the correct input and output filenames from job.yml
49+
- Instructions do not duplicate content already in `common_job_info_provided_to_all_steps_at_runtime`
50+
- If there is duplicated content amongst the instruction files, it should be moved to `common_job_info_provided_to_all_steps_at_runtime` and removed from the instruction files
51+
- If there is content that is needed in multiple steps but not all, it should be moved to its own file and referenced in the steps
52+
53+
### 5. Quality Reviews
54+
- Steps with complex or final outputs have reviews defined
55+
- `run_each` values reference valid output names or `step`
56+
- Quality criteria are statements of expected state, not questions
57+
- `additional_review_guidance` is used when reviewers need context beyond the step's own output files (e.g., cross-referencing prior step outputs)
58+
- Steps with no meaningful quality checks use `reviews: []`
59+
60+
### 6. Step Instruction Quality
61+
- Each instruction file follows the structure and section headings defined in
62+
`step_instruction.md.template` for this job type.
63+
- The sections clearly communicate: what the step is trying to achieve,
64+
what the agent should do, what to produce (including format/examples),
65+
and how quality will be evaluated.
66+
- Instructions are specific and actionable, not generic placeholders
67+
- Output format sections show what good output looks like (examples or
68+
templates)
69+
- If the step gathers user input, instructions mention using structured
70+
questions (e.g., the AskUserQuestion tool)
71+
- Instructions explain how to use file inputs from prior steps and how the
72+
step's outputs will be consumed by later steps.
73+
74+
## Output Format
75+
76+
- PASS: The job definition and step instructions are coherent and
77+
well-structured.
78+
- FAIL: List each issue with the specific file, the problem, and a
79+
suggested fix.
80+
additional_context:
81+
unchanged_matching_files: true
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Project Context for engineer
2+
3+
## Location
4+
5+
This job lives in the DeepWork package source at `src/deepwork/standard_jobs/engineer/`.
6+
It is loaded directly at runtime by the multi-folder job discovery system.
7+
8+
## File Organization
9+
10+
```
11+
engineer/
12+
├── AGENTS.md # This file
13+
├── CLAUDE.md -> AGENTS.md # Symlink for Claude Code
14+
├── job.yml # Job definition
15+
├── requirements.md # RFC 2119 requirements specification
16+
└── steps/
17+
├── translate_issue.md
18+
├── initialize_branch.md
19+
├── red_tests.md
20+
├── green_implementation.md
21+
├── finalize_pr.md
22+
├── product_sync.md
23+
├── check_agent_md.md
24+
├── check_context.md
25+
└── doctor_report.md
26+
```
27+
28+
## Workflows
29+
30+
- **implement**: 6-step workflow executing engineering work from product issue through PR merge and product sync
31+
- **doctor**: 3-step workflow validating agent.md and domain context files
32+
33+
## Design Decisions
34+
35+
1. **Domain-agnostic**: Domain adaptation tables (software, hardware, CAD, firmware, docs) live in `job.yml` `common_job_info`; step instructions are written to be domain-agnostic and rely on those tables
36+
2. **Six implement steps**: Preserves TDD discipline boundary (red tests committed before green implementation)
37+
3. **product_sync is separate**: Workflow can pause at finalize_pr while PR undergoes human review
38+
4. **Doctor focuses on agent.md**: Recommends `repo` library job for labels/branch protection/milestones
39+
5. **Requirements bundled**: RFC 2119 spec lives alongside job definition as `requirements.md`
40+
41+
## Last Updated
42+
- Date: 2026-03-24
43+
- From conversation about: Initial creation of the engineer standard job
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

0 commit comments

Comments
 (0)