oneie 3.6.26 → 3.6.28

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 (37) hide show
  1. package/.claude/agents/TROUBLESHOOTING.md +530 -0
  2. package/.claude/agents/agent-claude.md +645 -0
  3. package/.claude/agents/agent-clone.md +2 -0
  4. package/.claude/agents/agent-frontend.md +162 -21
  5. package/.claude/agents/agent-writer.md +722 -0
  6. package/.claude/commands/chat.md +504 -0
  7. package/.claude/commands/create.md +134 -18
  8. package/.claude/commands/fast.md +531 -0
  9. package/.claude/commands/one.md +79 -90
  10. package/.claude/commands/optimize.md +74 -0
  11. package/.claude/commands/plan.md +420 -373
  12. package/.claude/commands/review.md +99 -0
  13. package/.claude/commands/server.md +97 -48
  14. package/.claude/commands/start.md +182 -0
  15. package/.claude/commands/test.md +197 -0
  16. package/.claude/commands/validate.md +140 -0
  17. package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
  18. package/.claude/hooks/auto-format.sh +106 -0
  19. package/.claude/hooks/formatting.py +187 -0
  20. package/.claude/hooks/ontology-validation.py +255 -0
  21. package/.claude/hooks/validate-imports.py +182 -0
  22. package/.claude/hooks/validate-ontology.py +140 -0
  23. package/.claude/hooks/write-news.sh +194 -0
  24. package/CLAUDE.md +150 -1057
  25. package/one/knowledge/cascading-context-specification.md +1617 -0
  26. package/one/knowledge/claude-code-integration.md +1293 -0
  27. package/one/knowledge/development-commands.md +251 -0
  28. package/one/knowledge/guidelines.md +314 -0
  29. package/one/knowledge/parallel-agents.md +932 -0
  30. package/one/knowledge/performance.md +459 -0
  31. package/one/knowledge/troubleshooting.md +434 -0
  32. package/one/things/plans/dsl-claude-code.md +1011 -0
  33. package/one/things/plans/video-backend.md +638 -0
  34. package/one/things/plans/video-frontend.md +432 -0
  35. package/one/things/plans/video-old-archived.md +656 -0
  36. package/package.json +1 -1
  37. package/.claude/agents/AUDIT-agent-ops-alignment.md +0 -379
@@ -0,0 +1,1011 @@
1
+ ---
2
+ title: DSL Integration - Claude Code Ecosystem
3
+ dimension: things
4
+ category: plans
5
+ tags: dsl, claude-code, ontology, agents, commands
6
+ related_dimensions: knowledge, connections, events
7
+ scope: platform
8
+ created: 2025-11-08
9
+ updated: 2025-11-08
10
+ version: 1.0.0
11
+ status: ready
12
+ ai_context: |
13
+ This plan integrates the Plain English DSL and Technical DSL from one/knowledge/dsl.md
14
+ into the .claude/* ecosystem (agents, commands, skills, docs).
15
+ Purpose: Enable 98% AI code generation accuracy through DSL-driven development.
16
+ Execution: 18 cycles, 6 quick wins by Cycle 6, parallel execution possible.
17
+ ---
18
+
19
+ # DSL Integration Plan - Claude Code Ecosystem
20
+
21
+ **Transform .claude/* files to understand and generate DSL-driven code**
22
+
23
+ ## Executive Summary
24
+
25
+ **Objective:** Integrate the ONE Platform DSL (both Plain English and Technical syntax) into the Claude Code ecosystem (.claude/* files) to enable seamless idea → DSL → code workflow.
26
+
27
+ **Why:** The DSL is the universal language that maps reality to code. By teaching all agents and commands to "speak DSL," we achieve pattern convergence and 98% code generation accuracy.
28
+
29
+ **Scope:** 25-30 high-impact files across agents, commands, skills, and reference docs.
30
+
31
+ **Timeline:** 18 cycles (10 days with parallelization)
32
+
33
+ **Quick Win:** Cycle 6 - Core agents understand DSL and can guide users
34
+
35
+ ---
36
+
37
+ ## The Vision: English → DSL → Code → Reality
38
+
39
+ ```
40
+ ┌─────────────────────────────────────────────────────────────┐
41
+ │ User Vision (Plain English) │
42
+ │ "CREATE ai clone WITH voice cloning" │
43
+ └─────────────────────────────────────────────────────────────┘
44
+ ↓
45
+ ┌─────────────────────────────────────────────────────────────┐
46
+ │ DSL Validation (agent-director) │
47
+ │ ✓ Maps to entities (ai_clone) │
48
+ │ ✓ Uses valid services (elevenlabs) │
49
+ │ ✓ Logs events (clone_created) │
50
+ └─────────────────────────────────────────────────────────────┘
51
+ ↓
52
+ ┌─────────────────────────────────────────────────────────────┐
53
+ │ Code Generation (agent-backend) │
54
+ │ DSL → Effect.ts + Plain Convex mutations │
55
+ └─────────────────────────────────────────────────────────────┘
56
+ ↓
57
+ ┌─────────────────────────────────────────────────────────────┐
58
+ │ Reality (Production) │
59
+ │ Working AI clone deployed to edge │
60
+ └─────────────────────────────────────────────────────────────┘
61
+ ```
62
+
63
+ **Current State:** DSL defined in `one/knowledge/dsl.md` but not integrated into .claude/* workflow
64
+
65
+ **Target State:** All agents, commands, and skills speak DSL natively
66
+
67
+ ---
68
+
69
+ ## Architecture: 18-Cycle Implementation
70
+
71
+ ### Phase 1: Foundation (Cycles 1-2)
72
+
73
+ **Goal:** Audit and map DSL integration opportunities
74
+
75
+ **Cycles:**
76
+ - **Cycle 1:** Audit all .claude/* files (95+ files)
77
+ - Categorize by DSL relevance (high/medium/low)
78
+ - Identify integration points (where to add DSL examples)
79
+ - Map DSL primitives to agent capabilities
80
+ - **Output:** DSL integration map (.claude/state/dsl-integration-map.json)
81
+
82
+ - **Cycle 2:** Define DSL integration patterns
83
+ - Create DSL snippet library (common patterns)
84
+ - Define integration templates (agents vs commands vs skills)
85
+ - Establish consistency rules
86
+ - **Output:** DSL pattern library (.claude/DSL_PATTERNS.md)
87
+
88
+ **Agent:** agent-documenter (audit & analysis)
89
+
90
+ ---
91
+
92
+ ### Phase 2: Core Agents (Cycles 3-6) ⚡ QUICK WINS
93
+
94
+ **Goal:** Core agents understand and generate DSL
95
+
96
+ **Cycles:**
97
+ - **Cycle 3:** agent-director.md - Orchestration DSL
98
+ - Add "Plain English → DSL Validation" section
99
+ - Include DSL validation flow examples
100
+ - Map user intent to DSL declarations
101
+ - **Example:**
102
+ ```
103
+ User: "I want AI tutors for my courses"
104
+ Director validates:
105
+ ✓ Entity: ai_clone (type exists)
106
+ ✓ Connection: teaching (valid relationship)
107
+ ✓ Event: tutor_interaction (valid event type)
108
+ ```
109
+
110
+ - **Cycle 4:** agent-backend.md - Compilation DSL
111
+ - Add "DSL → Convex Compilation" section
112
+ - Show DSL → Effect.ts examples
113
+ - Explain Plain Convex (NO Convex Ents) output
114
+ - **Example:**
115
+ ```typescript
116
+ // DSL Input
117
+ { entity: { type: "ai_clone", name: "My Clone" } }
118
+
119
+ // Compiled Output (Plain Convex)
120
+ const cloneId = await ctx.db.insert("entities", {
121
+ type: "ai_clone",
122
+ name: "My Clone",
123
+ properties: {},
124
+ status: "active",
125
+ createdAt: Date.now(),
126
+ updatedAt: Date.now()
127
+ });
128
+ ```
129
+
130
+ - **Cycle 5:** agent-quality.md - Validation DSL
131
+ - Add "DSL Validation Patterns" section
132
+ - Define ontology compliance checks
133
+ - Add metadata pattern validation
134
+ - **Example:**
135
+ ```
136
+ Validate DSL against ontology:
137
+ 1. Entity types (66 valid types)
138
+ 2. Connection types (25 valid types)
139
+ 3. Event types (67 valid types)
140
+ 4. Metadata patterns (consolidated types)
141
+ ```
142
+
143
+ - **Cycle 6:** agent-frontend.md - Frontend-Only DSL
144
+ - Add "Frontend-Only DSL Patterns" section
145
+ - Show no-backend DSL examples
146
+ - localStorage/nanostores patterns
147
+ - **Example:**
148
+ ```typescript
149
+ // Frontend-only DSL (no backend entities)
150
+ {
151
+ flow: [
152
+ { validate: { localStorage: "products" } },
153
+ { query: { from: "localStorage", key: "cart" } },
154
+ { service: { provider: "stripe", method: "checkout" } }
155
+ ]
156
+ }
157
+ ```
158
+
159
+ **🎯 Milestone (Cycle 6):** Core agents can guide users from Plain English → DSL → Code
160
+
161
+ **Agent:** agent-documenter (documentation updates)
162
+
163
+ ---
164
+
165
+ ### Phase 3: Commands (Cycles 7-10)
166
+
167
+ **Goal:** Commands use DSL for feature generation
168
+
169
+ **Cycles:**
170
+ - **Cycle 7:** /chat.md - Vision Capture DSL
171
+ - Add "Capture Vision in Plain English DSL" section
172
+ - Map conversation → DSL primitives
173
+ - Save DSL declarations to onboarding.json
174
+ - **Example:**
175
+ ```json
176
+ {
177
+ "vision": "Course platform with AI tutors",
178
+ "dsl": {
179
+ "entities": ["course", "lesson", "ai_clone"],
180
+ "connections": ["enrolled_in", "taught_by"],
181
+ "events": ["lesson_completed", "tutor_interaction"]
182
+ }
183
+ }
184
+ ```
185
+
186
+ - **Cycle 8:** /plan.md - DSL Feature Templates
187
+ - Add "DSL Feature Declaration" section
188
+ - Generate plans with DSL snippets
189
+ - Include DSL validation in planning
190
+ - **Example:**
191
+ ```
192
+ Cycle 10: Implement AI tutor feature
193
+ DSL Template:
194
+ - Entity: ai_clone (voice + personality)
195
+ - Service: elevenlabs.cloneVoice()
196
+ - Connection: teaching (clone → course)
197
+ - Event: tutor_interaction (log conversations)
198
+ ```
199
+
200
+ - **Cycle 9:** /create.md - DSL-Based Generation
201
+ - Add "Generate from DSL Template" section
202
+ - Map feature requests to DSL patterns
203
+ - Auto-generate DSL declarations
204
+ - **Example:**
205
+ ```
206
+ /create ai-tutor
207
+
208
+ Generates DSL:
209
+ {
210
+ feature: "AITutor",
211
+ flow: [
212
+ { entity: { type: "ai_clone" } },
213
+ { service: { provider: "openai" } },
214
+ { event: { type: "tutor_interaction" } }
215
+ ]
216
+ }
217
+ ```
218
+
219
+ - **Cycle 10:** /fast.md - Rapid DSL Compilation
220
+ - Add "DSL → Code (Fast)" section
221
+ - Show instant DSL → TypeScript flow
222
+ - Minimal cycle DSL patterns
223
+ - **Example:**
224
+ ```
225
+ /fast payment-checkout
226
+
227
+ DSL → Code in 1 cycle:
228
+ 1. Validate DSL (payment service available)
229
+ 2. Compile to Convex mutation
230
+ 3. Generate frontend component
231
+ 4. Deploy
232
+ ```
233
+
234
+ **Agent:** agent-documenter (command updates)
235
+
236
+ ---
237
+
238
+ ### Phase 4: Skills (Cycles 11-14)
239
+
240
+ **Goal:** Skills use DSL for specialized operations
241
+
242
+ **Cycles:**
243
+ - **Cycle 11:** Skills/convex/* - DSL → Convex Patterns
244
+ - create-mutation.md: Add DSL input examples
245
+ - create-query.md: Add DSL query patterns
246
+ - test-function.md: Add DSL test generation
247
+ - **Files:** 5 skill files
248
+
249
+ - **Cycle 12:** Skills/ontology/* - DSL Validation Skills
250
+ - validate-schema.md: Add DSL → schema validation
251
+ - check-dimension.md: Add DSL dimension mapping
252
+ - verify-relationships.md: Add DSL connection validation
253
+ - **Files:** 5 skill files
254
+
255
+ - **Cycle 13:** Skills/testing/* - DSL Test Generation
256
+ - generate-tests.md: Add DSL → test case generation
257
+ - run-tests.md: Add DSL validation tests
258
+ - analyze-coverage.md: Add DSL coverage metrics
259
+ - **Files:** 4 skill files
260
+
261
+ - **Cycle 14:** Skills/documentation/* - DSL Documentation
262
+ - generate-api-docs.md: Add DSL API doc generation
263
+ - update-knowledge.md: Add DSL knowledge capture
264
+ - create-migration-guide.md: Add DSL migration patterns
265
+ - **Files:** 4 skill files
266
+
267
+ **Agent:** agent-documenter (skill updates)
268
+
269
+ ---
270
+
271
+ ### Phase 5: Cross-References (Cycles 15-17)
272
+
273
+ **Goal:** Centralized DSL references accessible everywhere
274
+
275
+ **Cycles:**
276
+ - **Cycle 15:** CLAUDE.md (Root) - DSL Overview
277
+ - Add "Plain English DSL" section (300 tokens)
278
+ - Link to one/knowledge/dsl.md (full spec)
279
+ - Quick examples (CREATE, CONNECT, RECORD, CALL, CHECK)
280
+ - **Location:** /CLAUDE.md
281
+
282
+ - **Cycle 16:** web/AGENTS.md - DSL Quick Reference
283
+ - Add "DSL Quick Reference" section
284
+ - Common DSL patterns for agents
285
+ - Frontend-only DSL examples
286
+ - **Location:** /web/AGENTS.md
287
+
288
+ - **Cycle 17:** .claude/DSL_QUICK_REFERENCE.md - Comprehensive Guide
289
+ - Create new reference doc (2K tokens)
290
+ - All DSL primitives explained
291
+ - Full examples library
292
+ - Validation rules
293
+ - **Location:** /.claude/DSL_QUICK_REFERENCE.md (new file)
294
+
295
+ **Agent:** agent-documenter (reference docs)
296
+
297
+ ---
298
+
299
+ ### Phase 6: Validation (Cycle 18)
300
+
301
+ **Goal:** Verify DSL integration accuracy
302
+
303
+ **Cycle:**
304
+ - **Cycle 18:** Integration Validation
305
+ - Test DSL examples in all updated files
306
+ - Verify ontology compliance
307
+ - Check cross-references consistency
308
+ - Run validation hooks
309
+ - **Output:** Validation report
310
+
311
+ **Agent:** agent-quality (validation & testing)
312
+
313
+ ---
314
+
315
+ ## File Impact Analysis
316
+
317
+ ### High Priority (Full DSL Integration) - 6 Files
318
+
319
+ **Core Agents:**
320
+ 1. `.claude/agents/agent-director.md` - Plain English → DSL validation
321
+ 2. `.claude/agents/agent-backend.md` - DSL → Convex compilation
322
+ 3. `.claude/agents/agent-quality.md` - DSL validation patterns
323
+ 4. `.claude/agents/agent-frontend.md` - Frontend-only DSL
324
+ 5. `.claude/agents/agent-ontology.md` - DSL ↔ Ontology mapping
325
+
326
+ **Core Commands:**
327
+ 6. `.claude/commands/chat.md` - Vision → DSL capture
328
+
329
+ **Impact:** These 6 files enable the complete DSL workflow
330
+
331
+ ---
332
+
333
+ ### Medium Priority (DSL Examples) - 10 Files
334
+
335
+ **Commands:**
336
+ - `.claude/commands/plan.md` - DSL feature templates
337
+ - `.claude/commands/create.md` - DSL-based generation
338
+ - `.claude/commands/fast.md` - Rapid DSL compilation
339
+
340
+ **Skills (Convex):**
341
+ - `.claude/skills/convex/create-mutation.md`
342
+ - `.claude/skills/convex/create-query.md`
343
+ - `.claude/skills/convex/test-function.md`
344
+
345
+ **Skills (Ontology):**
346
+ - `.claude/skills/ontology/validate-schema.md`
347
+ - `.claude/skills/ontology/check-dimension.md`
348
+ - `.claude/skills/ontology/verify-relationships.md`
349
+
350
+ **Skills (Testing):**
351
+ - `.claude/skills/testing/generate-tests.md`
352
+
353
+ **Impact:** Add DSL examples and patterns to specialized operations
354
+
355
+ ---
356
+
357
+ ### Low Priority (DSL References) - 12 Files
358
+
359
+ **Reference Docs:**
360
+ - `/CLAUDE.md` - High-level DSL overview
361
+ - `/web/AGENTS.md` - DSL quick reference
362
+ - `/.claude/DSL_QUICK_REFERENCE.md` - Comprehensive guide (NEW)
363
+
364
+ **Skills (Documentation):**
365
+ - `.claude/skills/documentation/generate-api-docs.md`
366
+ - `.claude/skills/documentation/update-knowledge.md`
367
+ - `.claude/skills/documentation/create-migration-guide.md`
368
+
369
+ **Other Agents:**
370
+ - `.claude/agents/agent-documenter.md` - How to document DSL
371
+ - `.claude/agents/agent-integrator.md` - DSL protocol integration
372
+ - `.claude/agents/agent-designer.md` - DSL → UI specs
373
+ - `.claude/agents/agent-builder.md` - DSL rapid building
374
+ - `.claude/agents/agent-sales.md` - DSL for demos
375
+ - `.claude/agents/agent-clone.md` - DSL migration patterns
376
+
377
+ **Impact:** Context and references for comprehensive DSL understanding
378
+
379
+ ---
380
+
381
+ ### Not Needed (No DSL) - ~65 Files
382
+
383
+ **Excluded Categories:**
384
+ - Deployment scripts (push.md, release.md, deploy.md)
385
+ - Server management (server.md, mcp-on.md)
386
+ - Git workflows (commit.md)
387
+ - Hooks (validation scripts, formatters)
388
+ - MCP configuration
389
+ - Most specialized skills (Astro, design, sales KPIs)
390
+
391
+ **Reason:** These files are operational/infrastructure, not feature development
392
+
393
+ ---
394
+
395
+ ## DSL Integration Patterns
396
+
397
+ ### Pattern 1: Plain English DSL (User-Facing)
398
+
399
+ **Used in:** /chat.md, agent-director.md
400
+
401
+ **Example:**
402
+ ```
403
+ User: "CREATE ai clone WITH voice from my videos"
404
+
405
+ Maps to DSL:
406
+ - CREATE → Entity declaration
407
+ - ai clone → type: "ai_clone"
408
+ - WITH voice → Service: elevenlabs.cloneVoice()
409
+ - from my videos → Input: videoUrls
410
+ ```
411
+
412
+ **Implementation:**
413
+ ```markdown
414
+ ## Plain English DSL Capture
415
+
416
+ When user describes features in natural language, map to DSL primitives:
417
+
418
+ | User Says | DSL Primitive | Example |
419
+ |-----------|---------------|---------|
420
+ | "CREATE X" | entity | `{ type: "ai_clone" }` |
421
+ | "CONNECT X to Y" | connect | `{ from: X, to: Y, type: "owns" }` |
422
+ | "RECORD X event" | event | `{ type: "clone_created" }` |
423
+ | "CALL X service" | service | `{ provider: "elevenlabs" }` |
424
+ | "CHECK X condition" | validate | `{ exists: true, type: "creator" }` |
425
+ ```
426
+
427
+ ---
428
+
429
+ ### Pattern 2: Technical DSL (Agent-Facing)
430
+
431
+ **Used in:** agent-backend.md, agent-quality.md
432
+
433
+ **Example:**
434
+ ```typescript
435
+ // Feature: Create AI Clone
436
+ const createAICloneDSL = {
437
+ feature: "CreateAIClone",
438
+ input: {
439
+ creatorId: "Id<entities>",
440
+ videoUrls: "string[]"
441
+ },
442
+ flow: [
443
+ {
444
+ service: {
445
+ provider: "elevenlabs",
446
+ method: "cloneVoice",
447
+ params: { samples: "$audioSamples" },
448
+ output: "voiceId"
449
+ }
450
+ },
451
+ {
452
+ entity: {
453
+ type: "ai_clone",
454
+ name: "$creator.name + ' Clone'",
455
+ properties: { voiceId: "$voiceId" }
456
+ }
457
+ }
458
+ ]
459
+ };
460
+ ```
461
+
462
+ **Implementation:**
463
+ ```markdown
464
+ ## DSL → Convex Compilation
465
+
466
+ The ONE DSL compiles to Plain Convex (NO Convex Ents):
467
+
468
+ ### DSL Input
469
+ \`\`\`typescript
470
+ { entity: { type: "ai_clone", properties: { voiceId } } }
471
+ \`\`\`
472
+
473
+ ### Compiled Output
474
+ \`\`\`typescript
475
+ const cloneId = await ctx.db.insert("entities", {
476
+ type: "ai_clone",
477
+ properties: { voiceId },
478
+ status: "active",
479
+ createdAt: Date.now(),
480
+ updatedAt: Date.now()
481
+ });
482
+ \`\`\`
483
+ ```
484
+
485
+ ---
486
+
487
+ ### Pattern 3: DSL Validation (Quality Assurance)
488
+
489
+ **Used in:** agent-quality.md, skills/ontology/*
490
+
491
+ **Example:**
492
+ ```typescript
493
+ // Validate DSL against ontology
494
+ const validator = new ONEValidator(FULL_ONTOLOGY);
495
+ const result = validator.validate(myFeatureDSL);
496
+
497
+ if (!result.valid) {
498
+ console.error("DSL validation failed:", result.errors);
499
+ // Invalid entity type: "ai_tutor" (should be "ai_clone")
500
+ // Invalid connection type: "teaches" (should be "teaching")
501
+ }
502
+ ```
503
+
504
+ **Implementation:**
505
+ ```markdown
506
+ ## DSL Validation Patterns
507
+
508
+ Before code generation, validate DSL against ontology:
509
+
510
+ **Entity Types (66 valid):**
511
+ - creator, ai_clone, token, course, lesson, etc.
512
+
513
+ **Connection Types (25 valid):**
514
+ - owns, teaching, enrolled_in, holds_tokens, etc.
515
+
516
+ **Event Types (67 valid):**
517
+ - clone_created, tokens_purchased, lesson_completed, etc.
518
+
519
+ **Metadata Patterns (consolidated types):**
520
+ - payment: metadata.paymentType (subscription|purchase|tip)
521
+ - livestream: metadata.livestreamType (hosted|attended)
522
+ - notification: metadata.notificationType (sent|received)
523
+ ```
524
+
525
+ ---
526
+
527
+ ### Pattern 4: Frontend-Only DSL
528
+
529
+ **Used in:** agent-frontend.md, /fast.md
530
+
531
+ **Example:**
532
+ ```typescript
533
+ // No backend entities, pure frontend
534
+ const checkoutFlowDSL = {
535
+ feature: "ProductCheckout",
536
+ frontend_only: true,
537
+ flow: [
538
+ { query: { from: "localStorage", key: "cart" } },
539
+ { service: { provider: "stripe", method: "createCheckout" } },
540
+ { navigate: "/success" }
541
+ ]
542
+ };
543
+ ```
544
+
545
+ **Implementation:**
546
+ ```markdown
547
+ ## Frontend-Only DSL Patterns
548
+
549
+ When backend is not needed, use client-side DSL:
550
+
551
+ **Storage:**
552
+ \`\`\`typescript
553
+ { query: { from: "localStorage", key: "cart" } }
554
+ { update: { target: "localStorage", key: "user", value: "$user" } }
555
+ \`\`\`
556
+
557
+ **Third-Party Services:**
558
+ \`\`\`typescript
559
+ { service: { provider: "stripe", method: "createCheckout" } }
560
+ { service: { provider: "openai", method: "chat", client: true } }
561
+ \`\`\`
562
+
563
+ **State Management (nanostores):**
564
+ \`\`\`typescript
565
+ { atom: { name: "cartItems", initial: [] } }
566
+ { computed: { name: "cartTotal", from: "$cartItems" } }
567
+ \`\`\`
568
+ ```
569
+
570
+ ---
571
+
572
+ ## Key DSL Concepts (Reference)
573
+
574
+ From `one/knowledge/dsl.md`:
575
+
576
+ ### 5 Core Primitives
577
+
578
+ 1. **CREATE** - Add typed entities
579
+ ```
580
+ entity: { type: "ai_clone", name: "My Clone", properties: {...} }
581
+ ```
582
+
583
+ 2. **CONNECT** - Define relationships
584
+ ```
585
+ connect: { from: "$creatorId", to: "$cloneId", type: "owns" }
586
+ ```
587
+
588
+ 3. **RECORD** - Log events
589
+ ```
590
+ event: { type: "clone_created", actor: "$creatorId", metadata: {...} }
591
+ ```
592
+
593
+ 4. **CALL** - Invoke services
594
+ ```
595
+ service: { provider: "elevenlabs", method: "cloneVoice", params: {...} }
596
+ ```
597
+
598
+ 5. **CHECK** - Validate conditions
599
+ ```
600
+ validate: { creatorId: { exists: true, type: "creator" } }
601
+ ```
602
+
603
+ ### Ontology Types
604
+
605
+ **66 Entity Types** (things)
606
+ **25 Connection Types** (18 specific + 7 consolidated)
607
+ **67 Event Types** (24 specific + 11 consolidated)
608
+
609
+ ### Compilation Target
610
+
611
+ **Plain Convex (NO Convex Ents):**
612
+ - Uses `ctx.db.insert()`, `ctx.db.query()`, `ctx.db.patch()`
613
+ - No `ent()` or `edge()` definitions
614
+ - Metadata field stores type-specific data
615
+ - Simpler, more explicit, better for AI
616
+
617
+ ---
618
+
619
+ ## Parallel Execution Strategy
620
+
621
+ ### Stream 1: Agents (Cycles 3-6) + Commands (Cycles 7-10)
622
+
623
+ **Why parallel:** Independent documentation updates
624
+
625
+ **Agent 1:** agent-documenter updates agents
626
+ **Agent 2:** agent-documenter updates commands
627
+
628
+ **Duration:** 4 cycles instead of 8
629
+
630
+ ---
631
+
632
+ ### Stream 2: Skills (Cycles 11-14) + Cross-Refs (Cycles 15-17)
633
+
634
+ **Why parallel:** Different file types
635
+
636
+ **Agent 1:** agent-documenter updates skills
637
+ **Agent 2:** agent-documenter creates reference docs
638
+
639
+ **Duration:** 4 cycles instead of 7
640
+
641
+ ---
642
+
643
+ ### Total Timeline
644
+
645
+ **Sequential:** 18 cycles (18 days)
646
+ **Parallel:** 10 cycles (10 days)
647
+ **Savings:** 44% faster with 2 parallel streams
648
+
649
+ ---
650
+
651
+ ## Expected Outcomes
652
+
653
+ ### Immediate (Cycle 6)
654
+
655
+ ✅ Core agents speak DSL natively
656
+ ✅ /chat captures vision in DSL format
657
+ ✅ agent-director validates DSL against ontology
658
+ ✅ agent-backend compiles DSL → TypeScript
659
+
660
+ ### Medium-Term (Cycle 12)
661
+
662
+ ✅ All commands use DSL templates
663
+ ✅ Skills generate DSL-compliant code
664
+ ✅ Quality validates DSL automatically
665
+
666
+ ### Long-Term (Cycle 18)
667
+
668
+ ✅ Complete DSL integration across .claude/*
669
+ ✅ Pattern convergence (98% accuracy)
670
+ ✅ Unified language: English → DSL → Code → Reality
671
+
672
+ ---
673
+
674
+ ## Success Metrics
675
+
676
+ **Accuracy:**
677
+ - Before: 85% code generation accuracy (learning patterns)
678
+ - After: 98% code generation accuracy (DSL convergence)
679
+
680
+ **Efficiency:**
681
+ - Before: 150K tokens per feature (full context)
682
+ - After: 3K tokens per feature (DSL-driven)
683
+
684
+ **Consistency:**
685
+ - Before: 100 framework-specific patterns
686
+ - After: 1 universal DSL language
687
+
688
+ **Developer Experience:**
689
+ - Before: "Learn React, Convex, Effect.ts, Astro..."
690
+ - After: "Speak Plain English, system validates & generates"
691
+
692
+ ---
693
+
694
+ ## Risk Mitigation
695
+
696
+ ### Risk 1: Over-Abstraction
697
+
698
+ **Risk:** DSL becomes too abstract, loses expressiveness
699
+
700
+ **Mitigation:**
701
+ - Keep Plain English DSL simple (5 commands)
702
+ - Technical DSL stays explicit (TypeScript-like)
703
+ - Always show compiled output examples
704
+ - Provide escape hatch (write raw Convex code)
705
+
706
+ ### Risk 2: Learning Curve
707
+
708
+ **Risk:** Users confused by DSL syntax
709
+
710
+ **Mitigation:**
711
+ - /chat captures intent in natural language
712
+ - System translates to DSL automatically
713
+ - Show DSL → Code mapping transparently
714
+ - Provide visual DSL builder (future)
715
+
716
+ ### Risk 3: Documentation Drift
717
+
718
+ **Risk:** DSL examples get out of sync with implementation
719
+
720
+ **Mitigation:**
721
+ - agent-quality validates DSL in docs
722
+ - Automated tests check DSL compilation
723
+ - Version DSL spec (currently 1.0.0)
724
+ - Track breaking changes explicitly
725
+
726
+ ---
727
+
728
+ ## Maintenance Plan
729
+
730
+ ### After Launch
731
+
732
+ **Monthly:**
733
+ - Review DSL usage analytics
734
+ - Update examples based on common patterns
735
+ - Refine Plain English DSL vocabulary
736
+
737
+ **Quarterly:**
738
+ - Audit DSL integration completeness
739
+ - Add new DSL primitives if needed
740
+ - Update ontology type counts
741
+
742
+ **Yearly:**
743
+ - Major DSL version update (1.0 → 2.0)
744
+ - Platform-wide DSL migration
745
+ - Publish DSL evolution insights
746
+
747
+ ---
748
+
749
+ ## References
750
+
751
+ **Primary Source:**
752
+ - `one/knowledge/dsl.md` - Complete DSL specification (1600+ lines)
753
+
754
+ **Related Plans:**
755
+ - `one/things/plans/ontology-6-dimensions.md` - 6D ontology migration
756
+ - `one/knowledge/architecture.md` - Platform architecture
757
+ - `one/connections/workflow.md` - Development workflow
758
+
759
+ **Agent Definitions:**
760
+ - `.claude/agents/agent-director.md` - Orchestration
761
+ - `.claude/agents/agent-backend.md` - Code generation
762
+ - `.claude/agents/agent-quality.md` - Validation
763
+
764
+ ---
765
+
766
+ ## Execution Checklist
767
+
768
+ ### Pre-Flight
769
+ - [ ] Read `one/knowledge/dsl.md` completely
770
+ - [ ] Understand 6-dimension ontology
771
+ - [ ] Review .claude/* file structure
772
+ - [ ] Identify high-priority targets
773
+
774
+ ### Phase 1 (Cycles 1-2)
775
+ - [ ] Audit all 95+ .claude/* files
776
+ - [ ] Create DSL integration map
777
+ - [ ] Define DSL snippet library
778
+ - [ ] Establish consistency rules
779
+
780
+ ### Phase 2 (Cycles 3-6) ⚡ QUICK WINS
781
+ - [ ] Update agent-director.md
782
+ - [ ] Update agent-backend.md
783
+ - [ ] Update agent-quality.md
784
+ - [ ] Update agent-frontend.md
785
+ - [ ] **Milestone:** Core agents speak DSL
786
+
787
+ ### Phase 3 (Cycles 7-10)
788
+ - [ ] Update /chat.md
789
+ - [ ] Update /plan.md
790
+ - [ ] Update /create.md
791
+ - [ ] Update /fast.md
792
+
793
+ ### Phase 4 (Cycles 11-14)
794
+ - [ ] Update skills/convex/* (5 files)
795
+ - [ ] Update skills/ontology/* (5 files)
796
+ - [ ] Update skills/testing/* (4 files)
797
+ - [ ] Update skills/documentation/* (4 files)
798
+
799
+ ### Phase 5 (Cycles 15-17)
800
+ - [ ] Update CLAUDE.md
801
+ - [ ] Update web/AGENTS.md
802
+ - [ ] Create .claude/DSL_QUICK_REFERENCE.md
803
+
804
+ ### Phase 6 (Cycle 18)
805
+ - [ ] Validate all DSL examples
806
+ - [ ] Test DSL compilation
807
+ - [ ] Check cross-references
808
+ - [ ] Generate validation report
809
+
810
+ ### Post-Launch
811
+ - [ ] Monitor DSL usage
812
+ - [ ] Collect feedback
813
+ - [ ] Document lessons learned
814
+ - [ ] Plan DSL v2.0 features
815
+
816
+ ---
817
+
818
+ ## Appendix A: DSL Snippet Library
819
+
820
+ ### Common Entity Declarations
821
+
822
+ ```typescript
823
+ // AI Clone
824
+ { entity: { type: "ai_clone", properties: { voiceId, systemPrompt } } }
825
+
826
+ // Token
827
+ { entity: { type: "token", properties: { symbol, supply, price } } }
828
+
829
+ // Course
830
+ { entity: { type: "course", properties: { title, description, lessons } } }
831
+
832
+ // User
833
+ { entity: { type: "creator", properties: { email, name, role: "org_owner" } } }
834
+ ```
835
+
836
+ ### Common Connections
837
+
838
+ ```typescript
839
+ // Ownership
840
+ { connect: { from: "$userId", to: "$assetId", type: "owns" } }
841
+
842
+ // Enrollment
843
+ { connect: { from: "$userId", to: "$courseId", type: "enrolled_in" } }
844
+
845
+ // Teaching
846
+ { connect: { from: "$cloneId", to: "$courseId", type: "teaching" } }
847
+
848
+ // Token Holding
849
+ { connect: { from: "$userId", to: "$tokenId", type: "holds_tokens",
850
+ metadata: { balance: 1000 } } }
851
+ ```
852
+
853
+ ### Common Events
854
+
855
+ ```typescript
856
+ // Creation
857
+ { event: { type: "entity_created", actor: "$userId", entity: "$entityId" } }
858
+
859
+ // Purchase
860
+ { event: { type: "tokens_purchased", actor: "$userId",
861
+ metadata: { amount: 1000, usdAmount: 100 } } }
862
+
863
+ // Completion
864
+ { event: { type: "lesson_completed", actor: "$studentId",
865
+ metadata: { courseId, lessonId, score: 95 } } }
866
+ ```
867
+
868
+ ### Common Services
869
+
870
+ ```typescript
871
+ // OpenAI
872
+ { service: { provider: "openai", method: "chat",
873
+ params: { model: "gpt-4", messages: [] } } }
874
+
875
+ // ElevenLabs
876
+ { service: { provider: "elevenlabs", method: "cloneVoice",
877
+ params: { samples: [] } } }
878
+
879
+ // Stripe
880
+ { service: { provider: "stripe", method: "charge",
881
+ params: { amount: 10000, currency: "usd" } } }
882
+
883
+ // Blockchain
884
+ { service: { provider: "blockchain", method: "mint",
885
+ params: { contractAddress, amount } } }
886
+ ```
887
+
888
+ ---
889
+
890
+ ## Appendix B: File-by-File Breakdown
891
+
892
+ ### Agents (6 files)
893
+
894
+ 1. **agent-director.md** (High Priority)
895
+ - Add: Plain English → DSL validation flow
896
+ - Add: DSL orchestration examples
897
+ - Add: Ontology mapping table
898
+
899
+ 2. **agent-backend.md** (High Priority)
900
+ - Add: DSL → Convex compilation section
901
+ - Add: Plain Convex examples (NO Ents)
902
+ - Add: Effect.ts integration patterns
903
+
904
+ 3. **agent-quality.md** (High Priority)
905
+ - Add: DSL validation patterns
906
+ - Add: Ontology compliance checks
907
+ - Add: Metadata validation rules
908
+
909
+ 4. **agent-frontend.md** (High Priority)
910
+ - Add: Frontend-only DSL patterns
911
+ - Add: No-backend examples
912
+ - Add: Client-side state management DSL
913
+
914
+ 5. **agent-ontology.md** (Medium Priority)
915
+ - Add: DSL ↔ Ontology mapping
916
+ - Add: Type definitions reference
917
+ - Add: Metadata patterns guide
918
+
919
+ 6. **agent-documenter.md** (Low Priority)
920
+ - Add: How to document DSL features
921
+ - Add: DSL example formatting
922
+ - Add: Knowledge capture for DSL
923
+
924
+ ### Commands (4 files)
925
+
926
+ 7. **chat.md** (High Priority)
927
+ - Add: Vision → DSL capture section
928
+ - Add: Plain English DSL examples
929
+ - Add: Save DSL to onboarding.json
930
+
931
+ 8. **plan.md** (Medium Priority)
932
+ - Add: DSL feature declaration templates
933
+ - Add: DSL validation in planning
934
+ - Add: DSL snippet generation
935
+
936
+ 9. **create.md** (Medium Priority)
937
+ - Add: DSL-based feature generation
938
+ - Add: Template selection by DSL pattern
939
+ - Add: Auto-generate DSL from request
940
+
941
+ 10. **fast.md** (Medium Priority)
942
+ - Add: Rapid DSL → code flow
943
+ - Add: Minimal cycle DSL patterns
944
+ - Add: Quick compilation examples
945
+
946
+ ### Skills (18 files)
947
+
948
+ **Convex (5 files):**
949
+ 11. create-mutation.md
950
+ 12. create-query.md
951
+ 13. test-function.md
952
+ 14. read-schema.md
953
+ 15. check-deployment.md
954
+
955
+ **Ontology (5 files):**
956
+ 16. validate-schema.md
957
+ 17. check-dimension.md
958
+ 18. verify-relationships.md
959
+ 19. generate-entity-type.md
960
+ 20. README.md
961
+
962
+ **Testing (4 files):**
963
+ 21. generate-tests.md
964
+ 22. run-tests.md
965
+ 23. validate-e2e.md
966
+ 24. analyze-coverage.md
967
+
968
+ **Documentation (4 files):**
969
+ 25. generate-api-docs.md
970
+ 26. update-knowledge.md
971
+ 27. create-migration-guide.md
972
+ 28. generate-readme.md
973
+
974
+ ### Reference Docs (3 files)
975
+
976
+ 29. **CLAUDE.md** (Root)
977
+ - Add: Plain English DSL overview (300 tokens)
978
+ - Add: Link to full spec
979
+ - Add: Quick examples
980
+
981
+ 30. **web/AGENTS.md**
982
+ - Add: DSL quick reference for agents
983
+ - Add: Common DSL patterns
984
+ - Add: Frontend-only DSL examples
985
+
986
+ 31. **.claude/DSL_QUICK_REFERENCE.md** (NEW)
987
+ - Create: Comprehensive DSL guide
988
+ - Include: All primitives explained
989
+ - Include: Full examples library
990
+ - Include: Validation rules
991
+
992
+ ---
993
+
994
+ ## Version History
995
+
996
+ **v1.0.0** (2025-11-08)
997
+ - Initial plan created
998
+ - 18-cycle implementation defined
999
+ - File impact analysis complete
1000
+ - Integration patterns documented
1001
+
1002
+ ---
1003
+
1004
+ ## Next Actions
1005
+
1006
+ 1. **Review this plan:** Validate approach with team
1007
+ 2. **Execute Cycle 1:** Audit .claude/* files
1008
+ 3. **Create integration map:** Define specific changes per file
1009
+ 4. **Begin Phase 2:** Start agent updates (quick wins)
1010
+
1011
+ **Ready to execute?** Type `/now` to begin Cycle 1.