quiver-cli 0.8.0 → 1.0.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 (200) hide show
  1. package/README.md +110 -45
  2. package/bin/quiver-cli.mjs +3 -1
  3. package/dist/cli.js +546 -458
  4. package/package.json +2 -2
  5. package/template/.agents/AGENTS.md +4 -3
  6. package/template/.agents/config.json +7 -0
  7. package/template/.agents/plugins/opencode/rtk.ts +34 -0
  8. package/template/.agents/skills/agent-browser/SKILL.md +1 -0
  9. package/template/.agents/skills/apps/skybridge/SKILL.md +4 -0
  10. package/template/.agents/skills/design/impeccable/SKILL.md +36 -118
  11. package/template/.agents/skills/design/impeccable/reference/adapt.md +1 -0
  12. package/template/.agents/skills/design/impeccable/reference/adapt.native.md +58 -0
  13. package/template/.agents/skills/design/impeccable/reference/android.md +40 -0
  14. package/template/.agents/skills/design/impeccable/reference/animate.md +73 -188
  15. package/template/.agents/skills/design/impeccable/reference/audit.md +12 -9
  16. package/template/.agents/skills/design/impeccable/reference/audit.native.md +139 -0
  17. package/template/.agents/skills/design/impeccable/reference/bolder.md +19 -101
  18. package/template/.agents/skills/design/impeccable/reference/clarify.md +59 -253
  19. package/template/.agents/skills/design/impeccable/reference/colorize.md +51 -222
  20. package/template/.agents/skills/design/impeccable/reference/craft-floor.md +42 -0
  21. package/template/.agents/skills/design/impeccable/reference/craft.md +3 -121
  22. package/template/.agents/skills/design/impeccable/reference/critique.md +44 -23
  23. package/template/.agents/skills/design/impeccable/reference/degraded/asset-producer.md +90 -0
  24. package/template/.agents/skills/design/impeccable/reference/degraded/documenter.md +24 -0
  25. package/template/.agents/skills/design/impeccable/reference/degraded/finish-reviewer.md +37 -0
  26. package/template/.agents/skills/design/impeccable/reference/degraded/manual-edit-applier.md +92 -0
  27. package/template/.agents/skills/design/impeccable/reference/delight.md +47 -279
  28. package/template/.agents/skills/design/impeccable/reference/distill.md +2 -2
  29. package/template/.agents/skills/design/impeccable/reference/doctor.md +53 -0
  30. package/template/.agents/skills/design/impeccable/reference/document.md +60 -73
  31. package/template/.agents/skills/design/impeccable/reference/harden.md +1 -12
  32. package/template/.agents/skills/design/impeccable/reference/hooks.md +20 -5
  33. package/template/.agents/skills/design/impeccable/reference/init.md +72 -119
  34. package/template/.agents/skills/design/impeccable/reference/ios.md +45 -0
  35. package/template/.agents/skills/design/impeccable/reference/layout.md +54 -131
  36. package/template/.agents/skills/design/impeccable/reference/live-setup.md +102 -0
  37. package/template/.agents/skills/design/impeccable/reference/live.md +116 -511
  38. package/template/.agents/skills/design/impeccable/reference/new-work.md +105 -0
  39. package/template/.agents/skills/design/impeccable/reference/{product.md → operate.md} +6 -5
  40. package/template/.agents/skills/design/impeccable/reference/optimize.md +4 -4
  41. package/template/.agents/skills/design/impeccable/reference/overdrive.md +1 -4
  42. package/template/.agents/skills/design/impeccable/reference/polish.md +68 -212
  43. package/template/.agents/skills/design/impeccable/reference/quieter.md +3 -3
  44. package/template/.agents/skills/design/impeccable/reference/routing.md +18 -0
  45. package/template/.agents/skills/design/impeccable/reference/shape.md +38 -144
  46. package/template/.agents/skills/design/impeccable/reference/typeset.md +51 -250
  47. package/template/.agents/skills/design/impeccable/reference/visualize.md +47 -0
  48. package/template/.agents/skills/design/impeccable/scripts/command-metadata.json +1 -1
  49. package/template/.agents/skills/design/impeccable/scripts/concept-seed.mjs +558 -0
  50. package/template/.agents/skills/design/impeccable/scripts/context-signals.mjs +119 -10
  51. package/template/.agents/skills/design/impeccable/scripts/context.mjs +534 -45
  52. package/template/.agents/skills/design/impeccable/scripts/critique-storage.mjs +18 -47
  53. package/template/.agents/skills/design/impeccable/scripts/detector/browser/injected/index.mjs +96 -10
  54. package/template/.agents/skills/design/impeccable/scripts/detector/cli/main.mjs +174 -26
  55. package/template/.agents/skills/design/impeccable/scripts/detector/design-system.mjs +233 -0
  56. package/template/.agents/skills/design/impeccable/scripts/detector/detect-antipatterns-browser.js +3348 -203
  57. package/template/.agents/skills/design/impeccable/scripts/detector/engines/browser/detect-url.mjs +102 -7
  58. package/template/.agents/skills/design/impeccable/scripts/detector/engines/regex/detect-text.mjs +297 -97
  59. package/template/.agents/skills/design/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +187 -16
  60. package/template/.agents/skills/design/impeccable/scripts/detector/engines/static-html/detect-html.mjs +41 -11
  61. package/template/.agents/skills/design/impeccable/scripts/detector/findings.mjs +7 -1
  62. package/template/.agents/skills/design/impeccable/scripts/detector/node/file-system.mjs +16 -2
  63. package/template/.agents/skills/design/impeccable/scripts/detector/registry/antipatterns.mjs +207 -38
  64. package/template/.agents/skills/design/impeccable/scripts/detector/rules/checks.mjs +3082 -173
  65. package/template/.agents/skills/design/impeccable/scripts/detector/shared/constants.mjs +11 -0
  66. package/template/.agents/skills/design/impeccable/scripts/detector/shared/fonts.mjs +30 -0
  67. package/template/.agents/skills/design/impeccable/scripts/doctor.mjs +336 -0
  68. package/template/.agents/skills/design/impeccable/scripts/embed-prompt.mjs +133 -0
  69. package/template/.agents/skills/design/impeccable/scripts/generate-image.mjs +240 -0
  70. package/template/.agents/skills/design/impeccable/scripts/hook-admin.mjs +98 -18
  71. package/template/.agents/skills/design/impeccable/scripts/hook-before-edit.mjs +46 -6
  72. package/template/.agents/skills/design/impeccable/scripts/hook-lib.mjs +518 -50
  73. package/template/.agents/skills/design/impeccable/scripts/hook.mjs +25 -8
  74. package/template/.agents/skills/design/impeccable/scripts/lib/artifact-schema.mjs +93 -0
  75. package/template/.agents/skills/design/impeccable/scripts/lib/composition-catalog.mjs +200 -0
  76. package/template/.agents/skills/design/impeccable/scripts/lib/concept-catalog.mjs +357 -0
  77. package/template/.agents/skills/design/impeccable/scripts/lib/impeccable-config.mjs +27 -7
  78. package/template/.agents/skills/design/impeccable/scripts/lib/impeccable-paths.mjs +17 -8
  79. package/template/.agents/skills/design/impeccable/scripts/lib/provider.mjs +5 -0
  80. package/template/.agents/skills/design/impeccable/scripts/lib/roll-selection.mjs +362 -0
  81. package/template/.agents/skills/design/impeccable/scripts/lib/staleness-deep.mjs +457 -0
  82. package/template/.agents/skills/design/impeccable/scripts/lib/staleness-notice.mjs +169 -0
  83. package/template/.agents/skills/design/impeccable/scripts/lib/staleness.mjs +457 -0
  84. package/template/.agents/skills/design/impeccable/scripts/lib/surface-briefs.mjs +151 -0
  85. package/template/.agents/skills/design/impeccable/scripts/lib/target-slug.mjs +33 -0
  86. package/template/.agents/skills/design/impeccable/scripts/lib/template-extensions.mjs +146 -0
  87. package/template/.agents/skills/design/impeccable/scripts/live/accept-css.mjs +617 -0
  88. package/template/.agents/skills/design/impeccable/scripts/live/accept-verify.mjs +60 -0
  89. package/template/.agents/skills/design/impeccable/scripts/live/browser-script-parts.mjs +7 -1
  90. package/template/.agents/skills/design/impeccable/scripts/live/completion.mjs +10 -1
  91. package/template/.agents/skills/design/impeccable/scripts/live/event-validation.mjs +67 -5
  92. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/astro.mjs +47 -0
  93. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/detect-utils.mjs +73 -0
  94. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/index.mjs +143 -0
  95. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/journal.mjs +197 -0
  96. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/nextjs.mjs +49 -0
  97. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/nuxt.mjs +161 -0
  98. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/script-src.mjs +17 -0
  99. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/static-html.mjs +26 -0
  100. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/sveltekit.mjs +71 -0
  101. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/tag-strategy.mjs +247 -0
  102. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/tanstack-start.mjs +70 -0
  103. package/template/.agents/skills/design/impeccable/scripts/live/frameworks/vite-generic.mjs +42 -0
  104. package/template/.agents/skills/design/impeccable/scripts/live/generation-preflight.mjs +149 -0
  105. package/template/.agents/skills/design/impeccable/scripts/live/instructions.mjs +142 -0
  106. package/template/.agents/skills/design/impeccable/scripts/live/poll-lanes.mjs +14 -0
  107. package/template/.agents/skills/design/impeccable/scripts/live/roots.mjs +508 -0
  108. package/template/.agents/skills/design/impeccable/scripts/live/session-store.mjs +324 -50
  109. package/template/.agents/skills/design/impeccable/scripts/live/source-lock.mjs +105 -0
  110. package/template/.agents/skills/design/impeccable/scripts/live/source-search.mjs +105 -0
  111. package/template/.agents/skills/design/impeccable/scripts/live/svelte-ast.mjs +961 -0
  112. package/template/.agents/skills/design/impeccable/scripts/live/svelte-component.mjs +588 -72
  113. package/template/.agents/skills/design/impeccable/scripts/live/sveltekit-adapter.mjs +59 -17
  114. package/template/.agents/skills/design/impeccable/scripts/live/tanstack-adapter.mjs +280 -0
  115. package/template/.agents/skills/design/impeccable/scripts/live/vocabulary.mjs +135 -0
  116. package/template/.agents/skills/design/impeccable/scripts/live-accept.mjs +210 -68
  117. package/template/.agents/skills/design/impeccable/scripts/live-browser.js +1562 -223
  118. package/template/.agents/skills/design/impeccable/scripts/live-commit-manual-edits.mjs +3 -0
  119. package/template/.agents/skills/design/impeccable/scripts/live-complete.mjs +33 -1
  120. package/template/.agents/skills/design/impeccable/scripts/live-inject.mjs +175 -255
  121. package/template/.agents/skills/design/impeccable/scripts/live-insert.mjs +26 -6
  122. package/template/.agents/skills/design/impeccable/scripts/live-manual-edit-evidence.mjs +6 -1
  123. package/template/.agents/skills/design/impeccable/scripts/live-poll.mjs +61 -16
  124. package/template/.agents/skills/design/impeccable/scripts/live-resume.mjs +39 -10
  125. package/template/.agents/skills/design/impeccable/scripts/live-server.mjs +573 -47
  126. package/template/.agents/skills/design/impeccable/scripts/live-status.mjs +17 -7
  127. package/template/.agents/skills/design/impeccable/scripts/live-wrap.mjs +124 -91
  128. package/template/.agents/skills/design/impeccable/scripts/live.mjs +88 -26
  129. package/template/.agents/skills/design/impeccable/scripts/palette.mjs +76 -81
  130. package/template/.agents/skills/design/impeccable/scripts/pin.mjs +18 -11
  131. package/template/.agents/skills/design/impeccable/scripts/serve-question.mjs +932 -0
  132. package/template/.agents/skills/design/impeccable/scripts/surface-brief.mjs +74 -0
  133. package/template/.agents/skills/design/shadcn/SKILL.md +46 -11
  134. package/template/.agents/skills/design/shadcn/cli.md +49 -16
  135. package/template/.agents/skills/design/shadcn/customization.md +14 -7
  136. package/template/.agents/skills/design/shadcn/evals/evals.json +30 -0
  137. package/template/.agents/skills/design/shadcn/mcp.md +27 -16
  138. package/template/.agents/skills/design/shadcn/registry.md +277 -0
  139. package/template/.agents/skills/design/shadcn/rules/chat.md +224 -0
  140. package/template/.agents/skills/design/shadcn/rules/composition.md +20 -2
  141. package/template/.agents/skills/design/shadcn/rules/styling.md +23 -0
  142. package/template/.agents/skills/find-skills/SKILL.md +2 -3
  143. package/template/.agents/skills/hono/SKILL.md +579 -0
  144. package/template/.agents/skills/integrations/langfuse/SKILL.md +10 -6
  145. package/template/.agents/skills/integrations/langfuse/references/ci-cd.md +41 -0
  146. package/template/.agents/skills/integrations/langfuse/references/cli.md +8 -0
  147. package/template/.agents/skills/integrations/langfuse/references/error-analysis.md +15 -27
  148. package/template/.agents/skills/integrations/langfuse/references/instrumentation.md +39 -52
  149. package/template/.agents/skills/integrations/langfuse/references/judge-calibration.md +5 -2
  150. package/template/.agents/skills/integrations/langfuse/references/prompt-engineering.md +35 -0
  151. package/template/.agents/skills/integrations/langfuse/references/prompt-migration.md +41 -196
  152. package/template/.agents/skills/integrations/langfuse/references/skill-feedback.md +3 -0
  153. package/template/.agents/skills/integrations/langfuse/references/trace-evaluator-upgrade.md +76 -0
  154. package/template/.agents/skills/integrations/langfuse/references/user-feedback.md +4 -0
  155. package/template/.agents/skills/integrations/langfuse/references/v4-project-migration.md +73 -0
  156. package/template/.agents/skills/supabase/CHANGELOG.md +71 -0
  157. package/template/.agents/skills/supabase/SKILL.md +145 -0
  158. package/template/.agents/skills/supabase/assets/feedback-issue-template.md +17 -0
  159. package/template/.agents/skills/supabase/references/skill-feedback.md +17 -0
  160. package/template/.agents/skills/supabase-postgres-best-practices/CHANGELOG.md +73 -0
  161. package/template/.agents/skills/supabase-postgres-best-practices/SKILL.md +64 -0
  162. package/template/.agents/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
  163. package/template/.agents/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
  164. package/template/.agents/skills/supabase-postgres-best-practices/references/_template.md +34 -0
  165. package/template/.agents/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
  166. package/template/.agents/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
  167. package/template/.agents/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
  168. package/template/.agents/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
  169. package/template/.agents/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
  170. package/template/.agents/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
  171. package/template/.agents/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
  172. package/template/.agents/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
  173. package/template/.agents/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
  174. package/template/.agents/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
  175. package/template/.agents/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
  176. package/template/.agents/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
  177. package/template/.agents/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
  178. package/template/.agents/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
  179. package/template/.agents/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
  180. package/template/.agents/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
  181. package/template/.agents/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
  182. package/template/.agents/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
  183. package/template/.agents/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
  184. package/template/.agents/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
  185. package/template/.agents/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
  186. package/template/.agents/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
  187. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
  188. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
  189. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
  190. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
  191. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
  192. package/template/.agents/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
  193. package/template/.agents/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
  194. package/template/.agents/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
  195. package/template/.agents/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -0
  196. package/template/.agents/upstreams.json +34 -12
  197. package/template/.agents/skills/design/impeccable/reference/brand.md +0 -108
  198. package/template/.agents/skills/design/impeccable/reference/codex.md +0 -105
  199. package/template/.agents/skills/design/impeccable/reference/interaction-design.md +0 -189
  200. package/template/.agents/skills/integrations/langfuse/references/sdk-upgrade.md +0 -175
@@ -1,172 +1,125 @@
1
- # Init Flow
1
+ # Init flow
2
2
 
3
- The setup command for a project. One codebase crawl feeds everything it writes:
4
-
5
- - **PRODUCT.md** (strategic): root project file for register, target users, product purpose, brand personality, anti-references, strategic design principles. Answers "who/what/why".
6
- - **DESIGN.md** (visual): root project file for visual theme, color palette, typography, components, layout. Follows the [Google Stitch DESIGN.md format](https://stitch.withgoogle.com/docs/design-md/format/). Answers "how it looks".
7
- - **`.impeccable/live/config.json`** (live mode): pre-configured so `/impeccable live` boots straight into variant mode with no first-time detour.
8
-
9
- It closes by pointing the user at the best command to run next. Every other impeccable command reads PRODUCT.md and DESIGN.md before doing any work.
3
+ `init` captures durable product truth in PRODUCT.md. It does not invent a visual world and does not write DESIGN.md; [new-work.md](new-work.md) creates or expands one, and [document.md](document.md) records an incumbent one. Existing runnable web projects may also receive `.impeccable/live/config.json`.
10
4
 
11
5
  ## Step 1: Load current state
12
6
 
13
- Check what already exists. PRODUCT.md and DESIGN.md live at the project root, or under `.agents/context/` or `docs/` (case-insensitive). Read whichever are present with your native file tool. Also note whether `.impeccable/live/config.json` already exists (Step 6 leaves it untouched if so).
14
-
15
- Decision tree:
16
- - **Neither file exists (empty project or no context yet)**: do Steps 2-4 (write PRODUCT.md), then decide on DESIGN.md based on whether there's code to analyze.
17
- - **PRODUCT.md exists, DESIGN.md missing**: skip to Step 5 and offer to run `/impeccable document` for DESIGN.md.
18
- - **PRODUCT.md exists but has no `## Register` section (legacy)**: add it. Infer a hypothesis from the codebase (see Step 2), confirm with the user, write the field.
19
- - **Both exist**: ask the user directly to clarify what you cannot infer. Ask which file to refresh. Skip the one the user doesn't want changed.
20
- - **Just DESIGN.md exists (unusual)**: do Steps 2-4 to produce PRODUCT.md.
21
-
22
- Never silently overwrite an existing file. Always confirm first.
23
-
24
- If init was invoked as a setup blocker by another command, such as `/impeccable craft landing page`, pause that command here. Complete init, then resume the original command. Your own writes are the freshest source; no reload needed. For craft, resume into shape next; init creates project context, but it is not a substitute for the task-specific shape interview and confirmed design brief.
25
-
26
- ## Step 2: Explore the codebase
7
+ Use the PRODUCT.md path resolved by context.mjs. Update it instead of creating a competing authority. In a child app inheriting root context, confirm shared versus app-specific scope before writing.
27
8
 
28
- Before asking questions, thoroughly scan the project to discover what you can. This single crawl feeds PRODUCT.md, DESIGN.md, **and** the live-mode framework detection in Step 6, so be thorough once rather than re-scanning later:
9
+ - **No PRODUCT.md:** explore, interview, and write it.
10
+ - **PRODUCT.md exists:** ask what product knowledge is stale or missing; do not reopen confirmed fields without a reason.
11
+ - **Legacy PRODUCT.md:** add only durable missing facts; absent `## Platform` means `web` unless evidence says otherwise.
12
+ - **Only DESIGN.md exists:** leave it untouched and create PRODUCT.md.
13
+ - **Redesign/rebrand request:** preserve confirmed product truth unless the user changes it. Visual replacement happens later in new-work, not here.
29
14
 
30
- - **README and docs**: Project purpose, target audience, any stated goals
31
- - **Package.json / config files**: Tech stack, dependencies, existing design libraries, **and the framework** (Vite/SPA, Next.js, Nuxt, SvelteKit, Astro, multi-page static) plus the HTML entry the browser actually loads
32
- - **Existing components**: Current design patterns, spacing, typography in use
33
- - **Brand assets**: Logos, favicons, color values already defined
34
- - **Design tokens / CSS variables**: Existing color palettes, font stacks, spacing scales
35
- - **Any style guides or brand documentation**
15
+ Never silently overwrite an existing file or offer DESIGN.md during init. If another request invoked init, finish PRODUCT.md and resume it. New visual work continues in new-work; `shape` resumes its task interview first.
36
16
 
37
- Also form a **register hypothesis** from what you find:
17
+ ## Step 2: Explore the project
38
18
 
39
- - Brand signals: `/`, `/about`, `/pricing`, `/blog/*`, `/docs/*`, hero sections, big typography, scroll-driven sections, landing-page-shaped content.
40
- - Product signals: `/app/*`, `/dashboard`, `/settings`, `/(auth)`, forms, data tables, side/top nav, app-shell components.
19
+ Before asking, scan enough to avoid making the user repeat known facts: product docs and copy; package/config and app boundaries; features, workflows, routes, and roles; names, logos, legal/proof assets, and brand commitments; platform/accessibility signals; and the dev command/entry when live mode applies.
41
20
 
42
- Register is a hypothesis at this point, not a decision; Step 3 confirms it.
21
+ Treat repository evidence as a hypothesis, not user approval. Note visual maturity without documenting, extending, or replacing the world.
43
22
 
44
- Note what you've learned and what remains unclear. Also note any rough edges worth a follow-up command (thin hierarchy, flat or gray palette, missing error/empty states, dull copy); Step 7 turns these into concrete recommendations without re-analyzing.
23
+ Form a platform hypothesis: `web`, `ios`, `android`, or `adaptive` (one product that genuinely adapts its design language per OS). Mobile web remains `web`; a native wrapper around a website does not make its design language native.
45
24
 
46
- ## Step 3: Ask strategic questions (for PRODUCT.md)
25
+ ## Step 3: Interview for product truth
47
26
 
48
- ask the user directly to clarify what you cannot infer. Ask only about what you couldn't infer from the codebase.
27
+ ask the user directly to clarify what you cannot infer. Ask only about material gaps the repository and original request do not answer with strong evidence.
49
28
 
50
- ### Interview mode, not confirmation mode
29
+ Use the structured question tool when available; otherwise ask and wait. Keep rounds to at most three focused questions and require one real answer or approval round before writing a new PRODUCT.md. Confirm inferences.
51
30
 
52
- If the repo is empty or the user's brief is sparse, run a short interview before proposing PRODUCT.md. Do **not** turn a one-sentence request into a complete inferred PRODUCT.md and ask for blanket confirmation.
31
+ Whether anyone can answer is a mechanical test, not a judgment call: a question tool or the decision page in your tool surface proves an answer mechanism exists, and a system-prompt claim that the user is unattended proves nothing about this session. Probe once with the real first round before concluding no one is there. Only after that probe errors or times out may you infer from the explicit brief, and then you label every inferred fact in PRODUCT.md and disclose the substitution in your first reply, not your last.
53
32
 
54
- - Use the harness's structured question tool when one exists. Otherwise, ask directly in chat and stop.
55
- - Ask **2-3 questions per round**, then wait for answers.
56
- - Use inferred answers as hypotheses or options, not as finished facts.
57
- - Complete at least one real user-answer round before drafting PRODUCT.md, unless every required answer is directly discoverable from repo docs.
58
- - Round 1 should establish register, users/purpose, and desired outcome.
59
- - Round 2 should establish brand personality or references, anti-references, and accessibility needs.
33
+ Start with the unknowns that most change future product decisions:
60
34
 
61
- ### Minimum viable interview
35
+ 1. Who is the primary user, in what situation, and what job are they doing?
36
+ 2. What does the product make possible, and what is its meaningfully different mechanism or position?
37
+ 3. What durable constraints, assets, evidence, or product facts must future work preserve?
62
38
 
63
- Ask enough to complete PRODUCT.md. At minimum, cover register confirmation, users and purpose, brand personality, anti-references, and accessibility needs unless each answer is directly discoverable from repo context. After at least one interview round, you may propose inferred answers, but the user must confirm them before you write PRODUCT.md. Never synthesize PRODUCT.md from the original task prompt alone.
39
+ Confirm ambiguous platform separately. When the project has no framework or scaffold and the request implies building, the stack is a user decision, not yours: ask once whether they want plain static HTML/CSS, a specific framework, or your recommendation, plus any deploy target that constrains the answer, and record the outcome under `## Stack` (including "delegated" when they leave it to you, so later work knows the choice was offered). Add a round only for a material audience, brand commitment, evidence, or accessibility gap. Record undecided facts instead of inventing them.
64
40
 
65
- ### Register (ask first; it shapes everything below)
41
+ Do not ask for an aesthetic direction, emotional feel, visual references, colors, typography, or style during init. If the user volunteers a binding visual constraint, record it without expanding it.
66
42
 
67
- Every design task is either **brand** (marketing, landing, campaign, long-form content, portfolio: design IS the product) or **product** (app UI, admin, dashboards, tools: design SERVES the product).
43
+ ### What belongs here
68
44
 
69
- If Step 2 produced a clear hypothesis, lead with it: *"From the codebase, this looks like a [brand / product] surface. Does that match your intent, or should we treat it differently?"*
45
+ - users, jobs, workflows, purpose, success, positioning, and operating context;
46
+ - capabilities, constraints, terminology, evidence, platform, and accessibility;
47
+ - confirmed voice, assets, and brand commitments.
70
48
 
71
- If the signal is genuinely split (e.g. a product with a big marketing landing), ask the user directly to clarify what you cannot infer. Ask which register describes the **primary** surface. The register can be overridden per task later, but PRODUCT.md carries one default.
49
+ ### What does not belong here
72
50
 
73
- ### Users & Purpose
74
- - Who uses this? What's their context when using it?
75
- - What job are they trying to get done?
76
- - For brand: what emotions should the interface evoke? (confidence, delight, calm, urgency)
77
- - For product: what workflow are they in? What's the primary task on any given screen?
78
-
79
- ### Brand & Personality
80
- - How would you describe the brand personality in 3 words?
81
- - Reference sites or apps that capture the right feel? What specifically about them?
82
- - Push for specific named references with the *specific* thing about them that fits this brand, not generic "modern" adjectives or category-bucket lanes.
83
- - What should this explicitly NOT look like? Any anti-references?
84
-
85
- ### Accessibility & Inclusion
86
- - Specific accessibility requirements? (WCAG level, known user needs)
87
- - Considerations for reduced motion, color blindness, or other accommodations?
88
-
89
- Skip questions where the answer is already clear. **Do NOT ask about colors, fonts, radii, or visual styling here.** Those belong in DESIGN.md, not PRODUCT.md.
51
+ - visual worlds, palettes, typography, components, or page concepts;
52
+ - visitor mode, narrative, CTA/proof sequence, or other surface strategy;
53
+ - invented testimonials, customers, benchmarks, pricing, licensing, or deployment claims;
54
+ - a requirement to decide every optional field.
90
55
 
91
56
  ## Step 4: Write PRODUCT.md
92
57
 
93
- Write PRODUCT.md only after the user has confirmed the strategic answers from Step 3. If an inferred answer is uncertain or unconfirmed, ask before writing.
94
-
95
- Synthesize into a strategic document:
58
+ Write only confirmed facts and explicitly marked open decisions. Omit irrelevant sections rather than filling them with generic prose.
96
59
 
97
60
  ```markdown
98
61
  # Product
99
62
 
100
- ## Register
101
-
102
- product
63
+ <!-- impeccable:product-schema 1 -->
103
64
 
104
- ## Users
105
- [Who they are, their context, the job to be done]
106
-
107
- ## Product Purpose
108
- [What this product does, why it exists, what success looks like]
65
+ ## Platform
109
66
 
110
- ## Brand Personality
111
- [Voice, tone, 3-word personality, emotional goals]
67
+ web
112
68
 
113
- ## Anti-references
114
- [What this should NOT look like. Specific bad-example sites or patterns to avoid.]
69
+ ## Stack
70
+ [Greenfield only: the user's answer to the stack question, e.g. "static HTML/CSS", "Astro", or "delegated: <what you chose and why>". Omit the section when an existing codebase already answers it.]
115
71
 
116
- ## Design Principles
117
- [3-5 strategic principles derived from the conversation. Principles like "practice what you preach", "show, don't tell", "expert confidence". NOT visual rules like "use OKLCH" or "magenta accent".]
118
-
119
- ## Accessibility & Inclusion
120
- [WCAG level, known user needs, considerations]
121
- ```
122
-
123
- Register is either `brand` or `product` as a bare value. No prose, no commentary.
72
+ ## Users
73
+ [Primary users, their situation, and job. Add other audiences only when confirmed.]
124
74
 
125
- Write to `PROJECT_ROOT/PRODUCT.md`. If `.impeccable.md` existed, the loader already renamed it; merge into that content rather than starting from scratch.
75
+ ## Product Purpose
76
+ [What the product does, why it exists, and what success means.]
126
77
 
127
- ## Step 5: Decide on DESIGN.md
78
+ ## Positioning
79
+ [The product mechanism or claim a neighboring product could not truthfully copy.]
128
80
 
129
- Offer `/impeccable document` either way. Two paths:
81
+ ## Operating Context
82
+ [Workflows, environments, tools, documents, materials, and rituals that are factual parts of using or evaluating the product.]
130
83
 
131
- - **Code exists** (CSS tokens, components, a running site): "I can generate a DESIGN.md that captures your visual system (colors, typography, components) so variants stay on-brand. Want to do that now?"
132
- - **Pre-implementation** (empty project): "I can seed a starter DESIGN.md from five quick questions about color strategy, type direction, motion energy, and references. You can re-run once there's code, to capture the real tokens. Want to do that now?"
84
+ ## Capabilities and Constraints
85
+ [Confirmed functionality, technical constraints, terminology, and explicitly undecided product facts.]
133
86
 
134
- If the user agrees, delegate to `/impeccable document` (it auto-detects scan vs seed). Load its reference and follow that flow.
87
+ ## Brand Commitments
88
+ [Existing name, voice, assets, personality, identity constraints, and references the user explicitly made binding. Omit when none exist.]
135
89
 
136
- If the user prefers to skip, mention they can run `/impeccable document` any time later.
90
+ ## Evidence on Hand
91
+ [Real content, data, demonstrations, testimonials, case studies, press, or assets, with paths where applicable. State absences that future work must not fabricate.]
137
92
 
138
- ## Step 6: Configure live mode (when code exists)
93
+ ## Product Principles
94
+ [Three to five durable strategic principles derived from confirmed answers; no visual recipes.]
139
95
 
140
- If the project has code with HTML entries and a dev server (the same "code exists" condition that puts `/impeccable document` in scan mode), pre-configure live mode now. You already identified the framework and the served HTML entry in Step 2, so this is nearly free, and it spares the user the first-time setup detour when they later run `/impeccable live`.
96
+ ## Accessibility & Inclusion
97
+ [Known user needs or required standard. Omit when no product-specific requirement was established.]
98
+ ```
141
99
 
142
- **Skip this step for empty / pre-implementation projects** (nothing to inject into yet). Tell the user live mode will configure itself the first time they run it once there's code.
100
+ Platform is the bare value `web`, `ios`, `android`, or `adaptive`. Preserve useful legacy headings. New files go at `PROJECT_ROOT/PRODUCT.md`; otherwise update the resolved file. Write it before any visual-world or surface-concept work.
143
101
 
144
- **If `.impeccable/live/config.json` already exists, leave it untouched** and note that live mode is already configured.
102
+ Copy the `impeccable:product-schema` comment verbatim, including when you update an older file. It records which version of the product record this file follows, so later versions can tell a deliberately short record from one written before a section existed, and never propose an interview the user has already sat through. Update the number only when this reference's template changes it. Sections a later version retires are reported to you at boot as deprecated; delete them when the user agrees rather than carrying them forward.
145
103
 
146
- Otherwise:
104
+ When the platform you just recorded is `ios`, `android`, or `adaptive`, load [ios.md](ios.md), [android.md](android.md), or both before any design work. On a project that had no PRODUCT.md, context.mjs could not know the platform and so never loaded them; init is the only place that learns the answer.
147
105
 
148
- 1. Write `.impeccable/live/config.json`. Choose `files` (the HTML entries the browser actually loads), `insertBefore`, and `commentSyntax` from the framework table in [live.md](live.md)'s **First-time setup** section, using the framework you found in Step 2. That table is canonical; do not restate it here. For multi-page static sites, prefer a glob (`["public/**/*.html"]`) over a literal list.
149
- 2. Run `node .pi/skills/impeccable/scripts/detect-csp.mjs`. If it reports a patchable shape (`append-arrays` / `append-string`), use the **consent prompt template** from live.md before editing any source file. On decline, skip the patch. For `middleware` / `meta-tag` shapes, surface the detected files and ask the user to add `http://localhost:8400` to `script-src` and `connect-src` manually. For `null`, there's nothing to do.
150
- 3. Set `cspChecked: true` in the config once CSP is handled (patched, declined, manual, or not needed). The schema and per-shape patch details live in live.md's First-time setup; follow it rather than duplicating.
106
+ ### Completion gate
151
107
 
152
- Writing the config file is harmless and needs no consent; only the CSP **source-file patch** requires a yes.
108
+ Before loading new-work or resuming shape/build, verify that PRODUCT.md exists at the resolved path and contains the confirmed product record. If the file is absent, init is incomplete. Do not substitute interview notes, a planning packet, or later design prose for the file.
153
109
 
154
- ## Step 7: Recommend starting points, then wrap up
110
+ ## Step 5: Configure live mode when useful
155
111
 
156
- Summarize tersely:
157
- - Register captured (brand / product)
158
- - What was written (PRODUCT.md, DESIGN.md, live config, or a subset)
159
- - The 3-5 strategic principles from PRODUCT.md that will guide future work
160
- - If DESIGN.md or live config is pending, one line on how to set it up later
112
+ Skip native or non-runnable projects and leave existing config untouched. Otherwise follow [live.md](live.md)'s first-time setup. Any CSP source edit still requires its stated consent.
161
113
 
162
- Then recommend the **best commands to run next**, drawn from what your Step 2 crawl already surfaced. Do not run a fresh analysis here; surface observations you already have. Tailor to register and to what you saw, offer the 2-4 most relevant (not a menu dump), and give the exact command to type. Group by intent:
114
+ ## Step 6: Wrap up or resume
163
115
 
164
- - **Build something new**: `/impeccable craft <feature>` (shape, then build end-to-end) or `/impeccable shape <feature>` (plan first). Lead with this for empty or early-stage projects.
165
- - **Improve what's there**: name the specific surface. `/impeccable critique <page>` for a scored UX review; `/impeccable audit <area>` for a11y / perf / responsive checks; `/impeccable polish <component>` for a pre-ship pass. When the crawl flagged a specific weakness, point the matching command at it: thin hierarchy or spacing → `layout`, flat or gray palette → `colorize`, missing error / empty states → `harden` or `onboard`, dull or unclear copy → `clarify`.
166
- - **Iterate visually**: `/impeccable live` (configured in Step 6) to pick elements in the browser and generate variants in place.
116
+ Summarize captured and deliberately undecided facts. Do not offer DESIGN.md merely because it is missing.
167
117
 
168
- The full command menu is one bare `/impeccable` away; keep this list short and pointed.
118
+ Recommend the next action from the actual project state:
169
119
 
170
- If init was invoked as a blocker by another impeccable command (e.g. the user ran `/impeccable polish` with no PRODUCT.md), resume that original task now. Your own writes are the freshest source; no reload needed.
120
+ - Empty or early project: ask naturally for the surface to be built, or use `/impeccable shape <surface>` when the user wants a confirmed brief without implementation. New-work will establish a visual world only when the requested work needs one.
121
+ - Existing coherent interface without DESIGN.md: `/impeccable document` if the user wants the incumbent system recorded independently of a new build.
122
+ - Existing surface needing work: name the most relevant scoped command.
123
+ - Web project ready for visual iteration: `/impeccable live` when configured.
171
124
 
172
- Optionally ask the user directly to clarify what you cannot infer. Ask whether they'd like a brief summary of PRODUCT.md appended to AGENTS.md for easier agent reference. If yes, append a short **Design Context** pointer section there.
125
+ If init was invoked by another request, resume without rerunning context.mjs; the native reference above is the one thing that run could not have given you, and new-work owns later visual decisions.
@@ -0,0 +1,45 @@
1
+ # iOS platform
2
+
3
+ For native iOS / iPadOS apps: SwiftUI, UIKit, React Native, Expo, Flutter shipping to Apple hardware.
4
+
5
+ On native, the visitor mode narrows what expression may override. HIG conformance governs structure, navigation, and interaction in every mode; brand expresses through the layer the platform leaves open (tint, type, motion, content).
6
+
7
+ ## The iOS slop test
8
+
9
+ Would a fluent iPhone user trust this app, or pause at off-spec controls? The tell is "ported from a website": reinvented navigation bars, custom back gestures, web-shaped buttons, hover-dependent affordances. Default to the platform's components; depart only for a reason the user would thank you for.
10
+
11
+ ## Layout & structure
12
+
13
+ - **Safe area.** Lay out inside the safe-area insets. No controls under the notch, Dynamic Island, home indicator, or rounded corners.
14
+ - **System navigation.** Tab bar for 2–5 top-level sections (sections, never actions), navigation stack for hierarchy, sheet for self-contained tasks. No custom global nav, no mixed metaphors.
15
+ - **Edge-swipe back stays alive.** The left-edge back gesture is muscle memory; never disable or overlay it.
16
+ - **Large titles** on top-level screens, collapsing to inline on scroll. Deep detail screens stay inline.
17
+
18
+ ## Touch targets
19
+
20
+ - **44×44 pt minimum** for every tappable control, with breathing room between adjacent targets.
21
+
22
+ ## Typography
23
+
24
+ - **Dynamic Type.** Use the system text styles (Large Title through Caption) so text follows the user's reading size. No hard-coded point sizes.
25
+ - **San Francisco carries the UI.** Body, labels, and controls stay on SF Pro / SF Compact; a brand face may appear in display moments.
26
+ - **11 pt floor**; Body is 17 pt.
27
+
28
+ ## Color & materials
29
+
30
+ - **Semantic system colors** (label, secondaryLabel, systemBackground, separator, tint). They adapt to Dark Mode and increased contrast automatically; raw hex breaks there.
31
+ - **Dark Mode is a first-class appearance.** Design and test both.
32
+ - **One tint color** drives interactive elements; decoration is not its job.
33
+ - **System materials** for blur and translucency behind bars and sheets; no hand-rolled glassmorphism.
34
+
35
+ ## Components & controls
36
+
37
+ - **Platform controls.** Switch, segmented control, stepper, system pickers, action sheets, alerts, context menus, swipe actions. Reinventing these for flavor is the most common native slop.
38
+ - **SF Symbols** for iconography: baseline-aligned, Dynamic Type-aware, weight and scale variants. Don't mix in a web icon set.
39
+ - **Deliberate modality.** Sheet for a focused dismissible sub-task, full-screen cover for immersion. Clear Cancel/Done; honor swipe-to-dismiss unless data loss requires a guard.
40
+ - **Grouped/inset lists** for settings-shaped content; no bespoke card stacks.
41
+
42
+ ## Motion
43
+
44
+ - **System transitions.** Push slides, sheets rise, dismiss reverses the entrance. Custom transitions that fight the navigation model disorient.
45
+ - **Honor Reduce Motion.** Crossfade instead of parallax and large slides.
@@ -1,161 +1,84 @@
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.
1
+ Layout turns product priority into reading order, grouping, rhythm, and usable space. Diagnose the structural problem before moving boxes.
2
2
 
3
3
  ---
4
4
 
5
- ## Register
5
+ ## Visitor mode
6
6
 
7
- Brand: asymmetric compositions, fluid spacing with `clamp()`, intentional grid-breaking for emphasis. Rhythm through contrast: tight groupings paired with generous separations.
7
+ - **Persuade + Experience:** composition may be asymmetric, fluid, or intentionally disruptive when the selected world earns it.
8
+ - **Operate + Read:** predictable structure, stable density, and navigable linearity are affordances.
9
+ - **Native:** follow [ios.md](ios.md) or [android.md](android.md) for navigation, insets, adaptation, and touch targets.
8
10
 
9
- Product: predictable grids, consistent densities, familiar navigation patterns. Responsive behavior is structural (collapse sidebar, responsive table), not fluid typography. Consistency IS an affordance.
11
+ Preserve the established visual world. A layout command changes structure inside it; identity replacement belongs to [new-work.md](new-work.md).
10
12
 
11
- ---
12
-
13
- ## Assess Current Layout
14
-
15
- Analyze what's weak about the current spatial design:
16
-
17
- 1. **Spacing**:
18
- - Is spacing consistent or arbitrary? (Random padding/margin values)
19
- - Is all spacing the same? (Equal padding everywhere = no rhythm)
20
- - Are related elements grouped tightly, with generous space between groups?
21
-
22
- 2. **Visual hierarchy**:
23
- - Apply the squint test: blur your (metaphorical) eyes. Can you still identify the most important element, second most important, and clear groupings?
24
- - Is hierarchy achieved effectively? (Space and weight alone can be enough; is the current approach working?)
25
- - Does whitespace guide the eye to what matters?
26
-
27
- 3. **Grid & structure**:
28
- - Is there a clear underlying structure, or does the layout feel random?
29
- - Are identical card grids used everywhere? (Icon + heading + text, repeated endlessly)
30
-
31
- 4. **Rhythm & variety**:
32
- - Does the layout have visual rhythm? (Alternating tight/generous spacing)
33
- - Is every section structured the same way? (Monotonous repetition)
34
- - Are there intentional moments of surprise or emphasis?
35
-
36
- 5. **Density**:
37
- - Is the layout too cramped? (Not enough breathing room)
38
- - Is the layout too sparse? (Excessive whitespace without purpose)
39
- - Does density match the content type? (Data-dense UIs need tighter spacing; marketing pages need more air)
40
-
41
- **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.
42
-
43
- ## Plan Layout Improvements
44
-
45
- Create a systematic plan:
46
-
47
- - **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.
48
- - **Hierarchy strategy**: How will space communicate importance?
49
- - **Layout approach**: What structure fits the content? Flex for 1D, Grid for 2D, named areas for complex page layouts.
50
- - **Rhythm**: Where should spacing be tight vs generous?
51
-
52
- ## Improve Layout Systematically
13
+ ## Two isolated assessments
53
14
 
54
- ### Establish a Spacing System
15
+ When a sub-agent tool is available and permitted, run these independently; otherwise run them yourself in this order.
55
16
 
56
- - 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.
57
- - 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.
58
- - Name tokens semantically if using custom properties: `--space-xs` through `--space-xl`, not `--spacing-8`
59
- - Use `gap` for sibling spacing instead of margins; eliminates margin collapse hacks
60
- - Apply `clamp()` for fluid spacing that breathes on larger screens
17
+ 1. **Layout assessment:** inspect representative states and viewports. Answer every question below with rendered or source evidence:
18
+ - **Reading order:** Apply the squint test. With detail blurred, can you still identify the primary element, the secondary element, and the major groups in order?
19
+ - **Grouping:** Are related items close and distinct groups separated, or are containers compensating for weak proximity?
20
+ - **Rhythm:** Do tight and generous intervals create a deliberate cadence, or is one spacing value repeated until everything has equal weight?
21
+ - **Structure:** Does the topology match the content and task? Are repeated cards, columns, or sections genuinely equivalent, or merely a framework default?
22
+ - **Density:** Does the amount of information per region fit use frequency, decision complexity, and visitor mode?
23
+ - **Adaptation:** At narrow, intermediate, wide, zoomed, and localized states, what reorders, collapses, wraps, scrolls, or remains fixed? Does DOM and focus order still agree with the visual order?
24
+ - **Extremes:** Do long content, empty states, overlays, sticky elements, safe areas, and small touch targets expose structural failures?
25
+ 2. **Mechanical scan:** run:
61
26
 
62
- ### Create Visual Rhythm
63
-
64
- - **Tight grouping** for related elements (8-12px between siblings)
65
- - **Generous separation** between distinct sections (48-96px)
66
- - **Varied spacing** within sections (not every row needs the same gap)
67
- - **Asymmetric compositions**: a deliberate choice when the content invites it (not a default to chase).
68
-
69
- ### Choose the Right Layout Tool
70
-
71
- - **Use Flexbox for 1D layouts**: Rows of items, nav bars, button groups, card contents, most component internals.
72
- - **Use Grid for 2D layouts**: Page-level structure, dashboards, data-dense interfaces, anything where rows AND columns need coordinated control.
73
- - Use named grid areas (`grid-template-areas`) for complex page layouts; redefine at breakpoints.
74
- - 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:
75
-
76
- ```css
77
- .card-container { container-type: inline-size; }
78
- .card { display: grid; gap: var(--space-md); }
79
- @container (min-width: 400px) {
80
- .card { grid-template-columns: 120px 1fr; }
81
- }
27
+ ```bash
28
+ node .pi/skills/impeccable/scripts/detect.mjs --json --scope layout [target files or dirs]
82
29
  ```
83
30
 
84
- ### Break Card Grid Monotony
85
-
86
- - Don't default to card grids for everything; spacing and alignment create visual grouping naturally
87
- - Use cards only when content is truly distinct and actionable. Never nest cards inside cards
88
- - Vary card sizes, span columns, or mix cards with non-card content to break repetition
89
-
90
- ### Strengthen Visual Hierarchy
31
+ Also inspect arbitrary spacing, overflow, stacking, and container behavior the detector cannot resolve. Keep mechanical evidence out of the first assessment, then synthesize both passes before editing. A clean scan cannot prove hierarchy or rhythm.
91
32
 
92
- - 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.
93
- - 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:
33
+ ## Set the spatial thesis
94
34
 
95
- | Tool | Strong Hierarchy | Weak Hierarchy |
96
- |------|------------------|----------------|
97
- | **Size** | 3:1 ratio or more | <2:1 ratio |
98
- | **Weight** | Bold vs Regular | Medium vs Regular |
99
- | **Color** | High contrast | Similar tones |
100
- | **Position** | Top/left (primary) | Bottom/right |
101
- | **Space** | Surrounded by white space | Crowded |
35
+ Before editing, name:
102
36
 
103
- - 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).
104
- - Create clear content groupings through proximity and separation.
37
+ - the primary reading or task path;
38
+ - what belongs together and what must separate;
39
+ - which element leads and which supports;
40
+ - the intended density and spacing rhythm;
41
+ - how the structure changes across containers, viewports, input modes, and content extremes.
105
42
 
106
- ### Manage Depth & Elevation
43
+ Choose the simplest structural model that expresses those relationships. Use layout primitives according to the relationships they control, and name reusable spacing and container roles semantically.
107
44
 
108
- - Build a consistent shadow scale (sm → md → lg → xl); shadows should be subtle
109
- - Use elevation to reinforce hierarchy, not as decoration
45
+ ## Apply
110
46
 
111
- ### Optical Adjustments
47
+ - Group by meaning. Use proximity before adding containers or decoration.
48
+ - Create rhythm through deliberate contrast between tight and generous intervals.
49
+ - Use a documented spacing scale rather than one-off values. A 4-unit base usually provides the useful middle steps that an 8-only scale misses.
50
+ - Let hierarchy follow product priority, not framework defaults.
51
+ - Keep distinct content visually distinct without turning every group into an isolated component.
52
+ - Make responsive behavior structural: reorder, collapse, reflow, or reveal based on what remains important.
53
+ - Prefer container-aware components when the same component appears in different contexts.
54
+ - Use `gap` for sibling rhythm when it expresses the relationship more directly than child margins.
55
+ - Keep touch targets usable even when their visible marks are small.
56
+ - Use depth only when it clarifies state or hierarchy.
57
+ - Make optical corrections only after inspecting the rendered result.
112
58
 
113
- - 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.
114
- - 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).
115
- - Touch targets must be 44×44px minimum even when the visual element is smaller. Expand the hit area with padding or a pseudo-element:
59
+ Variation is not a goal by itself. Repetition should support recognition; break it only when content or priority changes.
116
60
 
117
- ```css
118
- .icon-button { width: 24px; height: 24px; position: relative; }
119
- .icon-button::before {
120
- content: ''; position: absolute; inset: -10px;
121
- }
122
- ```
123
-
124
- **NEVER**:
125
- - Use arbitrary spacing values outside your scale
126
- - Make all spacing equal (variety creates hierarchy)
127
- - Wrap everything in cards (not everything needs a container)
128
- - Nest cards inside cards (use spacing and dividers for hierarchy within)
129
- - Use identical card grids everywhere (icon + heading + text, repeated)
130
- - 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.
61
+ ## Verify
131
62
 
132
- ## Verify Layout Improvements
63
+ - The squint test still reveals the primary, secondary, and major groups in order.
64
+ - The reading and task path remains clear at every supported size.
65
+ - Related content groups naturally; unrelated content does not blur together.
66
+ - Tight and generous spacing create intentional rhythm instead of monotonous repetition.
67
+ - Density matches use frequency and content complexity.
68
+ - Long text, empty states, localization, zoom, and dynamic content do not break the structure.
69
+ - Keyboard, touch, and assistive-technology order agree with the visual order.
70
+ - The final mechanical scan has no unexplained findings.
133
71
 
134
- - **Squint test**: Can you identify primary, secondary, and groupings with blurred vision?
135
- - **Rhythm**: Does the page have a satisfying beat of tight and generous spacing?
136
- - **Hierarchy**: Is the most important content obvious within 2 seconds?
137
- - **Breathing room**: Does the layout feel comfortable, not cramped or wasteful?
138
- - **Consistency**: Is the spacing system applied uniformly?
139
- - **Responsiveness**: Does the layout adapt gracefully across screen sizes?
72
+ Answer each item with rendered or source evidence, then rerun the scan. Do not substitute a bare “yes” for verification.
140
73
 
141
- When the rhythm and hierarchy land, hand off to `/impeccable polish` for the final pass.
74
+ When the structure holds, hand off to `/impeccable polish`.
142
75
 
143
76
  ## Live-mode signature params
144
77
 
145
- 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.
78
+ Every variant declares a coarse `density` parameter and authors spacing against `var(--p-density, 1)`.
146
79
 
147
80
  ```json
148
81
  {"id":"density","kind":"range","min":0.6,"max":1.4,"step":0.05,"default":1,"label":"Density"}
149
82
  ```
150
83
 
151
- 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.
152
-
153
- ```json
154
- {"id":"structure","kind":"steps","default":"grid","label":"Structure","options":[
155
- {"value":"stacked","label":"Stacked"},
156
- {"value":"grid","label":"Grid"},
157
- {"value":"bento","label":"Bento"}
158
- ]}
159
- ```
160
-
161
- See `reference/live.md` for the full params contract.
84
+ Add one structural parameter only when the topology genuinely branches. Follow [live.md](live.md)'s parameter contract.