@srobroek/pi-design 0.0.0 → 0.11.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 (59) hide show
  1. package/CHANGELOG.md +168 -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 +78 -0
  10. package/agents/ui-implementer.md +75 -0
  11. package/agents/ui-ux-specialist.md +129 -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 +46 -0
  50. package/skills/ui-microcopy/references/copy-guidance.md +76 -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,509 @@
1
+ # design-system -- the largest design tier: establishing or rebuilding a design
2
+ # system, not one surface inside an existing one.
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 system:
7
+ # bd mol pour design-system --var surface=<route> --var scope=<paths>
8
+ #
9
+ # 22 steps, 3 human gates. 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
+ # A superset of design-surface. It keeps the three interrogation gates, the
16
+ # Component Driven staging, and the parallel critique-and-a11y pair, and adds the
17
+ # five things a system needs that a surface does not: a token pipeline spine
18
+ # (author layered DTCG, gate the schema, build the artifacts), a theme and density
19
+ # matrix pass, a contrast gate over the generated pairs, a primitive inventory and
20
+ # construction pass, and a documentation pass.
21
+ #
22
+ # THE TOKEN SPINE AND THE PRIMITIVE PASS RUN IN PARALLEL after the artifacts are
23
+ # built: the theme matrix and the contrast gate do not block enumerating and
24
+ # building primitives, and both halves rejoin at verify-components. That is real
25
+ # parallelism, not padding.
26
+ #
27
+ # CANONICALITY, DECIDED: layered DTCG under tokens/**/*.json is the canonical
28
+ # machine source. DESIGN.md is the authored-intent artifact and a linted
29
+ # projection of it, never the compiler input, because design.md export --format
30
+ # dtcg is lossy three ways -- it resolves references into values instead of
31
+ # preserving the alias graph, serialises colours as sRGB components instead of the
32
+ # authored colour space, and emits one flat file with no component, theme, or
33
+ # density tiers.
34
+ #
35
+ # Every join names at least one unconditional step, so a step whose whole `needs`
36
+ # list is filtered keeps its parent edge and becomes ready rather than stranded.
37
+ formula = "design-system"
38
+ description = "Establish or rebuild the design system for {{scope}}: ground and grill, token pipeline, theme and density matrix, contrast gate, primitives, staged build, verify, parallel critique and a11y, document, human approval"
39
+ type = "workflow"
40
+
41
+ [vars.surface]
42
+ required = true
43
+ description = "route or URL the agent drives during VERIFY"
44
+
45
+ [vars.scope]
46
+ required = true
47
+ description = "paths the work may touch"
48
+
49
+ [vars.platform]
50
+ default = "web"
51
+ description = "web uses the browser tools; any other value uses a desktop accessibility inspector for native desktop"
52
+
53
+ # Select documentation only when requested and its upstream is available.
54
+ [vars.want_design_md]
55
+ default = "false"
56
+ description = "true when the user requests DESIGN.md and design-md's upstream is available"
57
+
58
+
59
+ [vars.themes]
60
+ default = "light,dark"
61
+ description = "comma-separated theme axis; every named theme must define the full raw token set"
62
+
63
+ [vars.density]
64
+ default = "comfortable"
65
+ description = "comma-separated density axis; the first value is the default density"
66
+
67
+ [[steps]]
68
+ id = "ground-system"
69
+ title = "GROUND what already exists, and the stack"
70
+ type = "task"
71
+ priority = 1
72
+ labels = ["design", "phase:ground"]
73
+ description = """
74
+ Run the design-system-audit skill across {{scope}}. Inventory every token carrier,
75
+ scale, primitive, and theme mechanism already present, plus the raw literals that
76
+ bypass them. Record the registry on this bead. Verdict PRESENT, PARTIAL, or
77
+ ABSENT. The system decision step evaluates that verdict before any new scale
78
+ is authored. Anything already load-bearing constrains the new system.
79
+
80
+ Detect the stack from evidence, never from a default: package.json dependencies,
81
+ pubspec.yaml, a *.xcodeproj or Package.swift, composer.json, or app.json plus a
82
+ react-native dependency. Record which marker was found. When nothing is
83
+ detectable, ask at the INTENT gate rather than assuming. Platform is
84
+ {{platform}}.
85
+
86
+ Apply the design-upstream-preflight skill here, at GROUND, for every row an ENABLED
87
+ step of this molecule reaches, and record on this bead each install, its path,
88
+ every prerequisite still missing, and every MCP server that did not connect. A
89
+ row that failed to install STOPS the step that needs it, so an unrecorded gap
90
+ strands this molecule there.
91
+
92
+ document-system is conditional on {{want_design_md}}. Record the
93
+ system contract on beads regardless.
94
+ """
95
+
96
+ [steps.metadata]
97
+ skill_hints = "design-system-audit"
98
+
99
+ [[steps]]
100
+ id = "grill-intent"
101
+ title = "INTENT gate: grill the user about the system"
102
+ type = "task"
103
+ needs = ["ground-system"]
104
+ labels = ["design", "phase:gate"]
105
+ description = """
106
+ Interrogate the user before specifying anything. Number each question, give a
107
+ recommended answer with it, ask the whole current frontier as one batch, then
108
+ wait. A question that depends on another still-open question belongs to a later
109
+ round.
110
+
111
+ Establish, and record every answer on this bead: product type (SaaS,
112
+ e-commerce, portfolio, dashboard, tool, productivity, or hybrid); target audience
113
+ and usage context; style keywords; the stack GROUND detected, confirmed rather
114
+ than assumed; the scope edges inside {{scope}}; the observable state that counts
115
+ as done; and three 1-10 dials -- variance (centred and minimal through bold and
116
+ asymmetric), motion (subtle micro-interactions through complex choreography), and
117
+ density (spacious through dense dashboard). Confirm the theme axis {{themes}} and
118
+ the density axis {{density}} are the ones the product actually needs.
119
+
120
+ Never ask what a tool could answer or what the request already specifies.
121
+ Unresolved intent stays blocked without explicit approval, including unattended runs.
122
+ Only bd gate resolve closes the gate.
123
+ """
124
+
125
+ [steps.gate]
126
+ type = "human"
127
+ timeout = "72h"
128
+
129
+ [[steps]]
130
+ id = "grill-system"
131
+ title = "SYSTEM gate: approve the scales this system introduces"
132
+ type = "task"
133
+ needs = ["ground-system"]
134
+ labels = ["design", "phase:gate"]
135
+ description = """
136
+ Read GROUND's verdict and the proposed change. PRESENT with no new scales:
137
+ record N/A with registry evidence and resolve this gate. Otherwise obtain
138
+ explicit approval for each introduced or replaced axis: colour ramps, type
139
+ ratio, spacing base, radii, elevation, and any fluid type scale.
140
+
141
+ Existing approval covering the exact change is sufficient. Without it, leave
142
+ this step unresolved, including unattended runs. Recommended answers are not
143
+ consent. Only bd gate resolve closes the gate.
144
+ """
145
+
146
+ [steps.gate]
147
+ type = "human"
148
+ timeout = "72h"
149
+
150
+ [[steps]]
151
+ id = "specify-system"
152
+ title = "SPECIFY the system contract"
153
+ type = "task"
154
+ needs = ["ground-system", "grill-intent", "grill-system"]
155
+ labels = ["design", "phase:specify"]
156
+ description = """
157
+ Write the system contract from the INTENT answers, not from taste. Name the token
158
+ tiers and their files: foundation.json, semantic.json, component/*.json,
159
+ themes/*.json, density/*.json under tokens/ inside {{scope}}. Tier names are
160
+ project convention, not DTCG semantics, so state them explicitly. Name the theme
161
+ axis {{themes}} and the density axis {{density}} and how each maps to a selector.
162
+ Name the primitive set the system must ship. Pin the source format to DTCG Format
163
+ Module 2025.10.
164
+
165
+ The system decision always precedes this step.
166
+ """
167
+
168
+ [[steps]]
169
+ id = "author-tokens"
170
+ title = "author layered DTCG under tokens/"
171
+ type = "task"
172
+ needs = ["specify-system"]
173
+ labels = ["design", "phase:build", "phase:tokens"]
174
+ description = """
175
+ Author the tiers the contract names, as DTCG JSON under tokens/**/*.json inside
176
+ {{scope}}: foundation.json for raw values, semantic.json for intent-named
177
+ aliases, component/*.json for component-scoped tokens, themes/*.json per theme in
178
+ {{themes}}, density/*.json per value in {{density}}. Preserve the alias graph:
179
+ semantic tiers reference foundation tokens rather than repeating their values.
180
+
181
+ Author colours in the intended colour space and never pre-convert to sRGB, for
182
+ example {"$type":"color","$value":{"colorSpace":"oklch","components":[0.62,0.16,250],"alpha":1}}.
183
+ This layered source is canonical; DESIGN.md is a projection of it, authored later.
184
+ Record on this bead the absolute path of the tokens/ directory you wrote, because
185
+ every later token step runs against that path rather than the session cwd.
186
+ """
187
+
188
+ [[steps]]
189
+ id = "check-token-schema"
190
+ title = "gate the token source against the DTCG schema"
191
+ type = "task"
192
+ needs = ["author-tokens"]
193
+ labels = ["design", "phase:tokens"]
194
+ description = """
195
+ Run an independent schema gate over the authored source, separate from the build
196
+ engine that consumes it. Set TOKENS_DIR to the tokens/ path author-tokens
197
+ recorded, because a bare `find tokens` searches the session cwd and misses a
198
+ source that lives inside {{scope}}:
199
+ find "${TOKENS_DIR:?}" -type f -name '*.json' -print0 | xargs -0 npx --yes --package=@design-token-kit/cli dtokens check --scope schema
200
+ It exits 2 on findings. Fix the source, never the checker. A build that succeeds
201
+ on malformed source has only hidden the problem one layer down, which is why this
202
+ gate is its own bead and runs before any artifact is generated.
203
+ """
204
+
205
+ [[steps]]
206
+ id = "build-token-artifacts"
207
+ title = "build the token artifacts"
208
+ type = "task"
209
+ needs = ["check-token-schema"]
210
+ labels = ["design", "phase:tokens"]
211
+ description = """
212
+ From the package directory that holds TOKENS_DIR and its terrazzo config, run:
213
+ npx --yes --package=@terrazzo/cli tz build
214
+ Terrazzo is the single build authority. It emits CSS custom properties on :root,
215
+ the per-theme and per-density selectors, and typed JS with a .d.ts whose
216
+ keyof Tokens supplies the token-name union, so a bad token name fails typecheck.
217
+
218
+ Never hand-edit a generated artifact, and never add a second builder or a second
219
+ TypeScript generator: two engines means two artifact authorities. Add a project
220
+ CI drift gate that byte-compares each generated artifact, because no build engine
221
+ provides one.
222
+ """
223
+
224
+ [[steps]]
225
+ id = "matrix-theme-density"
226
+ title = "complete the theme and density matrix"
227
+ type = "task"
228
+ needs = ["build-token-artifacts"]
229
+ labels = ["design", "phase:tokens"]
230
+ description = """
231
+ Assert every theme in {{themes}} defines the full raw token set, and every value
232
+ in {{density}} resolves for every theme. Terrazzo generates the permutation
233
+ matrix but asserts no completeness requirement, so this is project policy and
234
+ needs its own check. Assert the fallback selector too: a theme value missing at
235
+ runtime must land on a defined default, not on an unset custom property.
236
+
237
+ Runtime theming stays a browser concern. Apply data-theme alongside
238
+ prefers-color-scheme, read a synchronous boot cache before first paint, and
239
+ confirm the applied values with the ui-review skill's computed styles: no build tool
240
+ can prove the absence of a flash or the correct cascade precedence.
241
+ """
242
+
243
+ [[steps]]
244
+ id = "check-contrast"
245
+ title = "contrast gate over the generated pairs"
246
+ type = "task"
247
+ needs = ["matrix-theme-density"]
248
+ labels = ["design", "phase:tokens"]
249
+ description = """
250
+ Gate contrast over the generated foreground and background pairs, for every theme
251
+ in {{themes}} crossed with every value in {{density}}. Thresholds: 4.5:1 for body
252
+ text, 3:1 for UI boundaries and large text. Use colorjs.io
253
+ foreground.contrast(background, "WCAG21"); it ships no bin, so this is a
254
+ project-owned script.
255
+
256
+ This gate exists because the DESIGN.md linter is not one: its contrast-ratio rule
257
+ warns only below 4.5:1, only on component backgroundColor and textColor pairs,
258
+ with no 3:1 UI-boundary rule and no theme-wide matrix. Record every failing pair
259
+ with its measured ratio and its required ratio.
260
+ """
261
+
262
+ [[steps]]
263
+ id = "inventory-primitives"
264
+ title = "inventory the primitives the system must ship"
265
+ type = "task"
266
+ needs = ["specify-system"]
267
+ labels = ["design", "phase:build"]
268
+ description = """
269
+ Enumerate the primitive set from the system contract: which primitives already
270
+ exist and are load-bearing, which exist but bypass the tokens, and which are
271
+ missing entirely. Runs in parallel with the token spine, because enumerating
272
+ primitives needs the contract, not the built artifacts.
273
+
274
+ For each surviving primitive read its documented property set from
275
+ manifests/components.json when a Storybook exists, or from the component source
276
+ and its types otherwise. Record the inventory with a keep, migrate, or build
277
+ disposition per primitive.
278
+ """
279
+
280
+ [[steps]]
281
+ id = "build-primitives"
282
+ title = "BUILD stage 1: the primitives, in isolation"
283
+ type = "task"
284
+ needs = ["inventory-primitives", "build-token-artifacts"]
285
+ labels = ["design", "phase:build"]
286
+ description = """
287
+ Component Driven stage one. Build or migrate each primitive from the inventory on
288
+ its own, in isolation, starting small. Enumerate default, hover, focus-visible,
289
+ active, disabled, loading, empty, error, selected. Implement every applicable
290
+ state; record N/A with a primitive-specific reason for the others.
291
+
292
+ Every colour comes from a token and every spacing value from the scale; the built
293
+ artifacts exist by now, so a raw literal here is a mistake, not a shortcut.
294
+ Verify each property against manifests/components.json or the component source
295
+ before using it, including plausible-sounding ones such as shadow or size; a
296
+ story name does not reflect a property name. Rename with an LSP rename, never text
297
+ substitution. Bond mol-design-component onto this step per primitive that needs
298
+ its own bead.
299
+ """
300
+
301
+ [[steps]]
302
+ id = "build-composition"
303
+ title = "BUILD stage 2: compose the primitives"
304
+ type = "task"
305
+ needs = ["build-primitives"]
306
+ labels = ["design", "phase:build"]
307
+ description = """
308
+ Component Driven stage two. Compose the primitives into larger components,
309
+ increasing complexity gradually. Compose only what stage one already covers; a
310
+ composition built on an unfinished primitive relocates the failure upward, which
311
+ is the cost this staging exists to avoid.
312
+ """
313
+
314
+ [[steps]]
315
+ id = "build-pages"
316
+ title = "BUILD stage 3: assemble pages with mock data"
317
+ type = "task"
318
+ needs = ["build-composition"]
319
+ labels = ["design", "phase:build"]
320
+ description = """
321
+ Component Driven stage three. Assemble {{surface}} from the composite components,
322
+ using mock data to simulate the hard-to-reach states and the edge cases: empty
323
+ collections, long strings, missing images, permission-denied, partial failure,
324
+ and the loading and error states real data will not reproduce on demand. Mock
325
+ data is what makes those states reachable at all, so do not defer them to
326
+ integration. Page-first development is the named anti-pattern; this step is
327
+ third for that reason.
328
+ """
329
+
330
+ [[steps]]
331
+ id = "integrate-data"
332
+ title = "BUILD stage 4: integrate real data and logic"
333
+ type = "task"
334
+ needs = ["build-pages"]
335
+ labels = ["design", "phase:build"]
336
+ description = """
337
+ Component Driven stage four. Connect data and business logic so {{surface}} meets
338
+ the real backend. Every state the mock data reached must still be reachable with
339
+ real data, or the state has been lost rather than integrated. Record which states
340
+ are now driven by real responses and which remain mock-only.
341
+ """
342
+
343
+ [[steps]]
344
+ id = "verify-components"
345
+ title = "VERIFY the primitives at component level"
346
+ type = "task"
347
+ needs = ["build-primitives", "check-contrast"]
348
+ labels = ["design", "phase:verify"]
349
+ description = """
350
+ Run the ui-review skill against each primitive in isolation, before anything
351
+ page-level is verified, because a component-level failure is smaller and more
352
+ precise to locate. Drive the real component: the browser tools when {{platform}} is
353
+ web, a desktop accessibility inspector otherwise. Where a Storybook exists, render the isolated story at
354
+ iframe.html?id=<storyId>; otherwise use a scratch harness page.
355
+
356
+ Evidence order is fixed: ARIA snapshot first, computed styles second, screenshot
357
+ last. Widths 1440, 768, 375. Assert every applicable state per primitive, and assert the
358
+ computed values resolve to the generated tokens for every theme in {{themes}}.
359
+ This is where the token spine and the primitive pass rejoin.
360
+ """
361
+
362
+ [steps.metadata]
363
+ skill_hints = "ui-review"
364
+
365
+ [[steps]]
366
+ id = "verify-surface"
367
+ title = "VERIFY {{surface}} at page level"
368
+ type = "task"
369
+ needs = ["integrate-data", "verify-components"]
370
+ labels = ["design", "phase:verify"]
371
+ description = """
372
+ Run the ui-review skill against {{surface}} only after verify-components passed.
373
+ Evidence order is fixed: ARIA snapshot first, computed styles second, screenshot
374
+ last. Widths 1440, 768, 375. Walk the compositions, then the page itself. Every
375
+ claim carries a named citation; an unwitnessed state is not verified. A reflow or
376
+ target-size problem bonds mol-design-responsive onto this step.
377
+
378
+ Then run the design_impeccable_scan tool on "{{surface}}" (it asks before it runs
379
+ npx --yes impeccable detect --json) and record its JSON on this bead. CRITIQUE
380
+ needs it, and design-critic has no shell to run it.
381
+ """
382
+
383
+ [steps.metadata]
384
+ skill_hints = "ui-review"
385
+
386
+ [[steps]]
387
+ id = "critique-visual"
388
+ title = "CRITIQUE visual and UX"
389
+ type = "task"
390
+ needs = ["verify-surface"]
391
+ labels = ["design", "phase:critique"]
392
+ description = """
393
+ Spawn design-critic (read-only) in the SAME parallel batch as
394
+ audit-accessibility, never after it. Run the ui-review skill as critique on
395
+ {{surface}} and on the primitive set. Brief it with the impeccable detect JSON that
396
+ verify-surface recorded, as a COARSE corroborating signal only: its findings carry
397
+ "line": 0, so they are not located evidence and never substitute for driving the
398
+ surface. The critic corroborates each entry by driving the surface and cites that
399
+ location. Verdict PASS, MINOR, or MAJOR with named evidence. Do not edit files, and
400
+ do not question the user: the lead owns the conversation. A self-review by whoever
401
+ built the system shares its blind spots.
402
+ """
403
+
404
+ [steps.metadata]
405
+ skill_hints = "ui-review"
406
+ execution_agent_type = "design-critic"
407
+ execution_mode = "subagent"
408
+
409
+ [[steps]]
410
+ id = "audit-accessibility"
411
+ title = "AUDIT WCAG 2.2 AA"
412
+ type = "task"
413
+ needs = ["verify-surface"]
414
+ labels = ["design", "phase:critique"]
415
+ description = """
416
+ Spawn a11y-auditor (read-only) in the SAME parallel batch as critique-visual,
417
+ never after it. Run the accessibility-audit skill on {{surface}} and on the
418
+ primitive set. Verdict PASS, MINOR, or MAJOR, where MAJOR means an A or AA
419
+ criterion fails, and every finding carries its WCAG 2.2 criterion number, the
420
+ measured value, the required value, and the selector. Do not edit files, and do
421
+ not question the user. A MAJOR verdict bonds mol-design-a11y onto this step.
422
+ """
423
+
424
+ [steps.metadata]
425
+ skill_hints = "accessibility-audit"
426
+ execution_agent_type = "a11y-auditor"
427
+ execution_mode = "subagent"
428
+
429
+ [[steps]]
430
+ id = "reconcile-findings"
431
+ title = "RECONCILE critique and a11y findings"
432
+ type = "task"
433
+ needs = ["critique-visual", "audit-accessibility"]
434
+ labels = ["design", "phase:reconcile"]
435
+ description = """
436
+ Reconcile both verdicts yourself. Fix every MAJOR finding and every agreed MINOR inside
437
+ {{scope}}. A finding that traces to a token rather than a component is fixed in
438
+ the token source and rebuilt, never patched in generated CSS. Re-verify only the
439
+ changed assertion, never the whole walk, and leave a citation per re-run. Do not
440
+ accept a child verdict you cannot reproduce: report it as unreproduced rather
441
+ than dropping it silently. Record findings on this step and resolve them before continuing.
442
+ """
443
+
444
+ [[steps]]
445
+ id = "fix-round"
446
+ title = "one more fix pass on the system"
447
+ type = "task"
448
+ needs = ["reconcile-findings"]
449
+ labels = ["design", "phase:reconcile"]
450
+ description = """
451
+ Read the reconciled findings at runtime. None remain: record N/A with the
452
+ reconciled evidence and close this step. Otherwise perform the pass below.
453
+ A deliberate second pass over what RECONCILE left, when that is cheaper than
454
+ another molecule. Fix inside {{scope}} only, re-verify only the changed
455
+ assertion, and record what changed since the previous round along with the round
456
+ number. Anything still unresolved after this pass is an intent problem, not a fix
457
+ problem: bond mol-design-iterate rather than adding a third pass here.
458
+ """
459
+
460
+ [[steps]]
461
+ id = "document-system"
462
+ title = "document the system and write DESIGN.md"
463
+ type = "task"
464
+ needs = ["reconcile-findings", "fix-round"]
465
+ condition = "{{want_design_md}}"
466
+ labels = ["design", "phase:document"]
467
+ description = """
468
+ Run the design-md skill. Write repo-root DESIGN.md as the authored-intent artifact:
469
+ frontmatter tokens (colors, typography, spacing, radii, elevation, optional
470
+ motion) then Scope and Intent through Known Gaps. Every {group.token} must
471
+ resolve. Unknowns go under Known Gaps. TODO or TO_FILL is invalid. Token values
472
+ must appear literally, because static analysis cannot read a file that maps over
473
+ a token object.
474
+
475
+ Also record: the tier files and what each owns, the theme axis {{themes}} and the
476
+ density axis {{density}} with their selectors, the primitive inventory with its
477
+ dispositions, and which artifacts are generated and by what command. State that
478
+ tokens/**/*.json is canonical and DESIGN.md is a projection. Gate the result
479
+ with: npx --yes @google/design.md lint "$(git rev-parse --show-toplevel)/DESIGN.md"
480
+ Review a change to it with: npx --yes @google/design.md diff "<before>" "<after>"
481
+
482
+ When documentation is not requested, retain the contract and evidence on beads.
483
+ """
484
+
485
+ [steps.metadata]
486
+ skill_hints = "design-md"
487
+
488
+ [[steps]]
489
+ id = "system-approval"
490
+ title = "ACCEPT gate: human approval of the system"
491
+ type = "task"
492
+ needs = ["fix-round", "document-system"]
493
+ labels = ["design", "phase:gate"]
494
+ description = """
495
+ Present the whole chain for approval: the schema gate result, the theme and
496
+ density matrix, the contrast gate with every measured ratio, the primitive
497
+ inventory, the component-level and page-level evidence, both child verdicts, and
498
+ DESIGN.md when requested, otherwise the recorded system contract. Ask the user
499
+ whether the system is accepted as the project's authority and another iteration is wanted.
500
+ Number unresolved questions and give a recommended answer with each.
501
+
502
+ Without explicit acceptance, record the evidence and unanswered request and leave
503
+ this step unresolved, including unattended runs. Only bd gate resolve closes the
504
+ gate. An approved additional round bonds mol-design-iterate onto this step.
505
+ """
506
+
507
+ [steps.gate]
508
+ type = "human"
509
+ timeout = "72h"