@monoes/monomindcli 2.16.1 → 2.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/.claude/helpers/handlers/edit-handler.cjs +14 -12
  2. package/.claude/helpers/handlers/route-handler.cjs +6 -0
  3. package/.claude/helpers/monograph-freshen.cjs +31 -113
  4. package/.claude/helpers/utils/monograph-resolve.cjs +497 -0
  5. package/.claude/helpers/utils/monograph.cjs +8 -51
  6. package/README.md +1 -1
  7. package/dist/src/commands/doctor-hook-monograph-checks.d.ts +8 -0
  8. package/dist/src/commands/doctor-hook-monograph-checks.d.ts.map +1 -0
  9. package/dist/src/commands/doctor-hook-monograph-checks.js +79 -0
  10. package/dist/src/commands/doctor-hook-monograph-checks.js.map +1 -0
  11. package/dist/src/commands/doctor.d.ts.map +1 -1
  12. package/dist/src/commands/doctor.js +4 -1
  13. package/dist/src/commands/doctor.js.map +1 -1
  14. package/dist/src/commands/monograph.d.ts.map +1 -1
  15. package/dist/src/commands/monograph.js +16 -1
  16. package/dist/src/commands/monograph.js.map +1 -1
  17. package/dist/src/orgrt/bash-timeout.d.ts +14 -0
  18. package/dist/src/orgrt/bash-timeout.d.ts.map +1 -0
  19. package/dist/src/orgrt/bash-timeout.js +18 -0
  20. package/dist/src/orgrt/bash-timeout.js.map +1 -0
  21. package/dist/src/orgrt/block-recheck.d.ts +30 -0
  22. package/dist/src/orgrt/block-recheck.d.ts.map +1 -0
  23. package/dist/src/orgrt/block-recheck.js +81 -0
  24. package/dist/src/orgrt/block-recheck.js.map +1 -0
  25. package/dist/src/orgrt/completion-gate.d.ts +4 -0
  26. package/dist/src/orgrt/completion-gate.d.ts.map +1 -1
  27. package/dist/src/orgrt/completion-gate.js +22 -2
  28. package/dist/src/orgrt/completion-gate.js.map +1 -1
  29. package/dist/src/orgrt/daemon.d.ts.map +1 -1
  30. package/dist/src/orgrt/daemon.js +6 -4
  31. package/dist/src/orgrt/daemon.js.map +1 -1
  32. package/dist/src/orgrt/decisions.d.ts +1 -1
  33. package/dist/src/orgrt/decisions.d.ts.map +1 -1
  34. package/dist/src/orgrt/decisions.js +14 -6
  35. package/dist/src/orgrt/decisions.js.map +1 -1
  36. package/dist/src/orgrt/mailbox.d.ts +14 -0
  37. package/dist/src/orgrt/mailbox.d.ts.map +1 -1
  38. package/dist/src/orgrt/mailbox.js +31 -1
  39. package/dist/src/orgrt/mailbox.js.map +1 -1
  40. package/dist/src/orgrt/sandbox-fault.d.ts +16 -6
  41. package/dist/src/orgrt/sandbox-fault.d.ts.map +1 -1
  42. package/dist/src/orgrt/sandbox-fault.js +78 -33
  43. package/dist/src/orgrt/sandbox-fault.js.map +1 -1
  44. package/dist/src/orgrt/session.d.ts +4 -3
  45. package/dist/src/orgrt/session.d.ts.map +1 -1
  46. package/dist/src/orgrt/session.js +24 -13
  47. package/dist/src/orgrt/session.js.map +1 -1
  48. package/dist/src/orgrt/task-dag.d.ts +8 -2
  49. package/dist/src/orgrt/task-dag.d.ts.map +1 -1
  50. package/dist/src/orgrt/task-dag.js +10 -4
  51. package/dist/src/orgrt/task-dag.js.map +1 -1
  52. package/dist/src/orgrt/types.d.ts +11 -0
  53. package/dist/src/orgrt/types.d.ts.map +1 -1
  54. package/dist/src/orgrt/types.js +18 -0
  55. package/dist/src/orgrt/types.js.map +1 -1
  56. package/dist/src/utils/resource-governor.d.ts.map +1 -1
  57. package/dist/src/utils/resource-governor.js +35 -2
  58. package/dist/src/utils/resource-governor.js.map +1 -1
  59. package/dist/tsconfig.tsbuildinfo +1 -1
  60. package/package.json +6 -6
  61. package/.claude/skills/monodesign/SKILL.md +0 -257
  62. package/.claude/skills/monodesign/adapt.md +0 -53
  63. package/.claude/skills/monodesign/agents/monodesign-asset-producer.md +0 -100
  64. package/.claude/skills/monodesign/agents/monodesign-manual-edit-applier.md +0 -103
  65. package/.claude/skills/monodesign/animate.md +0 -65
  66. package/.claude/skills/monodesign/audit.md +0 -89
  67. package/.claude/skills/monodesign/bolder.md +0 -50
  68. package/.claude/skills/monodesign/clarify.md +0 -64
  69. package/.claude/skills/monodesign/colorize.md +0 -68
  70. package/.claude/skills/monodesign/craft.md +0 -51
  71. package/.claude/skills/monodesign/critique.md +0 -66
  72. package/.claude/skills/monodesign/delight.md +0 -47
  73. package/.claude/skills/monodesign/distill.md +0 -56
  74. package/.claude/skills/monodesign/document.md +0 -83
  75. package/.claude/skills/monodesign/extract.md +0 -74
  76. package/.claude/skills/monodesign/harden.md +0 -65
  77. package/.claude/skills/monodesign/init.md +0 -30
  78. package/.claude/skills/monodesign/layout.md +0 -36
  79. package/.claude/skills/monodesign/live.md +0 -34
  80. package/.claude/skills/monodesign/onboard.md +0 -50
  81. package/.claude/skills/monodesign/optimize.md +0 -64
  82. package/.claude/skills/monodesign/overdrive.md +0 -56
  83. package/.claude/skills/monodesign/polish.md +0 -68
  84. package/.claude/skills/monodesign/quieter.md +0 -57
  85. package/.claude/skills/monodesign/reference/adapt.md +0 -312
  86. package/.claude/skills/monodesign/reference/adapt.native.md +0 -58
  87. package/.claude/skills/monodesign/reference/android.md +0 -40
  88. package/.claude/skills/monodesign/reference/animate.md +0 -203
  89. package/.claude/skills/monodesign/reference/antipatterns-catalog.md +0 -410
  90. package/.claude/skills/monodesign/reference/audit.md +0 -135
  91. package/.claude/skills/monodesign/reference/audit.native.md +0 -139
  92. package/.claude/skills/monodesign/reference/bolder.md +0 -120
  93. package/.claude/skills/monodesign/reference/brand-workflow.md +0 -180
  94. package/.claude/skills/monodesign/reference/brand.md +0 -108
  95. package/.claude/skills/monodesign/reference/clarify.md +0 -288
  96. package/.claude/skills/monodesign/reference/codex.md +0 -105
  97. package/.claude/skills/monodesign/reference/cognitive-load.md +0 -106
  98. package/.claude/skills/monodesign/reference/color-and-contrast.md +0 -105
  99. package/.claude/skills/monodesign/reference/colorize.md +0 -257
  100. package/.claude/skills/monodesign/reference/component-specs.md +0 -260
  101. package/.claude/skills/monodesign/reference/component-states.md +0 -274
  102. package/.claude/skills/monodesign/reference/component-system.md +0 -358
  103. package/.claude/skills/monodesign/reference/copy-formulas.md +0 -160
  104. package/.claude/skills/monodesign/reference/craft.md +0 -123
  105. package/.claude/skills/monodesign/reference/critique.md +0 -780
  106. package/.claude/skills/monodesign/reference/delight.md +0 -302
  107. package/.claude/skills/monodesign/reference/design-principles.md +0 -246
  108. package/.claude/skills/monodesign/reference/distill.md +0 -111
  109. package/.claude/skills/monodesign/reference/document.md +0 -429
  110. package/.claude/skills/monodesign/reference/extract.md +0 -69
  111. package/.claude/skills/monodesign/reference/harden.md +0 -347
  112. package/.claude/skills/monodesign/reference/heuristics-scoring.md +0 -234
  113. package/.claude/skills/monodesign/reference/hooks.md +0 -92
  114. package/.claude/skills/monodesign/reference/image-prompts.md +0 -130
  115. package/.claude/skills/monodesign/reference/init.md +0 -221
  116. package/.claude/skills/monodesign/reference/interaction-design.md +0 -189
  117. package/.claude/skills/monodesign/reference/ios.md +0 -45
  118. package/.claude/skills/monodesign/reference/layout.md +0 -185
  119. package/.claude/skills/monodesign/reference/live.md +0 -710
  120. package/.claude/skills/monodesign/reference/motion-design.md +0 -109
  121. package/.claude/skills/monodesign/reference/onboard.md +0 -234
  122. package/.claude/skills/monodesign/reference/optimize.md +0 -258
  123. package/.claude/skills/monodesign/reference/overdrive.md +0 -130
  124. package/.claude/skills/monodesign/reference/personas.md +0 -179
  125. package/.claude/skills/monodesign/reference/polish.md +0 -241
  126. package/.claude/skills/monodesign/reference/pre-delivery-checklist.md +0 -108
  127. package/.claude/skills/monodesign/reference/product.md +0 -60
  128. package/.claude/skills/monodesign/reference/quieter.md +0 -99
  129. package/.claude/skills/monodesign/reference/responsive-design.md +0 -114
  130. package/.claude/skills/monodesign/reference/shape.md +0 -165
  131. package/.claude/skills/monodesign/reference/spatial-design.md +0 -100
  132. package/.claude/skills/monodesign/reference/teach.md +0 -10
  133. package/.claude/skills/monodesign/reference/token-architecture.md +0 -222
  134. package/.claude/skills/monodesign/reference/typeset.md +0 -301
  135. package/.claude/skills/monodesign/reference/typography.md +0 -159
  136. package/.claude/skills/monodesign/reference/ux-research.md +0 -143
  137. package/.claude/skills/monodesign/reference/ux-rules.md +0 -211
  138. package/.claude/skills/monodesign/reference/ux-writing.md +0 -107
  139. package/.claude/skills/monodesign/scripts/command-metadata.json +0 -94
  140. package/.claude/skills/monodesign/scripts/context-signals.mjs +0 -260
  141. package/.claude/skills/monodesign/scripts/context.mjs +0 -1065
  142. package/.claude/skills/monodesign/scripts/critique-storage.mjs +0 -416
  143. package/.claude/skills/monodesign/scripts/detect-csp.mjs +0 -193
  144. package/.claude/skills/monodesign/scripts/detect.mjs +0 -33
  145. package/.claude/skills/monodesign/scripts/detector/browser/injected/index.mjs +0 -1960
  146. package/.claude/skills/monodesign/scripts/detector/cli/main.mjs +0 -321
  147. package/.claude/skills/monodesign/scripts/detector/design-system.mjs +0 -814
  148. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns-browser.js +0 -5628
  149. package/.claude/skills/monodesign/scripts/detector/detect-antipatterns.mjs +0 -50
  150. package/.claude/skills/monodesign/scripts/detector/engines/browser/detect-url.mjs +0 -259
  151. package/.claude/skills/monodesign/scripts/detector/engines/browser/drivers.mjs +0 -339
  152. package/.claude/skills/monodesign/scripts/detector/engines/regex/detect-text.mjs +0 -636
  153. package/.claude/skills/monodesign/scripts/detector/engines/static-html/css-cascade.mjs +0 -1016
  154. package/.claude/skills/monodesign/scripts/detector/engines/static-html/detect-html.mjs +0 -253
  155. package/.claude/skills/monodesign/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -198
  156. package/.claude/skills/monodesign/scripts/detector/findings.mjs +0 -12
  157. package/.claude/skills/monodesign/scripts/detector/fix/css-regions.mjs +0 -181
  158. package/.claude/skills/monodesign/scripts/detector/fix/fixers.mjs +0 -373
  159. package/.claude/skills/monodesign/scripts/detector/fix/index.mjs +0 -426
  160. package/.claude/skills/monodesign/scripts/detector/node/file-system.mjs +0 -198
  161. package/.claude/skills/monodesign/scripts/detector/profile/profiler.mjs +0 -166
  162. package/.claude/skills/monodesign/scripts/detector/registry/antipatterns.mjs +0 -563
  163. package/.claude/skills/monodesign/scripts/detector/rules/checks.mjs +0 -3024
  164. package/.claude/skills/monodesign/scripts/detector/shared/color.mjs +0 -124
  165. package/.claude/skills/monodesign/scripts/detector/shared/constants.mjs +0 -101
  166. package/.claude/skills/monodesign/scripts/detector/shared/fonts.mjs +0 -30
  167. package/.claude/skills/monodesign/scripts/detector/shared/inline-ignores.mjs +0 -148
  168. package/.claude/skills/monodesign/scripts/detector/shared/page.mjs +0 -7
  169. package/.claude/skills/monodesign/scripts/hook-admin.mjs +0 -694
  170. package/.claude/skills/monodesign/scripts/hook-before-edit.mjs +0 -516
  171. package/.claude/skills/monodesign/scripts/hook-lib.mjs +0 -1785
  172. package/.claude/skills/monodesign/scripts/hook.mjs +0 -61
  173. package/.claude/skills/monodesign/scripts/lib/design-parser.mjs +0 -809
  174. package/.claude/skills/monodesign/scripts/lib/is-generated.mjs +0 -69
  175. package/.claude/skills/monodesign/scripts/lib/monodesign-config.mjs +0 -640
  176. package/.claude/skills/monodesign/scripts/lib/monodesign-paths.mjs +0 -129
  177. package/.claude/skills/monodesign/scripts/lib/provider.mjs +0 -4
  178. package/.claude/skills/monodesign/scripts/lib/target-args.mjs +0 -42
  179. package/.claude/skills/monodesign/scripts/live/browser-script-parts.mjs +0 -50
  180. package/.claude/skills/monodesign/scripts/live/completion.mjs +0 -19
  181. package/.claude/skills/monodesign/scripts/live/event-validation.mjs +0 -137
  182. package/.claude/skills/monodesign/scripts/live/insert-ui.mjs +0 -458
  183. package/.claude/skills/monodesign/scripts/live/manual-apply.mjs +0 -939
  184. package/.claude/skills/monodesign/scripts/live/manual-edit-routes.mjs +0 -357
  185. package/.claude/skills/monodesign/scripts/live/manual-edits-buffer.mjs +0 -152
  186. package/.claude/skills/monodesign/scripts/live/session-store.mjs +0 -293
  187. package/.claude/skills/monodesign/scripts/live/svelte-component.mjs +0 -826
  188. package/.claude/skills/monodesign/scripts/live/sveltekit-adapter.mjs +0 -279
  189. package/.claude/skills/monodesign/scripts/live/ui-core.mjs +0 -180
  190. package/.claude/skills/monodesign/scripts/live/vocabulary.mjs +0 -36
  191. package/.claude/skills/monodesign/scripts/live-accept.mjs +0 -812
  192. package/.claude/skills/monodesign/scripts/live-browser-dom.js +0 -147
  193. package/.claude/skills/monodesign/scripts/live-browser-session.js +0 -124
  194. package/.claude/skills/monodesign/scripts/live-browser.js +0 -11213
  195. package/.claude/skills/monodesign/scripts/live-commit-manual-edits.mjs +0 -1241
  196. package/.claude/skills/monodesign/scripts/live-complete.mjs +0 -75
  197. package/.claude/skills/monodesign/scripts/live-copy-edit-agent.mjs +0 -683
  198. package/.claude/skills/monodesign/scripts/live-discard-manual-edits.mjs +0 -51
  199. package/.claude/skills/monodesign/scripts/live-inject.mjs +0 -596
  200. package/.claude/skills/monodesign/scripts/live-insert.mjs +0 -272
  201. package/.claude/skills/monodesign/scripts/live-manual-edit-evidence.mjs +0 -363
  202. package/.claude/skills/monodesign/scripts/live-poll.mjs +0 -384
  203. package/.claude/skills/monodesign/scripts/live-resume.mjs +0 -94
  204. package/.claude/skills/monodesign/scripts/live-server.mjs +0 -1210
  205. package/.claude/skills/monodesign/scripts/live-status.mjs +0 -61
  206. package/.claude/skills/monodesign/scripts/live-target.mjs +0 -30
  207. package/.claude/skills/monodesign/scripts/live-wrap.mjs +0 -884
  208. package/.claude/skills/monodesign/scripts/live.mjs +0 -297
  209. package/.claude/skills/monodesign/scripts/modern-screenshot.umd.js +0 -14
  210. package/.claude/skills/monodesign/scripts/palette.mjs +0 -635
  211. package/.claude/skills/monodesign/scripts/pin.mjs +0 -221
  212. package/.claude/skills/monodesign/shape.md +0 -71
  213. package/.claude/skills/monodesign/teach.md +0 -18
  214. package/.claude/skills/monodesign/typeset.md +0 -59
@@ -1,185 +0,0 @@
1
- Space is the most underused design tool. Find the layout's actual problem (monotone spacing, weak hierarchy, identical card grids) and fix the structure, not the surface.
2
-
3
- ---
4
-
5
- ## Register
6
-
7
- Brand: asymmetric compositions, fluid spacing with `clamp()`, intentional grid-breaking for emphasis. Rhythm through contrast: tight groupings paired with generous separations.
8
-
9
- Product: predictable grids, consistent densities, familiar navigation patterns. Responsive behavior is structural (collapse sidebar, responsive table), not fluid typography. Consistency IS an affordance.
10
-
11
- Native (`ios` / `android` / `adaptive`): structure follows the Layout section of [ios.md](ios.md) / [android.md](android.md) (read it first if Setup hasn't already): platform navigation, insets, and touch targets, never the CSS tooling below.
12
-
13
- ---
14
-
15
- ## Two isolated assessments (required)
16
-
17
- Spawn two parallel sub-agents whenever a sub-agent/Task tool is exposed: one for the layout assessment, one for the mechanical pre-scan. If the harness needs explicit user permission for sub-agents, stop and ask before proceeding. Isolation is the point: detector output anchors visual judgment toward what the scan can see, so neither sub-agent gets the other's output. Each assessment runs in its own sub-agent; running either one in this context when a sub-agent tool exists is not permitted, even when it is faster; the fallback below is only for sessions with no sub-agent tool. Give each a self-contained prompt (target files, register, documented spacing scale when present, and its instructions below); do not assume it can read this file.
18
-
19
- **Sub-agent A (layout assessment)**: give it the full [Assess Current Layout](#assess-current-layout) checklist below, verbatim, in its prompt. It works through every item and returns per-item findings citing file, selector, or value.
20
-
21
- **Sub-agent B (mechanical pre-scan)**: run the bundled detector scoped to layout:
22
-
23
- ```bash
24
- node .claude/skills/monodesign/scripts/detect.mjs --json --scope layout [target files or dirs]
25
- ```
26
-
27
- A missing `node` on PATH is not permission to skip: hunt for a runtime (`command -v node`, nvm or Homebrew paths, the harness's own bundled node) and run it by full path. If none exists, halt the scan and report that Node must be installed (the parent relays this to the user); do **not** substitute grep for the detector or proceed unscanned. The detector abstains on arbitrary Tailwind spacing (`gap-[13px]`, `p-[7px]`) and ad-hoc `z-index` stacks, so when the project documents a spacing scale, also grep `gap-\[`, `p[trblxy]?-\[`, `m[trblxy]?-\[`, `z-\[` and judge those hits against it. Return the findings JSON plus the grep verdicts.
28
-
29
- **If no sub-agent tool is exposed (or the user declined)**: run both yourself, assessment first, pre-scan second, so the deterministic findings can't anchor the visual judgment. Keep that order even when the scan feels quicker to start with.
30
-
31
- **Synthesize** once both are done: merge into a single findings list, noting where they agree and what each caught alone. Fix every finding, or list it as a deliberate exception for the user to accept. A clean scan is a floor, not a verdict: a monotone grid with uniform spacing passes every detector rule, which is exactly what the assessment exists to catch. State in your final summary which path ran (parallel sub-agents or single-context fallback).
32
-
33
- ---
34
-
35
- ## Assess Current Layout
36
-
37
- This checklist is sub-agent A's brief (on the fallback path, work through it yourself before the pre-scan). Analyze what's weak about the current spatial design:
38
-
39
- 1. **Spacing**:
40
- - Is spacing consistent or arbitrary? (Random padding/margin values)
41
- - Is all spacing the same? (Equal padding everywhere = no rhythm)
42
- - Are related elements grouped tightly, with generous space between groups?
43
-
44
- 2. **Visual hierarchy**:
45
- - Apply the squint test: blur your (metaphorical) eyes. Can you still identify the most important element, second most important, and clear groupings?
46
- - Is hierarchy achieved effectively? (Space and weight alone can be enough; is the current approach working?)
47
- - Does whitespace guide the eye to what matters?
48
-
49
- 3. **Grid & structure**:
50
- - Is there a clear underlying structure, or does the layout feel random?
51
- - Are identical card grids used everywhere? (Icon + heading + text, repeated endlessly)
52
-
53
- 4. **Rhythm & variety**:
54
- - Does the layout have visual rhythm? (Alternating tight/generous spacing)
55
- - Is every section structured the same way? (Monotonous repetition)
56
- - Are there intentional moments of surprise or emphasis?
57
-
58
- 5. **Density**:
59
- - Is the layout too cramped? (Not enough breathing room)
60
- - Is the layout too sparse? (Excessive whitespace without purpose)
61
- - Does density match the content type? (Data-dense UIs need tighter spacing; marketing pages need more air)
62
-
63
- **CRITICAL**: Layout problems are often the root cause of interfaces feeling "off" even when colors and fonts are fine. Space is a design material; use it with intention.
64
-
65
- ## Plan Layout Improvements
66
-
67
- Create a systematic plan:
68
-
69
- - **Spacing system**: Use a consistent scale (a framework's built-in scale like Tailwind's, rem-based tokens, or a custom system). The specific values matter less than consistency.
70
- - **Hierarchy strategy**: How will space communicate importance?
71
- - **Layout approach**: What structure fits the content? Flex for 1D, Grid for 2D, named areas for complex page layouts.
72
- - **Rhythm**: Where should spacing be tight vs generous?
73
-
74
- ## Improve Layout Systematically
75
-
76
- ### Establish a Spacing System
77
-
78
- - Use a consistent spacing scale (framework scales like Tailwind, rem-based tokens, or a custom scale all work). What matters is that values come from a defined set, not arbitrary numbers.
79
- - Prefer a 4pt base scale (4, 8, 12, 16, 24, 32, 48, 64, 96px) over 8pt; 8pt is too coarse and you'll frequently need 12px between 8 and 16.
80
- - Name tokens semantically if using custom properties: `--space-xs` through `--space-xl`, not `--spacing-8`
81
- - Use `gap` for sibling spacing instead of margins; eliminates margin collapse hacks
82
- - Apply `clamp()` for fluid spacing that breathes on larger screens
83
-
84
- ### Create Visual Rhythm
85
-
86
- - **Tight grouping** for related elements (8-12px between siblings)
87
- - **Generous separation** between distinct sections (48-96px)
88
- - **Varied spacing** within sections (not every row needs the same gap)
89
- - **Asymmetric compositions**: a deliberate choice when the content invites it (not a default to chase).
90
-
91
- ### Choose the Right Layout Tool
92
-
93
- - **Use Flexbox for 1D layouts**: Rows of items, nav bars, button groups, card contents, most component internals.
94
- - **Use Grid for 2D layouts**: Page-level structure, dashboards, data-dense interfaces, anything where rows AND columns need coordinated control.
95
- - Use named grid areas (`grid-template-areas`) for complex page layouts; redefine at breakpoints.
96
- - Use **container queries** for components, viewport queries for page layouts. A card in a narrow sidebar can stay compact while the same card in a main content area expands automatically:
97
-
98
- ```css
99
- .card-container { container-type: inline-size; }
100
- .card { display: grid; gap: var(--space-md); }
101
- @container (min-width: 400px) {
102
- .card { grid-template-columns: 120px 1fr; }
103
- }
104
- ```
105
-
106
- ### Break Card Grid Monotony
107
-
108
- - Don't default to card grids for everything; spacing and alignment create visual grouping naturally
109
- - Use cards only when content is truly distinct and actionable. Never nest cards inside cards
110
- - Vary card sizes, span columns, or mix cards with non-card content to break repetition
111
-
112
- ### Strengthen Visual Hierarchy
113
-
114
- - Use the fewest dimensions needed for clear hierarchy. Space alone can be enough; generous whitespace around an element draws the eye. Some of the most polished designs achieve rhythm with just space and weight. Add color or size contrast only when simpler means aren't sufficient.
115
- - The best hierarchy combines 2–3 dimensions at once. A heading that's larger, bolder, AND has more space above it reads as primary without trying:
116
-
117
- | Tool | Strong Hierarchy | Weak Hierarchy |
118
- |------|------------------|----------------|
119
- | **Size** | 3:1 ratio or more | <2:1 ratio |
120
- | **Weight** | Bold vs Regular | Medium vs Regular |
121
- | **Color** | High contrast | Similar tones |
122
- | **Position** | Top/left (primary) | Bottom/right |
123
- | **Space** | Surrounded by white space | Crowded |
124
-
125
- - Be aware of reading flow: in LTR languages, the eye naturally scans top-left to bottom-right, but primary action placement depends on context (e.g., bottom-right in dialogs, top in navigation).
126
- - Create clear content groupings through proximity and separation.
127
-
128
- ### Manage Depth & Elevation
129
-
130
- - Build a consistent shadow scale (sm → md → lg → xl); shadows should be subtle
131
- - Use elevation to reinforce hierarchy, not as decoration
132
-
133
- ### Optical Adjustments
134
-
135
- - If an icon looks visually off-center despite being geometrically centered, nudge it. But only if you're confident it actually looks wrong. Don't adjust speculatively.
136
- - Text at `margin-left: 0` looks slightly indented because of letterform whitespace; a negative margin (`-0.05em`) optically aligns it. Geometrically centered glyphs often look off-center (play icons need to shift right, arrows shift toward their direction).
137
- - Touch targets must be 44×44px minimum even when the visual element is smaller. Expand the hit area with padding or a pseudo-element:
138
-
139
- ```css
140
- .icon-button { width: 24px; height: 24px; position: relative; }
141
- .icon-button::before {
142
- content: ''; position: absolute; inset: -10px;
143
- }
144
- ```
145
-
146
- **NEVER**:
147
- - Use arbitrary spacing values outside your scale
148
- - Make all spacing equal (variety creates hierarchy)
149
- - Wrap everything in cards (not everything needs a container)
150
- - Nest cards inside cards (use spacing and dividers for hierarchy within)
151
- - Use identical card grids everywhere (icon + heading + text, repeated)
152
- - Default to the hero metric layout (big number, small label, stats, gradient) as a template. If showing real user data, a prominent metric can work, but it should display actual data, not decorative numbers.
153
-
154
- ## Verify Layout Improvements
155
-
156
- - **Squint test**: Can you identify primary, secondary, and groupings with blurred vision?
157
- - **Rhythm**: Does the page have a satisfying beat of tight and generous spacing?
158
- - **Hierarchy**: Is the most important content obvious within 2 seconds?
159
- - **Breathing room**: Does the layout feel comfortable, not cramped or wasteful?
160
- - **Consistency**: Is the spacing system applied uniformly?
161
- - **Responsiveness**: Does the layout adapt gracefully across screen sizes?
162
-
163
- Answer each item above by citing the file, selector, or value that satisfies it; never a bare yes. Then re-run the pre-scan and fix until the count of unresolved items and unaccepted findings is zero.
164
-
165
- When the rhythm and hierarchy land, hand off to `/monodesign polish` for the final pass.
166
-
167
- ## Live-mode signature params
168
-
169
- Each variant MUST declare a `density` param. Drive all spacing tokens in the variant's scoped CSS through `calc(var(--p-density, 1) * <base>)`: paddings, gaps, column widths. Users slide from airy to packed and see layout re-breathe with no regeneration.
170
-
171
- ```json
172
- {"id":"density","kind":"range","min":0.6,"max":1.4,"step":0.05,"default":1,"label":"Density"}
173
- ```
174
-
175
- For variants whose topology genuinely changes (stacked vs. side-by-side, grid vs. bento), use a `steps` param whose scoped CSS branches via `:scope[data-p-structure="X"]`. One structure param + one density param is a powerful combo; resist adding a third.
176
-
177
- ```json
178
- {"id":"structure","kind":"steps","default":"grid","label":"Structure","options":[
179
- {"value":"stacked","label":"Stacked"},
180
- {"value":"grid","label":"Grid"},
181
- {"value":"bento","label":"Bento"}
182
- ]}
183
- ```
184
-
185
- See `reference/live.md` for the full params contract.