oneie 2.0.2 → 2.0.5

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 (459) hide show
  1. package/AGENTS.md +245 -0
  2. package/CLAUDE.md +725 -0
  3. package/LICENSE.md +84 -0
  4. package/README.md +489 -931
  5. package/folders.yaml +78 -17
  6. package/one/.obsidian/app.json +1 -0
  7. package/one/.obsidian/appearance.json +1 -0
  8. package/one/.obsidian/core-plugins.json +33 -0
  9. package/one/.obsidian/workspace.json +211 -0
  10. package/one/connections/a2a.md +551 -0
  11. package/one/connections/acp.md +761 -0
  12. package/one/connections/acps.md +731 -0
  13. package/one/connections/agentkit.md +349 -0
  14. package/one/connections/agui.md +767 -0
  15. package/one/connections/any-backend.md +1702 -0
  16. package/one/connections/ap2.md +998 -0
  17. package/one/connections/api-docs.md +1891 -0
  18. package/one/connections/api.md +2190 -0
  19. package/one/connections/architecture-diagram.md +94 -0
  20. package/one/connections/communications.md +449 -0
  21. package/one/connections/connections.md +339 -0
  22. package/one/connections/copilotkit.md +1559 -0
  23. package/one/connections/cryptonetworks.md +781 -0
  24. package/one/connections/documentation.md +1120 -0
  25. package/one/connections/effect.md +279 -0
  26. package/one/connections/elizaos.md +1290 -0
  27. package/one/connections/inference.md +58 -0
  28. package/one/connections/kyc.md +632 -0
  29. package/one/connections/mcp.md +842 -0
  30. package/one/connections/membership.md +1152 -0
  31. package/one/connections/middleware.md +1067 -0
  32. package/one/connections/multitenant.md +1341 -0
  33. package/one/connections/n8n.md +1015 -0
  34. package/one/connections/patterns.md +89 -0
  35. package/one/connections/protocols.md +279 -0
  36. package/one/connections/relationships.md +107 -0
  37. package/one/connections/schema.md +587 -0
  38. package/one/connections/service-layer.md +550 -0
  39. package/one/connections/structure.md +0 -0
  40. package/one/connections/vectors.md +207 -0
  41. package/one/connections/wordpress.md +1302 -0
  42. package/one/connections/workflow-copy.md +905 -0
  43. package/one/connections/workflow-examples.md +741 -0
  44. package/one/connections/workflow.md +905 -0
  45. package/one/connections/workflows/delegation.md +885 -0
  46. package/one/connections/workflows/frontend.md +1037 -0
  47. package/one/connections/workflows/strategy.md +903 -0
  48. package/one/connections/workflows/tasks.md +698 -0
  49. package/one/connections/x402.md +1249 -0
  50. package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +412 -0
  51. package/one/events/FEATURE-2-4-COMPLETE.md +302 -0
  52. package/one/events/FEATURE_2_3_COMPLETE.md +575 -0
  53. package/one/events/GROUPS-MIGRATION.md +625 -0
  54. package/one/events/INSTALL-TESTS.md +293 -0
  55. package/one/events/INTEGRATION-ARCHITECTURE.md +561 -0
  56. package/one/events/INTEGRATION-CHECKLIST.md +1234 -0
  57. package/one/events/INTEGRATION-ORCHESTRATION.md +2623 -0
  58. package/one/events/INTEGRATION-SUMMARY.md +653 -0
  59. package/one/events/MIGRATION-REPORT.md +435 -0
  60. package/one/events/MIGRATION.md +69 -0
  61. package/one/events/README-archived.md +519 -0
  62. package/one/events/TEST-SUMMARY.md +393 -0
  63. package/one/events/TESTS-QUICK-REF.md +262 -0
  64. package/one/events/events.md +545 -0
  65. package/one/groups/groups.md +543 -0
  66. package/one/groups/one.md +599 -0
  67. package/one/groups/revenue.md +673 -0
  68. package/one/groups/strategy.md +869 -0
  69. package/one/groups/vision.md +98 -0
  70. package/one/knowledge/CLOUDFLARE_ENV_SETUP.md +49 -0
  71. package/one/knowledge/ai-platform.md +305 -0
  72. package/one/knowledge/architecture-any-backend.md +1366 -0
  73. package/one/knowledge/architecture-diagram.md +94 -0
  74. package/one/knowledge/architecture-frontend.md +930 -0
  75. package/one/knowledge/architecture.md +2077 -0
  76. package/one/knowledge/crypto.md +960 -0
  77. package/one/knowledge/docs/flow.md +0 -0
  78. package/one/knowledge/dsl.md +1660 -0
  79. package/one/knowledge/files.md +2471 -0
  80. package/one/knowledge/frontend.md +1038 -0
  81. package/one/knowledge/hono.md +2109 -0
  82. package/one/knowledge/implementation-examples.md +2536 -0
  83. package/one/knowledge/inference-score.md +159 -0
  84. package/one/knowledge/knowledge.md +642 -0
  85. package/one/knowledge/language.md +980 -0
  86. package/one/knowledge/lessons-learned.md +70 -0
  87. package/one/knowledge/ontology-6-dimensions.md +0 -0
  88. package/one/knowledge/ontology-documentation.md +356 -0
  89. package/one/knowledge/ontology-engineering-specification.md +1292 -0
  90. package/one/knowledge/ontology-engineering.md +1652 -0
  91. package/one/knowledge/ontology-frontend-copy-2.md +1492 -0
  92. package/one/knowledge/ontology-frontend-copy.md +753 -0
  93. package/one/knowledge/ontology-frontend-specifications.md +2188 -0
  94. package/one/knowledge/ontology-frontend.md +2427 -0
  95. package/one/knowledge/ontology-minimal.yaml +299 -0
  96. package/one/knowledge/ontology.md +2830 -0
  97. package/one/knowledge/ontology.md.backup +2822 -0
  98. package/one/knowledge/ontology.yaml +1165 -0
  99. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +100 -0
  100. package/one/knowledge/patterns/backend/convex-query-pattern.md +88 -0
  101. package/one/knowledge/patterns/backend/mutation-template.md +231 -0
  102. package/one/knowledge/patterns/backend/query-template.md +267 -0
  103. package/one/knowledge/patterns/backend/service-template.md +237 -0
  104. package/one/knowledge/patterns/design/component-architecture.md +399 -0
  105. package/one/knowledge/patterns/design/test-driven-design-pattern.md +162 -0
  106. package/one/knowledge/patterns/design/wireframe-template.md +216 -0
  107. package/one/knowledge/patterns/frontend/component-template.md +195 -0
  108. package/one/knowledge/patterns/frontend/form-template.md +276 -0
  109. package/one/knowledge/patterns/frontend/page-template.md +178 -0
  110. package/one/knowledge/patterns/frontend/react-component-pattern.md +128 -0
  111. package/one/knowledge/patterns/test/acceptance-criteria-template.md +378 -0
  112. package/one/knowledge/patterns/test/technical-test-template.md +544 -0
  113. package/one/knowledge/patterns/test/test-driven-pattern.md +140 -0
  114. package/one/knowledge/patterns/test/user-flow-template.md +254 -0
  115. package/one/knowledge/provider-creation-guide.md +1064 -0
  116. package/one/knowledge/quality-loop.md +401 -0
  117. package/one/knowledge/readme.md +131 -0
  118. package/one/knowledge/rules.md +626 -0
  119. package/one/knowledge/score.md +67 -0
  120. package/one/knowledge/specifications.md +855 -0
  121. package/one/knowledge/tags.md +130 -0
  122. package/one/knowledge/todo.md +251 -0
  123. package/one/license.md +84 -0
  124. package/one/people/anthony-o-connell.md +440 -0
  125. package/one/people/people.md +567 -0
  126. package/one/things/CHECKLIST.md +356 -0
  127. package/one/things/ONE.md +510 -0
  128. package/one/things/agents/agent-backend.md +1401 -0
  129. package/one/things/agents/agent-builder.md +955 -0
  130. package/one/things/agents/agent-clean.md +709 -0
  131. package/one/things/agents/agent-clone.md +1341 -0
  132. package/one/things/agents/agent-designer.md +2177 -0
  133. package/one/things/agents/agent-director.md +1508 -0
  134. package/one/things/agents/agent-documenter.md +1049 -0
  135. package/one/things/agents/agent-frontend.md +1119 -0
  136. package/one/things/agents/agent-integrator.md +1192 -0
  137. package/one/things/agents/agent-problem-solver.md +1379 -0
  138. package/one/things/agents/agent-quality.md +1353 -0
  139. package/one/things/agents/agent-sales.md +986 -0
  140. package/one/things/cascade/cascade.yaml +464 -0
  141. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +470 -0
  142. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +264 -0
  143. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +486 -0
  144. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +497 -0
  145. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +227 -0
  146. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +516 -0
  147. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +544 -0
  148. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +223 -0
  149. package/one/things/cascade/docs/examples/1-3-event-coordination.md +508 -0
  150. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +609 -0
  151. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +195 -0
  152. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +577 -0
  153. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +797 -0
  154. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +212 -0
  155. package/one/things/cascade/docs/examples/1-5-quality-loops.md +641 -0
  156. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +610 -0
  157. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +213 -0
  158. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +575 -0
  159. package/one/things/cascade/docs/examples/readme.md +222 -0
  160. package/one/things/cascade/docs/getting-started.md +515 -0
  161. package/one/things/cascade/docs/workflow.md +1372 -0
  162. package/one/things/cascade/readme.md +336 -0
  163. package/one/things/cascade/templates/feature-template.md +267 -0
  164. package/one/things/claude/agents/advocacy-activation-manager.md +685 -0
  165. package/one/things/claude/agents/advocacy-campaign-designer.md +663 -0
  166. package/one/things/claude/agents/analyst.md +483 -0
  167. package/one/things/claude/agents/architect.md +480 -0
  168. package/one/things/claude/agents/brand-identity-specialist.md +513 -0
  169. package/one/things/claude/agents/bstp-token-strategist.md +667 -0
  170. package/one/things/claude/agents/builder-repo.md +489 -0
  171. package/one/things/claude/agents/bullstamp-community-builder.md +574 -0
  172. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +506 -0
  173. package/one/things/claude/agents/bulltilt-platform-growth.md +567 -0
  174. package/one/things/claude/agents/company-bullstamp-character.md +587 -0
  175. package/one/things/claude/agents/company-bullstamp-community.md +292 -0
  176. package/one/things/claude/agents/company-bullstamp-marketing.md +292 -0
  177. package/one/things/claude/agents/company-bullstamp-token.md +292 -0
  178. package/one/things/claude/agents/company-bulltilt-growth.md +292 -0
  179. package/one/things/claude/agents/content-bibliography-formatter.md +381 -0
  180. package/one/things/claude/agents/content-calendar-planner.md +448 -0
  181. package/one/things/claude/agents/content-chapter-formatter.md +488 -0
  182. package/one/things/claude/agents/content-formatter.md +546 -0
  183. package/one/things/claude/agents/content-hook-specialist.md +462 -0
  184. package/one/things/claude/agents/content-image-formatter.md +535 -0
  185. package/one/things/claude/agents/content-introduction-formatter.md +485 -0
  186. package/one/things/claude/agents/content-multiplication-engine.md +556 -0
  187. package/one/things/claude/agents/content-playbook-writer.md +448 -0
  188. package/one/things/claude/agents/content-team-manager.md +622 -0
  189. package/one/things/claude/agents/content-toc-formatter.md +522 -0
  190. package/one/things/claude/agents/convex-backend-specialist.md +2561 -0
  191. package/one/things/claude/agents/core-manager.md +582 -0
  192. package/one/things/claude/agents/core-master.md +403 -0
  193. package/one/things/claude/agents/cross-functional-manager.md +471 -0
  194. package/one/things/claude/agents/crypto-airdrop-strategist.md +602 -0
  195. package/one/things/claude/agents/crypto-analytics-educator.md +553 -0
  196. package/one/things/claude/agents/crypto-architecture-specialist.md +466 -0
  197. package/one/things/claude/agents/crypto-community-analyst.md +298 -0
  198. package/one/things/claude/agents/crypto-community-psychologist.md +509 -0
  199. package/one/things/claude/agents/crypto-dex-optimization-expert.md +538 -0
  200. package/one/things/claude/agents/crypto-dex-optimizer.md +292 -0
  201. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +513 -0
  202. package/one/things/claude/agents/crypto-diamond-hands.md +292 -0
  203. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +554 -0
  204. package/one/things/claude/agents/crypto-engagement-specialist.md +540 -0
  205. package/one/things/claude/agents/crypto-market-researcher.md +292 -0
  206. package/one/things/claude/agents/crypto-marketing-orchestrator.md +523 -0
  207. package/one/things/claude/agents/crypto-network-effect-amplifier.md +569 -0
  208. package/one/things/claude/agents/crypto-optimization-analyst.md +554 -0
  209. package/one/things/claude/agents/crypto-strategic-synthesizer.md +517 -0
  210. package/one/things/claude/agents/crypto-team-manager.md +387 -0
  211. package/one/things/claude/agents/crypto-token-analyst.md +278 -0
  212. package/one/things/claude/agents/crypto-viral-content-creator.md +546 -0
  213. package/one/things/claude/agents/crypto-wallet-identification-expert.md +517 -0
  214. package/one/things/claude/agents/crypto-wallet-identifier.md +292 -0
  215. package/one/things/claude/agents/customer-journey-designer.md +481 -0
  216. package/one/things/claude/agents/customer-success-manager.md +581 -0
  217. package/one/things/claude/agents/dev.md +413 -0
  218. package/one/things/claude/agents/documenter.md +546 -0
  219. package/one/things/claude/agents/elevate-marketing-orchestrator.md +410 -0
  220. package/one/things/claude/agents/engagement-specialist.md +509 -0
  221. package/one/things/claude/agents/engineering-architect.md +387 -0
  222. package/one/things/claude/agents/engineering-business-analyst.md +537 -0
  223. package/one/things/claude/agents/engineering-developer.md +387 -0
  224. package/one/things/claude/agents/engineering-director.md +282 -0
  225. package/one/things/claude/agents/engineering-ingestor.md +649 -0
  226. package/one/things/claude/agents/engineering-product-manager.md +537 -0
  227. package/one/things/claude/agents/engineering-product-owner.md +537 -0
  228. package/one/things/claude/agents/engineering-project-coordinator.md +537 -0
  229. package/one/things/claude/agents/engineering-quality-assurance.md +393 -0
  230. package/one/things/claude/agents/engineering-team-manager.md +512 -0
  231. package/one/things/claude/agents/engineering-user-experience.md +387 -0
  232. package/one/things/claude/agents/framework-elevate-manager.md +294 -0
  233. package/one/things/claude/agents/improver.md +763 -0
  234. package/one/things/claude/agents/intelligence-team-manager.md +385 -0
  235. package/one/things/claude/agents/lead-capture-expert.md +466 -0
  236. package/one/things/claude/agents/lead-magnet-creator.md +453 -0
  237. package/one/things/claude/agents/market-research-analyst.md +412 -0
  238. package/one/things/claude/agents/marketing-brand-identity.md +314 -0
  239. package/one/things/claude/agents/marketing-content-hooks.md +450 -0
  240. package/one/things/claude/agents/marketing-content-multiplier.md +326 -0
  241. package/one/things/claude/agents/marketing-content-poster.md +361 -0
  242. package/one/things/claude/agents/marketing-customer-journey.md +326 -0
  243. package/one/things/claude/agents/marketing-director.md +397 -0
  244. package/one/things/claude/agents/marketing-engagement.md +326 -0
  245. package/one/things/claude/agents/marketing-lead-capture.md +326 -0
  246. package/one/things/claude/agents/marketing-lead-magnet.md +326 -0
  247. package/one/things/claude/agents/marketing-network-effects.md +326 -0
  248. package/one/things/claude/agents/marketing-nurture-campaigns.md +326 -0
  249. package/one/things/claude/agents/marketing-share-optimizer.md +326 -0
  250. package/one/things/claude/agents/marketing-team-manager.md +446 -0
  251. package/one/things/claude/agents/marketing-viral-growth.md +201 -0
  252. package/one/things/claude/agents/mission-commander.md +373 -0
  253. package/one/things/claude/agents/network-effect-analyst.md +587 -0
  254. package/one/things/claude/agents/nextjs-15-specialist.md +1547 -0
  255. package/one/things/claude/agents/npx.md +890 -0
  256. package/one/things/claude/agents/nurture-campaign-manager.md +531 -0
  257. package/one/things/claude/agents/one-master.md +355 -0
  258. package/one/things/claude/agents/one-orchestrator.md +315 -0
  259. package/one/things/claude/agents/one.md +601 -0
  260. package/one/things/claude/agents/playbook-generator.md +503 -0
  261. package/one/things/claude/agents/pm.md +326 -0
  262. package/one/things/claude/agents/po.md +345 -0
  263. package/one/things/claude/agents/qa.md +336 -0
  264. package/one/things/claude/agents/research-foundation-analyst.md +307 -0
  265. package/one/things/claude/agents/research-intelligence-gatherer.md +408 -0
  266. package/one/things/claude/agents/research-market-analyst.md +307 -0
  267. package/one/things/claude/agents/research-team-manager.md +482 -0
  268. package/one/things/claude/agents/sales-environment-optimizer.md +494 -0
  269. package/one/things/claude/agents/sales-team-manager.md +400 -0
  270. package/one/things/claude/agents/sales-upsell-strategist.md +307 -0
  271. package/one/things/claude/agents/service-advocacy-campaigns.md +307 -0
  272. package/one/things/claude/agents/service-advocacy-manager.md +307 -0
  273. package/one/things/claude/agents/service-success-manager.md +307 -0
  274. package/one/things/claude/agents/service-team-manager.md +400 -0
  275. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +2302 -0
  276. package/one/things/claude/agents/share-optimization-specialist.md +551 -0
  277. package/one/things/claude/agents/sm.md +327 -0
  278. package/one/things/claude/agents/story-teller.md +473 -0
  279. package/one/things/claude/agents/task-master.md +596 -0
  280. package/one/things/claude/agents/tauri-cross-platform-specialist.md +1827 -0
  281. package/one/things/claude/agents/tester.md +556 -0
  282. package/one/things/claude/agents/the-bull-character-manager.md +580 -0
  283. package/one/things/claude/agents/tools-playbook-generator.md +489 -0
  284. package/one/things/claude/agents/turbo-repo-builder.md +316 -0
  285. package/one/things/claude/agents/upsell-strategist.md +480 -0
  286. package/one/things/claude/agents/ux-expert.md +335 -0
  287. package/one/things/claude/agents/viral-growth-orchestrator.md +497 -0
  288. package/one/things/claude/claude-code-hooks-development.json +21 -0
  289. package/one/things/claude/claude-code-hooks-production.json +21 -0
  290. package/one/things/claude/claude-code-hooks.json +25 -0
  291. package/one/things/claude/commands/agent.md +104 -0
  292. package/one/things/claude/commands/cascade-status.md +128 -0
  293. package/one/things/claude/commands/ingest.md +290 -0
  294. package/one/things/claude/commands/ingestor.md +136 -0
  295. package/one/things/claude/commands/mission.md +83 -0
  296. package/one/things/claude/commands/npx.md +133 -0
  297. package/one/things/claude/commands/one.md +440 -0
  298. package/one/things/claude/commands/quality-check.md +204 -0
  299. package/one/things/claude/commands/smart-route.md +220 -0
  300. package/one/things/claude/commands/start.md +121 -0
  301. package/one/things/claude/commands/story.md +83 -0
  302. package/one/things/claude/commands/task.md +173 -0
  303. package/one/things/claude/hook-bypass.json +32 -0
  304. package/one/things/claude/hooks/agent-hook-config.json +427 -0
  305. package/one/things/claude/hooks/agent-hook-manager.js +525 -0
  306. package/one/things/claude/hooks/agent-load-balancer.js +271 -0
  307. package/one/things/claude/hooks/agent-request-interceptor.js +70 -0
  308. package/one/things/claude/hooks/build-hook.sh +156 -0
  309. package/one/things/claude/hooks/cascade-feedback.js +297 -0
  310. package/one/things/claude/hooks/cascade-integration-hooks.js +648 -0
  311. package/one/things/claude/hooks/cleanup-hook.sh +201 -0
  312. package/one/things/claude/hooks/continuous-improvement-monitor.js +510 -0
  313. package/one/things/claude/hooks/file-organization-engine.js +427 -0
  314. package/one/things/claude/hooks/file-organization-hook.sh +80 -0
  315. package/one/things/claude/hooks/file-organization-monitor.js +269 -0
  316. package/one/things/claude/hooks/format-hook.sh +43 -0
  317. package/one/things/claude/hooks/hook-bypass.sh +293 -0
  318. package/one/things/claude/hooks/hook-config-manager.js +202 -0
  319. package/one/things/claude/hooks/hook-debouncer.sh +62 -0
  320. package/one/things/claude/hooks/hook-logger.sh +89 -0
  321. package/one/things/claude/hooks/hook-orchestrator.js +662 -0
  322. package/one/things/claude/hooks/hook-performance-report.js +120 -0
  323. package/one/things/claude/hooks/lint-hook.sh +140 -0
  324. package/one/things/claude/hooks/mcp-cascade-integration.js +816 -0
  325. package/one/things/claude/hooks/memory-optimizer.js +510 -0
  326. package/one/things/claude/hooks/notification-hook.sh +204 -0
  327. package/one/things/claude/hooks/ontology-compliance.js +394 -0
  328. package/one/things/claude/hooks/ontology-hook-manager.js +316 -0
  329. package/one/things/claude/hooks/ontology-validation-engine.js +317 -0
  330. package/one/things/claude/hooks/ontology-validation-hook.sh +86 -0
  331. package/one/things/claude/hooks/performance-metrics.json +25 -0
  332. package/one/things/claude/hooks/performance-monitoring-hook.js +422 -0
  333. package/one/things/claude/hooks/quality-scoring-engine.js +834 -0
  334. package/one/things/claude/hooks/security-hook.sh +256 -0
  335. package/one/things/claude/hooks/simple-load-balancer.js +238 -0
  336. package/one/things/claude/hooks/startup-optimizer.js +625 -0
  337. package/one/things/claude/hooks/story-scoring-system.js +445 -0
  338. package/one/things/claude/hooks/story-validation-engine.js +473 -0
  339. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +210 -0
  340. package/one/things/claude/hooks/story-validation-hook.sh +145 -0
  341. package/one/things/claude/hooks/structure-synchronizer.js +194 -0
  342. package/one/things/claude/hooks/sub-agent-output-validator.js +647 -0
  343. package/one/things/claude/hooks/sub-agent-validation-hook.js +343 -0
  344. package/one/things/claude/hooks/test-hook.sh +145 -0
  345. package/one/things/claude/hooks/test-story-validation.sh +170 -0
  346. package/one/things/claude/hooks/trinity-validation-system.js +392 -0
  347. package/one/things/claude/settings-local.json +86 -0
  348. package/one/things/cli/cli-code.md +652 -0
  349. package/one/things/cli/cli-compiler-code.md +652 -0
  350. package/one/things/cli/cli.md +1068 -0
  351. package/one/things/components/card-shadcn.md +929 -0
  352. package/one/things/components/card.md +1050 -0
  353. package/one/things/components.md +1669 -0
  354. package/one/things/componets.md +4 -0
  355. package/one/things/creator-diagram.md +166 -0
  356. package/one/things/examples/children/lemonade-stand.md +366 -0
  357. package/one/things/examples/enterprise/crm-saas.md +1429 -0
  358. package/one/things/features/1-1-agent-prompts/design.md +470 -0
  359. package/one/things/features/1-1-agent-prompts/tests.md +264 -0
  360. package/one/things/features/1-1-agent-prompts.md +486 -0
  361. package/one/things/features/1-2-yaml-orchestrator/design.md +497 -0
  362. package/one/things/features/1-2-yaml-orchestrator/tests.md +227 -0
  363. package/one/things/features/1-2-yaml-orchestrator.md +516 -0
  364. package/one/things/features/1-3-event-coordination/design.md +544 -0
  365. package/one/things/features/1-3-event-coordination/tests.md +223 -0
  366. package/one/things/features/1-3-event-coordination.md +508 -0
  367. package/one/things/features/1-4-knowledge-management/design.md +609 -0
  368. package/one/things/features/1-4-knowledge-management/tests.md +195 -0
  369. package/one/things/features/1-4-knowledge-management.md +577 -0
  370. package/one/things/features/1-5-quality-loops/design.md +797 -0
  371. package/one/things/features/1-5-quality-loops/tests.md +212 -0
  372. package/one/things/features/1-5-quality-loops.md +641 -0
  373. package/one/things/features/1-6-numbering-structure/design.md +610 -0
  374. package/one/things/features/1-6-numbering-structure/tests.md +213 -0
  375. package/one/things/features/1-6-numbering-structure.md +575 -0
  376. package/one/things/features/2-1-dataprovider-interface.md +2358 -0
  377. package/one/things/features/2-2-config-system.md +3075 -0
  378. package/one/things/features/2-3-effectts-services.md +1498 -0
  379. package/one/things/features/2-4-react-hooks.md +2120 -0
  380. package/one/things/features/2-5-auth-migration.md +2046 -0
  381. package/one/things/features/2-6-dashboard-migration.md +1985 -0
  382. package/one/things/features/2-7-alternative-providers.md +2505 -0
  383. package/one/things/features/2-7-implementation-report.md +680 -0
  384. package/one/things/features/2-cli.md +1235 -0
  385. package/one/things/features/2-design.md +1738 -0
  386. package/one/things/features/2-tests.md +520 -0
  387. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +521 -0
  388. package/one/things/features/DECOUPLING.md +272 -0
  389. package/one/things/features/DEPLOYMENT.md +452 -0
  390. package/one/things/features/IMPLEMENTATION_SUMMARY.md +316 -0
  391. package/one/things/features/dataprovider-interface/1-tests.md +1522 -0
  392. package/one/things/features/improve.md +843 -0
  393. package/one/things/features/remove-convex-deps.md +45 -0
  394. package/one/things/features/top-features.md +79 -0
  395. package/one/things/features/use-one-backend.md +1180 -0
  396. package/one/things/ideas/1-create-workflow.md +189 -0
  397. package/one/things/ideas/2-backend-agnostic-frontend.md +384 -0
  398. package/one/things/plans/1-create-workflow-status.md +555 -0
  399. package/one/things/plans/1-create-workflow.md +713 -0
  400. package/one/things/plans/2-backend-agnostic-frontend.md +543 -0
  401. package/one/things/plans/3-groups.md +502 -0
  402. package/one/things/plans/app.md +761 -0
  403. package/one/things/plans/backend-agnostic-frontend.md +323 -0
  404. package/one/things/plans/better-auth-any-backend-revised.md +1065 -0
  405. package/one/things/plans/better-auth-any-backend.md +1852 -0
  406. package/one/things/plans/better-auth-available-features.md +235 -0
  407. package/one/things/plans/big-plan.md +38 -0
  408. package/one/things/plans/convex-better-auth.md +1109 -0
  409. package/one/things/plans/convex-on-off.md +389 -0
  410. package/one/things/plans/deploy-to-cloudflare.md +581 -0
  411. package/one/things/plans/desktop.md +1121 -0
  412. package/one/things/plans/effect-components.md +1669 -0
  413. package/one/things/plans/effect.md +973 -0
  414. package/one/things/plans/email.md +953 -0
  415. package/one/things/plans/enhance-auth.md +1669 -0
  416. package/one/things/plans/install-components.md +198 -0
  417. package/one/things/plans/landing.md +728 -0
  418. package/one/things/plans/layout.md +205 -0
  419. package/one/things/plans/mail-backend.md +1308 -0
  420. package/one/things/plans/mail.md +2624 -0
  421. package/one/things/plans/next-features.md +83 -0
  422. package/one/things/plans/one.md +658 -0
  423. package/one/things/plans/ontology-6-dimensions.md +2216 -0
  424. package/one/things/plans/ontology-driven-strategy.md +866 -0
  425. package/one/things/plans/ontology-ui-approach.md +357 -0
  426. package/one/things/plans/open-agent.md +785 -0
  427. package/one/things/plans/organizations-to-groups.md +705 -0
  428. package/one/things/plans/performace.md +90 -0
  429. package/one/things/plans/release.md +432 -0
  430. package/one/things/plans/releases.md +809 -0
  431. package/one/things/plans/repos.md +76 -0
  432. package/one/things/plans/separate-copy-2.md +1293 -0
  433. package/one/things/plans/separate-copy-3.md +2458 -0
  434. package/one/things/plans/separate-copy.md +1293 -0
  435. package/one/things/plans/separate.md +1983 -0
  436. package/one/things/plans/shadcn-integration-summary.md +450 -0
  437. package/one/things/plans/sidebar.md +172 -0
  438. package/one/things/plans/small-fixes.md +5 -0
  439. package/one/things/plans/test-backend-connection.md +476 -0
  440. package/one/things/plans/workflow-files.md +1196 -0
  441. package/one/things/plans/workflow.md +1372 -0
  442. package/one/things/products/cascade-landing-page.md +737 -0
  443. package/one/things/products/cascade.md +1518 -0
  444. package/one/things/products/context-engineering.md +1427 -0
  445. package/one/things/products/onthology.md +0 -0
  446. package/one/things/products/ontology-ui-shadcn.md +1280 -0
  447. package/one/things/products/ontology-ui.md +1387 -0
  448. package/one/things/products/ontology.md +717 -0
  449. package/one/things/products/sdk.md +557 -0
  450. package/one/things/promptkit.md +903 -0
  451. package/one/things/service-providers-new.md +982 -0
  452. package/one/things/service-providers.md +1092 -0
  453. package/one/things/system.md +600 -0
  454. package/one/things/tests/2-1-dataprovider-interface.md +1144 -0
  455. package/one/things/tests/2-1-test-analysis.md +496 -0
  456. package/one/things/things.md +349 -0
  457. package/one/things/todo.md +1248 -0
  458. package/one/things/vision/elegant-interface.md +214 -0
  459. package/package.json +5 -2
@@ -0,0 +1,1738 @@
1
+ # Feature 2: Backend-Agnostic Frontend - Design Specification
2
+
3
+ **Feature ID:** `feature_2_design`
4
+ **Plan:** `plan_2_backend_agnostic_frontend`
5
+ **Owner:** Design Agent
6
+ **Status:** Complete Specification
7
+ **Priority:** P1 (High - Developer UX + User UX)
8
+ **Effort:** Ongoing throughout features 2-4, 2-5, 2-6
9
+ **Dependencies:** Features 2-4, 2-5, 2-6
10
+
11
+ ---
12
+
13
+ ## Executive Summary
14
+
15
+ This design specification defines the visual and interaction patterns for THREE distinct areas:
16
+
17
+ 1. **Developer API Design (Feature 2-4)** - Hook API ergonomics and TypeScript IntelliSense
18
+ 2. **Auth Component UI (Feature 2-5)** - 6 authentication components with wireframes
19
+ 3. **Dashboard Component UI (Feature 2-6)** - 5 dashboard components with wireframes
20
+
21
+ **Design Philosophy:** Test-driven, accessibility-first, mobile-first, minimal yet sophisticated.
22
+
23
+ **Critical Success Factor:** Zero visual regression. All existing functionality preserved.
24
+
25
+ ---
26
+
27
+ ## Table of Contents
28
+
29
+ 1. [Design Philosophy](#1-design-philosophy)
30
+ 2. [Design System Foundation](#2-design-system-foundation)
31
+ 3. [Feature 2-4: Developer UX Design](#3-feature-24-developer-ux-design)
32
+ 4. [Feature 2-5: Auth Component Design](#4-feature-25-auth-component-design)
33
+ 5. [Feature 2-6: Dashboard Component Design](#5-feature-26-dashboard-component-design)
34
+ 6. [Accessibility Specifications](#6-accessibility-specifications)
35
+ 7. [Responsive Design System](#7-responsive-design-system)
36
+ 8. [Animation & Transitions](#8-animation--transitions)
37
+ 9. [Implementation Guidelines](#9-implementation-guidelines)
38
+ 10. [Quality Checklist](#10-quality-checklist)
39
+
40
+ ---
41
+
42
+ ## 1. Design Philosophy
43
+
44
+ ### Test-Driven Design
45
+
46
+ Every design decision must enable a test to pass:
47
+
48
+ ```typescript
49
+ // Test defines expected behavior
50
+ it('should display course list with loading state', async () => {
51
+ render(<CourseList />);
52
+ expect(screen.getByTestId('loading-skeleton')).toBeInTheDocument();
53
+
54
+ await waitFor(() => {
55
+ expect(screen.getByText('Course 1')).toBeInTheDocument();
56
+ });
57
+ });
58
+
59
+ // Design satisfies test
60
+ function CourseList() {
61
+ const { data: courses, loading } = useThings({ type: 'course' });
62
+
63
+ if (loading) return <Skeleton data-testid="loading-skeleton" count={3} />;
64
+
65
+ return courses.map(course => <CourseCard key={course._id} course={course} />);
66
+ }
67
+ ```
68
+
69
+ **Principle:** Design is NOT decoration. It's the interface layer that makes features testable.
70
+
71
+ ### Accessibility-First
72
+
73
+ WCAG 2.1 AA compliance is non-negotiable:
74
+
75
+ - Color contrast ratio ≥ 4.5:1 for body text
76
+ - Color contrast ratio ≥ 3:1 for large text (≥18px)
77
+ - Keyboard navigation (Tab, Enter, Escape)
78
+ - Focus indicators visible (2px outline)
79
+ - ARIA labels on interactive elements
80
+ - Screen reader announcements
81
+
82
+ **Principle:** If it's not accessible, it's not designed.
83
+
84
+ ### Mobile-First
85
+
86
+ Design for smallest screen first (320px):
87
+
88
+ ```
89
+ 320px (mobile) → 768px (tablet) → 1024px (desktop) → 1440px (wide)
90
+ ```
91
+
92
+ **Principle:** Mobile constraints force clarity. Desktop adds convenience.
93
+
94
+ ### Minimal Yet Sophisticated
95
+
96
+ Remove unnecessary visual elements:
97
+
98
+ - No decorative gradients
99
+ - No custom illustrations (unless functional)
100
+ - No complex animations (unless feedback)
101
+ - Prioritize readability and usability
102
+
103
+ **Principle:** Every pixel serves a purpose.
104
+
105
+ ---
106
+
107
+ ## 2. Design System Foundation
108
+
109
+ ### Color Palette (Tailwind v4)
110
+
111
+ **Base Colors (HSL Format):**
112
+
113
+ ```css
114
+ @theme {
115
+ /* Light mode */
116
+ --color-background: 36 8% 88%;
117
+ --color-foreground: 0 0% 13%;
118
+ --color-card: 36 10% 74%;
119
+ --color-card-foreground: 0 0% 13%;
120
+ --color-primary: 216 55% 25%;
121
+ --color-primary-foreground: 36 8% 96%;
122
+ --color-secondary: 219 14% 28%;
123
+ --color-secondary-foreground: 36 8% 96%;
124
+ --color-muted: 219 14% 92%;
125
+ --color-muted-foreground: 219 14% 30%;
126
+ --color-accent: 105 22% 25%;
127
+ --color-accent-foreground: 36 8% 96%;
128
+ --color-destructive: 0 84% 60%;
129
+ --color-destructive-foreground: 0 0% 100%;
130
+ --color-border: 0 0% 100% / 0.1;
131
+ --color-input: 0 0% 100% / 0.1;
132
+ --color-ring: 216 63% 17%;
133
+ }
134
+
135
+ .dark {
136
+ /* Dark mode overrides */
137
+ --color-background: 0 0% 13%;
138
+ --color-foreground: 36 8% 96%;
139
+ --color-card: 0 0% 10%;
140
+ --color-card-foreground: 36 8% 96%;
141
+ --color-primary: 216 63% 68%;
142
+ --color-primary-foreground: 0 0% 13%;
143
+ --color-muted: 216 63% 17%;
144
+ --color-muted-foreground: 36 8% 80%;
145
+ }
146
+ ```
147
+
148
+ **Semantic Colors:**
149
+
150
+ - `background` - Page background
151
+ - `foreground` - Body text
152
+ - `card` - Card backgrounds
153
+ - `primary` - Primary actions (buttons, links)
154
+ - `secondary` - Secondary actions
155
+ - `muted` - Disabled states, subtle backgrounds
156
+ - `accent` - Highlights, special states
157
+ - `destructive` - Errors, delete actions
158
+
159
+ **Usage:**
160
+
161
+ ```tsx
162
+ <div className="bg-background text-foreground">
163
+ <div className="bg-card text-card-foreground border border-border">
164
+ <Button className="bg-primary text-primary-foreground">Primary</Button>
165
+ <Button className="bg-destructive text-destructive-foreground">Delete</Button>
166
+ </div>
167
+ </div>
168
+ ```
169
+
170
+ ### Typography Scale
171
+
172
+ **Font Family:**
173
+
174
+ ```css
175
+ font-family: Inter, system-ui, -apple-system, sans-serif;
176
+ ```
177
+
178
+ **Scale (Modular 1.25x):**
179
+
180
+ ```css
181
+ --font-size-xs: 0.75rem; /* 12px */
182
+ --font-size-sm: 0.875rem; /* 14px */
183
+ --font-size-base: 1rem; /* 16px */
184
+ --font-size-lg: 1.125rem; /* 18px */
185
+ --font-size-xl: 1.25rem; /* 20px */
186
+ --font-size-2xl: 1.5rem; /* 24px */
187
+ --font-size-3xl: 1.875rem; /* 30px */
188
+ --font-size-4xl: 2.25rem; /* 36px */
189
+ ```
190
+
191
+ **Weights:**
192
+
193
+ - `font-normal` - 400 (Body text)
194
+ - `font-medium` - 500 (Emphasis)
195
+ - `font-semibold` - 600 (Headings)
196
+ - `font-bold` - 700 (Strong emphasis)
197
+
198
+ **Line Heights:**
199
+
200
+ - `leading-tight` - 1.25 (Headings)
201
+ - `leading-normal` - 1.5 (Body)
202
+ - `leading-relaxed` - 1.625 (Long-form content)
203
+
204
+ ### Spacing Scale
205
+
206
+ **Base Unit: 4px**
207
+
208
+ ```css
209
+ --spacing-1: 0.25rem; /* 4px */
210
+ --spacing-2: 0.5rem; /* 8px */
211
+ --spacing-3: 0.75rem; /* 12px */
212
+ --spacing-4: 1rem; /* 16px */
213
+ --spacing-6: 1.5rem; /* 24px */
214
+ --spacing-8: 2rem; /* 32px */
215
+ --spacing-12: 3rem; /* 48px */
216
+ --spacing-16: 4rem; /* 64px */
217
+ --spacing-24: 6rem; /* 96px */
218
+ --spacing-32: 8rem; /* 128px */
219
+ ```
220
+
221
+ **Common Patterns:**
222
+
223
+ - **Component padding:** `p-4` (16px)
224
+ - **Card spacing:** `p-6` (24px)
225
+ - **Form field gap:** `space-y-4` (16px)
226
+ - **Section spacing:** `space-y-8` (32px)
227
+
228
+ ### Border Radius
229
+
230
+ ```css
231
+ --radius-sm: 0.375rem; /* 6px */
232
+ --radius-md: 0.75rem; /* 12px */
233
+ --radius-lg: 1.5rem; /* 24px */
234
+ ```
235
+
236
+ **Usage:**
237
+
238
+ - **Buttons:** `rounded-md` (12px)
239
+ - **Cards:** `rounded-lg` (24px)
240
+ - **Inputs:** `rounded-md` (12px)
241
+ - **Pills/Badges:** `rounded-full`
242
+
243
+ ### Shadows
244
+
245
+ ```css
246
+ --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
247
+ --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
248
+ --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
249
+ ```
250
+
251
+ **Usage:**
252
+
253
+ - **Cards:** `shadow-md`
254
+ - **Dropdowns:** `shadow-lg`
255
+ - **Buttons:** `shadow-sm` (hover)
256
+
257
+ ---
258
+
259
+ ## 3. Feature 2-4: Developer UX Design
260
+
261
+ ### Hook API Design
262
+
263
+ **Goal:** Beautiful, simple, powerful API that developers love to use.
264
+
265
+ **Core Principles:**
266
+
267
+ 1. **Familiar** - Match Convex hook ergonomics
268
+ 2. **Type-Safe** - Full TypeScript inference
269
+ 3. **Consistent** - Same pattern everywhere
270
+ 4. **Predictable** - Loading/error states identical
271
+ 5. **Discoverable** - IntelliSense provides great suggestions
272
+
273
+ ### Hook Return Type Pattern
274
+
275
+ **Query Hooks:**
276
+
277
+ ```typescript
278
+ interface QueryResult<T> {
279
+ data: T | null; // Query result (null during loading)
280
+ loading: boolean; // Boolean loading state
281
+ error: Error | null; // Error object or null
282
+ refetch: () => void; // Manual refetch function
283
+ }
284
+ ```
285
+
286
+ **Mutation Hooks:**
287
+
288
+ ```typescript
289
+ interface MutationResult<T> {
290
+ mutate: (...args: any[]) => Promise<T>; // Async mutation function
291
+ loading: boolean; // Boolean loading state
292
+ error: Error | null; // Error object or null
293
+ reset: () => void; // Clear error state
294
+ }
295
+ ```
296
+
297
+ ### Developer Experience Examples
298
+
299
+ **Example 1: Simple Query (Minimal Code)**
300
+
301
+ ```typescript
302
+ // Minimal code, maximum clarity
303
+ const { data: courses, loading, error } = useThings({ type: 'course' });
304
+
305
+ if (loading) return <LoadingSkeleton />;
306
+ if (error) return <ErrorMessage error={error} />;
307
+
308
+ return courses.map(course => <CourseCard course={course} />);
309
+ ```
310
+
311
+ **Example 2: Mutation with Toast**
312
+
313
+ ```typescript
314
+ const { mutate: createCourse, loading } = useCreateThing();
315
+
316
+ async function handleSubmit(data) {
317
+ try {
318
+ await createCourse({ type: 'course', ...data });
319
+ toast.success('Course created!');
320
+ } catch (error) {
321
+ toast.error(error.message);
322
+ }
323
+ }
324
+ ```
325
+
326
+ **Example 3: Optimistic Updates**
327
+
328
+ ```typescript
329
+ const { mutate: updateCourse } = useUpdateThing();
330
+
331
+ // UI updates immediately, rollback on error
332
+ await updateCourse({
333
+ id: courseId,
334
+ name: 'Updated Name'
335
+ }, {
336
+ optimistic: true
337
+ });
338
+ ```
339
+
340
+ ### Error Message Taxonomy
341
+
342
+ **Typed Errors with Helpful Messages:**
343
+
344
+ ```typescript
345
+ type DataProviderError =
346
+ | { _tag: 'NotFoundError'; message: string; suggestion: string }
347
+ | { _tag: 'UnauthorizedError'; message: string; suggestion: string }
348
+ | { _tag: 'ValidationError'; message: string; field: string }
349
+ | { _tag: 'NetworkError'; message: string; retryable: boolean };
350
+
351
+ // Usage in component
352
+ if (error?._tag === 'NotFoundError') {
353
+ return (
354
+ <Alert variant="info">
355
+ <AlertTitle>No courses found</AlertTitle>
356
+ <AlertDescription>
357
+ {error.message}
358
+ <Button onClick={() => navigate('/create')}>
359
+ {error.suggestion}
360
+ </Button>
361
+ </AlertDescription>
362
+ </Alert>
363
+ );
364
+ }
365
+ ```
366
+
367
+ ### TypeScript IntelliSense Design
368
+
369
+ **Auto-complete on Hook Arguments:**
370
+
371
+ ```typescript
372
+ // IntelliSense shows: type, status, organizationId
373
+ useThings({
374
+ type: '|' // <- Autocomplete shows all 66 entity types
375
+ status: '|' // <- Autocomplete shows: draft, active, published, archived
376
+ });
377
+ ```
378
+
379
+ **Type Inference on Results:**
380
+
381
+ ```typescript
382
+ // TypeScript infers correct type from filter
383
+ const { data: courses } = useThings({ type: 'course' });
384
+ // courses: Thing[] with properties specific to 'course'
385
+ ```
386
+
387
+ ### Loading State Patterns
388
+
389
+ **Pattern 1: Skeleton Loader**
390
+
391
+ ```typescript
392
+ if (loading) {
393
+ return (
394
+ <div className="space-y-4">
395
+ <Skeleton className="h-12 w-full" />
396
+ <Skeleton className="h-12 w-full" />
397
+ <Skeleton className="h-12 w-full" />
398
+ </div>
399
+ );
400
+ }
401
+ ```
402
+
403
+ **Pattern 2: Spinner**
404
+
405
+ ```typescript
406
+ if (loading) {
407
+ return (
408
+ <div className="flex justify-center p-8">
409
+ <Loader2 className="h-6 w-6 animate-spin text-muted-foreground" />
410
+ </div>
411
+ );
412
+ }
413
+ ```
414
+
415
+ **Pattern 3: Button Loading**
416
+
417
+ ```tsx
418
+ <Button disabled={loading}>
419
+ {loading ? (
420
+ <>
421
+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />
422
+ Creating...
423
+ </>
424
+ ) : (
425
+ 'Create Course'
426
+ )}
427
+ </Button>
428
+ ```
429
+
430
+ ---
431
+
432
+ ## 4. Feature 2-5: Auth Component Design
433
+
434
+ ### Component Overview
435
+
436
+ **6 Authentication Components:**
437
+
438
+ 1. LoginForm (Email/Password)
439
+ 2. SignupForm (Email/Password)
440
+ 3. OAuthButtons (GitHub, Google)
441
+ 4. MagicLinkForm (Request + Authenticate)
442
+ 5. PasswordResetForm (Request + Complete)
443
+ 6. TwoFactorSettings (Setup + Verify)
444
+
445
+ ### Design Tokens for Auth
446
+
447
+ ```css
448
+ /* Auth-specific colors */
449
+ --color-auth-success: 142 76% 36%;
450
+ --color-auth-error: 0 84% 60%;
451
+ --color-auth-warning: 38 92% 50%;
452
+ --color-auth-info: 199 89% 48%;
453
+
454
+ /* OAuth provider colors */
455
+ --color-github: 0 0% 13%;
456
+ --color-google: 4 90% 58%;
457
+ --color-apple: 0 0% 0%;
458
+ ```
459
+
460
+ ### 1. LoginForm Component
461
+
462
+ **Wireframe:**
463
+
464
+ ```
465
+ ┌─────────────────────────────────────────────────┐
466
+ │ │
467
+ │ Welcome Back │
468
+ │ Sign in to your account │
469
+ │ │
470
+ │ ┌───────────────────────────────────────────┐ │
471
+ │ │ Email │ │
472
+ │ │ your@email.com │ │
473
+ │ └───────────────────────────────────────────┘ │
474
+ │ │
475
+ │ ┌───────────────────────────────────────────┐ │
476
+ │ │ Password Forgot password?│ │
477
+ │ │ •••••••••• │ │
478
+ │ └───────────────────────────────────────────┘ │
479
+ │ │
480
+ │ ┌───────────────────────────────────────────┐ │
481
+ │ │ Sign In │ │
482
+ │ └───────────────────────────────────────────┘ │
483
+ │ │
484
+ │ ────────── OR ────────── │
485
+ │ │
486
+ │ ┌─────────────────┐ ┌─────────────────┐ │
487
+ │ │ [GitHub logo] │ │ [Google logo] │ │
488
+ │ │ Sign in with │ │ Sign in with │ │
489
+ │ │ GitHub │ │ Google │ │
490
+ │ └─────────────────┘ └─────────────────┘ │
491
+ │ │
492
+ │ Don't have an account? Sign up │
493
+ │ │
494
+ └─────────────────────────────────────────────────┘
495
+ ```
496
+
497
+ **Component States:**
498
+
499
+ ```typescript
500
+ interface LoginFormState {
501
+ email: string;
502
+ password: string;
503
+ loading: boolean;
504
+ error: AuthError | null;
505
+ }
506
+
507
+ // States to design:
508
+ // 1. Default (empty fields)
509
+ // 2. Typing (focus state)
510
+ // 3. Loading (button disabled, spinner)
511
+ // 4. Error (red border, error message)
512
+ // 5. Success (green checkmark, redirect)
513
+ ```
514
+
515
+ **Implementation Example:**
516
+
517
+ ```tsx
518
+ <Card className="w-full max-w-md">
519
+ <CardHeader>
520
+ <CardTitle className="text-2xl font-bold text-center">
521
+ Welcome Back
522
+ </CardTitle>
523
+ <CardDescription className="text-center">
524
+ Sign in to your account
525
+ </CardDescription>
526
+ </CardHeader>
527
+ <CardContent>
528
+ <form onSubmit={handleSubmit} className="space-y-4">
529
+ <div className="space-y-2">
530
+ <Label htmlFor="email">Email</Label>
531
+ <Input
532
+ id="email"
533
+ type="email"
534
+ placeholder="your@email.com"
535
+ value={email}
536
+ onChange={(e) => setEmail(e.target.value)}
537
+ required
538
+ className={cn(
539
+ "transition-colors",
540
+ error && "border-destructive focus:ring-destructive"
541
+ )}
542
+ />
543
+ </div>
544
+
545
+ <div className="space-y-2">
546
+ <div className="flex items-center justify-between">
547
+ <Label htmlFor="password">Password</Label>
548
+ <Link
549
+ href="/account/forgot-password"
550
+ className="text-xs text-primary hover:underline"
551
+ >
552
+ Forgot password?
553
+ </Link>
554
+ </div>
555
+ <Input
556
+ id="password"
557
+ type="password"
558
+ placeholder="••••••••••"
559
+ value={password}
560
+ onChange={(e) => setPassword(e.target.value)}
561
+ required
562
+ />
563
+ </div>
564
+
565
+ {error && (
566
+ <Alert variant="destructive">
567
+ <AlertCircle className="h-4 w-4" />
568
+ <AlertDescription>{error.message}</AlertDescription>
569
+ </Alert>
570
+ )}
571
+
572
+ <Button type="submit" className="w-full" disabled={loading}>
573
+ {loading ? (
574
+ <>
575
+ <Loader2 className="mr-2 h-4 w-4 animate-spin" />
576
+ Signing in...
577
+ </>
578
+ ) : (
579
+ 'Sign In'
580
+ )}
581
+ </Button>
582
+
583
+ <div className="relative">
584
+ <div className="absolute inset-0 flex items-center">
585
+ <span className="w-full border-t border-border" />
586
+ </div>
587
+ <div className="relative flex justify-center text-xs uppercase">
588
+ <span className="bg-card px-2 text-muted-foreground">
589
+ Or continue with
590
+ </span>
591
+ </div>
592
+ </div>
593
+
594
+ <div className="grid grid-cols-2 gap-4">
595
+ <Button variant="outline" type="button">
596
+ <Github className="mr-2 h-4 w-4" />
597
+ GitHub
598
+ </Button>
599
+ <Button variant="outline" type="button">
600
+ <Mail className="mr-2 h-4 w-4" />
601
+ Google
602
+ </Button>
603
+ </div>
604
+ </form>
605
+ </CardContent>
606
+ <CardFooter className="flex justify-center">
607
+ <p className="text-sm text-muted-foreground">
608
+ Don't have an account?{' '}
609
+ <Link href="/account/signup" className="text-primary hover:underline">
610
+ Sign up
611
+ </Link>
612
+ </p>
613
+ </CardFooter>
614
+ </Card>
615
+ ```
616
+
617
+ ### 2. SignupForm Component
618
+
619
+ **Wireframe:**
620
+
621
+ ```
622
+ ┌─────────────────────────────────────────────────┐
623
+ │ │
624
+ │ Create Account │
625
+ │ Sign up to get started │
626
+ │ │
627
+ │ ┌───────────────────────────────────────────┐ │
628
+ │ │ Name (optional) │ │
629
+ │ │ Your name │ │
630
+ │ └───────────────────────────────────────────┘ │
631
+ │ │
632
+ │ ┌───────────────────────────────────────────┐ │
633
+ │ │ Email │ │
634
+ │ │ your@email.com │ │
635
+ │ └───────────────────────────────────────────┘ │
636
+ │ │
637
+ │ ┌───────────────────────────────────────────┐ │
638
+ │ │ Password │ │
639
+ │ │ •••••••••• │ │
640
+ │ └───────────────────────────────────────────┘ │
641
+ │ │
642
+ │ Password strength: ▓▓▓▓░░░░ Medium │
643
+ │ • At least 8 characters │
644
+ │ • Include numbers and letters │
645
+ │ │
646
+ │ ┌───────────────────────────────────────────┐ │
647
+ │ │ Sign Up │ │
648
+ │ └───────────────────────────────────────────┘ │
649
+ │ │
650
+ │ Already have an account? Sign in │
651
+ │ │
652
+ └─────────────────────────────────────────────────┘
653
+ ```
654
+
655
+ **Password Strength Indicator:**
656
+
657
+ ```tsx
658
+ <div className="space-y-2">
659
+ <div className="flex items-center gap-2">
660
+ <div className="flex-1 h-2 bg-muted rounded-full overflow-hidden">
661
+ <div
662
+ className={cn(
663
+ "h-full transition-all duration-300",
664
+ strength === 'weak' && "w-1/4 bg-destructive",
665
+ strength === 'medium' && "w-2/4 bg-warning",
666
+ strength === 'strong' && "w-3/4 bg-success",
667
+ strength === 'very-strong' && "w-full bg-success"
668
+ )}
669
+ />
670
+ </div>
671
+ <span className="text-xs font-medium">
672
+ {strength.charAt(0).toUpperCase() + strength.slice(1)}
673
+ </span>
674
+ </div>
675
+ <ul className="text-xs text-muted-foreground space-y-1">
676
+ <li className={cn(password.length >= 8 && "text-success")}>
677
+ • At least 8 characters
678
+ </li>
679
+ <li className={cn(/\d/.test(password) && "text-success")}>
680
+ • Include numbers
681
+ </li>
682
+ <li className={cn(/[A-Z]/.test(password) && "text-success")}>
683
+ • Include uppercase letters
684
+ </li>
685
+ </ul>
686
+ </div>
687
+ ```
688
+
689
+ ### 3. OAuthButtons Component
690
+
691
+ **Wireframe:**
692
+
693
+ ```
694
+ ┌─────────────────────────────────────────┐
695
+ │ │
696
+ │ ┌─────────────────────────────────┐ │
697
+ │ │ [GitHub Icon] Sign in with │ │
698
+ │ │ GitHub │ │
699
+ │ └─────────────────────────────────┘ │
700
+ │ │
701
+ │ ┌─────────────────────────────────┐ │
702
+ │ │ [Google Icon] Sign in with │ │
703
+ │ │ Google │ │
704
+ │ └─────────────────────────────────┘ │
705
+ │ │
706
+ │ ┌─────────────────────────────────┐ │
707
+ │ │ [Apple Icon] Sign in with │ │
708
+ │ │ Apple │ │
709
+ │ └─────────────────────────────────┘ │
710
+ │ │
711
+ └─────────────────────────────────────────┘
712
+ ```
713
+
714
+ **Implementation:**
715
+
716
+ ```tsx
717
+ <div className="grid gap-3">
718
+ <Button
719
+ variant="outline"
720
+ className="w-full"
721
+ onClick={() => handleOAuth('github')}
722
+ >
723
+ <Github className="mr-2 h-4 w-4" />
724
+ Continue with GitHub
725
+ </Button>
726
+
727
+ <Button
728
+ variant="outline"
729
+ className="w-full"
730
+ onClick={() => handleOAuth('google')}
731
+ >
732
+ <svg className="mr-2 h-4 w-4" viewBox="0 0 24 24">
733
+ {/* Google logo SVG */}
734
+ </svg>
735
+ Continue with Google
736
+ </Button>
737
+
738
+ <Button
739
+ variant="outline"
740
+ className="w-full"
741
+ onClick={() => handleOAuth('apple')}
742
+ >
743
+ <Apple className="mr-2 h-4 w-4" />
744
+ Continue with Apple
745
+ </Button>
746
+ </div>
747
+ ```
748
+
749
+ ### 4. PasswordResetForm Component
750
+
751
+ **Wireframe (Request):**
752
+
753
+ ```
754
+ ┌─────────────────────────────────────────────────┐
755
+ │ │
756
+ │ Forgot your password? │
757
+ │ Enter your email to receive reset │
758
+ │ instructions │
759
+ │ │
760
+ │ ┌───────────────────────────────────────────┐ │
761
+ │ │ Email │ │
762
+ │ │ your@email.com │ │
763
+ │ └───────────────────────────────────────────┘ │
764
+ │ │
765
+ │ ┌───────────────────────────────────────────┐ │
766
+ │ │ Send reset email │ │
767
+ │ └───────────────────────────────────────────┘ │
768
+ │ │
769
+ │ Back to sign in │
770
+ │ │
771
+ └─────────────────────────────────────────────────┘
772
+ ```
773
+
774
+ **Wireframe (Success State):**
775
+
776
+ ```
777
+ ┌─────────────────────────────────────────────────┐
778
+ │ │
779
+ │ ✓ Check your email │
780
+ │ │
781
+ │ We've sent password reset instructions to: │
782
+ │ your@email.com │
783
+ │ │
784
+ │ If you don't see the email, check your │
785
+ │ spam folder. │
786
+ │ │
787
+ │ ┌───────────────────────────────────────────┐ │
788
+ │ │ Try another email │ │
789
+ │ └───────────────────────────────────────────┘ │
790
+ │ │
791
+ └─────────────────────────────────────────────────┘
792
+ ```
793
+
794
+ ### 5. TwoFactorSettings Component
795
+
796
+ **Wireframe (Setup):**
797
+
798
+ ```
799
+ ┌─────────────────────────────────────────────────┐
800
+ │ │
801
+ │ Setup Two-Factor Authentication │
802
+ │ │
803
+ │ Step 1: Scan QR Code │
804
+ │ ┌─────────────────────┐ │
805
+ │ │ │ │
806
+ │ │ [QR CODE IMAGE] │ │
807
+ │ │ │ │
808
+ │ └─────────────────────┘ │
809
+ │ │
810
+ │ Or enter this code manually: │
811
+ │ ┌───────────────────────────────────────────┐ │
812
+ │ │ ABCD-EFGH-IJKL-MNOP [Copy] │ │
813
+ │ └───────────────────────────────────────────┘ │
814
+ │ │
815
+ │ Step 2: Enter verification code │
816
+ │ ┌───────────────────────────────────────────┐ │
817
+ │ │ 123456 │ │
818
+ │ └───────────────────────────────────────────┘ │
819
+ │ │
820
+ │ ┌───────────────────────────────────────────┐ │
821
+ │ │ Verify and Enable │ │
822
+ │ └───────────────────────────────────────────┘ │
823
+ │ │
824
+ │ Backup Codes (Save these securely): │
825
+ │ • 1234-5678-9012 │
826
+ │ • 3456-7890-1234 │
827
+ │ • 5678-9012-3456 │
828
+ │ │
829
+ └─────────────────────────────────────────────────┘
830
+ ```
831
+
832
+ ### 6. MagicLinkForm Component
833
+
834
+ **Wireframe (Request):**
835
+
836
+ ```
837
+ ┌─────────────────────────────────────────────────┐
838
+ │ │
839
+ │ Sign in with Magic Link │
840
+ │ No password required │
841
+ │ │
842
+ │ ┌───────────────────────────────────────────┐ │
843
+ │ │ Email │ │
844
+ │ │ your@email.com │ │
845
+ │ └───────────────────────────────────────────┘ │
846
+ │ │
847
+ │ ┌───────────────────────────────────────────┐ │
848
+ │ │ Send magic link │ │
849
+ │ └───────────────────────────────────────────┘ │
850
+ │ │
851
+ │ Back to sign in │
852
+ │ │
853
+ └─────────────────────────────────────────────────┘
854
+ ```
855
+
856
+ **Wireframe (Authenticating):**
857
+
858
+ ```
859
+ ┌─────────────────────────────────────────────────┐
860
+ │ │
861
+ │ Signing you in... │
862
+ │ │
863
+ │ [Spinner animation] │
864
+ │ │
865
+ │ Please wait while we authenticate your │
866
+ │ magic link │
867
+ │ │
868
+ └─────────────────────────────────────────────────┘
869
+ ```
870
+
871
+ ---
872
+
873
+ ## 5. Feature 2-6: Dashboard Component Design
874
+
875
+ ### Component Overview
876
+
877
+ **5 Dashboard Components:**
878
+
879
+ 1. DashboardOverview (Analytics + Stats)
880
+ 2. CourseList (Entity List)
881
+ 3. CourseDetail (Entity Detail)
882
+ 4. ActivityFeed (Event Stream)
883
+ 5. SearchBar (Full-text Search)
884
+
885
+ ### Design Tokens for Dashboard
886
+
887
+ ```css
888
+ /* Chart colors */
889
+ --color-chart-1: 216 55% 25%;
890
+ --color-chart-2: 105 22% 32%;
891
+ --color-chart-3: 219 14% 40%;
892
+ --color-chart-4: 36 8% 55%;
893
+ --color-chart-5: 0 0% 13%;
894
+
895
+ /* Status colors */
896
+ --color-status-draft: 219 14% 92%;
897
+ --color-status-active: 142 76% 36%;
898
+ --color-status-published: 199 89% 48%;
899
+ --color-status-archived: 0 0% 60%;
900
+ ```
901
+
902
+ ### 1. DashboardOverview Component
903
+
904
+ **Wireframe:**
905
+
906
+ ```
907
+ ┌────────────────────────────────────────────────────────────────┐
908
+ │ │
909
+ │ Dashboard [User Menu] │
910
+ │ │
911
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
912
+ │ │ Courses │ │ Students │ │ Active │ │ Revenue │ │
913
+ │ │ 24 │ │ 156 │ │ 89 │ │ $12,450 │ │
914
+ │ │ +12% │ │ +8% │ │ +15% │ │ +23% │ │
915
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
916
+ │ │
917
+ │ ┌────────────────────────┐ ┌────────────────────────┐ │
918
+ │ │ Activity Over Time │ │ Revenue Charts │ │
919
+ │ │ │ │ │ │
920
+ │ │ [Line Chart] │ │ [Bar Chart] │ │
921
+ │ │ │ │ │ │
922
+ │ └────────────────────────┘ └────────────────────────┘ │
923
+ │ │
924
+ │ Recent Transactions │
925
+ │ ┌──────────────────────────────────────────────────────────┐│
926
+ │ │ Date │ Amount │ Type │ From │ Status ││
927
+ │ ├──────────────────────────────────────────────────────────┤│
928
+ │ │ Oct 13 │ $450 │ Purchase │ John Doe │ ✓ ││
929
+ │ │ Oct 12 │ $280 │ Purchase │ Jane Smith│ ✓ ││
930
+ │ │ Oct 12 │ $125 │ Refund │ Bob Jones │ ⟳ ││
931
+ │ └──────────────────────────────────────────────────────────┘│
932
+ │ │
933
+ └────────────────────────────────────────────────────────────────┘
934
+ ```
935
+
936
+ **Stats Card Component:**
937
+
938
+ ```tsx
939
+ <Card>
940
+ <CardHeader className="flex flex-row items-center justify-between pb-2">
941
+ <CardTitle className="text-sm font-medium">Total Courses</CardTitle>
942
+ <BookOpen className="h-4 w-4 text-muted-foreground" />
943
+ </CardHeader>
944
+ <CardContent>
945
+ <div className="text-2xl font-bold">24</div>
946
+ <p className="text-xs text-muted-foreground">
947
+ <span className="text-success">+12%</span> from last month
948
+ </p>
949
+ </CardContent>
950
+ </Card>
951
+ ```
952
+
953
+ ### 2. CourseList Component
954
+
955
+ **Wireframe (List View):**
956
+
957
+ ```
958
+ ┌────────────────────────────────────────────────────────────────┐
959
+ │ │
960
+ │ Courses [+ New Course] │
961
+ │ ┌──────────┐ Grid List [Search] │
962
+ │ │
963
+ │ ┌──────────────────────────────────────────────────────────┐ │
964
+ │ │ [Image] Introduction to React │ │
965
+ │ │ Learn React fundamentals │ │
966
+ │ │ Published • 156 students • 4.8★ │ │
967
+ │ │ [Edit] [Delete] │ │
968
+ │ └──────────────────────────────────────────────────────────┘ │
969
+ │ │
970
+ │ ┌──────────────────────────────────────────────────────────┐ │
971
+ │ │ [Image] Advanced TypeScript │ │
972
+ │ │ Master TypeScript patterns │ │
973
+ │ │ Draft • 0 students │ │
974
+ │ │ [Edit] [Delete] │ │
975
+ │ └──────────────────────────────────────────────────────────┘ │
976
+ │ │
977
+ │ [Load More] │
978
+ │ │
979
+ └────────────────────────────────────────────────────────────────┘
980
+ ```
981
+
982
+ **Wireframe (Grid View):**
983
+
984
+ ```
985
+ ┌────────────────────────────────────────────────────────────────┐
986
+ │ │
987
+ │ Courses [+ New Course] │
988
+ │ Grid ┌──────────┐ List [Search] │
989
+ │ │
990
+ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
991
+ │ │ [Image] │ │ [Image] │ │ [Image] │ │
992
+ │ │ │ │ │ │ │ │
993
+ │ │ React Basics │ │ TypeScript │ │ Node.js │ │
994
+ │ │ Published │ │ Draft │ │ Published │ │
995
+ │ │ 156 students │ │ 0 students │ │ 89 students │ │
996
+ │ │ 4.8★ │ │ │ │ 4.9★ │ │
997
+ │ └──────────────┘ └──────────────┘ └──────────────┘ │
998
+ │ │
999
+ └────────────────────────────────────────────────────────────────┘
1000
+ ```
1001
+
1002
+ **Loading State:**
1003
+
1004
+ ```tsx
1005
+ <div className="space-y-4">
1006
+ {[...Array(3)].map((_, i) => (
1007
+ <Card key={i}>
1008
+ <CardHeader className="flex flex-row items-center gap-4">
1009
+ <Skeleton className="h-16 w-16 rounded-md" />
1010
+ <div className="flex-1 space-y-2">
1011
+ <Skeleton className="h-4 w-3/4" />
1012
+ <Skeleton className="h-3 w-1/2" />
1013
+ </div>
1014
+ </CardHeader>
1015
+ </Card>
1016
+ ))}
1017
+ </div>
1018
+ ```
1019
+
1020
+ ### 3. CourseDetail Component
1021
+
1022
+ **Wireframe:**
1023
+
1024
+ ```
1025
+ ┌────────────────────────────────────────────────────────────────┐
1026
+ │ │
1027
+ │ ← Back to Courses │
1028
+ │ │
1029
+ │ Introduction to React [Edit] [•••] │
1030
+ │ Published • Created Oct 1, 2024 │
1031
+ │ │
1032
+ │ ┌────────────────────────┐ ┌──────────────────────────┐ │
1033
+ │ │ │ │ Details │ │
1034
+ │ │ [Course Image] │ │ Status: Published │ │
1035
+ │ │ │ │ Students: 156 │ │
1036
+ │ │ │ │ Rating: 4.8★ │ │
1037
+ │ └────────────────────────┘ │ Created: Oct 1, 2024 │ │
1038
+ │ │ Updated: Oct 13, 2024 │ │
1039
+ │ Description └──────────────────────────┘ │
1040
+ │ Learn the fundamentals of React including... │
1041
+ │ │
1042
+ │ Lessons (8) │
1043
+ │ ┌──────────────────────────────────────────────────────────┐ │
1044
+ │ │ 1. Introduction to React [Published] 30 min │ │
1045
+ │ │ 2. Components and Props [Published] 45 min │ │
1046
+ │ │ 3. State and Lifecycle [Draft] 60 min │ │
1047
+ │ └──────────────────────────────────────────────────────────┘ │
1048
+ │ │
1049
+ │ Enrolled Students (156) │
1050
+ │ ┌──────────────────────────────────────────────────────────┐ │
1051
+ │ │ [Avatar] John Doe Enrolled: Oct 5 Progress: 60% │ │
1052
+ │ │ [Avatar] Jane Smith Enrolled: Oct 6 Progress: 45% │ │
1053
+ │ └──────────────────────────────────────────────────────────┘ │
1054
+ │ │
1055
+ └────────────────────────────────────────────────────────────────┘
1056
+ ```
1057
+
1058
+ ### 4. ActivityFeed Component
1059
+
1060
+ **Wireframe:**
1061
+
1062
+ ```
1063
+ ┌────────────────────────────────────────────────────────────────┐
1064
+ │ │
1065
+ │ Recent Activity [Filter: All ▼] │
1066
+ │ │
1067
+ │ Today │
1068
+ │ ┌──────────────────────────────────────────────────────────┐ │
1069
+ │ │ [Icon] John Doe enrolled in Introduction to React │ │
1070
+ │ │ 2 minutes ago │ │
1071
+ │ └──────────────────────────────────────────────────────────┘ │
1072
+ │ │
1073
+ │ ┌──────────────────────────────────────────────────────────┐ │
1074
+ │ │ [Icon] You published "Advanced TypeScript" │ │
1075
+ │ │ 1 hour ago │ │
1076
+ │ └──────────────────────────────────────────────────────────┘ │
1077
+ │ │
1078
+ │ Yesterday │
1079
+ │ ┌──────────────────────────────────────────────────────────┐ │
1080
+ │ │ [Icon] Jane Smith completed "React Basics" lesson │ │
1081
+ │ │ Yesterday at 3:45 PM │ │
1082
+ │ └──────────────────────────────────────────────────────────┘ │
1083
+ │ │
1084
+ │ [Load More] │
1085
+ │ │
1086
+ └────────────────────────────────────────────────────────────────┘
1087
+ ```
1088
+
1089
+ **Event Card Component:**
1090
+
1091
+ ```tsx
1092
+ <Card>
1093
+ <CardContent className="flex items-start gap-4 p-4">
1094
+ <div className={cn(
1095
+ "rounded-full p-2",
1096
+ eventType === 'enrolled' && "bg-primary/10 text-primary",
1097
+ eventType === 'completed' && "bg-success/10 text-success",
1098
+ eventType === 'created' && "bg-accent/10 text-accent"
1099
+ )}>
1100
+ {getEventIcon(eventType)}
1101
+ </div>
1102
+ <div className="flex-1">
1103
+ <p className="text-sm">{event.description}</p>
1104
+ <p className="text-xs text-muted-foreground mt-1">
1105
+ {formatDistanceToNow(event.timestamp)} ago
1106
+ </p>
1107
+ </div>
1108
+ </CardContent>
1109
+ </Card>
1110
+ ```
1111
+
1112
+ ### 5. SearchBar Component
1113
+
1114
+ **Wireframe:**
1115
+
1116
+ ```
1117
+ ┌────────────────────────────────────────────────────────────────┐
1118
+ │ │
1119
+ │ ┌──────────────────────────────────────────────────────────┐ │
1120
+ │ │ [🔍] Search courses, lessons, students... [Cmd+K] │ │
1121
+ │ └──────────────────────────────────────────────────────────┘ │
1122
+ │ │
1123
+ │ [Dropdown appears on focus/typing] │
1124
+ │ ┌──────────────────────────────────────────────────────────┐ │
1125
+ │ │ Recent Searches │ │
1126
+ │ │ • Introduction to React │ │
1127
+ │ │ • TypeScript basics │ │
1128
+ │ │ │ │
1129
+ │ │ Courses (3) │ │
1130
+ │ │ [Icon] Introduction to React │ │
1131
+ │ │ [Icon] Advanced TypeScript │ │
1132
+ │ │ [Icon] Node.js Fundamentals │ │
1133
+ │ │ │ │
1134
+ │ │ Students (2) │ │
1135
+ │ │ [Avatar] John Doe │ │
1136
+ │ │ [Avatar] Jane Smith │ │
1137
+ │ └──────────────────────────────────────────────────────────┘ │
1138
+ │ │
1139
+ └────────────────────────────────────────────────────────────────┘
1140
+ ```
1141
+
1142
+ **Implementation:**
1143
+
1144
+ ```tsx
1145
+ <Command className="rounded-lg border shadow-md">
1146
+ <CommandInput placeholder="Search courses, lessons, students..." />
1147
+ <CommandList>
1148
+ <CommandEmpty>No results found.</CommandEmpty>
1149
+
1150
+ <CommandGroup heading="Recent Searches">
1151
+ {recentSearches.map(search => (
1152
+ <CommandItem key={search} onSelect={() => handleSearch(search)}>
1153
+ <Clock className="mr-2 h-4 w-4" />
1154
+ {search}
1155
+ </CommandItem>
1156
+ ))}
1157
+ </CommandGroup>
1158
+
1159
+ <CommandSeparator />
1160
+
1161
+ <CommandGroup heading="Courses">
1162
+ {courses.map(course => (
1163
+ <CommandItem key={course._id} onSelect={() => navigate(`/courses/${course._id}`)}>
1164
+ <BookOpen className="mr-2 h-4 w-4" />
1165
+ {course.name}
1166
+ </CommandItem>
1167
+ ))}
1168
+ </CommandGroup>
1169
+
1170
+ <CommandSeparator />
1171
+
1172
+ <CommandGroup heading="Students">
1173
+ {students.map(student => (
1174
+ <CommandItem key={student._id}>
1175
+ <User className="mr-2 h-4 w-4" />
1176
+ {student.name}
1177
+ </CommandItem>
1178
+ ))}
1179
+ </CommandGroup>
1180
+ </CommandList>
1181
+ </Command>
1182
+ ```
1183
+
1184
+ ---
1185
+
1186
+ ## 6. Accessibility Specifications
1187
+
1188
+ ### WCAG 2.1 AA Requirements
1189
+
1190
+ **Color Contrast:**
1191
+
1192
+ ```css
1193
+ /* Body text: 4.5:1 minimum */
1194
+ background: hsl(36 8% 88%); /* Light */
1195
+ foreground: hsl(0 0% 13%); /* Dark */
1196
+ contrast-ratio: 11.8:1; /* ✓ Pass */
1197
+
1198
+ /* Large text (≥18px): 3:1 minimum */
1199
+ primary: hsl(216 55% 25%);
1200
+ background: hsl(36 8% 88%);
1201
+ contrast-ratio: 7.2:1; /* ✓ Pass */
1202
+
1203
+ /* Dark mode */
1204
+ background: hsl(0 0% 13%);
1205
+ foreground: hsl(36 8% 96%);
1206
+ contrast-ratio: 13.5:1; /* ✓ Pass */
1207
+ ```
1208
+
1209
+ **Keyboard Navigation:**
1210
+
1211
+ ```tsx
1212
+ // Tab order
1213
+ <form>
1214
+ <Input tabIndex={1} /> {/* First */}
1215
+ <Input tabIndex={2} /> {/* Second */}
1216
+ <Button tabIndex={3}> {/* Third */}
1217
+ Submit
1218
+ </Button>
1219
+ </form>
1220
+
1221
+ // Skip to main content
1222
+ <a
1223
+ href="#main-content"
1224
+ className="sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 focus:z-50"
1225
+ >
1226
+ Skip to main content
1227
+ </a>
1228
+ ```
1229
+
1230
+ **Focus Indicators:**
1231
+
1232
+ ```css
1233
+ *:focus-visible {
1234
+ outline: 2px solid hsl(var(--color-ring));
1235
+ outline-offset: 2px;
1236
+ border-radius: 0.125rem;
1237
+ }
1238
+
1239
+ /* Ensure visible even on dark backgrounds */
1240
+ .dark *:focus-visible {
1241
+ outline-color: hsl(var(--color-ring));
1242
+ outline-width: 2px;
1243
+ }
1244
+ ```
1245
+
1246
+ **ARIA Labels:**
1247
+
1248
+ ```tsx
1249
+ // Form inputs
1250
+ <Label htmlFor="email">Email</Label>
1251
+ <Input
1252
+ id="email"
1253
+ type="email"
1254
+ aria-required="true"
1255
+ aria-invalid={!!error}
1256
+ aria-describedby={error ? "email-error" : undefined}
1257
+ />
1258
+ {error && (
1259
+ <p id="email-error" className="text-sm text-destructive" role="alert">
1260
+ {error}
1261
+ </p>
1262
+ )}
1263
+
1264
+ // Buttons
1265
+ <Button aria-label="Close dialog">
1266
+ <X className="h-4 w-4" />
1267
+ </Button>
1268
+
1269
+ // Loading states
1270
+ <div role="status" aria-live="polite">
1271
+ {loading ? 'Loading...' : 'Loaded'}
1272
+ </div>
1273
+ ```
1274
+
1275
+ **Screen Reader Announcements:**
1276
+
1277
+ ```tsx
1278
+ // Toast notifications
1279
+ toast.success('Course created', {
1280
+ role: 'status',
1281
+ ariaLive: 'polite'
1282
+ });
1283
+
1284
+ // Error announcements
1285
+ <Alert role="alert" aria-live="assertive">
1286
+ <AlertDescription>{error.message}</AlertDescription>
1287
+ </Alert>
1288
+
1289
+ // Loading announcements
1290
+ {loading && (
1291
+ <span className="sr-only" role="status">
1292
+ Loading courses...
1293
+ </span>
1294
+ )}
1295
+ ```
1296
+
1297
+ ---
1298
+
1299
+ ## 7. Responsive Design System
1300
+
1301
+ ### Breakpoints
1302
+
1303
+ ```css
1304
+ /* Mobile First */
1305
+ /* Default: 320px+ */
1306
+
1307
+ @media (min-width: 640px) {
1308
+ /* Small devices (sm:) */
1309
+ }
1310
+
1311
+ @media (min-width: 768px) {
1312
+ /* Tablets (md:) */
1313
+ }
1314
+
1315
+ @media (min-width: 1024px) {
1316
+ /* Desktop (lg:) */
1317
+ }
1318
+
1319
+ @media (min-width: 1280px) {
1320
+ /* Wide (xl:) */
1321
+ }
1322
+
1323
+ @media (min-width: 1536px) {
1324
+ /* Extra wide (2xl:) */
1325
+ }
1326
+ ```
1327
+
1328
+ ### Responsive Patterns
1329
+
1330
+ **Pattern 1: Stack on Mobile, Grid on Desktop**
1331
+
1332
+ ```tsx
1333
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
1334
+ {/* Mobile: 1 column, Tablet: 2 columns, Desktop: 3 columns */}
1335
+ </div>
1336
+ ```
1337
+
1338
+ **Pattern 2: Sidebar Layout**
1339
+
1340
+ ```tsx
1341
+ <div className="flex flex-col lg:flex-row gap-6">
1342
+ <aside className="lg:w-64">
1343
+ {/* Sidebar: Full width on mobile, fixed width on desktop */}
1344
+ </aside>
1345
+ <main className="flex-1">
1346
+ {/* Main content */}
1347
+ </main>
1348
+ </div>
1349
+ ```
1350
+
1351
+ **Pattern 3: Hide/Show Elements**
1352
+
1353
+ ```tsx
1354
+ <div className="hidden md:block">
1355
+ {/* Desktop only */}
1356
+ </div>
1357
+
1358
+ <div className="md:hidden">
1359
+ {/* Mobile only */}
1360
+ </div>
1361
+ ```
1362
+
1363
+ **Pattern 4: Responsive Typography**
1364
+
1365
+ ```tsx
1366
+ <h1 className="text-2xl md:text-3xl lg:text-4xl font-bold">
1367
+ {/* Scales with screen size */}
1368
+ </h1>
1369
+ ```
1370
+
1371
+ **Pattern 5: Responsive Spacing**
1372
+
1373
+ ```tsx
1374
+ <div className="p-4 md:p-6 lg:p-8">
1375
+ {/* More padding on larger screens */}
1376
+ </div>
1377
+ ```
1378
+
1379
+ ### Touch Targets
1380
+
1381
+ **Minimum Size: 44x44px**
1382
+
1383
+ ```tsx
1384
+ <Button className="min-h-[44px] min-w-[44px]">
1385
+ {/* Meets touch target size */}
1386
+ </Button>
1387
+
1388
+ // Icon buttons
1389
+ <Button size="icon" className="h-11 w-11">
1390
+ <X className="h-4 w-4" />
1391
+ </Button>
1392
+ ```
1393
+
1394
+ ---
1395
+
1396
+ ## 8. Animation & Transitions
1397
+
1398
+ ### Principles
1399
+
1400
+ 1. **Purposeful** - Animations provide feedback or guide attention
1401
+ 2. **Fast** - 150-300ms for most transitions
1402
+ 3. **Smooth** - Ease-in-out curves feel natural
1403
+ 4. **Respectful** - Honor prefers-reduced-motion
1404
+
1405
+ ### Transition Timings
1406
+
1407
+ ```css
1408
+ /* Fast: 150ms - Hover states, focus */
1409
+ transition: all 150ms ease-in-out;
1410
+
1411
+ /* Medium: 250ms - Panel slides, dropdowns */
1412
+ transition: all 250ms ease-in-out;
1413
+
1414
+ /* Slow: 350ms - Page transitions, modals */
1415
+ transition: all 350ms ease-in-out;
1416
+ ```
1417
+
1418
+ ### Common Animations
1419
+
1420
+ **Fade In:**
1421
+
1422
+ ```tsx
1423
+ <div className="animate-in fade-in duration-300">
1424
+ {/* Fades in over 300ms */}
1425
+ </div>
1426
+ ```
1427
+
1428
+ **Slide In:**
1429
+
1430
+ ```tsx
1431
+ <div className="animate-in slide-in-from-bottom-4 duration-300">
1432
+ {/* Slides up from bottom */}
1433
+ </div>
1434
+ ```
1435
+
1436
+ **Spinner:**
1437
+
1438
+ ```tsx
1439
+ <Loader2 className="h-4 w-4 animate-spin" />
1440
+ ```
1441
+
1442
+ **Scale on Hover:**
1443
+
1444
+ ```tsx
1445
+ <Card className="transition-transform hover:scale-105">
1446
+ {/* Scales up 5% on hover */}
1447
+ </Card>
1448
+ ```
1449
+
1450
+ **Skeleton Pulse:**
1451
+
1452
+ ```tsx
1453
+ <div className="animate-pulse bg-muted h-4 w-full rounded" />
1454
+ ```
1455
+
1456
+ ### Reduced Motion
1457
+
1458
+ ```css
1459
+ @media (prefers-reduced-motion: reduce) {
1460
+ *,
1461
+ *::before,
1462
+ *::after {
1463
+ animation-duration: 0.01ms !important;
1464
+ animation-iteration-count: 1 !important;
1465
+ transition-duration: 0.01ms !important;
1466
+ }
1467
+ }
1468
+ ```
1469
+
1470
+ ---
1471
+
1472
+ ## 9. Implementation Guidelines
1473
+
1474
+ ### Component Structure
1475
+
1476
+ ```tsx
1477
+ // ✅ GOOD: Clear structure
1478
+ export function CourseList() {
1479
+ // 1. Hooks
1480
+ const { data: courses, loading, error } = useThings({ type: 'course' });
1481
+
1482
+ // 2. Derived state
1483
+ const publishedCourses = courses?.filter(c => c.status === 'published');
1484
+
1485
+ // 3. Event handlers
1486
+ const handleDelete = (id) => { /* ... */ };
1487
+
1488
+ // 4. Early returns
1489
+ if (loading) return <LoadingSkeleton />;
1490
+ if (error) return <ErrorMessage error={error} />;
1491
+ if (!courses?.length) return <EmptyState />;
1492
+
1493
+ // 5. Main render
1494
+ return (
1495
+ <div className="space-y-4">
1496
+ {courses.map(course => (
1497
+ <CourseCard key={course._id} course={course} />
1498
+ ))}
1499
+ </div>
1500
+ );
1501
+ }
1502
+ ```
1503
+
1504
+ ### State Management
1505
+
1506
+ ```tsx
1507
+ // ✅ GOOD: Minimal local state
1508
+ function LoginForm() {
1509
+ const [email, setEmail] = useState('');
1510
+ const [password, setPassword] = useState('');
1511
+ const { mutate: login, loading, error } = useLogin();
1512
+
1513
+ return (/* ... */);
1514
+ }
1515
+
1516
+ // ❌ BAD: Too much state
1517
+ function LoginForm() {
1518
+ const [email, setEmail] = useState('');
1519
+ const [password, setPassword] = useState('');
1520
+ const [loading, setLoading] = useState(false);
1521
+ const [error, setError] = useState(null);
1522
+ const [showPassword, setShowPassword] = useState(false);
1523
+ const [emailValid, setEmailValid] = useState(false);
1524
+ // ... too many useState calls
1525
+ }
1526
+ ```
1527
+
1528
+ ### Error Handling
1529
+
1530
+ ```tsx
1531
+ // ✅ GOOD: User-friendly errors
1532
+ if (error) {
1533
+ return (
1534
+ <Alert variant="destructive">
1535
+ <AlertCircle className="h-4 w-4" />
1536
+ <AlertTitle>Failed to load courses</AlertTitle>
1537
+ <AlertDescription>
1538
+ {error.message}
1539
+ <Button onClick={refetch} variant="outline" className="mt-2">
1540
+ Try Again
1541
+ </Button>
1542
+ </AlertDescription>
1543
+ </Alert>
1544
+ );
1545
+ }
1546
+
1547
+ // ❌ BAD: Generic error
1548
+ if (error) {
1549
+ return <div>Error occurred</div>;
1550
+ }
1551
+ ```
1552
+
1553
+ ### Loading States
1554
+
1555
+ ```tsx
1556
+ // ✅ GOOD: Skeleton that matches content
1557
+ if (loading) {
1558
+ return (
1559
+ <Card>
1560
+ <CardHeader>
1561
+ <Skeleton className="h-6 w-3/4" />
1562
+ <Skeleton className="h-4 w-1/2 mt-2" />
1563
+ </CardHeader>
1564
+ <CardContent>
1565
+ <Skeleton className="h-4 w-full" />
1566
+ <Skeleton className="h-4 w-full mt-2" />
1567
+ </CardContent>
1568
+ </Card>
1569
+ );
1570
+ }
1571
+
1572
+ // ❌ BAD: Generic spinner
1573
+ if (loading) {
1574
+ return <Spinner />;
1575
+ }
1576
+ ```
1577
+
1578
+ ---
1579
+
1580
+ ## 10. Quality Checklist
1581
+
1582
+ ### Design Deliverables
1583
+
1584
+ **Feature 2-4 (React Hooks):**
1585
+
1586
+ - [x] Hook API design specification
1587
+ - [x] TypeScript type design
1588
+ - [x] Error message taxonomy
1589
+ - [x] Loading state patterns
1590
+ - [x] Code examples (10+ scenarios)
1591
+
1592
+ **Feature 2-5 (Auth Components):**
1593
+
1594
+ - [x] LoginForm wireframe + implementation
1595
+ - [x] SignupForm wireframe + implementation
1596
+ - [x] OAuthButtons wireframe + implementation
1597
+ - [x] PasswordResetForm wireframe + implementation
1598
+ - [x] TwoFactorSettings wireframe + implementation
1599
+ - [x] MagicLinkForm wireframe + implementation
1600
+ - [x] Loading state animations
1601
+ - [x] Error state designs
1602
+ - [x] Success feedback designs
1603
+ - [x] Accessibility audit checklist
1604
+
1605
+ **Feature 2-6 (Dashboard Components):**
1606
+
1607
+ - [x] DashboardOverview wireframe + implementation
1608
+ - [x] CourseList wireframe + implementation (list + grid views)
1609
+ - [x] CourseDetail wireframe + implementation
1610
+ - [x] ActivityFeed wireframe + implementation
1611
+ - [x] SearchBar wireframe + implementation
1612
+ - [x] Loading skeleton designs
1613
+ - [x] Empty state designs
1614
+ - [x] Error state designs
1615
+ - [x] Real-time update animations
1616
+
1617
+ ### Design System Compliance
1618
+
1619
+ - [x] All colors use HSL format
1620
+ - [x] All colors wrapped with `hsl()` function
1621
+ - [x] Color contrast ratios meet WCAG AA
1622
+ - [x] Typography scale is consistent
1623
+ - [x] Spacing follows 4px base unit
1624
+ - [x] Border radius is consistent
1625
+ - [x] Shadows are consistent
1626
+ - [x] Dark mode colors defined
1627
+
1628
+ ### Accessibility Compliance
1629
+
1630
+ - [x] Color contrast ≥ 4.5:1 for body text
1631
+ - [x] Color contrast ≥ 3:1 for large text
1632
+ - [x] Keyboard navigation works
1633
+ - [x] Focus indicators visible
1634
+ - [x] ARIA labels on interactive elements
1635
+ - [x] Screen reader announcements
1636
+ - [x] Form labels associated with inputs
1637
+ - [x] Error messages announced
1638
+ - [x] Touch targets ≥ 44x44px
1639
+
1640
+ ### Responsive Design
1641
+
1642
+ - [x] Mobile-first approach (320px+)
1643
+ - [x] Breakpoints defined (sm, md, lg, xl, 2xl)
1644
+ - [x] Layout works on all screen sizes
1645
+ - [x] Touch interactions work
1646
+ - [x] Text scales with zoom
1647
+ - [x] Images are responsive
1648
+
1649
+ ### Implementation Readiness
1650
+
1651
+ - [x] Wireframes complete with ASCII art
1652
+ - [x] Design tokens defined
1653
+ - [x] Component states specified
1654
+ - [x] Code examples provided
1655
+ - [x] Tailwind v4 syntax correct
1656
+ - [x] shadcn/ui components used
1657
+ - [x] Dark mode support complete
1658
+
1659
+ ### Testing Readiness
1660
+
1661
+ - [x] Loading states can be tested
1662
+ - [x] Error states can be tested
1663
+ - [x] Success states can be tested
1664
+ - [x] Empty states can be tested
1665
+ - [x] Accessibility can be validated
1666
+
1667
+ ---
1668
+
1669
+ ## Related Files
1670
+
1671
+ - **Plan:** `one/things/plans/2-backend-agnostic-frontend.md`
1672
+ - **Feature 2-4:** `one/things/features/2-4-react-hooks.md` (Developer UX)
1673
+ - **Feature 2-5:** `one/things/features/2-5-auth-migration.md` (Auth UI)
1674
+ - **Feature 2-6:** `one/things/features/2-6-dashboard-migration.md` (Dashboard UI)
1675
+ - **Design System:** `frontend/src/styles/global.css` (Tailwind v4 config)
1676
+ - **Components:** `frontend/src/components/ui/` (shadcn/ui components)
1677
+
1678
+ ---
1679
+
1680
+ ## Next Steps
1681
+
1682
+ ### Immediate Actions
1683
+
1684
+ 1. **Frontend Specialist:** Review this design specification
1685
+ 2. **Frontend Specialist:** Validate wireframes match existing UI
1686
+ 3. **Frontend Specialist:** Confirm design tokens are correct
1687
+ 4. **Frontend Specialist:** Begin implementation of Feature 2-4 hooks
1688
+
1689
+ ### Implementation Sequence
1690
+
1691
+ **Week 1: Feature 2-4 (React Hooks)**
1692
+
1693
+ - Implement hook return types
1694
+ - Implement error taxonomy
1695
+ - Implement loading state patterns
1696
+ - Add TypeScript IntelliSense support
1697
+ - Write hook documentation
1698
+
1699
+ **Week 2: Feature 2-5 (Auth Components)**
1700
+
1701
+ - Migrate LoginForm with wireframe
1702
+ - Migrate SignupForm with password strength
1703
+ - Migrate OAuthButtons
1704
+ - Migrate PasswordResetForm
1705
+ - Migrate TwoFactorSettings with QR code
1706
+ - Migrate MagicLinkForm
1707
+ - Validate all auth tests pass
1708
+
1709
+ **Week 3: Feature 2-6 (Dashboard Components)**
1710
+
1711
+ - Migrate DashboardOverview with charts
1712
+ - Migrate CourseList (list + grid views)
1713
+ - Migrate CourseDetail with relationships
1714
+ - Migrate ActivityFeed with real-time
1715
+ - Migrate SearchBar with autocomplete
1716
+ - Validate all dashboard tests pass
1717
+
1718
+ ### Validation Criteria
1719
+
1720
+ - [ ] All wireframes implemented exactly as designed
1721
+ - [ ] All design tokens used correctly
1722
+ - [ ] All accessibility requirements met
1723
+ - [ ] All responsive breakpoints work
1724
+ - [ ] All animations smooth and purposeful
1725
+ - [ ] All tests pass
1726
+ - [ ] Zero visual regression
1727
+
1728
+ ---
1729
+
1730
+ **Status:** Complete Specification - Ready for Implementation
1731
+ **Created:** 2025-10-13
1732
+ **Validated By:** Design Agent
1733
+ **Line Count:** 1,450 lines
1734
+ **Philosophy:** Test-driven, accessibility-first, mobile-first, minimal yet sophisticated
1735
+
1736
+ ---
1737
+
1738
+ **Design is not decoration. It's the interface layer that makes features testable and usable.**