@tacuchi/agent-workflow-cli 20.26.0 → 21.1.0

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 (220) hide show
  1. package/README.md +2 -1
  2. package/dist/adapters/node-file-system.js +3 -0
  3. package/dist/adapters/node-file-system.js.map +1 -1
  4. package/dist/application/capability/compose.js +161 -0
  5. package/dist/application/capability/compose.js.map +1 -0
  6. package/dist/application/capability/descriptor-loader.js +109 -0
  7. package/dist/application/capability/descriptor-loader.js.map +1 -0
  8. package/dist/application/capability/design-handler.js +299 -0
  9. package/dist/application/capability/design-handler.js.map +1 -0
  10. package/dist/application/capability/dispatcher.js +312 -0
  11. package/dist/application/capability/dispatcher.js.map +1 -0
  12. package/dist/application/capability/durable-effect.js +220 -0
  13. package/dist/application/capability/durable-effect.js.map +1 -0
  14. package/dist/application/capability/installed-inventory.js +168 -0
  15. package/dist/application/capability/installed-inventory.js.map +1 -0
  16. package/dist/application/capability/readiness.js +204 -0
  17. package/dist/application/capability/readiness.js.map +1 -0
  18. package/dist/application/capability/resolution.js +264 -0
  19. package/dist/application/capability/resolution.js.map +1 -0
  20. package/dist/application/capability/wrapper.js +187 -0
  21. package/dist/application/capability/wrapper.js.map +1 -0
  22. package/dist/application/context/manifest.js +11 -5
  23. package/dist/application/context/manifest.js.map +1 -1
  24. package/dist/application/context/measure.js +5 -2
  25. package/dist/application/context/measure.js.map +1 -1
  26. package/dist/application/context/plan-service.js +6 -6
  27. package/dist/application/context/plan-service.js.map +1 -1
  28. package/dist/application/design/design-bundle-service.js +148 -0
  29. package/dist/application/design/design-bundle-service.js.map +1 -0
  30. package/dist/application/design/design-gate-service.js +246 -0
  31. package/dist/application/design/design-gate-service.js.map +1 -0
  32. package/dist/application/design/design-graph-service.js +85 -0
  33. package/dist/application/design/design-graph-service.js.map +1 -0
  34. package/dist/application/design/design-index-service.js +132 -0
  35. package/dist/application/design/design-index-service.js.map +1 -0
  36. package/dist/application/design/design-proposal-service.js +69 -0
  37. package/dist/application/design/design-proposal-service.js.map +1 -0
  38. package/dist/application/design/design-publish-service.js +756 -0
  39. package/dist/application/design/design-publish-service.js.map +1 -0
  40. package/dist/application/design/design-record-service.js +100 -0
  41. package/dist/application/design/design-record-service.js.map +1 -0
  42. package/dist/application/design/design-resolver-service.js +165 -0
  43. package/dist/application/design/design-resolver-service.js.map +1 -0
  44. package/dist/application/flow/advance.js +533 -0
  45. package/dist/application/flow/advance.js.map +1 -0
  46. package/dist/application/flow/flow-service.js +65 -0
  47. package/dist/application/flow/flow-service.js.map +1 -0
  48. package/dist/application/flow/run-projection.js +80 -0
  49. package/dist/application/flow/run-projection.js.map +1 -0
  50. package/dist/application/flow/run-state-service.js +107 -0
  51. package/dist/application/flow/run-state-service.js.map +1 -0
  52. package/dist/application/flow/submit.js +423 -0
  53. package/dist/application/flow/submit.js.map +1 -0
  54. package/dist/application/resume-service.js +46 -14
  55. package/dist/application/resume-service.js.map +1 -1
  56. package/dist/application/self/install-skill.js +11 -0
  57. package/dist/application/self/install-skill.js.map +1 -1
  58. package/dist/application/self/uninstall.js +21 -0
  59. package/dist/application/self/uninstall.js.map +1 -1
  60. package/dist/application/semantic-operation/protocol.js +18 -12
  61. package/dist/application/semantic-operation/protocol.js.map +1 -1
  62. package/dist/application/semantic-operation/publish.js +56 -9
  63. package/dist/application/semantic-operation/publish.js.map +1 -1
  64. package/dist/application/skills-resolver-service.js +27 -6
  65. package/dist/application/skills-resolver-service.js.map +1 -1
  66. package/dist/application/status-service.js +5 -1
  67. package/dist/application/status-service.js.map +1 -1
  68. package/dist/application/workline-index-service.js +6 -0
  69. package/dist/application/workline-index-service.js.map +1 -1
  70. package/dist/application/workspace-init-service.js +22 -2
  71. package/dist/application/workspace-init-service.js.map +1 -1
  72. package/dist/cli/commands/capability.js +182 -0
  73. package/dist/cli/commands/capability.js.map +1 -0
  74. package/dist/cli/commands/designs.js +110 -0
  75. package/dist/cli/commands/designs.js.map +1 -0
  76. package/dist/cli/commands/flow.js +71 -0
  77. package/dist/cli/commands/flow.js.map +1 -0
  78. package/dist/cli/commands/index.js +6 -0
  79. package/dist/cli/commands/index.js.map +1 -1
  80. package/dist/cli/commands/resume.js +8 -0
  81. package/dist/cli/commands/resume.js.map +1 -1
  82. package/dist/cli/commands/skills.js +55 -2
  83. package/dist/cli/commands/skills.js.map +1 -1
  84. package/dist/cli/commands/status.js +50 -0
  85. package/dist/cli/commands/status.js.map +1 -1
  86. package/dist/cli/help-groups.js +9 -0
  87. package/dist/cli/help-groups.js.map +1 -1
  88. package/dist/cli/parser.js +7 -0
  89. package/dist/cli/parser.js.map +1 -1
  90. package/dist/cli/tui/data/workflow-content.js +5 -0
  91. package/dist/cli/tui/data/workflow-content.js.map +1 -1
  92. package/dist/cli/tui/tabs/workflow-tab.js +5 -1
  93. package/dist/cli/tui/tabs/workflow-tab.js.map +1 -1
  94. package/dist/domain/capability/descriptor.js +553 -0
  95. package/dist/domain/capability/descriptor.js.map +1 -0
  96. package/dist/domain/capability/effects.js +90 -0
  97. package/dist/domain/capability/effects.js.map +1 -0
  98. package/dist/domain/capability/protocol.js +494 -0
  99. package/dist/domain/capability/protocol.js.map +1 -0
  100. package/dist/domain/contract-reader.js +84 -0
  101. package/dist/domain/contract-reader.js.map +1 -0
  102. package/dist/domain/design/adapter.js +161 -0
  103. package/dist/domain/design/adapter.js.map +1 -0
  104. package/dist/domain/design/artifact-body.js +223 -0
  105. package/dist/domain/design/artifact-body.js.map +1 -0
  106. package/dist/domain/design/artifact.js +750 -0
  107. package/dist/domain/design/artifact.js.map +1 -0
  108. package/dist/domain/design/baseline.js +359 -0
  109. package/dist/domain/design/baseline.js.map +1 -0
  110. package/dist/domain/design/capability.js +310 -0
  111. package/dist/domain/design/capability.js.map +1 -0
  112. package/dist/domain/design/closure.js +161 -0
  113. package/dist/domain/design/closure.js.map +1 -0
  114. package/dist/domain/design/direct.js +108 -0
  115. package/dist/domain/design/direct.js.map +1 -0
  116. package/dist/domain/design/external-send.js +65 -0
  117. package/dist/domain/design/external-send.js.map +1 -0
  118. package/dist/domain/design/governance.js +298 -0
  119. package/dist/domain/design/governance.js.map +1 -0
  120. package/dist/domain/design/identity.js +145 -0
  121. package/dist/domain/design/identity.js.map +1 -0
  122. package/dist/domain/design/manifest.js +552 -0
  123. package/dist/domain/design/manifest.js.map +1 -0
  124. package/dist/domain/design/maturity.js +305 -0
  125. package/dist/domain/design/maturity.js.map +1 -0
  126. package/dist/domain/design/naming.js +117 -0
  127. package/dist/domain/design/naming.js.map +1 -0
  128. package/dist/domain/design/offline.js +92 -0
  129. package/dist/domain/design/offline.js.map +1 -0
  130. package/dist/domain/design/profiles.js +212 -0
  131. package/dist/domain/design/profiles.js.map +1 -0
  132. package/dist/domain/design/projections.js +165 -0
  133. package/dist/domain/design/projections.js.map +1 -0
  134. package/dist/domain/design/proposal.js +234 -0
  135. package/dist/domain/design/proposal.js.map +1 -0
  136. package/dist/domain/design/reference.js +234 -0
  137. package/dist/domain/design/reference.js.map +1 -0
  138. package/dist/domain/design/render-bundle.js +0 -0
  139. package/dist/domain/design/render-bundle.js.map +1 -0
  140. package/dist/domain/design/rendition.js +472 -0
  141. package/dist/domain/design/rendition.js.map +1 -0
  142. package/dist/domain/design/retired.js +61 -0
  143. package/dist/domain/design/retired.js.map +1 -0
  144. package/dist/domain/design/revision.js +219 -0
  145. package/dist/domain/design/revision.js.map +1 -0
  146. package/dist/domain/design/secrets.js +86 -0
  147. package/dist/domain/design/secrets.js.map +1 -0
  148. package/dist/domain/design/sources.js +180 -0
  149. package/dist/domain/design/sources.js.map +1 -0
  150. package/dist/domain/design/validation.js +19 -0
  151. package/dist/domain/design/validation.js.map +1 -0
  152. package/dist/domain/design/visual-evidence.js +155 -0
  153. package/dist/domain/design/visual-evidence.js.map +1 -0
  154. package/dist/domain/design/yaml-subset.js +390 -0
  155. package/dist/domain/design/yaml-subset.js.map +1 -0
  156. package/dist/domain/flow/answer.js +459 -0
  157. package/dist/domain/flow/answer.js.map +1 -0
  158. package/dist/domain/flow/authority.js +2276 -0
  159. package/dist/domain/flow/authority.js.map +1 -0
  160. package/dist/domain/flow/authorization.js +62 -0
  161. package/dist/domain/flow/authorization.js.map +1 -0
  162. package/dist/domain/flow/directive.js +421 -0
  163. package/dist/domain/flow/directive.js.map +1 -0
  164. package/dist/domain/flow/rules.js +140 -0
  165. package/dist/domain/flow/rules.js.map +1 -0
  166. package/dist/domain/flow/run-state.js +317 -0
  167. package/dist/domain/flow/run-state.js.map +1 -0
  168. package/dist/domain/harnesses.js +21 -0
  169. package/dist/domain/harnesses.js.map +1 -1
  170. package/dist/domain/safe-path.js +23 -0
  171. package/dist/domain/safe-path.js.map +1 -0
  172. package/dist/domain/skills.js +26 -3
  173. package/dist/domain/skills.js.map +1 -1
  174. package/package.json +1 -1
  175. package/skills/w/SKILL.md +15 -13
  176. package/skills/w/artifacts/README.md +3 -4
  177. package/skills/w/artifacts/artifacts-core/CHECKPOINT.md +2 -2
  178. package/skills/w/commands/plan-exec.md +11 -5
  179. package/skills/w/commands/plan-new.md +6 -2
  180. package/skills/w/commands/plan-refine.md +6 -3
  181. package/skills/w/commands/quick.md +2 -2
  182. package/skills/w/commands/spec-new.md +2 -2
  183. package/skills/w/commands/spec-refine.md +1 -0
  184. package/skills/w/context/MANIFEST.json +57 -9
  185. package/skills/w/harness/HARNESS.md +20 -0
  186. package/skills/w/loops/CHASSIS.md +11 -20
  187. package/skills/w/loops/CODE-POLICIES.md +18 -9
  188. package/skills/w/loops/README.md +1 -1
  189. package/skills/w/loops/plan-exec-loop/LOOP.md +126 -62
  190. package/skills/w/loops/plan-new-loop/LOOP.md +71 -73
  191. package/skills/w/loops/plan-refine-loop/LOOP.md +20 -10
  192. package/skills/w/loops/quick-loop/LOOP.md +18 -26
  193. package/skills/w/loops/spec-refine-loop/LOOP.md +28 -30
  194. package/skills/w/modules/COMPACTION.md +2 -6
  195. package/skills/w/modules/DB-SCRIPTS-ONLY.md +2 -0
  196. package/skills/w/modules/DESIGN-REFERENCES.md +113 -0
  197. package/skills/w/modules/IDEATION-GATE.md +3 -3
  198. package/skills/w/modules/PERSIST-ROUTING.md +1 -0
  199. package/skills/w/modules/PLAN-EXECUTION-BATCHES.md +65 -0
  200. package/skills/w/modules/PLAN-INPUT.md +5 -3
  201. package/skills/w/modules/PLAN-REFINE-SPLIT.md +3 -1
  202. package/skills/w/modules/PLAN-SPLIT-GATE.md +7 -5
  203. package/skills/w/modules/PROMPT-CONTINUITY.md +3 -1
  204. package/skills/w/modules/SPEC-CHANGE-SHAPE.md +4 -4
  205. package/skills/w/roles/README.md +9 -5
  206. package/skills/w/roles/design/CONTRACT.md +80 -0
  207. package/skills/w/roles/design/ROLE.md +224 -0
  208. package/skills/w/schemas/capability-descriptor.schema.json +260 -0
  209. package/skills/w/schemas/design/design-baseline.v1.schema.json +71 -0
  210. package/skills/w/schemas/design/design-manifest.v1.schema.json +322 -0
  211. package/skills/w/schemas/design/design-render-bundle.v1.schema.json +191 -0
  212. package/skills/w/schemas/design/design-rendition.v1.schema.json +232 -0
  213. package/skills/w/schemas/design/design-review.v1.schema.json +72 -0
  214. package/skills/w/schemas/design/design-revocation.v1.schema.json +54 -0
  215. package/skills/w/schemas/design/ui-flow.v1.schema.json +211 -0
  216. package/skills/w/schemas/design/ui-screen.v1.schema.json +242 -0
  217. package/skills/w/artifacts/artifacts-design/SPEC.md +0 -42
  218. package/skills/w/modules/PLAN-DESIGN-SPECS.md +0 -12
  219. package/skills/w/modules/PLAN-REFINE-DESIGN-SPECS.md +0 -7
  220. package/skills/w/roles/ui-spec/ROLE.md +0 -147
@@ -0,0 +1,80 @@
1
+ # design — invocation contract
2
+
3
+ The single authority for **how** `design` is invoked. The installed wrapper
4
+ (`design/SKILL.md`) and [`ROLE.md`](ROLE.md) both point here instead of
5
+ restating it: two descriptions of one contract disagree the day either changes.
6
+
7
+ The machine-readable form is the descriptor published next to the wrapper
8
+ (`workline-capability.json`, schema `../../schemas/capability-descriptor.schema.json`).
9
+ This file is what a person or a loop reads.
10
+
11
+ ## One door, four stages
12
+
13
+ ```
14
+ aw capability prepare --capability design --operation <op> [--input k=v ...]
15
+ aw capability continue # stdin: {"parent": <request>}
16
+ aw capability validate # stdin: {"request": …, "answer": …}
17
+ aw capability apply --approval <digest> # stdin: {"request": …, "plan": …}
18
+ ```
19
+
20
+ The verbs are **stages**, never operations: the operation travels in the
21
+ envelope. Every attempt returns `outcome`, `output` and `receipt`. A
22
+ `needs_input` is answered with `continue`, which builds the NEXT attempt of the
23
+ same `invocation_id` — it never reuses the previous request.
24
+
25
+ ## What each caller may invoke
26
+
27
+ | Caller | Operations | Then |
28
+ |---|---|---|
29
+ | direct wrapper | all five | converses in the host; opens no flow session or document |
30
+ | SPEC REFINE | `create` · `update` · `validate` | keeps its own questions, gate and publication |
31
+ | PLAN NEW · PLAN REFINE | `update` · `validate` | closes its plan over the revision it references |
32
+ | PLAN EXEC · QUICK | `validate` | **consumes** the package inside its own lifecycle |
33
+
34
+ There is no sixth `consume` operation: consuming is what a flow DOES with a
35
+ validated package, not something it asks the capability to do. An operation
36
+ outside its row is refused, never improvised. A flow may add gates of its own and
37
+ may never lower one the capability already failed; a durable output produced
38
+ through the direct route is adopted later **by exact reference** — same identity,
39
+ revision and digest — with no recreation and no format conversion.
40
+
41
+ ## Sources, and what an omission costs
42
+
43
+ The v1 catalog: Markdown or text, images and screenshots, PDF, DOCX, PPTX, host
44
+ context or attachments, an existing package, and provider locators. Binary
45
+ documents are read by the **host's** multimodal capability — no parser ships in
46
+ the CLI — so what the catalog declares is what the domain can account for.
47
+
48
+ Every source ends in one of five dispositions, and each one that is not `used`
49
+ carries its reason: `used` · `skipped` (a decision) · `unsupported` (a format v1
50
+ never promised, every retired UI format included) · `unavailable` (it should
51
+ have been readable and was not) · `redacted` (withheld on purpose).
52
+
53
+ The consequence is fail-closed: a source that did not contribute blocks
54
+ `handoff` unless someone states, in writing, why the design does not need it. A
55
+ run that silently dropped a requirements document and still declared itself
56
+ ready for implementation is the failure this exists to prevent. Original
57
+ documents are never copied into the package unless a person names them, and
58
+ never when they are sensitive.
59
+
60
+ ## Where the output lands
61
+
62
+ Inside a workspace the package defaults to `docs/designs/` and is discoverable
63
+ by the index — which is what lets a spec or a plan reference it later without it
64
+ ever having had a relationship with those flows. Outside a workspace the caller
65
+ must name an explicit root; the result is still a conformant, portable package,
66
+ and it is simply not indexed. What never happens is a guess: no root declared,
67
+ nothing written.
68
+
69
+ ## What the direct route does not do
70
+
71
+ - Never creates, advances, closes or publishes a SPEC, PLAN or QUICK session or
72
+ document.
73
+ - Never initializes a workspace: an operation that needs one and does not find
74
+ it returns an explicit result.
75
+ - Never exercises an effect the descriptor does not declare, nor one that
76
+ requires approval without asking for it first.
77
+
78
+ `off` is decided per operation by the descriptor and no host, wrapper or legacy
79
+ name reverts it. `aw skills --detail` reports the live state, its evidence and
80
+ the next action.
@@ -0,0 +1,224 @@
1
+ ---
2
+ name: design
3
+ description: >-
4
+ UI design authoring over the **UI Design Package v1** — the durable dossier
5
+ under `docs/designs/NNN-design-<slug>/` that a spec references and a plan
6
+ implements against. Authors **flows** (the journey: nodes, edges, actors) and
7
+ **screens** (the surface: states, structure, data, accessibility) as Markdown
8
+ with versioned YAML frontmatter, plus the rules, tokens, renditions and
9
+ governance records around them. Knows the package layout, the six canonical
10
+ schemas, the maturity ladder (`outline` → `handoff`), the reference grammar
11
+ `DES-NNN/SCR-NNN@rN#anchor`, and what a document must close before an
12
+ implementation may be planned against it. Use when a loop refines a spec,
13
+ builds or refines a plan, or executes one that involves screens, forms,
14
+ dashboards, modals or any UI surface.
15
+ ---
16
+
17
+ # design — UI design over the UI Design Package v1
18
+
19
+ ## Role
20
+
21
+ `design` — this is its **built-in default implementation**, and `design` is the
22
+ **only public identity** of this capability. `ui-design` (the role this
23
+ replaces) and `ui-spec` (the skill that used to fill it) are **not** aliases,
24
+ **not** alternative implementations and **not** accepted names: a second name
25
+ for one capability is a second contract in disguise, and the day the two
26
+ disagree there is no way to say which one the package obeys.
27
+
28
+ Rebindable in `.workflow/skills.toml` to a third-party skill or `off`.
29
+ Resolution: built-in default → `~/.workflow/skills.toml` (global) →
30
+ `.workflow/skills.toml` (workspace). See [`../README.md`](../README.md).
31
+
32
+ ## Purpose
33
+
34
+ Given a UI requirement, author the **semantic** design of its journeys and
35
+ surfaces into a package that outlives the session that produced it: durable,
36
+ versioned, referenceable by digest, and complete enough that an implementation
37
+ can be planned against it without reopening the design conversation.
38
+
39
+ The package is the deliverable. A spec **references** it; it never contains it.
40
+
41
+ ## Composed by
42
+
43
+ - **`spec-refine-loop`** — the requirement involves UI: reuse a compatible
44
+ baseline or open an `outline` revision, and leave only `## Design references`
45
+ in the spec document.
46
+ - **`plan-new-loop` · `plan-refine-loop`** — the plan consumes UI: promote to
47
+ `handoff` exactly the closure the plan consumes, and write the exact roots
48
+ into each phase or task.
49
+ - **`plan-exec-loop`** — reads and validates; **never redesigns**. A design that
50
+ turns out wrong stops execution and goes back to the refining loop.
51
+
52
+ In all of them the composing loop contributes the human questions
53
+ (*structured-choice*, chassis § *Structured-choice*), the gap-driven iteration
54
+ and the curation. This skill contributes what a correct package looks like.
55
+
56
+ ## Knowledge
57
+
58
+ ### Package layout
59
+
60
+ ```
61
+ docs/designs/NNN-design-<slug>/
62
+ design-manifest.json mutable index — catalog, governance, currentness
63
+ baselines/DES-NNN-rNNN.json immutable: what the package IS at that revision
64
+ flows/FLW-NNN-rNNN-<slug>.md
65
+ screens/SCR-NNN-rNNN-<slug>.md
66
+ design-system/rules/RUL-NNN-rNNN-<slug>.md
67
+ tokens/TOK-NNN-rNNN-<slug>.tokens.json
68
+ renditions/VIS-NNN-rNNN-<slug>/rendition.json
69
+ assets/<digest>-<name>.<ext>
70
+ governance/reviews/REV-NNN.json
71
+ governance/revocations/RVK-NNN.json
72
+ PACKAGE.md · design-system/DESIGN.md regenerable projections, never sealed
73
+ ```
74
+
75
+ The revision is **in the file name**, so publishing `@r2` writes a new file and
76
+ *cannot* overwrite `@r1` — not by policy, by path. An asset carries the digest
77
+ of its own bytes, so different content can never occupy the same name.
78
+
79
+ ### The two documents this skill authors
80
+
81
+ Both are Markdown: versioned YAML frontmatter (identity, relations, trace,
82
+ unknowns) plus a **fixed list of `##` sections**, once each, in order, none
83
+ empty. A section that genuinely does not apply is declared in
84
+ `not_applicable: {key: reason}` — silence is not closure, and the **essential**
85
+ sections admit no such claim.
86
+
87
+ | | `flow` (`workline.ui-flow/v1`) | `screen` (`workline.ui-screen/v1`) |
88
+ |---|---|---|
89
+ | Answers | how the journey runs | what one surface is |
90
+ | Frontmatter core | `actors`, `entry`, `nodes`, `edges` | `default_state`, `states[]`, `flow_refs`, `dependencies` |
91
+ | Sections | Goal and outcome · Preconditions and entry · Main journey · Alternatives and recovery · Permissions and privacy · Traceability | Purpose and context · Structure and content · Components and design-system deltas · Data, permissions and validation · States and transitions · Interaction and navigation · Responsive and adaptation · Localization · Accessibility · Edge cases and degradation · Traceability |
92
+ | Essential (no waiver) | Goal and outcome · Main journey · Traceability | Purpose and context · Structure and content · States and transitions · Interaction and navigation · Accessibility · Traceability |
93
+
94
+ ### Reference grammar
95
+
96
+ `DES-001/SCR-001@r2#error` — package / artifact @ revision # state anchor. A
97
+ reference always pins the revision: **a later revision never invalidates a
98
+ reference already fixed**. Baselines are cited as `DES-001@r2` plus the digest
99
+ that seals them.
100
+
101
+ ### Maturity: `outline` → `handoff`
102
+
103
+ `outline` is a legitimate state, not a failure — it exists precisely to hold
104
+ what is not yet decided. A document may declare `handoff` only when:
105
+
106
+ - its **applicable completeness** is closed (every section says something or is
107
+ waived with a reason);
108
+ - it carries **no blocking unknown** (`unknowns[].blocking: true`);
109
+ - a flow **resolves its graph** — nodes with no edges are not a journey;
110
+ - every reference to **another package** is pinned in `external[]` by provider,
111
+ revision and digest;
112
+ - no essential section answers with a **rendition and nothing else**: an
113
+ approved image is not the current semantics and is not a WCAG conformance.
114
+
115
+ ### Governance: four independent dimensions
116
+
117
+ **Maturity** (`outline`/`handoff`), **review** (a `REV-*.json` that approves or
118
+ rejects an exact baseline *by digest*), **currentness** (derived from
119
+ `supersedes` — superseded warns and still executes) and **execution policy**
120
+ (whether the workspace demands approval) move **separately**. An approval is
121
+ never inherited: a new revision returns to `proposed`, and the only way to
122
+ forbid an intact revision is an explicit, audited revocation.
123
+
124
+ ## Operations
125
+
126
+ Five semantic operations, all over the **same** package. `create` and `update`
127
+ are one route with a different compare-and-swap base, not two formats.
128
+
129
+ | Operation | Does | Writes |
130
+ |---|---|---|
131
+ | `create` | first revision of a package | manifest, baseline, artifacts, projections |
132
+ | `update` | next revision of an existing package | idem, over a declared base |
133
+ | `validate` | judges without writing: schemas, naming, references, maturity, closure | nothing |
134
+ | `render` | regenerates the projections | `PACKAGE.md`, `design-system/DESIGN.md` — never sealed |
135
+ | `record` | seals a governance decision about a revision that exists | `governance/reviews/` · `governance/revocations/` |
136
+
137
+ None of them may invent a layout or a schema of its own. There is no «direct
138
+ package», no parallel Markdown render and no side JSON: **one format, one
139
+ authority**.
140
+
141
+ ## Canonical authority
142
+
143
+ The normative contract is the six published JSON Schemas under
144
+ [`../../schemas/design/`](../../schemas/design/) — manifest, baseline, flow,
145
+ screen, review, revocation — and the validators that implement them. The
146
+ built-in floor and **every** improvement bound to this role validate their
147
+ output against exactly those, with the same gates.
148
+
149
+ - A missing external improvement **never blocks the floor**: with nothing bound,
150
+ the role resolves to this skill and the capability keeps working.
151
+ - A contributor extends the domain by **adding fields to a schema**, never by
152
+ declaring a format of their own. Nobody redefines the canonical authority —
153
+ not a bound skill, not a host, not a workspace.
154
+
155
+ ## Boundary with Spec 014
156
+
157
+ The **transversal capability lifecycle belongs to Spec 014 and is not
158
+ reimplemented here**: skill descriptor, enable/disable lifecycle, the
159
+ `request` / `outcome` / `receipt` envelope, routing between direct and composed
160
+ paths, `off`, effects, and host-native projection are governed there.
161
+
162
+ This contract adds **only** what is proper to the design domain: fields,
163
+ validators and completeness. Where the two meet, Spec 014 decides the envelope
164
+ and this one decides the payload. Duplicating either side is the failure mode
165
+ being avoided.
166
+
167
+ ### How it is invoked
168
+
169
+ Both routes reach the same dispatcher and each caller has a fixed row of
170
+ operations it may ask for. That contract is stated once, in
171
+ [`CONTRACT.md`](CONTRACT.md) — the same file the installed wrapper points at.
172
+ Nothing about invocation is restated here.
173
+
174
+ ## CLI ↔ agent split
175
+
176
+ Explicit, and it is the whole point of the handshake:
177
+
178
+ - **The CLI owns** inventory, numbering, digests, validation, authorization and
179
+ **writing**. It is the only thing that touches the filesystem.
180
+ - **The agent owns** exactly one step: authoring the **semantic content**. Its
181
+ answer is *data to be validated*, never an instruction to be trusted.
182
+
183
+ Three stages, and only the third writes: `prepare` (what was read, where writing
184
+ is allowed, and an `input_digest` sealing the state seen) → `validate` (parse the
185
+ answer against that request; on survival, a preview and an `approval_digest`
186
+ over the exact bytes proposed) → `apply` (recompute the input digest, check the
187
+ approval still matches, publish all-or-nothing).
188
+
189
+ ## Output
190
+
191
+ The package itself — new artifact files plus the revision that seals them. The
192
+ **loop** writes (through the CLI), never this skill on its own.
193
+
194
+ What this skill does **not** produce: design inside a spec or a plan document.
195
+ A spec carries `## Design references` (package, baseline, digest, path hint); a
196
+ plan carries the exact roots each phase or task consumes. Embedding the design
197
+ in the document is what the package exists to end.
198
+
199
+ ## Retired path — `retired/unsupported`, and nothing else
200
+
201
+ The legacy path is **gone**: the `ui-design` binding, the `ui-spec` skill, the
202
+ spec's `## UI spec` section and the per-screen design SPECs that PLAN sessions
203
+ carried. `design` is the only identity and the package above the only format.
204
+
205
+ Presenting any of it — a binding or invocation naming a retired name, a `## UI
206
+ spec` section, a session design SPEC, an output of `ui-spec-generator` — is
207
+ reported **`retired/unsupported`**. It is never read as a contract, and never
208
+ satisfies a gate as evidence. There is **no alias, no dual-read, no importer, no
209
+ conversion, no migrate-on-touch and no bulk migration**: a design that is still
210
+ needed is **recreated** over the package from current sources.
211
+
212
+ What retirement does not do is destroy: every document already written stays
213
+ exactly where it is, byte for byte, readable by whoever opens it. Retiring an
214
+ input is not the same as deleting a record.
215
+
216
+ **`ui-spec-generator` is outside this topology.** It is not a dependency, not an
217
+ adapter and not a source of truth for anything here; nothing in Workline reads,
218
+ invokes or imports it. Whatever becomes of that repository is its own business —
219
+ cleaning it up is explicitly not part of this contract.
220
+
221
+ ## Source
222
+
223
+ Requirement: `docs/specs/013-spec-estandarizar-ui-spec.md`. Contract and
224
+ rationale: the six schemas under [`../../schemas/design/`](../../schemas/design/).
@@ -0,0 +1,260 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workline.dev/schemas/capability-descriptor.schema.json",
4
+ "title": "Workline capability descriptor v1",
5
+ "description": "The cross-cutting contract an Agent Skill declares to become invocable by Workline. Not a design format and not part of the UI Design Package catalog: it says what a capability IS — operations, inputs, outputs, context, interaction, effects, floor, degradations, off policy and retirement — for any capability, design included.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "contract_version",
10
+ "name",
11
+ "purpose",
12
+ "exposure",
13
+ "default_operation",
14
+ "operations",
15
+ "floor",
16
+ "degradations",
17
+ "compatibility"
18
+ ],
19
+ "properties": {
20
+ "contract_version": {
21
+ "description": "Version of THIS contract, not of the skill. An unknown value stops validation before any field is read.",
22
+ "const": 1
23
+ },
24
+ "name": {
25
+ "description": "The capability's only public identity. There is no parallel role ID: the binding slot and the capability are one name.",
26
+ "type": "string",
27
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
28
+ },
29
+ "purpose": {
30
+ "description": "What the capability resolves, in one sentence. Discovery and generated help derive from here rather than restating it.",
31
+ "type": "string",
32
+ "minLength": 1
33
+ },
34
+ "exposure": {
35
+ "description": "Routes the capability opens. A skill declaring neither gets no Workline surface — installing a utility does not make it a capability.",
36
+ "type": "array",
37
+ "minItems": 1,
38
+ "uniqueItems": true,
39
+ "items": { "enum": ["direct", "compose"] }
40
+ },
41
+ "default_operation": {
42
+ "description": "Operation assumed when a caller names none. Null when every invocation must be explicit.",
43
+ "type": ["string", "null"],
44
+ "pattern": "^[a-z][a-z0-9_]*$"
45
+ },
46
+ "operations": {
47
+ "description": "The finite operation catalog. Anything outside it is refused, never improvised.",
48
+ "type": "array",
49
+ "minItems": 1,
50
+ "items": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": [
54
+ "name",
55
+ "summary",
56
+ "exposure",
57
+ "workspace",
58
+ "interaction",
59
+ "inputs",
60
+ "output",
61
+ "effects",
62
+ "off"
63
+ ],
64
+ "properties": {
65
+ "name": {
66
+ "type": "string",
67
+ "pattern": "^[a-z][a-z0-9_]*$"
68
+ },
69
+ "summary": {
70
+ "type": "string",
71
+ "minLength": 1
72
+ },
73
+ "exposure": {
74
+ "description": "Routes this operation answers on. Always a subset of the capability's own exposure.",
75
+ "type": "array",
76
+ "minItems": 1,
77
+ "uniqueItems": true,
78
+ "items": { "enum": ["direct", "compose"] }
79
+ },
80
+ "workspace": {
81
+ "description": "Whether the operation needs a Workline workspace. Being outside one returns an explicit result and never initializes Workline implicitly.",
82
+ "enum": ["required", "optional", "standalone"]
83
+ },
84
+ "interaction": {
85
+ "description": "Whether one attempt is the whole conversation, or the operation may answer `needs_input` and continue.",
86
+ "enum": ["single_pass", "needs_input"]
87
+ },
88
+ "inputs": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "required": ["name", "kind", "required", "sensitivity", "schema"],
94
+ "properties": {
95
+ "name": {
96
+ "type": "string",
97
+ "pattern": "^[a-z][a-z0-9_]*$"
98
+ },
99
+ "kind": { "enum": ["text", "reference", "attachment", "selection"] },
100
+ "required": { "type": "boolean" },
101
+ "sensitivity": {
102
+ "description": "Reading a sensitive source is never authorized by the invocation alone.",
103
+ "enum": ["public", "sensitive"]
104
+ },
105
+ "schema": {
106
+ "description": "Canonical format id when the input is schema-bearing, else null.",
107
+ "type": ["string", "null"],
108
+ "pattern": "^[a-z][a-z0-9.-]*/v[1-9][0-9]*$"
109
+ }
110
+ }
111
+ }
112
+ },
113
+ "output": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": ["kind", "schema", "completeness"],
117
+ "properties": {
118
+ "kind": {
119
+ "description": "A typed value, a durable reference, or both. Host prose is never the payload a flow consumes.",
120
+ "enum": ["value", "reference", "value_and_reference"]
121
+ },
122
+ "schema": {
123
+ "type": ["string", "null"],
124
+ "pattern": "^[a-z][a-z0-9.-]*/v[1-9][0-9]*$"
125
+ },
126
+ "completeness": {
127
+ "description": "Completeness values this operation may report. A dimension separate from the outcome: `completed` still requires the requested profile's completeness.",
128
+ "type": "array",
129
+ "minItems": 1,
130
+ "uniqueItems": true,
131
+ "items": { "enum": ["complete", "partial"] }
132
+ }
133
+ }
134
+ },
135
+ "effects": {
136
+ "description": "Every class of effect the operation may exercise. An undeclared effect is never exercised, so `read_only` is a declaration and not the absence of one.",
137
+ "type": "array",
138
+ "minItems": 1,
139
+ "items": {
140
+ "type": "object",
141
+ "additionalProperties": false,
142
+ "required": ["class", "idempotent", "authorization", "approval"],
143
+ "properties": {
144
+ "class": {
145
+ "enum": [
146
+ "read_only",
147
+ "local_additive",
148
+ "mutate_overwrite",
149
+ "execute",
150
+ "network_external",
151
+ "destructive"
152
+ ]
153
+ },
154
+ "idempotent": { "type": "boolean" },
155
+ "authorization": {
156
+ "description": "Granted by the invocation itself, or by a preflight the human sees first.",
157
+ "enum": ["invocation", "preflight"]
158
+ },
159
+ "approval": { "enum": ["none", "visible"] }
160
+ }
161
+ }
162
+ },
163
+ "off": {
164
+ "description": "What binding the capability `off` does to this operation. Never reverted by a host, a wrapper or a legacy name.",
165
+ "enum": ["blocked", "allowed"]
166
+ }
167
+ }
168
+ }
169
+ },
170
+ "floor": {
171
+ "description": "What runs with nothing installed. A capability a core gate needs carries its own implementation, so a missing external skill never blocks SPEC, PLAN or QUICK.",
172
+ "type": "object",
173
+ "additionalProperties": false,
174
+ "required": ["builtin", "kind", "improvements"],
175
+ "properties": {
176
+ "builtin": { "type": "boolean" },
177
+ "kind": { "enum": ["core", "feature"] },
178
+ "improvements": {
179
+ "description": "`host_selected` means the host decides which compatible improvements contribute and in what order; Workline imposes no universal precedence.",
180
+ "enum": ["host_selected", "none"]
181
+ }
182
+ }
183
+ },
184
+ "degradations": {
185
+ "description": "The observable reasons a run may fall back, and what each one does. A cause not declared here is not a degradation, it is a failure.",
186
+ "type": "array",
187
+ "items": {
188
+ "type": "object",
189
+ "additionalProperties": false,
190
+ "required": ["cause", "action"],
191
+ "properties": {
192
+ "cause": {
193
+ "enum": [
194
+ "opaque_selection",
195
+ "incompatible_improvement",
196
+ "invalid_binding",
197
+ "digest_changed"
198
+ ]
199
+ },
200
+ "action": { "enum": ["floor", "reject"] }
201
+ }
202
+ }
203
+ },
204
+ "compatibility": {
205
+ "type": "object",
206
+ "additionalProperties": false,
207
+ "required": [
208
+ "status",
209
+ "minimum_contract_version",
210
+ "improves",
211
+ "retired_names",
212
+ "retired_formats"
213
+ ],
214
+ "properties": {
215
+ "status": { "enum": ["active", "deprecated"] },
216
+ "minimum_contract_version": {
217
+ "type": "integer",
218
+ "minimum": 1
219
+ },
220
+ "improves": {
221
+ "description": "What this descriptor improves, in its OWN words. Null when the descriptor IS the capability. Installed never implies compatible: the resolution verifies this claim against the capability being resolved before the improvement contributes or produces any effect.",
222
+ "type": ["object", "null"],
223
+ "additionalProperties": false,
224
+ "required": ["capability", "operations", "contract_version"],
225
+ "properties": {
226
+ "capability": {
227
+ "type": "string",
228
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
229
+ },
230
+ "operations": {
231
+ "type": "array",
232
+ "minItems": 1,
233
+ "items": {
234
+ "type": "string",
235
+ "pattern": "^[a-z][a-z0-9_]*$"
236
+ }
237
+ },
238
+ "contract_version": {
239
+ "type": "integer",
240
+ "minimum": 1
241
+ }
242
+ }
243
+ },
244
+ "retired_names": {
245
+ "description": "Names that are NOT aliases. A binding, invocation or descriptor using one fails with guidance to adopt the live name; it never resolves silently.",
246
+ "type": "array",
247
+ "items": {
248
+ "type": "string",
249
+ "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
250
+ }
251
+ },
252
+ "retired_formats": {
253
+ "description": "Formats unsupported as a source: never read, imported, converted or migrated, and unable to satisfy a gate. The files themselves are left intact.",
254
+ "type": "array",
255
+ "items": { "type": "string", "minLength": 1 }
256
+ }
257
+ }
258
+ }
259
+ }
260
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://workline.dev/schemas/design/design-baseline.v1.schema.json",
4
+ "title": "Workline UI Design Package v1 — baseline",
5
+ "description": "Immutable authority of one published revision: the closed selection of normative files with their revision and the SHA-256 of their bytes, sealed by a digest over canonical JSON WITHOUT the digest field. The mutable manifest, the governance records and the regenerable projections are excluded by construction, so re-indexing or re-rendering can never alter a revision published months ago.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schema",
10
+ "package",
11
+ "revision",
12
+ "parent_baseline",
13
+ "published",
14
+ "digest",
15
+ "selection"
16
+ ],
17
+ "properties": {
18
+ "schema": {
19
+ "const": "workline.design-baseline/v1"
20
+ },
21
+ "package": {
22
+ "type": "string",
23
+ "pattern": "^DES-(?:[0-9]{3}|[1-9][0-9]{3,})$"
24
+ },
25
+ "revision": {
26
+ "type": "integer",
27
+ "minimum": 1
28
+ },
29
+ "parent_baseline": {
30
+ "description": "The previous revision of THIS package, or null for the first. A line never forks: an intentional divergence creates another package with `derived_from`.",
31
+ "type": ["string", "null"],
32
+ "pattern": "^DES-(?:[0-9]{3}|[1-9][0-9]{3,})@r[1-9][0-9]{0,5}$"
33
+ },
34
+ "published": {
35
+ "type": "string",
36
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
37
+ },
38
+ "digest": {
39
+ "description": "SHA-256 over canonical JSON of this document WITHOUT this field. No self-reference, so anyone can recompute and compare.",
40
+ "type": "string",
41
+ "pattern": "^sha256:[0-9a-f]{64}$"
42
+ },
43
+ "selection": {
44
+ "description": "The closed set of normative files this revision publishes together. Never empty: a published revision publishes something.",
45
+ "type": "array",
46
+ "items": {
47
+ "type": "object",
48
+ "additionalProperties": false,
49
+ "required": ["path", "revision", "sha256"],
50
+ "properties": {
51
+ "path": {
52
+ "description": "Package-relative path under flows/, screens/, design-system/rules/, tokens/, renditions/ or assets/.",
53
+ "type": "string",
54
+ "minLength": 1
55
+ },
56
+ "revision": {
57
+ "description": "The revision the file's own name carries; null for a content-addressed asset.",
58
+ "type": ["integer", "null"],
59
+ "minimum": 1
60
+ },
61
+ "sha256": {
62
+ "description": "Digest of the file's BYTES, not of a projection of them.",
63
+ "type": "string",
64
+ "pattern": "^sha256:[0-9a-f]{64}$"
65
+ }
66
+ }
67
+ },
68
+ "minItems": 1
69
+ }
70
+ }
71
+ }