oneie 3.5.0 → 3.6.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 (141) hide show
  1. package/.claude/agents/agent-director.md +902 -22
  2. package/.claude/agents/agent-onboard-example-output.md +600 -0
  3. package/.claude/agents/agent-onboard.md +576 -0
  4. package/.claude/commands/ONBOARDING_ENHANCEMENT_SUMMARY.md +266 -0
  5. package/.claude/commands/deploy.md +77 -150
  6. package/.claude/commands/one.md +375 -5
  7. package/.claude/commands/release.md +64 -3
  8. package/.mcp.json +57 -0
  9. package/CLAUDE.md +55 -69
  10. package/CREATE-WEBSITE.md +442 -0
  11. package/SECURITY.md +31 -0
  12. package/TESTING-ONBOARDING.md +185 -0
  13. package/dist/commands/create-website.d.ts +19 -0
  14. package/dist/commands/create-website.d.ts.map +1 -0
  15. package/dist/commands/create-website.js +231 -0
  16. package/dist/commands/create-website.js.map +1 -0
  17. package/dist/commands/init.d.ts +5 -6
  18. package/dist/commands/init.d.ts.map +1 -1
  19. package/dist/commands/init.js +213 -103
  20. package/dist/commands/init.js.map +1 -1
  21. package/dist/index.js +7 -5
  22. package/dist/index.js.map +1 -1
  23. package/dist/utils/installation-setup.d.ts +24 -1
  24. package/dist/utils/installation-setup.d.ts.map +1 -1
  25. package/dist/utils/installation-setup.js +85 -1
  26. package/dist/utils/installation-setup.js.map +1 -1
  27. package/dist/utils/launch-claude.d.ts +6 -0
  28. package/dist/utils/launch-claude.d.ts.map +1 -0
  29. package/dist/utils/launch-claude.js +51 -0
  30. package/dist/utils/launch-claude.js.map +1 -0
  31. package/dist/utils/validation.d.ts +48 -0
  32. package/dist/utils/validation.d.ts.map +1 -0
  33. package/dist/utils/validation.js +73 -0
  34. package/dist/utils/validation.js.map +1 -0
  35. package/folders.yaml +1 -1
  36. package/one/.obsidian/core-plugins.json +33 -0
  37. package/one/.obsidian/workspace.json +20 -20
  38. package/one/connections/workflow-onboarding.md +683 -0
  39. package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +354 -0
  40. package/one/events/CRITICAL-FIXES-COMPLETE.md +504 -0
  41. package/one/events/DEPLOYMENT.md +178 -0
  42. package/one/events/ECOMMERCE-DEMO-PLAN.md +225 -0
  43. package/one/events/ECOMMERCE-LIVE-DEMO.md +363 -0
  44. package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +735 -0
  45. package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +923 -0
  46. package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +223 -0
  47. package/one/events/HANDOFF.md +313 -0
  48. package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +503 -0
  49. package/one/events/IMPLEMENTATION_SUMMARY.md +529 -0
  50. package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +666 -0
  51. package/one/events/LANDING-PAGE-IMPLEMENTATION.md +642 -0
  52. package/one/events/LANDING-PAGE-QUICKSTART.md +407 -0
  53. package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +1627 -0
  54. package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +573 -0
  55. package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +398 -0
  56. package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +525 -0
  57. package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +455 -0
  58. package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +486 -0
  59. package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +203 -0
  60. package/one/events/SECURITY-AUDIT-FIXES.md +376 -0
  61. package/one/events/SECURITY-SCAN-COMPLETE.md +281 -0
  62. package/one/events/SHOP-BUILD-STATUS.md +114 -0
  63. package/one/events/SHOP-PREMIUM-UPDATE.md +149 -0
  64. package/one/events/SITE-WIDE-GRADIENT-FIX.md +299 -0
  65. package/one/events/STORE-PRODUCTION-READY-STATUS.md +359 -0
  66. package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +429 -0
  67. package/one/events/agent-director-enhancement-summary.md +386 -0
  68. package/one/events/agent-onboard-implementation-summary.md +457 -0
  69. package/one/events/clean-agent-ontology-cleanup-report.md +353 -0
  70. package/one/events/landing-page-generator.md +458 -0
  71. package/one/events/onboarding-implementation-complete.md +505 -0
  72. package/one/events/release.md +254 -0
  73. package/one/events/separate-implementation-status.md +537 -0
  74. package/one/knowledge/100-inference-quick-reference.md +431 -0
  75. package/one/knowledge/agent-onboard-usage.md +612 -0
  76. package/one/knowledge/cli-claude-handoff.md +718 -0
  77. package/one/knowledge/ontology-blog.yaml +31 -0
  78. package/one/knowledge/ontology-cheatsheet.md +591 -0
  79. package/one/knowledge/ontology-community.yaml +42 -0
  80. package/one/knowledge/ontology-core-universal.md +722 -0
  81. package/one/knowledge/ontology-core.yaml +50 -0
  82. package/one/knowledge/ontology-courses.yaml +53 -0
  83. package/one/knowledge/ontology-creator.md +376 -0
  84. package/one/knowledge/ontology-developer-guide.md +789 -0
  85. package/one/knowledge/ontology-education.md +920 -0
  86. package/one/knowledge/ontology-index.md +354 -0
  87. package/one/knowledge/ontology-migration-guide.md +811 -0
  88. package/one/knowledge/ontology-minimal.yaml +1 -1
  89. package/one/knowledge/ontology-portfolio.yaml +31 -0
  90. package/one/knowledge/ontology-quickstart.md +576 -0
  91. package/one/knowledge/ontology-shop.yaml +121 -0
  92. package/one/knowledge/ontology-tokens.yaml +32 -0
  93. package/one/knowledge/ontology-tutorial.md +434 -0
  94. package/one/knowledge/ontology-video-script.md +890 -0
  95. package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +467 -0
  96. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +408 -0
  97. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +369 -0
  98. package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +396 -0
  99. package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +468 -0
  100. package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +582 -0
  101. package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +449 -0
  102. package/one/things/docs/ecommerce/QUICK-START.md +368 -0
  103. package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +498 -0
  104. package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +237 -0
  105. package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +171 -0
  106. package/one/things/docs/ecommerce/demo.astro +309 -0
  107. package/one/things/plans/agent-director-100-inference-plans.md +410 -0
  108. package/one/things/plans/dual-website-strategy.md +612 -0
  109. package/one/things/plans/feature-based-sites.md +821 -0
  110. package/one/things/plans/multi-ontology-architecture.md +836 -0
  111. package/one/things/plans/onboarding.md +32 -0
  112. package/one/things/plans/separate.md +15 -17
  113. package/one/things/plans/start-new.md +738 -0
  114. package/package.json +7 -2
  115. package/one/things/claude/hooks/agent-hook-manager.js +0 -525
  116. package/one/things/claude/hooks/agent-load-balancer.js +0 -271
  117. package/one/things/claude/hooks/agent-request-interceptor.js +0 -70
  118. package/one/things/claude/hooks/cascade-feedback.js +0 -297
  119. package/one/things/claude/hooks/cascade-integration-hooks.js +0 -648
  120. package/one/things/claude/hooks/continuous-improvement-monitor.js +0 -510
  121. package/one/things/claude/hooks/file-organization-engine.js +0 -427
  122. package/one/things/claude/hooks/file-organization-monitor.js +0 -269
  123. package/one/things/claude/hooks/hook-config-manager.js +0 -202
  124. package/one/things/claude/hooks/hook-orchestrator.js +0 -662
  125. package/one/things/claude/hooks/hook-performance-report.js +0 -120
  126. package/one/things/claude/hooks/mcp-cascade-integration.js +0 -816
  127. package/one/things/claude/hooks/memory-optimizer.js +0 -510
  128. package/one/things/claude/hooks/ontology-compliance.js +0 -394
  129. package/one/things/claude/hooks/ontology-hook-manager.js +0 -316
  130. package/one/things/claude/hooks/ontology-validation-engine.js +0 -317
  131. package/one/things/claude/hooks/performance-monitoring-hook.js +0 -422
  132. package/one/things/claude/hooks/quality-scoring-engine.js +0 -834
  133. package/one/things/claude/hooks/simple-load-balancer.js +0 -238
  134. package/one/things/claude/hooks/startup-optimizer.js +0 -625
  135. package/one/things/claude/hooks/story-scoring-system.js +0 -445
  136. package/one/things/claude/hooks/story-validation-engine.js +0 -473
  137. package/one/things/claude/hooks/structure-synchronizer.js +0 -194
  138. package/one/things/claude/hooks/sub-agent-output-validator.js +0 -647
  139. package/one/things/claude/hooks/sub-agent-validation-hook.js +0 -343
  140. package/one/things/claude/hooks/trinity-validation-system.js +0 -392
  141. package/one/things/plans/organizations-to-groups.md +0 -705
@@ -0,0 +1,890 @@
1
+ # Multi-Ontology Tutorial Video Script
2
+
3
+ **Purpose:** Educational video series explaining the multi-ontology architecture
4
+ **Target Audience:** Developers building on ONE Platform
5
+ **Total Duration:** ~35 minutes (3 videos)
6
+
7
+ ---
8
+
9
+ ## Video 1: Introduction to Multi-Ontology Architecture (5 minutes)
10
+
11
+ ### [0:00-0:30] Hook
12
+
13
+ **VISUAL:** Animation showing traditional database schema with 50+ tables gradually simplifying to 6 clean dimensions
14
+
15
+ **SCRIPT:**
16
+
17
+ "What if you could add a complete e-commerce feature to your platform without writing a single database migration?
18
+
19
+ What if adding a blog, newsletter, or course system was as simple as enabling a feature flag?
20
+
21
+ Welcome to the Multi-Ontology Architecture."
22
+
23
+ **ON-SCREEN TEXT:**
24
+ - No schema migrations
25
+ - Type-safe by default
26
+ - Infinite extensibility
27
+
28
+ ### [0:30-2:00] The Problem
29
+
30
+ **VISUAL:** Split screen showing traditional vs. ONE approach
31
+
32
+ **SCRIPT:**
33
+
34
+ "Traditional platforms create new database tables for every feature.
35
+
36
+ Want to add a blog? Create tables for posts, categories, tags, authors, comments...
37
+
38
+ Want to add a shop? Create tables for products, orders, inventory, shipping...
39
+
40
+ Before long, you have 50 tables, 200 columns, and a maintenance nightmare.
41
+
42
+ Every new feature requires:
43
+ - Database migrations
44
+ - Schema updates
45
+ - Breaking changes
46
+ - Hours of debugging
47
+
48
+ There's a better way."
49
+
50
+ **ON-SCREEN TEXT:**
51
+ Traditional:
52
+ - 50+ tables
53
+ - Schema migrations
54
+ - Breaking changes
55
+
56
+ ONE:
57
+ - 6 dimensions
58
+ - YAML definitions
59
+ - Zero downtime
60
+
61
+ ### [2:00-3:30] The Solution
62
+
63
+ **VISUAL:** 6-dimension ontology diagram with things, connections, events flowing
64
+
65
+ **SCRIPT:**
66
+
67
+ "The Multi-Ontology Architecture solves this with 6 universal dimensions:
68
+
69
+ 1. **Groups** - Who belongs where (organizations, teams, communities)
70
+ 2. **People** - Who can do what (roles, permissions)
71
+ 3. **Things** - What exists (any entity in your system)
72
+ 4. **Connections** - How they relate (relationships between entities)
73
+ 5. **Events** - What happened (complete audit trail)
74
+ 6. **Knowledge** - What it means (semantic search and AI)
75
+
76
+ These 6 dimensions never change.
77
+
78
+ But you can add unlimited features by extending them with YAML definitions.
79
+
80
+ Want a blog? Define blog_post as a thing type.
81
+ Want a shop? Define product as a thing type.
82
+ Want a newsletter? Define subscriber as a thing type.
83
+
84
+ All type-safe. All auto-generated. Zero schema migrations."
85
+
86
+ **ON-SCREEN TEXT:**
87
+ 6 Dimensions = Infinite Features
88
+
89
+ ### [3:30-5:00] What You'll Learn
90
+
91
+ **VISUAL:** Course outline with chapters
92
+
93
+ **SCRIPT:**
94
+
95
+ "In this tutorial series, you'll learn:
96
+
97
+ **Video 1 (this video):** Understanding the architecture
98
+
99
+ **Video 2:** Creating your first feature - We'll build a complete newsletter system with subscriptions, campaigns, and analytics. 10 minutes.
100
+
101
+ **Video 3:** Advanced patterns - Multi-feature interactions, performance optimization, and production deployment. 20 minutes.
102
+
103
+ By the end, you'll be able to:
104
+ - Create custom features in minutes
105
+ - Compose features together
106
+ - Deploy with confidence
107
+ - Scale infinitely
108
+
109
+ Let's get started."
110
+
111
+ **ON-SCREEN TEXT:**
112
+ - 3 videos, 35 minutes
113
+ - Build a real feature
114
+ - Production-ready patterns
115
+
116
+ ---
117
+
118
+ ## Video 2: Creating Your First Feature (10 minutes)
119
+
120
+ ### [0:00-0:30] Introduction
121
+
122
+ **VISUAL:** Finished newsletter dashboard preview
123
+
124
+ **SCRIPT:**
125
+
126
+ "Welcome back! In this video, we're building a complete newsletter feature from scratch.
127
+
128
+ We'll create:
129
+ - Newsletter publications
130
+ - Subscriber management
131
+ - Email campaigns
132
+ - Analytics dashboard
133
+
134
+ And it'll all be type-safe and real-time.
135
+
136
+ Let's dive in."
137
+
138
+ ### [0:30-2:00] Planning the Data Model
139
+
140
+ **VISUAL:** Whiteboard diagram of entities and relationships
141
+
142
+ **SCRIPT:**
143
+
144
+ "Before writing any code, let's plan our data model.
145
+
146
+ **What entities do we need?** (Things)
147
+ - Newsletter - The publication
148
+ - Newsletter Issue - Individual editions
149
+ - Subscriber - People subscribed
150
+ - Campaign - Email delivery system
151
+
152
+ **How do they relate?** (Connections)
153
+ - Creator owns Newsletter
154
+ - Issue belongs to Newsletter
155
+ - Subscriber subscribes to Newsletter
156
+ - Campaign sends Issue
157
+
158
+ **What actions happen?** (Events)
159
+ - Newsletter created
160
+ - User subscribed
161
+ - Issue published
162
+ - Campaign sent
163
+ - Email opened
164
+
165
+ This maps perfectly to our 6-dimension ontology."
166
+
167
+ **ON-SCREEN DIAGRAM:**
168
+ ```
169
+ Creator --owns--> Newsletter --contains--> Issue
170
+ ^ |
171
+ | |
172
+ Subscriber --subscribes to Campaign --sends-->
173
+ ```
174
+
175
+ ### [2:00-4:00] Creating the YAML Ontology
176
+
177
+ **VISUAL:** Code editor showing YAML file being created
178
+
179
+ **SCRIPT:**
180
+
181
+ "Now we define this in YAML. Create `ontology-newsletter.yaml`:
182
+
183
+ First, declare the feature:
184
+
185
+ ```yaml
186
+ feature: newsletter
187
+ extends: core
188
+ version: "1.0.0"
189
+ ```
190
+
191
+ This extends the core ontology, giving us access to creator, group, and other core types.
192
+
193
+ Now define our things:
194
+
195
+ ```yaml
196
+ thingTypes:
197
+ - name: newsletter
198
+ properties:
199
+ title: string
200
+ description: string
201
+ schedule: string
202
+ subscriberCount: number
203
+ ```
204
+
205
+ Define connections:
206
+
207
+ ```yaml
208
+ connectionTypes:
209
+ - name: subscribed_to
210
+ fromType: subscriber
211
+ toType: newsletter
212
+ ```
213
+
214
+ And events:
215
+
216
+ ```yaml
217
+ eventTypes:
218
+ - name: newsletter_subscribed
219
+ thingType: subscriber
220
+ ```
221
+
222
+ That's it. Our ontology is defined."
223
+
224
+ **ON-SCREEN TEXT:**
225
+ - 4 thing types
226
+ - 5 connection types
227
+ - 12 event types
228
+ = Complete feature
229
+
230
+ ### [4:00-5:30] Generating TypeScript Types
231
+
232
+ **VISUAL:** Terminal showing type generation
233
+
234
+ **SCRIPT:**
235
+
236
+ "Now the magic happens. Run the type generator:
237
+
238
+ ```bash
239
+ PUBLIC_FEATURES='newsletter' bun run generate-ontology-types.ts
240
+ ```
241
+
242
+ Watch as it:
243
+ 1. Loads the core ontology
244
+ 2. Loads your newsletter ontology
245
+ 3. Composes them together
246
+ 4. Generates TypeScript types
247
+
248
+ Output:
249
+ - 70 thing types (core + newsletter)
250
+ - 30 connection types
251
+ - 79 event types
252
+
253
+ All type-safe. All auto-complete. Zero manual typing."
254
+
255
+ **ON-SCREEN OUTPUT:**
256
+ ```
257
+ ✅ Ontologies loaded successfully!
258
+ - Features: core, newsletter
259
+ - Thing Types: 70
260
+ - Connection Types: 30
261
+ - Event Types: 79
262
+ ⚙️ Generating TypeScript types...
263
+ ✅ Types generated successfully!
264
+ ```
265
+
266
+ ### [5:30-7:30] Creating Mutations
267
+
268
+ **VISUAL:** Code editor showing mutation being written
269
+
270
+ **SCRIPT:**
271
+
272
+ "Now write a mutation to create newsletters.
273
+
274
+ Import the generated types:
275
+
276
+ ```typescript
277
+ import type { ThingType, ConnectionType, EventType }
278
+ from '../types/ontology';
279
+ ```
280
+
281
+ Create the mutation:
282
+
283
+ ```typescript
284
+ export const create = mutation({
285
+ args: {
286
+ groupId: v.id('groups'),
287
+ title: v.string(),
288
+ schedule: v.string(),
289
+ },
290
+ handler: async (ctx, args) => {
291
+ // 1. Create newsletter entity
292
+ const newsletterId = await ctx.db.insert('entities', {
293
+ type: 'newsletter' as ThingType,
294
+ name: args.title,
295
+ properties: { /* ... */ },
296
+ });
297
+
298
+ // 2. Create ownership connection
299
+ await ctx.db.insert('connections', {
300
+ relationshipType: 'owns' as ConnectionType,
301
+ fromEntityId: userId,
302
+ toEntityId: newsletterId,
303
+ });
304
+
305
+ // 3. Log creation event
306
+ await ctx.db.insert('events', {
307
+ type: 'newsletter_created' as EventType,
308
+ actorId: userId,
309
+ targetId: newsletterId,
310
+ });
311
+
312
+ return newsletterId;
313
+ },
314
+ });
315
+ ```
316
+
317
+ Three steps. Create, connect, log. Every time."
318
+
319
+ **ON-SCREEN TEXT:**
320
+ Pattern:
321
+ 1. Create entity
322
+ 2. Create connection
323
+ 3. Log event
324
+
325
+ ### [7:30-9:00] Creating Queries
326
+
327
+ **VISUAL:** Code showing real-time queries
328
+
329
+ **SCRIPT:**
330
+
331
+ "Queries are even simpler:
332
+
333
+ ```typescript
334
+ export const list = query({
335
+ args: { groupId: v.id('groups') },
336
+ handler: async (ctx, args) => {
337
+ return await ctx.db
338
+ .query('entities')
339
+ .withIndex('group_type', q =>
340
+ q.eq('groupId', args.groupId)
341
+ .eq('type', 'newsletter')
342
+ )
343
+ .collect();
344
+ },
345
+ });
346
+ ```
347
+
348
+ This automatically:
349
+ - Filters by group (multi-tenant)
350
+ - Filters by type
351
+ - Returns real-time results
352
+
353
+ When someone creates a newsletter, all subscribers see it instantly.
354
+
355
+ That's the power of Convex."
356
+
357
+ ### [9:00-10:00] Testing & Wrap-up
358
+
359
+ **VISUAL:** Test results showing green checkmarks
360
+
361
+ **SCRIPT:**
362
+
363
+ "Write tests to validate:
364
+
365
+ ```typescript
366
+ it('should create newsletter', async () => {
367
+ const id = await t.mutation(api.newsletter.create, {
368
+ groupId: 'test',
369
+ title: 'Test Newsletter',
370
+ });
371
+
372
+ expect(id).toBeDefined();
373
+ });
374
+ ```
375
+
376
+ Run tests:
377
+ ```bash
378
+ bun test newsletter.test.ts
379
+ ```
380
+
381
+ ✅ All passing.
382
+
383
+ You just built a complete newsletter system in 10 minutes.
384
+
385
+ Type-safe. Real-time. Production-ready.
386
+
387
+ In the next video, we'll explore advanced patterns like multi-feature interactions and performance optimization.
388
+
389
+ See you there!"
390
+
391
+ ---
392
+
393
+ ## Video 3: Advanced Patterns (20 minutes)
394
+
395
+ ### [0:00-0:30] Introduction
396
+
397
+ **VISUAL:** Complex architecture diagram
398
+
399
+ **SCRIPT:**
400
+
401
+ "Welcome to the advanced patterns video!
402
+
403
+ You've learned the basics. Now let's level up.
404
+
405
+ We'll cover:
406
+ - Multi-feature interactions
407
+ - Performance optimization
408
+ - Production deployment
409
+ - Real-world case studies
410
+
411
+ Let's go deep."
412
+
413
+ ### [0:30-3:00] Pattern 1: Multi-Feature Composition
414
+
415
+ **VISUAL:** Blog + Newsletter integration diagram
416
+
417
+ **SCRIPT:**
418
+
419
+ "Features can interact with each other.
420
+
421
+ Let's integrate blog and newsletter.
422
+
423
+ Goal: Send blog posts to newsletter subscribers.
424
+
425
+ Create an integration ontology:
426
+
427
+ ```yaml
428
+ feature: blog-newsletter
429
+ extends: blog,newsletter
430
+ ```
431
+
432
+ Notice: We extend BOTH features.
433
+
434
+ Now define a connection:
435
+
436
+ ```yaml
437
+ connectionTypes:
438
+ - name: featured_in
439
+ fromType: blog_post # From blog feature
440
+ toType: newsletter_issue # From newsletter feature
441
+ ```
442
+
443
+ And an event:
444
+
445
+ ```yaml
446
+ eventTypes:
447
+ - name: post_emailed
448
+ thingType: blog_post
449
+ ```
450
+
451
+ Now implement:
452
+
453
+ ```typescript
454
+ export const sendPostToNewsletter = mutation({
455
+ handler: async (ctx, args) => {
456
+ const post = await ctx.db.get(args.postId);
457
+
458
+ // Create newsletter issue from post
459
+ const issueId = await ctx.db.insert('entities', {
460
+ type: 'newsletter_issue',
461
+ properties: {
462
+ title: post.properties.title,
463
+ content: post.properties.content,
464
+ },
465
+ });
466
+
467
+ // Link post to issue
468
+ await ctx.db.insert('connections', {
469
+ relationshipType: 'featured_in',
470
+ fromEntityId: args.postId,
471
+ toEntityId: issueId,
472
+ });
473
+
474
+ // Log event
475
+ await ctx.db.insert('events', {
476
+ type: 'post_emailed',
477
+ actorId: args.postId,
478
+ targetId: issueId,
479
+ });
480
+
481
+ return issueId;
482
+ },
483
+ });
484
+ ```
485
+
486
+ Features compose beautifully."
487
+
488
+ **ON-SCREEN TEXT:**
489
+ Compose Features:
490
+ - Extend multiple
491
+ - Cross-reference types
492
+ - Share connections
493
+ - Unified events
494
+
495
+ ### [3:00-6:00] Pattern 2: Conditional Features (Runtime)
496
+
497
+ **VISUAL:** Feature flags dashboard
498
+
499
+ **SCRIPT:**
500
+
501
+ "Features can be enabled/disabled at runtime.
502
+
503
+ Check enabled features:
504
+
505
+ ```typescript
506
+ import { ONTOLOGY_METADATA } from '../types/ontology';
507
+
508
+ export const getFeatures = query({
509
+ handler: async () => {
510
+ return {
511
+ enabled: ONTOLOGY_METADATA.features,
512
+ hasBlog: ONTOLOGY_METADATA.features.includes('blog'),
513
+ hasShop: ONTOLOGY_METADATA.features.includes('shop'),
514
+ };
515
+ },
516
+ });
517
+ ```
518
+
519
+ Use in conditional logic:
520
+
521
+ ```typescript
522
+ export const createContent = mutation({
523
+ handler: async (ctx, args) => {
524
+ const features = ONTOLOGY_METADATA.features;
525
+
526
+ if (args.type === 'blog_post' && !features.includes('blog')) {
527
+ throw new Error('Blog feature not enabled');
528
+ }
529
+
530
+ // Create entity...
531
+ },
532
+ });
533
+ ```
534
+
535
+ This enables:
536
+ - Feature flags
537
+ - A/B testing
538
+ - Gradual rollouts
539
+ - Per-group features
540
+
541
+ Different organizations can enable different features.
542
+
543
+ One platform. Infinite configurations."
544
+
545
+ **ON-SCREEN TEXT:**
546
+ Runtime Features:
547
+ - Feature flags
548
+ - A/B testing
549
+ - Gradual rollout
550
+ - Per-org config
551
+
552
+ ### [6:00-10:00] Pattern 3: Performance Optimization
553
+
554
+ **VISUAL:** Performance metrics dashboard
555
+
556
+ **SCRIPT:**
557
+
558
+ "At scale, performance matters.
559
+
560
+ **Optimization 1: Cache Type Sets**
561
+
562
+ Type validation can be slow with linear search.
563
+
564
+ Before:
565
+ ```typescript
566
+ function isValid(type: string) {
567
+ return THING_TYPES.includes(type); // O(n)
568
+ }
569
+ ```
570
+
571
+ After:
572
+ ```typescript
573
+ const THING_TYPE_SET = new Set(THING_TYPES);
574
+
575
+ function isValid(type: string) {
576
+ return THING_TYPE_SET.has(type); // O(1)
577
+ }
578
+ ```
579
+
580
+ 100x faster on large type arrays.
581
+
582
+ **Optimization 2: Batch Operations**
583
+
584
+ Don't create entities one-by-one:
585
+
586
+ ```typescript
587
+ // Bad: Loop with awaits
588
+ for (const item of items) {
589
+ await create(item); // Slow!
590
+ }
591
+
592
+ // Good: Batch with Promise.all
593
+ const results = await Promise.all(
594
+ items.map(item => create(item))
595
+ );
596
+ ```
597
+
598
+ 10x faster for bulk operations.
599
+
600
+ **Optimization 3: Index Strategy**
601
+
602
+ Always use indexes:
603
+
604
+ ```typescript
605
+ // Bad: No index
606
+ await ctx.db.query('entities').collect();
607
+
608
+ // Good: Use index
609
+ await ctx.db
610
+ .query('entities')
611
+ .withIndex('group_type', q =>
612
+ q.eq('groupId', groupId).eq('type', 'newsletter')
613
+ )
614
+ .collect();
615
+ ```
616
+
617
+ 1000x faster on large datasets.
618
+
619
+ **Optimization 4: Limit Results**
620
+
621
+ Always paginate:
622
+
623
+ ```typescript
624
+ // Bad: Unbounded
625
+ await ctx.db.query('entities').collect();
626
+
627
+ // Good: Limited
628
+ await ctx.db.query('entities').take(50);
629
+ ```
630
+
631
+ Prevents memory issues at scale."
632
+
633
+ **ON-SCREEN METRICS:**
634
+ - Type checks: 100x faster
635
+ - Batch ops: 10x faster
636
+ - Indexed queries: 1000x faster
637
+ - Pagination: ∞x safer
638
+
639
+ ### [10:00-14:00] Pattern 4: Event-Driven Analytics
640
+
641
+ **VISUAL:** Analytics dashboard with charts
642
+
643
+ **SCRIPT:**
644
+
645
+ "Events power analytics.
646
+
647
+ Every action creates an event. Query events for insights.
648
+
649
+ **Basic Analytics:**
650
+
651
+ ```typescript
652
+ export const getAnalytics = query({
653
+ handler: async (ctx, args) => {
654
+ const events = await ctx.db
655
+ .query('events')
656
+ .withIndex('target_time', q =>
657
+ q.eq('targetId', newsletterId)
658
+ .gte('timestamp', thirtyDaysAgo)
659
+ )
660
+ .collect();
661
+
662
+ return {
663
+ subscriptions: events.filter(e =>
664
+ e.type === 'newsletter_subscribed'
665
+ ).length,
666
+ unsubscriptions: events.filter(e =>
667
+ e.type === 'newsletter_unsubscribed'
668
+ ).length,
669
+ };
670
+ },
671
+ });
672
+ ```
673
+
674
+ **Advanced: Cohort Analysis**
675
+
676
+ ```typescript
677
+ // Group subscribers by signup date
678
+ const cohorts = subscribers.reduce((acc, sub) => {
679
+ const week = getWeek(sub.properties.subscribedAt);
680
+ if (!acc[week]) acc[week] = [];
681
+ acc[week].push(sub);
682
+ return acc;
683
+ }, {});
684
+
685
+ // Calculate retention for each cohort
686
+ const retention = Object.entries(cohorts).map(([week, subs]) => {
687
+ const stillActive = subs.filter(s =>
688
+ s.properties.active
689
+ ).length;
690
+
691
+ return {
692
+ week,
693
+ cohortSize: subs.length,
694
+ stillActive,
695
+ retentionRate: stillActive / subs.length,
696
+ };
697
+ });
698
+ ```
699
+
700
+ Events enable any analytics without changing schema."
701
+
702
+ **ON-SCREEN TEXT:**
703
+ Event-Driven Analytics:
704
+ - No schema changes
705
+ - Real-time metrics
706
+ - Infinite dimensions
707
+ - Cohort analysis
708
+
709
+ ### [14:00-17:00] Production Deployment
710
+
711
+ **VISUAL:** Deployment pipeline diagram
712
+
713
+ **SCRIPT:**
714
+
715
+ "Let's deploy to production.
716
+
717
+ **Step 1: Environment Setup**
718
+
719
+ ```bash
720
+ # Development
721
+ PUBLIC_FEATURES="blog,newsletter,shop"
722
+ CONVEX_URL=https://dev.convex.cloud
723
+
724
+ # Staging
725
+ PUBLIC_FEATURES="blog,newsletter,shop,courses"
726
+ CONVEX_URL=https://staging.convex.cloud
727
+
728
+ # Production
729
+ PUBLIC_FEATURES="blog,newsletter"
730
+ CONVEX_URL=https://prod.convex.cloud
731
+ ```
732
+
733
+ Different features per environment!
734
+
735
+ **Step 2: Generate Types for Production**
736
+
737
+ ```bash
738
+ # In CI/CD pipeline
739
+ PUBLIC_FEATURES=$PROD_FEATURES \
740
+ bun run generate-ontology-types.ts
741
+ ```
742
+
743
+ **Step 3: Deploy**
744
+
745
+ ```bash
746
+ # Deploy backend
747
+ cd backend && npx convex deploy
748
+
749
+ # Deploy frontend
750
+ cd web && bun run build && wrangler deploy
751
+ ```
752
+
753
+ **Step 4: Rollback (if needed)**
754
+
755
+ Convex has instant rollback:
756
+
757
+ ```bash
758
+ npx convex deploy --rollback
759
+ ```
760
+
761
+ Back to previous version in seconds.
762
+
763
+ **Step 5: Monitor**
764
+
765
+ Watch real-time metrics:
766
+ - Event throughput
767
+ - Query latency
768
+ - Error rates
769
+ - Feature usage
770
+
771
+ All built-in."
772
+
773
+ **ON-SCREEN TEXT:**
774
+ Production Checklist:
775
+ ✅ Environment config
776
+ ✅ Type generation
777
+ ✅ Deploy backend
778
+ ✅ Deploy frontend
779
+ ✅ Monitor metrics
780
+
781
+ ### [17:00-19:00] Real-World Case Study
782
+
783
+ **VISUAL:** Production dashboard screenshots
784
+
785
+ **SCRIPT:**
786
+
787
+ "Let's see this in action.
788
+
789
+ **Case Study: ONE Platform**
790
+
791
+ The ONE Platform uses this exact architecture.
792
+
793
+ Features enabled:
794
+ - blog (content publishing)
795
+ - newsletter (email marketing)
796
+ - courses (education)
797
+ - shop (e-commerce)
798
+ - tokens (creator economy)
799
+
800
+ **By the numbers:**
801
+ - 66 thing types
802
+ - 31 connection types
803
+ - 93 event types
804
+ - 1 schema migration ever (the initial one)
805
+
806
+ **Adding a new feature:**
807
+ - Write YAML: 10 minutes
808
+ - Generate types: 5 seconds
809
+ - Write mutations: 20 minutes
810
+ - Write queries: 10 minutes
811
+ - Write tests: 15 minutes
812
+ - Deploy: 1 minute
813
+
814
+ Total: ~1 hour from idea to production.
815
+
816
+ Traditional approach: 2-4 weeks.
817
+
818
+ **Metrics:**
819
+ - 98% less context for AI
820
+ - 100x faster feature development
821
+ - Zero schema migrations
822
+ - Infinite scalability
823
+
824
+ This is the power of ontology-driven development."
825
+
826
+ **ON-SCREEN STATS:**
827
+ ONE Platform:
828
+ - 66 thing types
829
+ - 31 connections
830
+ - 93 events
831
+ - 0 migrations
832
+ - 1 hour per feature
833
+
834
+ ### [19:00-20:00] Wrap-up & Next Steps
835
+
836
+ **VISUAL:** Course completion screen
837
+
838
+ **SCRIPT:**
839
+
840
+ "Congratulations! You've mastered the Multi-Ontology Architecture.
841
+
842
+ You learned:
843
+ 1. The 6-dimension foundation
844
+ 2. How to create features
845
+ 3. Advanced composition patterns
846
+ 4. Performance optimization
847
+ 5. Production deployment
848
+
849
+ **What's next?**
850
+
851
+ 1. Build your own feature
852
+ 2. Join the community
853
+ 3. Explore the documentation
854
+ 4. Deploy to production
855
+
856
+ **Resources:**
857
+ - Documentation: /one/knowledge/
858
+ - Examples: /backend/examples/
859
+ - Community: Discord link
860
+ - Support: GitHub Issues
861
+
862
+ You're ready to build the future.
863
+
864
+ Happy coding!"
865
+
866
+ **ON-SCREEN TEXT:**
867
+ You Did It! 🎉
868
+
869
+ Next Steps:
870
+ 1. Build your feature
871
+ 2. Join Discord
872
+ 3. Read docs
873
+ 4. Ship it!
874
+
875
+ ---
876
+
877
+ **END OF VIDEO SERIES**
878
+
879
+ Total Duration: ~35 minutes
880
+ - Video 1: 5 minutes (Introduction)
881
+ - Video 2: 10 minutes (First Feature)
882
+ - Video 3: 20 minutes (Advanced Patterns)
883
+
884
+ **Production Notes:**
885
+ - Use screen recording for code
886
+ - Use animations for concepts
887
+ - Add captions for accessibility
888
+ - Include timestamps in description
889
+ - Link to GitHub repos
890
+ - Provide downloadable code