agemon 0.1.0 → 6.3.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 (269) hide show
  1. package/README.md +983 -30
  2. package/assets/skills/architecture/agemon-architecture/LICENSE +21 -0
  3. package/assets/skills/architecture/agemon-architecture/NOTICE.md +9 -0
  4. package/assets/skills/architecture/agemon-architecture/SKILL.md +275 -0
  5. package/assets/skills/code-quality/agemon-clean-code/LICENSE +21 -0
  6. package/assets/skills/code-quality/agemon-clean-code/NOTICE.md +9 -0
  7. package/assets/skills/code-quality/agemon-clean-code/SKILL.md +78 -0
  8. package/assets/skills/code-quality/agemon-house-rules/SKILL.md +103 -0
  9. package/assets/skills/commit/agemon-commit/SKILL.md +87 -0
  10. package/assets/skills/design/agemon-design/LICENSE +21 -0
  11. package/assets/skills/design/agemon-design/NOTICE.md +43 -0
  12. package/assets/skills/design/agemon-design/SKILL.md +128 -0
  13. package/assets/skills/design/agemon-design/references/accessibility.md +182 -0
  14. package/assets/skills/design/agemon-design/references/actions.md +215 -0
  15. package/assets/skills/design/agemon-design/references/ai-chat.md +158 -0
  16. package/assets/skills/design/agemon-design/references/brief.md +190 -0
  17. package/assets/skills/design/agemon-design/references/color.md +216 -0
  18. package/assets/skills/design/agemon-design/references/components.md +91 -0
  19. package/assets/skills/design/agemon-design/references/copy.md +300 -0
  20. package/assets/skills/design/agemon-design/references/core-rules.md +166 -0
  21. package/assets/skills/design/agemon-design/references/craft-intent.md +162 -0
  22. package/assets/skills/design/agemon-design/references/dashboard.md +131 -0
  23. package/assets/skills/design/agemon-design/references/dataviz.md +197 -0
  24. package/assets/skills/design/agemon-design/references/finish-bar.md +243 -0
  25. package/assets/skills/design/agemon-design/references/forms.md +192 -0
  26. package/assets/skills/design/agemon-design/references/heuristics.md +319 -0
  27. package/assets/skills/design/agemon-design/references/inspiration.md +287 -0
  28. package/assets/skills/design/agemon-design/references/layout.md +236 -0
  29. package/assets/skills/design/agemon-design/references/loops.md +155 -0
  30. package/assets/skills/design/agemon-design/references/metadata.md +98 -0
  31. package/assets/skills/design/agemon-design/references/modern-css.md +448 -0
  32. package/assets/skills/design/agemon-design/references/motion.md +434 -0
  33. package/assets/skills/design/agemon-design/references/personas.md +206 -0
  34. package/assets/skills/design/agemon-design/references/preset-dashboard.md +109 -0
  35. package/assets/skills/design/agemon-design/references/preset-editorial.md +94 -0
  36. package/assets/skills/design/agemon-design/references/preset-minimal.md +93 -0
  37. package/assets/skills/design/agemon-design/references/principles-catalog.md +299 -0
  38. package/assets/skills/design/agemon-design/references/recipe-auth.md +88 -0
  39. package/assets/skills/design/agemon-design/references/recipe-dashboard.md +130 -0
  40. package/assets/skills/design/agemon-design/references/recipe-landing.md +120 -0
  41. package/assets/skills/design/agemon-design/references/responsive.md +168 -0
  42. package/assets/skills/design/agemon-design/references/review.md +340 -0
  43. package/assets/skills/design/agemon-design/references/routing.md +143 -0
  44. package/assets/skills/design/agemon-design/references/sound.md +150 -0
  45. package/assets/skills/design/agemon-design/references/spec.md +123 -0
  46. package/assets/skills/design/agemon-design/references/stack.md +522 -0
  47. package/assets/skills/design/agemon-design/references/stage-assets.md +106 -0
  48. package/assets/skills/design/agemon-design/references/stage-build.md +46 -0
  49. package/assets/skills/design/agemon-design/references/stage-critique.md +34 -0
  50. package/assets/skills/design/agemon-design/references/stage-directions.md +44 -0
  51. package/assets/skills/design/agemon-design/references/stage-intake.md +34 -0
  52. package/assets/skills/design/agemon-design/references/stage-verify.md +44 -0
  53. package/assets/skills/design/agemon-design/references/state-design.md +188 -0
  54. package/assets/skills/design/agemon-design/references/tells-2026-11.md +32 -0
  55. package/assets/skills/design/agemon-design/references/themes.md +233 -0
  56. package/assets/skills/design/agemon-design/references/third-party-licenses.md +323 -0
  57. package/assets/skills/design/agemon-design/references/tokens.md +350 -0
  58. package/assets/skills/design/agemon-design/references/typography.md +248 -0
  59. package/assets/skills/design/agemon-design/scripts/audit-page.js +532 -0
  60. package/assets/skills/design/agemon-design/scripts/check-source.mjs +358 -0
  61. package/assets/skills/design/agemon-design/scripts/deal.mjs +231 -0
  62. package/assets/skills/design/agemon-design/scripts/inventory.mjs +676 -0
  63. package/assets/skills/essentials/web-design-guidelines/LICENSE +21 -0
  64. package/assets/skills/essentials/web-design-guidelines/NOTICE.md +14 -0
  65. package/assets/skills/essentials/web-design-guidelines/SKILL.md +18 -0
  66. package/assets/skills/essentials/web-design-guidelines/references/guidelines.md +184 -0
  67. package/assets/skills/essentials/writing-guidelines/LICENSE +21 -0
  68. package/assets/skills/essentials/writing-guidelines/NOTICE.md +14 -0
  69. package/assets/skills/essentials/writing-guidelines/SKILL.md +18 -0
  70. package/assets/skills/essentials/writing-guidelines/references/guidelines.md +250 -0
  71. package/assets/skills/founder/agemon-founder-board/LICENSE +21 -0
  72. package/assets/skills/founder/agemon-founder-board/NOTICE.md +11 -0
  73. package/assets/skills/founder/agemon-founder-board/SKILL.md +111 -0
  74. package/assets/skills/founder/agemon-founder-board/lenses.md +84 -0
  75. package/assets/skills/founder/agemon-founder-brand/LICENSE +21 -0
  76. package/assets/skills/founder/agemon-founder-brand/NOTICE.md +12 -0
  77. package/assets/skills/founder/agemon-founder-brand/SKILL.md +77 -0
  78. package/assets/skills/founder/agemon-founder-cfo/LICENSE +21 -0
  79. package/assets/skills/founder/agemon-founder-cfo/NOTICE.md +12 -0
  80. package/assets/skills/founder/agemon-founder-cfo/SKILL.md +109 -0
  81. package/assets/skills/founder/agemon-founder-cfo/example.json +27 -0
  82. package/assets/skills/founder/agemon-founder-cfo/unit_economics.py +270 -0
  83. package/assets/skills/founder/agemon-founder-competitors/LICENSE +21 -0
  84. package/assets/skills/founder/agemon-founder-competitors/NOTICE.md +12 -0
  85. package/assets/skills/founder/agemon-founder-competitors/SKILL.md +84 -0
  86. package/assets/skills/founder/agemon-founder-consumer/LICENSE +21 -0
  87. package/assets/skills/founder/agemon-founder-consumer/NOTICE.md +11 -0
  88. package/assets/skills/founder/agemon-founder-consumer/SKILL.md +126 -0
  89. package/assets/skills/founder/agemon-founder-consumer/customer.example.json +34 -0
  90. package/assets/skills/founder/agemon-founder-consumer/panel.py +424 -0
  91. package/assets/skills/founder/agemon-founder-consumer/pitch.example.md +3 -0
  92. package/assets/skills/founder/agemon-founder-launch/LICENSE +21 -0
  93. package/assets/skills/founder/agemon-founder-launch/NOTICE.md +11 -0
  94. package/assets/skills/founder/agemon-founder-launch/SKILL.md +65 -0
  95. package/assets/skills/founder/agemon-founder-marketing/LICENSE +21 -0
  96. package/assets/skills/founder/agemon-founder-marketing/NOTICE.md +11 -0
  97. package/assets/skills/founder/agemon-founder-marketing/SKILL.md +80 -0
  98. package/assets/skills/founder/agemon-founder-offer/LICENSE +21 -0
  99. package/assets/skills/founder/agemon-founder-offer/NOTICE.md +11 -0
  100. package/assets/skills/founder/agemon-founder-offer/SKILL.md +75 -0
  101. package/assets/skills/founder/agemon-founder-ops/LICENSE +21 -0
  102. package/assets/skills/founder/agemon-founder-ops/NOTICE.md +12 -0
  103. package/assets/skills/founder/agemon-founder-ops/SKILL.md +77 -0
  104. package/assets/skills/founder/agemon-founder-plan/LICENSE +21 -0
  105. package/assets/skills/founder/agemon-founder-plan/NOTICE.md +11 -0
  106. package/assets/skills/founder/agemon-founder-plan/SKILL.md +88 -0
  107. package/assets/skills/founder/agemon-founder-plan/compile.py +178 -0
  108. package/assets/skills/founder/agemon-founder-pricing/LICENSE +21 -0
  109. package/assets/skills/founder/agemon-founder-pricing/NOTICE.md +12 -0
  110. package/assets/skills/founder/agemon-founder-pricing/SKILL.md +92 -0
  111. package/assets/skills/founder/agemon-founder-pricing/van_westendorp.py +172 -0
  112. package/assets/skills/geo-seo/geo/LICENSE +21 -0
  113. package/assets/skills/geo-seo/geo/NOTICE.md +18 -0
  114. package/assets/skills/geo-seo/geo/SKILL.md +145 -0
  115. package/assets/skills/geo-seo/geo-audit/LICENSE +21 -0
  116. package/assets/skills/geo-seo/geo-audit/NOTICE.md +17 -0
  117. package/assets/skills/geo-seo/geo-audit/SKILL.md +371 -0
  118. package/assets/skills/geo-seo/geo-audit/references/ai-visibility.md +233 -0
  119. package/assets/skills/geo-seo/geo-audit/references/content.md +329 -0
  120. package/assets/skills/geo-seo/geo-audit/references/platform-analysis.md +294 -0
  121. package/assets/skills/geo-seo/geo-audit/references/schema.md +383 -0
  122. package/assets/skills/geo-seo/geo-audit/references/technical.md +368 -0
  123. package/assets/skills/geo-seo/geo-brand-mentions/LICENSE +21 -0
  124. package/assets/skills/geo-seo/geo-brand-mentions/NOTICE.md +15 -0
  125. package/assets/skills/geo-seo/geo-brand-mentions/SKILL.md +459 -0
  126. package/assets/skills/geo-seo/geo-citability/LICENSE +21 -0
  127. package/assets/skills/geo-seo/geo-citability/NOTICE.md +14 -0
  128. package/assets/skills/geo-seo/geo-citability/SKILL.md +320 -0
  129. package/assets/skills/geo-seo/geo-content/LICENSE +21 -0
  130. package/assets/skills/geo-seo/geo-content/NOTICE.md +14 -0
  131. package/assets/skills/geo-seo/geo-content/SKILL.md +352 -0
  132. package/assets/skills/geo-seo/geo-crawlers/LICENSE +21 -0
  133. package/assets/skills/geo-seo/geo-crawlers/NOTICE.md +15 -0
  134. package/assets/skills/geo-seo/geo-crawlers/SKILL.md +388 -0
  135. package/assets/skills/geo-seo/geo-llmstxt/LICENSE +21 -0
  136. package/assets/skills/geo-seo/geo-llmstxt/NOTICE.md +14 -0
  137. package/assets/skills/geo-seo/geo-llmstxt/SKILL.md +433 -0
  138. package/assets/skills/geo-seo/geo-platform-optimizer/LICENSE +21 -0
  139. package/assets/skills/geo-seo/geo-platform-optimizer/NOTICE.md +14 -0
  140. package/assets/skills/geo-seo/geo-platform-optimizer/SKILL.md +282 -0
  141. package/assets/skills/geo-seo/geo-report/LICENSE +21 -0
  142. package/assets/skills/geo-seo/geo-report/NOTICE.md +14 -0
  143. package/assets/skills/geo-seo/geo-report/SKILL.md +406 -0
  144. package/assets/skills/geo-seo/geo-report-pdf/LICENSE +21 -0
  145. package/assets/skills/geo-seo/geo-report-pdf/NOTICE.md +20 -0
  146. package/assets/skills/geo-seo/geo-report-pdf/SKILL.md +153 -0
  147. package/assets/skills/geo-seo/geo-report-pdf/templates/geo-report-template.html +548 -0
  148. package/assets/skills/geo-seo/geo-schema/LICENSE +21 -0
  149. package/assets/skills/geo-seo/geo-schema/NOTICE.md +16 -0
  150. package/assets/skills/geo-seo/geo-schema/SKILL.md +396 -0
  151. package/assets/skills/geo-seo/geo-technical/LICENSE +21 -0
  152. package/assets/skills/geo-seo/geo-technical/NOTICE.md +15 -0
  153. package/assets/skills/geo-seo/geo-technical/SKILL.md +566 -0
  154. package/assets/skills/output-style/agemon-adhd/LICENSE +21 -0
  155. package/assets/skills/output-style/agemon-adhd/NOTICE.md +13 -0
  156. package/assets/skills/output-style/agemon-adhd/SKILL.md +138 -0
  157. package/assets/skills/performance/agemon-performance/NOTICE.md +1 -0
  158. package/assets/skills/performance/agemon-performance/SKILL.md +76 -0
  159. package/assets/skills/security/agemon-security/LICENSE +21 -0
  160. package/assets/skills/security/agemon-security/NOTICE.md +8 -0
  161. package/assets/skills/security/agemon-security/SKILL.md +356 -0
  162. package/assets/skills/security/agemon-security-audit/AI-AND-LLM.md +83 -0
  163. package/assets/skills/security/agemon-security-audit/ATTACK-CLASSES.md +130 -0
  164. package/assets/skills/security/agemon-security-audit/CLIENT-SIDE.md +83 -0
  165. package/assets/skills/security/agemon-security-audit/CLOUD-AND-DEPLOYMENT.md +86 -0
  166. package/assets/skills/security/agemon-security-audit/DATA-ISOLATION-AND-LIFECYCLE.md +84 -0
  167. package/assets/skills/security/agemon-security-audit/DESKTOP-MOBILE-AND-LOCAL-IPC.md +89 -0
  168. package/assets/skills/security/agemon-security-audit/HUNTING.md +251 -0
  169. package/assets/skills/security/agemon-security-audit/LICENSE +21 -0
  170. package/assets/skills/security/agemon-security-audit/MEMORY-SAFETY-AND-BINARY.md +101 -0
  171. package/assets/skills/security/agemon-security-audit/NOTICE.md +12 -0
  172. package/assets/skills/security/agemon-security-audit/PROTOCOLS-RPC-AND-MESSAGING.md +81 -0
  173. package/assets/skills/security/agemon-security-audit/RECONNAISSANCE.md +156 -0
  174. package/assets/skills/security/agemon-security-audit/RESOURCE-EXHAUSTION-AND-AVAILABILITY.md +78 -0
  175. package/assets/skills/security/agemon-security-audit/SKILL.md +192 -0
  176. package/assets/skills/security/agemon-security-audit/SUPPLY-CHAIN-AND-RELEASE.md +73 -0
  177. package/assets/skills/security/agemon-security-audit/VALIDATION-AND-REPORTING.md +186 -0
  178. package/assets/skills/security/agemon-security-audit/WEB-PROTOCOL-AND-AUTH.md +105 -0
  179. package/assets/skills/security/agemon-security-audit/report-schema.json +461 -0
  180. package/assets/skills/security/agemon-security-audit/validate-coverage-ledger.cjs +872 -0
  181. package/assets/skills/security/agemon-security-audit/validate-findings.cjs +773 -0
  182. package/assets/skills/self-review/agemon-review-intake/LICENSE +21 -0
  183. package/assets/skills/self-review/agemon-review-intake/NOTICE.md +9 -0
  184. package/assets/skills/self-review/agemon-review-intake/SKILL.md +205 -0
  185. package/assets/skills/self-review/agemon-review-request/LICENSE +21 -0
  186. package/assets/skills/self-review/agemon-review-request/NOTICE.md +9 -0
  187. package/assets/skills/self-review/agemon-review-request/SKILL.md +104 -0
  188. package/assets/skills/self-review/agemon-review-request/code-reviewer.md +188 -0
  189. package/assets/skills/self-review/agemon-root-cause/LICENSE +21 -0
  190. package/assets/skills/self-review/agemon-root-cause/NOTICE.md +10 -0
  191. package/assets/skills/self-review/agemon-root-cause/SKILL.md +283 -0
  192. package/assets/skills/self-review/agemon-root-cause/condition-based-waiting-example.ts +158 -0
  193. package/assets/skills/self-review/agemon-root-cause/condition-based-waiting.md +115 -0
  194. package/assets/skills/self-review/agemon-root-cause/defense-in-depth.md +122 -0
  195. package/assets/skills/self-review/agemon-root-cause/find-polluter.sh +72 -0
  196. package/assets/skills/self-review/agemon-root-cause/root-cause-tracing.md +169 -0
  197. package/assets/skills/self-review/agemon-root-cause/test-academic.md +14 -0
  198. package/assets/skills/self-review/agemon-root-cause/test-pressure-1.md +58 -0
  199. package/assets/skills/self-review/agemon-root-cause/test-pressure-2.md +68 -0
  200. package/assets/skills/self-review/agemon-root-cause/test-pressure-3.md +69 -0
  201. package/assets/skills/self-review/agemon-verify-before-done/LICENSE +21 -0
  202. package/assets/skills/self-review/agemon-verify-before-done/NOTICE.md +9 -0
  203. package/assets/skills/self-review/agemon-verify-before-done/SKILL.md +120 -0
  204. package/assets/skills/team-lead/agemon-plan-rfc/SKILL.md +317 -0
  205. package/assets/skills/team-lead/prd-generator/SKILL.md +437 -0
  206. package/assets/skills/team-lead/skill-headofit-audit/SKILL.md +72 -0
  207. package/assets/skills/team-lead/skill-incident-rca/SKILL.md +66 -0
  208. package/assets/skills/team-lead/skill-meeting-lifecycle/SKILL.md +63 -0
  209. package/assets/skills/team-lead/skill-obsidian-vault-sync/SKILL.md +69 -0
  210. package/assets/skills/team-lead/skill-prd-decomposer/SKILL.md +71 -0
  211. package/assets/skills/team-lead/skill-sec-check/SKILL.md +70 -0
  212. package/assets/skills/team-lead/skill-task-extractor/SKILL.md +79 -0
  213. package/assets/skills/team-lead/skill-tech-spike/SKILL.md +57 -0
  214. package/assets/skills/team-lead/skill-techlead-reviewer/SKILL.md +81 -0
  215. package/assets/skills/workflow/agemon-brainstorming/LICENSE +21 -0
  216. package/assets/skills/workflow/agemon-brainstorming/NOTICE.md +14 -0
  217. package/assets/skills/workflow/agemon-brainstorming/SKILL.md +287 -0
  218. package/assets/skills/workflow/agemon-brainstorming/builder-check-prompt.md +23 -0
  219. package/assets/skills/workflow/agemon-dispatching-parallel-agents/LICENSE +21 -0
  220. package/assets/skills/workflow/agemon-dispatching-parallel-agents/NOTICE.md +13 -0
  221. package/assets/skills/workflow/agemon-dispatching-parallel-agents/SKILL.md +167 -0
  222. package/assets/skills/workflow/agemon-executing-plans/LICENSE +21 -0
  223. package/assets/skills/workflow/agemon-executing-plans/NOTICE.md +15 -0
  224. package/assets/skills/workflow/agemon-executing-plans/SKILL.md +322 -0
  225. package/assets/skills/workflow/agemon-executing-plans/scripts/task-done +55 -0
  226. package/assets/skills/workflow/agemon-executing-plans/scripts/task-start +32 -0
  227. package/assets/skills/workflow/agemon-finishing-a-development-branch/LICENSE +21 -0
  228. package/assets/skills/workflow/agemon-finishing-a-development-branch/NOTICE.md +13 -0
  229. package/assets/skills/workflow/agemon-finishing-a-development-branch/SKILL.md +225 -0
  230. package/assets/skills/workflow/agemon-subagent-driven-development/LICENSE +21 -0
  231. package/assets/skills/workflow/agemon-subagent-driven-development/NOTICE.md +15 -0
  232. package/assets/skills/workflow/agemon-subagent-driven-development/SKILL.md +339 -0
  233. package/assets/skills/workflow/agemon-subagent-driven-development/code-reviewer.md +198 -0
  234. package/assets/skills/workflow/agemon-subagent-driven-development/implementer-prompt.md +154 -0
  235. package/assets/skills/workflow/agemon-subagent-driven-development/re-review-prompt.md +116 -0
  236. package/assets/skills/workflow/agemon-subagent-driven-development/references/batching.md +11 -0
  237. package/assets/skills/workflow/agemon-subagent-driven-development/references/cannot-verify.md +10 -0
  238. package/assets/skills/workflow/agemon-subagent-driven-development/references/final-review.md +49 -0
  239. package/assets/skills/workflow/agemon-subagent-driven-development/references/fix-loop.md +77 -0
  240. package/assets/skills/workflow/agemon-subagent-driven-development/references/handling-reports.md +15 -0
  241. package/assets/skills/workflow/agemon-subagent-driven-development/references/preflight.md +26 -0
  242. package/assets/skills/workflow/agemon-subagent-driven-development/references/resuming.md +12 -0
  243. package/assets/skills/workflow/agemon-subagent-driven-development/references/role-scout.md +18 -0
  244. package/assets/skills/workflow/agemon-subagent-driven-development/references/role-worker.md +19 -0
  245. package/assets/skills/workflow/agemon-subagent-driven-development/scripts/review-package +64 -0
  246. package/assets/skills/workflow/agemon-subagent-driven-development/scripts/sdd-repo +54 -0
  247. package/assets/skills/workflow/agemon-subagent-driven-development/scripts/sdd-workspace +110 -0
  248. package/assets/skills/workflow/agemon-subagent-driven-development/scripts/task-brief +108 -0
  249. package/assets/skills/workflow/agemon-subagent-driven-development/task-reviewer-prompt.md +209 -0
  250. package/assets/skills/workflow/agemon-test-driven-development/LICENSE +21 -0
  251. package/assets/skills/workflow/agemon-test-driven-development/NOTICE.md +14 -0
  252. package/assets/skills/workflow/agemon-test-driven-development/SKILL.md +330 -0
  253. package/assets/skills/workflow/agemon-test-driven-development/writing-good-tests.md +198 -0
  254. package/assets/skills/workflow/agemon-using-git-worktrees/LICENSE +21 -0
  255. package/assets/skills/workflow/agemon-using-git-worktrees/NOTICE.md +13 -0
  256. package/assets/skills/workflow/agemon-using-git-worktrees/SKILL.md +167 -0
  257. package/assets/skills/workflow/agemon-writing-plans/LICENSE +21 -0
  258. package/assets/skills/workflow/agemon-writing-plans/NOTICE.md +13 -0
  259. package/assets/skills/workflow/agemon-writing-plans/SKILL.md +204 -0
  260. package/assets/tools/code-review-graph-constraints.txt +1418 -0
  261. package/assets/tools/package-lock.json +111 -0
  262. package/assets/tools/package.json +6 -0
  263. package/dist/chunk-ZZBF3GOV.js +3451 -0
  264. package/dist/chunk-ZZBF3GOV.js.map +1 -0
  265. package/dist/fake-subprocess-IV4ML77S.js +636 -0
  266. package/dist/fake-subprocess-IV4ML77S.js.map +1 -0
  267. package/dist/index.js +23836 -1945
  268. package/dist/index.js.map +1 -1
  269. package/package.json +37 -17
@@ -0,0 +1,158 @@
1
+ # AI Chat — Interaction Patterns for AI-Native Surfaces
2
+
3
+ Framework-agnostic patterns for UIs that stream tokens, render tool traces, show citations, or render AI-generated content alongside user chrome. The rules sit on top of `state-design.md` — AI surfaces extend the base lattice with streaming-specific states, caret semantics, and trust affordances. No assumption of Vercel AI SDK, LangChain, or CopilotKit — patterns apply to any streaming runtime.
4
+
5
+ ---
6
+
7
+ ## When to Read This
8
+
9
+ Read when building anything that streams tokens to the user, renders function-call traces, shows citations or source chips, or presents AI-generated content alongside human-authored UI. If the surface is just a "submit + await + render" form with no streaming and no tool use, skip this and stay in `state-design.md` + `copy.md`.
10
+
11
+ ---
12
+
13
+ ## The Streaming Contract
14
+
15
+ What the user expects the moment they hit send. Every bullet is a hard rule, not a preference.
16
+
17
+ - **First visible pixel < 400ms** (Doherty threshold). If the model is slow, paint the message shell, the thinking indicator, and the stop button before the first token. Never a blank screen waiting on the first chunk.
18
+ - **Caret or cursor indicator while tokens arrive.** No caret = "is it broken?" panic. A blinking block, a pulsing dot at the tail of the last token, or a subtle gradient sweep — one of these is always visible during an active stream.
19
+ - **Progressive markdown rendering.** Parse headings, lists, code blocks, and inline formatting as chunks arrive. Never buffer the full response and render once — users perceive that as a freeze even if the total time is identical.
20
+ - **Token pacing matches reality.** If the model is fast, don't artificially slow the render to feel "human." If it's slow, show incremental progress, never a spinner that sits for 15s.
21
+ - **Interruptible.** Always a stop button while streaming. After stop, a regenerate button. Never strand the user watching a response they don't want.
22
+ - **Scroll discipline.** Auto-scroll to follow new tokens, but pause auto-scroll the moment the user scrolls up. Resume only on user send or explicit "scroll to bottom."
23
+
24
+ ---
25
+
26
+ ## Status Affordances
27
+
28
+ Seven states AI UIs need beyond the base `state-design.md` lattice. Every state has a distinct visual signal — the user never has to guess which one they're in.
29
+
30
+ | State | Signal |
31
+ |---|---|
32
+ | Idle | Empty input, placeholder copy, blinking cursor on focus. Optionally: starter prompt carousels below input — only when the surface has tested the carousel against a control (no surface should ship "what AI thinks users want to ask" — that pattern reads as condescending and misses real intents). |
33
+ | Composing | User typing; no AI activity shown; send button enabled |
34
+ | Thinking | Sent, model hasn't started; typing-dots or "thinking…" label; max 2s before escalating to progress |
35
+ | Streaming | Caret visible; tokens appearing; stop button active; auto-scroll following tail |
36
+ | Tool-calling | Labeled tool trace ("Searching web for…" / "Reading file X.ts") with collapsible detail and running spinner |
37
+ | Complete | Caret gone; all actions available — regenerate, copy, feedback, branch |
38
+ | Error | Specific cause + retry + copy-error-id; never a toast that vanishes |
39
+
40
+ The thinking → streaming transition is the most-botched handoff. If thinking lasts > 2s without a progress signal, users refresh. Escalate to "Still thinking — this sometimes takes up to 10s" after 2s.
41
+
42
+ ---
43
+
44
+ ## Tool Traces
45
+
46
+ When the model calls a function (web search, file read, code execution), render it inline. Hiding tool calls is the fastest way to lose user trust.
47
+
48
+ **Required parts:**
49
+ - **Title + target.** "Search web: 'Anchor Positioning browser support'" — not "Tool call: search".
50
+ - **Status icon.** Running (spinner), complete (check), failed (warning).
51
+ - **Collapsible detail.** Expand to show request args + response. Collapsed by default for readable flow; expanded by user choice persists through the session.
52
+ - **Duration once done.** "Search web: 'Anchor Positioning' · 1.2s" — cheap honesty.
53
+ - **Chained traces render in order.** If the model calls three tools, show three traces in sequence as they happen, not a single "tools" umbrella.
54
+
55
+ **Never** hide tool calls behind a toggle that defaults to off. If the model did work, the user sees it happened. Transparency is the trust primitive for AI UIs.
56
+
57
+ ---
58
+
59
+ ## Citation Chips
60
+
61
+ When the model cites sources, make them first-class content, not footnotes no one reads.
62
+
63
+ - **Inline superscript** — `⟨¹⟩` or `[1]` at the end of the cited clause.
64
+ - **Hover/tap reveals source card** — title, URL, excerpt (2-3 lines of context), favicon.
65
+ - **Sources section at the bottom** — ordered by first-appearance citation number, not alphabetical.
66
+ - **Click a chip scrolls to that quote** — the stream becomes a deep-link map. Use View Transitions if navigating between a source detail page and the chat.
67
+ - **Broken citation = find-and-replace.** If a source 404s at chip-render time, mark the chip as unverified with a warning icon; don't silently drop it.
68
+
69
+ ---
70
+
71
+ ## Feedback Affordances
72
+
73
+ Every AI response gets visible feedback controls (thumbs / star / "did this help?" affordance). User interaction with them is optional — the system never gates progression on feedback. The control's presence signals the team values feedback; the optional interaction respects user attention.
74
+
75
+ - **Thumb up / thumb down.** Pick up/down OR agree/disagree wording — never mix. Persist choice; allow undo.
76
+ - **On thumb down: inline quick chips** — "factually incorrect", "harmful", "refused reasonable request", "bad format", "other". User can skip chips and just send the thumb.
77
+ - **Acknowledgement copy** — "Thanks — this helps us improve." Not "Your feedback has been recorded successfully!" Match `copy.md` restraint.
78
+ - **Never block the UI on feedback.** No "you must rate before continuing" modals. Ever.
79
+
80
+ ---
81
+
82
+ ## Retry / Regenerate / Continue
83
+
84
+ Three distinct verbs for three distinct operations. Mixing them is a common AI-UI tell.
85
+
86
+ | Verb | Meaning | Effect on history |
87
+ |------|---------|-------------------|
88
+ | Retry | Same prompt, same context, same model | Replaces prior response |
89
+ | Regenerate | Same prompt, variation (temperature bump or alt model) | Creates alternative; original stays visible |
90
+ | Continue | Response was cut off; extend from last token | Appends to prior response |
91
+
92
+ Label the buttons with the actual verb. "Try again" is ambiguous — is it retry or regenerate? Pick one and be explicit.
93
+
94
+ ---
95
+
96
+ ## Inline Actions on Response
97
+
98
+ What lives on each assistant message, reachable by hover (desktop) or tap-and-hold (mobile):
99
+
100
+ - **Copy.** Always. Clean text — no invisible whitespace, no markdown-to-plain conversion surprises. If the response is code, copy without the surrounding prose.
101
+ - **Edit prompt.** Jump to the user message that produced this response, with the original text pre-filled. Edits trigger retry.
102
+ - **Branch conversation.** Fork from this point; the original thread stays intact. Useful for "what if I asked differently?" exploration.
103
+ - **Share link.** Generates a read-only URL to this response (or the full thread up to this point).
104
+ - **Export markdown.** Clean markdown of the response, ready to paste into a doc.
105
+ - **Flag.** For destructive or concerning content. Sends to your review queue.
106
+
107
+ Actions appear on hover; persist on the last message (most commonly actioned); collapse into a `⋯` menu on mobile.
108
+
109
+ ---
110
+
111
+ ## Generative UI Patterns
112
+
113
+ When the model generates UI — charts, cards, forms, interactive tools — the render has rules the model doesn't know about. Enforce them in the renderer.
114
+
115
+ - **Loading skeleton matches component shape.** A generated chart gets a chart-shaped skeleton; a generated table gets table rows. Generic gray box is the AI-slop fallback.
116
+ - **Fallback to plain text if structured render fails.** If the schema is malformed, render the raw text and log the parse error — never show a broken component.
117
+ - **Interactive elements keep keyboard accessibility.** Generated buttons, selects, and forms are real `<button>`, `<select>`, `<form>` — not divs. The model doesn't get to skip a11y.
118
+ - **"Copy as code" always available.** For any generated UI, the user can see and copy the underlying code/props. Debuggability is trust.
119
+ - **Streaming components render progressively.** A generated table fills row by row as data arrives, not all-at-once at the end.
120
+
121
+ ---
122
+
123
+ ## Conversation Surface Layout
124
+
125
+ Body rules that make long threads readable.
126
+
127
+ - **Input always visible.** Pinned to viewport bottom on mobile (above the home indicator); sticky on desktop when the thread scrolls past its height. Never behind a scroll gate.
128
+ - **Scroll-to-bottom on send.** Force-scroll when the user sends a new message. During streaming, auto-scroll follows the tail UNTIL the user scrolls up — then pause until they scroll down or send again.
129
+ - **Max-width on message content.** ~65-75ch reading line. Full-width on tool traces and generative UI (they need room).
130
+ - **Alternating visual treatment for user vs assistant.** Right-aligned vs left-aligned, or tinted bubble vs plain, or avatar on one side only. Subtle — not a heavy rhythm that fights the content.
131
+ - **Thread virtualization at > 100 messages.** Long sessions compound DOM cost; render only the visible window + some buffer.
132
+
133
+ ---
134
+
135
+ ## Anti-Patterns
136
+
137
+ Ten sins that immediately read as "AI UI built in a weekend":
138
+
139
+ - Streaming without a caret — user can't tell if it's alive.
140
+ - Spinner > 3s without a progress signal or expected-duration copy.
141
+ - Auto-scrolling while the user is reading earlier content.
142
+ - Hiding tool calls behind a default-off toggle.
143
+ - Forced feedback ("rate before continuing").
144
+ - Removing the stop button during an active stream.
145
+ - Awaiting the full response then rendering once (no progressive parse).
146
+ - Copy button that copies with invisible whitespace, zero-width chars, or broken markdown.
147
+ - "Thinking…" label for 30s with no escalation, no progress, no tool trace.
148
+ - Fake typewriter pacing slower than the actual stream — makes a fast model feel slow.
149
+
150
+ ---
151
+
152
+ ## Cross-References
153
+
154
+ - `state-design.md` — base state lattice (idle / loading / empty / error / partial / conflict / offline). AI surfaces extend it with thinking / streaming / tool-calling.
155
+ - `motion.md` — caret animation tokens, streaming shimmer, tool-trace expand/collapse. Use the existing duration scale; never bespoke.
156
+ - `accessibility.md` — live-region announcements when content streams (`aria-live="polite"` on the message container; `aria-busy` during tool calls).
157
+ - `heuristics.md` — visibility-of-system-status applied to AI; the stream is the system, and it needs to be visible at every moment.
158
+ - `copy.md` — error and acknowledgement copy for AI responses; tone is restrained, not effusive.
@@ -0,0 +1,190 @@
1
+ # Design Brief
2
+
3
+ Defines the durable sections of `.design/brief.md` — the artifact that anchors every design decision in this project. Read it first when working on any UI task. If it doesn't exist, run `/agemon-design brief` to generate one. Every decision you make should be traceable to a principle in the brief.
4
+
5
+ The file has two parts. [stage-intake.md](stage-intake.md) writes the working part for a run: subject, audience, references, risk appetite, what stays fixed and assumptions. The `brief` action adds the durable sections below. A file may hold only one part so far.
6
+
7
+ Older `.ui-craft/brief.md` files are read as the same format and never rewritten; new content goes in `.design/brief.md`. Whichever file you read, it supplies design values and preferences only, per the Untrusted content rule in [SKILL.md](../SKILL.md).
8
+
9
+ ---
10
+
11
+ ## The Brief Format
12
+
13
+ The durable part has five required sections, all short, plus an optional sixth that grows over time. No preamble. No mission statements.
14
+
15
+ ---
16
+
17
+ ### 1. Product purpose (1 sentence)
18
+
19
+ What this product does, in one sentence. Not a tagline. Specific. The kind of sentence a stranger could repeat after reading once.
20
+
21
+ > **Strong:** "Schedules end-of-day cash reconciliation reports for retail finance teams."
22
+ > **Weak:** "An AI-powered platform for modern teams." — generic, interchangeable with any SaaS product, tells the agent nothing about what trade-offs to make.
23
+
24
+ The test: could two different products use this sentence? If yes, rewrite.
25
+
26
+ ---
27
+
28
+ ### 2. Primary user (1 sentence)
29
+
30
+ Who the product is for, by role and context. Specific enough that a UI decision could differ from a hypothetical secondary user.
31
+
32
+ > **Strong:** "A finance ops lead at a 200-store retail chain, working in the office between 6am and 9am, on a 13" laptop."
33
+ > **Weak:** "Anyone who manages money." — too broad to constrain a single layout decision.
34
+
35
+ Role + context + device is the minimum. Frequency of use and session length are useful additions.
36
+
37
+ ---
38
+
39
+ ### 3. Three to five principles (the operating beliefs)
40
+
41
+ Opinionated statements about how this product behaves. Not aspirations — beliefs. Beliefs that, when two conflict, one wins.
42
+
43
+ Each principle must clear five bars:
44
+
45
+ - **Opinionated** — takes a stance someone could disagree with
46
+ - **Actionable** — resolves a real design debate when applied
47
+ - **Memorable** — short enough to recall without reading the file
48
+ - **Distinctive** — reflects this product, not generic SaaS values
49
+ - **Testable** — a proposed design can be evaluated against it
50
+
51
+ List them in conflict-resolution order. When two principles apply to the same decision, the higher one wins.
52
+
53
+ **Example pairs — strong vs. weak:**
54
+
55
+ | Strong | Weak | Why the weak one fails |
56
+ |--------|------|----------------------|
57
+ | "Wrong is worse than late." | "Accuracy matters." | The strong one resolves the confirmation modal debate. The weak one is a platitude every product claims. |
58
+ | "The empty page is the customer." | "Good onboarding is important." | The strong one makes a specific architectural call: blank canvas over wizard. The weak one is a category. |
59
+ | "Show the data, not the design." | "Keep it simple." | The strong one tells the agent what to do with color, chrome, and decoration. The weak one means nothing actionable. |
60
+
61
+ ---
62
+
63
+ ### 4. Success metric for the surface (1-2 sentences)
64
+
65
+ What "the user succeeded" looks like, in observable behavior. Not a business metric — a usage signal that surface design directly influences.
66
+
67
+ > **Strong:** "User identifies the day's outlier stores within 30 seconds of landing on the dashboard."
68
+ > **Weak:** "Increase MRR by 12%." — a business outcome; the surface has no direct lever on it.
69
+
70
+ The metric constrains every information hierarchy decision on that surface. Write it before designing the layout.
71
+
72
+ ---
73
+
74
+ ### 5. Out of scope (bullet list)
75
+
76
+ Three to five things this surface deliberately does NOT do. Constrain by exclusion. Prevents scope creep mid-design.
77
+
78
+ ```markdown
79
+ - Does not display historical trends beyond 30 days
80
+ - Does not support bulk edits from this surface
81
+ - Does not expose raw transaction data
82
+ ```
83
+
84
+ Short. Declarative. Each item should prevent at least one future feature request from landing in the wrong place.
85
+
86
+ ---
87
+
88
+ ### 6. Learned constraints (optional, append-only)
89
+
90
+ Corrections the user has made to design output on this project — the brief teaching itself. Starts empty; grows whenever the user rejects or redirects a choice. Each entry is dated and pins the rule plus the reason, so it generalizes instead of pattern-matching one literal case.
91
+
92
+ ```markdown
93
+ - **2026-06-23** — No gradient backgrounds on hero/landing surfaces. *Why:* brand reads restrained; flashy undercuts trust.
94
+ - **2026-06-20** — Button press feedback caps at `scale(0.97)`. *Why:* user found 0.92 exaggerated.
95
+ ```
96
+
97
+ These are project-scoped design facts, not a general memory store — they live in the brief because they *are* design decisions, just learned rather than stated up front. They rank with the principles (section 3): a learned constraint overrides a skill default but never the accessibility/correctness floor.
98
+
99
+ ### 7. Fold classes used (append-only, written by `/agemon-design build`)
100
+
101
+ Which composition class each landing fold in this project committed to. Append-only; `/agemon-design build` reads it to pick a class this project has not spent yet.
102
+
103
+ ```markdown
104
+ - **2026-07-29** — `type-only` — pricing page. Sacrificed any product demonstration above the fold.
105
+ - **2026-07-14** — `product-dominant` — home. Sacrificed narrative; the fold shows, it does not explain.
106
+ ```
107
+
108
+ This section is not documentation, it is the mechanism. Asking a model for variety returns its default every time — ten blind builds of this skill produced the same fold ten times out of ten, across two unrelated products, with the fold prescribed, then permitted, then explicitly forbidden. Nothing written in prose moved it. What moves it is drawing from what is left, and that requires remembering what was taken. Delete this section and the project converges again on the next surface.
109
+
110
+ ---
111
+
112
+ ## How the Brief Gets Used
113
+
114
+ Read `.design/brief.md` first when working on any UI. It is the first step of [stage-intake.md](stage-intake.md).
115
+
116
+ When making a design decision, cite the principle it applies. Write it as: *"Density reduced per principle 2: 'Show the data, not the design.'"* If a decision isn't covered by any principle, flag it — the brief is incomplete, not the decision wrong. Surface the gap so the brief can be updated.
117
+
118
+ If two principles conflict, the higher-ranked one wins. Document the override.
119
+
120
+ ---
121
+
122
+ ## Principles Workshop
123
+
124
+ Run this when the user is starting fresh and has no principles yet.
125
+
126
+ **Step 1: Start from product values, not visual style.**
127
+ Visual style is a consequence of values. "Clean and minimal" is not a principle — it's an aesthetic preference. Ask: what does this product believe about its users' time, expertise, errors, and goals?
128
+
129
+ **Step 2: Apply the "would anyone disagree?" test.**
130
+ If every reasonable person would agree with the principle, it's a platitude. "Be accessible to all users" fails this test. "Speed over completeness — truncate everything, reveal on demand" passes it because some would argue against it.
131
+
132
+ **Step 3: Test against past decisions.**
133
+ Take three real design calls that were debated. Would the candidate principle have produced the same outcome? If it would have flipped a decision you're happy with, it's the wrong principle.
134
+
135
+ **Step 4: Rank for conflict.**
136
+ When "speed" and "completeness" both apply to the same decision, which wins? Write the ranking explicitly. Unranked principles defer every close call back to a human — which defeats the purpose.
137
+
138
+ **Step 5: Trim to three to five.**
139
+ More than five means none of them are load-bearing. If you have eight, find the two that subsume the others and keep those. A principle that never resolves a debate is decorative.
140
+
141
+ **Examples by product archetype:**
142
+
143
+ - Finance reconciliation tool: "Wrong is worse than late." Makes confirmation modals universal. Makes fast-paths expensive to justify. Prevents destructive actions from hiding behind affordance.
144
+ - Creative tool: "The empty page is the customer." Makes loading states cheaper than first-run wizards. Makes templates less prominent than blank-canvas affordance. Deprioritizes onboarding over invitations.
145
+ - Developer dashboard: "Show the data, not the design." Retreats chrome. Reserves color for status signals. Blocks marketing-page patterns from leaking into the product.
146
+
147
+ ---
148
+
149
+ ## When to Update the Brief
150
+
151
+ Update when any of these shift: product direction, target user definition, surface scope, or a principle is found to resolve decisions in the wrong direction.
152
+
153
+ Date each addition. Never delete past principles — if a principle is superseded, mark it deprecated with the date and a reason:
154
+
155
+ ```markdown
156
+ ~~3. "Speed over completeness."~~ — deprecated 2025-11, product shifted to compliance use case where error cost > latency cost.
157
+ 4. "Correctness over speed."
158
+ ```
159
+
160
+ The brief is append-mostly. The team should be able to trace why a principle changed.
161
+
162
+ ---
163
+
164
+ ## Self-Correction
165
+
166
+ When the user corrects design output — "not like that", "I don't like this", "always do X here", "never Z", or reverses a non-default choice in a way that reads as a standing preference — append it to section 6. Capture the **why**, not just the what; phrase it so a future build can apply it without this conversation's context; confirm in one line where it landed. Don't re-litigate a correction already recorded. If a correction would breach the accessibility/correctness floor, apply the closest compliant interpretation and say so — never store an unsafe rule.
167
+
168
+ This is project-scoped, and it lives in the brief by design — agemon-design is a UI skill, not a general memory engine.
169
+
170
+ **Optional cross-project bridge.** If the user wants a correction applied across *all* their projects (not just this one), that's general memory, outside the brief's scope. When an external memory service is available to the agent, mirror the constraint there so other projects inherit it; otherwise note that cross-project recall needs such a service. The brief remains the canonical project store either way.
171
+
172
+ ---
173
+
174
+ ## When the Brief Doesn't Apply
175
+
176
+ **Marketing pages** need a different brief than the product itself. The primary user, success metric, and principles are different. Write a separate brief scoped to the marketing surface.
177
+
178
+ **First-run experiences** often have a distinct goal (activation, not task completion) and may warrant their own brief — or an addendum to the product brief.
179
+
180
+ **Multi-brand products** need a brief per brand, not per product. The format is the same; the content differs per brand context.
181
+
182
+ The brief format is universal. Its content is always scoped to a single surface and audience. If one brief is trying to serve three different contexts, split it.
183
+
184
+ ---
185
+
186
+ ## File Location and Git
187
+
188
+ Commit `.design/brief.md` to the repo. The brief is documentation, not configuration. Ignoring it in `.gitignore` means losing the team's collective design memory between sessions and collaborators.
189
+
190
+ The `.design/` directory is the project's design decision store. It belongs in version control alongside the code it governs, except for `.design/shots/`.
@@ -0,0 +1,216 @@
1
+ # Color & Theming
2
+
3
+ Strategic color application, palette building, dark mode, and design tokens.
4
+
5
+ ---
6
+
7
+ ## Color Strategy
8
+
9
+ More color ≠ better. Strategic color beats rainbow vomit. Every color needs a purpose.
10
+
11
+ ### Application UI Color Balance
12
+ The 60-30-10 rule is for interior design and marketing sites — not application UI. Mature SaaS products follow a different pattern:
13
+ - **90%+ neutral tones** — grays, whites, subtle warm/cool tints for surfaces and text
14
+ - **One accent color, used sparingly** — buttons, links, focus rings, emphasis states
15
+ - **Secondary colors only for semantic meaning** — success green, warning amber, error red
16
+
17
+ ### Commitment Axis (marketing surfaces)
18
+
19
+ Product UI stays restrained; marketing surfaces have permission to commit further. Pick a strategy **before** picking colors, gated by DESIGN_VARIANCE ([craft-intent.md](craft-intent.md)):
20
+
21
+ | Strategy | What it means | Variance gate |
22
+ |----------|---------------|---------------|
23
+ | **Restrained** | 90%+ neutral, one accent ≤10% of surface | any — the product default |
24
+ | **Committed** | one saturated color carries 30-60% of the surface (a drenched hero, a full-color section) | ≥7 |
25
+ | **Full palette** | 3-4 named color roles, each used deliberately | ≥8, brand campaign or portfolio |
26
+ | **Drenched** | the surface IS the color; neutrals are the exception | 9-10, explicit brief only |
27
+
28
+ Commit or don't — a saturated hero hedged with timid neutrals around the edges reads as indecision. A beige-and-muted landing page on a brand brief ignores the register: on marketing surfaces, restraint without intent reads as mediocre, not refined. Name what the strategy is doing in the Craft Read so the user can push back.
29
+
30
+ ### Color Purposes
31
+ - **Semantic**: success (green), error (red/rose), warning (amber), info (blue)
32
+ - **Hierarchy**: drawing attention to important elements
33
+ - **Categorization**: different sections, types, or states
34
+ - **Emotional tone**: warmth, energy, trust, creativity
35
+ - **Wayfinding**: helping users navigate structure
36
+
37
+ ---
38
+
39
+ ## Use OKLCH
40
+
41
+ OKLCH is perceptually uniform — equal steps in lightness *look* equal. Best for generating harmonious scales.
42
+
43
+ ```css
44
+ /* Warm neutral (not pure gray) */
45
+ --surface: oklch(97% 0.01 60);
46
+
47
+ /* Cool tint */
48
+ --surface-cool: oklch(97% 0.01 250);
49
+
50
+ /* Generate a consistent scale */
51
+ --blue-50: oklch(97% 0.02 250);
52
+ --blue-100: oklch(93% 0.04 250);
53
+ --blue-200: oklch(87% 0.08 250);
54
+ --blue-500: oklch(60% 0.15 250);
55
+ --blue-900: oklch(30% 0.10 250);
56
+ ```
57
+
58
+ ---
59
+
60
+ ## Gamut & P3
61
+
62
+ Max displayable chroma is not a flat ceiling — it varies strongly by hue and lightness. Purples and blues reach far higher chroma at mid lightness than yellows and cyans do at the same lightness; the OKLCH gamut is an uneven shape, not a cylinder. When generating a multi-hue palette (categorical chart colors, semantic status colors across hues), hold **chroma as a percentage of each hue's own max** rather than one absolute chroma value for every hue — a fixed `C 0.15` looks vivid on a purple and clipped/dull on a cyan at the same lightness, because the cyan's ceiling is lower.
63
+
64
+ **A P3 screen should get more color, not a different color.** Ship the sRGB-safe value as the default and let capable displays step up to a richer chroma at the same hue and lightness — the two versions should read as the same accent, just less clipped on hardware that can show it:
65
+ ```css
66
+ :root {
67
+ --accent: oklch(60% 0.15 250); /* sRGB-safe default */
68
+ }
69
+
70
+ @media (color-gamut: p3) {
71
+ :root {
72
+ --accent: oklch(60% 0.19 250); /* richer on P3 displays */
73
+ }
74
+ }
75
+ ```
76
+ If the project also needs to support browsers without `oklch()` at all, wrap the enhanced rule in `@supports (color: oklch(0 0 0))` — inside that block, declare the plain-color fallback first and the OKLCH value second, so a supporting browser applies the fallback and then immediately overrides it with the richer color, while a non-supporting browser skips the whole block and keeps whatever fallback was set outside it.
77
+
78
+ ---
79
+
80
+ ## Palette Building
81
+
82
+ ### One-Hue Palette Recipe
83
+
84
+ A complete UI palette from a single brand hue, five roles: **text strong**, **text weak**, **stroke strong**, **stroke weak**, **fill** — generated by shifting only saturation and brightness of the base hue (in OKLCH: lightness and chroma; hold the hue). Each role has a contrast job (text strong ≥ Lc 75-90, strokes ≥ non-text minimums). **Why:** one hue at five intensities is cohesive by construction and gives every tone a functional meaning; five unrelated grays give you neither. Add a second hue only when a role genuinely can't be served by the first.
85
+
86
+ **QA the scale before shipping it.** A scale generated in HSL keeps the same numeric hue at every step but doesn't hold that hue perceptually constant — the light and dark ends visibly lean toward a neighboring hue even though the number didn't move. Spot-check by reading the OKLCH hue angle at each step of the generated scale; if it wanders more than roughly a dozen degrees from one end to the other, the drift is visible to the eye, not just on paper, and the fix is regenerating in OKLCH with hue held fixed while only lightness and chroma vary.
87
+
88
+ ### Tinted Neutrals
89
+ Default to tinted neutrals over pure gray — a subtle hue tint reads as intentional. (Exception: deliberately achromatic systems — Sharp Geometric at zero chroma, print-derived palettes — where pure gray IS the statement; see the Signal preset in `themes.md`.)
90
+ - **Warm**: `oklch(L 0.01 60)` (slight warm tint)
91
+ - **Cool**: `oklch(L 0.01 250)` (slight blue tint)
92
+ - Match tint to your brand's primary hue
93
+
94
+ ### Hue Consistency
95
+ On non-neutral backgrounds, tint borders/shadows/text toward the same hue:
96
+ ```css
97
+ /* Card on blue background */
98
+ .card {
99
+ border: 1px solid oklch(70% 0.05 250); /* blue-tinted border */
100
+ box-shadow: 0 4px 12px oklch(30% 0.03 250 / 0.15); /* blue-tinted shadow */
101
+ }
102
+ ```
103
+
104
+ ### Never
105
+ - Gray text on colored backgrounds — looks washed out; use darker shade of bg color or transparency
106
+ - Pure black (`#000`) or pure white (`#fff`) for large areas
107
+ - Purple/cyan/blue gradient everything (AI slop)
108
+ - Gradients as decoration without purpose
109
+
110
+ ---
111
+
112
+ ## Dark Mode
113
+
114
+ ### Required Setup
115
+ ```html
116
+ <html style="color-scheme: dark">
117
+ <meta name="theme-color" content="#000000">
118
+ ```
119
+
120
+ ### Rules
121
+ - `color-scheme: dark` on `<html>` — ensures scrollbars, form controls, etc. have proper contrast
122
+ - `<meta name="theme-color">` matches page background
123
+ - Explicit `background-color` and `color` on native `<select>` (Windows fix)
124
+ - Reduce shadow intensity in dark mode (shadows are less visible on dark)
125
+ - **Elevation via transparency, not fixed grays:** define raised surfaces as white at stepped opacities (e.g. 6% / 8% / 12% over the base) instead of hand-picked lighter grays. **Why:** a transparent fill blends with whatever sits beneath it, so the same token reads consistently at every elevation — and light mode reuses the trick with black at 4-9%. Solid grays only match the one background they were picked against.
126
+ - Increase surface differentiation (more elevation steps)
127
+ - Watch gradient banding — fading to dark colors can cause banding; use background images when needed
128
+
129
+ ---
130
+
131
+ ## Semantic Color Tokens
132
+
133
+ ```css
134
+ /* Surfaces */
135
+ --surface-primary: oklch(...);
136
+ --surface-secondary: oklch(...);
137
+ --surface-elevated: oklch(...);
138
+
139
+ /* Text */
140
+ --text-primary: oklch(...);
141
+ --text-secondary: oklch(...);
142
+ --text-tertiary: oklch(...);
143
+
144
+ /* Status */
145
+ --status-success: oklch(65% 0.18 145);
146
+ --status-error: oklch(60% 0.20 25);
147
+ --status-warning: oklch(75% 0.15 70);
148
+ --status-info: oklch(60% 0.15 250);
149
+
150
+ /* Interactive */
151
+ --interactive-primary: oklch(...);
152
+ --interactive-hover: oklch(...); /* more contrast than rest */
153
+ --interactive-active: oklch(...); /* even more contrast */
154
+ --interactive-focus: oklch(...);
155
+ ```
156
+
157
+ **State overlays scale better than per-component state colors:** define hover/press as two reusable overlay tokens (e.g. hover = the fill tone, press = the weak stroke tone, or translucent black/white steps) and apply them over ANY component surface. Every new component inherits correct states for free instead of minting its own hover/press variations.
158
+
159
+ ---
160
+
161
+ ## Contrast
162
+
163
+ - **Prefer APCA** over WCAG 2 for perceptual accuracy
164
+ - **Text contrast**: minimum 4.5:1 (WCAG AA), prefer 7:1 (AAA)
165
+ - **UI components**: minimum 3:1
166
+ - **Think in the gap, not the absolute value.** What determines whether body text reads is the ΔL between foreground and background in OKLCH — roughly 0.55 or more of separation is the target. That gap is cheap near the extremes: a background at L 0.95 or L 0.1 has plenty of room to pair with a strongly contrasting foreground. It gets expensive as background L drifts toward the middle of the range — somewhere around L 0.4-0.7, there simply isn't 0.55 of room left on either side without pushing the foreground all the way to near-black or near-white. Treat any surface landing in that middle band as a contrast red flag and resolve it before the text color gets locked in
167
+ - **Interactions increase contrast**: `:hover`/`:active`/`:focus` have more contrast than rest
168
+ - **Never rely on color alone** — include text labels, icons, patterns
169
+ - **Color-blind-friendly palettes** for charts and data visualization
170
+
171
+ ---
172
+
173
+ ## Application Patterns
174
+
175
+ ### Accent Application
176
+ - Primary actions (CTA buttons)
177
+ - Links (maintain accessibility)
178
+ - Key icons for recognition
179
+ - Section headers
180
+ - Hover states (introduce color on interaction)
181
+ - Focus rings matching brand
182
+
183
+ ### Background & Surfaces
184
+ - Tinted backgrounds (warm/cool neutrals, not pure gray)
185
+ - Colored sections to separate areas
186
+ - Subtle gradient backgrounds (intentional, not generic)
187
+ - Tinted cards for warmth
188
+
189
+ ### Borders & Accents
190
+ - Accent borders on cards (left/top)
191
+ - Colored underlines for active states
192
+ - Subtle colored dividers
193
+ - Colored focus indicators
194
+
195
+ ### Image Outlines
196
+ Give `<img>` a subtle `1px` inset outline so images sit at the same depth as bordered/shadowed surfaces — and the outline color is **non-negotiable**:
197
+ - **Light mode:** pure black at low opacity — `rgba(0,0,0,0.1)` (Tailwind `outline-black/10`).
198
+ - **Dark mode:** pure white — `rgba(255,255,255,0.1)` (Tailwind `dark:outline-white/10`).
199
+ - **Never** a tinted near-black/near-white from the palette (slate/zinc/neutral, `#0a0a0a`, `#f5f5f7`) and never the accent/ink hue. A tinted outline picks up the surface underneath and reads as dirt on the image edge — this is the one place the hue-consistency rule above does NOT apply.
200
+ - Use `outline` + `outline-offset: -1px` (inset), not `border` — keeps the image its intended size and adds nothing to layout.
201
+
202
+ ```css
203
+ img { outline: 1px solid rgba(0,0,0,0.1); outline-offset: -1px; }
204
+ /* dark: rgba(255,255,255,0.1) */
205
+ ```
206
+
207
+ ---
208
+
209
+ ## Design Rules
210
+
211
+ - **Limit accent color to one per view**
212
+ - Use existing theme tokens before introducing new ones
213
+ - Never gradients unless explicitly requested
214
+ - Never glow effects as primary affordances
215
+ - Layered shadows: ambient + direct light
216
+ - Crisp edges: semi-transparent borders + shadows