Add Document Type Definitions (DTD) support for job outputs - #81
Merged
Conversation
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>
nhorton
force-pushed
the
docs/job-type-classification
branch
from
January 20, 2026 18:41
cc303bc to
2748519
Compare
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>
- 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 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>
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_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>
Reconcile branch with main, incorporating v0.3.1 fixes: - created rule mode for matching only newly created files - Fix created mode rules incorrectly firing on modified files - Fix compare_to: prompt mode detection Co-Authored-By: Claude Opus 4.5 <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
deepwork_jobs.define(Steps 1.5, 1.6, 1.7)deepwork_jobs.learn(Steps 3.5, 4.5)Test plan
deepwork sync🤖 Generated with Claude Code