Commit c9b99b1
Add Document Type Definitions (DTD) support for job outputs (#81)
* Add Document Type Definitions (DTD) support for job outputs
Implement DTDs as a first-class feature for formalizing document specifications
with quality criteria, enabling consistent document structure across job outputs.
Key changes:
- Add DTD schema and parser for frontmatter markdown format
- Extend job.yml output schema to support DTD references
- Update skill generators to inject DTD context into templates
- Add document detection workflow to deepwork_jobs.define
- Add DTD improvement workflow to deepwork_jobs.learn
- Update Claude and Gemini templates for DTD-aware rendering
- Bump version to 0.4.0
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Rename dtd to document_type with full file path references
Change the output schema from referencing DTDs by name to using full file paths:
- Renamed `dtd` field to `document_type` in job.yml outputs
- Changed pattern from name-based (e.g., "monthly_report") to path-based
(e.g., ".deepwork/dtds/monthly_report.md")
- This makes references self-documenting and allows agents to understand
them without additional context
Updated:
- Schema: new pattern ^\.deepwork/dtds/[a-z][a-z0-9_-]*\.md$
- Parser: OutputSpec.dtd -> OutputSpec.document_type
- Generator: load DTDs by file path instead of directory scan
- Templates: has_dtd -> has_document_type, dtd -> document_type
- Documentation: updated all examples and explanations
- Tests and fixtures: renamed job_with_dtd to job_with_document_type
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add job.yml DTD for define step output validation
- Create job_spec.md DTD with 9 quality criteria for job.yml files
- Update install.py to copy DTDs from standard jobs to .deepwork/dtds/
- Reference DTD in deepwork_jobs define step output with document_type
- Bump deepwork_jobs version to 0.7.0
- Temporarily disable new-standard-job-warning rule (bug causes infinite loop)
The DTD ensures consistent quality for all job.yml files created via
/deepwork_jobs.define by validating: identifier format, semantic version,
summary length, description richness, changelog presence, step completeness,
dependency validity, input consistency, and output paths.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add review_job_spec step to deepwork_jobs workflow
Add DTD-based quality validation step between define and implement that:
- Uses a sub-agent (haiku model) for unbiased review of job.yml
- Evaluates all 9 DTD quality criteria from job_spec.md
- Iterates fix-review cycle until all criteria pass
This establishes a reusable pattern for DTD-conforming document validation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add outputs to process-oriented steps for DTD compliance
Review of all jobs against job_spec DTD revealed 3 jobs with steps
missing required outputs:
- add_platform/verify: added verification_checklist.md
- commit (test, lint, commit_and_push): added implicit state outputs
- update/job: added files_synced implicit state output
These are process-oriented steps where the "output" is a state change
rather than a file artifact, but the DTD requires at least one output
per step for completeness.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Rename DTD to doc spec throughout codebase
- Rename dtd_parser.py to doc_spec_parser.py
- Rename dtd_schema.py to doc_spec_schema.py
- Rename .deepwork/dtds/ directories to doc_specs/
- Rename document-type-definitions.md to doc-specs.md
- Update all references from DTD/dtd to doc spec/doc_spec
- Update schema pattern for document_type paths
- Update documentation, job definitions, and templates
- Add pytest and uv to allowed commands in Claude settings
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 5e18bf4 commit c9b99b1
75 files changed
Lines changed: 4358 additions & 148 deletions
File tree
- .claude
- skills
- add_platform.add_capabilities
- add_platform.implement
- add_platform.research
- add_platform.verify
- commit.commit_and_push
- commit.lint
- commit.test
- deepwork_jobs.define
- deepwork_jobs.implement
- deepwork_jobs.learn
- deepwork_jobs.review_job_spec
- deepwork_jobs
- deepwork_rules.define
- update.job
- .deepwork
- doc_specs
- jobs
- add_platform
- commit
- deepwork_jobs
- doc_specs
- steps
- templates
- update
- rules
- .gemini/skills
- add_platform
- commit
- deepwork_jobs
- deepwork_rules
- update
- doc
- src/deepwork
- cli
- core
- schemas
- standard_jobs/deepwork_jobs
- doc_specs
- steps
- templates
- templates
- claude
- gemini
- utils
- tests
- fixtures
- doc_specs
- jobs/job_with_document_type
- steps
- integration
- unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
310 | 313 | | |
311 | 314 | | |
312 | 315 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
198 | | - | |
| 199 | + | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
| 137 | + | |
137 | 138 | | |
138 | 139 | | |
139 | 140 | | |
| |||
146 | 147 | | |
147 | 148 | | |
148 | 149 | | |
149 | | - | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
144 | | - | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| |||
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
0 commit comments