@tiic-tech/openworkflow 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/dist/adapters/codex/src/cleanCodexAdapter.js +4 -1
  2. package/dist/adapters/codex/src/cleanCodexAdapter.js.map +1 -1
  3. package/dist/adapters/codex/src/constants.d.ts +1 -0
  4. package/dist/adapters/codex/src/constants.js +2 -0
  5. package/dist/adapters/codex/src/constants.js.map +1 -0
  6. package/dist/adapters/codex/src/generateCommands.js +14 -9
  7. package/dist/adapters/codex/src/generateCommands.js.map +1 -1
  8. package/dist/adapters/codex/src/generateSkills.js +13 -0
  9. package/dist/adapters/codex/src/generateSkills.js.map +1 -1
  10. package/dist/adapters/codex/src/generatedFiles.js +1 -1
  11. package/dist/adapters/codex/src/manifest.js +11 -2
  12. package/dist/adapters/codex/src/manifest.js.map +1 -1
  13. package/dist/adapters/codex/src/templates.d.ts +0 -1
  14. package/dist/adapters/codex/src/templates.js +0 -1
  15. package/dist/adapters/codex/src/templates.js.map +1 -1
  16. package/dist/adapters/src/registry.d.ts +20 -0
  17. package/dist/adapters/src/registry.js +81 -0
  18. package/dist/adapters/src/registry.js.map +1 -0
  19. package/dist/cli/src/commands/brief.d.ts +46 -0
  20. package/dist/cli/src/commands/brief.js +294 -0
  21. package/dist/cli/src/commands/brief.js.map +1 -0
  22. package/dist/cli/src/commands/check.d.ts +42 -0
  23. package/dist/cli/src/commands/check.js +326 -0
  24. package/dist/cli/src/commands/check.js.map +1 -0
  25. package/dist/cli/src/commands/clean.js +46 -1
  26. package/dist/cli/src/commands/clean.js.map +1 -1
  27. package/dist/cli/src/commands/context.d.ts +1 -0
  28. package/dist/cli/src/commands/context.js +471 -0
  29. package/dist/cli/src/commands/context.js.map +1 -0
  30. package/dist/cli/src/commands/doctor.js +122 -12
  31. package/dist/cli/src/commands/doctor.js.map +1 -1
  32. package/dist/cli/src/commands/draft.d.ts +1 -0
  33. package/dist/cli/src/commands/draft.js +175 -0
  34. package/dist/cli/src/commands/draft.js.map +1 -0
  35. package/dist/cli/src/commands/gitAutomation.d.ts +1 -0
  36. package/dist/cli/src/commands/gitAutomation.js +378 -0
  37. package/dist/cli/src/commands/gitAutomation.js.map +1 -0
  38. package/dist/cli/src/commands/handoff.d.ts +22 -0
  39. package/dist/cli/src/commands/handoff.js +122 -0
  40. package/dist/cli/src/commands/handoff.js.map +1 -0
  41. package/dist/cli/src/commands/init.js +52 -1
  42. package/dist/cli/src/commands/init.js.map +1 -1
  43. package/dist/cli/src/commands/inspect.d.ts +23 -0
  44. package/dist/cli/src/commands/inspect.js +157 -0
  45. package/dist/cli/src/commands/inspect.js.map +1 -0
  46. package/dist/cli/src/commands/register.d.ts +1 -0
  47. package/dist/cli/src/commands/register.js +251 -0
  48. package/dist/cli/src/commands/register.js.map +1 -0
  49. package/dist/cli/src/commands/resume.d.ts +59 -0
  50. package/dist/cli/src/commands/resume.js +280 -0
  51. package/dist/cli/src/commands/resume.js.map +1 -0
  52. package/dist/cli/src/commands/shared.js +6 -2
  53. package/dist/cli/src/commands/shared.js.map +1 -1
  54. package/dist/cli/src/commands/summaries.d.ts +1 -0
  55. package/dist/cli/src/commands/summaries.js +77 -0
  56. package/dist/cli/src/commands/summaries.js.map +1 -0
  57. package/dist/cli/src/commands/summarize.d.ts +1 -0
  58. package/dist/cli/src/commands/summarize.js +316 -0
  59. package/dist/cli/src/commands/summarize.js.map +1 -0
  60. package/dist/cli/src/commands/sync.js +135 -12
  61. package/dist/cli/src/commands/sync.js.map +1 -1
  62. package/dist/cli/src/commands/validate.js +25 -1
  63. package/dist/cli/src/commands/validate.js.map +1 -1
  64. package/dist/cli/src/dev/verifyAgentE2E.d.ts +2 -0
  65. package/dist/cli/src/dev/verifyAgentE2E.js +391 -0
  66. package/dist/cli/src/dev/verifyAgentE2E.js.map +1 -0
  67. package/dist/cli/src/dev/verifyCleanCommand.js +213 -2
  68. package/dist/cli/src/dev/verifyCleanCommand.js.map +1 -1
  69. package/dist/cli/src/dev/verifyRuntimeSurface.js +4940 -54
  70. package/dist/cli/src/dev/verifyRuntimeSurface.js.map +1 -1
  71. package/dist/cli/src/dev/verifyWorkflowE2E.js +477 -45
  72. package/dist/cli/src/dev/verifyWorkflowE2E.js.map +1 -1
  73. package/dist/cli/src/index.js +184 -6
  74. package/dist/cli/src/index.js.map +1 -1
  75. package/dist/cli/src/report.d.ts +26 -0
  76. package/dist/cli/src/report.js +17 -0
  77. package/dist/cli/src/report.js.map +1 -0
  78. package/dist/core/src/artifacts/readiness.d.ts +7 -0
  79. package/dist/core/src/artifacts/readiness.js +240 -0
  80. package/dist/core/src/artifacts/readiness.js.map +1 -0
  81. package/dist/core/src/artifacts/registry.d.ts +9 -2
  82. package/dist/core/src/artifacts/registry.js +687 -60
  83. package/dist/core/src/artifacts/registry.js.map +1 -1
  84. package/dist/core/src/commands/registry.js +1425 -146
  85. package/dist/core/src/commands/registry.js.map +1 -1
  86. package/dist/core/src/contracts/index.d.ts +1 -1
  87. package/dist/core/src/fs/index.d.ts +24 -0
  88. package/dist/core/src/fs/index.js +48 -1
  89. package/dist/core/src/fs/index.js.map +1 -1
  90. package/dist/core/src/git/autonomousSimulator.d.ts +46 -0
  91. package/dist/core/src/git/autonomousSimulator.js +163 -0
  92. package/dist/core/src/git/autonomousSimulator.js.map +1 -0
  93. package/dist/core/src/git/branchIdentity.d.ts +19 -0
  94. package/dist/core/src/git/branchIdentity.js +75 -0
  95. package/dist/core/src/git/branchIdentity.js.map +1 -0
  96. package/dist/core/src/git/draftPrPilot.d.ts +47 -0
  97. package/dist/core/src/git/draftPrPilot.js +196 -0
  98. package/dist/core/src/git/draftPrPilot.js.map +1 -0
  99. package/dist/core/src/git/localEvidenceReader.d.ts +21 -0
  100. package/dist/core/src/git/localEvidenceReader.js +142 -0
  101. package/dist/core/src/git/localEvidenceReader.js.map +1 -0
  102. package/dist/core/src/git/localGitAutomation.d.ts +68 -0
  103. package/dist/core/src/git/localGitAutomation.js +470 -0
  104. package/dist/core/src/git/localGitAutomation.js.map +1 -0
  105. package/dist/core/src/git/mergeReadinessCheckpoint.d.ts +31 -0
  106. package/dist/core/src/git/mergeReadinessCheckpoint.js +110 -0
  107. package/dist/core/src/git/mergeReadinessCheckpoint.js.map +1 -0
  108. package/dist/core/src/git/prReadySummary.d.ts +16 -0
  109. package/dist/core/src/git/prReadySummary.js +144 -0
  110. package/dist/core/src/git/prReadySummary.js.map +1 -0
  111. package/dist/core/src/git/remoteReadonlyPlanner.d.ts +60 -0
  112. package/dist/core/src/git/remoteReadonlyPlanner.js +223 -0
  113. package/dist/core/src/git/remoteReadonlyPlanner.js.map +1 -0
  114. package/dist/core/src/onboarding/agentsGuide.d.ts +32 -0
  115. package/dist/core/src/onboarding/agentsGuide.js +164 -0
  116. package/dist/core/src/onboarding/agentsGuide.js.map +1 -0
  117. package/dist/core/src/validators/validateOpenWorkflow.js +1331 -15
  118. package/dist/core/src/validators/validateOpenWorkflow.js.map +1 -1
  119. package/dist/core/src/validators/validateRepositoryContracts.js +2321 -306
  120. package/dist/core/src/validators/validateRepositoryContracts.js.map +1 -1
  121. package/dist/core/src/workflow/cleanOpenWorkflow.d.ts +2 -0
  122. package/dist/core/src/workflow/cleanOpenWorkflow.js +97 -8
  123. package/dist/core/src/workflow/cleanOpenWorkflow.js.map +1 -1
  124. package/dist/core/src/workflow/doctorOpenWorkflow.d.ts +7 -0
  125. package/dist/core/src/workflow/doctorOpenWorkflow.js +26 -0
  126. package/dist/core/src/workflow/doctorOpenWorkflow.js.map +1 -0
  127. package/dist/core/src/workflow/initOpenWorkflow.d.ts +7 -0
  128. package/dist/core/src/workflow/initOpenWorkflow.js +96 -8
  129. package/dist/core/src/workflow/initOpenWorkflow.js.map +1 -1
  130. package/dist/core/src/workflow/planningQueueResume.d.ts +105 -0
  131. package/dist/core/src/workflow/planningQueueResume.js +596 -0
  132. package/dist/core/src/workflow/planningQueueResume.js.map +1 -0
  133. package/dist/core/src/workflow/readWorkflowConfig.d.ts +6 -0
  134. package/dist/core/src/workflow/readWorkflowConfig.js +28 -0
  135. package/dist/core/src/workflow/readWorkflowConfig.js.map +1 -0
  136. package/dist/core/src/workflow/summaryHealth.d.ts +60 -0
  137. package/dist/core/src/workflow/summaryHealth.js +713 -0
  138. package/dist/core/src/workflow/summaryHealth.js.map +1 -0
  139. package/dist/core/src/workflow/syncOpenWorkflow.d.ts +22 -0
  140. package/dist/core/src/workflow/syncOpenWorkflow.js +235 -0
  141. package/dist/core/src/workflow/syncOpenWorkflow.js.map +1 -0
  142. package/package.json +2 -1
  143. package/references/artifact-authoring-templates.md +14 -12
  144. package/references/artifact-instruction-envelope.md +133 -0
  145. package/references/coder-continuous-growth-loop.md +68 -0
  146. package/references/gh-operation-governance.md +114 -0
  147. package/references/git-automation-governance.md +324 -0
  148. package/references/git-version-control-governance.md +227 -0
  149. package/references/internal-coder-protocol.md +202 -0
  150. package/references/issue-governance.md +115 -0
  151. package/references/planning-artifact-contracts.md +595 -0
  152. package/references/planning-skill-runtime-exposure.md +159 -0
  153. package/references/proto-redesign-artifact-contracts.md +217 -0
  154. package/references/proto2html-artifact-contracts.md +113 -0
  155. package/references/skill-system-lifecycle.md +198 -0
  156. package/references/validation-trust-domains.md +286 -0
  157. package/references/workflow-blueprint-runtime-alignment.md +287 -0
  158. package/schemas/atom-tasks.schema.json +101 -0
  159. package/schemas/candidate-changes.schema.json +323 -0
  160. package/schemas/current-state.schema.json +113 -0
  161. package/schemas/html-prototype.schema.json +288 -0
  162. package/schemas/openworkflow-contract.schema.json +9 -1
  163. package/schemas/proto-prompt-pack.schema.json +1333 -0
  164. package/schemas/prototype-evidence.schema.json +684 -142
  165. package/schemas/selected-change.schema.json +104 -0
  166. package/schemas/validation-target.schema.json +187 -1
  167. package/schemas/validation.schema.json +187 -1
  168. package/schemas/vision-session.schema.json +151 -0
  169. package/skills/analyze-changes/SKILL.md +92 -0
  170. package/skills/analyze-changes/agents/openai.yaml +4 -0
  171. package/skills/analyze-changes/references/analysis-protocol.md +116 -0
  172. package/skills/build-proto-prompt/SKILL.md +125 -0
  173. package/skills/build-proto-prompt/references/output-boundary.md +54 -0
  174. package/skills/build-proto-prompt/references/prompt-pack-compiler-protocol.md +80 -0
  175. package/skills/build-prototype/SKILL.md +162 -38
  176. package/skills/build-prototype/agents/openai.yaml +2 -2
  177. package/skills/build-prototype/references/philosophy-engine.md +61 -0
  178. package/skills/build-prototype/references/strategic-prompt-pack-protocol.md +365 -0
  179. package/skills/build-prototype/references/vision2prompt/01_input_contract.md +84 -0
  180. package/skills/build-prototype/references/vision2prompt/02_vision_decomposition.md +108 -0
  181. package/skills/build-prototype/references/vision2prompt/03_strategy_hypothesis_generation.md +89 -0
  182. package/skills/build-prototype/references/vision2prompt/04_product_system_extraction.md +78 -0
  183. package/skills/build-prototype/references/vision2prompt/05_prototype_prompt_schema.md +189 -0
  184. package/skills/build-prototype/references/vision2prompt/06_output_templates.md +125 -0
  185. package/skills/build-prototype/references/vision2prompt/07_quality_rubric.md +171 -0
  186. package/skills/build-validation/SKILL.md +136 -54
  187. package/skills/build-validation/references/prototype-validation-target-rubric.md +35 -0
  188. package/skills/build-validation/references/return-to-vision-gate.md +32 -0
  189. package/skills/build-vision/SKILL.md +192 -0
  190. package/skills/build-vision/references/proto-readiness-rubric.md +48 -0
  191. package/skills/build-vision/references/vision-interview-protocol.md +48 -0
  192. package/skills/coder/SKILL.md +204 -0
  193. package/skills/decompose-to-changes/SKILL.md +176 -0
  194. package/skills/decompose-to-changes/agents/openai.yaml +4 -0
  195. package/skills/decompose-to-changes/references/decomposition-protocol.md +278 -0
  196. package/skills/prompt2proto/SKILL.md +157 -0
  197. package/skills/prompt2proto/agents/openai.yaml +4 -0
  198. package/skills/prompt2proto/references/00_role_philosophy_engine.md +96 -0
  199. package/skills/prompt2proto/references/01_input_contract.md +53 -0
  200. package/skills/prompt2proto/references/02_prompt_pack_readiness.md +50 -0
  201. package/skills/prompt2proto/references/03_visual_translation_workflow.md +64 -0
  202. package/skills/prompt2proto/references/04_output_contract.md +67 -0
  203. package/skills/prompt2proto/references/05_quality_rubric.md +46 -0
  204. package/skills/proto2html/SKILL.md +136 -0
  205. package/skills/proto2html/agents/openai.yaml +4 -0
  206. package/skills/proto2html/references/proto2html-protocol.md +115 -0
  207. package/skills/run-team/SKILL.md +4 -0
  208. package/skills/select-change/SKILL.md +200 -0
  209. package/skills/select-change/agents/openai.yaml +4 -0
  210. package/skills/select-change/references/selection-protocol.md +281 -0
  211. package/skills/tune-prototype/SKILL.md +121 -0
  212. package/skills/tune-prototype/agents/openai.yaml +4 -0
  213. package/skills/tune-prototype/references/refined-prompt-pack-protocol.md +161 -0
@@ -0,0 +1,159 @@
1
+ # Planning Skill Runtime Exposure Boundary
2
+
3
+ This reference defines the accepted design-only boundary for exposing planning
4
+ skills such as `decompose-to-changes`, `analyze-changes`, and `select-change`
5
+ through OpenWorkflow runtime and generated adapter surfaces.
6
+
7
+ It implements the approved `C004` Option B path. It does not authorize runtime
8
+ registry, artifact registry, adapter generation, or generated-surface changes.
9
+
10
+ ## Purpose
11
+
12
+ Planning skills are currently repo-local dogfood skills. They operate on
13
+ durable planning artifacts under `changes/<plan_id>/` and are useful before the
14
+ formal `.openworkflow` spec/change/team chain is fully instantiated.
15
+
16
+ Runtime exposure is valuable only if it preserves three boundaries:
17
+
18
+ - source skills remain implementation-independent planning behavior;
19
+ - core owns semantic workflow and artifact contracts;
20
+ - adapters own platform-specific delivery and generated files.
21
+
22
+ ## Authority Boundaries
23
+
24
+ ### Core Semantic Registry
25
+
26
+ Core may define semantic command or capability names, command scope, allowed
27
+ outputs, forbidden outputs, handoff behavior, and artifact contract metadata.
28
+
29
+ Core must not contain Codex-specific paths, frontmatter rules, generated file
30
+ names, or skill invocation syntax.
31
+
32
+ ### Artifact Contracts
33
+
34
+ Artifact contracts may define source-of-truth files, required fields, summary
35
+ policies, current pointers, and read-order expectations.
36
+
37
+ Planning artifacts must stay summary-first. Default low-context read models
38
+ should consume `SUMMARY.yaml`, current slices, or compact indexes before full
39
+ candidate queues.
40
+
41
+ ### Adapter Delivery
42
+
43
+ Adapters own generated skill files, platform metadata, frontmatter, file layout,
44
+ manifest entries, and drift checks for their platform.
45
+
46
+ The Codex adapter may generate `.agents/skills/ow-*` surfaces only from source
47
+ registries and templates. Generated files must not be hand-edited to prove a
48
+ behavior change.
49
+
50
+ ### Generated Surfaces
51
+
52
+ Generated `.agents/**`, `.openworkflow/**`, and managed `AGENTS.md` sections are
53
+ outputs. Product behavior changes must land in source registries, artifact
54
+ contracts, templates, validators, or references first, then be regenerated with
55
+ `openworkflow sync`.
56
+
57
+ ### Source Skills
58
+
59
+ Source skills under `skills/` remain the dogfood implementation references
60
+ until runtime exposure is accepted. Their behavior can be promoted only through
61
+ explicit, validated source contracts.
62
+
63
+ ## Runtime Exposure Invariants
64
+
65
+ - One source of truth per behavior: source skill, core command, artifact
66
+ contract, and adapter template must not each define competing semantics.
67
+ - Runtime exposure must preserve repo-local delivery as the default trust
68
+ model.
69
+ - Every new generated surface needs parity or drift validation before it is
70
+ trusted.
71
+ - Planning queues are feat boundaries; selected candidates remain commit-sized
72
+ slices.
73
+ - Cross-queue analysis is advisory; selection remains inside one owning queue.
74
+ - High-risk candidates still require a decision report and explicit approved
75
+ option before implementation.
76
+
77
+ ## Approved Command Semantics
78
+
79
+ The accepted C010 direction is to promote the planning source skills to formal
80
+ OpenWorkflow semantic command ids:
81
+
82
+ - `/ow:decompose-to-changes`: creates, queries, and maintains one
83
+ `CANDIDATE_CHANGES.yaml` queue under `changes/<plan_id>/`. It owns planning
84
+ decomposition and queue maintenance, but it must not select a candidate or
85
+ implement code.
86
+ - `/ow:analyze-changes`: reads one or more candidate queues and writes advisory
87
+ `CHANGE_ANALYSIS.yaml` evidence. It recommends the next plan id and candidate
88
+ id, including high-risk stop recommendations, but it must not mutate queues,
89
+ select candidates, or authorize high-risk implementation.
90
+ - `/ow:select-change`: consumes a queue or explicit analysis recommendation and
91
+ writes `SELECTED_CHANGE.yaml`, `ATOM_TASKS.yaml`, and
92
+ `IMPLEMENTATION_BRIEF.md` for one commit-sized candidate. It must re-check
93
+ branch, dirty-tree, dependency, and high-risk gates before selection.
94
+
95
+ These command ids are core semantic decisions. Core owns the command names,
96
+ source-of-truth behavior boundaries, required and forbidden context, output
97
+ contracts, and high-risk gates.
98
+
99
+ The C011 generated-surface follow-up delivers these command ids through Codex
100
+ repo-local skills generated from the command registry. Source skills remain the
101
+ behavior references for the planning protocols; generated `.agents/skills/ow-*`
102
+ surfaces must stay derived from source registries and templates.
103
+
104
+ ## Read-Model Expectations
105
+
106
+ Planning runtime exposure must not load full planning history by default.
107
+
108
+ Default read models should prefer:
109
+
110
+ 1. `.openworkflow/CURRENT_STATE.yaml` for active pointers.
111
+ 2. `SUMMARY.yaml` for each active planning queue.
112
+ 3. `CHANGE_ANALYSIS.yaml` when a cross-queue decision is being consumed.
113
+ 4. `SELECTED_CHANGE.yaml` and `ATOM_TASKS.yaml` for the selected candidate.
114
+ 5. Full `CANDIDATE_CHANGES.yaml` only when selection, queue maintenance, or
115
+ audit requires source truth.
116
+
117
+ `references/planning-artifact-contracts.md` defines the planning artifact
118
+ registration roles and minimum summary fields. Runtime exposure work must
119
+ depend on that registration contract before adding command, adapter, or
120
+ generated-surface behavior.
121
+
122
+ ## Follow-Up Candidate Split
123
+
124
+ Future runtime exposure should be split into smaller candidates:
125
+
126
+ - `C009`: define planning artifact registration and summary/read-model
127
+ contract. Complete when limited to contract/reference design.
128
+ - `C010`: add command or capability registry semantics without adapter
129
+ generation. High risk until a specific registry boundary is approved.
130
+ - `C011`: add Codex adapter generation for accepted planning surfaces. Complete
131
+ for Codex repo-local delivery of DTC, AC, and SC generated skills.
132
+ - `C012`: add runtime-surface and agent e2e verification fixtures. Medium risk
133
+ when it only verifies existing source behavior; high risk if it changes
134
+ generated surfaces.
135
+ - `C013`: reassess full `C004` runtime exposure after the smaller candidates
136
+ prove boundaries.
137
+
138
+ ## Validation Gates
139
+
140
+ Every follow-up must run:
141
+
142
+ - `npm run validate`
143
+ - `git diff --check`
144
+
145
+ Runtime or generated-surface follow-ups must also run:
146
+
147
+ - `node dist/cli/src/index.js sync --root . --tools codex --json`
148
+ - `node dist/cli/src/index.js doctor --root . --tools codex --json`
149
+ - `npm run verify:runtime-surface`
150
+ - `npm run verify:agent-e2e`
151
+
152
+ ## Non-Goals
153
+
154
+ - No runtime command registry changes in the design-only boundary.
155
+ - No artifact registry changes in the design-only boundary.
156
+ - No adapter generation changes in the design-only boundary.
157
+ - No generated `.agents/**`, `.openworkflow/**`, or `AGENTS.md` edits in the
158
+ design-only boundary.
159
+ - No remote git or GitHub mutation.
@@ -0,0 +1,217 @@
1
+ # Proto Redesign Artifact Contracts
2
+
3
+ This reference defines the artifact vocabulary for the image-first `/ow:proto`
4
+ redesign. It is intentionally source-level: it does not change command runtime,
5
+ generated adapter surfaces, or validation command visibility.
6
+
7
+ ## Scope
8
+
9
+ The redesigned proto flow has two prompt-producing modes:
10
+
11
+ - `strategic_proto_prompt_pack`: first-pass prompts generated from product
12
+ vision and optional validation evidence.
13
+ - `refined_proto_prompt_pack`: screen-bound refinement prompts generated from
14
+ baseline prototype output, the original prompt pack, and a tune request.
15
+
16
+ Review and decision evidence is recorded separately so prototype exploration
17
+ does not become hidden production implementation.
18
+
19
+ ## Input Policy
20
+
21
+ ### VISION-Only Input
22
+
23
+ `/ow:proto` may proceed from vision-only input when no validation artifact
24
+ exists. In that mode it must:
25
+
26
+ - state that validation evidence is absent
27
+ - extract the core product uncertainty from the vision
28
+ - generate strategic prototype directions, not implementation tasks
29
+ - avoid pretending that a validation decision has already happened
30
+
31
+ ### Validation Present
32
+
33
+ When `VALIDATION.yaml` and `PROTOTYPE_BRIEF.md` are present, `/ow:proto` must:
34
+
35
+ - preserve the validation core question
36
+ - keep validation include and exclude scope as hard prototype boundaries
37
+ - use validation acceptance as evidence questions
38
+ - avoid broadening into later or supporting features unless the validation
39
+ artifact explicitly includes them
40
+
41
+ ### Automatic Validation
42
+
43
+ Automatic validation after vision creation is a separate future change. This
44
+ contract only defines how proto consumes validation when it exists and how proto
45
+ falls back when it does not.
46
+
47
+ ## Validation Consumption Policy
48
+
49
+ `/ow:proto` treats validation as decision context, not as a mandatory gate.
50
+ The active policy is `optional_explicit_validation`:
51
+
52
+ - If `VISION.md` or a vision contract exists and validation artifacts are
53
+ absent, proto may proceed in `vision_only` mode.
54
+ - If validation artifacts exist, proto must consume them and preserve their
55
+ boundaries.
56
+ - If the user explicitly asks to skip validation, proto may proceed in
57
+ `vision_only` mode and record that validation was skipped.
58
+ - If the vision is too vague to identify a product uncertainty, proto should
59
+ stop and ask for vision clarification instead of manufacturing validation.
60
+ - Automatic validation derivation after vision creation is allowed only as a
61
+ future feature behind a separate selected change.
62
+
63
+ ### Input Priority
64
+
65
+ When inputs disagree, apply this priority:
66
+
67
+ 1. Latest explicit user instruction.
68
+ 2. Accepted validation decision or prototype brief.
69
+ 3. Vision contract and non-goals.
70
+ 4. Current session constraints.
71
+ 5. Conservative product inference.
72
+
73
+ Validation artifacts should narrow prototype scope. They should not silently add
74
+ features that the vision excludes.
75
+
76
+ ### Required Policy Fields
77
+
78
+ Every proto prompt pack should record:
79
+
80
+ - `validation_input.mode`: `vision_only`, `validation_present`, or
81
+ `internally_derived`
82
+ - `validation_input.refs`: source validation artifact refs, if any
83
+ - `validation_input.notes`: concise explanation of missing, skipped, or
84
+ consumed validation context
85
+
86
+ Use `internally_derived` only after a future feature explicitly implements that
87
+ behavior. Until then, the value is reserved for compatibility.
88
+
89
+ ### Behavior Matrix
90
+
91
+ | Situation | Proto behavior | Required note |
92
+ |---|---|---|
93
+ | Vision exists, validation missing | Proceed from vision | `validation_input.mode: vision_only` |
94
+ | Vision exists, user skips validation | Proceed from vision | Note explicit skip |
95
+ | Validation and prototype brief exist | Consume validation | `validation_input.mode: validation_present` |
96
+ | Validation conflicts with vision | Stop for decision | Name the conflict |
97
+ | Vision too vague | Stop for clarification | Name missing vision facts |
98
+ | User asks to auto-validate | Create follow-up change | Do not silently auto-trigger |
99
+
100
+ ## Strategic Proto Prompt Pack
101
+
102
+ Purpose: convert a product vision into multiple high-fidelity prototype prompt
103
+ directions grounded in distinct strategic hypotheses.
104
+
105
+ Required sections:
106
+
107
+ - `source`: vision, optional validation refs, constraints, target tool, target
108
+ language, requested direction count
109
+ - `normalized_input`: domain, primary user, core pain, behavior change, success
110
+ signal, differentiator, non-goals, trust or privacy constraints
111
+ - `strategic_core`: target user, behavior change, mechanism, differentiator,
112
+ boundary conditions, central uncertainty
113
+ - `directions`: one entry per strategic prototype direction
114
+ - `build_recommendation`: first direction to generate and why
115
+ - `review_plan`: success signals, failure signals, and next test
116
+ - `negative_constraints`: what the generated prototype must not imply
117
+
118
+ Each direction requires:
119
+
120
+ - `direction_id`
121
+ - `name`
122
+ - `strategic_hypothesis`
123
+ - `validates`
124
+ - `main_risk`
125
+ - `prototype_prompt`
126
+ - `pm_judgment`
127
+
128
+ Prototype prompts should specify screens, journey, interactions, AI or system
129
+ behavior, trust/privacy controls, visual direction, anti-goals, and concrete
130
+ sample content.
131
+
132
+ ## Refined Proto Prompt Pack
133
+
134
+ Purpose: convert baseline prototype screens and a tune request into
135
+ screen-bound prompts for the next generation pass while preserving product
136
+ system intent.
137
+
138
+ Required sections:
139
+
140
+ - `source`: baseline screens, baseline prompt, product vision, tune request,
141
+ target form factor, locked elements, regeneration scope
142
+ - `baseline_audit`: screen ids, journey stages, user goals, visible components,
143
+ system states, product features, trust boundaries, visual cues
144
+ - `product_system`: product thesis, primary loop, interaction model,
145
+ information architecture, design language, component vocabulary, copy style,
146
+ trust and boundary system, anti-goals
147
+ - `delta_rules`: `must_inherit`, `must_add`, `must_remove`, `flexible_change`
148
+ - `screen_manifest`: target screen ids, source mappings, generation order
149
+ - `global_design_prompt`
150
+ - `screen_prompts`
151
+ - `negative_prompt`
152
+ - `acceptance_checklist`
153
+
154
+ Each screen prompt requires:
155
+
156
+ - `prompt_id`
157
+ - `target_screen_id`
158
+ - `source_screen_ids`
159
+ - `screen_name`
160
+ - `strategic_purpose`
161
+ - `user_goal`
162
+ - `system_state`
163
+ - `canvas`
164
+ - `must_inherit`
165
+ - `must_add`
166
+ - `must_remove`
167
+ - `flexible_changes`
168
+ - `layout_structure`
169
+ - `required_components`
170
+ - `required_copy`
171
+ - `interaction_states`
172
+ - `system_behavior`
173
+ - `trust_privacy_safety`
174
+ - `visual_style_rules`
175
+ - `negative_constraints`
176
+ - `desired_user_feeling`
177
+ - `acceptance_criteria`
178
+
179
+ ## Review Evidence
180
+
181
+ Prototype review evidence should record:
182
+
183
+ - generated artifact refs
184
+ - source prompt pack refs
185
+ - selected direction or screen ids
186
+ - user feedback
187
+ - accepted elements
188
+ - rejected elements
189
+ - tune requests
190
+ - recommendation: `continue`, `tune`, `pivot`, `stop`, or `needs_more_evidence`
191
+ - follow-up candidate ids when available
192
+
193
+ Review evidence may refer to generated images, screenshots, or design tool
194
+ outputs, but it should not embed large binary artifacts.
195
+
196
+ ## Decision Handoff
197
+
198
+ After first-pass proto generation:
199
+
200
+ - if one direction is accepted, hand off to tune or design/spec planning
201
+ - if the direction is promising but not sufficient, create a refined prompt pack
202
+ - if no direction validates the product uncertainty, revisit vision or
203
+ validation
204
+
205
+ After tune generation:
206
+
207
+ - accepted improvements become `must_inherit` in the next tune pass
208
+ - rejected elements become negative constraints
209
+ - production implementation must wait for an explicit selected change or spec
210
+
211
+ ## Non-Goals
212
+
213
+ - Do not generate production implementation tasks from prompt packs.
214
+ - Do not add `/ow:proto2html`.
215
+ - Do not remove or internalize `ow:validation`.
216
+ - Do not expose runtime command or adapter surfaces from this contract.
217
+ - Do not hand-edit generated `.agents/` or `.openworkflow/` surfaces.
@@ -0,0 +1,113 @@
1
+ # Proto2html Artifact Contracts
2
+
3
+ This reference defines the artifact vocabulary for `/ow:proto2html`. It is a
4
+ contract-only change: it does not add a command, source skill, generated
5
+ adapter surface, or HTML implementation.
6
+
7
+ ## Purpose
8
+
9
+ `/ow:proto2html` converts an accepted benchmark prototype image or accepted
10
+ screen group into one HTML reconstruction. It is a fidelity reconstruction
11
+ step, not product exploration.
12
+
13
+ The command boundary is intentionally narrow:
14
+
15
+ - Input: accepted benchmark image evidence, source prompt lineage, and relevant
16
+ prototype review notes.
17
+ - Output: one local HTML prototype plus structured fidelity evidence.
18
+ - Handoff: a locked HTML prototype that can later feed `/ow:html2spec`.
19
+
20
+ ## Source Of Truth
21
+
22
+ The source artifact is:
23
+
24
+ ```text
25
+ .openworkflow/html-prototypes/<id>/HTML_PROTOTYPE.yaml
26
+ ```
27
+
28
+ Supporting evidence lives next to it:
29
+
30
+ ```text
31
+ .openworkflow/html-prototypes/<id>/
32
+ HTML_PROTOTYPE.yaml
33
+ prototype.html
34
+ FIDELITY_REPORT.yaml
35
+ screenshots/
36
+ SUMMARY.yaml
37
+ ```
38
+
39
+ `HTML_PROTOTYPE.yaml` is the compact source of truth. `prototype.html`,
40
+ screenshots, and visual diffs are evidence refs, not embedded YAML content.
41
+
42
+ ## Required Input
43
+
44
+ Proto2html must start from accepted prototype evidence. At least one benchmark
45
+ source is required:
46
+
47
+ - accepted benchmark image path
48
+ - accepted generated image set with selected benchmark id
49
+ - accepted baseline screen group
50
+ - accepted refined prompt pack with generated image refs
51
+
52
+ The input record must preserve:
53
+
54
+ - source prototype evidence ref
55
+ - source prompt pack ref, when available
56
+ - benchmark image or screen refs
57
+ - decision or review evidence that accepted the benchmark
58
+ - reconstruction scope
59
+ - explicit exclusions
60
+
61
+ If no accepted benchmark evidence exists, proto2html should stop and return to
62
+ `/ow:proto` or `/ow:tune`.
63
+
64
+ ## HTML Output
65
+
66
+ The output contract describes one single-file HTML reconstruction:
67
+
68
+ - `html_artifact.path`: local path to `prototype.html`
69
+ - `html_artifact.type`: `single_file_html`
70
+ - `html_artifact.entrypoint`: relative path opened for review
71
+ - `render_targets`: viewport targets used for reconstruction
72
+ - `implementation_notes`: reconstruction choices that affect fidelity
73
+
74
+ The HTML artifact should be reviewable locally and should not become a
75
+ production app. Application architecture, persistence, auth, backend APIs, and
76
+ deployment config are out of scope.
77
+
78
+ ## Fidelity Evidence
79
+
80
+ Fidelity evidence records how closely the HTML reconstruction matches the
81
+ accepted benchmark:
82
+
83
+ - benchmark refs
84
+ - rendered screenshot refs
85
+ - visual comparison notes
86
+ - matched elements
87
+ - fidelity gaps
88
+ - browser or rendering checks
89
+ - known limits
90
+
91
+ Fidelity gaps should be actionable and bounded. They should explain whether the
92
+ gap is acceptable for spec extraction or requires another reconstruction pass.
93
+
94
+ ## Decision And Handoff
95
+
96
+ The artifact result should be one of:
97
+
98
+ - `accepted`: HTML is good enough to lock for spec extraction.
99
+ - `needs_reconstruction`: HTML needs another proto2html pass.
100
+ - `return_to_tune`: benchmark image is not stable enough.
101
+ - `blocked`: required benchmark or rendering evidence is missing.
102
+
103
+ The normal accepted handoff is `/ow:html2spec`.
104
+
105
+ ## Non-Goals
106
+
107
+ - Do not explore new product directions.
108
+ - Do not generate new prototype images.
109
+ - Do not tune the visual concept; return to `/ow:tune` for that.
110
+ - Do not create engineering specs.
111
+ - Do not create production implementation tasks.
112
+ - Do not add `/ow:proto2html` runtime command or adapter surfaces from this
113
+ contract-only change.
@@ -0,0 +1,198 @@
1
+ # Skill System Lifecycle
2
+
3
+ This reference defines OpenWorkflow's native skill format and lifecycle. It is
4
+ the read-first contract for future changes that edit skill generation, adapter
5
+ delivery, generated-surface validation, or runtime command exposure.
6
+
7
+ ## Format Contract
8
+
9
+ An OpenWorkflow runtime skill is a Markdown skill file with YAML frontmatter and
10
+ XML-like semantic blocks. It is not a full XML document and must not be wrapped
11
+ in a top-level `<skill>` element.
12
+
13
+ Current generated Codex runtime skills follow this shape:
14
+
15
+ ```md
16
+ ---
17
+ name: "ow-proto"
18
+ description: "Create image-first strategic prototype prompt packs..."
19
+ ---
20
+ <!-- generated-by: openworkflow; adapter: codex; adapter-version: 0.1.0; template-id: codex.skill.ow.proto -->
21
+ # /ow:proto
22
+
23
+ <user_behavior>
24
+ ...
25
+ </user_behavior>
26
+
27
+ <agent_protocol>
28
+ ...
29
+ </agent_protocol>
30
+
31
+ <codex_skill>
32
+ ...
33
+ </codex_skill>
34
+ ```
35
+
36
+ The frontmatter is for agent discovery. The Markdown heading and prose are for
37
+ human and agent readability. The XML-like blocks are for stable agent protocol
38
+ boundaries.
39
+
40
+ ## Frontmatter Policy
41
+
42
+ Required fields for generated runtime skills:
43
+
44
+ - `name`: the repo-local skill name, such as `ow-proto`
45
+ - `description`: short invocation guidance for the target agent platform
46
+ - `metadata`: generated identity fields, including generator name, adapter id,
47
+ adapter version, template id, source command id, semantic trigger, and skill
48
+ name
49
+
50
+ Source skills under `skills/` may use their own frontmatter as required by the
51
+ skill authoring system, but source skills are not runtime `/ow:*` surfaces until
52
+ they are registered and generated through an adapter.
53
+
54
+ The generated marker remains the ownership signal used by sync and cleanup.
55
+ Structured metadata gives validators and agents a queryable identity layer, but
56
+ it does not replace the generated marker.
57
+
58
+ ## Protocol Blocks
59
+
60
+ OpenWorkflow uses XML-like blocks because they give agents low-context,
61
+ machine-locatable boundaries inside otherwise readable Markdown.
62
+
63
+ The block taxonomy is:
64
+
65
+ - `<user_behavior>`: visible-response behavior and interaction style for the command.
66
+ - `<agent_protocol>`: private command protocol. Agents must not quote or expose this block as routine output.
67
+ - `<source_of_truth>`: durable state root, currently `.openworkflow/`.
68
+ - `<stage>` and `<command_visibility>`: lifecycle stage and user/internal command visibility.
69
+ - `<interaction_mode>`: command-specific mode, such as conversation-first or image-first.
70
+ - `<inner_thinking>`: private reasoning guardrails. This block authorizes private classification and scope checks, not disclosure of chain of thought.
71
+ - `<required_context>`: files or indexes that must be loaded before acting.
72
+ - `<optional_context>`: files that may be loaded only when summaries or required context are insufficient.
73
+ - `<forbidden_context>`: paths that should not be loaded for this command.
74
+ - `<allowed_outputs>`: durable outputs the command may create or update.
75
+ - `<conditional_outputs>`: outputs allowed only under named conditions.
76
+ - `<artifact_contracts>`: compact artifact contracts relevant to the command.
77
+ - `<forbidden_outputs>`: outputs the command must not create.
78
+ - `<audit_checkpoints>`: before, during, and after checks that keep the workflow trustworthy.
79
+ - `<working_protocol>`: common execution rules for loading, acting, and narrowing scope.
80
+ - `<artifact_checkpoint>`: rules for when durable artifact writes are appropriate.
81
+ - `<anti_patterns>`: known behavior that should be rejected.
82
+ - `<handoff>` and `<handoff_commands>`: readiness and next-command boundaries.
83
+ - `<codex_skill>`: Codex adapter metadata that links the generated skill to the semantic command.
84
+
85
+ Blocks may contain Markdown lists or short prose. They are XML-like delimiters,
86
+ not an XML schema. Block contents should still escape literal `<`, `>`, and `&`
87
+ where generated content needs to be rendered inside another XML-like block.
88
+
89
+ ## Lifecycle
90
+
91
+ The source-of-truth chain is:
92
+
93
+ 1. `packages/core/src/commands/registry.ts` defines semantic `/ow:*` commands,
94
+ stages, visibility, target artifacts, and command protocols.
95
+ 2. `packages/core/src/artifacts/registry.ts` defines discovery artifact
96
+ contracts consumed by command generation and audit outputs.
97
+ 3. Adapter generators, currently under `packages/adapters/codex/src/`, render
98
+ repo-local runtime surfaces.
99
+ 4. `openworkflow init` and `openworkflow sync` write generated surfaces.
100
+ 5. Generated files are committed only after source changes and sync or init have
101
+ produced them.
102
+
103
+ Generated Codex surfaces include:
104
+
105
+ - `.agents/skills/ow-*/SKILL.md`
106
+ - `.agents/skills/ow-*/agents/openai.yaml`
107
+ - `.agents/openworkflow-adapter.yaml`
108
+ - `.openworkflow/audit/*`
109
+ - `AGENTS.md` managed content when onboarding guidance changes
110
+
111
+ Do not hand-edit generated surfaces to change product behavior. Update command
112
+ registries, artifact registries, adapter templates, schemas, validators, or
113
+ source skills, then regenerate.
114
+
115
+ ## Repo-Local Delivery
116
+
117
+ OpenWorkflow's default delivery is repo-local. Runtime skills live with the
118
+ repository so agents can consume the same workflow contract as the codebase.
119
+
120
+ OpenSpec's global Codex prompt installation model is useful as a reference for
121
+ adapter abstraction, but it is not the default OpenWorkflow model. OpenWorkflow
122
+ should not move `/ow:*` behavior into user-home prompt files because that would
123
+ weaken reproducibility, reviewability, and repository auditability.
124
+
125
+ Future adapter work may introduce delivery metadata such as skill-only,
126
+ command-only, or both. That metadata must keep repo-local delivery as the
127
+ default unless a future change explicitly accepts a different trust model.
128
+
129
+ ## Relationship To OpenSpec
130
+
131
+ The OpenSpec research produced useful lifecycle lessons:
132
+
133
+ - Template source and generated skill files should be separated.
134
+ - A central registry should list skills, command ids, directory names, and
135
+ delivery targets.
136
+ - Adapter-specific path and frontmatter rules should live behind adapter
137
+ boundaries.
138
+ - Generated files should carry version or generated metadata that supports
139
+ drift detection.
140
+ - Profile or delivery concepts can separate "which workflows exist" from "how
141
+ they are installed."
142
+
143
+ OpenWorkflow should not copy these parts directly:
144
+
145
+ - Markdown-only runtime skill protocols are too weak for OW's artifact and
146
+ handoff boundaries.
147
+ - Global Codex prompt installation does not match OW's repo-local audit model.
148
+ - File-existence-only drift checks are weaker than OW's command, artifact, and
149
+ audit contracts.
150
+ - Hardcoding all protocol text in one template layer would make artifact
151
+ contracts secondary; OW should keep command and artifact registries as the
152
+ primary source.
153
+
154
+ ## Static Skills And Dynamic Instructions
155
+
156
+ Runtime skills are static command contracts. They tell the agent what command
157
+ means, what context to load, what outputs are allowed, and when to hand off.
158
+
159
+ Dynamic artifact instructions are a separate possible layer. The design contract
160
+ is in `references/artifact-instruction-envelope.md`. If OW later adds an
161
+ OpenSpec-like instruction envelope, it should be generated for a specific
162
+ artifact or selected task and may use tags such as `<task>`, `<context>`,
163
+ `<rules>`, `<dependencies>`, `<output>`, `<template>`, and
164
+ `<success_criteria>`.
165
+
166
+ Dynamic instruction envelopes must never be copied into produced artifacts
167
+ unless the artifact contract explicitly asks for them. They are constraints for
168
+ the agent, not user-facing artifact content.
169
+
170
+ ## Drift And Validation Expectations
171
+
172
+ Future validation should be able to answer:
173
+
174
+ - Does every registered runtime command have the expected generated skill?
175
+ - Does every generated skill identify its command, adapter, and template?
176
+ - Do generated skills contain required frontmatter and protocol blocks?
177
+ - Do generated audit indexes match command and artifact registries?
178
+ - Does sync reproduce generated surfaces without manual patching?
179
+
180
+ Until structured generated metadata is added, the generated marker remains the
181
+ minimum ownership signal. Changes that touch runtime skills, adapter output, or
182
+ audit indexes should run repository validation and runtime-surface verification
183
+ when those commands are in scope.
184
+
185
+ ## Change Boundaries
186
+
187
+ Use this reference before selecting or implementing changes that touch:
188
+
189
+ - skill generation
190
+ - command registry exposure
191
+ - artifact contract registration
192
+ - adapter delivery
193
+ - generated-surface validation
194
+ - `.agents/**`
195
+ - `.openworkflow/audit/**`
196
+
197
+ Small documentation or source-skill changes do not need to regenerate runtime
198
+ surfaces unless they change the registered command or adapter output.