oneie 2.0.2 → 2.0.3

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 (405) hide show
  1. package/AGENTS.md +245 -0
  2. package/CLAUDE.md +534 -0
  3. package/one/.obsidian/app.json +1 -0
  4. package/one/.obsidian/appearance.json +1 -0
  5. package/one/.obsidian/core-plugins.json +33 -0
  6. package/one/.obsidian/workspace.json +211 -0
  7. package/one/connections/a2a.md +551 -0
  8. package/one/connections/acp.md +761 -0
  9. package/one/connections/acps.md +731 -0
  10. package/one/connections/agui.md +767 -0
  11. package/one/connections/any-backend.md +1702 -0
  12. package/one/connections/ap2.md +998 -0
  13. package/one/connections/api-docs.md +1891 -0
  14. package/one/connections/api.md +2190 -0
  15. package/one/connections/architecture-diagram.md +94 -0
  16. package/one/connections/communications.md +449 -0
  17. package/one/connections/connections.md +339 -0
  18. package/one/connections/cryptonetworks.md +781 -0
  19. package/one/connections/documentation.md +1120 -0
  20. package/one/connections/effect.md +279 -0
  21. package/one/connections/elizaos.md +1290 -0
  22. package/one/connections/inference.md +58 -0
  23. package/one/connections/kyc.md +632 -0
  24. package/one/connections/mcp.md +842 -0
  25. package/one/connections/membership.md +1152 -0
  26. package/one/connections/middleware.md +1067 -0
  27. package/one/connections/multitenant.md +1341 -0
  28. package/one/connections/n8n.md +1015 -0
  29. package/one/connections/patterns.md +89 -0
  30. package/one/connections/protocols.md +279 -0
  31. package/one/connections/relationships.md +107 -0
  32. package/one/connections/schema.md +587 -0
  33. package/one/connections/service-layer.md +550 -0
  34. package/one/connections/structure.md +0 -0
  35. package/one/connections/vectors.md +207 -0
  36. package/one/connections/wordpress.md +1302 -0
  37. package/one/connections/workflow-copy.md +905 -0
  38. package/one/connections/workflow-examples.md +741 -0
  39. package/one/connections/workflow.md +905 -0
  40. package/one/connections/workflows/delegation.md +885 -0
  41. package/one/connections/workflows/frontend.md +1037 -0
  42. package/one/connections/workflows/strategy.md +903 -0
  43. package/one/connections/workflows/tasks.md +698 -0
  44. package/one/connections/x402.md +1249 -0
  45. package/one/events/events.md +545 -0
  46. package/one/knowledge/ai-platform.md +305 -0
  47. package/one/knowledge/architecture-diagram.md +94 -0
  48. package/one/knowledge/architecture-frontend.md +930 -0
  49. package/one/knowledge/architecture.md +2077 -0
  50. package/one/knowledge/crypto.md +960 -0
  51. package/one/knowledge/dsl.md +1660 -0
  52. package/one/knowledge/files.md +2471 -0
  53. package/one/knowledge/frontend.md +1038 -0
  54. package/one/knowledge/hono.md +2109 -0
  55. package/one/knowledge/implementation-examples.md +2536 -0
  56. package/one/knowledge/inference-score.md +159 -0
  57. package/one/knowledge/knowledge.md +642 -0
  58. package/one/knowledge/language.md +980 -0
  59. package/one/knowledge/lessons-learned.md +70 -0
  60. package/one/knowledge/ontology-6-dimensions.md +0 -0
  61. package/one/knowledge/ontology-documentation.md +356 -0
  62. package/one/knowledge/ontology-engineering-specification.md +1292 -0
  63. package/one/knowledge/ontology-engineering.md +1652 -0
  64. package/one/knowledge/ontology-frontend-copy-2.md +1492 -0
  65. package/one/knowledge/ontology-frontend-copy.md +753 -0
  66. package/one/knowledge/ontology-frontend-specifications.md +2188 -0
  67. package/one/knowledge/ontology-frontend.md +2427 -0
  68. package/one/knowledge/ontology-minimal.yaml +299 -0
  69. package/one/knowledge/ontology.md +2819 -0
  70. package/one/knowledge/ontology.yaml +1165 -0
  71. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +100 -0
  72. package/one/knowledge/patterns/backend/convex-query-pattern.md +88 -0
  73. package/one/knowledge/patterns/backend/mutation-template.md +231 -0
  74. package/one/knowledge/patterns/backend/query-template.md +267 -0
  75. package/one/knowledge/patterns/backend/service-template.md +237 -0
  76. package/one/knowledge/patterns/design/component-architecture.md +399 -0
  77. package/one/knowledge/patterns/design/test-driven-design-pattern.md +162 -0
  78. package/one/knowledge/patterns/design/wireframe-template.md +216 -0
  79. package/one/knowledge/patterns/frontend/component-template.md +195 -0
  80. package/one/knowledge/patterns/frontend/form-template.md +276 -0
  81. package/one/knowledge/patterns/frontend/page-template.md +178 -0
  82. package/one/knowledge/patterns/frontend/react-component-pattern.md +128 -0
  83. package/one/knowledge/patterns/test/acceptance-criteria-template.md +378 -0
  84. package/one/knowledge/patterns/test/technical-test-template.md +544 -0
  85. package/one/knowledge/patterns/test/test-driven-pattern.md +140 -0
  86. package/one/knowledge/patterns/test/user-flow-template.md +254 -0
  87. package/one/knowledge/quality-loop.md +401 -0
  88. package/one/knowledge/readme.md +131 -0
  89. package/one/knowledge/rules.md +626 -0
  90. package/one/knowledge/score.md +67 -0
  91. package/one/knowledge/specifications.md +855 -0
  92. package/one/knowledge/tags.md +130 -0
  93. package/one/organisation/one.md +599 -0
  94. package/one/organisation/organisation.md +438 -0
  95. package/one/organisation/revenue.md +673 -0
  96. package/one/organisation/strategy.md +869 -0
  97. package/one/organisation/vision.md +98 -0
  98. package/one/people/anthony-o-connell.md +440 -0
  99. package/one/people/people.md +567 -0
  100. package/one/repomix-output.md +92634 -0
  101. package/one/things/agentkit.md +349 -0
  102. package/one/things/agents/agent-backend.md +1401 -0
  103. package/one/things/agents/agent-builder.md +955 -0
  104. package/one/things/agents/agent-clean.md +709 -0
  105. package/one/things/agents/agent-clone.md +1341 -0
  106. package/one/things/agents/agent-designer.md +2177 -0
  107. package/one/things/agents/agent-director.md +1508 -0
  108. package/one/things/agents/agent-documenter.md +1049 -0
  109. package/one/things/agents/agent-frontend.md +1119 -0
  110. package/one/things/agents/agent-integrator.md +1192 -0
  111. package/one/things/agents/agent-problem-solver.md +1379 -0
  112. package/one/things/agents/agent-quality.md +1353 -0
  113. package/one/things/agents/agent-sales.md +986 -0
  114. package/one/things/cascade/cascade.yaml +464 -0
  115. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +470 -0
  116. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +264 -0
  117. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +486 -0
  118. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +497 -0
  119. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +227 -0
  120. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +516 -0
  121. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +544 -0
  122. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +223 -0
  123. package/one/things/cascade/docs/examples/1-3-event-coordination.md +508 -0
  124. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +609 -0
  125. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +195 -0
  126. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +577 -0
  127. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +797 -0
  128. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +212 -0
  129. package/one/things/cascade/docs/examples/1-5-quality-loops.md +641 -0
  130. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +610 -0
  131. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +213 -0
  132. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +575 -0
  133. package/one/things/cascade/docs/examples/readme.md +222 -0
  134. package/one/things/cascade/docs/getting-started.md +515 -0
  135. package/one/things/cascade/docs/workflow.md +1372 -0
  136. package/one/things/cascade/readme.md +336 -0
  137. package/one/things/cascade/templates/feature-template.md +267 -0
  138. package/one/things/claude/agents/advocacy-activation-manager.md +685 -0
  139. package/one/things/claude/agents/advocacy-campaign-designer.md +663 -0
  140. package/one/things/claude/agents/analyst.md +483 -0
  141. package/one/things/claude/agents/architect.md +480 -0
  142. package/one/things/claude/agents/brand-identity-specialist.md +513 -0
  143. package/one/things/claude/agents/bstp-token-strategist.md +667 -0
  144. package/one/things/claude/agents/builder-repo.md +489 -0
  145. package/one/things/claude/agents/bullstamp-community-builder.md +574 -0
  146. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +506 -0
  147. package/one/things/claude/agents/bulltilt-platform-growth.md +567 -0
  148. package/one/things/claude/agents/company-bullstamp-character.md +587 -0
  149. package/one/things/claude/agents/company-bullstamp-community.md +292 -0
  150. package/one/things/claude/agents/company-bullstamp-marketing.md +292 -0
  151. package/one/things/claude/agents/company-bullstamp-token.md +292 -0
  152. package/one/things/claude/agents/company-bulltilt-growth.md +292 -0
  153. package/one/things/claude/agents/content-bibliography-formatter.md +381 -0
  154. package/one/things/claude/agents/content-calendar-planner.md +448 -0
  155. package/one/things/claude/agents/content-chapter-formatter.md +488 -0
  156. package/one/things/claude/agents/content-formatter.md +546 -0
  157. package/one/things/claude/agents/content-hook-specialist.md +462 -0
  158. package/one/things/claude/agents/content-image-formatter.md +535 -0
  159. package/one/things/claude/agents/content-introduction-formatter.md +485 -0
  160. package/one/things/claude/agents/content-multiplication-engine.md +556 -0
  161. package/one/things/claude/agents/content-playbook-writer.md +448 -0
  162. package/one/things/claude/agents/content-team-manager.md +622 -0
  163. package/one/things/claude/agents/content-toc-formatter.md +522 -0
  164. package/one/things/claude/agents/convex-backend-specialist.md +2561 -0
  165. package/one/things/claude/agents/core-manager.md +582 -0
  166. package/one/things/claude/agents/core-master.md +403 -0
  167. package/one/things/claude/agents/cross-functional-manager.md +471 -0
  168. package/one/things/claude/agents/crypto-airdrop-strategist.md +602 -0
  169. package/one/things/claude/agents/crypto-analytics-educator.md +553 -0
  170. package/one/things/claude/agents/crypto-architecture-specialist.md +466 -0
  171. package/one/things/claude/agents/crypto-community-analyst.md +298 -0
  172. package/one/things/claude/agents/crypto-community-psychologist.md +509 -0
  173. package/one/things/claude/agents/crypto-dex-optimization-expert.md +538 -0
  174. package/one/things/claude/agents/crypto-dex-optimizer.md +292 -0
  175. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +513 -0
  176. package/one/things/claude/agents/crypto-diamond-hands.md +292 -0
  177. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +554 -0
  178. package/one/things/claude/agents/crypto-engagement-specialist.md +540 -0
  179. package/one/things/claude/agents/crypto-market-researcher.md +292 -0
  180. package/one/things/claude/agents/crypto-marketing-orchestrator.md +523 -0
  181. package/one/things/claude/agents/crypto-network-effect-amplifier.md +569 -0
  182. package/one/things/claude/agents/crypto-optimization-analyst.md +554 -0
  183. package/one/things/claude/agents/crypto-strategic-synthesizer.md +517 -0
  184. package/one/things/claude/agents/crypto-team-manager.md +387 -0
  185. package/one/things/claude/agents/crypto-token-analyst.md +278 -0
  186. package/one/things/claude/agents/crypto-viral-content-creator.md +546 -0
  187. package/one/things/claude/agents/crypto-wallet-identification-expert.md +517 -0
  188. package/one/things/claude/agents/crypto-wallet-identifier.md +292 -0
  189. package/one/things/claude/agents/customer-journey-designer.md +481 -0
  190. package/one/things/claude/agents/customer-success-manager.md +581 -0
  191. package/one/things/claude/agents/dev.md +413 -0
  192. package/one/things/claude/agents/documenter.md +546 -0
  193. package/one/things/claude/agents/elevate-marketing-orchestrator.md +410 -0
  194. package/one/things/claude/agents/engagement-specialist.md +509 -0
  195. package/one/things/claude/agents/engineering-architect.md +387 -0
  196. package/one/things/claude/agents/engineering-business-analyst.md +537 -0
  197. package/one/things/claude/agents/engineering-developer.md +387 -0
  198. package/one/things/claude/agents/engineering-director.md +282 -0
  199. package/one/things/claude/agents/engineering-ingestor.md +649 -0
  200. package/one/things/claude/agents/engineering-product-manager.md +537 -0
  201. package/one/things/claude/agents/engineering-product-owner.md +537 -0
  202. package/one/things/claude/agents/engineering-project-coordinator.md +537 -0
  203. package/one/things/claude/agents/engineering-quality-assurance.md +393 -0
  204. package/one/things/claude/agents/engineering-team-manager.md +512 -0
  205. package/one/things/claude/agents/engineering-user-experience.md +387 -0
  206. package/one/things/claude/agents/framework-elevate-manager.md +294 -0
  207. package/one/things/claude/agents/improver.md +763 -0
  208. package/one/things/claude/agents/intelligence-team-manager.md +385 -0
  209. package/one/things/claude/agents/lead-capture-expert.md +466 -0
  210. package/one/things/claude/agents/lead-magnet-creator.md +453 -0
  211. package/one/things/claude/agents/market-research-analyst.md +412 -0
  212. package/one/things/claude/agents/marketing-brand-identity.md +314 -0
  213. package/one/things/claude/agents/marketing-content-hooks.md +450 -0
  214. package/one/things/claude/agents/marketing-content-multiplier.md +326 -0
  215. package/one/things/claude/agents/marketing-content-poster.md +361 -0
  216. package/one/things/claude/agents/marketing-customer-journey.md +326 -0
  217. package/one/things/claude/agents/marketing-director.md +397 -0
  218. package/one/things/claude/agents/marketing-engagement.md +326 -0
  219. package/one/things/claude/agents/marketing-lead-capture.md +326 -0
  220. package/one/things/claude/agents/marketing-lead-magnet.md +326 -0
  221. package/one/things/claude/agents/marketing-network-effects.md +326 -0
  222. package/one/things/claude/agents/marketing-nurture-campaigns.md +326 -0
  223. package/one/things/claude/agents/marketing-share-optimizer.md +326 -0
  224. package/one/things/claude/agents/marketing-team-manager.md +446 -0
  225. package/one/things/claude/agents/marketing-viral-growth.md +201 -0
  226. package/one/things/claude/agents/mission-commander.md +373 -0
  227. package/one/things/claude/agents/network-effect-analyst.md +587 -0
  228. package/one/things/claude/agents/nextjs-15-specialist.md +1547 -0
  229. package/one/things/claude/agents/npx.md +890 -0
  230. package/one/things/claude/agents/nurture-campaign-manager.md +531 -0
  231. package/one/things/claude/agents/one-master.md +355 -0
  232. package/one/things/claude/agents/one-orchestrator.md +315 -0
  233. package/one/things/claude/agents/one.md +601 -0
  234. package/one/things/claude/agents/playbook-generator.md +503 -0
  235. package/one/things/claude/agents/pm.md +326 -0
  236. package/one/things/claude/agents/po.md +345 -0
  237. package/one/things/claude/agents/qa.md +336 -0
  238. package/one/things/claude/agents/research-foundation-analyst.md +307 -0
  239. package/one/things/claude/agents/research-intelligence-gatherer.md +408 -0
  240. package/one/things/claude/agents/research-market-analyst.md +307 -0
  241. package/one/things/claude/agents/research-team-manager.md +482 -0
  242. package/one/things/claude/agents/sales-environment-optimizer.md +494 -0
  243. package/one/things/claude/agents/sales-team-manager.md +400 -0
  244. package/one/things/claude/agents/sales-upsell-strategist.md +307 -0
  245. package/one/things/claude/agents/service-advocacy-campaigns.md +307 -0
  246. package/one/things/claude/agents/service-advocacy-manager.md +307 -0
  247. package/one/things/claude/agents/service-success-manager.md +307 -0
  248. package/one/things/claude/agents/service-team-manager.md +400 -0
  249. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +2302 -0
  250. package/one/things/claude/agents/share-optimization-specialist.md +551 -0
  251. package/one/things/claude/agents/sm.md +327 -0
  252. package/one/things/claude/agents/story-teller.md +473 -0
  253. package/one/things/claude/agents/task-master.md +596 -0
  254. package/one/things/claude/agents/tauri-cross-platform-specialist.md +1827 -0
  255. package/one/things/claude/agents/tester.md +556 -0
  256. package/one/things/claude/agents/the-bull-character-manager.md +580 -0
  257. package/one/things/claude/agents/tools-playbook-generator.md +489 -0
  258. package/one/things/claude/agents/turbo-repo-builder.md +316 -0
  259. package/one/things/claude/agents/upsell-strategist.md +480 -0
  260. package/one/things/claude/agents/ux-expert.md +335 -0
  261. package/one/things/claude/agents/viral-growth-orchestrator.md +497 -0
  262. package/one/things/claude/claude-code-hooks-development.json +21 -0
  263. package/one/things/claude/claude-code-hooks-production.json +21 -0
  264. package/one/things/claude/claude-code-hooks.json +25 -0
  265. package/one/things/claude/commands/agent.md +104 -0
  266. package/one/things/claude/commands/cascade-status.md +128 -0
  267. package/one/things/claude/commands/ingest.md +290 -0
  268. package/one/things/claude/commands/ingestor.md +136 -0
  269. package/one/things/claude/commands/mission.md +83 -0
  270. package/one/things/claude/commands/npx.md +133 -0
  271. package/one/things/claude/commands/one.md +440 -0
  272. package/one/things/claude/commands/quality-check.md +204 -0
  273. package/one/things/claude/commands/smart-route.md +220 -0
  274. package/one/things/claude/commands/start.md +121 -0
  275. package/one/things/claude/commands/story.md +83 -0
  276. package/one/things/claude/commands/task.md +173 -0
  277. package/one/things/claude/hook-bypass.json +32 -0
  278. package/one/things/claude/hooks/agent-hook-config.json +427 -0
  279. package/one/things/claude/hooks/agent-hook-manager.js +525 -0
  280. package/one/things/claude/hooks/agent-load-balancer.js +271 -0
  281. package/one/things/claude/hooks/agent-request-interceptor.js +70 -0
  282. package/one/things/claude/hooks/build-hook.sh +156 -0
  283. package/one/things/claude/hooks/cascade-feedback.js +297 -0
  284. package/one/things/claude/hooks/cascade-integration-hooks.js +648 -0
  285. package/one/things/claude/hooks/cleanup-hook.sh +201 -0
  286. package/one/things/claude/hooks/continuous-improvement-monitor.js +510 -0
  287. package/one/things/claude/hooks/file-organization-engine.js +427 -0
  288. package/one/things/claude/hooks/file-organization-hook.sh +80 -0
  289. package/one/things/claude/hooks/file-organization-monitor.js +269 -0
  290. package/one/things/claude/hooks/format-hook.sh +43 -0
  291. package/one/things/claude/hooks/hook-bypass.sh +293 -0
  292. package/one/things/claude/hooks/hook-config-manager.js +202 -0
  293. package/one/things/claude/hooks/hook-debouncer.sh +62 -0
  294. package/one/things/claude/hooks/hook-logger.sh +89 -0
  295. package/one/things/claude/hooks/hook-orchestrator.js +662 -0
  296. package/one/things/claude/hooks/hook-performance-report.js +120 -0
  297. package/one/things/claude/hooks/lint-hook.sh +140 -0
  298. package/one/things/claude/hooks/mcp-cascade-integration.js +816 -0
  299. package/one/things/claude/hooks/memory-optimizer.js +510 -0
  300. package/one/things/claude/hooks/notification-hook.sh +204 -0
  301. package/one/things/claude/hooks/ontology-compliance.js +394 -0
  302. package/one/things/claude/hooks/ontology-hook-manager.js +316 -0
  303. package/one/things/claude/hooks/ontology-validation-engine.js +317 -0
  304. package/one/things/claude/hooks/ontology-validation-hook.sh +86 -0
  305. package/one/things/claude/hooks/performance-metrics.json +25 -0
  306. package/one/things/claude/hooks/performance-monitoring-hook.js +422 -0
  307. package/one/things/claude/hooks/quality-scoring-engine.js +834 -0
  308. package/one/things/claude/hooks/security-hook.sh +256 -0
  309. package/one/things/claude/hooks/simple-load-balancer.js +238 -0
  310. package/one/things/claude/hooks/startup-optimizer.js +625 -0
  311. package/one/things/claude/hooks/story-scoring-system.js +445 -0
  312. package/one/things/claude/hooks/story-validation-engine.js +473 -0
  313. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +210 -0
  314. package/one/things/claude/hooks/story-validation-hook.sh +145 -0
  315. package/one/things/claude/hooks/structure-synchronizer.js +194 -0
  316. package/one/things/claude/hooks/sub-agent-output-validator.js +647 -0
  317. package/one/things/claude/hooks/sub-agent-validation-hook.js +343 -0
  318. package/one/things/claude/hooks/test-hook.sh +145 -0
  319. package/one/things/claude/hooks/test-story-validation.sh +170 -0
  320. package/one/things/claude/hooks/trinity-validation-system.js +392 -0
  321. package/one/things/claude/settings-local.json +86 -0
  322. package/one/things/cli-code.md +652 -0
  323. package/one/things/cli-compiler-code.md +652 -0
  324. package/one/things/cli.md +1045 -0
  325. package/one/things/components/card-shadcn.md +929 -0
  326. package/one/things/components/card.md +1050 -0
  327. package/one/things/components.md +1669 -0
  328. package/one/things/componets.md +4 -0
  329. package/one/things/copilotkit.md +1559 -0
  330. package/one/things/creator-diagram.md +166 -0
  331. package/one/things/examples/children/lemonade-stand.md +366 -0
  332. package/one/things/examples/enterprise/crm-saas.md +1429 -0
  333. package/one/things/features/1-1-agent-prompts/design.md +470 -0
  334. package/one/things/features/1-1-agent-prompts/tests.md +264 -0
  335. package/one/things/features/1-1-agent-prompts.md +486 -0
  336. package/one/things/features/1-2-yaml-orchestrator/design.md +497 -0
  337. package/one/things/features/1-2-yaml-orchestrator/tests.md +227 -0
  338. package/one/things/features/1-2-yaml-orchestrator.md +516 -0
  339. package/one/things/features/1-3-event-coordination/design.md +544 -0
  340. package/one/things/features/1-3-event-coordination/tests.md +223 -0
  341. package/one/things/features/1-3-event-coordination.md +508 -0
  342. package/one/things/features/1-4-knowledge-management/design.md +609 -0
  343. package/one/things/features/1-4-knowledge-management/tests.md +195 -0
  344. package/one/things/features/1-4-knowledge-management.md +577 -0
  345. package/one/things/features/1-5-quality-loops/design.md +797 -0
  346. package/one/things/features/1-5-quality-loops/tests.md +212 -0
  347. package/one/things/features/1-5-quality-loops.md +641 -0
  348. package/one/things/features/1-6-numbering-structure/design.md +610 -0
  349. package/one/things/features/1-6-numbering-structure/tests.md +213 -0
  350. package/one/things/features/1-6-numbering-structure.md +575 -0
  351. package/one/things/features/2-cli.md +1235 -0
  352. package/one/things/features/use-one-backend.md +1180 -0
  353. package/one/things/ideas/1-create-workflow.md +189 -0
  354. package/one/things/plans/1-create-workflow-status.md +555 -0
  355. package/one/things/plans/1-create-workflow.md +713 -0
  356. package/one/things/plans/app.md +761 -0
  357. package/one/things/plans/better-auth-any-backend-revised.md +1065 -0
  358. package/one/things/plans/better-auth-any-backend.md +1852 -0
  359. package/one/things/plans/better-auth-available-features.md +235 -0
  360. package/one/things/plans/big-plan.md +38 -0
  361. package/one/things/plans/convex-better-auth.md +1109 -0
  362. package/one/things/plans/convex-on-off.md +389 -0
  363. package/one/things/plans/desktop.md +1121 -0
  364. package/one/things/plans/effect-components.md +1669 -0
  365. package/one/things/plans/effect.md +973 -0
  366. package/one/things/plans/email.md +953 -0
  367. package/one/things/plans/enhance-auth.md +1669 -0
  368. package/one/things/plans/install-components.md +198 -0
  369. package/one/things/plans/landing.md +728 -0
  370. package/one/things/plans/layout.md +205 -0
  371. package/one/things/plans/mail-backend.md +1308 -0
  372. package/one/things/plans/mail.md +2624 -0
  373. package/one/things/plans/next-features.md +83 -0
  374. package/one/things/plans/one.md +658 -0
  375. package/one/things/plans/ontology-6-dimensions.md +2216 -0
  376. package/one/things/plans/ontology-driven-strategy.md +866 -0
  377. package/one/things/plans/ontology-ui-approach.md +357 -0
  378. package/one/things/plans/open-agent.md +785 -0
  379. package/one/things/plans/performace.md +90 -0
  380. package/one/things/plans/releases.md +809 -0
  381. package/one/things/plans/repos.md +76 -0
  382. package/one/things/plans/separate-copy-2.md +1293 -0
  383. package/one/things/plans/separate-copy-3.md +2458 -0
  384. package/one/things/plans/separate-copy.md +1293 -0
  385. package/one/things/plans/separate.md +1983 -0
  386. package/one/things/plans/shadcn-integration-summary.md +450 -0
  387. package/one/things/plans/sidebar.md +172 -0
  388. package/one/things/plans/small-fixes.md +5 -0
  389. package/one/things/plans/test-backend-connection.md +476 -0
  390. package/one/things/plans/workflow-files.md +1196 -0
  391. package/one/things/plans/workflow.md +1372 -0
  392. package/one/things/products/cascade-landing-page.md +737 -0
  393. package/one/things/products/cascade.md +1518 -0
  394. package/one/things/products/context-engineering.md +1427 -0
  395. package/one/things/products/onthology.md +0 -0
  396. package/one/things/products/ontology-ui-shadcn.md +1280 -0
  397. package/one/things/products/ontology-ui.md +1387 -0
  398. package/one/things/products/ontology.md +717 -0
  399. package/one/things/products/sdk.md +557 -0
  400. package/one/things/promptkit.md +903 -0
  401. package/one/things/service-providers-new.md +982 -0
  402. package/one/things/service-providers.md +1092 -0
  403. package/one/things/things.md +349 -0
  404. package/one/things/todo.md +1248 -0
  405. package/package.json +5 -2
@@ -0,0 +1,973 @@
1
+ # Integrating Effect.ts and confect into Astro-shadcn-Convex for AI Agents
2
+
3
+ **Effect.ts and confect transform your Convex AI agent development** by bringing functional programming's robust error handling, structured concurrency, and type safety to the reactive database stack. Based on production deployments like 14.ai (AI customer support platform), this integration provides industrial-strength reliability for building sophisticated agents with multi-step workflows, provider fallbacks, and complex state management. The combination works: Convex handles reactive data and real-time synchronization while Effect.ts manages external API calls, error recovery, and dependency injection.
4
+
5
+ ## Integration approaches
6
+
7
+ ### Understanding confect's role
8
+
9
+ Confect isn't just a thin wrapper—it's a comprehensive framework that **deeply integrates Effect.ts with Convex**. Created by RJ Dellecese, confect replaces Convex's native validator system with Effect's schema library and transforms all Convex APIs to return `Effect` types instead of `Promise`. Where Convex returns `A | null`, confect returns `Option<A>`, and errors become explicit in the Effect type signature. This provides end-to-end type safety from database operations through business logic to HTTP APIs with automatic OpenAPI documentation.
10
+
11
+ ### Project structure with Effect and confect
12
+
13
+ Your Astro-shadcn-Convex project extends naturally with Effect code living primarily in the Convex backend:
14
+
15
+ ```
16
+ your-project/
17
+ ├── src/ # Astro frontend
18
+ │ ├── components/
19
+ │ │ └── ui/ # Shadcn components (React)
20
+ │ ├── pages/
21
+ │ │ └── index.astro
22
+ │ └── lib/
23
+ │ └── convex.tsx # Convex client setup
24
+ ├── convex/ # Convex backend (Effect-focused)
25
+ │ ├── _generated/ # Auto-generated types
26
+ │ ├── schema.ts # Effect Schema definitions
27
+ │ ├── confect.ts # Generated function constructors
28
+ │ ├── functions.ts # Effect-based queries/mutations
29
+ │ ├── functions.schemas.ts # Args/returns validators
30
+ │ ├── lib/ # Effect services and layers
31
+ │ │ ├── services/
32
+ │ │ │ ├── Database.ts
33
+ │ │ │ ├── AI.ts
34
+ │ │ │ └── VectorStore.ts
35
+ │ │ └── layers/
36
+ │ │ ├── DatabaseLive.ts
37
+ │ │ ├── AILive.ts
38
+ │ │ └── index.ts # Combined app layers
39
+ │ ├── agents/ # Agent-specific code
40
+ │ │ ├── schemas/
41
+ │ │ │ └── agentSchemas.ts
42
+ │ │ ├── services/
43
+ │ │ │ ├── AgentService.ts
44
+ │ │ │ └── ToolRegistry.ts
45
+ │ │ ├── tools/
46
+ │ │ │ ├── search.ts
47
+ │ │ │ └── database.ts
48
+ │ │ └── workflows/
49
+ │ │ └── orchestration.ts
50
+ │ └── http/
51
+ │ └── api.ts # Effect HTTP APIs
52
+ ├── convex.json
53
+ ├── astro.config.mjs
54
+ └── tsconfig.json
55
+ ```
56
+
57
+ ### Schema definition with confect
58
+
59
+ Replace Convex validators with Effect schemas for stronger type guarantees:
60
+
61
+ ```typescript
62
+ // convex/schema.ts
63
+ import { Id, defineSchema, defineTable } from "@rjdellecese/confect/server";
64
+ import { Schema } from "effect";
65
+
66
+ export const confectSchema = defineSchema({
67
+ agents: defineTable(
68
+ Schema.Struct({
69
+ userId: Id.Id("users"),
70
+ name: Schema.String,
71
+ instructions: Schema.String,
72
+ model: Schema.Literal("gpt-4o", "claude-3-5-sonnet", "gemini-flash"),
73
+ status: Schema.Literal("active", "paused", "archived"),
74
+ metadata: Schema.optional(
75
+ Schema.Struct({
76
+ tags: Schema.Array(Schema.String),
77
+ lastActive: Schema.Number,
78
+ })
79
+ ),
80
+ })
81
+ )
82
+ .index("by_user", ["userId"])
83
+ .index("by_status", ["status"]),
84
+
85
+ threads: defineTable(
86
+ Schema.Struct({
87
+ agentId: Id.Id("agents"),
88
+ userId: Id.Id("users"),
89
+ title: Schema.optional(Schema.String),
90
+ })
91
+ )
92
+ .index("by_agent", ["agentId"])
93
+ .index("by_user", ["userId"]),
94
+
95
+ messages: defineTable(
96
+ Schema.Struct({
97
+ threadId: Id.Id("threads"),
98
+ role: Schema.Literal("user", "assistant", "system", "tool"),
99
+ content: Schema.String,
100
+ toolCalls: Schema.optional(Schema.Array(
101
+ Schema.Struct({
102
+ name: Schema.String,
103
+ args: Schema.Record(Schema.String, Schema.Unknown),
104
+ result: Schema.optional(Schema.Unknown),
105
+ })
106
+ )),
107
+ embedding: Schema.optional(Schema.Array(Schema.Number)),
108
+ })
109
+ )
110
+ .index("by_thread", ["threadId"])
111
+ .vectorIndex("embedding", {
112
+ vectorField: "embedding",
113
+ filterFields: ["threadId", "role"],
114
+ dimensions: 1536,
115
+ }),
116
+ });
117
+
118
+ export default confectSchema.convexSchemaDefinition;
119
+ ```
120
+
121
+ ### Function constructors with confect
122
+
123
+ Generate type-safe Effect-based function constructors:
124
+
125
+ ```typescript
126
+ // convex/confect.ts
127
+ import {
128
+ ConfectActionCtx as ConfectActionCtxService,
129
+ type ConfectActionCtx as ConfectActionCtxType,
130
+ type ConfectDataModelFromConfectSchemaDefinition,
131
+ type ConfectDoc as ConfectDocType,
132
+ ConfectMutationCtx as ConfectMutationCtxService,
133
+ type ConfectMutationCtx as ConfectMutationCtxType,
134
+ ConfectQueryCtx as ConfectQueryCtxService,
135
+ type ConfectQueryCtx as ConfectQueryCtxType,
136
+ type TableNamesInConfectDataModel,
137
+ makeFunctions,
138
+ } from "@rjdellecese/confect/server";
139
+ import { confectSchema } from "./schema";
140
+
141
+ export const {
142
+ action,
143
+ internalAction,
144
+ internalMutation,
145
+ internalQuery,
146
+ mutation,
147
+ query,
148
+ } = makeFunctions(confectSchema);
149
+
150
+ type ConfectDataModel = ConfectDataModelFromConfectSchemaDefinition<typeof confectSchema>;
151
+
152
+ export type ConfectDoc<
153
+ TableName extends TableNamesInConfectDataModel<ConfectDataModel>,
154
+ > = ConfectDocType<ConfectDataModel, TableName>;
155
+
156
+ export const ConfectQueryCtx = ConfectQueryCtxService<ConfectDataModel>();
157
+ export type ConfectQueryCtx = ConfectQueryCtxType<ConfectDataModel>;
158
+
159
+ export const ConfectMutationCtx = ConfectMutationCtxService<ConfectDataModel>();
160
+ export type ConfectMutationCtx = ConfectMutationCtxType<ConfectDataModel>;
161
+
162
+ export const ConfectActionCtx = ConfectActionCtxService<ConfectDataModel>();
163
+ export type ConfectActionCtx = ConfectActionCtxType<ConfectDataModel>;
164
+ ```
165
+
166
+ ### Writing Effect-based Convex functions
167
+
168
+ Queries, mutations, and actions now use Effect patterns:
169
+
170
+ ```typescript
171
+ // convex/functions.ts
172
+ import { Effect } from "effect";
173
+ import { ConfectMutationCtx, ConfectQueryCtx, mutation, query } from "./confect";
174
+ import { Schema } from "effect";
175
+
176
+ // Query: Read agent threads (reactive)
177
+ export const listThreads = query({
178
+ args: Schema.Struct({ userId: Schema.String }),
179
+ returns: Schema.Array(Schema.Unknown),
180
+ handler: ({ userId }) =>
181
+ Effect.gen(function* () {
182
+ const { db } = yield* ConfectQueryCtx;
183
+ return yield* db
184
+ .query("threads")
185
+ .withIndex("by_user", (q) => q.eq("userId", userId))
186
+ .order("desc")
187
+ .collect();
188
+ }),
189
+ });
190
+
191
+ // Mutation: Create thread (transactional)
192
+ export const createThread = mutation({
193
+ args: Schema.Struct({
194
+ agentId: Schema.String,
195
+ userId: Schema.String,
196
+ initialMessage: Schema.String
197
+ }),
198
+ returns: Schema.String,
199
+ handler: ({ agentId, userId, initialMessage }) =>
200
+ Effect.gen(function* () {
201
+ const { db } = yield* ConfectMutationCtx;
202
+
203
+ // Create thread
204
+ const threadId = yield* db.insert("threads", {
205
+ agentId,
206
+ userId,
207
+ });
208
+
209
+ // Add first message
210
+ yield* db.insert("messages", {
211
+ threadId,
212
+ role: "user",
213
+ content: initialMessage,
214
+ });
215
+
216
+ return threadId;
217
+ }),
218
+ });
219
+ ```
220
+
221
+ ### Frontend integration with Astro and React
222
+
223
+ Keep frontend code simple with standard Convex hooks—Effect lives primarily in the backend:
224
+
225
+ ```typescript
226
+ // src/lib/convex.tsx
227
+ import { ConvexReactClient } from "convex/react";
228
+ import { ConvexProvider } from "convex/react";
229
+
230
+ const CONVEX_URL = import.meta.env.PUBLIC_CONVEX_URL;
231
+ const client = new ConvexReactClient(CONVEX_URL);
232
+
233
+ export function ConvexClientProvider({ children }: { children: React.ReactNode }) {
234
+ return <ConvexProvider client={client}>{children}</ConvexProvider>;
235
+ }
236
+ ```
237
+
238
+ ```typescript
239
+ // src/components/AgentChat.tsx (React component)
240
+ import { useQuery, useMutation } from "convex/react";
241
+ import { api } from "../../convex/_generated/api";
242
+
243
+ export function AgentChat({ userId }: { userId: string }) {
244
+ const threads = useQuery(api.functions.listThreads, { userId });
245
+ const createThread = useMutation(api.functions.createThread);
246
+
247
+ // Reactive updates happen automatically
248
+ return (
249
+ <div>
250
+ {threads?.map(thread => (
251
+ <ThreadItem key={thread._id} thread={thread} />
252
+ ))}
253
+ <button onClick={() => createThread({
254
+ agentId: "agent123",
255
+ userId,
256
+ initialMessage: "Hello!"
257
+ })}>
258
+ New Chat
259
+ </button>
260
+ </div>
261
+ );
262
+ }
263
+ ```
264
+
265
+ ```astro
266
+ ---
267
+ // src/pages/index.astro
268
+ import Layout from '../layouts/Layout.astro';
269
+ import { AgentChat } from '../components/AgentChat';
270
+ import { ConvexClientProvider } from '../lib/convex';
271
+ ---
272
+
273
+ <Layout>
274
+ <ConvexClientProvider client:load>
275
+ <AgentChat userId="user123" client:load />
276
+ </ConvexClientProvider>
277
+ </Layout>
278
+ ```
279
+
280
+ ### Build configuration requirements
281
+
282
+ Critical TypeScript settings for confect compatibility:
283
+
284
+ ```json
285
+ // tsconfig.json (root)
286
+ {
287
+ "extends": "astro/tsconfigs/strict",
288
+ "compilerOptions": {
289
+ "exactOptionalPropertyTypes": false, // REQUIRED for Confect!
290
+ "strict": true,
291
+ "baseUrl": ".",
292
+ "paths": {
293
+ "@/*": ["./src/*"]
294
+ }
295
+ }
296
+ }
297
+
298
+ // convex/tsconfig.json
299
+ {
300
+ "compilerOptions": {
301
+ "exactOptionalPropertyTypes": false, // REQUIRED for Confect!
302
+ "moduleResolution": "Bundler",
303
+ "strict": true
304
+ }
305
+ }
306
+ ```
307
+
308
+ ```json
309
+ // convex.json
310
+ {
311
+ "functions": "convex/",
312
+ "node": {
313
+ "externalPackages": ["effect", "@effect/platform", "@effect/schema"],
314
+ "nodeVersion": "22"
315
+ }
316
+ }
317
+ ```
318
+
319
+ ## Benefits analysis
320
+
321
+ ### Effect.ts advantages for AI agent systems
322
+
323
+ **Typed error handling eliminates silent failures.** Effect makes errors first-class citizens with explicit error channels in type signatures (`Effect<Success, Error, Requirements>`). For AI agents calling unreliable LLM APIs, this prevents cascading failures. The 14.ai production system (AI customer support platform) uses tagged errors like `RateLimitError`, `InvalidInputError`, and `NetworkError` to implement sophisticated fallback chains—when OpenAI rate limits, automatically switch to Gemini. You compose error recovery strategies declaratively rather than nested try-catch blocks.
324
+
325
+ **Structured concurrency simplifies multi-step agent workflows.** Effect's fiber-based concurrency model provides lightweight virtual threads that compose naturally. Execute multiple tool calls concurrently with bounded concurrency (`Effect.all(toolCalls, { concurrency: 5 })`), race providers for fastest response (`Effect.race(openai, anthropic, gemini)`), or implement complex retry policies with exponential backoff. Interruption propagates automatically through fiber trees—when a user cancels an agent request, all child operations (LLM calls, database queries, tool executions) clean up properly without manual cancellation logic.
326
+
327
+ **Dependency injection enables seamless testing and provider swapping.** Effect's Context and Layer system provides compile-time type-safe dependency injection. Define an `LLMProvider` service interface, implement `OpenAILive` and `AnthropicLive` layers, swap at runtime based on configuration. For testing, replace with `LLMProviderMock` that returns canned responses. The 14.ai team reports this drastically improved test coverage—they mock LLM providers completely, eliminating flaky integration tests and reducing test costs.
328
+
329
+ **Resource management prevents leaks in long-running agents.** Effect's Scope system automatically releases resources (database connections, WebSocket streams, file handles) regardless of success, failure, or interruption. For streaming LLM responses, wrap in `Effect.scoped` with `addFinalizer` to abort streams on user cancellation. For RAG agents processing documents, ensure file handles close even when errors occur mid-processing. Effect handles cleanup correctly across concurrent operations—critical for production systems running 24/7.
330
+
331
+ **Schema validation provides type-safe data transformation.** Effect's Schema library validates and transforms data with full type inference. For AI agents, validate LLM function call outputs match expected schemas, parse structured responses, and enforce business rules. Schemas compose—define a base tool schema and extend it for specific tools. Transformations convert between API shapes and domain models. Combined with confect, your entire stack has end-to-end type safety from database to frontend.
332
+
333
+ ### confect-specific benefits for Convex
334
+
335
+ **Effect schemas replace Convex validators with stronger guarantees.** Confect uses Effect's Schema library instead of Convex's built-in validators (`v.string()`, `v.object()`). Effect schemas provide more expressive validation—regex patterns, numeric ranges, conditional logic, recursive types, and custom refinements. Schemas also enable transformations (converting ISO date strings to Date objects automatically) and better error messages. The schema serves as single source of truth for types, validation, and documentation.
336
+
337
+ **Option types eliminate null-checking boilerplate.** Where standard Convex returns `User | null` from queries, confect returns `Option<User>`. Effect's Option type forces explicit handling with pattern matching, map operations, or `getOrElse` fallbacks. This prevents null reference errors—you can't accidentally forget to check if a query returned null. Combined with Effect's type system, your entire agent workflow has explicit handling for missing data.
338
+
339
+ **Automatic database operation encoding/decoding.** Confect automatically encodes and decodes data according to your Effect schemas when reading from and writing to Convex. Define a schema with transformations (like converting timestamps to Date objects), and confect handles the conversions transparently. This keeps business logic clean—work with proper domain types throughout your code, not raw database representations.
340
+
341
+ **Built-in HTTP API with OpenAPI documentation.** Confect includes Effect's HTTP API modules for defining REST endpoints with automatic OpenAPI documentation generation via Scalar. Define your agent API endpoints with Effect schemas for request/response validation, and confect generates interactive API documentation. Perfect for exposing agent functionality to external integrations or building admin dashboards.
342
+
343
+ ### Synergy between Effect.ts and confect
344
+
345
+ These libraries work together seamlessly because confect is built on Effect.ts. When you write a confect function, you're writing Effect code—accessing the ConfectQueryCtx or ConfectMutationCtx returns an Effect that you compose with other Effects. Your agent service layers provide Effect-based operations, confect functions consume these services, and the entire stack maintains type safety with explicit error channels. The combination enables sophisticated patterns: query reactive agent state from Convex with ConfectQueryCtx, call external LLM APIs with Effect's retry/fallback logic, and save results transactionally with ConfectMutationCtx—all in a single composable workflow.
346
+
347
+ ### Specific advantages for building AI agents
348
+
349
+ **Multi-provider fallback chains.** Production AI systems need resilience against provider outages and rate limits. Effect's error handling makes this trivial: `generateText(prompt).pipe(Effect.catchTag("RateLimitError", () => fallbackProvider))`. Chain multiple fallbacks with different retry policies. The 14.ai system implements execution plans that track which providers failed, avoiding repeated attempts against known-down services.
350
+
351
+ **Parallel tool execution with graceful degradation.** AI agents often execute multiple tools concurrently. Effect's `Effect.all()` with `{ concurrency: N, mode: "either" }` runs tools in parallel, continues on individual failures, and collects successes. Your agent can still respond even if some tools fail—critical for production reliability.
352
+
353
+ **Streaming response management.** LLM streaming requires careful resource management to prevent leaks when users cancel requests. Effect's Stream module with Scope-based cleanup handles this correctly. The 14.ai pattern duplicates streams—one sends tokens to the user, another stores for analytics—with automatic cleanup on interruption.
354
+
355
+ **State management for conversational agents.** Effect's Ref provides atomic concurrent state updates. Combined with Convex's reactive database for persistence, you get both in-memory performance and durable storage. Use Ref for short-term conversational state (current tool executions, working memory) and Convex for long-term persistence (conversation history, learned preferences).
356
+
357
+ **Type-safe agent workflows.** Define agent workflows as Effect programs with explicit dependencies. Your workflow requires `LLMProvider`, `VectorStore`, and `ToolRegistry` services—Effect verifies at compile time that you provide these dependencies. Impossible to accidentally run an agent without required services configured.
358
+
359
+ ## Architecture patterns
360
+
361
+ ### Where to use Effect vs plain TypeScript
362
+
363
+ **Use Effect in Convex functions** (queries, mutations, actions). This is where Effect provides maximum value—handling external API calls, complex error scenarios, and resource management. All your agent orchestration logic, LLM interactions, and database operations benefit from Effect's guarantees.
364
+
365
+ **Use Effect for agent service layers.** Implement your AI capabilities (vector search, LLM generation, tool registry, memory management) as Effect services with explicit error types. These services compose naturally in agent workflows.
366
+
367
+ **Keep frontend code simple.** React components should use standard Convex hooks (`useQuery`, `useMutation`). Optionally use Effect for complex client-side validation or local state management, but this isn't necessary. The reactive updates from Convex work automatically—no need to integrate Effect with React state management.
368
+
369
+ **Use plain TypeScript for utilities and helpers** that don't involve async operations, error handling, or external integrations. Simple data transformations, formatters, and pure functions don't benefit from Effect.
370
+
371
+ ### Organizing Convex functions with Effect and confect
372
+
373
+ **Separate concerns into distinct function files:**
374
+
375
+ ```
376
+ convex/
377
+ ├── queries/ # Read-only operations
378
+ │ ├── threads.ts # Thread listing, filtering
379
+ │ ├── messages.ts # Message queries
380
+ │ └── agents.ts # Agent metadata
381
+ ├── mutations/ # Write operations
382
+ │ ├── threads.ts # Create/update threads
383
+ │ ├── messages.ts # Save messages
384
+ │ └── agents.ts # Agent configuration
385
+ └── actions/ # External integrations
386
+ ├── generate.ts # LLM generation
387
+ ├── embedding.ts # Vector embedding
388
+ └── tools.ts # Tool execution
389
+ ```
390
+
391
+ **Query pattern** (reactive, read-only):
392
+
393
+ ```typescript
394
+ // convex/queries/threads.ts
395
+ import { Effect } from "effect";
396
+ import { ConfectQueryCtx, query } from "../confect";
397
+ import { Schema } from "effect";
398
+
399
+ export const get = query({
400
+ args: Schema.Struct({ threadId: Schema.String }),
401
+ returns: Schema.Unknown,
402
+ handler: ({ threadId }) =>
403
+ Effect.gen(function* () {
404
+ const { db } = yield* ConfectQueryCtx;
405
+ return yield* db.get(threadId);
406
+ }),
407
+ });
408
+
409
+ export const list = query({
410
+ args: Schema.Struct({ agentId: Schema.String }),
411
+ returns: Schema.Array(Schema.Unknown),
412
+ handler: ({ agentId }) =>
413
+ Effect.gen(function* () {
414
+ const { db } = yield* ConfectQueryCtx;
415
+ return yield* db
416
+ .query("threads")
417
+ .withIndex("by_agent", (q) => q.eq("agentId", agentId))
418
+ .order("desc")
419
+ .take(50)
420
+ .collect();
421
+ }),
422
+ });
423
+ ```
424
+
425
+ **Mutation pattern** (transactional, write):
426
+
427
+ ```typescript
428
+ // convex/mutations/messages.ts
429
+ import { Effect } from "effect";
430
+ import { ConfectMutationCtx, mutation } from "../confect";
431
+ import { Schema } from "effect";
432
+
433
+ export const save = mutation({
434
+ args: Schema.Struct({
435
+ threadId: Schema.String,
436
+ role: Schema.Literal("user", "assistant"),
437
+ content: Schema.String,
438
+ toolCalls: Schema.optional(Schema.Array(Schema.Unknown)),
439
+ }),
440
+ returns: Schema.String,
441
+ handler: (args) =>
442
+ Effect.gen(function* () {
443
+ const { db } = yield* ConfectMutationCtx;
444
+
445
+ // Validate thread exists
446
+ const thread = yield* db.get(args.threadId);
447
+ if (!thread) {
448
+ return yield* Effect.fail(new Error("Thread not found"));
449
+ }
450
+
451
+ // Insert message
452
+ const messageId = yield* db.insert("messages", {
453
+ threadId: args.threadId,
454
+ role: args.role,
455
+ content: args.content,
456
+ toolCalls: args.toolCalls,
457
+ });
458
+
459
+ return messageId;
460
+ }),
461
+ });
462
+ ```
463
+
464
+ **Action pattern** (external calls, uses Effect heavily):
465
+
466
+ ```typescript
467
+ // convex/actions/generate.ts
468
+ import { Effect, Schedule } from "effect";
469
+ import { ConfectActionCtx, action } from "../confect";
470
+ import { LLMProvider, VectorStore } from "../lib/services";
471
+ import { Schema } from "effect";
472
+
473
+ export const generateResponse = action({
474
+ args: Schema.Struct({
475
+ threadId: Schema.String,
476
+ prompt: Schema.String
477
+ }),
478
+ returns: Schema.String,
479
+ handler: (args) =>
480
+ Effect.gen(function* () {
481
+ const ctx = yield* ConfectActionCtx;
482
+ const llm = yield* LLMProvider;
483
+ const vectorStore = yield* VectorStore;
484
+
485
+ // 1. Retrieve conversation history (via query)
486
+ const messages = yield* Effect.promise(() =>
487
+ ctx.runQuery(api.queries.messages.list, { threadId: args.threadId })
488
+ );
489
+
490
+ // 2. Search for relevant context
491
+ const context = yield* vectorStore.search(args.prompt).pipe(
492
+ Effect.timeout("5 seconds"),
493
+ Effect.catchAll(() => Effect.succeed([])) // Graceful degradation
494
+ );
495
+
496
+ // 3. Generate response with retry logic
497
+ const response = yield* llm.generate({
498
+ messages: [...messages, { role: "user", content: args.prompt }],
499
+ context,
500
+ }).pipe(
501
+ Effect.retry({
502
+ times: 3,
503
+ schedule: Schedule.exponential("1 second"),
504
+ }),
505
+ Effect.catchTags({
506
+ RateLimitError: () => llm.generateWithFallback(args.prompt),
507
+ NetworkError: (error) =>
508
+ Effect.succeed("I'm having trouble connecting. Please try again."),
509
+ })
510
+ );
511
+
512
+ // 4. Save response (via mutation)
513
+ yield* Effect.promise(() =>
514
+ ctx.runMutation(api.mutations.messages.save, {
515
+ threadId: args.threadId,
516
+ role: "assistant",
517
+ content: response,
518
+ })
519
+ );
520
+
521
+ return response;
522
+ }).pipe(
523
+ Effect.provide(AppLayer) // Provide service implementations
524
+ ),
525
+ });
526
+ ```
527
+
528
+ ### Agent-specific patterns
529
+
530
+ **Three-layer agent architecture** (from 14.ai production system):
531
+
532
+ **Layer 1: Actions** (atomic operations)
533
+
534
+ ```typescript
535
+ // convex/agents/actions/search.ts
536
+ import { Effect } from "effect";
537
+ import { VectorStore } from "../../lib/services";
538
+
539
+ export const searchKnowledgeBase = (query: string) =>
540
+ Effect.gen(function* () {
541
+ const vectorStore = yield* VectorStore;
542
+ const results = yield* vectorStore.search(query, { limit: 5 });
543
+ return results.map(r => r.content).join("\n\n");
544
+ });
545
+ ```
546
+
547
+ **Layer 2: Workflows** (multi-step processes)
548
+
549
+ ```typescript
550
+ // convex/agents/workflows/support.ts
551
+ import { Effect, Schedule } from "effect";
552
+ import { searchKnowledgeBase } from "../actions/search";
553
+ import { generateResponse } from "../actions/generate";
554
+
555
+ export const handleSupportQuery = (query: string) =>
556
+ Effect.gen(function* () {
557
+ // Step 1: Search knowledge base
558
+ const context = yield* searchKnowledgeBase(query).pipe(
559
+ Effect.timeout("5 seconds"),
560
+ Effect.retry({ times: 2 })
561
+ );
562
+
563
+ // Step 2: Generate response with context
564
+ const response = yield* generateResponse({
565
+ query,
566
+ context,
567
+ tone: "helpful and professional",
568
+ });
569
+
570
+ // Step 3: If response is uncertain, escalate
571
+ if (response.confidence < 0.7) {
572
+ yield* escalateToHuman(query, response);
573
+ }
574
+
575
+ return response;
576
+ });
577
+ ```
578
+
579
+ **Layer 3: Sub-agents** (domain-specific modules)
580
+
581
+ ```typescript
582
+ // convex/agents/sub-agents/billing.ts
583
+ import { Effect } from "effect";
584
+ import { handleSupportQuery } from "../workflows/support";
585
+
586
+ export class BillingAgent {
587
+ static handle = (query: string) =>
588
+ Effect.gen(function* () {
589
+ // Billing-specific preprocessing
590
+ const normalized = normalizeBillingQuery(query);
591
+
592
+ // Delegate to support workflow
593
+ const response = yield* handleSupportQuery(normalized);
594
+
595
+ // Billing-specific postprocessing
596
+ return formatBillingResponse(response);
597
+ });
598
+ }
599
+ ```
600
+
601
+ **Service-oriented agent architecture:**
602
+
603
+ ```typescript
604
+ // convex/lib/services/AgentService.ts
605
+ import { Context, Effect } from "effect";
606
+
607
+ export class AgentService extends Context.Tag("AgentService")<
608
+ AgentService,
609
+ {
610
+ readonly executeWorkflow: (
611
+ workflowId: string,
612
+ input: unknown
613
+ ) => Effect.Effect<string, AgentError>;
614
+
615
+ readonly registerTool: (
616
+ tool: AgentTool
617
+ ) => Effect.Effect<void, never>;
618
+ }
619
+ >() {}
620
+
621
+ // convex/lib/layers/AgentLive.ts
622
+ import { Layer, Effect } from "effect";
623
+ import { AgentService } from "../services/AgentService";
624
+ import { LLMProvider, ToolRegistry } from "../services";
625
+
626
+ export const AgentLive = Layer.effect(
627
+ AgentService,
628
+ Effect.gen(function* () {
629
+ const llm = yield* LLMProvider;
630
+ const tools = yield* ToolRegistry;
631
+
632
+ return {
633
+ executeWorkflow: (workflowId, input) =>
634
+ Effect.gen(function* () {
635
+ const workflow = yield* loadWorkflow(workflowId);
636
+ const result = yield* workflow.run(input, { llm, tools });
637
+ return result;
638
+ }),
639
+
640
+ registerTool: (tool) =>
641
+ tools.register(tool),
642
+ };
643
+ })
644
+ );
645
+ ```
646
+
647
+ **Tool registry pattern:**
648
+
649
+ ```typescript
650
+ // convex/lib/services/ToolRegistry.ts
651
+ import { Context, Effect } from "effect";
652
+
653
+ export interface AgentTool {
654
+ name: string;
655
+ description: string;
656
+ parameters: Schema.Schema<any>;
657
+ execute: (args: any) => Effect.Effect<any, ToolError>;
658
+ }
659
+
660
+ export class ToolRegistry extends Context.Tag("ToolRegistry")<
661
+ ToolRegistry,
662
+ {
663
+ readonly register: (tool: AgentTool) => Effect.Effect<void, never>;
664
+ readonly execute: (name: string, args: unknown) => Effect.Effect<any, ToolError>;
665
+ readonly list: () => Effect.Effect<AgentTool[], never>;
666
+ }
667
+ >() {}
668
+
669
+ // convex/agents/tools/search.ts
670
+ import { Schema } from "effect";
671
+ import { AgentTool } from "../../lib/services/ToolRegistry";
672
+
673
+ export const searchTool: AgentTool = {
674
+ name: "search",
675
+ description: "Search the knowledge base",
676
+ parameters: Schema.Struct({
677
+ query: Schema.String,
678
+ limit: Schema.optional(Schema.Number),
679
+ }),
680
+ execute: ({ query, limit = 5 }) =>
681
+ Effect.gen(function* () {
682
+ const vectorStore = yield* VectorStore;
683
+ return yield* vectorStore.search(query, { limit });
684
+ }),
685
+ };
686
+ ```
687
+
688
+ ### Composing service layers
689
+
690
+ **Layer composition pattern:**
691
+
692
+ ```typescript
693
+ // convex/lib/layers/index.ts
694
+ import { Layer } from "effect";
695
+ import { DatabaseLive } from "./DatabaseLive";
696
+ import { LLMProviderLive } from "./LLMProviderLive";
697
+ import { VectorStoreLive } from "./VectorStoreLive";
698
+ import { ToolRegistryLive } from "./ToolRegistryLive";
699
+ import { AgentLive } from "./AgentLive";
700
+
701
+ // Compose layers with dependencies
702
+ export const AppLayer = Layer.mergeAll(
703
+ DatabaseLive,
704
+ LLMProviderLive,
705
+ VectorStoreLive
706
+ ).pipe(
707
+ Layer.provideMerge(ToolRegistryLive), // ToolRegistry depends on above
708
+ Layer.provideMerge(AgentLive) // AgentService depends on all
709
+ );
710
+
711
+ // Usage in actions
712
+ export const myAction = action({
713
+ handler: (args) =>
714
+ Effect.gen(function* () {
715
+ const agent = yield* AgentService;
716
+ const result = yield* agent.executeWorkflow("support", args);
717
+ return result;
718
+ }).pipe(
719
+ Effect.provide(AppLayer) // Provide all services
720
+ ),
721
+ });
722
+ ```
723
+
724
+ ## Practical considerations
725
+
726
+ ### Learning curve and team adoption
727
+
728
+ **Effect.ts requires 2-4 weeks for proficiency.** The functional programming paradigm differs from standard TypeScript async/await. Developers need to understand Effect types, generator syntax (`Effect.gen`), error channels, and the pipe operator. Community feedback indicates initial frustration followed by productivity gains. Key insight from production teams: focus on learning 2-3 core modules (Effect, Schema, Layer) to achieve 80% productivity, then expand knowledge gradually.
729
+
730
+ **Mitigation strategy: incremental adoption.** Don't rewrite everything in Effect immediately. Start with error-prone areas like LLM API calls where Effect's retry/fallback logic provides immediate value. Use `Effect.runPromise()` at boundaries to integrate with existing code. Wrap external APIs as Effect services with mock implementations for testing. Gradually expand Effect usage as team confidence grows.
731
+
732
+ **Generator syntax bridges the gap.** Effect.gen looks similar to async/await, making it approachable for TypeScript developers:
733
+
734
+ ```typescript
735
+ // Familiar async/await
736
+ async function fetchUser(id: string) {
737
+ const user = await db.query("users").get(id);
738
+ const posts = await db.query("posts").filter(p => p.userId === user._id);
739
+ return { user, posts };
740
+ }
741
+
742
+ // Similar Effect.gen
743
+ const fetchUser = (id: string) =>
744
+ Effect.gen(function* () {
745
+ const { db } = yield* ConfectQueryCtx;
746
+ const user = yield* db.query("users").get(id);
747
+ const posts = yield* db.query("posts").filter(p => p.userId === user._id);
748
+ return { user, posts };
749
+ });
750
+ ```
751
+
752
+ **Confect adds minimal learning overhead.** If you understand Effect, confect is straightforward—it's Effect patterns applied to Convex. The main new concepts are the Confect contexts (`ConfectQueryCtx`, `ConfectMutationCtx`, `ConfectActionCtx`) which replace standard Convex's `ctx` parameter.
753
+
754
+ **Convex itself has gentle learning curve.** Convex's reactive database model is intuitive—queries automatically update, mutations are transactional, actions call external APIs. Most developers become productive with Convex in days. The AI agent component (from `@convex-dev/agents`) provides high-level abstractions that work well out of the box.
755
+
756
+ ### Performance implications
757
+
758
+ **Effect.ts performance is excellent.** Contrary to common misconceptions, Effect's core runtime adds minimal overhead (~15kb compressed). The generator-based syntax performs identically to async/await. Effect's structured concurrency actually improves performance by enabling fine-grained control over concurrent operations—you can easily limit concurrency to avoid overwhelming downstream services.
759
+
760
+ **Bundle size scales with usage.** Effect has aggressive tree-shaking. Only the functions you use get bundled. A typical agent application using Effect for error handling, concurrency, and schemas adds approximately 25-40kb to bundle size—negligible for modern applications.
761
+
762
+ **Convex performance characteristics.** Convex automatically caches query results and uses WebSocket-based subscriptions for efficient real-time updates. Database operations are fast (single-digit millisecond reads from cache). The main performance consideration: **use indexes for all queries**. Index-based queries scale to millions of documents; full table scans don't.
763
+
764
+ **Agent-specific performance patterns:**
765
+
766
+ 1. **Cache embeddings aggressively.** Vector embedding generation is expensive. Store embeddings in Convex with the `vectorIndex` and reuse them.
767
+
768
+ 2. **Limit concurrent LLM calls.** Use `Effect.all(calls, { concurrency: 3 })` to avoid rate limits and manage costs.
769
+
770
+ 3. **Stream responses when possible.** For chat interfaces, stream LLM tokens as they arrive rather than waiting for complete responses. Effect's Stream module handles this efficiently.
771
+
772
+ 4. **Denormalize for read performance.** Convex doesn't support joins. Denormalize frequently-accessed data rather than making multiple queries.
773
+
774
+
775
+ ### Debugging and tooling
776
+
777
+ **Effect DevTools provides runtime inspection.** Install the VS Code extension for Effect DevTools. It connects to your running application via WebSocket and shows real-time Effect execution, fiber traces, and structured logs. Critical for understanding complex agent workflows with multiple concurrent operations.
778
+
779
+ **Convex dashboard is comprehensive.** The Convex dashboard shows all database tables in real-time, function execution logs with timing, and a built-in Agent Playground for testing agent configurations. The Agent Playground lets you iterate on prompts, inspect tool calls, and tune context retrieval settings without writing code.
780
+
781
+ **Structured logging with Effect:**
782
+
783
+ ```typescript
784
+ import { Effect } from "effect";
785
+
786
+ const agentWorkflow = Effect.gen(function* () {
787
+ yield* Effect.log("Starting agent workflow", { userId, threadId });
788
+
789
+ const result = yield* generateResponse(prompt).pipe(
790
+ Effect.tap((response) =>
791
+ Effect.log("Generated response", {
792
+ length: response.length,
793
+ model: "gpt-4o"
794
+ })
795
+ )
796
+ );
797
+
798
+ yield* Effect.log("Workflow complete", { result });
799
+ return result;
800
+ });
801
+ ```
802
+
803
+ Logs appear in Convex dashboard with structured metadata for filtering and analysis.
804
+
805
+ **OpenTelemetry integration** for production observability:
806
+
807
+ ```typescript
808
+ import { Tracer } from "effect";
809
+
810
+ const tracedGeneration = generateText(prompt).pipe(
811
+ Effect.withSpan("llm-generation", {
812
+ attributes: { model: "gpt-4o", promptLength: prompt.length }
813
+ })
814
+ );
815
+ ```
816
+
817
+ Traces export to your observability platform (Datadog, Honeycomb, etc.) for production monitoring.
818
+
819
+ ### Migration strategies
820
+
821
+ **For greenfield projects, start with Effect and confect from day one.** Structure your Convex backend with Effect patterns from the beginning. Use confect's schema-first approach for database definitions. Build agent services as Effect layers with dependency injection. This approach provides maximum benefit with minimal migration pain.
822
+
823
+ **For existing Convex projects, adopt incrementally:**
824
+
825
+ 1. **Phase 1: Add confect and Effect to new features only.** Don't rewrite existing code. Implement new agent functionality using Effect patterns. This demonstrates value without disrupting working code.
826
+
827
+ 2. **Phase 2: Wrap high-value existing code.** Identify error-prone areas—typically external API calls and complex multi-step workflows. Wrap these in Effect with proper error handling and retries.
828
+
829
+ 3. **Phase 3: Migrate critical paths.** Once team is comfortable, migrate high-traffic or business-critical paths to Effect for improved reliability.
830
+
831
+
832
+ **Interoperability pattern** for gradual migration:
833
+
834
+ ```typescript
835
+ // Existing Convex function (standard)
836
+ export const legacyFunction = query({
837
+ handler: async (ctx, args) => {
838
+ return await ctx.db.query("users").collect();
839
+ },
840
+ });
841
+
842
+ // New Effect-based function calling legacy code
843
+ export const modernFunction = query({
844
+ handler: (args) =>
845
+ Effect.gen(function* () {
846
+ const { runQuery } = yield* ConfectQueryCtx;
847
+
848
+ // Call legacy function via runQuery
849
+ const users = yield* Effect.promise(() =>
850
+ runQuery(api.legacyFunction)
851
+ );
852
+
853
+ // Apply Effect-based processing
854
+ const processed = yield* processUsers(users);
855
+ return processed;
856
+ }),
857
+ });
858
+ ```
859
+
860
+ ### Potential gotchas and limitations
861
+
862
+ **Confect requires `exactOptionalPropertyTypes: false`.** This is a Convex limitation, not confect's. Convex treats optional properties differently than TypeScript's strict mode expects. Set this in your tsconfig.json or confect won't compile.
863
+
864
+ **Effect error handling can create false confidence.** The 14.ai team warns: clean Effect code can create false sense of robustness. You must still rigorously test failure scenarios. Effect makes error handling explicit but doesn't automatically make your code correct.
865
+
866
+ **Convex actions don't retry automatically.** Unlike queries and mutations which Convex retries on transient failures, actions require manual retry logic. Use Effect's retry operators for actions that call external APIs.
867
+
868
+ **Schema restrictions for Convex.** Not every Effect Schema is valid for Convex database storage. Convex supports specific types (strings, numbers, booleans, arrays, objects, null). Complex Effect transformations work for validation but can't be persisted directly.
869
+
870
+ **Effect dependency injection can be hard to trace at scale.** As your application grows, tracking where services are provided becomes challenging. Document your layer composition clearly and use consistent patterns across your codebase.
871
+
872
+ **Learning both technologies simultaneously is demanding.** If your team is new to both Effect and Convex, the learning curve multiplies. Consider mastering Convex first with standard patterns, then introducing Effect incrementally.
873
+
874
+ ### Production-ready patterns
875
+
876
+ **Service layer composition for agents:**
877
+
878
+ ```typescript
879
+ // convex/lib/layers/index.ts
880
+ import { Layer, Config, Effect } from "effect";
881
+
882
+ // Environment-aware configuration
883
+ const ConfigLive = Layer.effect(
884
+ ConfigService,
885
+ Effect.gen(function* () {
886
+ const openaiKey = yield* Config.string("OPENAI_API_KEY");
887
+ const anthropicKey = yield* Config.string("ANTHROPIC_API_KEY");
888
+ return { openaiKey, anthropicKey };
889
+ })
890
+ );
891
+
892
+ // LLM provider with fallback
893
+ const LLMProviderLive = Layer.effect(
894
+ LLMProvider,
895
+ Effect.gen(function* () {
896
+ const config = yield* ConfigService;
897
+
898
+ return {
899
+ generate: (prompt) =>
900
+ generateWithOpenAI(prompt, config.openaiKey).pipe(
901
+ Effect.catchTags({
902
+ RateLimitError: () => generateWithAnthropic(prompt, config.anthropicKey),
903
+ InvalidKeyError: (error) => Effect.fail(new ConfigurationError({ cause: error })),
904
+ }),
905
+ Effect.retry({ times: 3, schedule: Schedule.exponential("1 second") }),
906
+ Effect.timeout("30 seconds")
907
+ ),
908
+ };
909
+ })
910
+ );
911
+
912
+ // Complete application layer
913
+ export const AppLayer = Layer.mergeAll(
914
+ ConfigLive,
915
+ DatabaseLive,
916
+ VectorStoreLive
917
+ ).pipe(
918
+ Layer.provideMerge(LLMProviderLive),
919
+ Layer.provideMerge(ToolRegistryLive),
920
+ Layer.provideMerge(AgentLive)
921
+ );
922
+
923
+ // In production actions
924
+ export const production = action({
925
+ handler: (args) =>
926
+ myAgentWorkflow(args).pipe(
927
+ Effect.provide(AppLayer),
928
+ Effect.catchAll((error) =>
929
+ Effect.gen(function* () {
930
+ yield* Effect.log("Agent workflow failed", { error });
931
+ yield* notifyOperations(error); // Alert on-call
932
+ return fallbackResponse;
933
+ })
934
+ )
935
+ ),
936
+ });
937
+ ```
938
+
939
+ **Error recovery strategy for agent workflows:**
940
+
941
+ ```typescript
942
+ const robustAgentGeneration = (prompt: string) =>
943
+ Effect.gen(function* () {
944
+ // Try primary approach with full context
945
+ const fullResult = yield* generateWithContext(prompt, {
946
+ contextLimit: 10000
947
+ }).pipe(
948
+ Effect.timeout("30 seconds"),
949
+ Effect.catchTag("TimeoutError", () => Effect.fail({ _tag: "SlowGeneration" }))
950
+ );
951
+
952
+ return fullResult;
953
+ }).pipe(
954
+ // Fallback 1: Reduce context size
955
+ Effect.catchTag("SlowGeneration", () =>
956
+ generateWithContext(prompt, { contextLimit: 5000 })
957
+ ),
958
+ // Fallback 2: Switch to faster model
959
+ Effect.catchTag("RateLimitError", () =>
960
+ generateWithModel(prompt, "gpt-4o-mini")
961
+ ),
962
+ // Fallback 3: Cached response if available
963
+ Effect.catchAll(() =>
964
+ getCachedResponse(prompt).pipe(
965
+ Effect.catchAll(() =>
966
+ Effect.succeed("I'm experiencing technical difficulties. Please try again.")
967
+ )
968
+ )
969
+ )
970
+ );
971
+ ```
972
+
973
+ This integration of Effect.ts and confect into your Astro-shadcn-Convex stack provides industrial-strength reliability for production AI agents. The combination delivers type safety, robust error handling, and reactive data synchronization—critical capabilities for systems that users depend on. Start with confect for schema-first database design, introduce Effect for LLM integration with retry logic, and structure your agent logic as composable services. The learning investment pays dividends in reduced bugs, improved testability, and cleaner codebase architecture.