@srobroek/pi-design 0.0.0 → 0.11.1

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 (59) hide show
  1. package/CHANGELOG.md +174 -0
  2. package/LICENSE +202 -0
  3. package/README.md +438 -2
  4. package/_kit/prereqs.json +41 -0
  5. package/_kit/prereqs.ts +374 -0
  6. package/agents/a11y-auditor.md +107 -0
  7. package/agents/council-user.md +25 -0
  8. package/agents/council-ux.md +25 -0
  9. package/agents/design-critic.md +80 -0
  10. package/agents/ui-implementer.md +75 -0
  11. package/agents/ui-ux-specialist.md +133 -0
  12. package/commands/council-product.md +26 -0
  13. package/commands/design-review.md +17 -0
  14. package/extensions/design.js +438 -0
  15. package/formulas/design-surface.formula.toml +344 -0
  16. package/formulas/design-system.formula.toml +509 -0
  17. package/formulas/design-touch.formula.toml +188 -0
  18. package/formulas/mol-design-a11y.formula.toml +128 -0
  19. package/formulas/mol-design-component.formula.toml +122 -0
  20. package/formulas/mol-design-iterate.formula.toml +187 -0
  21. package/formulas/mol-design-motion.formula.toml +138 -0
  22. package/formulas/mol-design-responsive.formula.toml +135 -0
  23. package/formulas/mol-design-tokens.formula.toml +165 -0
  24. package/mcp-servers.ts +49 -0
  25. package/package.json +61 -4
  26. package/skills/accessibility-audit/SKILL.md +92 -0
  27. package/skills/accessibility-audit/references/upstream.md +78 -0
  28. package/skills/design-component-truth/SKILL.md +41 -0
  29. package/skills/design-evidence/SKILL.md +21 -0
  30. package/skills/design-guide/SKILL.md +26 -0
  31. package/skills/design-md/LICENSE +21 -0
  32. package/skills/design-md/NOTICE +31 -0
  33. package/skills/design-md/SKILL.md +79 -0
  34. package/skills/design-md/references/create-design-md.md +254 -0
  35. package/skills/design-md/references/upstream.md +60 -0
  36. package/skills/design-no-slop/SKILL.md +32 -0
  37. package/skills/design-prototype/SKILL.md +84 -0
  38. package/skills/design-prototype/references/in-app-variants.md +47 -0
  39. package/skills/design-prototype/references/upstream.md +43 -0
  40. package/skills/design-system-audit/SKILL.md +62 -0
  41. package/skills/design-system-audit/references/token-carriers.md +106 -0
  42. package/skills/design-system-audit/references/token-pipeline.md +115 -0
  43. package/skills/design-system-audit/references/upstream.md +52 -0
  44. package/skills/design-token-discipline/SKILL.md +24 -0
  45. package/skills/design-upstream-preflight/SKILL.md +60 -0
  46. package/skills/motion-design/SKILL.md +60 -0
  47. package/skills/ui-microcopy/LICENSE +212 -0
  48. package/skills/ui-microcopy/NOTICE +28 -0
  49. package/skills/ui-microcopy/SKILL.md +50 -0
  50. package/skills/ui-microcopy/references/copy-guidance.md +86 -0
  51. package/skills/ui-microcopy/references/upstream.md +11 -0
  52. package/skills/ui-review/SKILL.md +92 -0
  53. package/skills/ui-review/references/probes.md +446 -0
  54. package/skills/ui-review/references/storybook.md +217 -0
  55. package/skills/ui-review/references/tools.md +269 -0
  56. package/skills/ui-review/references/viewport-checks.md +184 -0
  57. package/skills/wireloom/LICENSE +21 -0
  58. package/skills/wireloom/NOTICE +30 -0
  59. package/skills/wireloom/SKILL.md +95 -0
@@ -0,0 +1,188 @@
1
+ # design-touch -- the smallest design tier: a scoped change inside a design system
2
+ # that already exists.
3
+ #
4
+ # Install: run the design_setup tool, which copies every design formula into
5
+ # <repo>/.beads/formulas/, or copy this file there (or into ~/.beads/formulas/).
6
+ # Pour one molecule per scoped change:
7
+ # bd mol pour design-touch --var surface=<route> --var scope=<paths>
8
+ #
9
+ # 8 steps, 1 human gate. No `mol-` prefix: by convention `mol-` marks a
10
+ # formula meant for `bd mol bond`, and this tier is poured, not bonded.
11
+ #
12
+ # PRECONDITION: the skills and agents named here ship in the design plugin
13
+ # (srobroek.design). Install it first, or every step names a capability that does not exist.
14
+ #
15
+ # WHY NO COMPONENT DRIVEN STAGING: staging exists to make a failure smaller to
16
+ # locate across a component/composition/page stack. A single-component touch has
17
+ # no stack, so the staging steps would be three empty beads. Pour design-surface
18
+ # instead the moment the change spans more than one primitive.
19
+ #
20
+ # Every join names at least one unconditional step, so a step whose whole `needs`
21
+ # list is filtered keeps its parent edge and becomes ready rather than stranded:
22
+ # `verify-surface` names `build-states` alongside the conditional
23
+ # `update-design-md` for exactly that reason.
24
+ formula = "design-touch"
25
+ description = "Scoped design touch on {{surface}} inside {{scope}}: ground, build every state, verify, one combined review, reconcile, human approval"
26
+ type = "workflow"
27
+
28
+ [vars.surface]
29
+ required = true
30
+ description = "route or URL the agent drives during VERIFY"
31
+
32
+ [vars.scope]
33
+ required = true
34
+ description = "paths the work may touch"
35
+
36
+ [vars.platform]
37
+ default = "web"
38
+ description = "web uses the browser tools; any other value uses a desktop accessibility inspector for native desktop"
39
+
40
+ [vars.want_design_md]
41
+ default = "false"
42
+ description = "true when this touch introduces a token or scale value that repo-root DESIGN.md must record"
43
+
44
+ [[steps]]
45
+ id = "ground-system"
46
+ title = "GROUND the system this touch sits in"
47
+ type = "task"
48
+ priority = 1
49
+ labels = ["design", "phase:ground"]
50
+ description = """
51
+ Run the design-system-audit skill on {{scope}}. Read the token files, the scales,
52
+ and the 5-10 existing components nearest {{surface}}. Record the discovered
53
+ registry on this bead so later steps cite it instead of guessing. Verdict
54
+ PRESENT, PARTIAL, or ABSENT. Never invent a token a search could find. Platform
55
+ is {{platform}}. ABSENT or PARTIAL means this tier is the wrong one: bond
56
+ mol-design-tokens, or pour design-system, rather than establishing a scale here.
57
+
58
+ Apply the design-upstream-preflight skill here, at GROUND, for every row an enabled
59
+ step of this molecule reaches, and record on this bead each install, its path, and
60
+ every prerequisite still missing. A row that failed to install STOPS the step that
61
+ needs it, so an unrecorded gap strands this molecule later rather than here.
62
+
63
+ This tier has no INTENT gate: specify-touch follows GROUND directly and the only
64
+ human gate is touch-approval at the end. So there is nowhere later to raise a
65
+ failed install, and this step handles it. Record every gap for the reader
66
+ without blocking on it.
67
+ """
68
+
69
+ [steps.metadata]
70
+ skill_hints = "design-system-audit"
71
+
72
+ [[steps]]
73
+ id = "specify-touch"
74
+ title = "SPECIFY the touch to {{surface}}"
75
+ type = "task"
76
+ needs = ["ground-system"]
77
+ labels = ["design", "phase:specify"]
78
+ description = """
79
+ Name the change to {{surface}} and the exact tokens and primitives it consumes,
80
+ each cited from the GROUND registry. State the observable condition that counts
81
+ as done. State the scope edge: what inside {{scope}} this touch may not alter.
82
+ Verify every component property against manifests/components.json or the
83
+ component source before naming it; a property that sounds plausible is not a
84
+ property.
85
+ """
86
+
87
+ [[steps]]
88
+ id = "build-states"
89
+ title = "BUILD every state for {{surface}}"
90
+ type = "task"
91
+ needs = ["specify-touch"]
92
+ labels = ["design", "phase:build"]
93
+ description = """
94
+ Implement the touch inside {{scope}}. Enumerate default, hover, focus-visible,
95
+ active, disabled, loading, empty, error, selected. Implement and verify every
96
+ applicable state; record N/A with a component-specific reason for the others.
97
+ Every colour comes from a token and every spacing value from the scale. Rename tokens and
98
+ components with an LSP rename, never text substitution. Use the ui-microcopy skill for copy and
99
+ the motion-design skill for motion.
100
+ """
101
+
102
+ [[steps]]
103
+ id = "update-design-md"
104
+ title = "record the touched tokens in DESIGN.md"
105
+ type = "task"
106
+ needs = ["build-states"]
107
+ condition = "{{want_design_md}}"
108
+ labels = ["design", "phase:build"]
109
+ description = """
110
+ Run the design-md skill. Add or update only the token entries this touch changed;
111
+ do not rewrite unrelated sections. Every {group.token} reference must resolve.
112
+ Unknowns belong under Known Gaps. TODO or TO_FILL is invalid. Gate the result
113
+ with: npx --yes @google/design.md lint "$(git rev-parse --show-toplevel)/DESIGN.md"
114
+ """
115
+
116
+ [steps.metadata]
117
+ skill_hints = "design-md"
118
+
119
+ [[steps]]
120
+ id = "verify-surface"
121
+ title = "VERIFY {{surface}} on real viewports"
122
+ type = "task"
123
+ needs = ["build-states", "update-design-md"]
124
+ labels = ["design", "phase:verify"]
125
+ description = """
126
+ Run the ui-review skill against {{surface}}. Drive the real surface: the browser
127
+ tools when {{platform}} is web, a desktop accessibility inspector otherwise. Evidence order is fixed: ARIA snapshot
128
+ first, computed styles second, screenshot last. Widths 1440, 768, 375. Every
129
+ state from BUILD gets a named citation; an unwitnessed state is not verified.
130
+ build-states is named unconditionally so this step stays reachable when
131
+ want_design_md is false.
132
+ """
133
+
134
+ [steps.metadata]
135
+ skill_hints = "ui-review"
136
+
137
+ [[steps]]
138
+ id = "review-combined"
139
+ title = "REVIEW visual, UX, and WCAG 2.2 AA together"
140
+ type = "task"
141
+ needs = ["verify-surface"]
142
+ labels = ["design", "phase:critique"]
143
+ description = """
144
+ One read-only review pass over {{surface}}, because a single-component touch does
145
+ not earn two parallel reviewers. Spawn a11y-auditor (read-only) with the combined
146
+ review brief: the accessibility-audit skill for WCAG 2.2 AA, then the ui-review skill
147
+ as critique against the design-no-slop skill. It returns two separate verdicts, each
148
+ PASS, MINOR, or MAJOR with named ARIA or computed-style evidence, so a visual PASS
149
+ never hides an accessibility MAJOR. Do not edit files here, and do not question
150
+ the user. A MAJOR accessibility verdict bonds mol-design-a11y onto this step.
151
+ """
152
+
153
+ [steps.metadata]
154
+ skill_hints = "accessibility-audit, ui-review"
155
+ execution_agent_type = "a11y-auditor"
156
+ execution_mode = "subagent"
157
+
158
+ [[steps]]
159
+ id = "reconcile-findings"
160
+ title = "RECONCILE the review findings"
161
+ type = "task"
162
+ needs = ["review-combined"]
163
+ labels = ["design", "phase:reconcile"]
164
+ description = """
165
+ Fix every MAJOR finding and every agreed MINOR inside {{scope}}. Re-verify only the
166
+ changed assertion, never the whole walk, and leave a citation per re-run. Do not
167
+ accept a finding you cannot reproduce: report it as unreproduced rather than
168
+ dropping it silently. Record findings on this step and resolve them before continuing.
169
+ """
170
+
171
+ [[steps]]
172
+ id = "touch-approval"
173
+ title = "human approval for the touch to {{surface}}"
174
+ type = "task"
175
+ needs = ["reconcile-findings"]
176
+ labels = ["design", "phase:gate"]
177
+ description = """
178
+ Present the VERIFY evidence and both review verdicts for {{surface}}, then grill
179
+ the user: what still reads wrong, and is the done condition from SPECIFY met.
180
+ Number unresolved questions and give a recommended answer with each. Without
181
+ explicit acceptance, record the evidence and unanswered request and leave this
182
+ step unresolved, including unattended runs. Only bd gate resolve closes the gate.
183
+ Another round of visual intent bonds mol-design-iterate onto this step.
184
+ """
185
+
186
+ [steps.gate]
187
+ type = "human"
188
+ timeout = "72h"
@@ -0,0 +1,128 @@
1
+ # mol-design-a11y -- a WCAG 2.2 AA remediation loop, bonded off a MAJOR verdict
2
+ # from a11y-auditor.
3
+ #
4
+ # Bond it onto the audit step that returned MAJOR, so the first child is ready
5
+ # immediately:
6
+ # bd mol bond mol-design-a11y <target-id> --var surface=<route> --var node=<node-id> --var round=<n>
7
+ # round is required: bd mol bond does not apply a var default, so a default here
8
+ # would fail the bond anyway. Pass 2 for the first remediation pass.
9
+ #
10
+ # 4 steps, no human gate. The `mol-` prefix marks a formula meant for `bd mol
11
+ # bond`; formulas resolve by filename stem.
12
+ #
13
+ # PRECONDITION: the skills named here ship in the design plugin (srobroek.design).
14
+ #
15
+ # EVERY FINDING CARRIES THREE NUMBERS: its WCAG 2.2 criterion number, the measured
16
+ # value, and the required value. A finding recorded as "contrast too low" cannot be
17
+ # re-measured by anyone else, cannot be proved fixed, and cannot be triaged against
18
+ # another finding. That is why the shape is fixed at triage rather than left to the
19
+ # reporter.
20
+ #
21
+ # Bond joins root-to-root as a sibling subtree and cannot rewire an inherited
22
+ # step's `needs`, so the bonding side owns the join edge and this file declares no
23
+ # `needs` pointing outside itself, which is also what lets it cook standalone.
24
+ formula = "mol-design-a11y"
25
+ description = "WCAG 2.2 AA remediation pass {{round}} on {{surface}} from node {{node}}: triage each finding to its criterion, remediate the MAJORs, re-measure only those criteria"
26
+ type = "workflow"
27
+
28
+ [vars.surface]
29
+ required = true
30
+ description = "route or URL the agent drives when measuring and re-measuring"
31
+
32
+ [vars.node]
33
+ required = true
34
+ description = "id of the design node bead whose a11y audit returned MAJOR"
35
+
36
+ [vars.round]
37
+ required = true
38
+ description = "pass number; 2 is the first remediation pass after the node's own audit"
39
+
40
+ [[steps]]
41
+ id = "triage-a11y-findings"
42
+ title = "TRIAGE each finding to its WCAG 2.2 criterion"
43
+ type = "task"
44
+ labels = ["design", "design:subprocess", "sub:a11y"]
45
+ description = """
46
+ Read the MAJOR verdict on node {{node}} and normalise every finding to the same
47
+ five fields, with no exceptions: the WCAG 2.2 success criterion number and name,
48
+ for example 1.4.3 Contrast (Minimum); the selector or accessible name of the
49
+ element; the measured value; the required value; and the conformance level, A or
50
+ AA. A finding missing any of those five is not triaged yet.
51
+
52
+ Re-measure rather than trusting the report: run the accessibility-audit skill
53
+ against {{surface}} and confirm each finding still reproduces at the current head.
54
+ A finding that does not reproduce is marked UNREPRODUCED with what was tried and
55
+ carried to the verdict step, never dropped and never quietly downgraded.
56
+
57
+ Classify what remains as MAJOR or MINOR, in the vocabulary a11y-auditor uses: any
58
+ A or AA failure is MAJOR, and an AAA, policy, or best-practice finding is MINOR.
59
+ Order the MAJORs by how many elements each affects, because a token-level contrast
60
+ failure and a single mislabelled button are not the same size of fix.
61
+ """
62
+
63
+ [steps.metadata]
64
+ skill_hints = "accessibility-audit"
65
+
66
+ [[steps]]
67
+ id = "remediate-major"
68
+ title = "REMEDIATE every MAJOR criterion failure"
69
+ type = "task"
70
+ needs = ["triage-a11y-findings"]
71
+ labels = ["design", "design:subprocess", "sub:a11y"]
72
+ description = """
73
+ Fix every MAJOR from TRIAGE, and only those, inside the scope node {{node}}
74
+ declared. Fix the cause at the level it lives: a contrast failure traced to a
75
+ token is fixed in the token source and rebuilt, never patched in generated CSS or
76
+ overridden per component. A missing accessible name is fixed in the component, not
77
+ by adding aria-label at every callsite.
78
+
79
+ Never satisfy a criterion by removing the feature that failed it, and never
80
+ suppress an audit rule to make a finding disappear: both change the report without
81
+ changing the barrier. Record per fix: the criterion number, the file changed, and
82
+ the value the fix is expected to measure.
83
+ """
84
+
85
+ [[steps]]
86
+ id = "reverify-criteria"
87
+ title = "RE-MEASURE only the criteria that were remediated"
88
+ type = "task"
89
+ needs = ["remediate-major"]
90
+ labels = ["design", "design:subprocess", "sub:a11y"]
91
+ description = """
92
+ Run the accessibility-audit skill against {{surface}} restricted to the criteria
93
+ REMEDIATE touched, plus the ui-review skill for the computed-style and ARIA evidence
94
+ each measurement needs. Never re-walk the whole audit: node {{node}} already
95
+ carries the evidence for every criterion this pass did not touch.
96
+
97
+ Evidence order is fixed: ARIA snapshot first, computed styles second, screenshot
98
+ last. Widths 1440, 768, 375 where the criterion is width-sensitive, plus 320 CSS px
99
+ for 1.4.10 Reflow, which is specified at that width. Record the new
100
+ measured value against the required value per criterion; a remediation asserted
101
+ without a re-measurement is not verified. Check the neighbours a fix can break:
102
+ raising a contrast ratio can lower another pair in the same theme, and adding a
103
+ focus style can break 2.4.11 focus-not-obscured.
104
+ """
105
+
106
+ [steps.metadata]
107
+ skill_hints = "accessibility-audit, ui-review"
108
+
109
+ [[steps]]
110
+ id = "a11y-verdict"
111
+ title = "VERDICT on remediation pass {{round}}"
112
+ type = "task"
113
+ needs = ["reverify-criteria"]
114
+ labels = ["design", "design:subprocess", "sub:a11y"]
115
+ description = """
116
+ Report per criterion, in a table: criterion number and name, level, measured value
117
+ before, measured value after, required value, and status. Four lists, each
118
+ explicit and none merged: criteria now passing; criteria still failing; MINORs
119
+ recorded and deliberately not fixed; and UNREPRODUCED findings with what was
120
+ tried. An empty list is stated as empty rather than omitted.
121
+
122
+ Surviving failures bond another mol-design-a11y with round incremented, rather
123
+ than reopening this one, so each pass keeps its own measurements. A criterion that
124
+ survives two passes is a design problem rather than a remediation problem: route
125
+ it to mol-design-iterate, because the fix needs a change of intent the user has to
126
+ approve. Never report AA conformance for {{surface}} from this molecule: it
127
+ measured the criteria it touched, not all of them.
128
+ """
@@ -0,0 +1,122 @@
1
+ # mol-design-component -- build ONE primitive in isolation to full state coverage.
2
+ # Component Driven stage one, as its own molecule.
3
+ #
4
+ # Bond it onto the build step that needs the primitive:
5
+ # bd mol bond mol-design-component <target-id> --var surface=<route> --var node=<node-id> --var component=<Name>
6
+ #
7
+ # 4 steps, no human gate. The `mol-` prefix marks a formula meant for `bd mol
8
+ # bond`; formulas resolve by filename stem.
9
+ #
10
+ # PRECONDITION: the skills named here ship in the design plugin (srobroek.design).
11
+ #
12
+ # WHY ONE COMPONENT PER MOLECULE: https://www.componentdriven.org/ builds one
13
+ # component at a time in isolation, and pinpoints bugs at the component level
14
+ # because it is less work and more precise than testing screens. Bond one of these
15
+ # per primitive rather than widening the var to a list: a molecule covering four
16
+ # components cannot report that three passed.
17
+ #
18
+ # Bond joins root-to-root as a sibling subtree and cannot rewire an inherited
19
+ # step's `needs`, so the bonding side owns the join edge and this file declares no
20
+ # `needs` pointing outside itself, which is also what lets it cook standalone.
21
+ formula = "mol-design-component"
22
+ description = "Build {{component}} in isolation for node {{node}}: enumerate its real props and nine states, build it, verify at component level before anything composes it"
23
+ type = "workflow"
24
+
25
+ [vars.surface]
26
+ required = true
27
+ description = "route or URL where {{component}} will eventually be used; drives the composition check, not the isolation walk"
28
+
29
+ [vars.node]
30
+ required = true
31
+ description = "id of the design node bead whose build step needs this primitive"
32
+
33
+ [vars.component]
34
+ required = true
35
+ description = "name of the single primitive this molecule builds"
36
+
37
+ [[steps]]
38
+ id = "spec-component-states"
39
+ title = "SPECIFY the real props and nine states of {{component}}"
40
+ type = "task"
41
+ labels = ["design", "design:subprocess", "sub:component"]
42
+ description = """
43
+ Establish what {{component}} actually is before building it. Read its documented
44
+ property set from http://localhost:6006/manifests/components.json when a
45
+ Storybook exists, or from the component source and its types otherwise: the prop
46
+ names, types, required flags, defaults, and the import statement. Do not assume a
47
+ property from a naming convention or from another library's API, including
48
+ plausible-sounding ones such as shadow or size, and do not trust a story name to
49
+ reflect a property name. Where a needed property is undocumented, ask rather than
50
+ inventing one.
51
+
52
+ Then enumerate what each of the nine states means for {{component}} specifically:
53
+ default, hover, focus-visible, active, disabled, loading, empty, error, selected.
54
+ A state that is genuinely not applicable is recorded as not applicable with the
55
+ reason, which is different from being forgotten. Cite the tokens from node
56
+ {{node}} that each state consumes.
57
+ """
58
+
59
+ [steps.metadata]
60
+ skill_hints = "design-system-audit"
61
+
62
+ [[steps]]
63
+ id = "build-component-isolated"
64
+ title = "BUILD {{component}} in isolation"
65
+ type = "task"
66
+ needs = ["spec-component-states"]
67
+ labels = ["design", "design:subprocess", "sub:component"]
68
+ description = """
69
+ Build {{component}} on its own, with no page and no sibling component around it.
70
+ Implement every one of the nine states SPECIFY kept. Every colour comes from a
71
+ token and every spacing value from the scale, cited from node {{node}}; a raw
72
+ literal here propagates into every future consumer.
73
+
74
+ Where a Storybook exists, add one story per state and one concept per story: a
75
+ single story demonstrating five sizes and variants at once is the named
76
+ anti-pattern. Put a JSDoc description and @summary above the component export and
77
+ above each story, and document every prop, because that is what an agent
78
+ receives. Use the ui-microcopy skill for any copy and the motion-design skill for any
79
+ transition.
80
+ """
81
+
82
+ [[steps]]
83
+ id = "verify-component-states"
84
+ title = "VERIFY {{component}} at component level"
85
+ type = "task"
86
+ needs = ["build-component-isolated"]
87
+ labels = ["design", "design:subprocess", "sub:component"]
88
+ description = """
89
+ Run the ui-review skill against {{component}} in isolation, BEFORE anything
90
+ composes it. Where a Storybook exists, render each story at
91
+ http://localhost:6006/iframe.html?id=<storyId>; otherwise drive a scratch harness
92
+ page holding only {{component}}.
93
+
94
+ Evidence order is fixed: ARIA snapshot first, computed styles second, screenshot
95
+ last. Widths 1440, 768, 375. Assert every one of the nine states SPECIFY kept,
96
+ each with a named citation, and assert the computed values resolve to the tokens
97
+ rather than to literals. A state asserted without evidence is not verified. Run
98
+ the accessibility-audit skill on the isolated component too: focus-visible,
99
+ disabled, and error each carry criteria that are cheaper to fix here than inside a
100
+ page.
101
+ """
102
+
103
+ [steps.metadata]
104
+ skill_hints = "ui-review, accessibility-audit"
105
+
106
+ [[steps]]
107
+ id = "component-verdict"
108
+ title = "VERDICT on {{component}} before it composes"
109
+ type = "task"
110
+ needs = ["verify-component-states"]
111
+ labels = ["design", "design:subprocess", "sub:component"]
112
+ description = """
113
+ Report per state: verified with its citation, not applicable with its reason, or
114
+ failing with its measured value. Report the final prop set and the import
115
+ statement a consumer needs, so composition does not re-derive them.
116
+
117
+ PASS releases {{component}} for composition into {{surface}}. Anything failing
118
+ stays here: composing on an unfinished primitive relocates the failure upward into
119
+ a page, where it costs more to locate, which is the entire reason this molecule
120
+ runs first. State explicitly that {{component}} has not been verified in
121
+ composition, because component-level PASS is not page-level PASS.
122
+ """
@@ -0,0 +1,187 @@
1
+ # mol-design-iterate -- an approved change of visual intent, bonded onto a finished
2
+ # design node for another round.
3
+ #
4
+ # Bond it onto the step whose result was accepted-but-changed, normally the
5
+ # approval gate of a design-touch, design-surface, or design-system molecule:
6
+ # bd mol bond mol-design-iterate <target-id> --var surface=<route> --var node=<node-id> --var round=<n>
7
+ # round is required: bd mol bond does not apply a var default, so a default here
8
+ # would fail the bond anyway. Pass 2 for the first iteration.
9
+ #
10
+ # 6 steps, 2 human gates. The `mol-` prefix marks a formula meant for `bd mol
11
+ # bond`; formulas resolve by filename stem.
12
+ #
13
+ # PRECONDITION: the skills and agents named here ship in the design plugin
14
+ # (srobroek.design).
15
+ #
16
+ # WHY A BONDED MOLECULE RATHER THAN A LOOP: a formula DAG is acyclic and a `needs`
17
+ # cycle is rejected at pour, so iteration cannot be expressed as an edge back to an
18
+ # earlier step. Each round is one bonded molecule. Bond joins root-to-root as a
19
+ # sibling subtree and cannot rewire an inherited step's `needs`, so the bonding
20
+ # side owns the join edge and this file declares no `needs` pointing outside
21
+ # itself, which is also what lets it cook standalone.
22
+ #
23
+ # ONLY THE CHANGED ASSERTION IS RE-VERIFIED. A full re-walk of a surface that
24
+ # already passed costs the same as the first walk and proves nothing new; every
25
+ # step below says so, because the temptation to re-run everything is what makes
26
+ # iteration expensive enough to skip.
27
+ formula = "mol-design-iterate"
28
+ description = "Iterate round {{round}} on {{surface}} from node {{node}}: regrill the changed intent, revise, re-verify only what changed, re-critique, re-audit, re-approve"
29
+ type = "workflow"
30
+
31
+ [vars.surface]
32
+ required = true
33
+ description = "route or URL the agent drives when re-verifying"
34
+
35
+ [vars.node]
36
+ required = true
37
+ description = "id of the design node bead this round iterates on"
38
+
39
+ [vars.round]
40
+ required = true
41
+ description = "round number; 2 is the first iteration after the original node"
42
+
43
+ [[steps]]
44
+ id = "regrill"
45
+ title = "REGRILL round {{round}}: what the previous round got wrong"
46
+ type = "task"
47
+ labels = ["design", "design:subprocess", "sub:iterate"]
48
+ description = """
49
+ Interrogate the user about what round {{round}} minus one got wrong on
50
+ {{surface}}. Number each question, give a recommended answer with it, ask the
51
+ whole current frontier as one batch, then wait.
52
+
53
+ Establish, and record on this bead: which specific assertions the previous round
54
+ got wrong, whether the miss is intent or execution, which of the three dials
55
+ (variance, motion, density) moved and to what value, and what observable state
56
+ counts as done this round. A change of intent is what earns an iteration. A
57
+ change of execution earns none: it goes back to the reconcile-findings step of
58
+ the molecule node {{node}} belongs to, so classify before revising. Read node
59
+ {{node}} for the previous round's evidence rather than asking the user to restate
60
+ it.
61
+
62
+ Without explicit approval for changed intent, record the unanswered questions and
63
+ leave this step unresolved, including unattended runs. Only bd gate resolve closes the gate.
64
+ """
65
+
66
+ [steps.metadata]
67
+ execution_mode = "interactive"
68
+
69
+ [steps.gate]
70
+ type = "human"
71
+ timeout = "72h"
72
+
73
+ [[steps]]
74
+ id = "revise"
75
+ title = "REVISE {{surface}} for round {{round}}"
76
+ type = "task"
77
+ needs = ["regrill"]
78
+ labels = ["design", "design:subprocess", "sub:iterate"]
79
+ description = """
80
+ Apply only the change REGRILL established. Use the ui-microcopy skill for copy and
81
+ the motion-design skill for motion, and cite the token for every value. Touch nothing
82
+ the previous round already got right: an unrequested improvement smuggled into an
83
+ iteration is a change no one approved.
84
+
85
+ Record on this bead what changed since round {{round}} minus one, file by file,
86
+ and which assertions from node {{node}} that change invalidates. That list is the
87
+ input to reverify, so it is not optional narration.
88
+ """
89
+
90
+ [[steps]]
91
+ id = "reverify"
92
+ title = "REVERIFY only the assertions round {{round}} changed"
93
+ type = "task"
94
+ needs = ["revise"]
95
+ labels = ["design", "design:subprocess", "sub:iterate"]
96
+ description = """
97
+ Run the ui-review skill against {{surface}}, restricted to the assertions REVISE
98
+ listed as invalidated. Never re-walk the whole surface: node {{node}} already
99
+ carries the evidence for everything this round did not touch, and re-running it
100
+ proves nothing new.
101
+
102
+ Evidence order is fixed: ARIA snapshot first, computed styles second, screenshot
103
+ last. Widths 1440, 768, 375, and only for the assertions in scope. Verify at
104
+ component level before page level. Cite each re-run.
105
+
106
+ Then apply the design-upstream-preflight skill for the impeccable row, run the
107
+ design_impeccable_scan tool on "{{surface}}" (it asks before it runs
108
+ npx --yes impeccable detect --json), and record its JSON on this bead. RECRITIQUE
109
+ needs it, and design-critic has no shell to run it.
110
+ """
111
+
112
+ [steps.metadata]
113
+ skill_hints = "ui-review"
114
+
115
+ [[steps]]
116
+ id = "recritique"
117
+ title = "RECRITIQUE round {{round}} on {{surface}}"
118
+ type = "task"
119
+ needs = ["reverify"]
120
+ labels = ["design", "design:subprocess", "sub:iterate"]
121
+ description = """
122
+ Spawn design-critic (read-only) in the SAME parallel batch as reaudit, never
123
+ after it. Critique only what round {{round}} changed on {{surface}}, using
124
+ the ui-review skill as critique. Brief it with the impeccable detect JSON that
125
+ reverify recorded, as a COARSE corroborating signal only: its findings carry
126
+ "line": 0, so they are not located evidence and never substitute for driving the
127
+ surface. The critic corroborates each entry by driving {{surface}}. Brief it with
128
+ the changed file paths, the route, the viewport widths, and the token paths: it
129
+ shares no context with the lead.
130
+
131
+ Verdict PASS, MINOR, or MAJOR with named evidence. Do not edit files, and do not
132
+ question the user.
133
+ """
134
+
135
+ [steps.metadata]
136
+ skill_hints = "ui-review"
137
+ execution_agent_type = "design-critic"
138
+ execution_mode = "subagent"
139
+
140
+ [[steps]]
141
+ id = "reaudit"
142
+ title = "REAUDIT WCAG 2.2 AA for round {{round}}"
143
+ type = "task"
144
+ needs = ["reverify"]
145
+ labels = ["design", "design:subprocess", "sub:iterate"]
146
+ description = """
147
+ Spawn a11y-auditor (read-only) in the SAME parallel batch as recritique, never
148
+ after it. Run the accessibility-audit skill over only what round {{round}} changed
149
+ on {{surface}}. A revision can break a criterion the previous round passed, which
150
+ is why this runs every round rather than once.
151
+
152
+ Verdict PASS, MINOR, or MAJOR, where MAJOR means an A or AA criterion fails, and
153
+ every finding carries its WCAG 2.2 criterion number, the measured value, the
154
+ required value, and the selector. Do not edit files, and do not question the user.
155
+ """
156
+
157
+ [steps.metadata]
158
+ skill_hints = "accessibility-audit"
159
+ execution_agent_type = "a11y-auditor"
160
+ execution_mode = "subagent"
161
+
162
+ [[steps]]
163
+ id = "reapprove"
164
+ title = "REAPPROVE round {{round}} of {{surface}}"
165
+ type = "task"
166
+ needs = ["recritique", "reaudit"]
167
+ labels = ["design", "design:subprocess", "sub:iterate"]
168
+ description = """
169
+ Reconcile both verdicts yourself first; do not accept a child verdict you cannot
170
+ reproduce, and report anything unreproduced rather than dropping it. Then present
171
+ round {{round}} for approval: state the round number, what changed since the
172
+ previous round, and the re-verified assertions with their citations. Say
173
+ explicitly which assertions were NOT re-verified and that node {{node}} carries
174
+ their evidence, so the user is approving a delta knowingly.
175
+
176
+ Grill the user: is round {{round}} accepted, or is another round wanted. Number
177
+ each question and give a recommended answer with it. Another round bonds a
178
+ further mol-design-iterate with round incremented, rather than reopening this
179
+ one, so each round keeps its own evidence.
180
+
181
+ Without explicit acceptance, record the evidence and unanswered request and leave
182
+ this step unresolved, including unattended runs. Only bd gate resolve closes the gate.
183
+ """
184
+
185
+ [steps.gate]
186
+ type = "human"
187
+ timeout = "72h"