oneie 2.0.2 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (459) hide show
  1. package/AGENTS.md +245 -0
  2. package/CLAUDE.md +725 -0
  3. package/LICENSE.md +84 -0
  4. package/README.md +489 -931
  5. package/folders.yaml +78 -17
  6. package/one/.obsidian/app.json +1 -0
  7. package/one/.obsidian/appearance.json +1 -0
  8. package/one/.obsidian/core-plugins.json +33 -0
  9. package/one/.obsidian/workspace.json +211 -0
  10. package/one/connections/a2a.md +551 -0
  11. package/one/connections/acp.md +761 -0
  12. package/one/connections/acps.md +731 -0
  13. package/one/connections/agentkit.md +349 -0
  14. package/one/connections/agui.md +767 -0
  15. package/one/connections/any-backend.md +1702 -0
  16. package/one/connections/ap2.md +998 -0
  17. package/one/connections/api-docs.md +1891 -0
  18. package/one/connections/api.md +2190 -0
  19. package/one/connections/architecture-diagram.md +94 -0
  20. package/one/connections/communications.md +449 -0
  21. package/one/connections/connections.md +339 -0
  22. package/one/connections/copilotkit.md +1559 -0
  23. package/one/connections/cryptonetworks.md +781 -0
  24. package/one/connections/documentation.md +1120 -0
  25. package/one/connections/effect.md +279 -0
  26. package/one/connections/elizaos.md +1290 -0
  27. package/one/connections/inference.md +58 -0
  28. package/one/connections/kyc.md +632 -0
  29. package/one/connections/mcp.md +842 -0
  30. package/one/connections/membership.md +1152 -0
  31. package/one/connections/middleware.md +1067 -0
  32. package/one/connections/multitenant.md +1341 -0
  33. package/one/connections/n8n.md +1015 -0
  34. package/one/connections/patterns.md +89 -0
  35. package/one/connections/protocols.md +279 -0
  36. package/one/connections/relationships.md +107 -0
  37. package/one/connections/schema.md +587 -0
  38. package/one/connections/service-layer.md +550 -0
  39. package/one/connections/structure.md +0 -0
  40. package/one/connections/vectors.md +207 -0
  41. package/one/connections/wordpress.md +1302 -0
  42. package/one/connections/workflow-copy.md +905 -0
  43. package/one/connections/workflow-examples.md +741 -0
  44. package/one/connections/workflow.md +905 -0
  45. package/one/connections/workflows/delegation.md +885 -0
  46. package/one/connections/workflows/frontend.md +1037 -0
  47. package/one/connections/workflows/strategy.md +903 -0
  48. package/one/connections/workflows/tasks.md +698 -0
  49. package/one/connections/x402.md +1249 -0
  50. package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +412 -0
  51. package/one/events/FEATURE-2-4-COMPLETE.md +302 -0
  52. package/one/events/FEATURE_2_3_COMPLETE.md +575 -0
  53. package/one/events/GROUPS-MIGRATION.md +625 -0
  54. package/one/events/INSTALL-TESTS.md +293 -0
  55. package/one/events/INTEGRATION-ARCHITECTURE.md +561 -0
  56. package/one/events/INTEGRATION-CHECKLIST.md +1234 -0
  57. package/one/events/INTEGRATION-ORCHESTRATION.md +2623 -0
  58. package/one/events/INTEGRATION-SUMMARY.md +653 -0
  59. package/one/events/MIGRATION-REPORT.md +435 -0
  60. package/one/events/MIGRATION.md +69 -0
  61. package/one/events/README-archived.md +519 -0
  62. package/one/events/TEST-SUMMARY.md +393 -0
  63. package/one/events/TESTS-QUICK-REF.md +262 -0
  64. package/one/events/events.md +545 -0
  65. package/one/groups/groups.md +543 -0
  66. package/one/groups/one.md +599 -0
  67. package/one/groups/revenue.md +673 -0
  68. package/one/groups/strategy.md +869 -0
  69. package/one/groups/vision.md +98 -0
  70. package/one/knowledge/CLOUDFLARE_ENV_SETUP.md +49 -0
  71. package/one/knowledge/ai-platform.md +305 -0
  72. package/one/knowledge/architecture-any-backend.md +1366 -0
  73. package/one/knowledge/architecture-diagram.md +94 -0
  74. package/one/knowledge/architecture-frontend.md +930 -0
  75. package/one/knowledge/architecture.md +2077 -0
  76. package/one/knowledge/crypto.md +960 -0
  77. package/one/knowledge/docs/flow.md +0 -0
  78. package/one/knowledge/dsl.md +1660 -0
  79. package/one/knowledge/files.md +2471 -0
  80. package/one/knowledge/frontend.md +1038 -0
  81. package/one/knowledge/hono.md +2109 -0
  82. package/one/knowledge/implementation-examples.md +2536 -0
  83. package/one/knowledge/inference-score.md +159 -0
  84. package/one/knowledge/knowledge.md +642 -0
  85. package/one/knowledge/language.md +980 -0
  86. package/one/knowledge/lessons-learned.md +70 -0
  87. package/one/knowledge/ontology-6-dimensions.md +0 -0
  88. package/one/knowledge/ontology-documentation.md +356 -0
  89. package/one/knowledge/ontology-engineering-specification.md +1292 -0
  90. package/one/knowledge/ontology-engineering.md +1652 -0
  91. package/one/knowledge/ontology-frontend-copy-2.md +1492 -0
  92. package/one/knowledge/ontology-frontend-copy.md +753 -0
  93. package/one/knowledge/ontology-frontend-specifications.md +2188 -0
  94. package/one/knowledge/ontology-frontend.md +2427 -0
  95. package/one/knowledge/ontology-minimal.yaml +299 -0
  96. package/one/knowledge/ontology.md +2830 -0
  97. package/one/knowledge/ontology.md.backup +2822 -0
  98. package/one/knowledge/ontology.yaml +1165 -0
  99. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +100 -0
  100. package/one/knowledge/patterns/backend/convex-query-pattern.md +88 -0
  101. package/one/knowledge/patterns/backend/mutation-template.md +231 -0
  102. package/one/knowledge/patterns/backend/query-template.md +267 -0
  103. package/one/knowledge/patterns/backend/service-template.md +237 -0
  104. package/one/knowledge/patterns/design/component-architecture.md +399 -0
  105. package/one/knowledge/patterns/design/test-driven-design-pattern.md +162 -0
  106. package/one/knowledge/patterns/design/wireframe-template.md +216 -0
  107. package/one/knowledge/patterns/frontend/component-template.md +195 -0
  108. package/one/knowledge/patterns/frontend/form-template.md +276 -0
  109. package/one/knowledge/patterns/frontend/page-template.md +178 -0
  110. package/one/knowledge/patterns/frontend/react-component-pattern.md +128 -0
  111. package/one/knowledge/patterns/test/acceptance-criteria-template.md +378 -0
  112. package/one/knowledge/patterns/test/technical-test-template.md +544 -0
  113. package/one/knowledge/patterns/test/test-driven-pattern.md +140 -0
  114. package/one/knowledge/patterns/test/user-flow-template.md +254 -0
  115. package/one/knowledge/provider-creation-guide.md +1064 -0
  116. package/one/knowledge/quality-loop.md +401 -0
  117. package/one/knowledge/readme.md +131 -0
  118. package/one/knowledge/rules.md +626 -0
  119. package/one/knowledge/score.md +67 -0
  120. package/one/knowledge/specifications.md +855 -0
  121. package/one/knowledge/tags.md +130 -0
  122. package/one/knowledge/todo.md +251 -0
  123. package/one/license.md +84 -0
  124. package/one/people/anthony-o-connell.md +440 -0
  125. package/one/people/people.md +567 -0
  126. package/one/things/CHECKLIST.md +356 -0
  127. package/one/things/ONE.md +510 -0
  128. package/one/things/agents/agent-backend.md +1401 -0
  129. package/one/things/agents/agent-builder.md +955 -0
  130. package/one/things/agents/agent-clean.md +709 -0
  131. package/one/things/agents/agent-clone.md +1341 -0
  132. package/one/things/agents/agent-designer.md +2177 -0
  133. package/one/things/agents/agent-director.md +1508 -0
  134. package/one/things/agents/agent-documenter.md +1049 -0
  135. package/one/things/agents/agent-frontend.md +1119 -0
  136. package/one/things/agents/agent-integrator.md +1192 -0
  137. package/one/things/agents/agent-problem-solver.md +1379 -0
  138. package/one/things/agents/agent-quality.md +1353 -0
  139. package/one/things/agents/agent-sales.md +986 -0
  140. package/one/things/cascade/cascade.yaml +464 -0
  141. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +470 -0
  142. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +264 -0
  143. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +486 -0
  144. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +497 -0
  145. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +227 -0
  146. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +516 -0
  147. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +544 -0
  148. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +223 -0
  149. package/one/things/cascade/docs/examples/1-3-event-coordination.md +508 -0
  150. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +609 -0
  151. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +195 -0
  152. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +577 -0
  153. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +797 -0
  154. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +212 -0
  155. package/one/things/cascade/docs/examples/1-5-quality-loops.md +641 -0
  156. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +610 -0
  157. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +213 -0
  158. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +575 -0
  159. package/one/things/cascade/docs/examples/readme.md +222 -0
  160. package/one/things/cascade/docs/getting-started.md +515 -0
  161. package/one/things/cascade/docs/workflow.md +1372 -0
  162. package/one/things/cascade/readme.md +336 -0
  163. package/one/things/cascade/templates/feature-template.md +267 -0
  164. package/one/things/claude/agents/advocacy-activation-manager.md +685 -0
  165. package/one/things/claude/agents/advocacy-campaign-designer.md +663 -0
  166. package/one/things/claude/agents/analyst.md +483 -0
  167. package/one/things/claude/agents/architect.md +480 -0
  168. package/one/things/claude/agents/brand-identity-specialist.md +513 -0
  169. package/one/things/claude/agents/bstp-token-strategist.md +667 -0
  170. package/one/things/claude/agents/builder-repo.md +489 -0
  171. package/one/things/claude/agents/bullstamp-community-builder.md +574 -0
  172. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +506 -0
  173. package/one/things/claude/agents/bulltilt-platform-growth.md +567 -0
  174. package/one/things/claude/agents/company-bullstamp-character.md +587 -0
  175. package/one/things/claude/agents/company-bullstamp-community.md +292 -0
  176. package/one/things/claude/agents/company-bullstamp-marketing.md +292 -0
  177. package/one/things/claude/agents/company-bullstamp-token.md +292 -0
  178. package/one/things/claude/agents/company-bulltilt-growth.md +292 -0
  179. package/one/things/claude/agents/content-bibliography-formatter.md +381 -0
  180. package/one/things/claude/agents/content-calendar-planner.md +448 -0
  181. package/one/things/claude/agents/content-chapter-formatter.md +488 -0
  182. package/one/things/claude/agents/content-formatter.md +546 -0
  183. package/one/things/claude/agents/content-hook-specialist.md +462 -0
  184. package/one/things/claude/agents/content-image-formatter.md +535 -0
  185. package/one/things/claude/agents/content-introduction-formatter.md +485 -0
  186. package/one/things/claude/agents/content-multiplication-engine.md +556 -0
  187. package/one/things/claude/agents/content-playbook-writer.md +448 -0
  188. package/one/things/claude/agents/content-team-manager.md +622 -0
  189. package/one/things/claude/agents/content-toc-formatter.md +522 -0
  190. package/one/things/claude/agents/convex-backend-specialist.md +2561 -0
  191. package/one/things/claude/agents/core-manager.md +582 -0
  192. package/one/things/claude/agents/core-master.md +403 -0
  193. package/one/things/claude/agents/cross-functional-manager.md +471 -0
  194. package/one/things/claude/agents/crypto-airdrop-strategist.md +602 -0
  195. package/one/things/claude/agents/crypto-analytics-educator.md +553 -0
  196. package/one/things/claude/agents/crypto-architecture-specialist.md +466 -0
  197. package/one/things/claude/agents/crypto-community-analyst.md +298 -0
  198. package/one/things/claude/agents/crypto-community-psychologist.md +509 -0
  199. package/one/things/claude/agents/crypto-dex-optimization-expert.md +538 -0
  200. package/one/things/claude/agents/crypto-dex-optimizer.md +292 -0
  201. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +513 -0
  202. package/one/things/claude/agents/crypto-diamond-hands.md +292 -0
  203. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +554 -0
  204. package/one/things/claude/agents/crypto-engagement-specialist.md +540 -0
  205. package/one/things/claude/agents/crypto-market-researcher.md +292 -0
  206. package/one/things/claude/agents/crypto-marketing-orchestrator.md +523 -0
  207. package/one/things/claude/agents/crypto-network-effect-amplifier.md +569 -0
  208. package/one/things/claude/agents/crypto-optimization-analyst.md +554 -0
  209. package/one/things/claude/agents/crypto-strategic-synthesizer.md +517 -0
  210. package/one/things/claude/agents/crypto-team-manager.md +387 -0
  211. package/one/things/claude/agents/crypto-token-analyst.md +278 -0
  212. package/one/things/claude/agents/crypto-viral-content-creator.md +546 -0
  213. package/one/things/claude/agents/crypto-wallet-identification-expert.md +517 -0
  214. package/one/things/claude/agents/crypto-wallet-identifier.md +292 -0
  215. package/one/things/claude/agents/customer-journey-designer.md +481 -0
  216. package/one/things/claude/agents/customer-success-manager.md +581 -0
  217. package/one/things/claude/agents/dev.md +413 -0
  218. package/one/things/claude/agents/documenter.md +546 -0
  219. package/one/things/claude/agents/elevate-marketing-orchestrator.md +410 -0
  220. package/one/things/claude/agents/engagement-specialist.md +509 -0
  221. package/one/things/claude/agents/engineering-architect.md +387 -0
  222. package/one/things/claude/agents/engineering-business-analyst.md +537 -0
  223. package/one/things/claude/agents/engineering-developer.md +387 -0
  224. package/one/things/claude/agents/engineering-director.md +282 -0
  225. package/one/things/claude/agents/engineering-ingestor.md +649 -0
  226. package/one/things/claude/agents/engineering-product-manager.md +537 -0
  227. package/one/things/claude/agents/engineering-product-owner.md +537 -0
  228. package/one/things/claude/agents/engineering-project-coordinator.md +537 -0
  229. package/one/things/claude/agents/engineering-quality-assurance.md +393 -0
  230. package/one/things/claude/agents/engineering-team-manager.md +512 -0
  231. package/one/things/claude/agents/engineering-user-experience.md +387 -0
  232. package/one/things/claude/agents/framework-elevate-manager.md +294 -0
  233. package/one/things/claude/agents/improver.md +763 -0
  234. package/one/things/claude/agents/intelligence-team-manager.md +385 -0
  235. package/one/things/claude/agents/lead-capture-expert.md +466 -0
  236. package/one/things/claude/agents/lead-magnet-creator.md +453 -0
  237. package/one/things/claude/agents/market-research-analyst.md +412 -0
  238. package/one/things/claude/agents/marketing-brand-identity.md +314 -0
  239. package/one/things/claude/agents/marketing-content-hooks.md +450 -0
  240. package/one/things/claude/agents/marketing-content-multiplier.md +326 -0
  241. package/one/things/claude/agents/marketing-content-poster.md +361 -0
  242. package/one/things/claude/agents/marketing-customer-journey.md +326 -0
  243. package/one/things/claude/agents/marketing-director.md +397 -0
  244. package/one/things/claude/agents/marketing-engagement.md +326 -0
  245. package/one/things/claude/agents/marketing-lead-capture.md +326 -0
  246. package/one/things/claude/agents/marketing-lead-magnet.md +326 -0
  247. package/one/things/claude/agents/marketing-network-effects.md +326 -0
  248. package/one/things/claude/agents/marketing-nurture-campaigns.md +326 -0
  249. package/one/things/claude/agents/marketing-share-optimizer.md +326 -0
  250. package/one/things/claude/agents/marketing-team-manager.md +446 -0
  251. package/one/things/claude/agents/marketing-viral-growth.md +201 -0
  252. package/one/things/claude/agents/mission-commander.md +373 -0
  253. package/one/things/claude/agents/network-effect-analyst.md +587 -0
  254. package/one/things/claude/agents/nextjs-15-specialist.md +1547 -0
  255. package/one/things/claude/agents/npx.md +890 -0
  256. package/one/things/claude/agents/nurture-campaign-manager.md +531 -0
  257. package/one/things/claude/agents/one-master.md +355 -0
  258. package/one/things/claude/agents/one-orchestrator.md +315 -0
  259. package/one/things/claude/agents/one.md +601 -0
  260. package/one/things/claude/agents/playbook-generator.md +503 -0
  261. package/one/things/claude/agents/pm.md +326 -0
  262. package/one/things/claude/agents/po.md +345 -0
  263. package/one/things/claude/agents/qa.md +336 -0
  264. package/one/things/claude/agents/research-foundation-analyst.md +307 -0
  265. package/one/things/claude/agents/research-intelligence-gatherer.md +408 -0
  266. package/one/things/claude/agents/research-market-analyst.md +307 -0
  267. package/one/things/claude/agents/research-team-manager.md +482 -0
  268. package/one/things/claude/agents/sales-environment-optimizer.md +494 -0
  269. package/one/things/claude/agents/sales-team-manager.md +400 -0
  270. package/one/things/claude/agents/sales-upsell-strategist.md +307 -0
  271. package/one/things/claude/agents/service-advocacy-campaigns.md +307 -0
  272. package/one/things/claude/agents/service-advocacy-manager.md +307 -0
  273. package/one/things/claude/agents/service-success-manager.md +307 -0
  274. package/one/things/claude/agents/service-team-manager.md +400 -0
  275. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +2302 -0
  276. package/one/things/claude/agents/share-optimization-specialist.md +551 -0
  277. package/one/things/claude/agents/sm.md +327 -0
  278. package/one/things/claude/agents/story-teller.md +473 -0
  279. package/one/things/claude/agents/task-master.md +596 -0
  280. package/one/things/claude/agents/tauri-cross-platform-specialist.md +1827 -0
  281. package/one/things/claude/agents/tester.md +556 -0
  282. package/one/things/claude/agents/the-bull-character-manager.md +580 -0
  283. package/one/things/claude/agents/tools-playbook-generator.md +489 -0
  284. package/one/things/claude/agents/turbo-repo-builder.md +316 -0
  285. package/one/things/claude/agents/upsell-strategist.md +480 -0
  286. package/one/things/claude/agents/ux-expert.md +335 -0
  287. package/one/things/claude/agents/viral-growth-orchestrator.md +497 -0
  288. package/one/things/claude/claude-code-hooks-development.json +21 -0
  289. package/one/things/claude/claude-code-hooks-production.json +21 -0
  290. package/one/things/claude/claude-code-hooks.json +25 -0
  291. package/one/things/claude/commands/agent.md +104 -0
  292. package/one/things/claude/commands/cascade-status.md +128 -0
  293. package/one/things/claude/commands/ingest.md +290 -0
  294. package/one/things/claude/commands/ingestor.md +136 -0
  295. package/one/things/claude/commands/mission.md +83 -0
  296. package/one/things/claude/commands/npx.md +133 -0
  297. package/one/things/claude/commands/one.md +440 -0
  298. package/one/things/claude/commands/quality-check.md +204 -0
  299. package/one/things/claude/commands/smart-route.md +220 -0
  300. package/one/things/claude/commands/start.md +121 -0
  301. package/one/things/claude/commands/story.md +83 -0
  302. package/one/things/claude/commands/task.md +173 -0
  303. package/one/things/claude/hook-bypass.json +32 -0
  304. package/one/things/claude/hooks/agent-hook-config.json +427 -0
  305. package/one/things/claude/hooks/agent-hook-manager.js +525 -0
  306. package/one/things/claude/hooks/agent-load-balancer.js +271 -0
  307. package/one/things/claude/hooks/agent-request-interceptor.js +70 -0
  308. package/one/things/claude/hooks/build-hook.sh +156 -0
  309. package/one/things/claude/hooks/cascade-feedback.js +297 -0
  310. package/one/things/claude/hooks/cascade-integration-hooks.js +648 -0
  311. package/one/things/claude/hooks/cleanup-hook.sh +201 -0
  312. package/one/things/claude/hooks/continuous-improvement-monitor.js +510 -0
  313. package/one/things/claude/hooks/file-organization-engine.js +427 -0
  314. package/one/things/claude/hooks/file-organization-hook.sh +80 -0
  315. package/one/things/claude/hooks/file-organization-monitor.js +269 -0
  316. package/one/things/claude/hooks/format-hook.sh +43 -0
  317. package/one/things/claude/hooks/hook-bypass.sh +293 -0
  318. package/one/things/claude/hooks/hook-config-manager.js +202 -0
  319. package/one/things/claude/hooks/hook-debouncer.sh +62 -0
  320. package/one/things/claude/hooks/hook-logger.sh +89 -0
  321. package/one/things/claude/hooks/hook-orchestrator.js +662 -0
  322. package/one/things/claude/hooks/hook-performance-report.js +120 -0
  323. package/one/things/claude/hooks/lint-hook.sh +140 -0
  324. package/one/things/claude/hooks/mcp-cascade-integration.js +816 -0
  325. package/one/things/claude/hooks/memory-optimizer.js +510 -0
  326. package/one/things/claude/hooks/notification-hook.sh +204 -0
  327. package/one/things/claude/hooks/ontology-compliance.js +394 -0
  328. package/one/things/claude/hooks/ontology-hook-manager.js +316 -0
  329. package/one/things/claude/hooks/ontology-validation-engine.js +317 -0
  330. package/one/things/claude/hooks/ontology-validation-hook.sh +86 -0
  331. package/one/things/claude/hooks/performance-metrics.json +25 -0
  332. package/one/things/claude/hooks/performance-monitoring-hook.js +422 -0
  333. package/one/things/claude/hooks/quality-scoring-engine.js +834 -0
  334. package/one/things/claude/hooks/security-hook.sh +256 -0
  335. package/one/things/claude/hooks/simple-load-balancer.js +238 -0
  336. package/one/things/claude/hooks/startup-optimizer.js +625 -0
  337. package/one/things/claude/hooks/story-scoring-system.js +445 -0
  338. package/one/things/claude/hooks/story-validation-engine.js +473 -0
  339. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +210 -0
  340. package/one/things/claude/hooks/story-validation-hook.sh +145 -0
  341. package/one/things/claude/hooks/structure-synchronizer.js +194 -0
  342. package/one/things/claude/hooks/sub-agent-output-validator.js +647 -0
  343. package/one/things/claude/hooks/sub-agent-validation-hook.js +343 -0
  344. package/one/things/claude/hooks/test-hook.sh +145 -0
  345. package/one/things/claude/hooks/test-story-validation.sh +170 -0
  346. package/one/things/claude/hooks/trinity-validation-system.js +392 -0
  347. package/one/things/claude/settings-local.json +86 -0
  348. package/one/things/cli/cli-code.md +652 -0
  349. package/one/things/cli/cli-compiler-code.md +652 -0
  350. package/one/things/cli/cli.md +1068 -0
  351. package/one/things/components/card-shadcn.md +929 -0
  352. package/one/things/components/card.md +1050 -0
  353. package/one/things/components.md +1669 -0
  354. package/one/things/componets.md +4 -0
  355. package/one/things/creator-diagram.md +166 -0
  356. package/one/things/examples/children/lemonade-stand.md +366 -0
  357. package/one/things/examples/enterprise/crm-saas.md +1429 -0
  358. package/one/things/features/1-1-agent-prompts/design.md +470 -0
  359. package/one/things/features/1-1-agent-prompts/tests.md +264 -0
  360. package/one/things/features/1-1-agent-prompts.md +486 -0
  361. package/one/things/features/1-2-yaml-orchestrator/design.md +497 -0
  362. package/one/things/features/1-2-yaml-orchestrator/tests.md +227 -0
  363. package/one/things/features/1-2-yaml-orchestrator.md +516 -0
  364. package/one/things/features/1-3-event-coordination/design.md +544 -0
  365. package/one/things/features/1-3-event-coordination/tests.md +223 -0
  366. package/one/things/features/1-3-event-coordination.md +508 -0
  367. package/one/things/features/1-4-knowledge-management/design.md +609 -0
  368. package/one/things/features/1-4-knowledge-management/tests.md +195 -0
  369. package/one/things/features/1-4-knowledge-management.md +577 -0
  370. package/one/things/features/1-5-quality-loops/design.md +797 -0
  371. package/one/things/features/1-5-quality-loops/tests.md +212 -0
  372. package/one/things/features/1-5-quality-loops.md +641 -0
  373. package/one/things/features/1-6-numbering-structure/design.md +610 -0
  374. package/one/things/features/1-6-numbering-structure/tests.md +213 -0
  375. package/one/things/features/1-6-numbering-structure.md +575 -0
  376. package/one/things/features/2-1-dataprovider-interface.md +2358 -0
  377. package/one/things/features/2-2-config-system.md +3075 -0
  378. package/one/things/features/2-3-effectts-services.md +1498 -0
  379. package/one/things/features/2-4-react-hooks.md +2120 -0
  380. package/one/things/features/2-5-auth-migration.md +2046 -0
  381. package/one/things/features/2-6-dashboard-migration.md +1985 -0
  382. package/one/things/features/2-7-alternative-providers.md +2505 -0
  383. package/one/things/features/2-7-implementation-report.md +680 -0
  384. package/one/things/features/2-cli.md +1235 -0
  385. package/one/things/features/2-design.md +1738 -0
  386. package/one/things/features/2-tests.md +520 -0
  387. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +521 -0
  388. package/one/things/features/DECOUPLING.md +272 -0
  389. package/one/things/features/DEPLOYMENT.md +452 -0
  390. package/one/things/features/IMPLEMENTATION_SUMMARY.md +316 -0
  391. package/one/things/features/dataprovider-interface/1-tests.md +1522 -0
  392. package/one/things/features/improve.md +843 -0
  393. package/one/things/features/remove-convex-deps.md +45 -0
  394. package/one/things/features/top-features.md +79 -0
  395. package/one/things/features/use-one-backend.md +1180 -0
  396. package/one/things/ideas/1-create-workflow.md +189 -0
  397. package/one/things/ideas/2-backend-agnostic-frontend.md +384 -0
  398. package/one/things/plans/1-create-workflow-status.md +555 -0
  399. package/one/things/plans/1-create-workflow.md +713 -0
  400. package/one/things/plans/2-backend-agnostic-frontend.md +543 -0
  401. package/one/things/plans/3-groups.md +502 -0
  402. package/one/things/plans/app.md +761 -0
  403. package/one/things/plans/backend-agnostic-frontend.md +323 -0
  404. package/one/things/plans/better-auth-any-backend-revised.md +1065 -0
  405. package/one/things/plans/better-auth-any-backend.md +1852 -0
  406. package/one/things/plans/better-auth-available-features.md +235 -0
  407. package/one/things/plans/big-plan.md +38 -0
  408. package/one/things/plans/convex-better-auth.md +1109 -0
  409. package/one/things/plans/convex-on-off.md +389 -0
  410. package/one/things/plans/deploy-to-cloudflare.md +581 -0
  411. package/one/things/plans/desktop.md +1121 -0
  412. package/one/things/plans/effect-components.md +1669 -0
  413. package/one/things/plans/effect.md +973 -0
  414. package/one/things/plans/email.md +953 -0
  415. package/one/things/plans/enhance-auth.md +1669 -0
  416. package/one/things/plans/install-components.md +198 -0
  417. package/one/things/plans/landing.md +728 -0
  418. package/one/things/plans/layout.md +205 -0
  419. package/one/things/plans/mail-backend.md +1308 -0
  420. package/one/things/plans/mail.md +2624 -0
  421. package/one/things/plans/next-features.md +83 -0
  422. package/one/things/plans/one.md +658 -0
  423. package/one/things/plans/ontology-6-dimensions.md +2216 -0
  424. package/one/things/plans/ontology-driven-strategy.md +866 -0
  425. package/one/things/plans/ontology-ui-approach.md +357 -0
  426. package/one/things/plans/open-agent.md +785 -0
  427. package/one/things/plans/organizations-to-groups.md +705 -0
  428. package/one/things/plans/performace.md +90 -0
  429. package/one/things/plans/release.md +432 -0
  430. package/one/things/plans/releases.md +809 -0
  431. package/one/things/plans/repos.md +76 -0
  432. package/one/things/plans/separate-copy-2.md +1293 -0
  433. package/one/things/plans/separate-copy-3.md +2458 -0
  434. package/one/things/plans/separate-copy.md +1293 -0
  435. package/one/things/plans/separate.md +1983 -0
  436. package/one/things/plans/shadcn-integration-summary.md +450 -0
  437. package/one/things/plans/sidebar.md +172 -0
  438. package/one/things/plans/small-fixes.md +5 -0
  439. package/one/things/plans/test-backend-connection.md +476 -0
  440. package/one/things/plans/workflow-files.md +1196 -0
  441. package/one/things/plans/workflow.md +1372 -0
  442. package/one/things/products/cascade-landing-page.md +737 -0
  443. package/one/things/products/cascade.md +1518 -0
  444. package/one/things/products/context-engineering.md +1427 -0
  445. package/one/things/products/onthology.md +0 -0
  446. package/one/things/products/ontology-ui-shadcn.md +1280 -0
  447. package/one/things/products/ontology-ui.md +1387 -0
  448. package/one/things/products/ontology.md +717 -0
  449. package/one/things/products/sdk.md +557 -0
  450. package/one/things/promptkit.md +903 -0
  451. package/one/things/service-providers-new.md +982 -0
  452. package/one/things/service-providers.md +1092 -0
  453. package/one/things/system.md +600 -0
  454. package/one/things/tests/2-1-dataprovider-interface.md +1144 -0
  455. package/one/things/tests/2-1-test-analysis.md +496 -0
  456. package/one/things/things.md +349 -0
  457. package/one/things/todo.md +1248 -0
  458. package/one/things/vision/elegant-interface.md +214 -0
  459. package/package.json +5 -2
@@ -0,0 +1,1518 @@
1
+ # ONE Cascade
2
+
3
+ **Plain English to Production Code via Agent Orchestration**
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ ONE Cascade transforms Plain English descriptions into working applications by orchestrating 8 specialized AI agents through 6 progressive stages. The system uses the 6-dimension ontology to validate every command and load only the context each agent needs—reducing context by 98% while enabling parallel agent execution.
10
+
11
+ **Core Concept:** Plain English → Ontology Validation → Targeted Context Loading → Parallel Agents → Production Code
12
+
13
+ ---
14
+
15
+ ## How It Works: From English to Reality
16
+
17
+ ### The Plain English Language
18
+
19
+ Creators describe features using natural language commands that map directly to the ontology:
20
+
21
+ ```
22
+ FEATURE: Import my YouTube videos and create courses
23
+
24
+ GET my YouTube channel videos
25
+ FOR EACH video extract title and description
26
+ CREATE course with video as lesson
27
+ CONNECT me to course as owner
28
+ RECORD course created
29
+ SHOW my courses dashboard
30
+ ```
31
+
32
+ **Each command maps to ontology dimensions:**
33
+
34
+ - `CREATE` → **Things** (entities: creator, course, lesson, video, student)
35
+ - `CONNECT` → **Connections** (owns, enrolled_in, part_of, authored)
36
+ - `RECORD` → **Events** (course_created, video_imported, lesson_completed)
37
+ - `GET` → **Queries** (retrieve YouTube videos, course data)
38
+ - `CALL` → **Services** (YouTube API, OpenAI, Stripe) + event logging
39
+ - `CHECK` → **Validation** (against ontology rules)
40
+ - `FOR EACH` → **Loops** (process multiple videos, students)
41
+
42
+ ### The 6-Stage Process
43
+
44
+ ```
45
+ Plain English
46
+ ↓
47
+ 1. IDEAS: Validate every command against ontology types
48
+ ↓
49
+ 2. PLANS: Group related commands into features, assign to specialists
50
+ ↓
51
+ 3. FEATURES: Specialists write technical specifications (parallel)
52
+ ↓
53
+ 4. TESTS: Define acceptance criteria from user flows
54
+ ↓
55
+ 5. DESIGN: Create UI that executes the flows
56
+ ↓
57
+ 6. IMPLEMENTATION: Generate code + validation loops (parallel)
58
+ ↓
59
+ Production-Ready Application
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Architecture
65
+
66
+ ### The 6-Level Flow
67
+
68
+ **1. IDEAS**
69
+
70
+ Creator writes Plain English → Director agent validates each command:
71
+
72
+ ```
73
+ GET my YouTube channel videos
74
+ ✓ Validates: service provider "youtube" exists
75
+ ✓ Validates: entity type "video" exists
76
+ ✓ Validates: event type "videos_imported" exists for logging
77
+
78
+ CREATE course with video as lesson
79
+ ✓ Validates: entity type "course" exists
80
+ ✓ Validates: entity type "lesson" exists
81
+ ✓ Validates: connection type "part_of" exists (lesson part_of course)
82
+ ```
83
+
84
+ **Output:** Validated commands with ontology type mappings
85
+
86
+ **Context Loaded:** Only ontology type names (66 entity types, 25 connection types, 67 event types)
87
+
88
+ **2. PLANS**
89
+
90
+ Director creates plan by grouping related commands into features:
91
+
92
+ ```
93
+ Plan 2: Creator Course Platform
94
+ ├── 2-1-youtube-import (Backend Specialist)
95
+ │ └── Commands: GET videos, CALL YouTube API, CREATE video entities
96
+ ├── 2-2-course-builder (Backend Specialist)
97
+ │ └── Commands: CREATE course, CONNECT lessons, RECORD course_created
98
+ ├── 2-3-course-pages (Frontend Specialist)
99
+ │ └── Commands: SHOW courses, SHOW lessons, INPUT enrollment
100
+ └── 2-4-ai-chat-with-videos (Integration Specialist)
101
+ └── Commands: CALL OpenAI with video transcripts, SHOW chat interface
102
+ ```
103
+
104
+ **Output:** Feature assignments with command groupings
105
+
106
+ **Context Loaded:** Only ontology types used in this plan + similar patterns from history
107
+
108
+ **3. FEATURES** (parallel)
109
+
110
+ Specialists convert commands to technical specifications:
111
+
112
+ ```
113
+ Plain English:
114
+ CREATE course called "YouTube Masterclass"
115
+ WITH lessons from videos
116
+ WITH price $99
117
+
118
+ Backend Specialist writes:
119
+ Entity Type: course
120
+ Properties: { title, description, price, lessons[] }
121
+ Service: Effect.ts CourseService.create()
122
+ Mutations: createCourse(title, price, lessons)
123
+ Events: course_created (logged after creation)
124
+ ```
125
+
126
+ **Output:** Technical feature specs
127
+
128
+ **Context Loaded:** Only ontology types for assigned features + implementation patterns for those types
129
+
130
+ **4. TESTS**
131
+
132
+ Quality agent converts flows to test specifications:
133
+
134
+ ```
135
+ Plain English:
136
+ GET my YouTube channel videos
137
+ FOR EACH video CREATE course
138
+ CHECK course has at least 1 lesson
139
+
140
+ Quality Agent creates:
141
+ Test: "should import videos from YouTube"
142
+ Given: creator has YouTube channel with 10 videos
143
+ When: creator imports videos
144
+ Then: 10 video entities created
145
+
146
+ Test: "should create courses from videos"
147
+ Given: 5 videos imported
148
+ When: creator creates course
149
+ Then: course has 5 lessons from videos
150
+ ```
151
+
152
+ **Output:** Test specifications
153
+
154
+ **Context Loaded:** Feature specification + ontology validation rules + test patterns
155
+
156
+ **5. DESIGN**
157
+
158
+ Design agent creates UI that executes the flow:
159
+
160
+ ```
161
+ Plain English:
162
+ SHOW my YouTube videos
163
+ SHOW course builder with video selector
164
+ SHOW courses dashboard
165
+
166
+ Design Agent creates:
167
+ Wireframe: YouTube video grid with import button
168
+ Component: <VideoGrid videos={youtubeVideos} />
169
+ Component: <CourseBuilder selectedVideos={videos} />
170
+ Component: <CourseDashboard courses={myCourses} />
171
+ Flow: Import videos → Select for course → Create course → View dashboard
172
+ ```
173
+
174
+ **Output:** UI/UX designs
175
+
176
+ **Context Loaded:** Feature specification + test criteria (user flows) + design patterns
177
+
178
+ **6. IMPLEMENTATION** (parallel with quality loops)
179
+
180
+ Specialists generate production code from specifications:
181
+
182
+ ```
183
+ Plain English:
184
+ RECORD course created BY creator WITH lessons
185
+
186
+ Generated TypeScript:
187
+ await db.insert('events', {
188
+ type: 'course_created',
189
+ actorId: creatorId,
190
+ targetId: courseId,
191
+ metadata: { lessonCount: lessons.length },
192
+ timestamp: Date.now()
193
+ })
194
+ ```
195
+
196
+ **Output:** Working application code with tests
197
+
198
+ **Context Loaded:** Feature spec + test criteria + design + implementation patterns + lessons learned
199
+
200
+ ---
201
+
202
+ ## Context Engineering: How the Ontology Minimizes Context
203
+
204
+ ### The Problem: Context Window Limitations
205
+
206
+ AI coding tools face a fundamental challenge: they need relevant code to make intelligent suggestions, but can't load everything. Most tools use these approaches:
207
+
208
+ **File-based loading:** Load current file + imports + similar files
209
+ - Problem: Often loads too much (imports tree explodes) or too little (misses patterns)
210
+ - Result: Slow, expensive, hit-or-miss relevance
211
+
212
+ **Semantic search:** Embed codebase, search for relevant chunks
213
+ - Problem: Requires pre-indexing, searches are fuzzy, results may not be what you need
214
+ - Result: Better than file-based, but still generic and unfocused
215
+
216
+ **Manual selection:** Developer chooses which files to include
217
+ - Problem: Developer must know what's relevant, breaks flow
218
+ - Result: Accurate but requires constant attention
219
+
220
+ ### The CASCADE Solution: Ontology as Type System
221
+
222
+ The 6-dimension ontology is fundamentally different—it's not searching or guessing, it's using the type system itself as the index:
223
+
224
+ **When you write:** `CREATE course WITH lessons`
225
+
226
+ **The ontology knows deterministically:**
227
+ 1. You're creating a `course` (entity type #12)
228
+ 2. A course has `lessons` (related via `part_of` connection)
229
+ 3. This requires: course schema, lesson schema, part_of connection definition
230
+ 4. Nothing else is needed to understand this command
231
+
232
+ **No search required. No guessing. Just type resolution.**
233
+
234
+ **Stage 1: Ideas (Minimal Context)**
235
+ ```
236
+ User writes: CREATE course WITH lessons
237
+ CONNECT creator to course as owner
238
+
239
+ Ontology reveals needed types:
240
+ - course (entity type)
241
+ - lesson (entity type)
242
+ - creator (entity type)
243
+ - owns (connection type)
244
+
245
+ Context loaded: Only these 4 type definitions
246
+ Result: ~200 tokens instead of 150,000
247
+ ```
248
+
249
+ **Stage 2: Plans (Targeted Context)**
250
+ ```
251
+ Director sees: This plan uses course, lesson, creator, owns
252
+
253
+ Ontology provides:
254
+ - Full definitions for these 4 types
255
+ - Similar patterns using these types
256
+ - Validation rules for these types
257
+
258
+ Context loaded: Only definitions + patterns for plan's types
259
+ Result: ~1,500 tokens (99% reduction from loading everything)
260
+ ```
261
+
262
+ **Stage 3: Features (Specialist Context)**
263
+ ```
264
+ Backend Specialist assigned: CREATE course WITH lessons
265
+
266
+ Ontology provides:
267
+ - Course entity schema
268
+ - Lesson entity schema
269
+ - Implementation patterns for CREATE commands
270
+ - Similar features that created courses
271
+
272
+ Context loaded: Only what's needed for this specific feature
273
+ Result: ~1,500 tokens per agent (agents work in parallel)
274
+ ```
275
+
276
+ **Stage 4: Tests (Validation Context)**
277
+ ```
278
+ Quality Agent sees: Feature creates course with lessons
279
+
280
+ Ontology provides:
281
+ - Validation rules for course entities
282
+ - Validation rules for lesson entities
283
+ - Test patterns for entity creation
284
+ - UX patterns for course workflows
285
+
286
+ Context loaded: Only validation rules + test patterns
287
+ Result: ~2,000 tokens focused on quality
288
+ ```
289
+
290
+ **Stage 5: Design (UI Context)**
291
+ ```
292
+ Design Agent sees: User needs to CREATE and VIEW courses
293
+
294
+ Ontology provides:
295
+ - Design patterns for course entities
296
+ - UI components for entity creation
297
+ - Layout patterns for entity lists
298
+ - Accessibility requirements
299
+
300
+ Context loaded: Only design patterns + components
301
+ Result: ~2,000 tokens focused on UI/UX
302
+ ```
303
+
304
+ **Stage 6: Implementation (Complete Feature Context)**
305
+ ```
306
+ Specialist implements: Course creation feature
307
+
308
+ Ontology provides:
309
+ - Feature specification (from Stage 3)
310
+ - Test criteria (from Stage 4)
311
+ - Design specification (from Stage 5)
312
+ - Implementation patterns for course creation
313
+ - Lessons learned about course features
314
+
315
+ Context loaded: Everything for THIS feature, nothing else
316
+ Result: ~2,500 tokens (complete but focused)
317
+ ```
318
+
319
+ ### Why Ontology-as-Type-System is More Elegant
320
+
321
+ **Other AI coding tools:**
322
+ ```
323
+ Developer: "I need to implement course creation"
324
+
325
+ Tool: "Let me search the codebase for 'course'..."
326
+ *finds 47 files mentioning 'course'*
327
+ *embeds them, ranks by similarity*
328
+ *loads top 10 files* (maybe relevant?)
329
+
330
+ Result: Generic code, might be right, might not
331
+ ```
332
+
333
+ **CASCADE with ontology:**
334
+ ```
335
+ Creator: "CREATE course WITH lessons"
336
+
337
+ Ontology: "course is entity type #12, lesson is entity type #18"
338
+ *loads exactly: course schema, lesson schema, part_of connection*
339
+ *loads exactly: CREATE pattern for entities*
340
+ *loads exactly: 3 previous course features*
341
+
342
+ Result: Precise code, guaranteed correct structure
343
+ ```
344
+
345
+ **The difference:**
346
+
347
+ | Approach | Method | Accuracy | Speed | Context Size |
348
+ |----------|--------|----------|-------|--------------|
349
+ | File-based | Import tree traversal | 40-60% relevant | Slow (load many files) | 50-150k tokens |
350
+ | Semantic search | Embedding similarity | 60-80% relevant | Medium (search + load) | 20-50k tokens |
351
+ | Manual selection | Developer chooses | 90%+ relevant | Fast but manual | 10-30k tokens |
352
+ | **CASCADE Ontology** | **Type resolution** | **100% relevant** | **Instant (no search)** | **1-3k tokens** |
353
+
354
+ **Why ontology wins:**
355
+
356
+ 1. **Deterministic:** Types are resolved, not searched
357
+ 2. **Complete:** Every type has defined schema, patterns, relationships
358
+ 3. **Minimal:** Only what's needed for the specific types used
359
+ 4. **Fast:** No embedding, no search, just lookup
360
+ 5. **Composable:** Types compose predictably (course + lesson = course with lessons)
361
+
362
+ ### Why This Works
363
+
364
+ **1. Types are stable** - The ontology types rarely change, so they're perfect indexes
365
+
366
+ **2. Commands map to types** - Every user command references specific types:
367
+ - `CREATE course` → load course type definition
368
+ - `CONNECT student to course` → load student + course + enrolled_in types
369
+ - `GET lessons WHERE part_of course` → load lesson + course + part_of types
370
+
371
+ **3. Patterns are reusable** - Implementation patterns are tagged by type:
372
+ - "How to CREATE entity" pattern
373
+ - "How to CONNECT two entities" pattern
374
+ - "How to query relationships" pattern
375
+
376
+ **4. Context compounds progressively** - Each stage adds only what's new:
377
+ - Stage 1: Type names only
378
+ - Stage 2: Type definitions for plan
379
+ - Stage 3: Patterns for feature types
380
+ - Stage 4: Validation for feature types
381
+ - Stage 5: Design for feature types
382
+ - Stage 6: Everything for feature, nothing for other features
383
+
384
+ ### Real-World Example: How Context Differs
385
+
386
+ **Scenario:** Implement student enrollment in a course
387
+
388
+ **Other AI tools approach:**
389
+ ```
390
+ 1. Search codebase for "enroll" → 23 files
391
+ 2. Search codebase for "student" → 41 files
392
+ 3. Search codebase for "course" → 47 files
393
+ 4. Embed all 111 files (duplicates removed: 89 unique)
394
+ 5. Rank by similarity to query
395
+ 6. Load top 15 files (hoping they're relevant)
396
+ 7. Context: 35,000 tokens (mostly noise)
397
+ 8. AI generates code (based on fuzzy matches)
398
+ ```
399
+
400
+ **CASCADE ontology approach:**
401
+ ```
402
+ 1. Parse command: CONNECT student TO course AS enrolled_in
403
+ 2. Ontology lookup:
404
+ - student: entity type #8 (here's the schema)
405
+ - course: entity type #12 (here's the schema)
406
+ - enrolled_in: connection type #4 (here's how connections work)
407
+ 3. Pattern lookup:
408
+ - "CONNECT entity TO entity" pattern (here's the template)
409
+ - Previous enrollment features (here are 2 examples)
410
+ 4. Context: 1,800 tokens (100% relevant)
411
+ 5. AI generates code (based on exact types)
412
+ ```
413
+
414
+ **Result comparison:**
415
+
416
+ Other tools: "Here's code that *might* work, based on similar patterns in your codebase"
417
+ CASCADE: "Here's code that *will* work, based on the exact types you specified"
418
+
419
+ ### The Elegant Insight
420
+
421
+ Traditional AI coding tools are doing information retrieval. CASCADE is doing type checking.
422
+
423
+ **Information retrieval:** Search → Rank → Hope it's relevant
424
+ **Type checking:** Lookup → Load exact definitions → Guaranteed correct structure
425
+
426
+ The ontology doesn't search for what might be relevant—it knows deterministically what IS relevant because types define their own requirements.
427
+
428
+ ---
429
+
430
+ ## Agent System
431
+
432
+ ### 8 Specialized Agents
433
+
434
+ **Engineering Director**
435
+
436
+ - Validates commands against ontology types
437
+ - Maps user flows to technical features
438
+ - Creates parallel task lists from independent commands
439
+ - Assigns features to appropriate specialists
440
+
441
+ **Backend Specialist**
442
+
443
+ - Converts `CREATE` commands to database schemas
444
+ - Converts `RECORD` commands to event logging
445
+ - Converts `CALL` commands to service integrations
446
+ - Implements Effect.ts services from specifications
447
+
448
+ **Frontend Specialist**
449
+
450
+ - Converts `SHOW` commands to UI components
451
+ - Converts `GIVE` commands to user feedback
452
+ - Creates forms for `INPUT` specifications
453
+ - Implements pages that execute user flows
454
+
455
+ **Integration Specialist**
456
+
457
+ - Converts `CONNECT` commands to relationship logic
458
+ - Converts `CALL` commands to external API integrations
459
+ - Implements data flows between operations
460
+ - Coordinates multi-system features
461
+
462
+ **Quality Agent**
463
+
464
+ - Converts `CHECK` commands to validation tests
465
+ - Converts user flows to acceptance criteria
466
+ - Validates each step has corresponding test
467
+ - Ensures error cases (OTHERWISE clauses) are tested
468
+
469
+ **Design Agent**
470
+
471
+ - Converts user flows to wireframes
472
+ - Designs UI components for each command
473
+ - Creates visual flows matching execution order
474
+ - Ensures visual feedback for each operation
475
+
476
+ **Problem Solver**
477
+
478
+ - Analyzes specification-to-code mismatches (uses ultrathink)
479
+ - Identifies where implementation deviates from specification
480
+ - Proposes fixes that maintain intended behavior
481
+ - Validates fixes preserve original requirements
482
+
483
+ **Documenter**
484
+
485
+ - Converts specifications to user-facing documentation
486
+ - Documents each command's purpose
487
+ - Creates API docs from service calls
488
+ - Generates examples from patterns
489
+
490
+ ---
491
+
492
+ ## Parallel Execution via Command Analysis
493
+
494
+ ### Traditional Approach
495
+
496
+ ```
497
+ Load entire codebase → Parse → Find relevant code → Execute
498
+ ```
499
+
500
+ Every operation requires full codebase context.
501
+
502
+ ### How CASCADE Analyzes Commands for Parallel Execution
503
+
504
+ The system analyzes commands to identify independent operations:
505
+
506
+ ```
507
+ FEATURE: Import YouTube videos and build course
508
+
509
+ STEP 1 (Sequential - must happen first):
510
+ CALL YouTube API to get channel videos
511
+
512
+ STEP 2 (Parallel - no dependencies):
513
+ DO AT SAME TIME:
514
+ - FOR EACH video extract transcript
515
+ - FOR EACH video generate thumbnail
516
+ - FOR EACH video calculate duration
517
+
518
+ STEP 3 (Sequential - needs data from Step 2):
519
+ FOR EACH video CREATE lesson entity
520
+ WITH transcript
521
+ WITH thumbnail
522
+ WITH duration
523
+
524
+ STEP 4 (Parallel - independent operations):
525
+ DO AT SAME TIME:
526
+ - CREATE course with all lessons
527
+ - CONNECT creator to course as owner
528
+ - RECORD course created
529
+ ```
530
+
531
+ ### Agent Launch Pattern
532
+
533
+ ```typescript
534
+ // Director analyzes DSL and launches agents in parallel
535
+
536
+ // Step 2: Three independent FOR EACH operations
537
+ Task(agent: backend-specialist, context: "FOR EACH video extract transcript", tokens: 2500)
538
+ Task(agent: backend-specialist, context: "FOR EACH video generate thumbnail", tokens: 2500)
539
+ Task(agent: backend-specialist, context: "FOR EACH video calculate duration", tokens: 2500)
540
+
541
+ // All execute simultaneously, results merged when complete
542
+ ```
543
+
544
+ **Benefits:**
545
+ - Automatic parallelization from DSL structure
546
+ - No manual dependency management
547
+ - Agents coordinate via DSL semantics
548
+
549
+ ---
550
+
551
+ ## Event-Driven Coordination
552
+
553
+ ### How DSL RECORD Commands Enable Coordination
554
+
555
+ Every `RECORD` command in DSL becomes an event that other agents can watch:
556
+
557
+ ```
558
+ Plain English DSL:
559
+
560
+ RECORD videos imported
561
+ BY creator
562
+ WITH video count 10
563
+ WITH channel URL
564
+
565
+ ↓ Compiles to ↓
566
+
567
+ await db.insert('events', {
568
+ type: 'videos_imported',
569
+ actorId: creatorId,
570
+ metadata: {
571
+ videoCount: 10,
572
+ channelUrl: 'youtube.com/c/creator'
573
+ },
574
+ timestamp: Date.now()
575
+ })
576
+
577
+ ↓ Backend Specialist watches ↓
578
+
579
+ const importedVideos = await db
580
+ .query('events')
581
+ .withIndex('by_type', q => q.eq('type', 'videos_imported'))
582
+ .filter(q => q.eq(q.field('actorId'), creatorId))
583
+ .first()
584
+ ```
585
+
586
+ ### Full Coordination Flow
587
+
588
+ ```
589
+ Director writes DSL:
590
+ RECORD plan started WITH plan "2-creator-course-platform"
591
+ RECORD feature assigned WITH target "2-1-youtube-import" WITH agent "backend"
592
+
593
+ Backend Specialist watches DSL:
594
+ GET events WHERE type = "feature_assigned" WHERE agent = "backend"
595
+ → Start work on "2-1-youtube-import"
596
+
597
+ Backend Specialist writes DSL:
598
+ RECORD videos imported WITH count 10
599
+ RECORD implementation complete WITH target "2-1-youtube-import"
600
+
601
+ Quality watches DSL:
602
+ GET events WHERE type = "implementation_complete"
603
+ → Run tests
604
+
605
+ Quality writes DSL:
606
+ RECORD test passed WITH target "2-1-youtube-import"
607
+
608
+ Documenter watches DSL:
609
+ GET events WHERE type = "test_passed"
610
+ → Write documentation
611
+
612
+ Documenter writes DSL:
613
+ RECORD documentation complete WITH target "2-1-youtube-import"
614
+
615
+ Director watches DSL:
616
+ GET events WHERE type = "documentation_complete"
617
+ → Mark feature complete
618
+ ```
619
+
620
+ **Benefits:**
621
+ - Agents coordinate using same DSL users write
622
+ - Events table IS the message bus
623
+ - Complete audit trail in DSL semantics
624
+ - Natural failure recovery
625
+
626
+ ---
627
+
628
+ ## Quality Loops: DSL Validation and Fixing
629
+
630
+ ### How DSL Enables Self-Healing
631
+
632
+ When implementation doesn't match DSL specification, Problem Solver analyzes the gap:
633
+
634
+ ```
635
+ Plain English DSL says:
636
+ FOR EACH video CREATE lesson
637
+ RECORD course created
638
+ BY creator
639
+ WITH lesson count
640
+
641
+ Generated code does:
642
+ const courseId = await db.insert('entities', courseData)
643
+ // Missing: event logging!
644
+ // Missing: lesson count in metadata!
645
+
646
+ Quality Agent detects:
647
+ ✗ Test fails: "should log course_created event with lesson count"
648
+ ✗ DSL command not executed: RECORD course created
649
+
650
+ Problem Solver analyzes (ultrathink mode):
651
+ 1. DSL specifies: RECORD course created BY creator WITH lesson count
652
+ 2. Code creates course but doesn't record event
653
+ 3. Missing: event logging after entity creation
654
+ 4. Missing: lesson count in event metadata
655
+ 5. Solution: Add event logging with lesson count after db.insert
656
+
657
+ Problem Solver delegates fix:
658
+ Backend Specialist: Add event logging matching DSL spec
659
+ await db.insert('events', {
660
+ type: 'course_created',
661
+ actorId: creatorId,
662
+ targetId: courseId,
663
+ metadata: { lessonCount: lessons.length },
664
+ timestamp: Date.now()
665
+ })
666
+
667
+ Specialist adds lesson learned:
668
+ "Always implement RECORD commands after CREATE commands with metadata"
669
+ ```
670
+
671
+ ### Knowledge Accumulation
672
+
673
+ Lessons learned are written in DSL terms:
674
+
675
+ ```markdown
676
+ ### Always Implement RECORD After CREATE
677
+
678
+ **DSL Pattern:**
679
+ FOR EACH video CREATE lesson
680
+ CREATE course
681
+ RECORD course created BY creator WITH lesson count
682
+
683
+ **Problem:** CREATE was implemented but RECORD was missed
684
+ **Solution:** Every CREATE command must have corresponding RECORD with metadata
685
+ **Rule:** CREATE + RECORD are a pair, never separate, include all WITH clauses
686
+ **Example:**
687
+ const courseId = await db.insert('entities', courseData)
688
+ await db.insert('events', {
689
+ type: 'course_created',
690
+ actorId: creatorId,
691
+ targetId: courseId,
692
+ metadata: { lessonCount: lessons.length }
693
+ })
694
+ ```
695
+
696
+ These DSL patterns are loaded in Stage 6 to prevent repeated mistakes.
697
+
698
+ ---
699
+
700
+ ## Ontology Integration: DSL IS the Ontology
701
+
702
+ ### The Direct Mapping
703
+
704
+ The 6-dimension ontology defines valid DSL commands:
705
+
706
+ **Organizations (org-scoped data)**
707
+
708
+ ```
709
+ DSL: CREATE organization called "Acme Corp"
710
+ → Entity type: organization
711
+ → All subsequent operations scoped to this org
712
+ ```
713
+
714
+ **People (roles and authorization)**
715
+
716
+ ```
717
+ DSL: CREATE creator WITH role "org_owner"
718
+ → Entity type: creator (thing with role metadata)
719
+ → Authorization: can CREATE, CONNECT, RECORD within org
720
+
721
+ DSL: CHECK creator can access course
722
+ → Validation: role permissions against ontology rules
723
+ ```
724
+
725
+ **Things (66+ entity types)**
726
+
727
+ ```
728
+ DSL: CREATE ai_clone
729
+ → Entity type: ai_clone (one of 66+ types)
730
+ → Schema: ontology defines valid properties
731
+
732
+ DSL: CREATE course
733
+ → Entity type: course
734
+ → Schema: ontology defines valid properties
735
+ ```
736
+
737
+ **Connections (25+ relationship types)**
738
+
739
+ ```
740
+ DSL: CONNECT creator to ai_clone as owner
741
+ → Connection type: owns (one of 25+ types)
742
+ → Bidirectional: owner/owned_by
743
+ → Temporal: validFrom/validTo
744
+
745
+ DSL: CONNECT student to course as enrolled
746
+ → Connection type: enrolled_in
747
+ → Metadata: enrollment date, progress
748
+ ```
749
+
750
+ **Events (67+ event types)**
751
+
752
+ ```
753
+ DSL: RECORD clone created BY creator
754
+ → Event type: clone_created (one of 67+ types)
755
+ → Actor: creator (who did it)
756
+ → Target: clone (what was affected)
757
+ → Complete audit trail
758
+
759
+ DSL: RECORD tokens purchased BY fan
760
+ → Event type: tokens_purchased
761
+ → Consolidated event family: transacted
762
+ → Metadata: protocol = "token_purchase"
763
+ ```
764
+
765
+ **Knowledge (vectors and search)**
766
+
767
+ ```
768
+ DSL: GET personality traits WHERE creator = "john"
769
+ → Query: knowledge table
770
+ → Vector search: semantic similarity
771
+ → RAG context for AI responses
772
+ ```
773
+
774
+ ### Validation at Every DSL Stage
775
+
776
+ **Stage 1: Validate DSL Commands**
777
+
778
+ ```
779
+ User writes: CREATE xyz
780
+
781
+ Director checks:
782
+ ✗ "xyz" not in ontology entity types
783
+ → Error: "Unknown entity type 'xyz'. Did you mean: ai_clone, course, token?"
784
+
785
+ User writes: CONNECT creator to clone as invented_relationship
786
+
787
+ Director checks:
788
+ ✗ "invented_relationship" not in ontology connection types
789
+ → Error: "Unknown connection type. Use: owns, authored, delegated, etc."
790
+ ```
791
+
792
+ **Stage 3: Validate DSL Mappings**
793
+
794
+ ```
795
+ Specialist writes: Entity type "ai_clone" with property "unknownField"
796
+
797
+ Quality checks:
798
+ ✗ "unknownField" not in ai_clone schema
799
+ → Error: "Invalid property. Valid properties: voiceId, personalityPrompt, status"
800
+ ```
801
+
802
+ **Stage 4: Validate DSL Flow**
803
+
804
+ ```
805
+ Quality defines: Test flow deviates from DSL specification
806
+
807
+ Quality checks:
808
+ ✗ DSL says: CHECK fan owns tokens OTHERWISE say "Buy tokens"
809
+ ✗ Test says: CHECK fan logged in
810
+ → Error: "Test doesn't match DSL specification"
811
+ ```
812
+
813
+ **Stage 6: Validate DSL Execution**
814
+
815
+ ```
816
+ Code implements: Different behavior than DSL specifies
817
+
818
+ Quality validates:
819
+ ✗ DSL says: GIVE fan 10 tokens as reward
820
+ ✗ Code gives: 5 tokens
821
+ → Error: "Implementation doesn't match DSL specification"
822
+ ```
823
+
824
+ ---
825
+
826
+ ## Complete Example: From DSL to Working Code
827
+
828
+ ### Input: Plain English DSL
829
+
830
+ ```
831
+ FEATURE: Import YouTube videos and chat with AI about course content
832
+
833
+ INPUT:
834
+ - creator: who is building the course
835
+ - youtube channel: creator's YouTube channel URL
836
+ - student: who is learning
837
+ - message: question about course
838
+
839
+ OUTPUT:
840
+ - course: created course with lessons
841
+ - response: AI answer based on video transcripts
842
+ - enrollment: student enrolled in course
843
+
844
+ FLOW:
845
+
846
+ CHECK creator exists
847
+ OTHERWISE say "Creator account not found"
848
+
849
+ GET my YouTube channel videos
850
+ WITH channel URL
851
+ SAVE AS videos
852
+
853
+ CHECK videos count is at least 3
854
+ OTHERWISE say "Need at least 3 videos to create course"
855
+
856
+ FOR EACH video IN videos
857
+ CALL YouTube API to get video details
858
+ WITH video ID
859
+ SAVE AS video data
860
+
861
+ CALL OpenAI to generate transcript
862
+ WITH video URL
863
+ SAVE AS transcript
864
+
865
+ CREATE lesson called video title
866
+ WITH transcript
867
+ WITH video URL
868
+ WITH duration
869
+
870
+ RECORD lesson created BY creator
871
+
872
+ CREATE course called "YouTube Masterclass"
873
+ WITH all lessons
874
+ WITH price $99
875
+
876
+ CONNECT creator to course as owner
877
+
878
+ RECORD course created
879
+ BY creator
880
+ WITH lesson count
881
+
882
+ --- STUDENT ENROLLMENT ---
883
+
884
+ CHECK student exists
885
+ OTHERWISE say "Please create student account"
886
+
887
+ CHECK course exists
888
+ OTHERWISE say "Course not found"
889
+
890
+ CONNECT student to course as enrolled
891
+
892
+ RECORD enrollment
893
+ BY student
894
+ WITH course ID
895
+
896
+ --- AI CHAT WITH VIDEO CONTENT ---
897
+
898
+ GET student's question
899
+ SAVE AS message
900
+
901
+ GET course lessons WHERE student enrolled
902
+ SAVE AS lessons
903
+
904
+ CALL OpenAI to search relevant transcripts
905
+ WITH message
906
+ WITH lessons transcripts
907
+ SAVE AS context
908
+
909
+ CALL OpenAI to generate response
910
+ WITH context from videos
911
+ WITH message
912
+ WITH course structure
913
+ SAVE AS AI response
914
+
915
+ RECORD chat interaction
916
+ BY student
917
+ WITH course ID
918
+ WITH message
919
+ WITH response
920
+
921
+ GIVE AI response with video references
922
+ ```
923
+
924
+ ### Stage 1: Director Validates DSL
925
+
926
+ ```
927
+ ✓ Entity type "creator" exists in ontology
928
+ ✓ Entity type "video" exists
929
+ ✓ Entity type "course" exists
930
+ ✓ Entity type "lesson" exists
931
+ ✓ Entity type "student" exists
932
+ ✓ Connection type "owns" exists (creator owns course)
933
+ ✓ Connection type "enrolled_in" exists (student enrolled_in course)
934
+ ✓ Connection type "part_of" exists (lesson part_of course)
935
+ ✓ Event type "videos_imported" exists
936
+ ✓ Event type "course_created" exists
937
+ ✓ Event type "enrollment" exists
938
+ ✓ Event type "chat_interaction" exists
939
+ ✓ Service provider "youtube" exists
940
+ ✓ Service provider "openai" exists
941
+ ✓ All DSL commands valid
942
+
943
+ Creates Plan 2: YouTube Course Platform with AI Chat
944
+ ```
945
+
946
+ ### Stage 2: Director Creates Features
947
+
948
+ ```
949
+ Plan 2: YouTube Course Platform with AI Chat
950
+ ├── 2-1-youtube-import (Backend Specialist)
951
+ │ └── DSL: GET videos, CALL YouTube API, FOR EACH video
952
+ ├── 2-2-transcript-generation (Backend Specialist)
953
+ │ └── DSL: FOR EACH video CALL OpenAI, CREATE lesson
954
+ ├── 2-3-course-builder (Backend Specialist)
955
+ │ └── DSL: CREATE course, CONNECT lessons, RECORD course_created
956
+ ├── 2-4-enrollment-system (Integration Specialist)
957
+ │ └── DSL: CONNECT student to course, RECORD enrollment
958
+ ├── 2-5-ai-chat-engine (Backend Specialist)
959
+ │ └── DSL: GET transcripts, CALL OpenAI with context
960
+ ├── 2-6-course-pages (Frontend Specialist)
961
+ │ └── DSL: SHOW courses, SHOW lessons, SHOW chat interface
962
+ └── 2-7-student-dashboard (Frontend Specialist)
963
+ └── DSL: SHOW enrollment, SHOW progress, SHOW AI chat
964
+ ```
965
+
966
+ ### Stage 3: Specialists Write Specs (Parallel)
967
+
968
+ **Backend Specialist (2-1-youtube-import):**
969
+
970
+ ```
971
+ DSL: GET my YouTube channel videos WITH channel URL
972
+
973
+ Technical Spec:
974
+ Service: YouTubeImportService.getChannelVideos()
975
+ External: YouTube Data API v3
976
+ Input: channelUrl, creatorId
977
+ Output: Array<{ videoId, title, description, duration }>
978
+ Event: videos_imported (logged after retrieval)
979
+ ```
980
+
981
+ **Backend Specialist (2-2-transcript-generation):**
982
+
983
+ ```
984
+ DSL: FOR EACH video CALL OpenAI to generate transcript
985
+
986
+ Technical Spec:
987
+ Service: TranscriptService.generateFromVideo()
988
+ External: OpenAI Whisper API
989
+ Input: videoUrl
990
+ Output: transcript text
991
+ Pattern: Parallel processing for all videos
992
+ Event: transcript_generated (logged per video)
993
+ ```
994
+
995
+ **Backend Specialist (2-5-ai-chat-engine):**
996
+
997
+ ```
998
+ DSL: CALL OpenAI to search relevant transcripts WITH message
999
+
1000
+ Technical Spec:
1001
+ Service: AIChatService.generateResponse()
1002
+ External: OpenAI Chat Completion API + Vector Search
1003
+ Input: studentMessage, courseTranscripts, lessonContext
1004
+ Output: AI response with video references
1005
+ Event: chat_interaction (logged after response)
1006
+ ```
1007
+
1008
+ **Frontend Specialist (2-6-course-pages):**
1009
+
1010
+ ```
1011
+ DSL: SHOW courses, SHOW lessons, SHOW chat interface
1012
+
1013
+ Technical Spec:
1014
+ Pages: /courses, /courses/[id], /courses/[id]/chat
1015
+ Components: <CourseGrid>, <LessonPlayer>, <AIChatBox>
1016
+ State: course data, video playback, chat history
1017
+ Layout: Dashboard with video player + AI chat sidebar
1018
+ ```
1019
+
1020
+ ### Stage 4: Quality Defines Tests
1021
+
1022
+ ```
1023
+ Test Suite: YouTube Course Platform with AI Chat
1024
+
1025
+ Test 1: "should import videos from YouTube"
1026
+ Given: creator has YouTube channel with 10 videos
1027
+ When: creator imports channel
1028
+ Then: 10 video entities created with titles and URLs
1029
+
1030
+ Test 2: "should generate transcripts for all videos"
1031
+ Given: 5 videos imported
1032
+ When: transcript generation runs
1033
+ Then: 5 lesson entities created with transcripts
1034
+
1035
+ Test 3: "should create course with lessons"
1036
+ Given: 5 lessons exist
1037
+ When: creator creates course
1038
+ Then: course created with 5 lessons connected via part_of
1039
+
1040
+ Test 4: "should enroll student in course"
1041
+ Given: course exists with 5 lessons
1042
+ When: student enrolls
1043
+ Then: enrolled_in connection created, enrollment event logged
1044
+
1045
+ Test 5: "should answer questions using video transcripts"
1046
+ Given: student enrolled in course with video transcripts
1047
+ When: student asks "What is the main concept?"
1048
+ Then: AI responds with answer + references to specific videos
1049
+
1050
+ Test 6: "should track chat interactions"
1051
+ Given: student chatting with AI about course
1052
+ When: student sends 3 messages
1053
+ Then: 3 chat_interaction events logged with course context
1054
+ ```
1055
+
1056
+ ### Stage 5: Design Creates UI
1057
+
1058
+ ```
1059
+ Wireframe: Course Dashboard with AI Chat
1060
+
1061
+ ┌─────────────────────────────────────────────────────────────┐
1062
+ │ YouTube Masterclass │
1063
+ ├──────────────────────────┬──────────────────────────────────┤
1064
+ │ │ 💬 Ask AI About This Course │
1065
+ │ 📹 Lesson 1: Intro │ │
1066
+ │ [10:32] ▶ │ Student: What's the main topic? │
1067
+ │ │ │
1068
+ │ 📹 Lesson 2: Setup │ AI: Based on Lesson 1 (2:30), │
1069
+ │ [15:20] │ the main topic is... │
1070
+ │ │ 📹 See Lesson 1 │
1071
+ │ 📹 Lesson 3: Advanced │ │
1072
+ │ [22:45] │ Student: How do I start? │
1073
+ │ │ │
1074
+ │ Progress: 1/3 complete │ AI: As explained in Lesson 2... │
1075
+ │ │ 📹 See Lesson 2 │
1076
+ ├──────────────────────────┼──────────────────────────────────┤
1077
+ │ [Import More Videos] │ Type question... [Ask] │
1078
+ └──────────────────────────┴──────────────────────────────────┘
1079
+
1080
+ Decision: Split-pane layout (video player + AI chat)
1081
+ Decision: Video references in chat (satisfies "context from videos" DSL)
1082
+ Decision: Progress tracking (satisfies "enrollment" tracking)
1083
+ Decision: Import button (satisfies "GET YouTube videos" DSL)
1084
+ ```
1085
+
1086
+ ### Stage 6: Implementation (Parallel)
1087
+
1088
+ **Generated Backend Service:**
1089
+
1090
+ ```typescript
1091
+ // From DSL: Import YouTube videos and generate transcripts
1092
+ export const importYouTubeChannel = (params: ImportParams) =>
1093
+ Effect.gen(function* () {
1094
+ // Validate creator (DSL: CHECK creator exists)
1095
+ const creator = yield* CreatorService.findById(params.creatorId)
1096
+ if (!creator) {
1097
+ return yield* Effect.fail({
1098
+ tag: 'CreatorNotFound',
1099
+ message: 'Creator account not found'
1100
+ })
1101
+ }
1102
+
1103
+ // Get YouTube videos (DSL: GET my YouTube channel videos)
1104
+ const videos = yield* YouTubeService.getChannelVideos(params.channelUrl)
1105
+
1106
+ if (videos.length < 3) {
1107
+ return yield* Effect.fail({
1108
+ tag: 'InsufficientVideos',
1109
+ message: 'Need at least 3 videos to create course'
1110
+ })
1111
+ }
1112
+
1113
+ // Process videos in parallel (DSL: FOR EACH video)
1114
+ const lessons = yield* Effect.all(
1115
+ videos.map(video =>
1116
+ Effect.gen(function* () {
1117
+ // Generate transcript (DSL: CALL OpenAI)
1118
+ const transcript = yield* OpenAIService.transcribe(video.url)
1119
+
1120
+ // Create lesson (DSL: CREATE lesson)
1121
+ const lessonId = yield* db.insert('entities', {
1122
+ type: 'lesson',
1123
+ properties: {
1124
+ title: video.title,
1125
+ videoUrl: video.url,
1126
+ transcript,
1127
+ duration: video.duration
1128
+ }
1129
+ })
1130
+
1131
+ // Record lesson created (DSL: RECORD lesson created)
1132
+ yield* EventService.record({
1133
+ type: 'lesson_created',
1134
+ actorId: params.creatorId,
1135
+ targetId: lessonId,
1136
+ metadata: { videoId: video.id }
1137
+ })
1138
+
1139
+ return lessonId
1140
+ })
1141
+ ),
1142
+ { concurrency: 5 } // Parallel processing
1143
+ )
1144
+
1145
+ // Create course (DSL: CREATE course)
1146
+ const courseId = yield* db.insert('entities', {
1147
+ type: 'course',
1148
+ properties: {
1149
+ title: 'YouTube Masterclass',
1150
+ price: 99,
1151
+ lessonCount: lessons.length
1152
+ }
1153
+ })
1154
+
1155
+ // Connect lessons to course (DSL: CONNECT lessons part_of course)
1156
+ yield* Effect.all(
1157
+ lessons.map(lessonId =>
1158
+ db.insert('connections', {
1159
+ type: 'part_of',
1160
+ fromId: lessonId,
1161
+ toId: courseId
1162
+ })
1163
+ )
1164
+ )
1165
+
1166
+ // Connect creator to course (DSL: CONNECT creator to course as owner)
1167
+ yield* db.insert('connections', {
1168
+ type: 'owns',
1169
+ fromId: params.creatorId,
1170
+ toId: courseId
1171
+ })
1172
+
1173
+ // Record course created (DSL: RECORD course created)
1174
+ yield* EventService.record({
1175
+ type: 'course_created',
1176
+ actorId: params.creatorId,
1177
+ targetId: courseId,
1178
+ metadata: { lessonCount: lessons.length }
1179
+ })
1180
+
1181
+ return { courseId, lessonCount: lessons.length }
1182
+ })
1183
+
1184
+ // From DSL: AI chat with video transcripts
1185
+ export const chatWithCourse = (params: ChatParams) =>
1186
+ Effect.gen(function* () {
1187
+ // Get course lessons (DSL: GET course lessons WHERE student enrolled)
1188
+ const enrollment = yield* db
1189
+ .query('connections')
1190
+ .withIndex('by_type', q => q.eq('type', 'enrolled_in'))
1191
+ .filter(q =>
1192
+ q.and(
1193
+ q.eq(q.field('fromId'), params.studentId),
1194
+ q.eq(q.field('toId'), params.courseId)
1195
+ )
1196
+ )
1197
+ .first()
1198
+
1199
+ if (!enrollment) {
1200
+ return yield* Effect.fail({
1201
+ tag: 'NotEnrolled',
1202
+ message: 'Student not enrolled in course'
1203
+ })
1204
+ }
1205
+
1206
+ const lessons = yield* db
1207
+ .query('connections')
1208
+ .withIndex('by_type', q => q.eq('type', 'part_of'))
1209
+ .filter(q => q.eq(q.field('toId'), params.courseId))
1210
+ .collect()
1211
+
1212
+ // Get transcripts from lessons
1213
+ const transcripts = yield* Effect.all(
1214
+ lessons.map(lesson =>
1215
+ db.get(lesson.fromId).then(l => l.properties.transcript)
1216
+ )
1217
+ )
1218
+
1219
+ // Search relevant transcripts (DSL: CALL OpenAI to search)
1220
+ const context = yield* OpenAIService.searchTranscripts({
1221
+ query: params.message,
1222
+ transcripts
1223
+ })
1224
+
1225
+ // Generate response (DSL: CALL OpenAI to generate response)
1226
+ const response = yield* OpenAIService.generateResponse({
1227
+ context,
1228
+ message: params.message,
1229
+ lessons
1230
+ })
1231
+
1232
+ // Record interaction (DSL: RECORD chat interaction)
1233
+ yield* EventService.record({
1234
+ type: 'chat_interaction',
1235
+ actorId: params.studentId,
1236
+ targetId: params.courseId,
1237
+ metadata: { message: params.message, response }
1238
+ })
1239
+
1240
+ return { response, videoReferences: context.sources }
1241
+ })
1242
+ ```
1243
+
1244
+ **Generated Frontend Components:**
1245
+
1246
+ ```typescript
1247
+ // From DSL: SHOW courses, SHOW lessons, SHOW chat interface
1248
+ export function CourseDashboard({ courseId }: { courseId: string }) {
1249
+ const course = useQuery(api.courses.get, { courseId })
1250
+ const lessons = useQuery(api.lessons.listByCourse, { courseId })
1251
+ const [chatMessage, setChatMessage] = useState('')
1252
+ const [chatHistory, setChatHistory] = useState<ChatMessage[]>([])
1253
+
1254
+ const sendMessage = async () => {
1255
+ const result = await chatWithCourse({ courseId, message: chatMessage })
1256
+ setChatHistory([
1257
+ ...chatHistory,
1258
+ { role: 'student', content: chatMessage },
1259
+ { role: 'ai', content: result.response, sources: result.videoReferences }
1260
+ ])
1261
+ setChatMessage('')
1262
+ }
1263
+
1264
+ return (
1265
+ <div className="course-dashboard">
1266
+ <h1>{course?.properties.title}</h1>
1267
+
1268
+ <div className="layout-split">
1269
+ {/* Lessons sidebar */}
1270
+ <div className="lessons-sidebar">
1271
+ {lessons?.map(lesson => (
1272
+ <LessonCard
1273
+ key={lesson._id}
1274
+ title={lesson.properties.title}
1275
+ duration={lesson.properties.duration}
1276
+ videoUrl={lesson.properties.videoUrl}
1277
+ />
1278
+ ))}
1279
+ <button onClick={importMoreVideos}>Import More Videos</button>
1280
+ </div>
1281
+
1282
+ {/* AI Chat interface */}
1283
+ <div className="ai-chat">
1284
+ <h2>💬 Ask AI About This Course</h2>
1285
+ <div className="chat-messages">
1286
+ {chatHistory.map((msg, i) => (
1287
+ <ChatBubble
1288
+ key={i}
1289
+ role={msg.role}
1290
+ content={msg.content}
1291
+ sources={msg.sources}
1292
+ />
1293
+ ))}
1294
+ </div>
1295
+ <ChatInput
1296
+ value={chatMessage}
1297
+ onChange={setChatMessage}
1298
+ onSend={sendMessage}
1299
+ placeholder="Type question..."
1300
+ />
1301
+ </div>
1302
+ </div>
1303
+ </div>
1304
+ )
1305
+ }
1306
+ ```
1307
+
1308
+ **Generated Tests:**
1309
+
1310
+ ```typescript
1311
+ describe('YouTube Course Platform', () => {
1312
+ it('should import videos and create lessons', async () => {
1313
+ const creator = await createCreator()
1314
+ const result = await importYouTubeChannel({
1315
+ creatorId: creator.id,
1316
+ channelUrl: 'youtube.com/c/creator'
1317
+ })
1318
+
1319
+ expect(result.lessonCount).toBeGreaterThanOrEqual(3)
1320
+
1321
+ const lessons = await getLessons(result.courseId)
1322
+ expect(lessons).toHaveLength(result.lessonCount)
1323
+ expect(lessons[0].properties.transcript).toBeDefined()
1324
+ })
1325
+
1326
+ it('should answer questions using video transcripts', async () => {
1327
+ const student = await createStudent()
1328
+ const course = await createCourseWithLessons(5)
1329
+ await enrollStudent(student.id, course.id)
1330
+
1331
+ const result = await chatWithCourse({
1332
+ studentId: student.id,
1333
+ courseId: course.id,
1334
+ message: 'What is the main concept?'
1335
+ })
1336
+
1337
+ expect(result.response).toContain('Based on')
1338
+ expect(result.videoReferences).toHaveLength.greaterThan(0)
1339
+ })
1340
+
1341
+ it('should track enrollment and chat interactions', async () => {
1342
+ const student = await createStudent()
1343
+ const course = await createCourse()
1344
+
1345
+ await enrollStudent(student.id, course.id)
1346
+ await chatWithCourse({ studentId: student.id, courseId: course.id, message: 'Hi' })
1347
+
1348
+ const events = await getEvents({ studentId: student.id })
1349
+ expect(events).toContainEqual(expect.objectContaining({ type: 'enrollment' }))
1350
+ expect(events).toContainEqual(expect.objectContaining({ type: 'chat_interaction' }))
1351
+ })
1352
+ })
1353
+ ```
1354
+
1355
+ ### Output: Production-Ready Application
1356
+
1357
+ - ✅ YouTube import working with video metadata extraction
1358
+ - ✅ Transcript generation for all videos via OpenAI Whisper
1359
+ - ✅ Course builder with lessons automatically connected
1360
+ - ✅ Student enrollment system with tracking
1361
+ - ✅ AI chat with video transcript context
1362
+ - ✅ Video references in AI responses
1363
+ - ✅ Complete event logging (imports, enrollments, chats)
1364
+ - ✅ Tests covering all user flows
1365
+ - ✅ Dashboard UI with split-pane layout
1366
+
1367
+ **Generated Files:**
1368
+ - `backend/services/YouTubeImportService.ts`
1369
+ - `backend/services/TranscriptService.ts`
1370
+ - `backend/services/CourseService.ts`
1371
+ - `backend/services/AIChatService.ts`
1372
+ - `frontend/src/pages/courses.astro`
1373
+ - `frontend/src/pages/courses/[id].astro`
1374
+ - `frontend/src/components/CourseDashboard.tsx`
1375
+ - `frontend/src/components/LessonCard.tsx`
1376
+ - `frontend/src/components/ChatBubble.tsx`
1377
+ - `frontend/test/courses/import.test.ts`
1378
+ - `frontend/test/courses/enrollment.test.ts`
1379
+ - `frontend/test/courses/ai-chat.test.ts`
1380
+
1381
+ **Timeline:** 2-3 weeks from DSL to production
1382
+
1383
+ ---
1384
+
1385
+ ## File Structure
1386
+
1387
+ ```
1388
+ one/
1389
+ ├── knowledge/
1390
+ │ ├── language.md # Plain English DSL reference
1391
+ │ ├── ontology-minimal.yaml # 6-dimension ontology (DSL validation)
1392
+ │ ├── lessons-learned.md # DSL patterns that work
1393
+ │ └── patterns/ # DSL→Code translation patterns
1394
+ ├── things/
1395
+ │ ├── cascade/
1396
+ │ │ ├── cascade.yaml # Workflow orchestration config
1397
+ │ │ ├── docs/
1398
+ │ │ │ ├── getting-started.md # Quick start
1399
+ │ │ │ ├── workflow.md # Complete specification
1400
+ │ │ │ └── examples/ # DSL examples with generated code
1401
+ │ │ └── templates/
1402
+ │ │ └── feature-template.md # DSL feature template
1403
+ │ ├── agents/ # 8 agent prompts (DSL processors)
1404
+ │ │ ├── agent-director.md # Validates DSL
1405
+ │ │ ├── agent-backend.md # Implements CREATE, RECORD, CALL
1406
+ │ │ ├── agent-frontend.md # Implements SHOW, GIVE
1407
+ │ │ ├── agent-integration.md # Implements CONNECT, UPDATE
1408
+ │ │ ├── agent-quality.md # Validates DSL flow
1409
+ │ │ ├── agent-designer.md # Designs DSL execution UI
1410
+ │ │ ├── agent-problem-solver.md # Fixes DSL mismatches
1411
+ │ │ └── agent-documenter.md # Documents DSL features
1412
+ │ ├── plans/ # Generated plans (from DSL)
1413
+ │ └── features/ # Generated features (from DSL)
1414
+ └── events/
1415
+ └── workflow/ # Event logs (DSL RECORD commands)
1416
+ ```
1417
+
1418
+ ---
1419
+
1420
+ ## Command Interface
1421
+
1422
+ ```bash
1423
+ /one
1424
+ ```
1425
+
1426
+ Launches CASCADE with DSL interface:
1427
+
1428
+ ```
1429
+ ONE CASCADE - Plain English to Production Code
1430
+
1431
+ Write Features:
1432
+ 1. New Feature (Plain English DSL)
1433
+ 2. View Active Plans
1434
+ 3. Check Feature Status
1435
+
1436
+ Templates:
1437
+ 4. AI Clone Template
1438
+ 5. Token Economy Template
1439
+ 6. Course Platform Template
1440
+ 7. Custom Template
1441
+
1442
+ Help:
1443
+ H. DSL Quick Reference
1444
+ ?. Example Library
1445
+ ```
1446
+
1447
+ ---
1448
+
1449
+ ## Performance Metrics
1450
+
1451
+ | Metric | Traditional | CASCADE with DSL |
1452
+ |--------|-------------|------------------|
1453
+ | Input format | Technical specifications | Plain English |
1454
+ | Validation | Manual code review | Automatic against ontology |
1455
+ | Context per stage | 150,000 tokens | 200-2,500 tokens |
1456
+ | Average context | 150,000 tokens | 3,000 tokens (98% reduction) |
1457
+ | Parallelization | Manual coordination | Automatic from DSL structure |
1458
+ | Error detection | Runtime failures | Compile-time validation |
1459
+ | Code quality | Variable | Consistent (validated against DSL) |
1460
+ | Knowledge retention | None | DSL patterns accumulate |
1461
+ | Time to production | 3-6 months | 2-3 weeks |
1462
+
1463
+ ---
1464
+
1465
+ ## Technical Requirements
1466
+
1467
+ **Backend:**
1468
+ - Effect.ts (functional programming, error handling)
1469
+ - Database with events table (message bus)
1470
+ - Service providers (OpenAI, ElevenLabs, Stripe, etc.)
1471
+
1472
+ **Frontend:**
1473
+ - Astro 5 (static generation + SSR)
1474
+ - React 19 (islands architecture)
1475
+ - Tailwind v4 (styling)
1476
+
1477
+ **AI:**
1478
+ - Claude Code (agent orchestration)
1479
+ - Task tool (parallel agent execution)
1480
+ - 8 specialized agent prompts (DSL processors)
1481
+
1482
+ **Deployment:**
1483
+ - Edge platform (Cloudflare Pages, Vercel, etc.)
1484
+ - Database platform (supporting events table)
1485
+
1486
+ ---
1487
+
1488
+ ## Philosophy
1489
+
1490
+ **Core Principles:**
1491
+
1492
+ 1. **Plain English IS the specification** - DSL commands are executable
1493
+ 2. **Ontology IS the validation** - Every DSL command maps to ontology types
1494
+ 3. **Agents collaborate via DSL semantics** - RECORD commands create events agents watch
1495
+ 4. **Context loaded per DSL stage** - Only load what's needed for current DSL commands
1496
+ 5. **Parallel by default** - Independent DSL commands execute concurrently
1497
+ 6. **Quality loops validate DSL** - Implementation must match DSL specification
1498
+ 7. **Knowledge accumulates in DSL terms** - Lessons learned as DSL patterns
1499
+
1500
+ **Key Insight:** When the input language maps directly to the ontology, and agents coordinate using the same language, you get 98% context reduction, automatic parallelization, and self-validating implementations.
1501
+
1502
+ ---
1503
+
1504
+ ## Documentation
1505
+
1506
+ **DSL Reference:** `one/knowledge/language.md`
1507
+ **Quick Start:** `one/things/cascade/docs/getting-started.md`
1508
+ **Complete Workflow:** `one/things/cascade/docs/workflow.md`
1509
+ **Configuration:** `one/things/cascade/cascade.yaml`
1510
+ **Agent Prompts:** `one/things/agents/`
1511
+ **Ontology:** `one/knowledge/ontology-minimal.yaml`
1512
+ **Examples:** `one/things/cascade/docs/examples/`
1513
+
1514
+ ---
1515
+
1516
+ **ONE Cascade v1.0.0**
1517
+
1518
+ Plain English DSL → 6-Dimension Ontology → Parallel Agent Orchestration → Production Code