Skip to content

Commit c9b99b1

Browse files
nhortonclaude
andauthored
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

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
"Bash(python3:*)",
9090
"Bash(pip:*)",
9191
"Bash(pip3:*)",
92+
"Bash(pytest:*)",
93+
"Bash(uv:*)",
9294
"Bash(node:*)",
9395
"Bash(npm:*)",
9496
"Bash(npx:*)",

.claude/skills/add_platform.add_capabilities/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ Use branch format: `deepwork/add_platform-[instance]-YYYYMMDD`
208208
## Outputs
209209

210210
**Required outputs**:
211-
- `job_schema.py`- `adapters.py`
211+
- `job_schema.py`
212+
- `adapters.py`
213+
212214
## Quality Validation
213215

214216
Stop hooks will automatically validate your work. The loop continues until all criteria pass.

.claude/skills/add_platform.implement/SKILL.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,10 @@ Use branch format: `deepwork/add_platform-[instance]-YYYYMMDD`
306306
## Outputs
307307
308308
**Required outputs**:
309-
- `templates/` (directory)- `tests/` (directory)- `README.md`
309+
- `templates/` (directory)
310+
- `tests/` (directory)
311+
- `README.md`
312+
310313
## Quality Validation
311314
312315
Stop hooks will automatically validate your work. The loop continues until all criteria pass.

.claude/skills/add_platform.research/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,9 @@ Use branch format: `deepwork/add_platform-[instance]-YYYYMMDD`
258258
## Outputs
259259

260260
**Required outputs**:
261-
- `cli_configuration.md`- `hooks_system.md`
261+
- `cli_configuration.md`
262+
- `hooks_system.md`
263+
262264
## Quality Validation
263265

264266
Stop hooks will automatically validate your work. The loop continues until all criteria pass.

.claude/skills/add_platform.verify/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ Use branch format: `deepwork/add_platform-[instance]-YYYYMMDD`
182182

183183
## Outputs
184184

185-
No specific file outputs required.
185+
**Required outputs**:
186+
- `verification_checklist.md`
186187

187188
## Quality Validation
188189

@@ -195,7 +196,7 @@ Stop hooks will automatically validate your work. The loop continues until all c
195196
## On Completion
196197

197198
1. Verify outputs are created
198-
2. Inform user: "Step 4/4 complete"
199+
2. Inform user: "Step 4/4 complete, outputs: verification_checklist.md"
199200
3. **Workflow complete**: All steps finished. Consider creating a PR to merge the work branch.
200201

201202
---

.claude/skills/commit.commit_and_push/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ Use branch format: `deepwork/commit-[instance]-YYYYMMDD`
133133

134134
## Outputs
135135

136-
No specific file outputs required.
136+
**Required outputs**:
137+
- `changes_committed`
137138

138139
## Quality Validation
139140

@@ -146,7 +147,7 @@ Stop hooks will automatically validate your work. The loop continues until all c
146147
## On Completion
147148

148149
1. Verify outputs are created
149-
2. Inform user: "Step 3/3 complete"
150+
2. Inform user: "Step 3/3 complete, outputs: changes_committed"
150151
3. **Workflow complete**: All steps finished. Consider creating a PR to merge the work branch.
151152

152153
---

.claude/skills/commit.lint/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ Use branch format: `deepwork/commit-[instance]-YYYYMMDD`
128128
129129
## Outputs
130130
131-
No specific file outputs required.
131+
**Required outputs**:
132+
- `code_formatted`
132133
133134
## Quality Validation
134135
@@ -141,7 +142,7 @@ Stop hooks will automatically validate your work. The loop continues until all c
141142
## On Completion
142143
143144
1. Verify outputs are created
144-
2. Inform user: "Step 2/3 complete"
145+
2. Inform user: "Step 2/3 complete, outputs: code_formatted"
145146
3. **Continue workflow**: Use Skill tool to invoke `/commit.commit_and_push`
146147
147148
---

.claude/skills/commit.test/SKILL.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ Use branch format: `deepwork/commit-[instance]-YYYYMMDD`
111111

112112
## Outputs
113113

114-
No specific file outputs required.
114+
**Required outputs**:
115+
- `tests_passing`
115116

116117
## Quality Validation
117118

@@ -124,7 +125,7 @@ Stop hooks will automatically validate your work. The loop continues until all c
124125
## On Completion
125126

126127
1. Verify outputs are created
127-
2. Inform user: "Step 1/3 complete"
128+
2. Inform user: "Step 1/3 complete, outputs: tests_passing"
128129
3. **Continue workflow**: Use Skill tool to invoke `/commit.lint`
129130

130131
---

0 commit comments

Comments
 (0)