oneie 3.7.0 → 3.8.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 (1132) hide show
  1. package/README.md +9 -9
  2. package/dist/commands/agent.d.ts +2 -0
  3. package/dist/commands/agent.d.ts.map +1 -1
  4. package/dist/commands/agent.js +44 -0
  5. package/dist/commands/agent.js.map +1 -1
  6. package/dist/commands/bounty.d.ts +4 -0
  7. package/dist/commands/bounty.d.ts.map +1 -0
  8. package/dist/commands/bounty.js +24 -0
  9. package/dist/commands/bounty.js.map +1 -0
  10. package/dist/commands/capabilities.d.ts +4 -0
  11. package/dist/commands/capabilities.d.ts.map +1 -0
  12. package/dist/commands/capabilities.js +18 -0
  13. package/dist/commands/capabilities.js.map +1 -0
  14. package/dist/commands/commend.d.ts +4 -0
  15. package/dist/commands/commend.d.ts.map +1 -0
  16. package/dist/commands/commend.js +13 -0
  17. package/dist/commands/commend.js.map +1 -0
  18. package/dist/commands/completion.d.ts +4 -0
  19. package/dist/commands/completion.d.ts.map +1 -0
  20. package/dist/commands/completion.js +49 -0
  21. package/dist/commands/completion.js.map +1 -0
  22. package/dist/commands/config.d.ts +4 -0
  23. package/dist/commands/config.d.ts.map +1 -0
  24. package/dist/commands/config.js +78 -0
  25. package/dist/commands/config.js.map +1 -0
  26. package/dist/commands/doctor.d.ts +4 -0
  27. package/dist/commands/doctor.d.ts.map +1 -0
  28. package/dist/commands/doctor.js +72 -0
  29. package/dist/commands/doctor.js.map +1 -0
  30. package/dist/commands/export.d.ts +4 -0
  31. package/dist/commands/export.d.ts.map +1 -0
  32. package/dist/commands/export.js +15 -0
  33. package/dist/commands/export.js.map +1 -0
  34. package/dist/commands/fade.d.ts.map +1 -1
  35. package/dist/commands/fade.js +8 -4
  36. package/dist/commands/fade.js.map +1 -1
  37. package/dist/commands/flag.d.ts +4 -0
  38. package/dist/commands/flag.d.ts.map +1 -0
  39. package/dist/commands/flag.js +13 -0
  40. package/dist/commands/flag.js.map +1 -0
  41. package/dist/commands/health.d.ts +4 -0
  42. package/dist/commands/health.d.ts.map +1 -0
  43. package/dist/commands/health.js +11 -0
  44. package/dist/commands/health.js.map +1 -0
  45. package/dist/commands/highways.d.ts.map +1 -1
  46. package/dist/commands/highways.js +7 -4
  47. package/dist/commands/highways.js.map +1 -1
  48. package/dist/commands/hire.d.ts +4 -0
  49. package/dist/commands/hire.d.ts.map +1 -0
  50. package/dist/commands/hire.js +16 -0
  51. package/dist/commands/hire.js.map +1 -0
  52. package/dist/commands/init.d.ts.map +1 -1
  53. package/dist/commands/init.js +69 -42
  54. package/dist/commands/init.js.map +1 -1
  55. package/dist/commands/mark.d.ts.map +1 -1
  56. package/dist/commands/mark.js +7 -7
  57. package/dist/commands/mark.js.map +1 -1
  58. package/dist/commands/pay.d.ts +4 -0
  59. package/dist/commands/pay.d.ts.map +1 -0
  60. package/dist/commands/pay.js +21 -0
  61. package/dist/commands/pay.js.map +1 -0
  62. package/dist/commands/pipe.d.ts +4 -0
  63. package/dist/commands/pipe.d.ts.map +1 -0
  64. package/dist/commands/pipe.js +35 -0
  65. package/dist/commands/pipe.js.map +1 -0
  66. package/dist/commands/publish.d.ts +4 -0
  67. package/dist/commands/publish.d.ts.map +1 -0
  68. package/dist/commands/publish.js +23 -0
  69. package/dist/commands/publish.js.map +1 -0
  70. package/dist/commands/repl.d.ts +4 -0
  71. package/dist/commands/repl.d.ts.map +1 -0
  72. package/dist/commands/repl.js +56 -0
  73. package/dist/commands/repl.js.map +1 -0
  74. package/dist/commands/revenue.d.ts +4 -0
  75. package/dist/commands/revenue.d.ts.map +1 -0
  76. package/dist/commands/revenue.js +11 -0
  77. package/dist/commands/revenue.js.map +1 -0
  78. package/dist/commands/stats.d.ts +4 -0
  79. package/dist/commands/stats.d.ts.map +1 -0
  80. package/dist/commands/stats.js +11 -0
  81. package/dist/commands/stats.js.map +1 -0
  82. package/dist/commands/status.d.ts +4 -0
  83. package/dist/commands/status.d.ts.map +1 -0
  84. package/dist/commands/status.js +18 -0
  85. package/dist/commands/status.js.map +1 -0
  86. package/dist/commands/tail.d.ts +4 -0
  87. package/dist/commands/tail.d.ts.map +1 -0
  88. package/dist/commands/tail.js +51 -0
  89. package/dist/commands/tail.js.map +1 -0
  90. package/dist/commands/warn.d.ts.map +1 -1
  91. package/dist/commands/warn.js +6 -6
  92. package/dist/commands/warn.js.map +1 -1
  93. package/dist/index.js +61 -1
  94. package/dist/index.js.map +1 -1
  95. package/dist/lib/args.d.ts +1 -0
  96. package/dist/lib/args.d.ts.map +1 -1
  97. package/dist/lib/args.js +3 -0
  98. package/dist/lib/args.js.map +1 -1
  99. package/dist/lib/output.d.ts +5 -0
  100. package/dist/lib/output.d.ts.map +1 -0
  101. package/dist/lib/output.js +32 -0
  102. package/dist/lib/output.js.map +1 -0
  103. package/dist/lib/sdk.d.ts +10 -0
  104. package/dist/lib/sdk.d.ts.map +1 -0
  105. package/dist/lib/sdk.js +22 -0
  106. package/dist/lib/sdk.js.map +1 -0
  107. package/dist/utils/installation-setup.d.ts +15 -0
  108. package/dist/utils/installation-setup.d.ts.map +1 -1
  109. package/dist/utils/installation-setup.js +63 -0
  110. package/dist/utils/installation-setup.js.map +1 -1
  111. package/package.json +3 -18
  112. package/.claude/agents/TROUBLESHOOTING.md +0 -530
  113. package/.claude/agents/agent-backend.md +0 -574
  114. package/.claude/agents/agent-builder.md +0 -911
  115. package/.claude/agents/agent-claude.md +0 -645
  116. package/.claude/agents/agent-clean.md +0 -477
  117. package/.claude/agents/agent-clone.md +0 -554
  118. package/.claude/agents/agent-designer.md +0 -1080
  119. package/.claude/agents/agent-director.md +0 -2254
  120. package/.claude/agents/agent-documenter.md +0 -688
  121. package/.claude/agents/agent-frontend.md +0 -1199
  122. package/.claude/agents/agent-integrator.md +0 -670
  123. package/.claude/agents/agent-lawyer.md +0 -1320
  124. package/.claude/agents/agent-news.md +0 -363
  125. package/.claude/agents/agent-onboard.md +0 -613
  126. package/.claude/agents/agent-ontology.md +0 -585
  127. package/.claude/agents/agent-ops.md +0 -1275
  128. package/.claude/agents/agent-problem-solver.md +0 -669
  129. package/.claude/agents/agent-quality.md +0 -1042
  130. package/.claude/agents/agent-sales.md +0 -507
  131. package/.claude/agents/agent-writer.md +0 -1068
  132. package/.claude/commands/cascade.md +0 -742
  133. package/.claude/commands/chat.md +0 -728
  134. package/.claude/commands/commit.md +0 -95
  135. package/.claude/commands/create.md +0 -544
  136. package/.claude/commands/deploy.md +0 -309
  137. package/.claude/commands/fast.md +0 -636
  138. package/.claude/commands/mcp-on.md +0 -191
  139. package/.claude/commands/media-upload.md +0 -186
  140. package/.claude/commands/news.md +0 -274
  141. package/.claude/commands/onboard.md +0 -440
  142. package/.claude/commands/one.md +0 -398
  143. package/.claude/commands/optimize.md +0 -74
  144. package/.claude/commands/plan.md +0 -719
  145. package/.claude/commands/push.md +0 -214
  146. package/.claude/commands/release.md +0 -105
  147. package/.claude/commands/review.md +0 -99
  148. package/.claude/commands/server.md +0 -487
  149. package/.claude/commands/start.md +0 -227
  150. package/.claude/commands/test.md +0 -197
  151. package/.claude/commands/validate.md +0 -140
  152. package/.claude/hooks/.last-news-context +0 -1
  153. package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +0 -473
  154. package/.claude/hooks/README-knowledge-hooks.md +0 -451
  155. package/.claude/hooks/README-news-generation.md +0 -364
  156. package/.claude/hooks/README-root-cleanup.md +0 -200
  157. package/.claude/hooks/README.md +0 -284
  158. package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
  159. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  160. package/.claude/hooks/auto-format.sh +0 -106
  161. package/.claude/hooks/check-filenames.py +0 -177
  162. package/.claude/hooks/clean-post.py +0 -468
  163. package/.claude/hooks/clean-pre.py +0 -393
  164. package/.claude/hooks/clean-root-markdown.sh +0 -73
  165. package/.claude/hooks/commit-push.sh +0 -95
  166. package/.claude/hooks/done.py +0 -236
  167. package/.claude/hooks/format-hook.sh +0 -163
  168. package/.claude/hooks/formatting.py +0 -187
  169. package/.claude/hooks/hook-logger.sh +0 -173
  170. package/.claude/hooks/knowledge-post.py +0 -355
  171. package/.claude/hooks/knowledge-pre.py +0 -245
  172. package/.claude/hooks/mcp-on.sh +0 -134
  173. package/.claude/hooks/notification-hook.sh +0 -279
  174. package/.claude/hooks/ontology-validation.py +0 -255
  175. package/.claude/hooks/push.sh +0 -153
  176. package/.claude/hooks/release-cli.sh +0 -205
  177. package/.claude/hooks/root-cleanup.py +0 -217
  178. package/.claude/hooks/security-hook.sh +0 -397
  179. package/.claude/hooks/tag-all-docs.py +0 -464
  180. package/.claude/hooks/test-validate-ontology.sh +0 -170
  181. package/.claude/hooks/todo.py +0 -368
  182. package/.claude/hooks/track-changes.sh +0 -101
  183. package/.claude/hooks/validate-imports.py +0 -182
  184. package/.claude/hooks/validate-ontology-structure-summary.md +0 -243
  185. package/.claude/hooks/validate-ontology-structure.py +0 -558
  186. package/.claude/hooks/validate-ontology-structure.py.backup +0 -518
  187. package/.claude/hooks/validate-ontology.py +0 -140
  188. package/.claude/hooks/write-news.sh +0 -194
  189. package/.claude/skills/INDEX.md +0 -523
  190. package/.claude/skills/REGISTRY.md +0 -529
  191. package/.claude/skills/agent-backend-create-mutation.md +0 -319
  192. package/.claude/skills/agent-designer-create-wireframe.md +0 -341
  193. package/.claude/skills/agent-frontend-create-page.md +0 -413
  194. package/.claude/skills/agents/README.md +0 -238
  195. package/.claude/skills/astro/add-content-collection.md +0 -30
  196. package/.claude/skills/astro/check-build.md +0 -29
  197. package/.claude/skills/astro/create-component.md +0 -29
  198. package/.claude/skills/astro/create-page.md +0 -30
  199. package/.claude/skills/astro/optimize-performance.md +0 -21
  200. package/.claude/skills/convex/check-deployment.md +0 -46
  201. package/.claude/skills/convex/create-mutation.md +0 -405
  202. package/.claude/skills/convex/create-query.md +0 -52
  203. package/.claude/skills/convex/read-schema.md +0 -373
  204. package/.claude/skills/convex/test-function.md +0 -50
  205. package/.claude/skills/deployment/check-deployment-health.md +0 -20
  206. package/.claude/skills/deployment/create-release.md +0 -21
  207. package/.claude/skills/deployment/deploy-cloudflare.md +0 -31
  208. package/.claude/skills/deployment/deploy-convex.md +0 -30
  209. package/.claude/skills/deployment/sync-repositories.md +0 -19
  210. package/.claude/skills/design/check-accessibility.md +0 -21
  211. package/.claude/skills/design/create-component-spec.md +0 -27
  212. package/.claude/skills/design/generate-design-tokens.md +0 -24
  213. package/.claude/skills/design/generate-wireframe.md +0 -30
  214. package/.claude/skills/documentation/create-migration-guide.md +0 -20
  215. package/.claude/skills/documentation/generate-api-docs.md +0 -27
  216. package/.claude/skills/documentation/generate-readme.md +0 -22
  217. package/.claude/skills/documentation/update-knowledge.md +0 -20
  218. package/.claude/skills/integration/connect-external-system.md +0 -21
  219. package/.claude/skills/integration/implement-a2a.md +0 -20
  220. package/.claude/skills/integration/implement-acp.md +0 -20
  221. package/.claude/skills/integration/verify-integration.md +0 -20
  222. package/.claude/skills/ontology/README.md +0 -255
  223. package/.claude/skills/ontology/check-dimension.md +0 -307
  224. package/.claude/skills/ontology/generate-entity-type.md +0 -339
  225. package/.claude/skills/ontology/validate-schema.md +0 -229
  226. package/.claude/skills/ontology/verify-relationships.md +0 -310
  227. package/.claude/skills/problem-solving/analyze-test-failure.md +0 -21
  228. package/.claude/skills/problem-solving/identify-root-cause.md +0 -20
  229. package/.claude/skills/problem-solving/propose-solution.md +0 -29
  230. package/.claude/skills/problem-solving/verify-fix.md +0 -21
  231. package/.claude/skills/sales/generate-demo-script.md +0 -21
  232. package/.claude/skills/sales/qualify-lead.md +0 -30
  233. package/.claude/skills/sales/track-trial.md +0 -20
  234. package/.claude/skills/sales/verify-kyc.md +0 -20
  235. package/.claude/skills/testing/analyze-coverage.md +0 -24
  236. package/.claude/skills/testing/generate-tests.md +0 -24
  237. package/.claude/skills/testing/run-tests.md +0 -27
  238. package/.claude/skills/testing/validate-e2e.md +0 -25
  239. package/AGENTS.md +0 -60
  240. package/CLAUDE.md +0 -130
  241. package/CREATE-WEBSITE.md +0 -458
  242. package/SECURITY.md +0 -31
  243. package/folders.yaml +0 -92
  244. package/one/README.md +0 -760
  245. package/one/actors/anthony-o-connell.md +0 -469
  246. package/one/actors/people.md +0 -590
  247. package/one/events/0-changes.md +0 -2764
  248. package/one/events/1-PROJECTS-START-HERE.md +0 -384
  249. package/one/events/1-projects-developer-quickstart.md +0 -620
  250. package/one/events/1-projects-feature.md +0 -2047
  251. package/one/events/1-projects-team-briefing.md +0 -583
  252. package/one/events/2024-10-14-deployment-plan.md +0 -330
  253. package/one/events/2024-10-14-deployment-success.md +0 -447
  254. package/one/events/2024-10-14-final-sync-complete.md +0 -250
  255. package/one/events/2024-10-14-release-v2.0.6.md +0 -414
  256. package/one/events/2024-10-15-agent-clean-v2-summary.md +0 -495
  257. package/one/events/2024-10-15-handoff-to-clean.md +0 -347
  258. package/one/events/2024-10-15-package-manager-tests.md +0 -442
  259. package/one/events/2024-10-15-release-command-complete.md +0 -416
  260. package/one/events/2025-10-15-private-files-secured.md +0 -359
  261. package/one/events/2025-10-15-unignore-public-group-docs.md +0 -298
  262. package/one/events/2025-11-08-backend-claude-refactor.md +0 -242
  263. package/one/events/2025-11-08-parallel-agent-implementation.md +0 -620
  264. package/one/events/2025-11-10-ai-integration-status-report.md +0 -241
  265. package/one/events/ACCESSIBILITY_CHECKLIST.md +0 -275
  266. package/one/events/ACCESSIBILITY_FIXES_SUMMARY.md +0 -293
  267. package/one/events/ALIGNMENT_REPORT_PROBLEM_SOLVER.md +0 -335
  268. package/one/events/ALIGNMENT_SUMMARY.md +0 -280
  269. package/one/events/API_ROUTES_FIXES_SUMMARY.md +0 -280
  270. package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +0 -654
  271. package/one/events/AUDIT-ONTOLOGY-ALIGNMENT.md +0 -598
  272. package/one/events/AUDIT_PLAN_COMPLETION-20251108-125555.md +0 -262
  273. package/one/events/BEFORE_AFTER_COMPARISON.md +0 -978
  274. package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +0 -372
  275. package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +0 -430
  276. package/one/events/CHARTS-READY-TO-USE-20251106-080939.md +0 -184
  277. package/one/events/CHARTS-SUMMARY-20251106-080938.md +0 -196
  278. package/one/events/CLAUDE copy.md +0 -897
  279. package/one/events/CLEANUP-RELEASE-V2.0.8.md +0 -308
  280. package/one/events/CLOUDFLARE-FS-FIX-20251106-100516.md +0 -75
  281. package/one/events/COMPONENT_SHOWCASE-20251106-080938.md +0 -629
  282. package/one/events/CONNECTIONS_DEMO.md +0 -519
  283. package/one/events/CREATE-WEBSITE.md +0 -460
  284. package/one/events/CRITICAL-FIXES-COMPLETE.md +0 -571
  285. package/one/events/CUSTOM-DOMAIN.md +0 -375
  286. package/one/events/DELIVERABLES.md +0 -450
  287. package/one/events/DELIVERABLES.txt +0 -273
  288. package/one/events/DEMO-GROUPS-PAGE.md +0 -410
  289. package/one/events/DEMO-TESTING-SUMMARY.md +0 -536
  290. package/one/events/DEMO_COMPONENTS.md +0 -505
  291. package/one/events/DEMO_HOOKS_INDEX.md +0 -352
  292. package/one/events/DEMO_INFRASTRUCTURE.md +0 -923
  293. package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +0 -588
  294. package/one/events/DEMO_INTEGRATION_CHECKLIST.md +0 -449
  295. package/one/events/DEMO_QUICK_REFERENCE.md +0 -459
  296. package/one/events/DEMO_SETUP.md +0 -494
  297. package/one/events/DEPLOYMENT copy.md +0 -444
  298. package/one/events/DEPLOYMENT.md +0 -196
  299. package/one/events/DESIGN-DELIVERABLES-20251106-080938.md +0 -557
  300. package/one/events/DESIGN-EXECUTIVE-SUMMARY-20251106-080938.md +0 -484
  301. package/one/events/DOCS-SYSTEM-GUIDE-20251105-142103.md +0 -458
  302. package/one/events/DOCUMENTER-DELIVERY-SUMMARY.md +0 -481
  303. package/one/events/DOCUMENTER-EXECUTION-GUIDE.md +0 -394
  304. package/one/events/DOCUMENTER-TASK-BREAKDOWN.md +0 -783
  305. package/one/events/ECOMMERCE-BEFORE-AFTER.md +0 -267
  306. package/one/events/ECOMMERCE-DEMO-PLAN.md +0 -243
  307. package/one/events/ECOMMERCE-ENHANCEMENTS.md +0 -594
  308. package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +0 -439
  309. package/one/events/ECOMMERCE-LIVE-DEMO.md +0 -381
  310. package/one/events/ECOMMERCE-QUICKSTART.md +0 -376
  311. package/one/events/ECOMMERCE-README.md +0 -354
  312. package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +0 -214
  313. package/one/events/ECOMMERCE-SETUP-SUMMARY.md +0 -414
  314. package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +0 -753
  315. package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +0 -941
  316. package/one/events/EFFECT_TS_API_PATTERN.md +0 -496
  317. package/one/events/EXECUTION-READY.md +0 -359
  318. package/one/events/EXECUTION-SUMMARY.md +0 -478
  319. package/one/events/FEATURE-2-4-COMPLETE.md +0 -320
  320. package/one/events/FEATURE_2_3_COMPLETE.md +0 -593
  321. package/one/events/FILE-REFERENCE-20251105-142103.md +0 -325
  322. package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +0 -241
  323. package/one/events/GROUPS-MIGRATION.md +0 -643
  324. package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +0 -432
  325. package/one/events/HANDOFF.md +0 -331
  326. package/one/events/HOOKS-DEMO.md +0 -459
  327. package/one/events/IMPLEMENTATION-CHECKLIST-20251105-142103.md +0 -274
  328. package/one/events/IMPLEMENTATION-REPORT-DOCS-20251105-142102.md +0 -394
  329. package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +0 -568
  330. package/one/events/IMPLEMENTATION_SUMMARY-20251106-080938.md +0 -571
  331. package/one/events/IMPLEMENTATION_SUMMARY.md +0 -547
  332. package/one/events/INDEX-ALL-AGENTS.md +0 -190
  333. package/one/events/INDEX-FRONTEND-TESTING.md +0 -524
  334. package/one/events/INDEX-PROBLEM-SOLVER.md +0 -488
  335. package/one/events/INDEX-QUALITY-AGENT-INFER65.md +0 -455
  336. package/one/events/INDEX.md +0 -295
  337. package/one/events/INDEX_QUICK_START_REDESIGN-20251106-080939.md +0 -342
  338. package/one/events/INSTALL-TESTS.md +0 -311
  339. package/one/events/INSTALLATION_FOLDERS.md +0 -534
  340. package/one/events/INSTALLATION_FOLDERS_FILES.md +0 -223
  341. package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +0 -437
  342. package/one/events/INTEGRATION-ARCHITECTURE.md +0 -579
  343. package/one/events/INTEGRATION-CHECKLIST.md +0 -1252
  344. package/one/events/INTEGRATION-ORCHESTRATION.md +0 -2641
  345. package/one/events/INTEGRATION-SUMMARY.md +0 -671
  346. package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +0 -684
  347. package/one/events/LANDING-PAGE-IMPLEMENTATION.md +0 -660
  348. package/one/events/LANDING-PAGE-QUICKSTART.md +0 -425
  349. package/one/events/LICENSE.md +0 -107
  350. package/one/events/MASTER-COORDINATION-PLAN.md +0 -613
  351. package/one/events/MASTER-ORCHESTRATION-INFER65.md +0 -441
  352. package/one/events/MASTER-PLAN-SUMMARY.md +0 -309
  353. package/one/events/MCP-CONFIGURATION.md +0 -354
  354. package/one/events/MCP-SETUP-COMPLETE.md +0 -223
  355. package/one/events/MIGRATION-REPORT.md +0 -453
  356. package/one/events/MIGRATION.md +0 -87
  357. package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +0 -1663
  358. package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +0 -643
  359. package/one/events/NEWS-COMMANDS.md +0 -506
  360. package/one/events/NEWS-SYSTEM-SUMMARY.md +0 -480
  361. package/one/events/NODE-UPGRADE.md +0 -129
  362. package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +0 -416
  363. package/one/events/ONTOLOGY-HOOKS-README.md +0 -718
  364. package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +0 -383
  365. package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +0 -569
  366. package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +0 -491
  367. package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +0 -504
  368. package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +0 -221
  369. package/one/events/PACKAGE-STRUCTURE.md +0 -328
  370. package/one/events/PLAN-COMPLETE.md +0 -429
  371. package/one/events/PLAYBOOK-SETUP-SUMMARY.md +0 -349
  372. package/one/events/PROBLEM-SOLVER-EXECUTIVE-SUMMARY.md +0 -484
  373. package/one/events/PROBLEM-SOLVER-QUICKSTART.md +0 -420
  374. package/one/events/PROJECTS-PLAN-SUMMARY.md +0 -480
  375. package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +0 -585
  376. package/one/events/QA-CHECKLIST.md +0 -692
  377. package/one/events/QUALITY-AGENT-SUMMARY.md +0 -334
  378. package/one/events/QUALITY-EXECUTION-CHECKLIST.md +0 -593
  379. package/one/events/QUICK-REFERENCE-FRONTEND-TESTING.md +0 -475
  380. package/one/events/QUICK-START-ONTOLOGY.md +0 -426
  381. package/one/events/QUICK_START_REDESIGN-20251106-080938.md +0 -400
  382. package/one/events/README-PROBLEM-SOLVER.md +0 -394
  383. package/one/events/README-archived.md +0 -537
  384. package/one/events/README_QUICK_START_REDESIGN-20251106-080938.md +0 -484
  385. package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +0 -657
  386. package/one/events/SEARCH_DEMO_DELIVERY.md +0 -433
  387. package/one/events/SEARCH_DEMO_SUMMARY.md +0 -321
  388. package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +0 -399
  389. package/one/events/SECURITY-AUDIT-FIXES.md +0 -394
  390. package/one/events/SECURITY-SCAN-COMPLETE.md +0 -299
  391. package/one/events/SHOP-BUILD-STATUS.md +0 -132
  392. package/one/events/SHOP-PREMIUM-UPDATE.md +0 -165
  393. package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +0 -280
  394. package/one/events/SITE-WIDE-GRADIENT-FIX.md +0 -317
  395. package/one/events/SPECIALIST-QUICK-REFERENCE.md +0 -678
  396. package/one/events/STORE-PRODUCTION-READY-STATUS.md +0 -377
  397. package/one/events/STRIPE-INTEGRATION.md +0 -432
  398. package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +0 -447
  399. package/one/events/STRIPE-SETUP-GUIDE.md +0 -480
  400. package/one/events/TEST-PLAN-INDEX.md +0 -364
  401. package/one/events/TEST-PLAN.md +0 -1435
  402. package/one/events/TEST-SUMMARY.md +0 -411
  403. package/one/events/TESTING-DELIVERY.txt +0 -372
  404. package/one/events/TESTS-QUICK-REF.md +0 -280
  405. package/one/events/TRANSITIONS-QUICK-START.md +0 -159
  406. package/one/events/TRANSPARENCY-FIXES.md +0 -293
  407. package/one/events/TYPESCRIPT_FIXES.md +0 -170
  408. package/one/events/TYPESCRIPT_FIXES_COMPLETE.txt +0 -412
  409. package/one/events/TYPESCRIPT_FIXES_INDEX.md +0 -359
  410. package/one/events/VERIFICATION_CHECKLIST-20251106-080938.md +0 -326
  411. package/one/events/VIEW-TRANSITIONS.md +0 -446
  412. package/one/events/agent-command-implementation.md +0 -305
  413. package/one/events/agent-director-enhancement-summary.md +0 -404
  414. package/one/events/agent-director-routing-update.md +0 -214
  415. package/one/events/agent-onboard-implementation-summary.md +0 -475
  416. package/one/events/agent-ontology-alignment-completion.md +0 -263
  417. package/one/events/ai-integration-complete.md +0 -294
  418. package/one/events/ai-integration-lessons-learned.md +0 -511
  419. package/one/events/backend-integration-tests.md +0 -624
  420. package/one/events/backend-structure-diagram.txt +0 -393
  421. package/one/events/backend-structure-summary.txt +0 -269
  422. package/one/events/bullfm-video-podcast-analysis.md +0 -319
  423. package/one/events/clean-agent-ontology-cleanup-report.md +0 -371
  424. package/one/events/clean-agent-todo-analysis-summary.md +0 -336
  425. package/one/events/cloudflare-automation-complete.md +0 -350
  426. package/one/events/cloudflare-pages-infrastructure-setup.md +0 -282
  427. package/one/events/contact-page-complete.md +0 -316
  428. package/one/events/convex-analysis-index.md +0 -322
  429. package/one/events/convex-structure-analysis.md +0 -718
  430. package/one/events/creation-instructions-9-todos.md +0 -906
  431. package/one/events/cycle-3-video-player-port-20251108.md +0 -368
  432. package/one/events/cycle-3-video-player-port-complete-20251108.md +0 -334
  433. package/one/events/deployment-installation-folders.md +0 -178
  434. package/one/events/deployment-ops-summary.md +0 -386
  435. package/one/events/deployment-verification.md +0 -366
  436. package/one/events/design-spec-complete.md +0 -226
  437. package/one/events/documentation-audit-index.md +0 -473
  438. package/one/events/documentation-audit-summary.md +0 -417
  439. package/one/events/documentation-improvement-roadmap.md +0 -906
  440. package/one/events/documentation-standards-compliance-report.md +0 -538
  441. package/one/events/documentation-updates.md +0 -370
  442. package/one/events/events.md +0 -563
  443. package/one/events/fix-product-hydration-20251106.md +0 -211
  444. package/one/events/frontend-effects-complete.md +0 -584
  445. package/one/events/frontend-effects-orchestration.md +0 -1356
  446. package/one/events/frontend-effects-risk-register.md +0 -1055
  447. package/one/events/frontend-effects-week1-assignments.md +0 -1594
  448. package/one/events/hook-ontology-alignment-summary.md +0 -528
  449. package/one/events/installation-folders-workflow-integration.md +0 -458
  450. package/one/events/landing-page-generator.md +0 -476
  451. package/one/events/legal-assessment-2025-10-16.md +0 -1917
  452. package/one/events/master-coordination-plan.json +0 -1078
  453. package/one/events/master-plan-9-todos.md +0 -900
  454. package/one/events/mobile-performance-optimization.md +0 -179
  455. package/one/events/onboarding-implementation-complete.md +0 -523
  456. package/one/events/ontology-audit-agent-clone.md +0 -323
  457. package/one/events/ontology-test-examples.md +0 -580
  458. package/one/events/phase1-backend-implementation-complete.md +0 -536
  459. package/one/events/plan-completion-audit.md +0 -707
  460. package/one/events/plan-files-updated.md +0 -273
  461. package/one/events/production-readiness-plan.md +0 -389
  462. package/one/events/readme.md +0 -100
  463. package/one/events/release.md +0 -272
  464. package/one/events/root-cleanup-alignment-report.md +0 -265
  465. package/one/events/security-fixes-2025-01-15.md +0 -226
  466. package/one/events/separate-implementation-status.md +0 -555
  467. package/one/events/server-command-optimization-20251108.md +0 -150
  468. package/one/events/session-summary-2025-10-18.md +0 -366
  469. package/one/events/skills-complete.md +0 -351
  470. package/one/events/skills-infer-6-10-summary.md +0 -70
  471. package/one/events/skills-phase1-complete.md +0 -281
  472. package/one/events/specialist-assignments.md +0 -766
  473. package/one/events/structural-analysis-architecture-vs-plans.md +0 -600
  474. package/one/events/test-dashboard.md +0 -363
  475. package/one/events/test-index.md +0 -421
  476. package/one/events/test-report-ontology.md +0 -611
  477. package/one/events/testing-summary.md +0 -388
  478. package/one/events/todo-agent-builder.md +0 -1180
  479. package/one/events/todo-agent-director.md +0 -164
  480. package/one/events/todo-agent-documenter.md +0 -1815
  481. package/one/events/todo-agent-frontend.md +0 -1542
  482. package/one/events/todo-agent-problem-solver.md +0 -1682
  483. package/one/events/todo-agent-quality.md +0 -1647
  484. package/one/events/todo-refactoring-complete.md +0 -408
  485. package/one/events/wave1-backend-implementation-complete.md +0 -698
  486. package/one/events/web-AI_INTEGRATION_PHASE2_SUMMARY-20251111-152540.md +0 -529
  487. package/one/events/web-BUY-IN-CHATGPT-README-20251116-235241.md +0 -491
  488. package/one/events/web-CHARTS-IMPLEMENTATION-20251106-080939.md +0 -576
  489. package/one/events/web-CHARTS-QUICKSTART-20251106-080939.md +0 -416
  490. package/one/events/web-CODE-HIGHLIGHTING-SUMMARY-20251111-152540.md +0 -442
  491. package/one/events/web-DEPLOYMENT_SUMMARY-20251116-005428.md +0 -290
  492. package/one/events/web-DESIGN-SUMMARY-20251106-080939.md +0 -514
  493. package/one/events/web-README-AI-INTEGRATION-20251111-152540.md +0 -196
  494. package/one/events/web-RECHARTS-INTEGRATION-20251111-152540.md +0 -265
  495. package/one/events/web-RELEASE_OPTIMIZATION_PLAN-20251116-005428.md +0 -447
  496. package/one/events/web-TEST-CLEANUP-20251105-143205.md +0 -3
  497. package/one/events/web-USING-ANY-COMPONENT-IN-CHAT-20251111-152540.md +0 -561
  498. package/one/events/web-test-code-highlighting-20251111-152540.md +0 -231
  499. package/one/groups/features.md +0 -2904
  500. package/one/groups/groups.md +0 -587
  501. package/one/groups/one.md +0 -619
  502. package/one/groups/strategy-copy.md +0 -887
  503. package/one/learning/.obsidian/app.json +0 -1
  504. package/one/learning/.obsidian/appearance.json +0 -1
  505. package/one/learning/.obsidian/core-plugins.json +0 -33
  506. package/one/learning/.obsidian/ecommerce-ontology.md +0 -210
  507. package/one/learning/.obsidian/workspace.json +0 -211
  508. package/one/learning/100-inference-quick-reference.md +0 -449
  509. package/one/learning/ag-ui-protocol.md +0 -613
  510. package/one/learning/agent-onboard-usage.md +0 -630
  511. package/one/learning/agentic-commerce.md +0 -146
  512. package/one/learning/ai-agents-vs-memecoins-thesis.md +0 -683
  513. package/one/learning/ai-api-reference.md +0 -715
  514. package/one/learning/ai-platform.md +0 -323
  515. package/one/learning/ai-quickstart.md +0 -355
  516. package/one/learning/ai-sdk-implementation.md +0 -436
  517. package/one/learning/ai-token-crypto-analysis-framework.md +0 -1191
  518. package/one/learning/ai-token-paradigm-shift-2025.md +0 -732
  519. package/one/learning/altcoin-cycle-prediction-ontology.md +0 -884
  520. package/one/learning/altcoin-cycle-trading-strategy.md +0 -642
  521. package/one/learning/architecture-any-backend.md +0 -1589
  522. package/one/learning/architecture-diagram.md +0 -404
  523. package/one/learning/architecture-frontend.md +0 -1014
  524. package/one/learning/architecture.md +0 -1742
  525. package/one/learning/archived/ontology.old.md +0 -2840
  526. package/one/learning/astro-effect-complete-vision.md +0 -2148
  527. package/one/learning/astro-effect-simple-architecture.md +0 -750
  528. package/one/learning/audit-agent-onboard-alignment.md +0 -481
  529. package/one/learning/audit-agent-sales-alignment.md +0 -444
  530. package/one/learning/backend-api-reference.md +0 -728
  531. package/one/learning/cascading-context-specification.md +0 -1617
  532. package/one/learning/claude-code-integration.md +0 -1293
  533. package/one/learning/cli-claude-handoff.md +0 -736
  534. package/one/learning/context-engineering.md +0 -610
  535. package/one/learning/crypto-analysis-strategy.md +0 -1276
  536. package/one/learning/crypto-cycle-2024-2025-analysis.md +0 -44
  537. package/one/learning/crypto.md +0 -978
  538. package/one/learning/develop/design.md +0 -364
  539. package/one/learning/develop/index.md +0 -145
  540. package/one/learning/development-commands.md +0 -251
  541. package/one/learning/docs.md +0 -627
  542. package/one/learning/dsl.md +0 -1678
  543. package/one/learning/event-driven-documentation.md +0 -270
  544. package/one/learning/files.md +0 -2489
  545. package/one/learning/frontend.md +0 -1056
  546. package/one/learning/games-english.md +0 -691
  547. package/one/learning/games.md +0 -1082
  548. package/one/learning/generative-ui-patterns.md +0 -559
  549. package/one/learning/guidelines.md +0 -314
  550. package/one/learning/hono.md +0 -2127
  551. package/one/learning/implementation-examples.md +0 -2554
  552. package/one/learning/installation-folders.md +0 -366
  553. package/one/learning/institutional-cycle-paradigm-2025.md +0 -555
  554. package/one/learning/knowledge.md +0 -660
  555. package/one/learning/language.md +0 -998
  556. package/one/learning/lessons-learned.md +0 -378
  557. package/one/learning/lessons-website-building-focus.md +0 -382
  558. package/one/learning/merge-report.md +0 -254
  559. package/one/learning/metadata-system.md +0 -504
  560. package/one/learning/nine-padel-playbook.md +0 -229
  561. package/one/learning/one-protocol-ai-agents.md +0 -892
  562. package/one/learning/one-protocol-executive-report.md +0 -617
  563. package/one/learning/one-protocol-standard.md +0 -869
  564. package/one/learning/one-protocol-whitepaper.md +0 -756
  565. package/one/learning/ontology-blog.yaml +0 -47
  566. package/one/learning/ontology-cheatsheet.md +0 -617
  567. package/one/learning/ontology-community.yaml +0 -65
  568. package/one/learning/ontology-core-universal.md +0 -740
  569. package/one/learning/ontology-core.yaml +0 -63
  570. package/one/learning/ontology-courses.yaml +0 -76
  571. package/one/learning/ontology-creator.md +0 -402
  572. package/one/learning/ontology-crypto.md +0 -1603
  573. package/one/learning/ontology-developer-guide.md +0 -814
  574. package/one/learning/ontology-documentation.md +0 -377
  575. package/one/learning/ontology-ecommerce.md +0 -269
  576. package/one/learning/ontology-education-game.md +0 -1654
  577. package/one/learning/ontology-education.md +0 -938
  578. package/one/learning/ontology-engineering-specification.md +0 -1310
  579. package/one/learning/ontology-engineering.md +0 -1676
  580. package/one/learning/ontology-files.yaml +0 -525
  581. package/one/learning/ontology-frontend-master.md +0 -2898
  582. package/one/learning/ontology-frontend-specifications.md +0 -2196
  583. package/one/learning/ontology-frontend.md +0 -2475
  584. package/one/learning/ontology-index.md +0 -397
  585. package/one/learning/ontology-minimal.yaml +0 -301
  586. package/one/learning/ontology-portfolio.yaml +0 -45
  587. package/one/learning/ontology-quickstart.md +0 -602
  588. package/one/learning/ontology-release.md +0 -317
  589. package/one/learning/ontology-shop.yaml +0 -148
  590. package/one/learning/ontology-tokens.yaml +0 -51
  591. package/one/learning/ontology-tutorial.md +0 -455
  592. package/one/learning/ontology-v2.md +0 -4449
  593. package/one/learning/ontology-video-script.md +0 -939
  594. package/one/learning/ontology-visual-guide.md +0 -378
  595. package/one/learning/ontology.md +0 -3847
  596. package/one/learning/ontology.yaml +0 -1653
  597. package/one/learning/parallel-agents.md +0 -932
  598. package/one/learning/patterns/backend/convex-mutation-pattern.md +0 -130
  599. package/one/learning/patterns/backend/convex-query-pattern.md +0 -143
  600. package/one/learning/patterns/backend/mutation-template.md +0 -249
  601. package/one/learning/patterns/backend/query-template.md +0 -286
  602. package/one/learning/patterns/backend/service-template.md +0 -258
  603. package/one/learning/patterns/design/component-architecture.md +0 -435
  604. package/one/learning/patterns/design/index.md +0 -160
  605. package/one/learning/patterns/design/test-driven-design-pattern.md +0 -196
  606. package/one/learning/patterns/design/wireframe-template.md +0 -250
  607. package/one/learning/patterns/frontend/component-template.md +0 -246
  608. package/one/learning/patterns/frontend/form-template.md +0 -348
  609. package/one/learning/patterns/frontend/page-template.md +0 -209
  610. package/one/learning/patterns/frontend/react-component-pattern.md +0 -188
  611. package/one/learning/patterns/test/acceptance-criteria-template.md +0 -396
  612. package/one/learning/patterns/test/technical-test-template.md +0 -566
  613. package/one/learning/patterns/test/test-driven-pattern.md +0 -160
  614. package/one/learning/patterns/test/user-flow-template.md +0 -272
  615. package/one/learning/performance.md +0 -459
  616. package/one/learning/provider-agnostic-content.md +0 -995
  617. package/one/learning/provider-creation-guide.md +0 -1082
  618. package/one/learning/quality-loop.md +0 -419
  619. package/one/learning/quick-start-ontology-mapping.md +0 -773
  620. package/one/learning/readme-architecture.md +0 -158
  621. package/one/learning/readme.md +0 -149
  622. package/one/learning/rules.md +0 -644
  623. package/one/learning/score.md +0 -85
  624. package/one/learning/specifications.md +0 -873
  625. package/one/learning/tags.md +0 -148
  626. package/one/learning/todo-template.md +0 -269
  627. package/one/learning/todo.md +0 -269
  628. package/one/learning/troubleshooting.md +0 -434
  629. package/one/learning/typescript-patterns.md +0 -321
  630. package/one/learning/universal-generation-language.md +0 -827
  631. package/one/learning/x402-research.md +0 -104
  632. package/one/license.md +0 -107
  633. package/one/paths/a2a.md +0 -600
  634. package/one/paths/acp.md +0 -808
  635. package/one/paths/acps.md +0 -749
  636. package/one/paths/agentkit.md +0 -367
  637. package/one/paths/agui.md +0 -785
  638. package/one/paths/any-backend.md +0 -1720
  639. package/one/paths/ap2.md +0 -1072
  640. package/one/paths/api/queries-reference.md +0 -860
  641. package/one/paths/api-docs.md +0 -1909
  642. package/one/paths/api-reference.md +0 -1029
  643. package/one/paths/api.md +0 -2208
  644. package/one/paths/architecture-diagram.md +0 -112
  645. package/one/paths/communications.md +0 -467
  646. package/one/paths/connections.md +0 -357
  647. package/one/paths/copilotkit.md +0 -1577
  648. package/one/paths/cryptonetworks.md +0 -799
  649. package/one/paths/documentation.md +0 -1138
  650. package/one/paths/effect.md +0 -297
  651. package/one/paths/elizaos.md +0 -1308
  652. package/one/paths/groups.md +0 -814
  653. package/one/paths/inference.md +0 -76
  654. package/one/paths/integration-examples.md +0 -893
  655. package/one/paths/integration-guide.md +0 -887
  656. package/one/paths/integration-phase2.md +0 -754
  657. package/one/paths/kyc.md +0 -650
  658. package/one/paths/mcp.md +0 -860
  659. package/one/paths/membership.md +0 -1170
  660. package/one/paths/middleware.md +0 -1085
  661. package/one/paths/multitenant.md +0 -1359
  662. package/one/paths/n8n.md +0 -1033
  663. package/one/paths/patterns.md +0 -107
  664. package/one/paths/protocols.md +0 -297
  665. package/one/paths/relationships.md +0 -125
  666. package/one/paths/schema.md +0 -605
  667. package/one/paths/service-layer.md +0 -568
  668. package/one/paths/vectors.md +0 -225
  669. package/one/paths/wordpress.md +0 -1320
  670. package/one/paths/workflow-copy.md +0 -923
  671. package/one/paths/workflow-examples.md +0 -759
  672. package/one/paths/workflow-onboarding.md +0 -701
  673. package/one/paths/workflow.md +0 -923
  674. package/one/paths/workflows/delegation.md +0 -903
  675. package/one/paths/workflows/frontend.md +0 -1055
  676. package/one/paths/workflows/strategy.md +0 -921
  677. package/one/paths/workflows/tasks.md +0 -716
  678. package/one/paths/x402-baazar.md +0 -131
  679. package/one/paths/x402.md +0 -1353
  680. package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +0 -401
  681. package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +0 -588
  682. package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +0 -461
  683. package/one/things/CHECKLIST.md +0 -407
  684. package/one/things/IMPLEMENTATION_STATUS.md +0 -379
  685. package/one/things/ONE.md +0 -529
  686. package/one/things/agents/agent-backend.md +0 -1501
  687. package/one/things/agents/agent-builder.md +0 -1064
  688. package/one/things/agents/agent-clean.md +0 -1112
  689. package/one/things/agents/agent-clone.md +0 -1324
  690. package/one/things/agents/agent-deploy.md +0 -986
  691. package/one/things/agents/agent-designer.md +0 -2305
  692. package/one/things/agents/agent-director.md +0 -1526
  693. package/one/things/agents/agent-documenter.md +0 -1129
  694. package/one/things/agents/agent-frontend.md +0 -1201
  695. package/one/things/agents/agent-integrator.md +0 -1269
  696. package/one/things/agents/agent-lawyer.md +0 -1371
  697. package/one/things/agents/agent-problem-solver.md +0 -1457
  698. package/one/things/agents/agent-quality.md +0 -1483
  699. package/one/things/agents/agent-sales.md +0 -1074
  700. package/one/things/cascade/cascade.yaml +0 -481
  701. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +0 -523
  702. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +0 -314
  703. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +0 -562
  704. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +0 -543
  705. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +0 -272
  706. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +0 -548
  707. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +0 -586
  708. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +0 -267
  709. package/one/things/cascade/docs/examples/1-3-event-coordination.md +0 -547
  710. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +0 -665
  711. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +0 -236
  712. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +0 -652
  713. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +0 -860
  714. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +0 -255
  715. package/one/things/cascade/docs/examples/1-5-quality-loops.md +0 -725
  716. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +0 -659
  717. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +0 -256
  718. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +0 -639
  719. package/one/things/cascade/docs/examples/readme.md +0 -259
  720. package/one/things/cascade/docs/getting-started.md +0 -533
  721. package/one/things/cascade/docs/workflow.md +0 -1378
  722. package/one/things/cascade/readme.md +0 -379
  723. package/one/things/cascade/templates/feature-template.md +0 -289
  724. package/one/things/claude/agents/advocacy-activation-manager.md +0 -710
  725. package/one/things/claude/agents/advocacy-campaign-designer.md +0 -688
  726. package/one/things/claude/agents/analyst.md +0 -508
  727. package/one/things/claude/agents/architect.md +0 -505
  728. package/one/things/claude/agents/brand-identity-specialist.md +0 -538
  729. package/one/things/claude/agents/bstp-token-strategist.md +0 -690
  730. package/one/things/claude/agents/builder-repo.md +0 -532
  731. package/one/things/claude/agents/bullstamp-community-builder.md +0 -597
  732. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +0 -529
  733. package/one/things/claude/agents/bulltilt-platform-growth.md +0 -590
  734. package/one/things/claude/agents/company-bullstamp-character.md +0 -602
  735. package/one/things/claude/agents/company-bullstamp-community.md +0 -307
  736. package/one/things/claude/agents/company-bullstamp-marketing.md +0 -307
  737. package/one/things/claude/agents/company-bullstamp-token.md +0 -307
  738. package/one/things/claude/agents/company-bulltilt-growth.md +0 -307
  739. package/one/things/claude/agents/content-bibliography-formatter.md +0 -404
  740. package/one/things/claude/agents/content-calendar-planner.md +0 -473
  741. package/one/things/claude/agents/content-chapter-formatter.md +0 -513
  742. package/one/things/claude/agents/content-formatter.md +0 -571
  743. package/one/things/claude/agents/content-hook-specialist.md +0 -485
  744. package/one/things/claude/agents/content-image-formatter.md +0 -560
  745. package/one/things/claude/agents/content-introduction-formatter.md +0 -510
  746. package/one/things/claude/agents/content-multiplication-engine.md +0 -579
  747. package/one/things/claude/agents/content-playbook-writer.md +0 -473
  748. package/one/things/claude/agents/content-team-manager.md +0 -647
  749. package/one/things/claude/agents/content-toc-formatter.md +0 -547
  750. package/one/things/claude/agents/convex-backend-specialist.md +0 -2725
  751. package/one/things/claude/agents/core-manager.md +0 -607
  752. package/one/things/claude/agents/core-master.md +0 -426
  753. package/one/things/claude/agents/cross-functional-manager.md +0 -476
  754. package/one/things/claude/agents/crypto-airdrop-strategist.md +0 -622
  755. package/one/things/claude/agents/crypto-analytics-educator.md +0 -596
  756. package/one/things/claude/agents/crypto-architecture-specialist.md +0 -497
  757. package/one/things/claude/agents/crypto-community-analyst.md +0 -314
  758. package/one/things/claude/agents/crypto-community-psychologist.md +0 -546
  759. package/one/things/claude/agents/crypto-dex-optimization-expert.md +0 -579
  760. package/one/things/claude/agents/crypto-dex-optimizer.md +0 -307
  761. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +0 -552
  762. package/one/things/claude/agents/crypto-diamond-hands.md +0 -307
  763. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +0 -597
  764. package/one/things/claude/agents/crypto-engagement-specialist.md +0 -581
  765. package/one/things/claude/agents/crypto-market-researcher.md +0 -307
  766. package/one/things/claude/agents/crypto-marketing-orchestrator.md +0 -563
  767. package/one/things/claude/agents/crypto-network-effect-amplifier.md +0 -614
  768. package/one/things/claude/agents/crypto-optimization-analyst.md +0 -597
  769. package/one/things/claude/agents/crypto-strategic-synthesizer.md +0 -556
  770. package/one/things/claude/agents/crypto-team-manager.md +0 -392
  771. package/one/things/claude/agents/crypto-token-analyst.md +0 -319
  772. package/one/things/claude/agents/crypto-viral-content-creator.md +0 -549
  773. package/one/things/claude/agents/crypto-wallet-identification-expert.md +0 -527
  774. package/one/things/claude/agents/crypto-wallet-identifier.md +0 -307
  775. package/one/things/claude/agents/customer-journey-designer.md +0 -474
  776. package/one/things/claude/agents/customer-success-manager.md +0 -574
  777. package/one/things/claude/agents/dev.md +0 -406
  778. package/one/things/claude/agents/documenter.md +0 -548
  779. package/one/things/claude/agents/elevate-marketing-orchestrator.md +0 -403
  780. package/one/things/claude/agents/engagement-specialist.md +0 -502
  781. package/one/things/claude/agents/engineering-architect.md +0 -387
  782. package/one/things/claude/agents/engineering-business-analyst.md +0 -527
  783. package/one/things/claude/agents/engineering-developer.md +0 -386
  784. package/one/things/claude/agents/engineering-director.md +0 -322
  785. package/one/things/claude/agents/engineering-ingestor.md +0 -659
  786. package/one/things/claude/agents/engineering-product-manager.md +0 -525
  787. package/one/things/claude/agents/engineering-product-owner.md +0 -527
  788. package/one/things/claude/agents/engineering-project-coordinator.md +0 -525
  789. package/one/things/claude/agents/engineering-quality-assurance.md +0 -392
  790. package/one/things/claude/agents/engineering-team-manager.md +0 -515
  791. package/one/things/claude/agents/engineering-user-experience.md +0 -386
  792. package/one/things/claude/agents/framework-elevate-manager.md +0 -309
  793. package/one/things/claude/agents/improver.md +0 -805
  794. package/one/things/claude/agents/intelligence-team-manager.md +0 -390
  795. package/one/things/claude/agents/lead-capture-expert.md +0 -459
  796. package/one/things/claude/agents/lead-magnet-creator.md +0 -446
  797. package/one/things/claude/agents/market-research-analyst.md +0 -435
  798. package/one/things/claude/agents/marketing-brand-identity.md +0 -344
  799. package/one/things/claude/agents/marketing-content-hooks.md +0 -455
  800. package/one/things/claude/agents/marketing-content-multiplier.md +0 -331
  801. package/one/things/claude/agents/marketing-content-poster.md +0 -372
  802. package/one/things/claude/agents/marketing-customer-journey.md +0 -331
  803. package/one/things/claude/agents/marketing-director.md +0 -402
  804. package/one/things/claude/agents/marketing-engagement.md +0 -331
  805. package/one/things/claude/agents/marketing-lead-capture.md +0 -331
  806. package/one/things/claude/agents/marketing-lead-magnet.md +0 -331
  807. package/one/things/claude/agents/marketing-network-effects.md +0 -331
  808. package/one/things/claude/agents/marketing-nurture-campaigns.md +0 -331
  809. package/one/things/claude/agents/marketing-share-optimizer.md +0 -331
  810. package/one/things/claude/agents/marketing-team-manager.md +0 -451
  811. package/one/things/claude/agents/marketing-viral-growth.md +0 -232
  812. package/one/things/claude/agents/mission-commander.md +0 -378
  813. package/one/things/claude/agents/network-effect-analyst.md +0 -604
  814. package/one/things/claude/agents/nextjs-15-specialist.md +0 -1634
  815. package/one/things/claude/agents/npx.md +0 -946
  816. package/one/things/claude/agents/nurture-campaign-manager.md +0 -554
  817. package/one/things/claude/agents/one-master.md +0 -378
  818. package/one/things/claude/agents/one-orchestrator.md +0 -345
  819. package/one/things/claude/agents/one.md +0 -658
  820. package/one/things/claude/agents/playbook-generator.md +0 -526
  821. package/one/things/claude/agents/pm.md +0 -349
  822. package/one/things/claude/agents/po.md +0 -370
  823. package/one/things/claude/agents/qa.md +0 -361
  824. package/one/things/claude/agents/research-foundation-analyst.md +0 -324
  825. package/one/things/claude/agents/research-intelligence-gatherer.md +0 -435
  826. package/one/things/claude/agents/research-market-analyst.md +0 -324
  827. package/one/things/claude/agents/research-team-manager.md +0 -489
  828. package/one/things/claude/agents/sales-environment-optimizer.md +0 -519
  829. package/one/things/claude/agents/sales-team-manager.md +0 -407
  830. package/one/things/claude/agents/sales-upsell-strategist.md +0 -324
  831. package/one/things/claude/agents/service-advocacy-campaigns.md +0 -324
  832. package/one/things/claude/agents/service-advocacy-manager.md +0 -324
  833. package/one/things/claude/agents/service-success-manager.md +0 -324
  834. package/one/things/claude/agents/service-team-manager.md +0 -405
  835. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +0 -2357
  836. package/one/things/claude/agents/share-optimization-specialist.md +0 -576
  837. package/one/things/claude/agents/sm.md +0 -352
  838. package/one/things/claude/agents/story-teller.md +0 -498
  839. package/one/things/claude/agents/task-master.md +0 -621
  840. package/one/things/claude/agents/tauri-cross-platform-specialist.md +0 -1912
  841. package/one/things/claude/agents/tester.md +0 -595
  842. package/one/things/claude/agents/the-bull-character-manager.md +0 -603
  843. package/one/things/claude/agents/tools-playbook-generator.md +0 -492
  844. package/one/things/claude/agents/turbo-repo-builder.md +0 -346
  845. package/one/things/claude/agents/upsell-strategist.md +0 -503
  846. package/one/things/claude/agents/ux-expert.md +0 -360
  847. package/one/things/claude/agents/viral-growth-orchestrator.md +0 -520
  848. package/one/things/claude/claude-code-hooks-development.json +0 -21
  849. package/one/things/claude/claude-code-hooks-production.json +0 -21
  850. package/one/things/claude/claude-code-hooks.json +0 -25
  851. package/one/things/claude/commands/agent.md +0 -124
  852. package/one/things/claude/commands/cascade-status.md +0 -153
  853. package/one/things/claude/commands/ingest.md +0 -343
  854. package/one/things/claude/commands/ingestor.md +0 -158
  855. package/one/things/claude/commands/mission.md +0 -103
  856. package/one/things/claude/commands/npx.md +0 -156
  857. package/one/things/claude/commands/one.md +0 -486
  858. package/one/things/claude/commands/quality-check.md +0 -252
  859. package/one/things/claude/commands/smart-route.md +0 -261
  860. package/one/things/claude/commands/start.md +0 -139
  861. package/one/things/claude/commands/story.md +0 -103
  862. package/one/things/claude/commands/task.md +0 -193
  863. package/one/things/claude/hook-bypass.json +0 -32
  864. package/one/things/claude/hooks/agent-hook-config.json +0 -427
  865. package/one/things/claude/hooks/build-hook.sh +0 -156
  866. package/one/things/claude/hooks/cleanup-hook.sh +0 -201
  867. package/one/things/claude/hooks/file-organization-hook.sh +0 -80
  868. package/one/things/claude/hooks/format-hook.sh +0 -43
  869. package/one/things/claude/hooks/hook-bypass.sh +0 -293
  870. package/one/things/claude/hooks/hook-debouncer.sh +0 -62
  871. package/one/things/claude/hooks/hook-logger.sh +0 -89
  872. package/one/things/claude/hooks/lint-hook.sh +0 -140
  873. package/one/things/claude/hooks/notification-hook.sh +0 -204
  874. package/one/things/claude/hooks/ontology-validation-hook.sh +0 -86
  875. package/one/things/claude/hooks/performance-metrics.json +0 -25
  876. package/one/things/claude/hooks/security-hook.sh +0 -256
  877. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +0 -210
  878. package/one/things/claude/hooks/story-validation-hook.sh +0 -145
  879. package/one/things/claude/hooks/test-hook.sh +0 -145
  880. package/one/things/claude/hooks/test-story-validation.sh +0 -170
  881. package/one/things/claude/settings-local.json +0 -86
  882. package/one/things/cli/cli-code.md +0 -677
  883. package/one/things/cli/cli-compiler-code.md +0 -677
  884. package/one/things/cli/cli.md +0 -871
  885. package/one/things/components/card-shadcn.md +0 -953
  886. package/one/things/components/card.md +0 -1041
  887. package/one/things/components.md +0 -1743
  888. package/one/things/componets.md +0 -19
  889. package/one/things/contracts/Move.toml +0 -12
  890. package/one/things/contracts/README.md +0 -288
  891. package/one/things/contracts/one.move +0 -762
  892. package/one/things/contracts/sdk.ts +0 -579
  893. package/one/things/creator-diagram.md +0 -184
  894. package/one/things/crypto/FEATURES.md +0 -78
  895. package/one/things/crypto/ONECORE.md +0 -62
  896. package/one/things/crypto/ONECOREFAQ.md +0 -22
  897. package/one/things/crypto/ONECOREHOW.md +0 -46
  898. package/one/things/crypto/ONEENTERPRISE.md +0 -64
  899. package/one/things/crypto/ONEENTERPRISEFAQ.md +0 -64
  900. package/one/things/crypto/ONEENTERPRISEHOW.md +0 -53
  901. package/one/things/crypto/ONEPRO.md +0 -60
  902. package/one/things/crypto/ONEPROFAQ.md +0 -22
  903. package/one/things/crypto/ONEPROHOW.md +0 -53
  904. package/one/things/crypto/READMEAGENCY.md +0 -64
  905. package/one/things/crypto/VSL.md +0 -45
  906. package/one/things/crypto/WebsiteCopy.md +0 -176
  907. package/one/things/demo-accessibility-animations.md +0 -1025
  908. package/one/things/demo-components.md +0 -1310
  909. package/one/things/demo-design-summary.md +0 -692
  910. package/one/things/demo-design-system.md +0 -973
  911. package/one/things/demo-page-layouts.md +0 -1016
  912. package/one/things/design-system.md +0 -832
  913. package/one/things/designs/accessibility-audit.md +0 -877
  914. package/one/things/designs/component-specifications.md +0 -855
  915. package/one/things/designs/design-overview.md +0 -377
  916. package/one/things/designs/design-tokens.md +0 -448
  917. package/one/things/designs/wireframes-dashboard.md +0 -710
  918. package/one/things/docs/api-requests.md +0 -987
  919. package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +0 -485
  920. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +0 -465
  921. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +0 -425
  922. package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +0 -451
  923. package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +0 -536
  924. package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +0 -650
  925. package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +0 -473
  926. package/one/things/docs/ecommerce/QUICK-START.md +0 -405
  927. package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +0 -567
  928. package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +0 -271
  929. package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +0 -171
  930. package/one/things/docs/ecommerce/demo.astro +0 -309
  931. package/one/things/examples/children/lemonade-stand.md +0 -404
  932. package/one/things/examples/enterprise/crm-saas.md +0 -1444
  933. package/one/things/features/1-1-agent-prompts.md +0 -562
  934. package/one/things/features/1-2-yaml-orchestrator.md +0 -548
  935. package/one/things/features/1-3-event-coordination.md +0 -547
  936. package/one/things/features/1-4-knowledge-management.md +0 -652
  937. package/one/things/features/1-5-quality-loops.md +0 -725
  938. package/one/things/features/1-6-numbering-structure.md +0 -639
  939. package/one/things/features/2-1-dataprovider-interface.md +0 -2583
  940. package/one/things/features/2-2-config-system.md +0 -3242
  941. package/one/things/features/2-3-effectts-services.md +0 -1645
  942. package/one/things/features/2-4-react-hooks.md +0 -2136
  943. package/one/things/features/2-5-auth-migration.md +0 -2144
  944. package/one/things/features/2-6-dashboard-migration.md +0 -2084
  945. package/one/things/features/2-7-alternative-providers.md +0 -2578
  946. package/one/things/features/2-7-implementation-report.md +0 -724
  947. package/one/things/features/2-cli.md +0 -1720
  948. package/one/things/features/2-design.md +0 -1770
  949. package/one/things/features/2-tests.md +0 -576
  950. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +0 -576
  951. package/one/things/features/DECOUPLING.md +0 -290
  952. package/one/things/features/DEPLOYMENT.md +0 -470
  953. package/one/things/features/IMPLEMENTATION_SUMMARY.md +0 -362
  954. package/one/things/features/improve.md +0 -861
  955. package/one/things/features/remove-convex-deps.md +0 -63
  956. package/one/things/features/top-features.md +0 -87
  957. package/one/things/features/use-one-backend.md +0 -1217
  958. package/one/things/features-in-english.md +0 -200
  959. package/one/things/files.yaml +0 -721
  960. package/one/things/ideas/1-create-workflow.md +0 -207
  961. package/one/things/ideas/2-backend-agnostic-frontend.md +0 -439
  962. package/one/things/implementation/backend-guide.md +0 -457
  963. package/one/things/interface.md +0 -257
  964. package/one/things/landing-page-implementation.md +0 -455
  965. package/one/things/legal/README.md +0 -234
  966. package/one/things/legal/privacy-policy.md +0 -1227
  967. package/one/things/legal/terms-of-service.md +0 -1432
  968. package/one/things/master-workflow-plan.md +0 -806
  969. package/one/things/pay.one.ie.md +0 -53
  970. package/one/things/plans/0-in-sync.md +0 -136
  971. package/one/things/plans/0-timeline.md +0 -36
  972. package/one/things/plans/1-create-workflow.md +0 -732
  973. package/one/things/plans/QUICK-START-SIMPLIFICATION.md +0 -333
  974. package/one/things/plans/README-SIMPLIFICATION.md +0 -349
  975. package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +0 -16
  976. package/one/things/plans/SIMPLIFICATION-SUMMARY.md +0 -455
  977. package/one/things/plans/ai-elements-integration.md +0 -483
  978. package/one/things/plans/ai-elements.md +0 -1278
  979. package/one/things/plans/ai-integration-plan.md +0 -263
  980. package/one/things/plans/ai-integration.md +0 -996
  981. package/one/things/plans/ai-sdk.md +0 -798
  982. package/one/things/plans/ai-tools.md +0 -621
  983. package/one/things/plans/app.md +0 -832
  984. package/one/things/plans/architecture-summary.md +0 -312
  985. package/one/things/plans/async-ai-agents.md +0 -233
  986. package/one/things/plans/backend-agnostic-frontend.md +0 -390
  987. package/one/things/plans/backend-cleanup-quickstart.md +0 -380
  988. package/one/things/plans/backend-ontology-conformance.md +0 -475
  989. package/one/things/plans/backend-status.md +0 -599
  990. package/one/things/plans/backend-structure.md +0 -847
  991. package/one/things/plans/backend-target-structure.md +0 -482
  992. package/one/things/plans/backend.md +0 -1175
  993. package/one/things/plans/better-auth-any-backend-revised.md +0 -1103
  994. package/one/things/plans/better-auth-any-backend.md +0 -1896
  995. package/one/things/plans/better-auth-available-features.md +0 -273
  996. package/one/things/plans/big-plan.md +0 -52
  997. package/one/things/plans/cli-updates-required.md +0 -320
  998. package/one/things/plans/complete-step-by-step.md +0 -1409
  999. package/one/things/plans/components.md +0 -709
  1000. package/one/things/plans/convex-agents.md +0 -1034
  1001. package/one/things/plans/convex-better-auth.md +0 -1141
  1002. package/one/things/plans/convex-on-off.md +0 -407
  1003. package/one/things/plans/crypto-token-researcher.md +0 -629
  1004. package/one/things/plans/data-quality-metrics.md +0 -745
  1005. package/one/things/plans/deep-researcher-agent.md +0 -466
  1006. package/one/things/plans/deploy-to-cloudflare.md +0 -623
  1007. package/one/things/plans/deployment-architecture.md +0 -469
  1008. package/one/things/plans/desktop.md +0 -1139
  1009. package/one/things/plans/development-plan.md +0 -1283
  1010. package/one/things/plans/development-workflow-tldr.md +0 -207
  1011. package/one/things/plans/development-workflow.md +0 -959
  1012. package/one/things/plans/dsl-claude-code.md +0 -1011
  1013. package/one/things/plans/effect-components.md +0 -1743
  1014. package/one/things/plans/effect-patterns-reference.md +0 -2235
  1015. package/one/things/plans/effect.md +0 -1806
  1016. package/one/things/plans/email.md +0 -966
  1017. package/one/things/plans/enhance-auth.md +0 -1692
  1018. package/one/things/plans/execution-strategy.md +0 -1291
  1019. package/one/things/plans/existing-infrastructure.md +0 -712
  1020. package/one/things/plans/feature-based-sites.md +0 -894
  1021. package/one/things/plans/frontend-effects.md +0 -1276
  1022. package/one/things/plans/group-folder-multi-tenancy.md +0 -893
  1023. package/one/things/plans/improve-codebase.md +0 -1811
  1024. package/one/things/plans/install-components.md +0 -215
  1025. package/one/things/plans/integrate-frontend-and-backend.md +0 -603
  1026. package/one/things/plans/landing.md +0 -820
  1027. package/one/things/plans/layout.md +0 -249
  1028. package/one/things/plans/mail-backend.md +0 -1361
  1029. package/one/things/plans/mail.md +0 -2677
  1030. package/one/things/plans/mcp-clear-context-prompt.md +0 -81
  1031. package/one/things/plans/mcp-simple.md +0 -248
  1032. package/one/things/plans/multi-ontology-architecture.md +0 -885
  1033. package/one/things/plans/next-features.md +0 -114
  1034. package/one/things/plans/npx-agent-safety.md +0 -785
  1035. package/one/things/plans/npx-agent.md +0 -1089
  1036. package/one/things/plans/onboarding.md +0 -51
  1037. package/one/things/plans/one-protocol-and-payone-usage.md +0 -82
  1038. package/one/things/plans/one.md +0 -677
  1039. package/one/things/plans/ontology-6-dimensions.md +0 -2201
  1040. package/one/things/plans/ontology-compliance-audit.md +0 -342
  1041. package/one/things/plans/ontology-driven-strategy.md +0 -882
  1042. package/one/things/plans/ontology-refine.md +0 -586
  1043. package/one/things/plans/ontology-ui-approach.md +0 -375
  1044. package/one/things/plans/open-agent.md +0 -840
  1045. package/one/things/plans/performace.md +0 -122
  1046. package/one/things/plans/phase-1-foundation.md +0 -620
  1047. package/one/things/plans/phase-3-implementation.md +0 -1037
  1048. package/one/things/plans/plan-connect-to-api.md +0 -146
  1049. package/one/things/plans/quick-wins.md +0 -1428
  1050. package/one/things/plans/r2.md +0 -777
  1051. package/one/things/plans/readme-backend-cleanup.md +0 -402
  1052. package/one/things/plans/release.md +0 -507
  1053. package/one/things/plans/remove-backend-development-from-agents.md +0 -1331
  1054. package/one/things/plans/repos.md +0 -98
  1055. package/one/things/plans/separate-copy-2.md +0 -1349
  1056. package/one/things/plans/separate-copy-3.md +0 -2479
  1057. package/one/things/plans/separate-copy.md +0 -1349
  1058. package/one/things/plans/separate-demo.md +0 -864
  1059. package/one/things/plans/separate.md +0 -1999
  1060. package/one/things/plans/sequence.md +0 -2040
  1061. package/one/things/plans/shadcn-integration-summary.md +0 -510
  1062. package/one/things/plans/sidebar.md +0 -206
  1063. package/one/things/plans/skills.md +0 -709
  1064. package/one/things/plans/small-fixes.md +0 -23
  1065. package/one/things/plans/start-new.md +0 -764
  1066. package/one/things/plans/switch-off-auth.md +0 -42
  1067. package/one/things/plans/sync-checklist.md +0 -351
  1068. package/one/things/plans/test-backend-connection.md +0 -514
  1069. package/one/things/plans/unified-implementation-plan.md +0 -934
  1070. package/one/things/plans/update-demos.md +0 -581
  1071. package/one/things/plans/use-our-backend.md +0 -572
  1072. package/one/things/plans/video-backend.md +0 -638
  1073. package/one/things/plans/video-frontend.md +0 -490
  1074. package/one/things/plans/video-old-archived.md +0 -656
  1075. package/one/things/plans/wave1-onboarding-100-inferences.md +0 -1686
  1076. package/one/things/plans/wave1-onboarding-vision.md +0 -744
  1077. package/one/things/plans/wave1-orchestration-summary.md +0 -604
  1078. package/one/things/plans/wave1-specialist-assignments.md +0 -1413
  1079. package/one/things/plans/workflow-files.md +0 -1210
  1080. package/one/things/plans/workflow.md +0 -1378
  1081. package/one/things/plans-u.md +0 -905
  1082. package/one/things/products/Blockchain Products.md +0 -6278
  1083. package/one/things/products/cascade-landing-page.md +0 -841
  1084. package/one/things/products/cascade.md +0 -1568
  1085. package/one/things/products/context-engineering.md +0 -1488
  1086. package/one/things/products/onthology.md +0 -15
  1087. package/one/things/products/ontology-ui-shadcn.md +0 -1302
  1088. package/one/things/products/ontology-ui.md +0 -1429
  1089. package/one/things/products/ontology.md +0 -789
  1090. package/one/things/products/sdk.md +0 -573
  1091. package/one/things/promptkit.md +0 -930
  1092. package/one/things/repos/all-repos.md +0 -0
  1093. package/one/things/scripts-clean-mac.sh +0 -409
  1094. package/one/things/service-providers-new.md +0 -1052
  1095. package/one/things/service-providers.md +0 -1121
  1096. package/one/things/structure.md +0 -532
  1097. package/one/things/system.md +0 -618
  1098. package/one/things/templates.md +0 -294
  1099. package/one/things/tests/2-1-dataprovider-interface.md +0 -1216
  1100. package/one/things/tests/2-1-test-analysis.md +0 -544
  1101. package/one/things/things.md +0 -384
  1102. package/one/things/todo-acp-integration.md +0 -744
  1103. package/one/things/todo-ai.md +0 -933
  1104. package/one/things/todo-api.md +0 -1078
  1105. package/one/things/todo-assignment.md +0 -580
  1106. package/one/things/todo-buy-chatgpt.md +0 -1450
  1107. package/one/things/todo-components.md +0 -1683
  1108. package/one/things/todo-connections.md +0 -278
  1109. package/one/things/todo-ecommerce-frontend.md +0 -1313
  1110. package/one/things/todo-ecommerce.md +0 -569
  1111. package/one/things/todo-effects.md +0 -1075
  1112. package/one/things/todo-frontend-effects.md +0 -977
  1113. package/one/things/todo-landing-page.md +0 -1091
  1114. package/one/things/todo-mail.md +0 -1160
  1115. package/one/things/todo-master-plan.md +0 -490
  1116. package/one/things/todo-onboard.md +0 -666
  1117. package/one/things/todo-one-ie.md +0 -538
  1118. package/one/things/todo-page.md +0 -606
  1119. package/one/things/todo-plans.md +0 -282
  1120. package/one/things/todo-projects.md +0 -241
  1121. package/one/things/todo-refactoring-plan.md +0 -366
  1122. package/one/things/todo-release.md +0 -654
  1123. package/one/things/todo-sequence.md +0 -1621
  1124. package/one/things/todo-use-our-backend.md +0 -1908
  1125. package/one/things/todo-workflow.md +0 -626
  1126. package/one/things/todo-x402.md +0 -2047
  1127. package/one/things/todo.md +0 -21
  1128. package/one/things/video/scripts-crypto.md +0 -835
  1129. package/one/things/video-script-backup.md +0 -318
  1130. package/one/things/video-script-demo.md +0 -382
  1131. package/one/things/video-script-ontology.md +0 -333
  1132. package/one/things/video-script.md +0 -361
@@ -1,2475 +0,0 @@
1
- ---
2
- title: Ontology Frontend
3
- dimension: knowledge
4
- category: ontology-frontend.md
5
- tags: 6-dimensions, agent, architecture, backend, frontend, ontology, testing, ui
6
- related_dimensions: connections, events, groups, people, things
7
- scope: global
8
- created: 2025-11-03
9
- updated: 2025-11-03
10
- version: 1.0.0
11
- ai_context: |
12
- This document is part of the knowledge dimension in the ontology-frontend.md category.
13
- Location: one/knowledge/ontology-frontend.md
14
- Purpose: Documents frontend development ontology
15
- Related dimensions: connections, events, groups, people, things
16
- For AI agents: Read this to understand ontology frontend.
17
- ---
18
-
19
- # Frontend Development Ontology
20
-
21
- **Version:** 2.0.0
22
- **Type System:** Formal ontology for backend-agnostic Astro website development
23
- **Paradigm:** Pure declarative type theory + Provider pattern + Context engineering
24
-
25
- ---
26
-
27
- ## Table of Contents
28
-
29
- 1. [Core Axioms](#core-axioms)
30
- 2. [Provider Pattern & Context Engineering](#provider-pattern--context-engineering)
31
- 3. [Type Hierarchy](#type-hierarchy)
32
- 4. [Critical Distinctions](#critical-distinctions)
33
- 5. [State Management Hierarchy](#state-management-hierarchy)
34
- 6. [DataProvider Interface](#dataprovider-interface-universal-api)
35
- 7. [Entity Definitions](#entity-definitions)
36
- 8. [Multi-Tenant Architecture](#multi-tenant-architecture)
37
- 9. [Caching Ontology](#caching-ontology)
38
- 10. [Error Propagation Ontology](#error-propagation-ontology)
39
- 11. [Testing Ontology](#testing-ontology)
40
- 12. [Pattern Language](#pattern-language)
41
- 13. [Type Sync Automation](#type-sync-automation)
42
- 14. [Observability Layer](#observability-layer)
43
- 15. [Agent Task Mapping](#agent-task-mapping)
44
- 16. [Common Mistakes](#common-mistakes)
45
- 17. [Summary](#summary)
46
-
47
- ---
48
-
49
- ## Core Axioms
50
-
51
- ### Axiom 1: Everything is a Thing
52
-
53
- ```
54
- ∀x ∈ Frontend → x : Thing
55
- Thing ::= Page | Component | Content | Service | Provider | Configuration
56
- ```
57
-
58
- ### Axiom 2: All Things Have Type
59
-
60
- ```
61
- type : Thing → TypeID
62
- TypeID ::= String ∈ ontology.things.types
63
- ```
64
-
65
- ### Axiom 3: Things Connect
66
-
67
- ```
68
- connect : Thing × Thing → Connection
69
- Connection ::= { from: Thing, to: Thing, type: RelationType, metadata: Object }
70
- ```
71
-
72
- ### Axiom 4: Actions Emit Events
73
-
74
- ```
75
- action : Thing → Event
76
- Event ::= { type: EventType, actor: Thing, target: Thing, timestamp: Time, metadata: Object }
77
- ```
78
-
79
- ### Axiom 5: Patterns Compose
80
-
81
- ```
82
- compose : Pattern × Pattern → Pattern
83
- Pattern ::= { type: PatternType, inputs: [Thing], outputs: [Thing], transform: Function }
84
- ```
85
-
86
- ### Axiom 6: Backend Agnosticism
87
-
88
- ```
89
- ∀Provider. Provider implements DataProviderInterface → Frontend works with Provider
90
- DataProviderInterface ::= { organizations, people, things, connections, events, knowledge }
91
- ```
92
-
93
- ### Axiom 7: Context Minimalism
94
-
95
- ```
96
- ∀Operation. Load only required types, not implementations
97
- ContextUsed << ContextAvailable
98
- target_reduction: 98%+
99
- ```
100
-
101
- **Key Principle:** Frontend knows 6-dimension ontology, not backend implementation.
102
-
103
- ---
104
-
105
- ## Provider Pattern & Context Engineering
106
-
107
- ### The Core Insight: Providers ARE Context Loaders
108
-
109
- ```typescript
110
- {
111
- insight: "Provider pattern = 99.9% context reduction"
112
-
113
- // ❌ Traditional: Load entire backend
114
- traditionalApproach: {
115
- load: "Full Convex schema + all implementations + all docs",
116
- tokens: 280_000,
117
- problem: "Frontend context explodes with backend knowledge"
118
- }
119
-
120
- // ✅ Provider pattern: Load only interface
121
- providerApproach: {
122
- load: "DataProviderInterface only (contract)",
123
- tokens: 300,
124
- benefit: "Frontend never loads backend implementation"
125
- }
126
-
127
- // Backend translation happens at runtime (0 frontend tokens)
128
- execution: {
129
- frontend: "provider.things.get(id)", // Uses interface
130
- provider: "convexClient.query(...)", // Translates to backend
131
- backend: "Database query", // Executes
132
- result: "Frontend context = 300 tokens (not 280k)"
133
- }
134
-
135
- result: {
136
- context_reduction: "99.9%",
137
- backend_flexibility: "infinite (swap with config)",
138
- type_safety: "Effect.ts typed errors",
139
- testability: "Mock provider for tests"
140
- }
141
- }
142
- ```
143
-
144
- ### Provider as Just-In-Time Loader
145
-
146
- ```typescript
147
- // Traditional AI code generation
148
- ❌ function generateCourseComponent_Traditional() {
149
- context = {
150
- convexSchema: loadConvexSchema(), // 15,000 tokens
151
- convexMutations: loadMutations(), // 20,000 tokens
152
- convexQueries: loadQueries(), // 18,000 tokens
153
- implementations: loadImplementations() // 50,000 tokens
154
- } // Total: 103,000 tokens
155
-
156
- return ai.generate(task, context)
157
- }
158
-
159
- // ✅ Provider pattern
160
- ✅ function generateCourseComponent_Provider() {
161
- context = {
162
- interface: "DataProviderInterface", // 300 tokens
163
- operations: ["things.get", "things.list"] // Which operations needed
164
- } // Total: 300 tokens
165
-
166
- // AI generates code using interface
167
- code = ai.generate(task, context)
168
- // Result: provider.things.get(id) - works with ANY backend
169
-
170
- return code
171
- }
172
-
173
- // Savings: 103,000 → 300 tokens = 99.7% reduction
174
- ```
175
-
176
- ### Context Engineering Formula
177
-
178
- ```typescript
179
- {
180
- traditional: {
181
- formula: "ContextSize = Σ(all_files + all_docs + all_examples)",
182
- typical: "50k-300k tokens per request",
183
- problem: "Hits context limits, slow, expensive"
184
- },
185
-
186
- provider: {
187
- formula: "ContextSize = interface_definition + operation_signatures",
188
- typical: "300-500 tokens per request",
189
- benefit: "Never hits limits, fast, cheap, infinite backends"
190
- },
191
-
192
- improvement: {
193
- context_reduction: "99%+",
194
- cost_reduction: "100x cheaper",
195
- speed_improvement: "10x faster",
196
- backend_flexibility: "∞ backends supported"
197
- }
198
- }
199
- ```
200
-
201
- ---
202
-
203
- ## Type Hierarchy
204
-
205
- ### Base Types
206
-
207
- ```
208
- Thing
209
- ├── Artifact // Code artifacts (what agents create)
210
- │ ├── Page
211
- │ │ ├── LandingPage
212
- │ │ ├── BlogIndex
213
- │ │ ├── BlogPost
214
- │ │ ├── AppPage
215
- │ │ ├── AccountPage
216
- │ │ └── APIRoute
217
- │ ├── Component
218
- │ │ ├── UIComponent
219
- │ │ ├── FeatureComponent
220
- │ │ ├── Layout
221
- │ │ └── Island
222
- │ ├── Content
223
- │ │ ├── Collection
224
- │ │ ├── Entry
225
- │ │ └── Schema
226
- │ ├── Service // Effect.ts services (type-safe data operations)
227
- │ │ ├── GenericService // Handles all 66 types (ThingService, ConnectionService)
228
- │ │ └── SpecializedService // Optional convenience (CourseService)
229
- │ ├── Provider // Backend implementations (swap backends)
230
- │ │ ├── ConvexProvider // Convex backend
231
- │ │ ├── WordPressProvider // WordPress REST API
232
- │ │ ├── NotionProvider // Notion databases
233
- │ │ ├── SupabaseProvider // Supabase PostgreSQL
234
- │ │ └── CustomProvider // Any backend
235
- │ └── Configuration // Display & provider config (NOT business logic)
236
- │ ├── DisplayConfig // UI labels, icons, colors
237
- │ └── ProviderConfig // Backend URL, API keys
238
- ├── Pattern // Reusable templates
239
- │ ├── PagePattern
240
- │ ├── ComponentPattern
241
- │ ├── DataPattern
242
- │ ├── ServicePattern
243
- │ └── StylePattern
244
- ├── Interface // Abstract contracts
245
- │ ├── DataProviderInterface // Universal 6-dimension API
246
- │ └── SubscriptionInterface // Real-time updates (optional)
247
- ├── Capability // Agent capabilities
248
- │ ├── Create
249
- │ ├── Read
250
- │ ├── Update
251
- │ └── Delete
252
- └── Context // Execution context
253
- ├── TypeContext
254
- ├── PatternContext
255
- └── ExampleContext
256
- ```
257
-
258
- ---
259
-
260
- ## Critical Distinctions
261
-
262
- ### What Frontend IS
263
-
264
- ```typescript
265
- type FrontendResponsibility =
266
- | { type: "render"; data: any } // Display UI from data
267
- | { type: "call_provider"; operation: DataOperation } // Call DataProvider (not direct backend)
268
- | { type: "manage_ui_state"; state: UIState } // Form inputs, modals, loading (component-local)
269
- | { type: "route"; path: Path } // Client-side navigation
270
- | { type: "cache_display"; data: CachedData }; // Cache UI data (not business data)
271
- ```
272
-
273
- ### What Frontend IS NOT
274
-
275
- ```typescript
276
- type FrontendProhibition =
277
- | { type: "database_access"; reason: "Backend-only (provider abstracts)" }
278
- | {
279
- type: "business_logic";
280
- reason: "Backend validates (frontend calls provider)";
281
- }
282
- | { type: "event_logging"; reason: "Backend logs (frontend just triggers)" }
283
- | {
284
- type: "authorization";
285
- reason: "Backend authorizes (frontend just checks state)";
286
- }
287
- | {
288
- type: "data_validation";
289
- reason: "Backend validates (frontend UX hints only)";
290
- }
291
- | {
292
- type: "org_filtering";
293
- reason: "Provider handles (frontend never filters by org)";
294
- }
295
- | {
296
- type: "backend_specific_code";
297
- reason: "Provider abstracts (frontend uses interface)";
298
- };
299
- ```
300
-
301
- ---
302
-
303
- ## State Management Hierarchy
304
-
305
- ### Four-Layer State Architecture
306
-
307
- ```typescript
308
- {
309
- // Level 1: Server State (Provider owns - SOURCE OF TRUTH)
310
- ServerState: {
311
- owner: "Provider (backed by database)",
312
- source: "Backend database",
313
- access: "Query/Mutation via provider.interface only",
314
- examples: [
315
- "course list",
316
- "user profile",
317
- "enrollment count",
318
- "lesson progress"
319
- ],
320
- caching: "Provider-level (Cloudflare KV, Edge cache)",
321
- lifetime: "Persistent (until backend changes)",
322
- rule: "NEVER duplicate in frontend state. Query when needed."
323
- },
324
-
325
- // Level 2: SSR State (Astro owns - REQUEST SCOPED)
326
- SSRState: {
327
- owner: "Astro page (.astro files)",
328
- source: "Server-side provider fetch",
329
- access: "Props passed to components",
330
- examples: [
331
- "Initial page data (course details)",
332
- "SEO metadata (title, description)",
333
- "Organization context (from subdomain)"
334
- ],
335
- lifetime: "One HTTP request (not persisted)",
336
- pattern: `
337
- ---
338
- const course = await provider.things.get(id)
339
- ---
340
- <Layout title={course.name}>
341
- <CourseDetail course={course} />
342
- </Layout>
343
- `,
344
- rule: "Use for SEO, initial render, server-only data"
345
- },
346
-
347
- // Level 3: Island State (React owns - COMPONENT SCOPED)
348
- IslandState: {
349
- owner: "React component (useState/useReducer)",
350
- source: "Component-local logic",
351
- access: "Component-private (not shared)",
352
- examples: [
353
- "Form input values",
354
- "Modal open/closed",
355
- "Dropdown expanded",
356
- "Loading spinner visible"
357
- ],
358
- lifetime: "Component mounted (unmount = state destroyed)",
359
- pattern: `
360
- export function CourseForm() {
361
- const [title, setTitle] = useState('')
362
- const [loading, setLoading] = useState(false)
363
- // State dies when component unmounts
364
- }
365
- `,
366
- rule: "UI-only state. Never duplicate server state."
367
- },
368
-
369
- // Level 4: Shared Client State (Nanostores owns - SESSION SCOPED)
370
- SharedState: {
371
- owner: "Nanostores (global atoms)",
372
- source: "Cross-component coordination",
373
- access: "Multiple components subscribe",
374
- examples: [
375
- "Sidebar expanded/collapsed",
376
- "Dark/light theme preference",
377
- "User locale (en/es/fr)",
378
- "Toast notifications"
379
- ],
380
- lifetime: "Browser session + localStorage",
381
- pattern: `
382
- // stores/layout.ts
383
- export const sidebarExpanded = atom(true)
384
-
385
- // Component A
386
- const expanded = useStore(sidebarExpanded)
387
-
388
- // Component B (synced with A)
389
- const expanded = useStore(sidebarExpanded)
390
- `,
391
- rule: "UI preferences only. NOT server data."
392
- },
393
-
394
- // Anti-Pattern: Duplicating Server State
395
- antiPattern: {
396
- problem: "Storing server data in frontend state",
397
- example: `
398
- ❌ const [courses, setCourses] = useState([])
399
- ❌ useEffect(() => {
400
- provider.things.list('course').then(setCourses)
401
- }, [])
402
- // Problem: Server state duplicated in frontend
403
- // Problem: Stale data, manual sync, cache invalidation
404
- `,
405
- solution: `
406
- ✅ const courses = useQuery(api.courses.list)
407
- // Provider handles caching, revalidation, subscriptions
408
- // Frontend just renders. No state duplication.
409
- `
410
- },
411
-
412
- // Golden Rule
413
- rule: "State lives at HIGHEST appropriate level. Don't lift unnecessarily."
414
-
415
- // Decision Tree
416
- decisionTree: {
417
- question: "Does this state persist after page reload?",
418
- yes: {
419
- question: "Is this data from backend?",
420
- yes: "ServerState (provider query)",
421
- no: "SharedState (nanostores + localStorage)"
422
- },
423
- no: {
424
- question: "Do multiple components need this state?",
425
- yes: "SharedState (nanostores, session-only)",
426
- no: {
427
- question: "Is this SSR data?",
428
- yes: "SSRState (Astro props)",
429
- no: "IslandState (useState)"
430
- }
431
- }
432
- }
433
- }
434
- ```
435
-
436
- ---
437
-
438
- ## DataProvider Interface (Universal API)
439
-
440
- ### Core Contract
441
-
442
- ```typescript
443
- // ALL backends must implement this interface
444
- interface DataProviderInterface {
445
- // Dimension 1: Organizations
446
- organizations: {
447
- get: (id: string) → Effect<Organization, OrganizationNotFoundError>
448
- list: (params: ListParams) → Effect<Organization[], Error>
449
- update: (id: string, updates: Partial<Organization>) → Effect<void, Error>
450
- }
451
-
452
- // Dimension 2: People
453
- people: {
454
- get: (id: string) → Effect<Person, PersonNotFoundError | UnauthorizedError>
455
- list: (params: ListParams) → Effect<Person[], Error>
456
- create: (input: CreatePersonInput) → Effect<string, PersonCreateError>
457
- update: (id: string, updates: Partial<Person>) → Effect<void, Error>
458
- delete: (id: string) → Effect<void, Error>
459
- }
460
-
461
- // Dimension 3: Things
462
- things: {
463
- get: (id: string) → Effect<Thing, ThingNotFoundError | UnauthorizedError>
464
- list: (params: { type: ThingType; groupId?: string; filters?: any }) → Effect<Thing[], Error>
465
- create: (input: CreateThingInput) → Effect<string, ThingCreateError>
466
- update: (id: string, updates: Partial<Thing>) → Effect<void, Error>
467
- delete: (id: string) → Effect<void, Error>
468
- }
469
-
470
- // Dimension 4: Connections
471
- connections: {
472
- create: (input: CreateConnectionInput) → Effect<string, ConnectionCreateError>
473
- getRelated: (params: { thingId: string; relationshipType: ConnectionType; direction: Direction }) → Effect<Thing[], Error>
474
- getCount: (thingId: string, relationshipType: ConnectionType) → Effect<number, Error>
475
- delete: (id: string) → Effect<void, Error>
476
- }
477
-
478
- // Dimension 5: Events
479
- events: {
480
- log: (event: LogEventInput) → Effect<void, Error>
481
- query: (params: EventQueryParams) → Effect<Event[], Error>
482
- }
483
-
484
- // Dimension 6: Knowledge
485
- knowledge: {
486
- embed: (params: EmbedParams) → Effect<string, Error>
487
- search: (params: SearchParams) → Effect<KnowledgeMatch[], Error>
488
- }
489
-
490
- // Optional: Real-time subscriptions (not all backends support)
491
- subscriptions?: {
492
- watchThing: (id: string) → Effect<Observable<Thing>, Error>
493
- watchList: (type: ThingType, groupId?: string) → Effect<Observable<Thing[]>, Error>
494
- }
495
- }
496
- ```
497
-
498
- ### Provider Algebra
499
-
500
- ```typescript
501
- // Provider composition
502
- implement : Backend × DataProviderInterface → Provider
503
-
504
- // Examples:
505
- ConvexProvider = implement(ConvexBackend, DataProviderInterface)
506
- WordPressProvider = implement(WordPressBackend, DataProviderInterface)
507
- NotionProvider = implement(NotionBackend, DataProviderInterface)
508
-
509
- // Swapping backends (change ONE line in config)
510
- config.provider = ConvexProvider({ url: "..." })
511
- // OR
512
- config.provider = WordPressProvider({ url: "...", apiKey: "..." })
513
- // OR
514
- config.provider = NotionProvider({ apiKey: "...", databaseId: "..." })
515
-
516
- // Result: Frontend components don't change
517
- ```
518
-
519
- ---
520
-
521
- ## Entity Definitions
522
-
523
- ### Services (Effect.ts Layer)
524
-
525
- ```typescript
526
- // Generic Service (handles ALL 66 thing types)
527
- type GenericService = Service & {
528
- subtype: "generic"
529
- coverage: ThingType[] // All 66 types
530
- operations: CRUD
531
-
532
- invariant: {
533
- backend_agnostic: true // Works with ANY provider
534
- type_safe: true // Effect.ts typed errors
535
- composable: true // Combines into workflows
536
- }
537
- }
538
-
539
- // Example: ThingService handles courses, lessons, products, EVERYTHING
540
- type ThingService = GenericService & {
541
- name: "ThingService"
542
- operations: {
543
- get: (id: string) → Effect<Thing, ThingNotFoundError>
544
- list: (type: ThingType, orgId?: string) → Effect<Thing[], Error>
545
- create: (input: CreateThingInput) → Effect<string, ThingCreateError>
546
- update: (id: string, updates: any) → Effect<void, Error>
547
- delete: (id: string) → Effect<void, Error>
548
- }
549
-
550
- // Delegates to configured provider
551
- implementation: (provider: DataProvider) => ({
552
- get: (id) => provider.things.get(id),
553
- list: (type, groupId) => provider.things.list({ type, groupId }),
554
- // ...
555
- })
556
- }
557
-
558
- // Example: ConnectionService handles ALL relationship types
559
- type ConnectionService = GenericService & {
560
- name: "ConnectionService"
561
- operations: {
562
- create: (input: CreateConnectionInput) → Effect<string, ConnectionCreateError>
563
- getRelated: (thingId, type, direction) → Effect<Thing[], Error>
564
- getCount: (thingId, type) → Effect<number, Error>
565
- delete: (id) → Effect<void, Error>
566
- }
567
-
568
- implementation: (provider: DataProvider) => ({
569
- create: (input) => provider.connections.create(input),
570
- getRelated: (thingId, type, dir) => provider.connections.getRelated({ thingId, relationshipType: type, direction: dir }),
571
- // ...
572
- })
573
- }
574
-
575
- // Specialized Service (OPTIONAL - only add when patterns repeat 3+ times)
576
- type SpecializedService = Service & {
577
- subtype: "specialized"
578
- coverage: ThingType[] // Specific types only
579
- operations: DomainOperations
580
- dependencies: GenericService[] // Composes generic services
581
-
582
- invariant: {
583
- adds_convenience: true // Clearer domain vocabulary
584
- reduces_repetition: true // Encapsulates multi-step operations
585
- optional: true // NOT required (can use generic services directly)
586
- }
587
- }
588
-
589
- // Example: CourseService (OPTIONAL - only if you repeat these patterns)
590
- type CourseService = SpecializedService & {
591
- name: "CourseService"
592
- coverage: ["course"]
593
- dependencies: [ThingService, ConnectionService]
594
-
595
- operations: {
596
- // Convenience: Get course with lessons (vs 2 separate calls)
597
- getCourseWithLessons: (courseId) → Effect<{ course: Thing; lessons: Thing[] }, Error>
598
-
599
- // Convenience: Domain vocabulary (vs generic connection.create)
600
- enrollUser: (userId, courseId) → Effect<string, Error>
601
-
602
- // Convenience: Specific query (vs generic connection.getCount)
603
- getEnrollmentCount: (courseId) → Effect<number, Error>
604
- }
605
-
606
- implementation: (thingService, connectionService) => ({
607
- getCourseWithLessons: (id) => Effect.all([
608
- thingService.get(id),
609
- connectionService.getRelated(id, 'part_of', 'to')
610
- ]),
611
- enrollUser: (userId, courseId) => connectionService.create({
612
- fromThingId: userId,
613
- toThingId: courseId,
614
- relationshipType: 'enrolled_in'
615
- }),
616
- getEnrollmentCount: (courseId) => connectionService.getCount(courseId, 'enrolled_in')
617
- })
618
- }
619
- ```
620
-
621
- ### Providers (Backend Implementations)
622
-
623
- ```typescript
624
- type Provider = {
625
- type: "provider"
626
- backend: Backend // Convex, WordPress, Notion, etc
627
- implements: DataProviderInterface
628
-
629
- // Map ontology operations → backend-specific API calls
630
- translation: {
631
- things: {
632
- get: (id) → BackendSpecificCall
633
- list: (params) → BackendSpecificCall
634
- create: (input) → BackendSpecificCall
635
- // ...
636
- }
637
- connections: {
638
- // ...
639
- }
640
- // ... all 6 dimensions
641
- }
642
-
643
- invariant: {
644
- implements_interface: true // Must implement DataProviderInterface
645
- handles_6_dimensions: true // Organizations, People, Things, Connections, Events, Knowledge
646
- }
647
- }
648
-
649
- // Convex Provider
650
- type ConvexProvider = Provider & {
651
- backend: "convex"
652
-
653
- translation: {
654
- things: {
655
- get: (id) => convexClient.query(api.queries.things.get, { id }),
656
- list: (params) => convexClient.query(api.queries.things.list, params),
657
- create: (input) => convexClient.mutation(api.mutations.things.create, input),
658
- // ...
659
- }
660
- // ... map all operations to Convex API
661
- }
662
- }
663
-
664
- // WordPress Provider
665
- type WordPressProvider = Provider & {
666
- backend: "wordpress"
667
-
668
- translation: {
669
- things: {
670
- get: (id) => fetch(`${url}/wp-json/wp/v2/posts/${id}`)
671
- .then(transformWordPressPost → OneThing),
672
- list: (params) => fetch(`${url}/wp-json/wp/v2/posts?per_page=${params.limit}`)
673
- .then(transformWordPressPosts → OneThings),
674
- create: (input) => fetch(`${url}/wp-json/wp/v2/posts`, {
675
- method: 'POST',
676
- body: transformOneThing → WordPressPost
677
- }),
678
- // ...
679
- }
680
- // ... map all operations to WordPress REST API
681
- }
682
- }
683
-
684
- // Notion Provider
685
- type NotionProvider = Provider & {
686
- backend: "notion"
687
-
688
- translation: {
689
- things: {
690
- get: (id) => notionClient.pages.retrieve({ page_id: id })
691
- .then(transformNotionPage → OneThing),
692
- list: (params) => notionClient.databases.query({ database_id, page_size: params.limit })
693
- .then(transformNotionPages → OneThings),
694
- create: (input) => notionClient.pages.create({
695
- parent: { database_id },
696
- properties: transformOneThing → NotionProperties
697
- }),
698
- // ...
699
- }
700
- // ... map all operations to Notion API
701
- }
702
- }
703
- ```
704
-
705
- ### Configuration
706
-
707
- ```typescript
708
- // Display Configuration (UI only, NOT business logic)
709
- type DisplayConfig = Configuration & {
710
- purpose: "ui_presentation";
711
- scope: ThingType[];
712
-
713
- properties: {
714
- displayName: string; // "Course" (singular)
715
- displayNamePlural: string; // "Courses" (plural)
716
- icon: LucideIconName; // "BookOpen"
717
- color: TailwindColor; // "green"
718
- primaryField: string; // Which property to show as title
719
- secondaryField: string; // Which property to show as subtitle
720
- imageField: string; // Which property is the image
721
- fields: FieldConfig[]; // Form fields for UI
722
- };
723
-
724
- invariant: {
725
- ui_only: true; // NO business logic
726
- backend_agnostic: true; // Works with any provider
727
- display_hints: true; // Labels, placeholders, icons
728
- };
729
- };
730
-
731
- // Provider Configuration (backend connection)
732
- type ProviderConfig = Configuration & {
733
- purpose: "backend_connection";
734
-
735
- properties: {
736
- provider: ProviderType; // "convex" | "wordpress" | "notion" | etc
737
- url: string; // Backend URL
738
- apiKey?: string; // API key (if needed)
739
- databaseId?: string; // Database ID (for Notion)
740
- // ... other backend-specific config
741
- };
742
-
743
- invariant: {
744
- one_line_swap: true; // Change provider in ONE line
745
- environment_vars: true; // Use .env for secrets
746
- };
747
- };
748
- ```
749
-
750
- ---
751
-
752
- ## Multi-Tenant Architecture
753
-
754
- ### Subdomain-Based Organization Isolation
755
-
756
- ```typescript
757
- {
758
- pattern: "subdomain_org_isolation",
759
- problem: "How does provider handle fitnesspro.one.ie vs techcorp.one.ie?",
760
-
761
- solution: {
762
- // Middleware extracts orgId from subdomain
763
- middleware: `
764
- // src/middleware.ts
765
- export function onRequest(context, next) {
766
- const subdomain = context.url.hostname.split('.')[0]
767
- const group = await provider.groups.get({ slug: subdomain })
768
-
769
- context.locals.groupId = group._id
770
- context.locals.group = group
771
-
772
- return next()
773
- }
774
- `,
775
-
776
- // Provider auto-injects groupId in ALL queries
777
- provider: `
778
- // Provider automatically scopes ALL queries
779
- class ConvexProvider implements DataProviderInterface {
780
- constructor(private ctx: Context) {}
781
-
782
- things = {
783
- list: (params) => {
784
- // Provider ALWAYS adds org filter (frontend never needs to)
785
- return this.client.query(api.things.list, {
786
- ...params,
787
- groupId: this.ctx.locals.groupId // Auto-injected
788
- })
789
- },
790
-
791
- create: (input) => {
792
- // Provider ALWAYS stamps org on creation
793
- return this.client.mutation(api.things.create, {
794
- ...input,
795
- properties: {
796
- ...input.properties,
797
- groupId: this.ctx.locals.groupId // Auto-injected
798
- }
799
- })
800
- }
801
- }
802
- }
803
- `,
804
-
805
- // Frontend NEVER manually filters by org
806
- frontend: `
807
- // ✅ Frontend code (same for all orgs)
808
- const courses = await provider.things.list({ type: 'course' })
809
- // Provider adds groupId automatically
810
-
811
- // ❌ NEVER do this
812
- const courses = await provider.things.list({
813
- type: 'course',
814
- groupId: ctx.locals.groupId // Provider handles this
815
- })
816
- `,
817
-
818
- invariants: [
819
- "Provider enforces isolation (not frontend)",
820
- "Frontend never knows about multi-tenancy",
821
- "One frontend codebase for all groups",
822
- "Data isolation enforced at provider level"
823
- ]
824
- },
825
-
826
- benefits: [
827
- "Frontend code 100% group-agnostic",
828
- "Security enforced by provider (not UI)",
829
- "No group-specific frontend builds",
830
- "Impossible to leak group data (provider enforces)"
831
- ]
832
- }
833
- ```
834
-
835
- ---
836
-
837
- ## Caching Ontology
838
-
839
- ### Four-Tier Caching Architecture
840
-
841
- ```typescript
842
- {
843
- // Tier 1: Type Definition Cache (STATIC - INFINITE TTL)
844
- L1_TypeDefinitions: {
845
- what: "Ontology type structures",
846
- ttl: "∞ (types never change at runtime)",
847
- storage: "Memory (startup load)",
848
- size: "200 tokens × 66 types = 13,200 tokens",
849
- hitRate: "99.9%+ (loaded once)",
850
-
851
- implementation: `
852
- class TypeDefinitionCache {
853
- private cache = new Map<ThingType, TypeDefinition>()
854
-
855
- async load() {
856
- // Load all 66 types at startup (one time)
857
- const types = await import('./ontology/types')
858
- types.forEach(type => this.cache.set(type.name, type))
859
- }
860
-
861
- get(type: ThingType): TypeDefinition {
862
- return this.cache.get(type) // Always hits (loaded at startup)
863
- }
864
- }
865
-
866
- // Usage: ~13k tokens loaded ONCE, reused for ALL requests
867
- const typeDef = typeCache.get('course') // 200 tokens, instant
868
- `,
869
-
870
- benefit: "AI loads 200 tokens (not 15k implementation tokens)"
871
- },
872
-
873
- // Tier 2: Provider Interface Cache (STATIC - INFINITE TTL)
874
- L2_ProviderInterface: {
875
- what: "DataProvider method signatures",
876
- ttl: "∞ (interface never changes)",
877
- storage: "Memory (startup load)",
878
- size: "300 tokens (entire interface)",
879
- hitRate: "100% (never changes)",
880
-
881
- implementation: `
882
- // Loaded once at startup
883
- const providerInterface = {
884
- things: {
885
- get: "(id: string) → Effect<Thing, Error>",
886
- list: "(params) → Effect<Thing[], Error>",
887
- // ...
888
- }
889
- // ... all 6 dimensions
890
- } // 300 tokens total
891
-
892
- // Usage: AI references interface (not backend implementation)
893
- context = { interface: providerInterface } // 300 tokens
894
- `,
895
-
896
- benefit: "AI never loads backend implementation (0 tokens)"
897
- },
898
-
899
- // Tier 3: SSR Data Cache (DYNAMIC - TTL: 1-60s)
900
- L3_SSRData: {
901
- what: "Server-rendered page data",
902
- ttl: "1-60s (configurable per route)",
903
- storage: "Cloudflare KV / Edge cache",
904
- size: "Variable (full pages or data)",
905
- strategy: "Stale-while-revalidate",
906
-
907
- implementation: `
908
- // Astro page with edge caching
909
- export const prerender = false
910
-
911
- export async function GET(context) {
912
- const cacheKey = \`course:\${context.params.id}\`
913
-
914
- // Check cache
915
- const cached = await context.locals.cache.get(cacheKey)
916
- if (cached && !isStale(cached, 60)) {
917
- return cached
918
- }
919
-
920
- // Fetch fresh
921
- const course = await provider.things.get(context.params.id)
922
-
923
- // Cache for 60s
924
- await context.locals.cache.set(cacheKey, course, { ttl: 60 })
925
-
926
- return course
927
- }
928
- `,
929
-
930
- patterns: {
931
- high_traffic_pages: "60s TTL (homepage, popular courses)",
932
- dynamic_pages: "10s TTL (user dashboards)",
933
- real_time_pages: "0s TTL (admin, analytics)"
934
- },
935
-
936
- benefit: "Reduces provider calls by 80-95%"
937
- },
938
-
939
- // Tier 4: Client Subscriptions (REALTIME - TTL: 0)
940
- L4_RealtimeSubscriptions: {
941
- what: "WebSocket live updates",
942
- ttl: "0 (always fresh)",
943
- storage: "Client memory (ephemeral)",
944
- strategy: "Provider pushes updates",
945
-
946
- implementation: `
947
- // React component with real-time subscription
948
- export function EnrollmentCount({ courseId }) {
949
- // Convex subscription (or any provider with subscription support)
950
- const count = useQuery(api.connections.getCount, {
951
- thingId: courseId,
952
- relationshipType: 'enrolled_in'
953
- })
954
-
955
- // Updates automatically when backend changes
956
- return <span>{count}</span>
957
- }
958
- `,
959
-
960
- when_to_use: [
961
- "Real-time dashboards",
962
- "Live enrollment counts",
963
- "Collaborative editing",
964
- "Chat/notifications"
965
- ],
966
-
967
- fallback: "If provider doesn't support subscriptions, poll with L3 cache"
968
- },
969
-
970
- // Cache Hierarchy Decision Tree
971
- decisionTree: {
972
- question: "Is this ontology type data?",
973
- yes: "L1 (Type Definition Cache) - infinite TTL",
974
- no: {
975
- question: "Is this provider interface?",
976
- yes: "L2 (Provider Interface Cache) - infinite TTL",
977
- no: {
978
- question: "Does data change in real-time?",
979
- yes: "L4 (Real-time Subscriptions) - 0 TTL",
980
- no: {
981
- question: "Is data page-level?",
982
- yes: "L3 (SSR Data Cache) - 1-60s TTL",
983
- no: "No cache (fetch on demand)"
984
- }
985
- }
986
- }
987
- },
988
-
989
- // Golden Rule
990
- rule: "Cache closer to definition = less context loaded. Types/interface = cached forever."
991
- }
992
- ```
993
-
994
- ### Cache Invalidation Strategies
995
-
996
- ```typescript
997
- {
998
- strategies: {
999
- // L1 & L2: Never invalidate (static types/interface)
1000
- static: {
1001
- invalidation: "None (only invalidate on deployment)",
1002
- reason: "Types and interface don't change at runtime"
1003
- },
1004
-
1005
- // L3: Time-based + event-based
1006
- ssr: {
1007
- time_based: "TTL expires → fetch fresh",
1008
- event_based: "Backend mutation → invalidate affected pages",
1009
-
1010
- example: `
1011
- // When course updated, invalidate course page cache
1012
- await provider.things.update(courseId, updates)
1013
- await cache.delete(\`course:\${courseId}\`)
1014
- `
1015
- },
1016
-
1017
- // L4: Automatic (subscription handles)
1018
- realtime: {
1019
- invalidation: "Provider pushes updates automatically",
1020
- reason: "WebSocket connection = always fresh"
1021
- }
1022
- }
1023
- }
1024
- ```
1025
-
1026
- ---
1027
-
1028
- ## Error Propagation Ontology
1029
-
1030
- ### Full Error Flow: Provider → Service → Component → UI
1031
-
1032
- ```typescript
1033
- {
1034
- errorFlow: "Provider → Service → Component → UI",
1035
-
1036
- // Level 1: Provider Errors (Effect.ts tagged errors)
1037
- providerErrors: {
1038
- ThingNotFoundError: {
1039
- _tag: "ThingNotFoundError",
1040
- fields: { thingId: string; type: ThingType },
1041
- recovery: "Show 404 page or 'Not Found' component",
1042
- httpStatus: 404
1043
- },
1044
-
1045
- UnauthorizedError: {
1046
- _tag: "UnauthorizedError",
1047
- fields: { userId?: string; requiredPermission: string },
1048
- recovery: "Redirect to /login with returnUrl",
1049
- httpStatus: 401
1050
- },
1051
-
1052
- NetworkError: {
1053
- _tag: "NetworkError",
1054
- fields: { message: string; retryable: boolean },
1055
- recovery: "Retry with exponential backoff (if retryable)",
1056
- httpStatus: 503
1057
- },
1058
-
1059
- RateLimitError: {
1060
- _tag: "RateLimitError",
1061
- fields: { retryAfter: number },
1062
- recovery: "Show 'Try again in X seconds' message",
1063
- httpStatus: 429
1064
- }
1065
- },
1066
-
1067
- // Level 2: Service Errors (Domain-specific, compose provider errors)
1068
- serviceErrors: {
1069
- pattern: "Transform provider error → domain error",
1070
-
1071
- example: `
1072
- // CourseService.ts
1073
- getCourseWithLessons(id: string) {
1074
- return Effect.gen(function* () {
1075
- const course = yield* thingService.get(id)
1076
- const lessons = yield* connectionService.getRelated(id, 'part_of', 'to')
1077
-
1078
- return { course, lessons }
1079
- }).pipe(
1080
- // Transform provider error → domain error
1081
- Effect.catchTag('ThingNotFoundError', (e) =>
1082
- Effect.fail(new CourseNotFoundError({
1083
- courseId: e.thingId,
1084
- message: \`Course \${e.thingId} not found\`
1085
- }))
1086
- )
1087
- )
1088
- }
1089
- `,
1090
-
1091
- benefits: [
1092
- "Domain-specific error vocabulary",
1093
- "Hides provider implementation details",
1094
- "Easier for frontend to handle"
1095
- ]
1096
- },
1097
-
1098
- // Level 3: Component Errors (Catch and render)
1099
- componentErrors: {
1100
- pattern: "Match error._tag → Render UI component",
1101
-
1102
- example: `
1103
- // CourseDetail.tsx
1104
- export function CourseDetail({ courseId }: Props) {
1105
- const [course, setCourse] = useState<Thing | null>(null)
1106
- const [error, setError] = useState<Error | null>(null)
1107
-
1108
- useEffect(() => {
1109
- Effect.runPromise(
1110
- courseService.getCourseWithLessons(courseId)
1111
- )
1112
- .then(result => setCourse(result.course))
1113
- .catch(e => setError(e))
1114
- }, [courseId])
1115
-
1116
- // Render based on error type
1117
- if (error) {
1118
- switch (error._tag) {
1119
- case 'CourseNotFoundError':
1120
- return <Alert variant="warning">Course not found</Alert>
1121
-
1122
- case 'UnauthorizedError':
1123
- return <Alert variant="error">Please log in to view</Alert>
1124
-
1125
- case 'NetworkError':
1126
- return <Alert variant="error">Network error. Retrying...</Alert>
1127
-
1128
- default:
1129
- return <Alert variant="error">Something went wrong</Alert>
1130
- }
1131
- }
1132
-
1133
- return <div>{/* Render course */}</div>
1134
- }
1135
- `
1136
- },
1137
-
1138
- // Level 4: UI Errors (User-facing messages)
1139
- uiErrors: {
1140
- pattern: "Error → User-friendly message + Action",
1141
-
1142
- mapping: {
1143
- ThingNotFoundError: {
1144
- message: "This {type} doesn't exist",
1145
- action: "Go back or search for another",
1146
- component: "<Alert404 />"
1147
- },
1148
-
1149
- UnauthorizedError: {
1150
- message: "You need to log in to see this",
1151
- action: "Log in or Sign up",
1152
- component: "<LoginPrompt returnUrl={currentPath} />"
1153
- },
1154
-
1155
- NetworkError: {
1156
- message: "Connection issue",
1157
- action: "Retrying automatically...",
1158
- component: "<RetryAlert retrying={true} />"
1159
- },
1160
-
1161
- RateLimitError: {
1162
- message: "Too many requests",
1163
- action: "Try again in {retryAfter} seconds",
1164
- component: "<RateLimitAlert retryAfter={error.retryAfter} />"
1165
- }
1166
- }
1167
- },
1168
-
1169
- // Error Boundary Pattern
1170
- errorBoundary: `
1171
- // ErrorBoundary.tsx
1172
- export class ErrorBoundary extends React.Component {
1173
- state = { error: null }
1174
-
1175
- static getDerivedStateFromError(error) {
1176
- return { error }
1177
- }
1178
-
1179
- render() {
1180
- if (this.state.error) {
1181
- return <ErrorFallback error={this.state.error} />
1182
- }
1183
-
1184
- return this.props.children
1185
- }
1186
- }
1187
-
1188
- // Usage: Wrap islands in error boundaries
1189
- <ErrorBoundary>
1190
- <CourseDetail client:load courseId={id} />
1191
- </ErrorBoundary>
1192
- `,
1193
-
1194
- // Golden Rule
1195
- invariant: "Every error path has explicit UI recovery. No silent failures."
1196
- }
1197
- ```
1198
-
1199
- ---
1200
-
1201
- ## Testing Ontology
1202
-
1203
- ### Three-Layer Testing Strategy
1204
-
1205
- ```typescript
1206
- {
1207
- // Layer 1: Unit Tests (Service logic with mock provider)
1208
- unitTests: {
1209
- what: "Test service logic in isolation",
1210
- mock: "MockProvider (no real backend)",
1211
- fast: "Milliseconds per test",
1212
-
1213
- example: `
1214
- // tests/unit/services/course.test.ts
1215
- import { describe, it, expect } from 'vitest'
1216
- import { Effect, Layer } from 'effect'
1217
- import { CourseService } from '@/services/CourseService'
1218
- import { DataProvider } from '@/providers/DataProvider'
1219
-
1220
- describe('CourseService.getCourseWithLessons', () => {
1221
- it('should return course with lessons', async () => {
1222
- // Mock provider
1223
- const MockProvider = Layer.succeed(DataProvider, {
1224
- things: {
1225
- get: (id) => Effect.succeed({
1226
- _id: id,
1227
- type: 'course',
1228
- name: 'Test Course'
1229
- })
1230
- },
1231
- connections: {
1232
- getRelated: (thingId, type, direction) => Effect.succeed([
1233
- { _id: 'lesson1', type: 'lesson', name: 'Lesson 1' },
1234
- { _id: 'lesson2', type: 'lesson', name: 'Lesson 2' }
1235
- ])
1236
- }
1237
- })
1238
-
1239
- // Test service
1240
- const result = await Effect.runPromise(
1241
- Effect.gen(function* () {
1242
- const service = yield* CourseService
1243
- return yield* service.getCourseWithLessons('course123')
1244
- }).pipe(Effect.provide(MockProvider))
1245
- )
1246
-
1247
- expect(result.course.name).toBe('Test Course')
1248
- expect(result.lessons).toHaveLength(2)
1249
- })
1250
-
1251
- it('should fail with CourseNotFoundError', async () => {
1252
- const MockProvider = Layer.succeed(DataProvider, {
1253
- things: {
1254
- get: (id) => Effect.fail(new ThingNotFoundError({ thingId: id }))
1255
- }
1256
- })
1257
-
1258
- const result = await Effect.runPromiseExit(
1259
- Effect.gen(function* () {
1260
- const service = yield* CourseService
1261
- return yield* service.getCourseWithLessons('invalid')
1262
- }).pipe(Effect.provide(MockProvider))
1263
- )
1264
-
1265
- expect(result._tag).toBe('Failure')
1266
- expect(result.cause.error._tag).toBe('CourseNotFoundError')
1267
- })
1268
- })
1269
- `,
1270
-
1271
- coverage: [
1272
- "Service logic (business rules)",
1273
- "Error transformations",
1274
- "Effect composition",
1275
- "Edge cases"
1276
- ]
1277
- },
1278
-
1279
- // Layer 2: Integration Tests (Service + Real Provider + Test Backend)
1280
- integrationTests: {
1281
- what: "Test service + provider + real backend",
1282
- backend: "Test Convex deployment (isolated database)",
1283
- slow: "Seconds per test (real network calls)",
1284
-
1285
- example: `
1286
- // tests/integration/course-creation.test.ts
1287
- import { describe, it, expect, beforeEach, afterEach } from 'vitest'
1288
- import { convexProvider } from '@/providers/convex'
1289
- import { CourseService } from '@/services/CourseService'
1290
-
1291
- describe('Course Creation Flow', () => {
1292
- let testProvider
1293
- let testOrgId
1294
-
1295
- beforeEach(async () => {
1296
- // Use test Convex deployment
1297
- testProvider = convexProvider({
1298
- url: process.env.TEST_CONVEX_URL
1299
- })
1300
-
1301
- // Create test org
1302
- testOrgId = await testProvider.organizations.create({
1303
- name: 'Test Org',
1304
- slug: 'test-org'
1305
- })
1306
- })
1307
-
1308
- afterEach(async () => {
1309
- // Cleanup test data
1310
- await testProvider.organizations.delete(testOrgId)
1311
- })
1312
-
1313
- it('should create course with lessons', async () => {
1314
- // Create course (real mutation)
1315
- const courseId = await testProvider.things.create({
1316
- type: 'course',
1317
- name: 'Integration Test Course',
1318
- properties: { /* thing properties */ }
1319
- })
1320
-
1321
- // Create lessons (real mutations)
1322
- const lesson1Id = await testProvider.things.create({
1323
- type: 'lesson',
1324
- name: 'Lesson 1',
1325
- properties: { /* thing properties */ }
1326
- })
1327
-
1328
- await testProvider.connections.create({
1329
- fromThingId: lesson1Id,
1330
- toThingId: courseId,
1331
- relationshipType: 'part_of'
1332
- })
1333
-
1334
- // Verify (real query)
1335
- const result = await CourseService.getCourseWithLessons(courseId)
1336
-
1337
- expect(result.course.name).toBe('Integration Test Course')
1338
- expect(result.lessons).toHaveLength(1)
1339
- expect(result.lessons[0].name).toBe('Lesson 1')
1340
- })
1341
- })
1342
- `,
1343
-
1344
- coverage: [
1345
- "Full data flow (service → provider → backend → database)",
1346
- "Real mutations and queries",
1347
- "Data consistency",
1348
- "Backend constraints"
1349
- ]
1350
- },
1351
-
1352
- // Layer 3: E2E Tests (Full UI flow in browser)
1353
- e2eTests: {
1354
- what: "Test complete user flows in browser",
1355
- tool: "Playwright (headless Chrome)",
1356
- slow: "10-30s per test (full page loads)",
1357
-
1358
- example: `
1359
- // tests/e2e/course-enrollment.spec.ts
1360
- import { test, expect } from '@playwright/test'
1361
-
1362
- test.describe('Course Enrollment Flow', () => {
1363
- test('user can enroll in course', async ({ page }) => {
1364
- // Navigate to course page
1365
- await page.goto('/courses/course123')
1366
-
1367
- // Verify course details rendered
1368
- await expect(page.locator('h1')).toContainText('Test Course')
1369
-
1370
- // Click enroll button
1371
- await page.click('button:has-text("Enroll")')
1372
-
1373
- // Wait for enrollment confirmation
1374
- await expect(page.locator('.toast')).toContainText('Enrolled successfully')
1375
-
1376
- // Verify button changed to "Go to Course"
1377
- await expect(page.locator('button')).toContainText('Go to Course')
1378
-
1379
- // Navigate to user dashboard
1380
- await page.goto('/account')
1381
-
1382
- // Verify course appears in "My Courses"
1383
- await expect(page.locator('.my-courses')).toContainText('Test Course')
1384
- })
1385
-
1386
- test('unauthorized user prompted to login', async ({ page }) => {
1387
- // Navigate as guest
1388
- await page.goto('/courses/course123')
1389
-
1390
- // Click enroll
1391
- await page.click('button:has-text("Enroll")')
1392
-
1393
- // Should redirect to login
1394
- await expect(page).toHaveURL(/\/login/)
1395
-
1396
- // Login form should have returnUrl
1397
- await expect(page.locator('form')).toHaveAttribute(
1398
- 'data-return-url',
1399
- '/courses/course123'
1400
- )
1401
- })
1402
- })
1403
- `,
1404
-
1405
- coverage: [
1406
- "User flows (click, type, navigate)",
1407
- "Visual rendering",
1408
- "Loading states",
1409
- "Error states",
1410
- "Authentication flows"
1411
- ]
1412
- },
1413
-
1414
- // Test Pyramid
1415
- pyramid: {
1416
- unit: "70% (fast, many tests, mock provider)",
1417
- integration: "20% (medium, key flows, test backend)",
1418
- e2e: "10% (slow, critical paths, real UI)"
1419
- },
1420
-
1421
- // CI/CD Strategy
1422
- cicd: {
1423
- on_pr: "Run unit + integration tests",
1424
- on_merge: "Run all tests (including E2E)",
1425
- on_deploy: "Run smoke tests (E2E critical paths)"
1426
- },
1427
-
1428
- // Golden Rule
1429
- invariant: "Mock providers for unit tests. Real providers for integration. Real UI for E2E."
1430
- }
1431
- ```
1432
-
1433
- ---
1434
-
1435
- ## Pattern Language
1436
-
1437
- ### Pattern: Backend-Agnostic Data Access
1438
-
1439
- ```typescript
1440
- {
1441
- id: "backend_agnostic_data_access",
1442
- type: DATA_PATTERN,
1443
- applicability: (thing) => thing.type === "service" || thing.type === "component",
1444
-
1445
- inputs: [DataProviderInterface],
1446
- outputs: [Data],
1447
-
1448
- transform: (operation) => ({
1449
- code: `
1450
- // Works with ANY backend (Convex, WordPress, Notion, etc.)
1451
- const provider = yield* DataProvider
1452
-
1453
- // Call ontology operation (backend translates)
1454
- const data = yield* provider.things.get(id)
1455
-
1456
- return data
1457
- `
1458
- }),
1459
-
1460
- constraints: [
1461
- "no_backend_specific_code",
1462
- "uses_provider_interface",
1463
- "effect_ts_typed"
1464
- ],
1465
-
1466
- benefits: [
1467
- "swap_backends_one_line",
1468
- "type_safe_errors",
1469
- "testable_via_mock_provider"
1470
- ]
1471
- }
1472
- ```
1473
-
1474
- ### Pattern: Generic vs Specialized Services
1475
-
1476
- ```typescript
1477
- {
1478
- id: "generic_vs_specialized_service_decision",
1479
- type: SERVICE_PATTERN,
1480
-
1481
- decision_tree: {
1482
- // Start with generic
1483
- question: "Do you need to operate on things?",
1484
- yes: {
1485
- default: "Use ThingService (handles all 66 types)",
1486
- code: `
1487
- const thingService = yield* ThingService
1488
- const course = yield* thingService.get(courseId)
1489
- const lesson = yield* thingService.get(lessonId)
1490
- `
1491
- },
1492
-
1493
- // Add specialized only if needed
1494
- question: "Do you repeat the same 2-3 operation sequence 3+ times?",
1495
- yes: {
1496
- action: "Create SpecializedService",
1497
- code: `
1498
- // CourseService.ts (OPTIONAL)
1499
- export class CourseService {
1500
- getCourseWithLessons: (id) => Effect.all([
1501
- thingService.get(id),
1502
- connectionService.getRelated(id, 'part_of', 'to')
1503
- ])
1504
- }
1505
- `
1506
- },
1507
- no: {
1508
- action: "Keep using generic services",
1509
- reason: "Don't create specialized services prematurely"
1510
- }
1511
- },
1512
-
1513
- constraints: [
1514
- "always_have_generic_services",
1515
- "specialized_services_optional",
1516
- "add_specialized_when_patterns_emerge"
1517
- ]
1518
- }
1519
- ```
1520
-
1521
- ### Pattern: Provider Swapping
1522
-
1523
- ```typescript
1524
- {
1525
- id: "provider_swapping",
1526
- type: CONFIGURATION_PATTERN,
1527
- applicability: (thing) => thing.type === "configuration",
1528
-
1529
- inputs: [ProviderConfig],
1530
- outputs: [ConfiguredProvider],
1531
-
1532
- transform: (config) => ({
1533
- // astro.config.ts
1534
- code: `
1535
- import { convexProvider } from './providers/convex'
1536
- // import { wordpressProvider } from './providers/wordpress'
1537
- // import { notionProvider } from './providers/notion'
1538
-
1539
- export default defineConfig({
1540
- integrations: [
1541
- one({
1542
- // ✅ Change this ONE line to swap backends
1543
- provider: convexProvider({
1544
- url: import.meta.env.PUBLIC_CONVEX_URL
1545
- })
1546
-
1547
- // OR use WordPress:
1548
- // provider: wordpressProvider({
1549
- // url: 'https://yoursite.com',
1550
- // apiKey: import.meta.env.WORDPRESS_API_KEY
1551
- // })
1552
- })
1553
- ]
1554
- })
1555
- `
1556
- }),
1557
-
1558
- constraints: [
1559
- "one_line_change",
1560
- "no_code_changes",
1561
- "components_unchanged"
1562
- ]
1563
- }
1564
- ```
1565
-
1566
- ### Pattern: Progressive Enhancement
1567
-
1568
- ```typescript
1569
- {
1570
- id: "progressive_enhancement",
1571
- type: UI_PATTERN,
1572
- strategy: "Start SSR, enhance with islands, add real-time last",
1573
-
1574
- // Level 1: Base (works without JS)
1575
- base: {
1576
- layer: "Astro SSR",
1577
- code: `
1578
- <form action="/api/courses/enroll" method="post">
1579
- <input type="hidden" name="courseId" value={courseId} />
1580
- <button type="submit">Enroll</button>
1581
- </form>
1582
- `,
1583
- works_without_js: true,
1584
- accessibility: "Full keyboard navigation",
1585
- seo: "Search engines can see content"
1586
- },
1587
-
1588
- // Level 2: Enhanced (adds interactivity with JS)
1589
- enhanced: {
1590
- layer: "React island",
1591
- code: `
1592
- <EnrollButton
1593
- client:load
1594
- courseId={courseId}
1595
- initialEnrolled={enrolled}
1596
- />
1597
- `,
1598
- requires_js: true,
1599
- benefit: "Optimistic UI, instant feedback, loading states",
1600
- fallback: "Form still works via SSR if JS fails"
1601
- },
1602
-
1603
- // Level 3: Real-time (live updates)
1604
- realtime: {
1605
- layer: "WebSocket subscription",
1606
- code: `
1607
- export function EnrollmentCount({ courseId }: Props) {
1608
- const count = useQuery(api.connections.getCount, {
1609
- thingId: courseId,
1610
- relationshipType: 'enrolled_in'
1611
- })
1612
- return <span>{count} enrolled</span>
1613
- }
1614
- `,
1615
- requires_js: true,
1616
- requires_subscription: true,
1617
- benefit: "Live count updates as users enroll",
1618
- fallback: "SSR shows stale count (still functional)"
1619
- },
1620
-
1621
- strategy: {
1622
- 1: "Start with SSR (universal baseline)",
1623
- 2: "Add islands for interactivity (progressive)",
1624
- 3: "Add real-time only where needed (rare)",
1625
- rule: "Each layer enhances, never replaces previous layer"
1626
- }
1627
- }
1628
- ```
1629
-
1630
- ---
1631
-
1632
- ## Type Sync Automation
1633
-
1634
- ### Automatic Frontend/Backend Type Synchronization
1635
-
1636
- ```typescript
1637
- {
1638
- principle: "Backend schema = single source of truth. Frontend derives types.",
1639
-
1640
- pipeline: {
1641
- step1: {
1642
- where: "Backend",
1643
- what: "Define schema (convex/schema.ts)",
1644
- code: `
1645
- // convex/schema.ts
1646
- import { defineSchema, defineTable } from 'convex/server'
1647
- import { v } from 'convex/values'
1648
-
1649
- export default defineSchema({
1650
- things: defineTable({
1651
- type: v.string(),
1652
- name: v.string(),
1653
- properties: v.any(),
1654
- status: v.union(
1655
- v.literal('draft'),
1656
- v.literal('published'),
1657
- v.literal('archived')
1658
- ),
1659
- createdAt: v.number(),
1660
- updatedAt: v.number()
1661
- })
1662
- })
1663
- `
1664
- },
1665
-
1666
- step2: {
1667
- where: "Backend deployment",
1668
- what: "Deploy → Auto-generate types",
1669
- command: "npx convex deploy",
1670
- generates: "convex/_generated/dataModel.d.ts",
1671
- code: `
1672
- // Auto-generated by Convex
1673
- export type Thing = {
1674
- _id: Id<'things'>
1675
- _creationTime: number
1676
- type: string
1677
- name: string
1678
- properties: any
1679
- status: 'draft' | 'published' | 'archived'
1680
- createdAt: number
1681
- updatedAt: number
1682
- }
1683
- `
1684
- },
1685
-
1686
- step3: {
1687
- where: "Frontend",
1688
- what: "Import generated types",
1689
- code: `
1690
- // src/services/ThingService.ts
1691
- import type { Id } from '@/convex/_generated/dataModel'
1692
- import type { Thing } from '@/convex/_generated/dataModel'
1693
-
1694
- export class ThingService {
1695
- get(id: Id<'things'>): Effect<Thing, Error> {
1696
- // TypeScript knows exact shape of Thing
1697
- }
1698
- }
1699
- `
1700
- },
1701
-
1702
- step4: {
1703
- where: "Development",
1704
- what: "Hot reload triggers type regeneration",
1705
- trigger: "Save convex/schema.ts",
1706
- action: "Convex dev server regenerates types",
1707
- result: "TypeScript immediately shows errors in frontend"
1708
- }
1709
- },
1710
-
1711
- validation: {
1712
- ci: {
1713
- check: "TypeScript compilation",
1714
- command: "npx astro check",
1715
- fails_if: "Frontend imports types that don't match backend schema",
1716
- result: "Can't merge PR if types mismatch"
1717
- },
1718
-
1719
- dev: {
1720
- watch: "Convex dev server watches schema changes",
1721
- regenerates: "Types on every schema save",
1722
- editor: "VS Code shows TypeScript errors instantly"
1723
- },
1724
-
1725
- deploy: {
1726
- blocks: "Can't deploy frontend if types don't match backend",
1727
- ensures: "Frontend and backend always in sync"
1728
- }
1729
- },
1730
-
1731
- benefits: [
1732
- "Single source of truth (backend schema)",
1733
- "Zero manual type definition duplication",
1734
- "Immediate feedback on type mismatches",
1735
- "Impossible to deploy mismatched types",
1736
- "Refactoring is type-safe (rename propagates)"
1737
- ],
1738
-
1739
- example_refactor: `
1740
- // Backend: Rename field
1741
- // convex/schema.ts
1742
- things: defineTable({
1743
- // name: v.string(), // OLD
1744
- title: v.string(), // NEW
1745
- })
1746
-
1747
- // Deploy: Convex regenerates types
1748
- // convex/_generated/dataModel.d.ts
1749
- export type Thing = {
1750
- title: string // Updated
1751
- }
1752
-
1753
- // Frontend: TypeScript shows errors immediately
1754
- // src/components/CourseCard.tsx
1755
- <h1>{course.name}</h1> // ❌ Error: Property 'name' doesn't exist
1756
- <h1>{course.title}</h1> // ✅ Fixed
1757
-
1758
- // Result: Refactor is type-safe, can't forget any references
1759
- `,
1760
-
1761
- invariant: "Backend schema → Generated types → Frontend imports. Never manual sync."
1762
- }
1763
- ```
1764
-
1765
- ---
1766
-
1767
- ## Observability Layer
1768
-
1769
- ### Four-Pillar Observability Strategy
1770
-
1771
- ```typescript
1772
- {
1773
- // Pillar 1: Provider Call Observability
1774
- provider_calls: {
1775
- what: "Track every provider operation",
1776
- metrics: [
1777
- "Duration (p50, p95, p99)",
1778
- "Success rate (%)",
1779
- "Error types (grouped by _tag)",
1780
- "Throughput (ops/sec)"
1781
- ],
1782
-
1783
- implementation: `
1784
- // Wrap provider with observability layer
1785
- class ObservableProvider implements DataProviderInterface {
1786
- constructor(
1787
- private provider: DataProviderInterface,
1788
- private logger: Logger
1789
- ) {}
1790
-
1791
- things = {
1792
- get: (id) => {
1793
- const start = Date.now()
1794
-
1795
- return this.provider.things.get(id).pipe(
1796
- Effect.tap(() => {
1797
- const duration = Date.now() - start
1798
- this.logger.info('provider.things.get', {
1799
- thingId: id,
1800
- duration,
1801
- success: true
1802
- })
1803
- }),
1804
- Effect.tapError((error) => {
1805
- const duration = Date.now() - start
1806
- this.logger.error('provider.things.get', {
1807
- thingId: id,
1808
- duration,
1809
- error: error._tag,
1810
- success: false
1811
- })
1812
- })
1813
- )
1814
- }
1815
- }
1816
- }
1817
- `,
1818
-
1819
- alerts: [
1820
- "Slow queries (>2s p95)",
1821
- "High error rate (>5% over 5min)",
1822
- "Specific error spikes (e.g., UnauthorizedError >10/min)"
1823
- ]
1824
- },
1825
-
1826
- // Pillar 2: Context Usage Observability
1827
- context_usage: {
1828
- what: "Track AI context loading per request",
1829
- metrics: [
1830
- "Tokens loaded (by category: types, patterns, examples)",
1831
- "Total context size",
1832
- "Context budget utilization (%)",
1833
- "Cache hit rate (%)"
1834
- ],
1835
-
1836
- implementation: `
1837
- class ContextManager {
1838
- private usage = {
1839
- types: 0,
1840
- patterns: 0,
1841
- examples: 0,
1842
- total: 0
1843
- }
1844
-
1845
- addContext(category, content) {
1846
- const tokens = estimateTokens(content)
1847
- this.usage[category] += tokens
1848
- this.usage.total += tokens
1849
-
1850
- // Log to observability
1851
- logger.info('context.added', {
1852
- category,
1853
- tokens,
1854
- total: this.usage.total,
1855
- utilization: this.usage.total / BUDGET.total
1856
- })
1857
- }
1858
-
1859
- getReport() {
1860
- return {
1861
- ...this.usage,
1862
- budget: BUDGET.total,
1863
- utilization: (this.usage.total / BUDGET.total) * 100,
1864
- remaining: BUDGET.total - this.usage.total
1865
- }
1866
- }
1867
- }
1868
- `,
1869
-
1870
- alerts: [
1871
- "Context budget exceeded (>5k tokens)",
1872
- "Utilization >80% (approaching limit)",
1873
- "Cache miss rate >20% (inefficient loading)"
1874
- ]
1875
- },
1876
-
1877
- // Pillar 3: Cache Efficiency Observability
1878
- cache_efficiency: {
1879
- what: "Track cache performance",
1880
- metrics: [
1881
- "Hit rate (%) by cache tier (L1, L2, L3, L4)",
1882
- "Miss count (absolute)",
1883
- "Eviction rate (items evicted/sec)",
1884
- "Cache size (MB)"
1885
- ],
1886
-
1887
- implementation: `
1888
- class ObservableCache<K, V> {
1889
- private hits = 0
1890
- private misses = 0
1891
- private cache = new Map<K, V>()
1892
-
1893
- get(key: K): V | undefined {
1894
- if (this.cache.has(key)) {
1895
- this.hits++
1896
- logger.info('cache.hit', {
1897
- key,
1898
- hitRate: this.hitRate()
1899
- })
1900
- return this.cache.get(key)
1901
- } else {
1902
- this.misses++
1903
- logger.info('cache.miss', {
1904
- key,
1905
- hitRate: this.hitRate()
1906
- })
1907
- return undefined
1908
- }
1909
- }
1910
-
1911
- hitRate() {
1912
- return this.hits / (this.hits + this.misses)
1913
- }
1914
-
1915
- getStats() {
1916
- return {
1917
- hits: this.hits,
1918
- misses: this.misses,
1919
- hitRate: this.hitRate(),
1920
- size: this.cache.size
1921
- }
1922
- }
1923
- }
1924
- `,
1925
-
1926
- alerts: [
1927
- "L1 hit rate <95% (type cache should be near 100%)",
1928
- "L3 hit rate <60% (SSR cache not effective)",
1929
- "Cache size >100MB (memory pressure)"
1930
- ]
1931
- },
1932
-
1933
- // Pillar 4: Page Performance Observability
1934
- page_performance: {
1935
- what: "Track Core Web Vitals + custom metrics",
1936
- metrics: [
1937
- "TTFB (Time To First Byte)",
1938
- "FCP (First Contentful Paint)",
1939
- "LCP (Largest Contentful Paint)",
1940
- "CLS (Cumulative Layout Shift)",
1941
- "FID (First Input Delay)",
1942
- "Provider call duration (frontend metric)"
1943
- ],
1944
-
1945
- implementation: `
1946
- // Client-side performance tracking
1947
- // src/lib/observability.ts
1948
- export function trackPagePerformance() {
1949
- // Core Web Vitals
1950
- if ('web-vital' in window) {
1951
- getCLS(sendToAnalytics)
1952
- getFID(sendToAnalytics)
1953
- getLCP(sendToAnalytics)
1954
- }
1955
-
1956
- // Custom: Provider call timing
1957
- performance.measure('provider-call', {
1958
- start: 'provider-start',
1959
- end: 'provider-end'
1960
- })
1961
-
1962
- const measure = performance.getEntriesByName('provider-call')[0]
1963
- sendToAnalytics({
1964
- metric: 'provider_call_duration',
1965
- value: measure.duration
1966
- })
1967
- }
1968
-
1969
- function sendToAnalytics(metric) {
1970
- fetch('/api/analytics', {
1971
- method: 'POST',
1972
- body: JSON.stringify(metric)
1973
- })
1974
- }
1975
- `,
1976
-
1977
- cloudflare_analytics: {
1978
- what: "Built-in Cloudflare Pages Analytics",
1979
- tracks: ["TTFB", "FCP", "LCP", "requests/sec", "bandwidth"],
1980
- dashboard: "Cloudflare Pages dashboard → Analytics tab"
1981
- },
1982
-
1983
- alerts: [
1984
- "LCP >2.5s (bad user experience)",
1985
- "CLS >0.1 (layout shift)",
1986
- "TTFB >800ms (slow backend)"
1987
- ]
1988
- },
1989
-
1990
- // Event Emission Pattern
1991
- eventEmission: {
1992
- pattern: "Every significant operation emits event to backend",
1993
-
1994
- example: `
1995
- // Frontend calls provider
1996
- const course = await provider.things.get(courseId)
1997
-
1998
- // Provider logs event (backend receives)
1999
- await provider.events.log({
2000
- type: 'provider_query',
2001
- actorId: userId,
2002
- targetId: courseId,
2003
- timestamp: Date.now(),
2004
- metadata: {
2005
- operation: 'things.get',
2006
- duration: 123,
2007
- success: true,
2008
- provider: 'convex'
2009
- }
2010
- })
2011
-
2012
- // Backend stores in events table
2013
- // Dashboard can query: "Show all provider queries today"
2014
- `,
2015
-
2016
- benefits: [
2017
- "Full audit trail of all operations",
2018
- "Query events to debug issues",
2019
- "Aggregate metrics from events",
2020
- "Events table = observability database"
2021
- ]
2022
- },
2023
-
2024
- // Dashboards
2025
- dashboards: {
2026
- realtime: {
2027
- tool: "Convex Dashboard or custom React dashboard",
2028
- queries: [
2029
- "Provider call rate (last 1 hour)",
2030
- "Error rate by type (last 1 hour)",
2031
- "Cache hit rate (last 1 hour)",
2032
- "Top slow queries (p95 >2s)"
2033
- ]
2034
- },
2035
-
2036
- historical: {
2037
- tool: "Cloudflare Analytics + custom aggregations",
2038
- queries: [
2039
- "Page performance trends (last 30 days)",
2040
- "Provider call trends (last 30 days)",
2041
- "Error trends by type (last 30 days)",
2042
- "Cache efficiency trends (last 30 days)"
2043
- ]
2044
- }
2045
- },
2046
-
2047
- // Golden Rule
2048
- invariant: "Observe everything. Log to events. Query events for debugging. Alert on anomalies."
2049
- }
2050
- ```
2051
-
2052
- ---
2053
-
2054
- ## Agent Task Mapping
2055
-
2056
- ### Frontend-Specific Agent Responsibilities
2057
-
2058
- ```typescript
2059
- {
2060
- agents: {
2061
- "frontend-service-agent": {
2062
- creates: ["Effect.ts services"],
2063
- outputs: [
2064
- "src/services/ThingService.ts",
2065
- "src/services/ConnectionService.ts",
2066
- "src/services/[Domain]Service.ts (optional)"
2067
- ],
2068
- coordination: "Autonomous (parallel with provider-agent)"
2069
- },
2070
-
2071
- "frontend-provider-agent": {
2072
- creates: ["DataProvider implementations"],
2073
- outputs: [
2074
- "src/providers/convex/ConvexProvider.ts",
2075
- "src/providers/wordpress/WordPressProvider.ts",
2076
- "src/providers/[backend]/Provider.ts"
2077
- ],
2078
- coordination: "Autonomous (parallel with service-agent)"
2079
- },
2080
-
2081
- "frontend-page-agent": {
2082
- creates: ["Astro SSR pages"],
2083
- outputs: [
2084
- "src/pages/[thing]/index.astro",
2085
- "src/pages/[thing]/[id].astro"
2086
- ],
2087
- coordination: "Waits for service-agent (reads task_completed events)"
2088
- },
2089
-
2090
- "frontend-component-agent": {
2091
- creates: ["React islands (interactive components)"],
2092
- outputs: [
2093
- "src/components/features/[thing]/[Component].tsx"
2094
- ],
2095
- coordination: "Parallel with page-agent (both wait for service-agent)"
2096
- },
2097
-
2098
- "frontend-test-agent": {
2099
- creates: ["Unit, integration, and E2E tests"],
2100
- outputs: [
2101
- "tests/unit/services/[name].test.ts",
2102
- "tests/integration/[flow].test.ts",
2103
- "tests/e2e/[flow].spec.ts"
2104
- ],
2105
- coordination: "Waits for ALL agents (service, provider, page, component)"
2106
- }
2107
- },
2108
-
2109
- // Event-driven coordination (from workflow.md)
2110
- coordination_mechanism: {
2111
- type: "Events table (ontology IS the message bus)",
2112
-
2113
- pattern: `
2114
- // Agent completes → Emits event
2115
- await logEvent({
2116
- type: 'task_completed',
2117
- actorId: 'frontend-service-agent',
2118
- targetId: 'task_id',
2119
- metadata: { files: [...] }
2120
- })
2121
-
2122
- // Dependent agent → Queries events
2123
- const completed = await queryEvents({
2124
- type: 'task_completed',
2125
- actorId: 'frontend-service-agent'
2126
- })
2127
-
2128
- if (completed) {
2129
- // Proceed with task
2130
- }
2131
- `
2132
- },
2133
-
2134
- // Parallel execution (from workflow.md)
2135
- execution_model: {
2136
- services_layer: {
2137
- agents: ["frontend-service-agent", "frontend-provider-agent"],
2138
- parallelism: "Both start simultaneously",
2139
- coordination: "Autonomous (no dependencies)"
2140
- },
2141
-
2142
- ui_layer: {
2143
- agents: ["frontend-page-agent", "frontend-component-agent"],
2144
- parallelism: "Both start after services complete",
2145
- coordination: "Both wait for service-agent events"
2146
- },
2147
-
2148
- testing_layer: {
2149
- agents: ["frontend-test-agent"],
2150
- parallelism: "Starts after all implementation complete",
2151
- coordination: "Waits for all agents"
2152
- }
2153
- }
2154
- }
2155
- ```
2156
-
2157
- ---
2158
-
2159
- ## Common Mistakes
2160
-
2161
- ### Top 10 Anti-Patterns to Avoid
2162
-
2163
- ```typescript
2164
- {
2165
- // Mistake 1: Coupling to specific provider
2166
- mistake1: {
2167
- problem: "Importing Convex directly in frontend code",
2168
- bad: `
2169
- // ❌ BAD
2170
- import { ConvexClient } from 'convex/browser'
2171
- const client = new ConvexClient(url)
2172
- const course = await client.query(api.courses.get, { id })
2173
- `,
2174
- good: `
2175
- // ✅ GOOD
2176
- const provider = yield* DataProvider
2177
- const course = yield* provider.things.get(id)
2178
- `,
2179
- why: "Bad code breaks when you swap backends. Good code works with ANY backend."
2180
- },
2181
-
2182
- // Mistake 2: Creating specialized services prematurely
2183
- mistake2: {
2184
- problem: "Creating CourseService before patterns emerge",
2185
- bad: `
2186
- // ❌ BAD (created after 1 use)
2187
- class CourseService {
2188
- getCourseWithLessons(id) {
2189
- // Used once, doesn't justify specialized service
2190
- }
2191
- }
2192
- `,
2193
- good: `
2194
- // ✅ GOOD (use generic services until pattern repeats 3+ times)
2195
- const course = yield* thingService.get(id)
2196
- const lessons = yield* connectionService.getRelated(id, 'part_of', 'to')
2197
-
2198
- // Only create CourseService after repeating this 3+ times
2199
- `,
2200
- why: "Premature abstraction creates unnecessary complexity. Wait for patterns."
2201
- },
2202
-
2203
- // Mistake 3: Loading too much context
2204
- mistake3: {
2205
- problem: "Loading entire codebase for AI generation",
2206
- bad: `
2207
- // ❌ BAD
2208
- const context = {
2209
- allFiles: loadFiles('**/*.ts'), // 200k tokens
2210
- allDocs: loadDocs(), // 50k tokens
2211
- allExamples: loadExamples() // 30k tokens
2212
- } // 280k tokens
2213
- `,
2214
- good: `
2215
- // ✅ GOOD
2216
- const context = {
2217
- interface: DataProviderInterface, // 300 tokens
2218
- pattern: servicePattern // 400 tokens
2219
- } // 700 tokens (99.7% reduction)
2220
- `,
2221
- why: "Context explosion wastes time and money. Load only what's needed."
2222
- },
2223
-
2224
- // Mistake 4: Duplicating server state in frontend
2225
- mistake4: {
2226
- problem: "Storing backend data in useState",
2227
- bad: `
2228
- // ❌ BAD
2229
- const [courses, setCourses] = useState([])
2230
- useEffect(() => {
2231
- provider.things.list({ type: 'course' })
2232
- .then(setCourses)
2233
- }, [])
2234
- `,
2235
- good: `
2236
- // ✅ GOOD
2237
- const courses = useQuery(api.courses.list)
2238
- // Provider handles caching, no state duplication
2239
- `,
2240
- why: "Duplicating state creates sync issues. Let provider handle caching."
2241
- },
2242
-
2243
- // Mistake 5: Not handling error states
2244
- mistake5: {
2245
- problem: "No UI for errors",
2246
- bad: `
2247
- // ❌ BAD
2248
- const course = await provider.things.get(id)
2249
- return <div>{course.name}</div>
2250
- // What if course is undefined? No error handling!
2251
- `,
2252
- good: `
2253
- // ✅ GOOD
2254
- try {
2255
- const course = await provider.things.get(id)
2256
- return <div>{course.name}</div>
2257
- } catch (error) {
2258
- if (error._tag === 'ThingNotFoundError') {
2259
- return <Alert>Course not found</Alert>
2260
- }
2261
- return <Alert>Error loading course</Alert>
2262
- }
2263
- `,
2264
- why: "Errors WILL happen. Always have UI for error states."
2265
- },
2266
-
2267
- // Mistake 6: Manual group filtering
2268
- mistake6: {
2269
- problem: "Manually filtering by groupId",
2270
- bad: `
2271
- // ❌ BAD
2272
- const courses = await provider.things.list({
2273
- type: 'course',
2274
- groupId: ctx.locals.groupId // Manual filtering
2275
- })
2276
- `,
2277
- good: `
2278
- // ✅ GOOD
2279
- const courses = await provider.things.list({ type: 'course' })
2280
- // Provider auto-injects groupId
2281
- `,
2282
- why: "Provider enforces multi-tenancy. Frontend shouldn't know about groups."
2283
- },
2284
-
2285
- // Mistake 7: Not caching type definitions
2286
- mistake7: {
2287
- problem: "Loading type definitions on every request",
2288
- bad: `
2289
- // ❌ BAD
2290
- async function generateCode(type) {
2291
- const typeDef = await loadTypeFromFile(type) // Loads from disk every time
2292
- return ai.generate(task, { type: typeDef })
2293
- }
2294
- `,
2295
- good: `
2296
- // ✅ GOOD
2297
- const typeCache = new Map()
2298
-
2299
- async function generateCode(type) {
2300
- if (!typeCache.has(type)) {
2301
- typeCache.set(type, await loadTypeFromFile(type)) // Load once
2302
- }
2303
- return ai.generate(task, { type: typeCache.get(type) })
2304
- }
2305
- `,
2306
- why: "Type definitions never change at runtime. Cache forever."
2307
- },
2308
-
2309
- // Mistake 8: Skipping progressive enhancement
2310
- mistake8: {
2311
- problem: "JavaScript-only forms (don't work without JS)",
2312
- bad: `
2313
- // ❌ BAD
2314
- <button onClick={() => enroll()}>Enroll</button>
2315
- // Doesn't work if JS fails to load
2316
- `,
2317
- good: `
2318
- // ✅ GOOD
2319
- <form action="/api/enroll" method="post">
2320
- <button type="submit">Enroll</button>
2321
- </form>
2322
- // Works with or without JS
2323
-
2324
- // Then enhance with JS:
2325
- <EnrollButton client:load /> // Adds optimistic UI
2326
- `,
2327
- why: "Always start with working HTML. JavaScript should enhance, not enable."
2328
- },
2329
-
2330
- // Mistake 9: Not testing with mock providers
2331
- mistake9: {
2332
- problem: "Testing with real backend (slow, flaky)",
2333
- bad: `
2334
- // ❌ BAD
2335
- test('gets course', async () => {
2336
- const course = await service.get('real_id_from_db')
2337
- // Depends on real database state
2338
- })
2339
- `,
2340
- good: `
2341
- // ✅ GOOD
2342
- test('gets course', async () => {
2343
- const MockProvider = Layer.succeed(DataProvider, {
2344
- things: { get: (id) => Effect.succeed(mockCourse) }
2345
- })
2346
-
2347
- const course = await service.get('any_id')
2348
- .pipe(Effect.provide(MockProvider))
2349
- // Fast, deterministic, no database
2350
- })
2351
- `,
2352
- why: "Unit tests should be fast and deterministic. Use mocks."
2353
- },
2354
-
2355
- // Mistake 10: Ignoring type sync
2356
- mistake10: {
2357
- problem: "Manually duplicating backend types in frontend",
2358
- bad: `
2359
- // ❌ BAD
2360
- // frontend/types.ts
2361
- type Course = {
2362
- id: string
2363
- title: string
2364
- // Manually copied from backend
2365
- }
2366
- `,
2367
- good: `
2368
- // ✅ GOOD
2369
- import type { Thing } from '@/convex/_generated/dataModel'
2370
- // Auto-synced from backend schema
2371
- `,
2372
- why: "Manual type sync breaks. Use generated types from backend."
2373
- }
2374
- }
2375
- ```
2376
-
2377
- ---
2378
-
2379
- ## Summary
2380
-
2381
- ### Ontology Evolution
2382
-
2383
- **Version 4.0.0 Additions:**
2384
-
2385
- - **Provider as Context Loader** - 99.9% context reduction via interface abstraction
2386
- - **Multi-Tenant Architecture** - Subdomain-based org isolation enforced by provider
2387
- - **4-Tier Caching** - Type definitions, interface, SSR data, real-time subscriptions
2388
- - **State Management Hierarchy** - Server, SSR, Island, Shared (4 layers)
2389
- - **Error Propagation** - Provider → Service → Component → UI (typed errors)
2390
- - **Testing Ontology** - Unit (mock), Integration (real backend), E2E (browser)
2391
- - **Progressive Enhancement** - SSR → Islands → Real-time (3 layers)
2392
- - **Type Sync Automation** - Backend schema → Generated types → Frontend imports
2393
- - **Observability Layer** - Provider calls, context usage, cache efficiency, page performance
2394
- - **Agent Task Mapping** - Event-driven parallel execution with simplified coordination
2395
-
2396
- ### Key Metrics
2397
-
2398
- | Metric | v3.0.0 | v4.0.0 | Improvement |
2399
- | ----------------------- | ---------------------- | -------------------------------------- | ---------------------- |
2400
- | **Context per request** | 50k-300k tokens | 300-5k tokens | **99%+ reduction** |
2401
- | **Backend coupling** | High (Convex-specific) | Zero (provider abstraction) | **Infinite backends** |
2402
- | **Caching strategy** | Undefined | 4-tier (L1-L4) | **80-95% fewer calls** |
2403
- | **Error handling** | Basic | Full propagation | **100% coverage** |
2404
- | **Testing strategy** | Ad-hoc | 3-layer (unit/int/e2e) | **Systematic** |
2405
- | **State management** | Unclear | 4-layer hierarchy | **No duplication** |
2406
- | **Observability** | None | 4-pillar (calls, context, cache, perf) | **Full visibility** |
2407
- | **Agent coordination** | Sequential | Parallel (event-driven) | **5x faster** |
2408
-
2409
- ### Derivation Power
2410
-
2411
- ```
2412
- From minimal axioms:
2413
- 7 axioms (v4.0.0)
2414
- + DataProviderInterface
2415
- + 4-tier caching
2416
- + 4-layer state management
2417
- + Error propagation ontology
2418
- + Testing ontology
2419
- + Observability layer
2420
- →
2421
- ∞ implementations × ∞ backends × ∞ caching strategies
2422
- ```
2423
-
2424
- ### Context Engineering Results
2425
-
2426
- **Traditional approach:**
2427
-
2428
- - Load: 50k-300k tokens per request
2429
- - Cost: $0.50-$3.00 per request
2430
- - Speed: 30-60 seconds
2431
- - Backends: 1 (tightly coupled)
2432
-
2433
- **Ontology-driven approach (v4.0.0):**
2434
-
2435
- - Load: 300-5k tokens per request (98-99% reduction)
2436
- - Cost: $0.003-$0.05 per request (100x cheaper)
2437
- - Speed: 2-5 seconds (10x faster)
2438
- - Backends: ∞ (swap with 1 line)
2439
-
2440
- ### Properties
2441
-
2442
- - ✅ **Minimal**: Smallest set of axioms for complete expressiveness
2443
- - ✅ **Complete**: Derives all implementations for all backends
2444
- - ✅ **Consistent**: No contradictions
2445
- - ✅ **Composable**: Clear composition algebra
2446
- - ✅ **Formal**: Mathematically rigorous
2447
- - ✅ **Practical**: AI-executable
2448
- - ✅ **Flexible**: Works with ANY backend
2449
- - ✅ **Observable**: Full instrumentation
2450
- - ✅ **Testable**: 3-layer testing strategy
2451
- - ✅ **Performant**: 4-tier caching, 98%+ context reduction
2452
-
2453
- ### Usage Flow (v4.0.0)
2454
-
2455
- ```
2456
- Agent receives task:
2457
- 1. Load type definition [L1 cache: instant]
2458
- 2. Load DataProviderInterface [L2 cache: instant]
2459
- 3. Load pattern [context-engineering: just-in-time]
2460
- 4. Generate backend-agnostic code
2461
- 5. Validate: No backend-specific imports
2462
- 6. Write tests (mock provider for unit tests)
2463
- 7. Emit events (coordination via ontology)
2464
- 8. Observe metrics (provider calls, context usage, cache hits)
2465
-
2466
- Total context: Minimal (vs 280k traditional)
2467
- Result: Code works with Convex, WordPress, Notion, Supabase, etc.
2468
- Performance: 98%+ context reduction, 10x faster, 100x cheaper
2469
- ```
2470
-
2471
- ---
2472
-
2473
- **The ontology is executable. Types are the program. Backends are interchangeable. Context is minimal. Everything is observable.**
2474
-
2475
- **v4.0.0: Complete backend agnosticism + context engineering + observability + event-driven coordination = The future of frontend development.**