qualia-framework 2.6.0 → 3.2.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 (321) hide show
  1. package/CLAUDE.md +64 -0
  2. package/README.md +103 -30
  3. package/agents/builder.md +110 -0
  4. package/agents/planner.md +134 -0
  5. package/agents/qa-browser.md +186 -0
  6. package/agents/verifier.md +221 -0
  7. package/bin/cli.js +336 -531
  8. package/bin/install.js +570 -0
  9. package/bin/qualia-ui.js +299 -0
  10. package/bin/state.js +630 -0
  11. package/bin/statusline.js +252 -0
  12. package/guide.md +63 -0
  13. package/hooks/auto-update.js +139 -0
  14. package/hooks/branch-guard.js +47 -0
  15. package/hooks/migration-guard.js +60 -0
  16. package/hooks/pre-compact.js +32 -0
  17. package/hooks/pre-deploy-gate.js +110 -0
  18. package/hooks/pre-push.js +33 -0
  19. package/hooks/session-start.js +170 -0
  20. package/package.json +29 -20
  21. package/rules/design-reference.md +179 -0
  22. package/rules/frontend.md +126 -0
  23. package/skills/qualia/SKILL.md +87 -0
  24. package/skills/qualia-build/SKILL.md +97 -0
  25. package/skills/qualia-debug/SKILL.md +87 -0
  26. package/skills/qualia-design/SKILL.md +93 -0
  27. package/skills/qualia-handoff/SKILL.md +66 -0
  28. package/skills/qualia-idk/SKILL.md +8 -0
  29. package/skills/qualia-learn/SKILL.md +88 -0
  30. package/skills/qualia-new/SKILL.md +323 -0
  31. package/{framework/skills → skills}/qualia-optimize/SKILL.md +1 -1
  32. package/skills/qualia-pause/SKILL.md +63 -0
  33. package/skills/qualia-plan/SKILL.md +101 -0
  34. package/skills/qualia-polish/SKILL.md +157 -0
  35. package/skills/qualia-quick/SKILL.md +37 -0
  36. package/skills/qualia-report/SKILL.md +105 -0
  37. package/skills/qualia-resume/SKILL.md +49 -0
  38. package/skills/qualia-review/SKILL.md +76 -0
  39. package/skills/qualia-ship/SKILL.md +90 -0
  40. package/skills/qualia-skill-new/SKILL.md +167 -0
  41. package/skills/qualia-task/SKILL.md +91 -0
  42. package/skills/qualia-verify/SKILL.md +113 -0
  43. package/templates/DESIGN.md +137 -0
  44. package/templates/plan.md +28 -0
  45. package/templates/project.md +22 -0
  46. package/templates/state.md +27 -0
  47. package/templates/tracking.json +20 -0
  48. package/tests/bin.test.sh +673 -0
  49. package/tests/hooks.test.sh +315 -0
  50. package/tests/state.test.sh +535 -0
  51. package/tests/statusline.test.sh +243 -0
  52. package/bin/collect-metrics.sh +0 -62
  53. package/framework/.claudeignore +0 -51
  54. package/framework/CLAUDE.md +0 -51
  55. package/framework/MCP_SETUP.md +0 -229
  56. package/framework/agents/architecture-strategist.md +0 -53
  57. package/framework/agents/backend-agent.md +0 -150
  58. package/framework/agents/code-simplicity-reviewer.md +0 -86
  59. package/framework/agents/frontend-agent.md +0 -111
  60. package/framework/agents/kieran-typescript-reviewer.md +0 -96
  61. package/framework/agents/performance-oracle.md +0 -111
  62. package/framework/agents/qualia-codebase-mapper.md +0 -761
  63. package/framework/agents/qualia-debugger.md +0 -1204
  64. package/framework/agents/qualia-executor.md +0 -882
  65. package/framework/agents/qualia-integration-checker.md +0 -424
  66. package/framework/agents/qualia-phase-researcher.md +0 -457
  67. package/framework/agents/qualia-plan-checker.md +0 -700
  68. package/framework/agents/qualia-planner.md +0 -1245
  69. package/framework/agents/qualia-project-researcher.md +0 -603
  70. package/framework/agents/qualia-research-synthesizer.md +0 -200
  71. package/framework/agents/qualia-roadmapper.md +0 -606
  72. package/framework/agents/qualia-verifier.md +0 -686
  73. package/framework/agents/red-team-qa.md +0 -130
  74. package/framework/agents/security-auditor.md +0 -72
  75. package/framework/agents/team-orchestrator.md +0 -229
  76. package/framework/agents/teams/framework-audit-team.md +0 -66
  77. package/framework/agents/teams/full-stack-team.md +0 -48
  78. package/framework/agents/teams/optimize-team.md +0 -53
  79. package/framework/agents/teams/review-team.md +0 -70
  80. package/framework/agents/teams/ship-team.md +0 -86
  81. package/framework/agents/test-agent.md +0 -182
  82. package/framework/hooks/auto-format.sh +0 -54
  83. package/framework/hooks/block-env-edit.sh +0 -42
  84. package/framework/hooks/branch-guard.sh +0 -43
  85. package/framework/hooks/confirm-delete.sh +0 -59
  86. package/framework/hooks/migration-validate.sh +0 -77
  87. package/framework/hooks/notification-speak.sh +0 -16
  88. package/framework/hooks/pre-commit.sh +0 -100
  89. package/framework/hooks/pre-compact.sh +0 -56
  90. package/framework/hooks/pre-deploy-gate.sh +0 -160
  91. package/framework/hooks/qualia-colors.sh +0 -32
  92. package/framework/hooks/retention-cleanup.sh +0 -62
  93. package/framework/hooks/save-session-state.sh +0 -185
  94. package/framework/hooks/session-context-loader.sh +0 -96
  95. package/framework/hooks/session-learn.sh +0 -32
  96. package/framework/hooks/skill-announce.sh +0 -123
  97. package/framework/hooks/tool-error-announce.sh +0 -27
  98. package/framework/install.ps1 +0 -323
  99. package/framework/install.sh +0 -313
  100. package/framework/qualia-framework/VERSION +0 -1
  101. package/framework/qualia-framework/assets/qualia-logo.png +0 -0
  102. package/framework/qualia-framework/bin/collect-metrics.sh +0 -67
  103. package/framework/qualia-framework/bin/generate-report-docx.py +0 -429
  104. package/framework/qualia-framework/bin/qualia-tools.js +0 -2201
  105. package/framework/qualia-framework/bin/qualia-tools.test.js +0 -1054
  106. package/framework/qualia-framework/references/checkpoints.md +0 -775
  107. package/framework/qualia-framework/references/completion-checklists.md +0 -359
  108. package/framework/qualia-framework/references/continuation-format.md +0 -249
  109. package/framework/qualia-framework/references/continuation-prompt.md +0 -97
  110. package/framework/qualia-framework/references/decimal-phase-calculation.md +0 -65
  111. package/framework/qualia-framework/references/design-quality.md +0 -56
  112. package/framework/qualia-framework/references/employee-guide.md +0 -167
  113. package/framework/qualia-framework/references/git-integration.md +0 -254
  114. package/framework/qualia-framework/references/git-planning-commit.md +0 -50
  115. package/framework/qualia-framework/references/model-profile-resolution.md +0 -32
  116. package/framework/qualia-framework/references/model-profiles.md +0 -73
  117. package/framework/qualia-framework/references/phase-argument-parsing.md +0 -61
  118. package/framework/qualia-framework/references/planning-config.md +0 -195
  119. package/framework/qualia-framework/references/questioning.md +0 -141
  120. package/framework/qualia-framework/references/tdd.md +0 -263
  121. package/framework/qualia-framework/references/ui-brand.md +0 -160
  122. package/framework/qualia-framework/references/verification-patterns.md +0 -612
  123. package/framework/qualia-framework/templates/DEBUG.md +0 -159
  124. package/framework/qualia-framework/templates/DESIGN.md +0 -81
  125. package/framework/qualia-framework/templates/UAT.md +0 -247
  126. package/framework/qualia-framework/templates/codebase/architecture.md +0 -255
  127. package/framework/qualia-framework/templates/codebase/concerns.md +0 -310
  128. package/framework/qualia-framework/templates/codebase/conventions.md +0 -307
  129. package/framework/qualia-framework/templates/codebase/integrations.md +0 -280
  130. package/framework/qualia-framework/templates/codebase/stack.md +0 -186
  131. package/framework/qualia-framework/templates/codebase/structure.md +0 -285
  132. package/framework/qualia-framework/templates/codebase/testing.md +0 -480
  133. package/framework/qualia-framework/templates/config.json +0 -35
  134. package/framework/qualia-framework/templates/context.md +0 -283
  135. package/framework/qualia-framework/templates/continue-here.md +0 -78
  136. package/framework/qualia-framework/templates/debug-subagent-prompt.md +0 -91
  137. package/framework/qualia-framework/templates/discovery.md +0 -146
  138. package/framework/qualia-framework/templates/lab-notes.md +0 -16
  139. package/framework/qualia-framework/templates/milestone-archive.md +0 -123
  140. package/framework/qualia-framework/templates/milestone.md +0 -115
  141. package/framework/qualia-framework/templates/phase-prompt.md +0 -567
  142. package/framework/qualia-framework/templates/planner-subagent-prompt.md +0 -117
  143. package/framework/qualia-framework/templates/project.md +0 -184
  144. package/framework/qualia-framework/templates/projects/ai-agent.md +0 -156
  145. package/framework/qualia-framework/templates/projects/mobile-app.md +0 -181
  146. package/framework/qualia-framework/templates/projects/voice-agent.md +0 -134
  147. package/framework/qualia-framework/templates/projects/website.md +0 -137
  148. package/framework/qualia-framework/templates/requirements.md +0 -231
  149. package/framework/qualia-framework/templates/research-project/ARCHITECTURE.md +0 -204
  150. package/framework/qualia-framework/templates/research-project/FEATURES.md +0 -147
  151. package/framework/qualia-framework/templates/research-project/PITFALLS.md +0 -200
  152. package/framework/qualia-framework/templates/research-project/STACK.md +0 -120
  153. package/framework/qualia-framework/templates/research-project/SUMMARY.md +0 -170
  154. package/framework/qualia-framework/templates/research.md +0 -552
  155. package/framework/qualia-framework/templates/roadmap.md +0 -206
  156. package/framework/qualia-framework/templates/state.md +0 -179
  157. package/framework/qualia-framework/templates/summary-complex.md +0 -59
  158. package/framework/qualia-framework/templates/summary-minimal.md +0 -41
  159. package/framework/qualia-framework/templates/summary-standard.md +0 -48
  160. package/framework/qualia-framework/templates/summary.md +0 -246
  161. package/framework/qualia-framework/templates/user-setup.md +0 -311
  162. package/framework/qualia-framework/templates/verification-report.md +0 -322
  163. package/framework/qualia-framework/workflows/add-phase.md +0 -179
  164. package/framework/qualia-framework/workflows/add-todo.md +0 -157
  165. package/framework/qualia-framework/workflows/audit-milestone.md +0 -241
  166. package/framework/qualia-framework/workflows/check-todos.md +0 -176
  167. package/framework/qualia-framework/workflows/complete-milestone.md +0 -858
  168. package/framework/qualia-framework/workflows/diagnose-issues.md +0 -219
  169. package/framework/qualia-framework/workflows/discovery-phase.md +0 -289
  170. package/framework/qualia-framework/workflows/discuss-phase.md +0 -534
  171. package/framework/qualia-framework/workflows/execute-phase.md +0 -559
  172. package/framework/qualia-framework/workflows/execute-plan.md +0 -438
  173. package/framework/qualia-framework/workflows/help.md +0 -470
  174. package/framework/qualia-framework/workflows/insert-phase.md +0 -220
  175. package/framework/qualia-framework/workflows/list-phase-assumptions.md +0 -178
  176. package/framework/qualia-framework/workflows/map-codebase.md +0 -327
  177. package/framework/qualia-framework/workflows/new-milestone.md +0 -363
  178. package/framework/qualia-framework/workflows/new-project.md +0 -982
  179. package/framework/qualia-framework/workflows/pause-work.md +0 -122
  180. package/framework/qualia-framework/workflows/plan-milestone-gaps.md +0 -256
  181. package/framework/qualia-framework/workflows/plan-phase.md +0 -422
  182. package/framework/qualia-framework/workflows/progress.md +0 -389
  183. package/framework/qualia-framework/workflows/quick.md +0 -252
  184. package/framework/qualia-framework/workflows/remove-phase.md +0 -326
  185. package/framework/qualia-framework/workflows/research-phase.md +0 -74
  186. package/framework/qualia-framework/workflows/resume-project.md +0 -306
  187. package/framework/qualia-framework/workflows/set-profile.md +0 -80
  188. package/framework/qualia-framework/workflows/settings.md +0 -145
  189. package/framework/qualia-framework/workflows/transition.md +0 -556
  190. package/framework/qualia-framework/workflows/update.md +0 -197
  191. package/framework/qualia-framework/workflows/verify-phase.md +0 -195
  192. package/framework/qualia-framework/workflows/verify-work.md +0 -625
  193. package/framework/rules/context7.md +0 -14
  194. package/framework/rules/frontend.md +0 -33
  195. package/framework/rules/speed.md +0 -23
  196. package/framework/scripts/__pycache__/say.cpython-314.pyc +0 -0
  197. package/framework/scripts/apply-retention.sh +0 -120
  198. package/framework/scripts/bootstrap-pop-os.sh +0 -354
  199. package/framework/scripts/claude-voice +0 -13
  200. package/framework/scripts/cleanup.sh +0 -131
  201. package/framework/scripts/cowork-mode.sh +0 -141
  202. package/framework/scripts/generate-project-claude-md.sh +0 -153
  203. package/framework/scripts/load-test-webhook.js +0 -172
  204. package/framework/scripts/say.py +0 -236
  205. package/framework/scripts/showcase-video-recorder/ffmpeg-builder.js +0 -167
  206. package/framework/scripts/showcase-video-recorder/playwright-helpers.js +0 -216
  207. package/framework/scripts/speak.py +0 -55
  208. package/framework/scripts/speak.sh +0 -18
  209. package/framework/scripts/status.sh +0 -138
  210. package/framework/scripts/sync-to-framework.sh +0 -65
  211. package/framework/scripts/voice-hotkey.py +0 -227
  212. package/framework/scripts/voice-input.sh +0 -51
  213. package/framework/skills/animate/SKILL.md +0 -202
  214. package/framework/skills/bolder/SKILL.md +0 -144
  215. package/framework/skills/browser-qa/SKILL.md +0 -536
  216. package/framework/skills/clarify/SKILL.md +0 -179
  217. package/framework/skills/client-handoff/SKILL.md +0 -135
  218. package/framework/skills/collab-onboard/SKILL.md +0 -111
  219. package/framework/skills/colorize/SKILL.md +0 -170
  220. package/framework/skills/critique/SKILL.md +0 -126
  221. package/framework/skills/deep-research/SKILL.md +0 -240
  222. package/framework/skills/delight/SKILL.md +0 -329
  223. package/framework/skills/deploy/SKILL.md +0 -261
  224. package/framework/skills/deploy-verify/SKILL.md +0 -377
  225. package/framework/skills/deploy-verify/scripts/canary-check.sh +0 -206
  226. package/framework/skills/deploy-verify/scripts/check-console-errors.js +0 -147
  227. package/framework/skills/deploy-verify/scripts/check-cwv.js +0 -139
  228. package/framework/skills/deploy-verify/scripts/project-detect.sh +0 -84
  229. package/framework/skills/deploy-verify/scripts/verify.sh +0 -548
  230. package/framework/skills/design-quieter/SKILL.md +0 -130
  231. package/framework/skills/distill/SKILL.md +0 -149
  232. package/framework/skills/docs-lookup/SKILL.md +0 -79
  233. package/framework/skills/fcm-notifications/SKILL.md +0 -125
  234. package/framework/skills/financial-ledger/SKILL.md +0 -1039
  235. package/framework/skills/frontend-master/NOTICE.md +0 -4
  236. package/framework/skills/frontend-master/SKILL.md +0 -127
  237. package/framework/skills/frontend-master/reference/color-and-contrast.md +0 -132
  238. package/framework/skills/frontend-master/reference/interaction-design.md +0 -123
  239. package/framework/skills/frontend-master/reference/motion-design.md +0 -99
  240. package/framework/skills/frontend-master/reference/responsive-design.md +0 -114
  241. package/framework/skills/frontend-master/reference/spatial-design.md +0 -100
  242. package/framework/skills/frontend-master/reference/typography.md +0 -131
  243. package/framework/skills/frontend-master/reference/ux-writing.md +0 -107
  244. package/framework/skills/harden/SKILL.md +0 -357
  245. package/framework/skills/i18n-rtl/SKILL.md +0 -752
  246. package/framework/skills/learn/SKILL.md +0 -95
  247. package/framework/skills/memory/SKILL.md +0 -50
  248. package/framework/skills/mobile-expo/SKILL.md +0 -977
  249. package/framework/skills/mobile-expo/references/store-checklist.md +0 -550
  250. package/framework/skills/nestjs-backend/README.md +0 -73
  251. package/framework/skills/nestjs-backend/SKILL.md +0 -446
  252. package/framework/skills/nestjs-backend/references/templates.md +0 -1173
  253. package/framework/skills/normalize/SKILL.md +0 -79
  254. package/framework/skills/onboard/SKILL.md +0 -242
  255. package/framework/skills/openrouter-agent/SKILL.md +0 -922
  256. package/framework/skills/polish/SKILL.md +0 -209
  257. package/framework/skills/pr/SKILL.md +0 -66
  258. package/framework/skills/qualia/SKILL.md +0 -199
  259. package/framework/skills/qualia-add-todo/SKILL.md +0 -68
  260. package/framework/skills/qualia-audit-milestone/SKILL.md +0 -95
  261. package/framework/skills/qualia-check-todos/SKILL.md +0 -55
  262. package/framework/skills/qualia-complete-milestone/SKILL.md +0 -134
  263. package/framework/skills/qualia-debug/SKILL.md +0 -149
  264. package/framework/skills/qualia-design/SKILL.md +0 -203
  265. package/framework/skills/qualia-discuss-phase/SKILL.md +0 -72
  266. package/framework/skills/qualia-evolve/SKILL.md +0 -200
  267. package/framework/skills/qualia-execute-phase/SKILL.md +0 -89
  268. package/framework/skills/qualia-framework-audit/SKILL.md +0 -604
  269. package/framework/skills/qualia-guide/SKILL.md +0 -32
  270. package/framework/skills/qualia-help/SKILL.md +0 -114
  271. package/framework/skills/qualia-idk/SKILL.md +0 -352
  272. package/framework/skills/qualia-list-phase-assumptions/SKILL.md +0 -67
  273. package/framework/skills/qualia-new-milestone/SKILL.md +0 -72
  274. package/framework/skills/qualia-new-project/SKILL.md +0 -232
  275. package/framework/skills/qualia-pause-work/SKILL.md +0 -96
  276. package/framework/skills/qualia-plan-milestone-gaps/SKILL.md +0 -57
  277. package/framework/skills/qualia-plan-phase/SKILL.md +0 -104
  278. package/framework/skills/qualia-production-check/SKILL.md +0 -0
  279. package/framework/skills/qualia-progress/SKILL.md +0 -53
  280. package/framework/skills/qualia-quick/SKILL.md +0 -89
  281. package/framework/skills/qualia-report/SKILL.md +0 -166
  282. package/framework/skills/qualia-research-phase/SKILL.md +0 -88
  283. package/framework/skills/qualia-resume-work/SKILL.md +0 -62
  284. package/framework/skills/qualia-review/SKILL.md +0 -263
  285. package/framework/skills/qualia-start/SKILL.md +0 -161
  286. package/framework/skills/qualia-verify-work/SKILL.md +0 -132
  287. package/framework/skills/rag/SKILL.md +0 -750
  288. package/framework/skills/responsive/SKILL.md +0 -231
  289. package/framework/skills/retro/SKILL.md +0 -284
  290. package/framework/skills/sakani-conventions/SKILL.md +0 -136
  291. package/framework/skills/sakani-conventions/evals/evals.json +0 -23
  292. package/framework/skills/sakani-conventions/references/entities.md +0 -365
  293. package/framework/skills/sakani-conventions/references/error-codes.md +0 -95
  294. package/framework/skills/seo-master/SKILL.md +0 -490
  295. package/framework/skills/seo-master/references/checklist.md +0 -199
  296. package/framework/skills/seo-master/references/structured-data.md +0 -609
  297. package/framework/skills/ship/SKILL.md +0 -239
  298. package/framework/skills/stack-researcher/SKILL.md +0 -215
  299. package/framework/skills/status/SKILL.md +0 -154
  300. package/framework/skills/status/scripts/health-check.sh +0 -562
  301. package/framework/skills/subscription-payments/SKILL.md +0 -250
  302. package/framework/skills/supabase/SKILL.md +0 -973
  303. package/framework/skills/supabase/references/templates.md +0 -159
  304. package/framework/skills/team/SKILL.md +0 -67
  305. package/framework/skills/test-runner/SKILL.md +0 -202
  306. package/framework/skills/voice-agent/SKILL.md +0 -1312
  307. package/framework/skills/zoho-workflow/SKILL.md +0 -51
  308. package/framework/statusline-command.sh +0 -117
  309. package/framework/teams/default/inboxes/plan-04.json +0 -9
  310. package/framework/teams/review-team.md +0 -75
  311. package/framework/teams/ship-team.md +0 -86
  312. package/profiles/fawzi.json +0 -16
  313. package/profiles/hasan.json +0 -16
  314. package/profiles/moayad.json +0 -16
  315. package/templates/CLAUDE-owner.md +0 -52
  316. package/templates/CLAUDE.md.hbs +0 -58
  317. package/templates/env.claude.template +0 -12
  318. package/templates/settings.json +0 -172
  319. package/uninstall.sh +0 -90
  320. /package/{framework/rules → rules}/deployment.md +0 -0
  321. /package/{framework/rules → rules}/security.md +0 -0
@@ -1,100 +0,0 @@
1
- # Spatial Design
2
-
3
- ## Spacing Systems
4
-
5
- ### Use 4pt Base, Not 8pt
6
-
7
- 8pt systems are too coarse—you'll frequently need 12px (between 8 and 16). Use 4pt for granularity: 4, 8, 12, 16, 24, 32, 48, 64, 96px.
8
-
9
- ### Name Tokens Semantically
10
-
11
- Name by relationship (`--space-sm`, `--space-lg`), not value (`--spacing-8`). Use `gap` instead of margins for sibling spacing—it eliminates margin collapse and cleanup hacks.
12
-
13
- ## Grid Systems
14
-
15
- ### The Self-Adjusting Grid
16
-
17
- Use `repeat(auto-fit, minmax(280px, 1fr))` for responsive grids without breakpoints. Columns are at least 280px, as many as fit per row, leftovers stretch. For complex layouts, use named grid areas (`grid-template-areas`) and redefine them at breakpoints.
18
-
19
- ## Visual Hierarchy
20
-
21
- ### The Squint Test
22
-
23
- Blur your eyes (or screenshot and blur). Can you still identify:
24
- - The most important element?
25
- - The second most important?
26
- - Clear groupings?
27
-
28
- If everything looks the same weight blurred, you have a hierarchy problem.
29
-
30
- ### Hierarchy Through Multiple Dimensions
31
-
32
- Don't rely on size alone. Combine:
33
-
34
- | Tool | Strong Hierarchy | Weak Hierarchy |
35
- |------|------------------|----------------|
36
- | **Size** | 3:1 ratio or more | <2:1 ratio |
37
- | **Weight** | Bold vs Regular | Medium vs Regular |
38
- | **Color** | High contrast | Similar tones |
39
- | **Position** | Top/left (primary) | Bottom/right |
40
- | **Space** | Surrounded by white space | Crowded |
41
-
42
- **The best hierarchy uses 2-3 dimensions at once**: A heading that's larger, bolder, AND has more space above it.
43
-
44
- ### Cards Are Not Required
45
-
46
- Cards are overused. Spacing and alignment create visual grouping naturally. Use cards only when content is truly distinct and actionable, items need visual comparison in a grid, or content needs clear interaction boundaries. **Never nest cards inside cards**—use spacing, typography, and subtle dividers for hierarchy within a card.
47
-
48
- ## Container Queries
49
-
50
- Viewport queries are for page layouts. **Container queries are for components**:
51
-
52
- ```css
53
- .card-container {
54
- container-type: inline-size;
55
- }
56
-
57
- .card {
58
- display: grid;
59
- gap: var(--space-md);
60
- }
61
-
62
- /* Card layout changes based on its container, not viewport */
63
- @container (min-width: 400px) {
64
- .card {
65
- grid-template-columns: 120px 1fr;
66
- }
67
- }
68
- ```
69
-
70
- **Why this matters**: A card in a narrow sidebar stays compact, while the same card in a main content area expands—automatically, without viewport hacks.
71
-
72
- ## Optical Adjustments
73
-
74
- Text at `margin-left: 0` looks indented due to letterform whitespace—use negative margin (`-0.05em`) to optically align. Geometrically centered icons often look off-center; play icons need to shift right, arrows shift toward their direction.
75
-
76
- ### Touch Targets vs Visual Size
77
-
78
- Buttons can look small but need large touch targets (44px minimum). Use padding or pseudo-elements:
79
-
80
- ```css
81
- .icon-button {
82
- width: 24px; /* Visual size */
83
- height: 24px;
84
- position: relative;
85
- }
86
-
87
- .icon-button::before {
88
- content: '';
89
- position: absolute;
90
- inset: -10px; /* Expand tap target to 44px */
91
- }
92
- ```
93
-
94
- ## Depth & Elevation
95
-
96
- Create semantic z-index scales (dropdown → sticky → modal-backdrop → modal → toast → tooltip) instead of arbitrary numbers. For shadows, create a consistent elevation scale (sm → md → lg → xl). **Key insight**: Shadows should be subtle—if you can clearly see it, it's probably too strong.
97
-
98
- ---
99
-
100
- **Avoid**: Arbitrary spacing values outside your scale. Making all spacing equal (variety creates hierarchy). Creating hierarchy through size alone - combine size, weight, color, and space.
@@ -1,131 +0,0 @@
1
- # Typography
2
-
3
- ## Classic Typography Principles
4
-
5
- ### Vertical Rhythm
6
-
7
- Your line-height should be the base unit for ALL vertical spacing. If body text has `line-height: 1.5` on `16px` type (= 24px), spacing values should be multiples of 24px. This creates subconscious harmony—text and space share a mathematical foundation.
8
-
9
- ### Modular Scale & Hierarchy
10
-
11
- The common mistake: too many font sizes that are too close together (14px, 15px, 16px, 18px...). This creates muddy hierarchy.
12
-
13
- **Use fewer sizes with more contrast.** A 5-size system covers most needs:
14
-
15
- | Role | Typical Ratio | Use Case |
16
- |------|---------------|----------|
17
- | xs | 0.75rem | Captions, legal |
18
- | sm | 0.875rem | Secondary UI, metadata |
19
- | base | 1rem | Body text |
20
- | lg | 1.25-1.5rem | Subheadings, lead text |
21
- | xl+ | 2-4rem | Headlines, hero text |
22
-
23
- Popular ratios: 1.25 (major third), 1.333 (perfect fourth), 1.5 (perfect fifth). Pick one and commit.
24
-
25
- ### Readability & Measure
26
-
27
- Use `ch` units for character-based measure (`max-width: 65ch`). Line-height scales inversely with line length—narrow columns need tighter leading, wide columns need more.
28
-
29
- **Non-obvious**: Increase line-height for light text on dark backgrounds. The perceived weight is lighter, so text needs more breathing room. Add 0.05-0.1 to your normal line-height.
30
-
31
- ## Font Selection & Pairing
32
-
33
- ### Choosing Distinctive Fonts
34
-
35
- **Avoid the invisible defaults**: Inter, Roboto, Open Sans, Lato, Montserrat. These are everywhere, making your design feel generic. They're fine for documentation or tools where personality isn't the goal—but if you want distinctive design, look elsewhere.
36
-
37
- **Better Google Fonts alternatives**:
38
- - Instead of Inter → **Instrument Sans**, **Plus Jakarta Sans**, **Outfit**
39
- - Instead of Roboto → **Onest**, **Figtree**, **Urbanist**
40
- - Instead of Open Sans → **Source Sans 3**, **Nunito Sans**, **DM Sans**
41
- - For editorial/premium feel → **Fraunces**, **Newsreader**, **Lora**
42
-
43
- **System fonts are underrated**: `-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui` looks native, loads instantly, and is highly readable. Consider this for apps where performance > personality.
44
-
45
- ### Pairing Principles
46
-
47
- **The non-obvious truth**: You often don't need a second font. One well-chosen font family in multiple weights creates cleaner hierarchy than two competing typefaces. Only add a second font when you need genuine contrast (e.g., display headlines + body serif).
48
-
49
- When pairing, contrast on multiple axes:
50
- - Serif + Sans (structure contrast)
51
- - Geometric + Humanist (personality contrast)
52
- - Condensed display + Wide body (proportion contrast)
53
-
54
- **Never pair fonts that are similar but not identical** (e.g., two geometric sans-serifs). They create visual tension without clear hierarchy.
55
-
56
- ### Web Font Loading
57
-
58
- The layout shift problem: fonts load late, text reflows, and users see content jump. Here's the fix:
59
-
60
- ```css
61
- /* 1. Use font-display: swap for visibility */
62
- @font-face {
63
- font-family: 'CustomFont';
64
- src: url('font.woff2') format('woff2');
65
- font-display: swap;
66
- }
67
-
68
- /* 2. Match fallback metrics to minimize shift */
69
- @font-face {
70
- font-family: 'CustomFont-Fallback';
71
- src: local('Arial');
72
- size-adjust: 105%; /* Scale to match x-height */
73
- ascent-override: 90%; /* Match ascender height */
74
- descent-override: 20%; /* Match descender depth */
75
- line-gap-override: 10%; /* Match line spacing */
76
- }
77
-
78
- body {
79
- font-family: 'CustomFont', 'CustomFont-Fallback', sans-serif;
80
- }
81
- ```
82
-
83
- Tools like [Fontaine](https://github.com/unjs/fontaine) calculate these overrides automatically.
84
-
85
- ## Modern Web Typography
86
-
87
- ### Fluid Type
88
-
89
- Use `clamp(min, preferred, max)` for fluid typography. The middle value (e.g., `5vw + 1rem`) controls scaling rate—higher vw = faster scaling. Add a rem offset so it doesn't collapse to 0 on small screens.
90
-
91
- **When NOT to use fluid type**: Button text, labels, UI elements (should be consistent), very short text, or when you need precise breakpoint control.
92
-
93
- ### OpenType Features
94
-
95
- Most developers don't know these exist. Use them for polish:
96
-
97
- ```css
98
- /* Tabular numbers for data alignment */
99
- .data-table { font-variant-numeric: tabular-nums; }
100
-
101
- /* Proper fractions */
102
- .recipe-amount { font-variant-numeric: diagonal-fractions; }
103
-
104
- /* Small caps for abbreviations */
105
- abbr { font-variant-caps: all-small-caps; }
106
-
107
- /* Disable ligatures in code */
108
- code { font-variant-ligatures: none; }
109
-
110
- /* Enable kerning (usually on by default, but be explicit) */
111
- body { font-kerning: normal; }
112
- ```
113
-
114
- Check what features your font supports at [Wakamai Fondue](https://wakamaifondue.com/).
115
-
116
- ## Typography System Architecture
117
-
118
- Name tokens semantically (`--text-body`, `--text-heading`), not by value (`--font-size-16`). Include font stacks, size scale, weights, line-heights, and letter-spacing in your token system.
119
-
120
- ## Accessibility Considerations
121
-
122
- Beyond contrast ratios (which are well-documented), consider:
123
-
124
- - **Never disable zoom**: `user-scalable=no` breaks accessibility. If your layout breaks at 200% zoom, fix the layout.
125
- - **Use rem/em for font sizes**: This respects user browser settings. Never `px` for body text.
126
- - **Minimum 16px body text**: Smaller than this strains eyes and fails WCAG on mobile.
127
- - **Adequate touch targets**: Text links need padding or line-height that creates 44px+ tap targets.
128
-
129
- ---
130
-
131
- **Avoid**: More than 2-3 font families per project. Skipping fallback font definitions. Ignoring font loading performance (FOUT/FOIT). Using decorative fonts for body text.
@@ -1,107 +0,0 @@
1
- # UX Writing
2
-
3
- ## The Button Label Problem
4
-
5
- **Never use "OK", "Submit", or "Yes/No".** These are lazy and ambiguous. Use specific verb + object patterns:
6
-
7
- | Bad | Good | Why |
8
- |-----|------|-----|
9
- | OK | Save changes | Says what will happen |
10
- | Submit | Create account | Outcome-focused |
11
- | Yes | Delete message | Confirms the action |
12
- | Cancel | Keep editing | Clarifies what "cancel" means |
13
- | Click here | Download PDF | Describes the destination |
14
-
15
- **For destructive actions**, name the destruction:
16
- - "Delete" not "Remove" (delete is permanent, remove implies recoverable)
17
- - "Delete 5 items" not "Delete selected" (show the count)
18
-
19
- ## Error Messages: The Formula
20
-
21
- Every error message should answer: (1) What happened? (2) Why? (3) How to fix it? Example: "Email address isn't valid. Please include an @ symbol." not "Invalid input".
22
-
23
- ### Error Message Templates
24
-
25
- | Situation | Template |
26
- |-----------|----------|
27
- | **Format error** | "[Field] needs to be [format]. Example: [example]" |
28
- | **Missing required** | "Please enter [what's missing]" |
29
- | **Permission denied** | "You don't have access to [thing]. [What to do instead]" |
30
- | **Network error** | "We couldn't reach [thing]. Check your connection and [action]." |
31
- | **Server error** | "Something went wrong on our end. We're looking into it. [Alternative action]" |
32
-
33
- ### Don't Blame the User
34
-
35
- Reframe errors: "Please enter a date in MM/DD/YYYY format" not "You entered an invalid date".
36
-
37
- ## Empty States Are Opportunities
38
-
39
- Empty states are onboarding moments: (1) Acknowledge briefly, (2) Explain the value of filling it, (3) Provide a clear action. "No projects yet. Create your first one to get started." not just "No items".
40
-
41
- ## Voice vs Tone
42
-
43
- **Voice** is your brand's personality—consistent everywhere.
44
- **Tone** adapts to the moment.
45
-
46
- | Moment | Tone Shift |
47
- |--------|------------|
48
- | Success | Celebratory, brief: "Done! Your changes are live." |
49
- | Error | Empathetic, helpful: "That didn't work. Here's what to try..." |
50
- | Loading | Reassuring: "Saving your work..." |
51
- | Destructive confirm | Serious, clear: "Delete this project? This can't be undone." |
52
-
53
- **Never use humor for errors.** Users are already frustrated. Be helpful, not cute.
54
-
55
- ## Writing for Accessibility
56
-
57
- **Link text** must have standalone meaning—"View pricing plans" not "Click here". **Alt text** describes information, not the image—"Revenue increased 40% in Q4" not "Chart". Use `alt=""` for decorative images. **Icon buttons** need `aria-label` for screen reader context.
58
-
59
- ## Writing for Translation
60
-
61
- ### Plan for Expansion
62
-
63
- German text is ~30% longer than English. Allocate space:
64
-
65
- | Language | Expansion |
66
- |----------|-----------|
67
- | German | +30% |
68
- | French | +20% |
69
- | Finnish | +30-40% |
70
- | Chinese | -30% (fewer chars, but same width) |
71
-
72
- ### Translation-Friendly Patterns
73
-
74
- Keep numbers separate ("New messages: 3" not "You have 3 new messages"). Use full sentences as single strings (word order varies by language). Avoid abbreviations ("5 minutes ago" not "5 mins ago"). Give translators context about where strings appear.
75
-
76
- ## Consistency: The Terminology Problem
77
-
78
- Pick one term and stick with it:
79
-
80
- | Inconsistent | Consistent |
81
- |--------------|------------|
82
- | Delete / Remove / Trash | Delete |
83
- | Settings / Preferences / Options | Settings |
84
- | Sign in / Log in / Enter | Sign in |
85
- | Create / Add / New | Create |
86
-
87
- Build a terminology glossary and enforce it. Variety creates confusion.
88
-
89
- ## Avoid Redundant Copy
90
-
91
- If the heading explains it, the intro is redundant. If the button is clear, don't explain it again. Say it once, say it well.
92
-
93
- ## Loading States
94
-
95
- Be specific: "Saving your draft..." not "Loading...". For long waits, set expectations ("This usually takes 30 seconds") or show progress.
96
-
97
- ## Confirmation Dialogs: Use Sparingly
98
-
99
- Most confirmation dialogs are design failures—consider undo instead. When you must confirm: name the action, explain consequences, use specific button labels ("Delete project" / "Keep project", not "Yes" / "No").
100
-
101
- ## Form Instructions
102
-
103
- Show format with placeholders, not instructions. For non-obvious fields, explain why you're asking.
104
-
105
- ---
106
-
107
- **Avoid**: Jargon without explanation. Blaming users ("You made an error" → "This field is required"). Vague errors ("Something went wrong"). Varying terminology for variety. Humor for errors.
@@ -1,357 +0,0 @@
1
- ---
2
- name: harden
3
- description: Improve interface resilience through better error handling, i18n support, text overflow handling, and edge case management. Makes interfaces robust and production-ready.
4
- user-invokable: true
5
- args:
6
- - name: target
7
- description: The feature or area to harden (optional)
8
- required: false
9
- ---
10
-
11
- Strengthen interfaces against edge cases, errors, internationalization issues, and real-world usage scenarios that break idealized designs.
12
-
13
- ## Assess Hardening Needs
14
-
15
- Identify weaknesses and edge cases:
16
-
17
- 1. **Test with extreme inputs**:
18
- - Very long text (names, descriptions, titles)
19
- - Very short text (empty, single character)
20
- - Special characters (emoji, RTL text, accents)
21
- - Large numbers (millions, billions)
22
- - Many items (1000+ list items, 50+ options)
23
- - No data (empty states)
24
-
25
- 2. **Test error scenarios**:
26
- - Network failures (offline, slow, timeout)
27
- - API errors (400, 401, 403, 404, 500)
28
- - Validation errors
29
- - Permission errors
30
- - Rate limiting
31
- - Concurrent operations
32
-
33
- 3. **Test internationalization**:
34
- - Long translations (German is often 30% longer than English)
35
- - RTL languages (Arabic, Hebrew)
36
- - Character sets (Chinese, Japanese, Korean, emoji)
37
- - Date/time formats
38
- - Number formats (1,000 vs 1.000)
39
- - Currency symbols
40
-
41
- **CRITICAL**: Designs that only work with perfect data aren't production-ready. Harden against reality.
42
-
43
- ## Hardening Dimensions
44
-
45
- Systematically improve resilience:
46
-
47
- ### Text Overflow & Wrapping
48
-
49
- **Long text handling**:
50
- ```css
51
- /* Single line with ellipsis */
52
- .truncate {
53
- overflow: hidden;
54
- text-overflow: ellipsis;
55
- white-space: nowrap;
56
- }
57
-
58
- /* Multi-line with clamp */
59
- .line-clamp {
60
- display: -webkit-box;
61
- -webkit-line-clamp: 3;
62
- -webkit-box-orient: vertical;
63
- overflow: hidden;
64
- }
65
-
66
- /* Allow wrapping */
67
- .wrap {
68
- word-wrap: break-word;
69
- overflow-wrap: break-word;
70
- hyphens: auto;
71
- }
72
- ```
73
-
74
- **Flex/Grid overflow**:
75
- ```css
76
- /* Prevent flex items from overflowing */
77
- .flex-item {
78
- min-width: 0; /* Allow shrinking below content size */
79
- overflow: hidden;
80
- }
81
-
82
- /* Prevent grid items from overflowing */
83
- .grid-item {
84
- min-width: 0;
85
- min-height: 0;
86
- }
87
- ```
88
-
89
- **Responsive text sizing**:
90
- - Use `clamp()` for fluid typography
91
- - Set minimum readable sizes (14px on mobile)
92
- - Test text scaling (zoom to 200%)
93
- - Ensure containers expand with text
94
-
95
- ### Internationalization (i18n)
96
-
97
- **Text expansion**:
98
- - Add 30-40% space budget for translations
99
- - Use flexbox/grid that adapts to content
100
- - Test with longest language (usually German)
101
- - Avoid fixed widths on text containers
102
-
103
- ```jsx
104
- // ❌ Bad: Assumes short English text
105
- <button className="w-24">Submit</button>
106
-
107
- // ✅ Good: Adapts to content
108
- <button className="px-4 py-2">Submit</button>
109
- ```
110
-
111
- **RTL (Right-to-Left) support**:
112
- ```css
113
- /* Use logical properties */
114
- margin-inline-start: 1rem; /* Not margin-left */
115
- padding-inline: 1rem; /* Not padding-left/right */
116
- border-inline-end: 1px solid; /* Not border-right */
117
-
118
- /* Or use dir attribute */
119
- [dir="rtl"] .arrow { transform: scaleX(-1); }
120
- ```
121
-
122
- **Character set support**:
123
- - Use UTF-8 encoding everywhere
124
- - Test with Chinese/Japanese/Korean (CJK) characters
125
- - Test with emoji (they can be 2-4 bytes)
126
- - Handle different scripts (Latin, Cyrillic, Arabic, etc.)
127
-
128
- **Date/Time formatting**:
129
- ```javascript
130
- // ✅ Use Intl API for proper formatting
131
- new Intl.DateTimeFormat('en-US').format(date); // 1/15/2024
132
- new Intl.DateTimeFormat('de-DE').format(date); // 15.1.2024
133
-
134
- new Intl.NumberFormat('en-US', {
135
- style: 'currency',
136
- currency: 'USD'
137
- }).format(1234.56); // $1,234.56
138
- ```
139
-
140
- **Pluralization**:
141
- ```javascript
142
- // ❌ Bad: Assumes English pluralization
143
- `${count} item${count !== 1 ? 's' : ''}`
144
-
145
- // ✅ Good: Use proper i18n library
146
- t('items', { count }) // Handles complex plural rules
147
- ```
148
-
149
- ### Error Handling
150
-
151
- **Network errors**:
152
- - Show clear error messages
153
- - Provide retry button
154
- - Explain what happened
155
- - Offer offline mode (if applicable)
156
- - Handle timeout scenarios
157
-
158
- ```jsx
159
- // Error states with recovery
160
- {error && (
161
- <ErrorMessage>
162
- <p>Failed to load data. {error.message}</p>
163
- <button onClick={retry}>Try again</button>
164
- </ErrorMessage>
165
- )}
166
- ```
167
-
168
- **Form validation errors**:
169
- - Inline errors near fields
170
- - Clear, specific messages
171
- - Suggest corrections
172
- - Don't block submission unnecessarily
173
- - Preserve user input on error
174
-
175
- **API errors**:
176
- - Handle each status code appropriately
177
- - 400: Show validation errors
178
- - 401: Redirect to login
179
- - 403: Show permission error
180
- - 404: Show not found state
181
- - 429: Show rate limit message
182
- - 500: Show generic error, offer support
183
-
184
- **Graceful degradation**:
185
- - Core functionality works without JavaScript
186
- - Images have alt text
187
- - Progressive enhancement
188
- - Fallbacks for unsupported features
189
-
190
- ### Edge Cases & Boundary Conditions
191
-
192
- **Empty states**:
193
- - No items in list
194
- - No search results
195
- - No notifications
196
- - No data to display
197
- - Provide clear next action
198
-
199
- **Loading states**:
200
- - Initial load
201
- - Pagination load
202
- - Refresh
203
- - Show what's loading ("Loading your projects...")
204
- - Time estimates for long operations
205
-
206
- **Large datasets**:
207
- - Pagination or virtual scrolling
208
- - Search/filter capabilities
209
- - Performance optimization
210
- - Don't load all 10,000 items at once
211
-
212
- **Concurrent operations**:
213
- - Prevent double-submission (disable button while loading)
214
- - Handle race conditions
215
- - Optimistic updates with rollback
216
- - Conflict resolution
217
-
218
- **Permission states**:
219
- - No permission to view
220
- - No permission to edit
221
- - Read-only mode
222
- - Clear explanation of why
223
-
224
- **Browser compatibility**:
225
- - Polyfills for modern features
226
- - Fallbacks for unsupported CSS
227
- - Feature detection (not browser detection)
228
- - Test in target browsers
229
-
230
- ### Input Validation & Sanitization
231
-
232
- **Client-side validation**:
233
- - Required fields
234
- - Format validation (email, phone, URL)
235
- - Length limits
236
- - Pattern matching
237
- - Custom validation rules
238
-
239
- **Server-side validation** (always):
240
- - Never trust client-side only
241
- - Validate and sanitize all inputs
242
- - Protect against injection attacks
243
- - Rate limiting
244
-
245
- **Constraint handling**:
246
- ```html
247
- <!-- Set clear constraints -->
248
- <input
249
- type="text"
250
- maxlength="100"
251
- pattern="[A-Za-z0-9]+"
252
- required
253
- aria-describedby="username-hint"
254
- />
255
- <small id="username-hint">
256
- Letters and numbers only, up to 100 characters
257
- </small>
258
- ```
259
-
260
- ### Accessibility Resilience
261
-
262
- **Keyboard navigation**:
263
- - All functionality accessible via keyboard
264
- - Logical tab order
265
- - Focus management in modals
266
- - Skip links for long content
267
-
268
- **Screen reader support**:
269
- - Proper ARIA labels
270
- - Announce dynamic changes (live regions)
271
- - Descriptive alt text
272
- - Semantic HTML
273
-
274
- **Motion sensitivity**:
275
- ```css
276
- @media (prefers-reduced-motion: reduce) {
277
- * {
278
- animation-duration: 0.01ms !important;
279
- animation-iteration-count: 1 !important;
280
- transition-duration: 0.01ms !important;
281
- }
282
- }
283
- ```
284
-
285
- **High contrast mode**:
286
- - Test in Windows high contrast mode
287
- - Don't rely only on color
288
- - Provide alternative visual cues
289
-
290
- ### Performance Resilience
291
-
292
- **Slow connections**:
293
- - Progressive image loading
294
- - Skeleton screens
295
- - Optimistic UI updates
296
- - Offline support (service workers)
297
-
298
- **Memory leaks**:
299
- - Clean up event listeners
300
- - Cancel subscriptions
301
- - Clear timers/intervals
302
- - Abort pending requests on unmount
303
-
304
- **Throttling & Debouncing**:
305
- ```javascript
306
- // Debounce search input
307
- const debouncedSearch = debounce(handleSearch, 300);
308
-
309
- // Throttle scroll handler
310
- const throttledScroll = throttle(handleScroll, 100);
311
- ```
312
-
313
- ## Testing Strategies
314
-
315
- **Manual testing**:
316
- - Test with extreme data (very long, very short, empty)
317
- - Test in different languages
318
- - Test offline
319
- - Test slow connection (throttle to 3G)
320
- - Test with screen reader
321
- - Test keyboard-only navigation
322
- - Test on old browsers
323
-
324
- **Automated testing**:
325
- - Unit tests for edge cases
326
- - Integration tests for error scenarios
327
- - E2E tests for critical paths
328
- - Visual regression tests
329
- - Accessibility tests (axe, WAVE)
330
-
331
- **IMPORTANT**: Hardening is about expecting the unexpected. Real users will do things you never imagined.
332
-
333
- **NEVER**:
334
- - Assume perfect input (validate everything)
335
- - Ignore internationalization (design for global)
336
- - Leave error messages generic ("Error occurred")
337
- - Forget offline scenarios
338
- - Trust client-side validation alone
339
- - Use fixed widths for text
340
- - Assume English-length text
341
- - Block entire interface when one component errors
342
-
343
- ## Verify Hardening
344
-
345
- Test thoroughly with edge cases:
346
-
347
- - **Long text**: Try names with 100+ characters
348
- - **Emoji**: Use emoji in all text fields
349
- - **RTL**: Test with Arabic or Hebrew
350
- - **CJK**: Test with Chinese/Japanese/Korean
351
- - **Network issues**: Disable internet, throttle connection
352
- - **Large datasets**: Test with 1000+ items
353
- - **Concurrent actions**: Click submit 10 times rapidly
354
- - **Errors**: Force API errors, test all error states
355
- - **Empty**: Remove all data, test empty states
356
-
357
- Remember: You're hardening for production reality, not demo perfection. Expect users to input weird data, lose connection mid-flow, and use your product in unexpected ways. Build resilience into every component.