@istmx/skills 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 (210) hide show
  1. package/README.md +49 -0
  2. package/bin/cli.js +251 -0
  3. package/istm/SKILL.md +65 -0
  4. package/istm-animate/SKILL.md +87 -0
  5. package/istm-animate/animations/animation_utils.md +280 -0
  6. package/istm-animate/animations/animations.md +220 -0
  7. package/istm-animate/animations/core_motion.md +250 -0
  8. package/istm-animate/animations/examples/README.md +29 -0
  9. package/istm-animate/animations/examples/nuxt/app/app.vue +3 -0
  10. package/istm-animate/animations/examples/nuxt/app/composables/useGSAP.ts +91 -0
  11. package/istm-animate/animations/examples/nuxt/app/pages/index.vue +55 -0
  12. package/istm-animate/animations/examples/nuxt/nuxt.config.ts +4 -0
  13. package/istm-animate/animations/examples/nuxt/package.json +18 -0
  14. package/istm-animate/animations/examples/react/App.jsx +46 -0
  15. package/istm-animate/animations/examples/react/index.html +12 -0
  16. package/istm-animate/animations/examples/react/main.jsx +9 -0
  17. package/istm-animate/animations/examples/react/package.json +21 -0
  18. package/istm-animate/animations/examples/react/vite.config.js +7 -0
  19. package/istm-animate/animations/examples/vanilla/index.html +33 -0
  20. package/istm-animate/animations/examples/vanilla/main.js +36 -0
  21. package/istm-animate/animations/examples/vue/app.vue +47 -0
  22. package/istm-animate/animations/examples/vue/index.html +15 -0
  23. package/istm-animate/animations/examples/vue/main.js +9 -0
  24. package/istm-animate/animations/examples/vue/package.json +19 -0
  25. package/istm-animate/animations/examples/vue/vite.config.js +7 -0
  26. package/istm-animate/animations/framework_motion.md +262 -0
  27. package/istm-animate/animations/motion.csv +17 -0
  28. package/istm-animate/animations/motion.md +11 -0
  29. package/istm-animate/animations/motion_catalog.json +226 -0
  30. package/istm-animate/animations/motion_performance.md +75 -0
  31. package/istm-animate/animations/motion_plugins.md +429 -0
  32. package/istm-animate/animations/react_animations.md +132 -0
  33. package/istm-animate/animations/scroll_trigger_effects.md +291 -0
  34. package/istm-animate/animations/timeline_sequencing.md +103 -0
  35. package/istm-architecture/SKILL.md +109 -0
  36. package/istm-architecture/frameworks/angular.csv +51 -0
  37. package/istm-architecture/frameworks/astro.csv +54 -0
  38. package/istm-architecture/frameworks/avalonia.csv +57 -0
  39. package/istm-architecture/frameworks/flutter.csv +53 -0
  40. package/istm-architecture/frameworks/javafx.csv +76 -0
  41. package/istm-architecture/frameworks/jetpack-compose.csv +53 -0
  42. package/istm-architecture/frameworks/laravel.csv +51 -0
  43. package/istm-architecture/frameworks/nextjs.csv +53 -0
  44. package/istm-architecture/frameworks/nuxtjs.csv +59 -0
  45. package/istm-architecture/frameworks/react-native.csv +52 -0
  46. package/istm-architecture/frameworks/react.csv +54 -0
  47. package/istm-architecture/frameworks/svelte.csv +54 -0
  48. package/istm-architecture/frameworks/swiftui.csv +51 -0
  49. package/istm-architecture/frameworks/uwp.csv +56 -0
  50. package/istm-architecture/frameworks/vue.csv +50 -0
  51. package/istm-architecture/frameworks/winui.csv +60 -0
  52. package/istm-architecture/frameworks/wpf.csv +57 -0
  53. package/istm-architecture/templates/agents.md +229 -0
  54. package/istm-architecture/templates/architecture.md +111 -0
  55. package/istm-architecture/templates/design.md +138 -0
  56. package/istm-architecture/templates/project-overview.md +215 -0
  57. package/istm-awwward-designer/SKILL.md +43 -0
  58. package/istm-awwward-designer/libraries/threejs.csv +54 -0
  59. package/istm-awwward-designer/references/accessibility.md +774 -0
  60. package/istm-awwward-designer/references/anim-anti-patterns.md +576 -0
  61. package/istm-awwward-designer/references/animation-map.md +166 -0
  62. package/istm-awwward-designer/references/animation-standards.md +86 -0
  63. package/istm-awwward-designer/references/anti-patterns.md +191 -0
  64. package/istm-awwward-designer/references/color-systems.md +604 -0
  65. package/istm-awwward-designer/references/css-performance.md +477 -0
  66. package/istm-awwward-designer/references/descender-safety.md +490 -0
  67. package/istm-awwward-designer/references/design-audit.md +93 -0
  68. package/istm-awwward-designer/references/font-loading.md +378 -0
  69. package/istm-awwward-designer/references/image-optimization.md +440 -0
  70. package/istm-awwward-designer/references/invention-gate.md +356 -0
  71. package/istm-awwward-designer/references/micro-interactions.md +825 -0
  72. package/istm-awwward-designer/references/page-transitions.md +365 -0
  73. package/istm-awwward-designer/references/performance-standards.md +79 -0
  74. package/istm-awwward-designer/references/quality-gate.md +103 -0
  75. package/istm-awwward-designer/references/responsive-design.md +778 -0
  76. package/istm-awwward-designer/references/scoring-guide.md +201 -0
  77. package/istm-awwward-designer/references/scroll-patterns.md +668 -0
  78. package/istm-awwward-designer/references/stitch-brief.md +124 -0
  79. package/istm-awwward-designer/references/tech-stack.md +204 -0
  80. package/istm-awwward-designer/references/technical-audit.md +133 -0
  81. package/istm-awwward-designer/references/technique-families.md +293 -0
  82. package/istm-awwward-designer/references/testing.md +535 -0
  83. package/istm-awwward-designer/references/text-animation.md +585 -0
  84. package/istm-awwward-designer/references/typography.md +504 -0
  85. package/istm-awwward-designer/references/usability-audit.md +108 -0
  86. package/istm-awwward-designer/references/visual-standards.md +97 -0
  87. package/istm-design/SKILL.md +98 -0
  88. package/istm-design/colors/color_theory.md +293 -0
  89. package/istm-design/colors/colors.csv +193 -0
  90. package/istm-design/colors/colors_catalog.json +4034 -0
  91. package/istm-design/colors/palette.json +21 -0
  92. package/istm-design/styles/design_system.md +288 -0
  93. package/istm-design/styles/html-tailwind.csv +56 -0
  94. package/istm-design/styles/nuxt-ui.csv +71 -0
  95. package/istm-design/styles/product_design.md +55 -0
  96. package/istm-design/styles/shadcn.csv +61 -0
  97. package/istm-design/styles/style.md +12 -0
  98. package/istm-design/styles/styles.csv +85 -0
  99. package/istm-design/styles/styles_catalog.json +2018 -0
  100. package/istm-design/styles/ui-reasoning.csv +162 -0
  101. package/istm-design/styles/uno.csv +60 -0
  102. package/istm-design/typography/font_and_font.md +10 -0
  103. package/istm-design/typography/google-fonts.csv +1924 -0
  104. package/istm-design/typography/sans_serif_fonts.md +112 -0
  105. package/istm-design/typography/typography.csv +75 -0
  106. package/istm-design/typography/typography_catalog.json +964 -0
  107. package/istm-design/ux/app-interface.csv +31 -0
  108. package/istm-design/ux/charts.csv +26 -0
  109. package/istm-design/ux/icons.csv +106 -0
  110. package/istm-design/ux/landing.csv +35 -0
  111. package/istm-design/ux/products.csv +193 -0
  112. package/istm-design/ux/react-performance.csv +45 -0
  113. package/istm-design/ux/responsive_rules.md +62 -0
  114. package/istm-design/ux/storytelling.md +47 -0
  115. package/istm-design/ux/ux-guidelines.csv +100 -0
  116. package/istm-design/ux/ux_guidelines.json +1190 -0
  117. package/istm-system-design/SKILL.md +88 -0
  118. package/istm-system-design/principles/01-architecture-patterns.md +24 -0
  119. package/istm-system-design/principles/02-database-selection.md +32 -0
  120. package/istm-system-design/principles/03-api-design.md +25 -0
  121. package/istm-system-design/principles/04-authentication-security.md +23 -0
  122. package/istm-system-design/principles/05-caching-performance.md +21 -0
  123. package/istm-system-design/principles/06-asynchronous-processing.md +17 -0
  124. package/istm-system-design/principles/07-infrastructure-deployment.md +22 -0
  125. package/istm-system-design/principles/08-low-level-design.md +35 -0
  126. package/istm-system-design/principles/09-state-management.md +14 -0
  127. package/istm-system-design/principles/10-error-handling-and-logging.md +26 -0
  128. package/istm-system-design/principles/11-testing-strategy.md +18 -0
  129. package/istm-system-design/principles/12-seo-and-web-vitals.md +18 -0
  130. package/istm-system-design/stacks/SETUP.md +82 -0
  131. package/istm-system-design/stacks/STACK.md +67 -0
  132. package/istm-system-design/stacks/WORKFLOW.md +84 -0
  133. package/istm-system-design/templates/api-route.ts.template +32 -0
  134. package/istm-system-design/templates/migrations.md.template +30 -0
  135. package/istm-system-design/templates/schema.drizzle.ts.template +17 -0
  136. package/istm-system-design/templates/schema.prisma.template +28 -0
  137. package/istm-system-design/templates/trpc-router.ts.template +22 -0
  138. package/istm-system-design/templates/zod-validators.ts.template +14 -0
  139. package/istm-workflow/istm-audit/SKILL.md +108 -0
  140. package/istm-workflow/istm-audit/agent-prompt.md +393 -0
  141. package/istm-workflow/istm-audit/agents/openai.yaml +7 -0
  142. package/istm-workflow/istm-audit/modes/area.md +19 -0
  143. package/istm-workflow/istm-audit/modes/gapfill.md +12 -0
  144. package/istm-workflow/istm-audit/modes/greenfield.md +24 -0
  145. package/istm-workflow/istm-audit/modes/tool-skills.md +39 -0
  146. package/istm-workflow/istm-audit/modes/whole-repo.md +5 -0
  147. package/istm-workflow/istm-audit/patterns/clean-architecture.md +15 -0
  148. package/istm-workflow/istm-audit/patterns/domain-driven.md +16 -0
  149. package/istm-workflow/istm-audit/patterns/functional.md +16 -0
  150. package/istm-workflow/istm-audit/patterns/solid-oop.md +17 -0
  151. package/istm-workflow/istm-check/SKILL.md +52 -0
  152. package/istm-workflow/istm-check/agents/openai.yaml +7 -0
  153. package/istm-workflow/istm-check/modes/review.md +156 -0
  154. package/istm-workflow/istm-check/modes/verify.md +197 -0
  155. package/istm-workflow/istm-check/review-agent-prompt.md +57 -0
  156. package/istm-workflow/istm-check/review-guide.md +133 -0
  157. package/istm-workflow/istm-craft/SKILL.md +37 -0
  158. package/istm-workflow/istm-craft/agent-modes/architecture.md +73 -0
  159. package/istm-workflow/istm-craft/agent-modes/cross-cutting.md +65 -0
  160. package/istm-workflow/istm-craft/agent-modes/enhancement.md +45 -0
  161. package/istm-workflow/istm-craft/agent-modes/feature.md +85 -0
  162. package/istm-workflow/istm-craft/agent-prompt.md +249 -0
  163. package/istm-workflow/istm-craft/agents/openai.yaml +7 -0
  164. package/istm-workflow/istm-craft/internal/after-subagent.md +90 -0
  165. package/istm-workflow/istm-craft/internal/design-conversation.md +140 -0
  166. package/istm-workflow/istm-craft/internal/tool-discovery.md +58 -0
  167. package/istm-workflow/istm-craft/spec-template.md +278 -0
  168. package/istm-workflow/istm-debug/SKILL.md +102 -0
  169. package/istm-workflow/istm-debug/agents/openai.yaml +7 -0
  170. package/istm-workflow/istm-develop/SKILL.md +144 -0
  171. package/istm-workflow/istm-develop/agents/openai.yaml +7 -0
  172. package/istm-workflow/istm-develop/checklist.md +95 -0
  173. package/istm-workflow/istm-develop/flow/build.md +133 -0
  174. package/istm-workflow/istm-develop/flow/git.md +34 -0
  175. package/istm-workflow/istm-develop/logical-guide.md +99 -0
  176. package/istm-workflow/istm-develop/ui/existing.md +23 -0
  177. package/istm-workflow/istm-develop/ui/generate.md +131 -0
  178. package/istm-workflow/istm-develop/ui/image.md +41 -0
  179. package/istm-workflow/istm-develop/ui/implementation.md +281 -0
  180. package/istm-workflow/istm-develop/ui/mcp.md +11 -0
  181. package/istm-workflow/istm-develop/ui-guide.md +164 -0
  182. package/istm-workflow/istm-document/SKILL.md +123 -0
  183. package/istm-workflow/istm-document/agent-prompt.md +57 -0
  184. package/istm-workflow/istm-document/agents/openai.yaml +7 -0
  185. package/istm-workflow/istm-document/templates/changelog.md +54 -0
  186. package/istm-workflow/istm-document/templates/postmortem.md +58 -0
  187. package/istm-workflow/istm-document/templates/pr.md +43 -0
  188. package/istm-workflow/istm-document/templates/release-note.md +41 -0
  189. package/istm-workflow/istm-scope/SKILL.md +100 -0
  190. package/istm-workflow/istm-scope/agents/openai.yaml +7 -0
  191. package/istm-workflow/istm-scope/approaches/facade.md +33 -0
  192. package/istm-workflow/istm-scope/approaches/journey.md +31 -0
  193. package/istm-workflow/istm-scope/approaches/skateboard.md +33 -0
  194. package/istm-workflow/istm-scope/approaches/tracer-bullet.md +34 -0
  195. package/istm-workflow/istm-scope/modes/add.md +14 -0
  196. package/istm-workflow/istm-scope/modes/plan-brownfield.md +11 -0
  197. package/istm-workflow/istm-scope/modes/plan-greenfield.md +20 -0
  198. package/istm-workflow/istm-scope/modes/plan-monorepo.md +8 -0
  199. package/istm-workflow/istm-scope/modes/plan.md +120 -0
  200. package/istm-workflow/istm-scope/modes/replan.md +13 -0
  201. package/istm-workflow/istm-scope/scope-template.md +148 -0
  202. package/istm-workflow/istm-sync/SKILL.md +166 -0
  203. package/istm-workflow/istm-sync/agent-prompt.md +211 -0
  204. package/istm-workflow/istm-sync/agents/openai.yaml +7 -0
  205. package/istm-workflow/istm-test/SKILL.md +233 -0
  206. package/istm-workflow/istm-test/agent-prompt.md +62 -0
  207. package/istm-workflow/istm-test/agents/openai.yaml +7 -0
  208. package/istm-workflow/istm-test/modes/setup.md +97 -0
  209. package/istm-workflow/istm-test/writing-guide.md +196 -0
  210. package/package.json +35 -0
@@ -0,0 +1,490 @@
1
+ # Descender Safety Protocol
2
+
3
+ ## The Canvas Measurement Technique
4
+
5
+ Don't estimate descender depth. Measure it.
6
+
7
+ ```javascript
8
+ /**
9
+ * Measure the actual descender depth for a font at a given size.
10
+ * Returns pixels of descent below the baseline.
11
+ */
12
+ function measureDescender(fontFamily, fontSize, text = 'gy') {
13
+ const canvas = document.createElement('canvas');
14
+ canvas.width = 500;
15
+ canvas.height = 200;
16
+
17
+ const ctx = canvas.getContext('2d');
18
+ ctx.fillStyle = '#000';
19
+ ctx.font = `${fontSize}px ${fontFamily}`;
20
+
21
+ // TextMetrics object contains actual bounding box
22
+ const metrics = ctx.measureText(text);
23
+
24
+ // actualBoundingBoxDescent = pixels below baseline
25
+ const descent = metrics.actualBoundingBoxDescent;
26
+
27
+ console.log(`${fontFamily} @ ${fontSize}px descender: ${descent}px`);
28
+
29
+ return descent;
30
+ }
31
+
32
+ // Usage:
33
+ measureDescender('pp-neue-machina', 100); // Returns ~18px
34
+ measureDescender('druk', 100); // Returns ~10px
35
+ measureDescender('editorial-new', 100); // Returns ~20px
36
+ measureDescender('freight-display', 100); // Returns ~22px
37
+ ```
38
+
39
+ **How to use this:**
40
+ 1. Run this function in the browser console on your live site
41
+ 2. Pass the actual font family, size, and text you're using
42
+ 3. The return value is the real pixel depth of the descender
43
+ 4. Add 20% padding buffer: if descender is 18px, use 22px clearance
44
+
45
+ ---
46
+
47
+ ## The --descender-clearance CSS System
48
+
49
+ Create a global CSS custom property system for descender clearance. Measure each font family once, then reuse the values everywhere.
50
+
51
+ ```css
52
+ :root {
53
+ /* ===========================
54
+ Font-specific descender clearance values
55
+ Measured via canvas API, includes 20% safety buffer
56
+ =========================== */
57
+
58
+ /* Serif/Editorial fonts (larger descenders) */
59
+ --descender-editorial-new: 0.20em;
60
+ --descender-freight-display: 0.22em;
61
+ --descender-canela: 0.18em;
62
+
63
+ /* Premium sans (medium descenders) */
64
+ --descender-pp-neue-machina: 0.18em;
65
+ --descender-druk: 0.10em;
66
+ --descender-sohne: 0.12em;
67
+ --descender-aktiv-grotesk: 0.14em;
68
+
69
+ /* Tech/monospace (conservative) */
70
+ --descender-pp-sans-mono: 0.15em;
71
+ --descender-ibm-plex-mono: 0.16em;
72
+
73
+ /* Fallback for unmeasured fonts */
74
+ --descender-fallback: 0.15em;
75
+
76
+ /* Active font clearance — set this per project */
77
+ --descender-clearance: var(--descender-editorial-new);
78
+ }
79
+
80
+ /* ===========================
81
+ Apply clearance to all display text
82
+ =========================== */
83
+
84
+ /* Headings — overflow:visible lets descenders render into padding freely */
85
+ h1, h2, h3, h4, h5, h6 {
86
+ padding-bottom: var(--descender-clearance);
87
+ overflow: visible; /* NOT clip — clip ignores padding and cuts glyphs */
88
+ }
89
+
90
+ /* Display classes */
91
+ [class*="display"],
92
+ [class*="hero"],
93
+ [class*="headline"],
94
+ [class*="title"] {
95
+ padding-bottom: var(--descender-clearance);
96
+ overflow: visible;
97
+ }
98
+
99
+ /* Larger body text (>48px) */
100
+ p[class*="lead"],
101
+ p[class*="lg"],
102
+ p[class*="xl"] {
103
+ padding-bottom: var(--descender-clearance);
104
+ overflow: visible;
105
+ }
106
+
107
+ /* Typography animation wrappers */
108
+ .split-text-line,
109
+ [class*="split"],
110
+ [class*="animate-text"] {
111
+ padding-bottom: var(--descender-clearance);
112
+ overflow: visible;
113
+ }
114
+ ```
115
+
116
+ **Critical: `overflow: clip` vs `overflow: hidden` vs `overflow: visible`:**
117
+ - `overflow: clip` **does NOT respect `padding-bottom`** — it clips at the content box edge, making your padding useless. Despite being lighter weight, it will still cut descenders.
118
+ - `overflow: hidden` respects padding but creates a new block formatting context (affects margin collapse)
119
+ - `overflow: visible` — **the correct choice for text elements** — lets descenders breathe completely. Use `padding-bottom` to reserve space from the layout perspective, and let the glyph render into that padding freely.
120
+
121
+ **Bottom line for text elements:** Use `overflow: visible` + `padding-bottom: 0.18em`. Never use `overflow: clip` on a text element that contains italic or descending glyphs.
122
+
123
+ **For container sections (`.hero`, etc):** Use `overflow: hidden` (not `clip`) so that `padding` is respected and children can render into it.
124
+
125
+ ---
126
+
127
+ ## Split-Text Animation Rules (SplitType + GSAP)
128
+
129
+ When using SplitType with GSAP to animate text, descender clipping is guaranteed unless you follow these rules.
130
+
131
+ ### Rule 1: Every Line Wrapper Gets Padding
132
+
133
+ SplitType creates this structure:
134
+
135
+ ```html
136
+ <div class="split-text">
137
+ <div class="split-text-line">
138
+ <span class="split-text-char">H</span>
139
+ <span class="split-text-char">e</span>
140
+ <!-- ... -->
141
+ </div>
142
+ <div class="split-text-line">
143
+ <!-- second line -->
144
+ </div>
145
+ </div>
146
+ ```
147
+
148
+ The `.split-text-line` div has `overflow: hidden` and `height: calculated-line-height`. This is where clipping happens.
149
+
150
+ **Fix:** Apply descender padding to every line:
151
+
152
+ ```css
153
+ .split-text-line {
154
+ padding-bottom: var(--descender-clearance);
155
+ overflow: visible; /* NOT clip — clip ignores padding and cuts descenders */
156
+ }
157
+ ```
158
+
159
+ ### Rule 2: Calculate Actual Descender Before Animation
160
+
161
+ Don't use a generic 0.15em for every font. Measure the actual descender for your specific font at your specific size.
162
+
163
+ ```javascript
164
+ // At component mount, measure once
165
+ function calculateDescenderClearance(element, fontFamily, fontSize) {
166
+ const descent = measureDescender(fontFamily, fontSize);
167
+ // Convert pixels to em: 18px @ 100px = 0.18em
168
+ const clearanceEm = (descent * 1.2) / fontSize; // 1.2 = 20% buffer
169
+
170
+ // Set CSS custom property on the element
171
+ element.style.setProperty('--descender-clearance', `${clearanceEm.toFixed(2)}em`);
172
+ }
173
+
174
+ // Usage
175
+ const textElement = document.querySelector('.hero-title');
176
+ calculateDescenderClearance(textElement, 'editorial-new', 120);
177
+ ```
178
+
179
+ ### Rule 3: GSAP SplitType Example With Descender Safety
180
+
181
+ ```javascript
182
+ import gsap from 'gsap';
183
+ import SplitType from 'split-type';
184
+
185
+ function animateHeadlineWithDescenderSafety(selector) {
186
+ const element = document.querySelector(selector);
187
+
188
+ // Measure descender for this specific font/size
189
+ const computed = window.getComputedStyle(element);
190
+ const fontSize = parseFloat(computed.fontSize);
191
+ const fontFamily = computed.fontFamily; // extract from CSS
192
+
193
+ // Calculate and apply clearance
194
+ const descent = measureDescender(fontFamily, fontSize);
195
+ const clearanceEm = (descent * 1.2) / fontSize;
196
+ element.style.setProperty('--descender-clearance', `${clearanceEm.toFixed(2)}em`);
197
+
198
+ // Split text
199
+ const split = new SplitType(selector, {
200
+ types: 'lines,words,chars',
201
+ lineClass: 'split-text-line',
202
+ charClass: 'split-text-char'
203
+ });
204
+
205
+ // Apply padding to all line wrappers — overflow:visible lets descenders breathe
206
+ split.lines.forEach(line => {
207
+ line.style.paddingBottom = `${clearanceEm.toFixed(2)}em`;
208
+ line.style.overflow = 'visible'; // NOT 'clip' — clip ignores padding
209
+ });
210
+
211
+ // Now animate safely
212
+ gsap.from(split.chars, {
213
+ duration: 0.8,
214
+ opacity: 0,
215
+ y: 10,
216
+ stagger: 0.05,
217
+ ease: 'back.out'
218
+ });
219
+ }
220
+
221
+ // Call on component mount
222
+ animateHeadlineWithDescenderSafety('.hero-title');
223
+ ```
224
+
225
+ ### Rule 4: Stagger Timing with Font Weight Variation
226
+
227
+ If using a variable font with wght axis, vary the timing based on character weight for more organic feel:
228
+
229
+ ```javascript
230
+ gsap.from(split.chars, {
231
+ duration: 0.8,
232
+ opacity: 0,
233
+ y: 10,
234
+ stagger: (index, target) => {
235
+ // Heavier characters animate slightly slower
236
+ const fontWeight = parseInt(window.getComputedStyle(target).fontWeight) || 400;
237
+ const weightFactor = fontWeight / 400; // 400 = normal, 700+ = slower
238
+ return index * 0.05 * weightFactor;
239
+ },
240
+ ease: 'back.out'
241
+ });
242
+ ```
243
+
244
+ ---
245
+
246
+ ## Hero Section Rules
247
+
248
+ Hero sections with large text are the highest risk for descender clipping.
249
+
250
+ ### Never Use Overflow: Clip on Hero Container or Text Elements
251
+
252
+ ```css
253
+ /* WRONG — overflow:clip ignores padding entirely, cuts descenders */
254
+ .hero {
255
+ height: 100dvh;
256
+ overflow: clip; /* clip ignores padding — descenders still cut */
257
+ overflow-clip-margin: 0.2em; /* this doesn't save you */
258
+ }
259
+
260
+ .hero h1 {
261
+ font-size: 120px;
262
+ overflow: clip; /* NEVER on a text element */
263
+ padding-bottom: 0.18em; /* useless when overflow:clip is set */
264
+ }
265
+ ```
266
+
267
+ ### Correct Pattern: overflow:hidden on Container, overflow:visible on Text
268
+
269
+ ```css
270
+ /* CORRECT */
271
+ .hero {
272
+ height: 100dvh; /* dvh accounts for mobile address bar resize */
273
+ overflow: hidden; /* hidden (not clip) respects padding on child elements */
274
+ position: relative;
275
+ }
276
+
277
+ .hero h1 {
278
+ font-size: 120px;
279
+ padding-bottom: var(--descender-clearance); /* reserves layout space */
280
+ overflow: visible; /* lets glyph descenders render freely into that padding */
281
+ }
282
+ ```
283
+
284
+ The key insight: `overflow: clip` operates at the element's **content box** boundary and does not honour `padding-bottom`. `overflow: visible` on the text element combined with `padding-bottom` is the correct and battle-tested approach.
285
+
286
+ ### Ensure Next Section Has Top Padding
287
+
288
+ If the hero contains descenders, the next section must have padding to accommodate them when they extend past the hero boundary.
289
+
290
+ ```css
291
+ .section-after-hero {
292
+ padding-top: 120px; /* Space for potential descender overflow */
293
+ /* Or use CSS custom property */
294
+ padding-top: var(--section-padding-top, 120px);
295
+ }
296
+ ```
297
+
298
+ ### If Using Clip-Path on Hero
299
+
300
+ If you're creating a fancy clip-path shape for the hero bottom edge, add margin to account for descenders:
301
+
302
+ ```css
303
+ .hero {
304
+ clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
305
+ margin-bottom: 60px; /* Descender clearance */
306
+ }
307
+
308
+ .hero h1 {
309
+ padding-bottom: var(--descender-clearance);
310
+ }
311
+ ```
312
+
313
+ ---
314
+
315
+ ## The Mandatory Visual Check Sequence
316
+
317
+ Before declaring any site with display text (>48px) complete, run this checklist:
318
+
319
+ ### Step 1: Render at Scale
320
+ Open the live site on a desktop browser. Navigate to the page with large headings (hero, section titles, quotes).
321
+
322
+ ### Step 2: Use Test String
323
+ In the browser DevTools, find the first headline (h1 or large display text). Right-click → Inspect. The element should contain or be replaced with this test string:
324
+
325
+ ```
326
+ Typography Gg Yy Qq Pp
327
+ ```
328
+
329
+ You can manually type this into a headline temporarily, or add it as a data attribute that you toggle on/off with CSS:
330
+
331
+ ```html
332
+ <h1 class="hero-title" data-test="true">
333
+ Typography Gg Yy Qq Pp
334
+ </h1>
335
+ ```
336
+
337
+ ```css
338
+ h1[data-test="true"]::before {
339
+ content: "Typography Gg Yy Qq Pp";
340
+ }
341
+ ```
342
+
343
+ ### Step 3: Check Bottom Edge
344
+
345
+ Look closely at the bottom edge of the text. Specifically:
346
+ - Is the tail of 'g' fully visible?
347
+ - Is the tail of 'y' fully visible?
348
+ - Is the descender of 'q' fully visible?
349
+ - Is the descender of 'p' fully visible?
350
+
351
+ If ANY letter is cut off, stop and increase `--descender-clearance` by 0.02em.
352
+
353
+ ### Step 4: Repeat at Multiple Sizes
354
+
355
+ Check at:
356
+ - Desktop (1920px wide)
357
+ - Tablet (768px wide)
358
+ - Mobile (375px wide)
359
+
360
+ Font sizes may scale with clamp(), so check at all breakpoints.
361
+
362
+ ### Step 5: Check in Different Browsers
363
+
364
+ - Chrome
365
+ - Safari (if Mac available)
366
+ - Firefox
367
+
368
+ They may render differently due to metric table selection. If any browser clips, adjust clearance upward to the most conservative value.
369
+
370
+ ### Step 6: Screenshot and Verify
371
+
372
+ Take a screenshot of each headline in each viewport. Keep these screenshots. If a site is flagged in review for descender clipping, pull up these screenshots to verify you tested.
373
+
374
+ ### Step 7: Mobile-Specific Check
375
+
376
+ On actual mobile device (not browser resize):
377
+ - Render headline at mobile scale
378
+ - Check descenders
379
+ - They may look different due to rendering differences
380
+
381
+ ### Step 8: Declare Done
382
+
383
+ Only after all checks pass can you declare text implementation complete. Add this comment to your CSS:
384
+
385
+ ```css
386
+ /*
387
+ * Descender Safety: VERIFIED
388
+ * Tested @ 100px, 120px, 72px scales
389
+ * Browsers: Chrome, Safari, Firefox
390
+ * Devices: Desktop 1920px, Tablet 768px, Mobile 375px
391
+ * All descenders (g,y,q,p) visible and unclipped
392
+ * Last verified: 2025-03-02
393
+ */
394
+ ```
395
+
396
+ ---
397
+
398
+ ## Mobile Considerations
399
+
400
+ At smaller font sizes (body text, 16-24px), descenders are less visually noticeable, but split-text containers still clip if the line wrapper is too short.
401
+
402
+ ### Mobile Text Scaling with Clamp
403
+
404
+ If using clamp() for responsive typography:
405
+
406
+ ```css
407
+ h1 {
408
+ font-size: clamp(2.625rem, 5vw, 3.5rem);
409
+ /* At 375px mobile: 2.625rem = 42px
410
+ At 1920px desktop: 3.5rem = 56px
411
+ Descender scales with font size */
412
+ padding-bottom: var(--descender-clearance);
413
+ /* If clearance is 0.20em at large size, at mobile it's 0.20em * 42px = 8.4px
414
+ Still safe but less buffer */
415
+ }
416
+ ```
417
+
418
+ If your descender clearance is measured at desktop size, test that it still works at mobile. If mobile text looks tighter, increase clearance by 0.02em.
419
+
420
+ ### Touch-Friendly Test
421
+
422
+ On mobile, use your finger (not cursor) to hover over text to see the actual rendering on a touch device. Rendering may differ from desktop due to browser optimization.
423
+
424
+ ---
425
+
426
+ ## Advanced: Custom Descender Measurement Per Font
427
+
428
+ If you're using 3+ different premium fonts, create a font-specific measurement once and store it:
429
+
430
+ ```javascript
431
+ // fonts-config.js
432
+ export const FONT_METRICS = {
433
+ 'editorial-new': {
434
+ descenderClearance: '0.20em',
435
+ descenderPixels: 20, // at 100px size
436
+ category: 'serif'
437
+ },
438
+ 'pp-neue-machina': {
439
+ descenderClearance: '0.18em',
440
+ descenderPixels: 18,
441
+ category: 'sans'
442
+ },
443
+ 'druk': {
444
+ descenderClearance: '0.10em',
445
+ descenderPixels: 10,
446
+ category: 'sans'
447
+ },
448
+ 'sohne': {
449
+ descenderClearance: '0.12em',
450
+ descenderPixels: 12,
451
+ category: 'sans'
452
+ },
453
+ 'freight-display': {
454
+ descenderClearance: '0.22em',
455
+ descenderPixels: 22,
456
+ category: 'serif'
457
+ }
458
+ };
459
+
460
+ // Then in your CSS or component
461
+ import { FONT_METRICS } from './fonts-config.js';
462
+
463
+ function applyDescenderSafety(element, fontFamily) {
464
+ const metrics = FONT_METRICS[fontFamily];
465
+ if (metrics) {
466
+ element.style.setProperty('--descender-clearance', metrics.descenderClearance);
467
+ }
468
+ }
469
+ ```
470
+
471
+ This prevents re-measuring every project and ensures consistency.
472
+
473
+ ---
474
+
475
+ ## Checklist: Descender Safety Before Launch
476
+
477
+ - [ ] Measured actual descender depth for each font family used (canvas API)
478
+ - [ ] Created --descender-clearance CSS custom properties for each font
479
+ - [ ] Applied padding-bottom to all headings, display text, split-text lines
480
+ - [ ] Used `overflow: visible` on all text/heading elements (NOT `overflow: clip` — clip ignores padding)
481
+ - [ ] Used `overflow: hidden` (not `clip`) on hero container sections so child padding is respected
482
+ - [ ] Tested visual check sequence with "Typography Gg Yy Qq Pp" at all sizes
483
+ - [ ] Checked in Chrome, Safari, Firefox
484
+ - [ ] Verified on mobile, tablet, desktop viewports
485
+ - [ ] Confirmed actual device rendering (not just browser resize)
486
+ - [ ] Screenshots taken and saved for reference
487
+ - [ ] No descenders clipped anywhere on the site
488
+ - [ ] Added descender-safety verification comment to CSS
489
+
490
+ Descender clipping is 100% preventable. It only happens if you skip this protocol. Don't skip it.
@@ -0,0 +1,93 @@
1
+ # Design Quality Gate — Deep Dive
2
+
3
+ > Load when running Gate 1 (Design Quality). This is the detailed audit checklist for visual and brand decisions.
4
+
5
+ ---
6
+
7
+ ## Typography Audit
8
+
9
+ **These are automatic failures:**
10
+
11
+ - [ ] **No default system fonts** — `system-ui`, `Arial`, `Helvetica`, `Times New Roman`, `Georgia` as primary fonts. Custom fonts or quality variable fonts only.
12
+ - [ ] **Consistent font stack** — All type uses the same family (or approved secondary). No random font changes mid-page.
13
+ - [ ] **Consistent type scale** — Modular scale in use (1.25×, 1.333×, etc.). Not arbitrary random sizes.
14
+ - [ ] **Readable hierarchy** — h1 is largest, h2 secondary, h3 tertiary. No skipped levels. Body text at a size that doesn't require zooming.
15
+ - [ ] **No clipped descenders** — Letters g, y, p, q, j must not be cut off. **Critical rule**: any text element with `font-size > 48px` must have `overflow: visible` OR adequate `padding-bottom` to prevent glyph clipping. Test with "gypqj" strings at max font size.
16
+ - [ ] **Line height appropriate** — Body text: 1.5–1.7. Headings: 1.1–1.3. Tight but not cramped.
17
+ - [ ] **Letter spacing intentional** — All caps text should have tracked letter-spacing. No random letter-spacing on body text.
18
+ - [ ] **No text overflow** — No text running off containers. No `...` truncation without tooltip/expansion.
19
+
20
+ ---
21
+
22
+ ## Color Audit
23
+
24
+ **These are automatic failures:**
25
+
26
+ - [ ] **Coherent palette** — Maximum 2–3 primary colors + neutrals. No more than 6 distinct colors total. More than that = incoherent.
27
+ - [ ] **WCAG AA contrast** — All body text ≥4.5:1 ratio. Large text (≥18pt regular / ≥14pt bold) ≥3:1. Check all states: default, hover, active, disabled.
28
+ - [ ] **Not generic/template** — The palette must feel intentional to this brand. A tech startup should not look like a law firm. A luxury brand should not look like a SaaS product.
29
+ - [ ] **Dark mode / light mode** — If one exists, the other must too. Both must meet contrast requirements.
30
+ - [ ] **Color is not decorative-only** — Every color used must serve a purpose: brand, hierarchy, feedback (error/success), or state.
31
+ - [ ] **Hover/active states have contrast** — Interactive elements must not lose contrast on hover/active.
32
+ - [ ] **No pure #000000 or #FFFFFF** — Unless intentional brand choice. Off-black (#0a0a0a, #111) and off-white (#fafafa, #f5f5f5) feel more premium.
33
+
34
+ ---
35
+
36
+ ## Layout Audit
37
+
38
+ **These are automatic failures:**
39
+
40
+ - [ ] **Intentional rhythm** — Sections don't all look the same. There is variety: full-bleed vs. contained, dense vs. airy, single-column vs. multi-column.
41
+ - [ ] **Asymmetric where appropriate** — Not everything centered. Hero text left-aligned. Grid offset. Images breaking columns. Asymmetry creates visual interest.
42
+ - [ ] **Breathing room** — Generous padding/margin. Content doesn't feel cramped. White space is used intentionally, not as an afterthought.
43
+ - [ ] **Consistent spacing scale** — 4px/8px base grid. All spacing is a multiple of 4px (or 8px). No arbitrary spacing values like 37px or 53px.
44
+ - [ ] **Grid system** — If multi-column, a consistent grid (12-col, 8-col) in use. Not random widths.
45
+ - [ ] **Responsive behavior** — Layout adapts to breakpoints, not just hides things. Mobile layout should feel designed, not broken.
46
+ - [ ] **No equal visual weight everywhere** — Some sections/features are more prominent. If everything is "loud," nothing is.
47
+
48
+ ---
49
+
50
+ ## Image Audit
51
+
52
+ **These are automatic failures:**
53
+
54
+ - [ ] **High quality** — No pixelated, no stretched, no low-res images. All images should look crisp on retina displays.
55
+ - [ ] **Relevant content** — No generic stock photos of "diverse team laughing." Images must be purposeful: brand photography, product shots, or meaningful illustration.
56
+ - [ ] **Not stock-heavy** — Awwwwards jury immediately spots stock photos. Maximum 1–2 stock images if they serve a specific purpose. Prefer custom photography, real products, or purpose-built illustration.
57
+ - [ ] **Proper aspect ratios** — Images don't jump layout (use `aspect-ratio` CSS). Portrait/landscape/square consistently applied per context.
58
+ - [ ] **Optimized formats** — WebP or AVIF with Jpeg fallback. No PNG for photos (only for graphics with transparency).
59
+ - [ ] **Responsive images** — `srcset` for different display densities. `sizes` attribute correctly set.
60
+ - [ ] **Lazy loading** — Below-fold images use `loading="lazy"`. Above-fold hero images load eagerly.
61
+
62
+ ---
63
+
64
+ ## Icon Audit
65
+
66
+ **These are automatic failures:**
67
+
68
+ - [ ] **Single library** — One and only one icon library. **Must be Lucide** for Antigravity builds. Zero exceptions.
69
+ - [ ] **Consistent stroke weight** — All icons same stroke width (usually 1.5px–2px). No mixing 1px and 2px icons.
70
+ - [ ] **Consistent size** — Icons at fixed sizes (16, 20, 24, 32px). No random scaling.
71
+ - [ ] **Purposeful use** — Icons serve a function (navigation, action, status) or reinforce meaning. Not decorative noise.
72
+ - [ ] **Accessible** — Icons with no accompanying text have `aria-label`. No `aria-hidden="false"` on icon-only buttons.
73
+ - [ ] **No inline SVG spam** — Inline SVGs must be documented. Random inline SVGs are a maintenance hazard.
74
+ - [ ] **Check for violations** — Search codebase: `heroicons`, `font-awesome`, `phosphor`, `feather`, `tabler`, `remix-icon`. Any hit = immediate fail.
75
+
76
+ ---
77
+
78
+ ## Spacing Audit
79
+
80
+ - [ ] **4px/8px base unit** — All spacing values are multiples of 4px. Common values: 4, 8, 12, 16, 24, 32, 48, 64, 96, 128px.
81
+ - [ ] **Generous whitespace** — Section padding ≥64px on desktop, ≥32px on mobile. Components have internal spacing. Nothing feels cramped.
82
+ - [ ] **No micro-margins** — If spacing is <4px, it should be 0 (or 2px for fine adjustments). No 7px, 11px, 13px values.
83
+ - [ ] **Consistent component spacing** — Related elements grouped with consistent gap values. Use CSS custom properties (--space-sm, --space-md, --space-lg) to enforce consistency.
84
+
85
+ ---
86
+
87
+ ## Brand Audit
88
+
89
+ - [ ] **Design reflects brand** — Does the visual language match what the brand stands for? A fintech brand should feel trustworthy and precise. A creative agency should feel bold and distinctive.
90
+ - [ ] **Not template aesthetic** — Recognizable templates (generic hero + 3-column features + footer) are an automatic fail. Every section should feel custom.
91
+ - [ ] **Logo treatment correct** — Logo is SVG, correct proportions, correct clear space, correct colors (not forced into a color that breaks it).
92
+ - [ ] **No design inconsistency** — Every page feels like part of the same brand. Fonts, colors, spacing, icons all consistent.
93
+ - [ ] **Micro-brand moments** — Small details that show craft: custom cursor, branded scrollbar, selection color, favicon, loading state, custom focus ring.