oneie 3.6.27 → 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.
package/CLAUDE.md CHANGED
@@ -20,537 +20,103 @@ If you are about to run a command that could lose work, destroy commits, or over
20
20
  **You are reading the ROOT context file.** As you navigate deeper into the codebase, read directory-specific CLAUDE.md files:
21
21
 
22
22
  ```
23
- /CLAUDE.md (this file - global)
23
+ /CLAUDE.md (this file - global orchestration)
24
24
  ↓ Navigate to subdirectory
25
- /backend/CLAUDE.md (backend-specific, takes precedence in backend/)
25
+ /web/CLAUDE.md (frontend-specific, higher precedence in web/)
26
26
  ↓ Navigate deeper
27
- /backend/convex/CLAUDE.md (Convex-specific, highest precedence in convex/)
27
+ /web/src/components/CLAUDE.md (component-specific, highest precedence)
28
+ ↓ Or navigate to backend
29
+ /backend/CLAUDE.md (backend-specific, higher precedence in backend/)
30
+ ↓ Navigate deeper
31
+ /backend/convex/CLAUDE.md (database-specific, highest precedence in backend/)
28
32
  ```
29
33
 
30
34
  **Precedence rule:** Closer to the file you're editing = higher precedence.
31
35
 
32
- ### Parallel Agent Execution
33
-
34
- **CRITICAL:** When tasks can be done independently, spawn agents in PARALLEL (not sequentially).
35
-
36
- **Send a SINGLE message with multiple Task tool calls** to execute agents concurrently:
37
-
38
- - Frontend + Backend agents working simultaneously
39
- - Multiple feature agents in parallel
40
- - Documentation + Implementation at the same time
41
-
42
- **Example:** If you need to create web/CLAUDE.md and backend/CLAUDE.md, spawn both agent-frontend and agent-backend in ONE message (not two sequential messages).
43
-
44
- **Result:** 2-5x faster execution through parallelization.
36
+ **Parallel Agent Execution:** When tasks can be done independently, spawn agents in PARALLEL (not sequentially). Send a SINGLE message with multiple Task tool calls to execute agents concurrently for 2-5x faster execution.
45
37
 
46
38
  ---
47
39
 
48
40
  ## Architecture Overview
49
41
 
50
- **ONE Platform** is a multi-tenant AI-native platform built on a **6-dimension ontology** that models reality itself (not just data).
51
-
52
- **Every single thing in ONE platform exists within one of these 6 dimensions:**
53
-
54
- ```
55
- ┌──────────────────────────────────────────────────────────────┐
56
- │ 1. GROUPS │
57
- │ Multi-tenant isolation with hierarchical nesting - who owns │
58
- │ what at group level (friend circles → DAOs → governments) │
59
- └──────────────────────────────────────────────────────────────┘
60
- ↓
61
- ┌──────────────────────────────────────────────────────────────┐
62
- │ 2. PEOPLE │
63
- │ Authorization & governance - platform owner, group owners │
64
- └──────────────────────────────────────────────────────────────┘
65
- ↓
66
- ┌──────────────────────────────────────────────────────────────┐
67
- │ 3. THINGS │
68
- │ Every "thing" - users, agents, content, tokens, courses │
69
- └──────────────────────────────────────────────────────────────┘
70
- ↓
71
- ┌──────────────────────────────────────────────────────────────┐
72
- │ 4. CONNECTIONS │
73
- │ Every relationship - owns, follows, taught_by, powers │
74
- └──────────────────────────────────────────────────────────────┘
75
- ↓
76
- ┌──────────────────────────────────────────────────────────────┐
77
- │ 5. EVENTS │
78
- │ Every action - purchased, created, viewed, completed │
79
- └──────────────────────────────────────────────────────────────┘
80
- ↓
81
- ┌──────────────────────────────────────────────────────────────┐
82
- │ 6. KNOWLEDGE │
83
- │ Labels + chunks + vectors powering RAG & search │
84
- └──────────────────────────────────────────────────────────────┘
85
- ```
86
-
87
- **The architecture separates concerns into three layers:**
42
+ **ONE Platform** is a multi-tenant AI-native platform built on a **6-dimension ontology** that models reality itself.
88
43
 
89
44
  ```
90
45
  Web (Astro + React) → Backend (Convex) → 6-Dimension Ontology
91
46
  ```
92
47
 
93
- **Why this architecture enables 98% AI code generation accuracy:** Each feature maps to the SAME 6 dimensions. Patterns converge (not diverge). Accuracy compounds over time (85% → 98%), not degrades (95% → 30%).
94
-
95
48
  **Key Repositories:**
49
+ - `/web` - Frontend (Astro 5, React 19, Tailwind v4) - see `web/CLAUDE.md`
50
+ - `/backend` - Backend (Convex, Effect.ts, Better Auth) - see `backend/CLAUDE.md`
51
+ - `/one` - Documentation (41 files, 8 layers organized by 6 dimensions)
52
+ - `/.claude` - Agent definitions & commands
53
+ - `/apps` - Example applications
96
54
 
97
- - `/web` - Main web application (Astro 5, React 19, Tailwind v4)
98
- - `/backend` - Headless Convex backend (6-dimension ontology, auth, real-time)
99
- - `/apps` - Example applications and integrations
100
- - `/one` - Comprehensive platform documentation (41 files, 8 layers)
101
-
102
- ## Planning Paradigm: Cycle-Based Execution
103
-
104
- **CRITICAL:** We don't plan in days. We plan in **cycle passes** (Cycle 1-100).
105
-
106
- ### Why Cycle-Based Planning?
107
-
108
- Traditional planning uses time estimates ("Day 1-3", "Week 2"), which are:
109
- - Inaccurate (time varies wildly)
110
- - Context-heavy (requires re-planning)
111
- - Sequential (blocks parallel work)
112
-
113
- Cycle-based planning uses **sequence positions** ("Cycle 1-100"), which are:
114
- - Precise (each cycle is a concrete step)
115
- - Context-light (< 3000 tokens per cycle)
116
- - Parallel-friendly (cycles can run concurrently when dependencies allow)
55
+ **Read full architecture:** `/one/knowledge/architecture.md`
117
56
 
118
- ### The 100-Cycle Template
119
-
120
- Every feature follows a **100-cycle sequence** (see `one/knowledge/todo.md`):
121
-
122
- ```
123
- Cycle 1-10: Foundation & Setup (validate, map, plan)
124
- Cycle 11-20: Backend Schema & Services (database, business logic)
125
- Cycle 21-30: Frontend Pages & Components (UI, interactions)
126
- Cycle 31-40: Integration & Connections (external systems)
127
- Cycle 41-50: Authentication & Authorization (security)
128
- Cycle 51-60: Knowledge & RAG (embeddings, search)
129
- Cycle 61-70: Quality & Testing (unit, integration, e2e)
130
- Cycle 71-80: Design & Wireframes (UI/UX, accessibility)
131
- Cycle 81-90: Performance & Optimization (speed, efficiency)
132
- Cycle 91-100: Deployment & Documentation (production, guides)
133
- ```
57
+ ---
134
58
 
135
- ### How to Use Cycle Planning
59
+ ## The 6-Dimension Ontology
136
60
 
137
- 1. **Start with the sequence:** Read `one/knowledge/todo.md` to understand the flow
138
- 2. **Do the next thing:** Execute the next cycle in sequence
139
- 3. **Use hooks for context:**
140
- - `.claude/hooks/todo` loads current cycle context automatically
141
- - `.claude/hooks/done` marks complete and advances to next
142
- 4. **Adapt as needed:** Skip irrelevant cycles, add extras for complex features
143
- 5. **Run in parallel:** Execute independent cycles concurrently (e.g., Backend + Frontend after schema defined)
61
+ **Read canonical specification:** `/one/knowledge/ontology.md` (Version 1.0.0)
144
62
 
145
- ### Commands for Cycle Workflow
63
+ **Quick Reference:**
64
+ 1. **GROUPS** → Multi-tenant containers (groupId scoping, infinite nesting)
65
+ 2. **PEOPLE** → Authorization & roles (4 roles: platform_owner, org_owner, org_user, customer)
66
+ 3. **THINGS** → All entities (66+ types: users, agents, content, tokens, courses)
67
+ 4. **CONNECTIONS** → All relationships (25+ types: owns, follows, purchased, holds_tokens)
68
+ 5. **EVENTS** → Complete audit trail (67+ types: created, updated, purchased, completed)
69
+ 6. **KNOWLEDGE** → Labels + vectors (RAG, search, categorization)
146
70
 
147
- ```
148
- ██████╗ ███╗ ██╗███████╗
149
- ██╔═══██╗████╗ ██║██╔════╝
150
- ██║ ██║██╔██╗ ██║█████╗
151
- ██║ ██║██║╚██╗██║██╔══╝
152
- ╚██████╔╝██║ ╚████║███████╗
153
- ╚═════╝ ╚═╝ ╚═══╝╚══════╝
71
+ **Golden Rule:** If you can't map a feature to these 6 dimensions, you're thinking about it wrong.
154
72
 
155
- Make Your Ideas Real
73
+ **Implementation:** 5 database tables (groups, things, connections, events, knowledge) implement the 6 dimensions. People are represented as things with `type: 'creator'`.
156
74
 
157
- https://one.ie • npx oneie
75
+ ---
158
76
 
159
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
160
- /now /next /todo /done
161
- /build /design /deploy /see
162
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
163
- ```
77
+ ## Cycle-Based Planning
164
78
 
165
- **Workflow Commands:**
166
- - `/now` - Display current cycle and what you're working on
167
- - `/next` - Advance to next cycle and load context
168
- - `/todo` - View complete task list (100-cycle sequence)
169
- - `/done` - Mark current cycle complete and advance
79
+ **We plan in cycles (1-100), not days.** Each cycle = concrete step, < 3k tokens.
170
80
 
171
- **Creation Commands:**
81
+ **Commands:**
82
+ - `/now` - Display current cycle
83
+ - `/next` - Advance to next cycle
84
+ - `/todo` - View 100-cycle sequence
85
+ - `/done` - Mark complete and advance
172
86
  - `/build` - Build features with AI specialists
173
87
  - `/design` - Create wireframes & UI components
174
88
  - `/deploy` - Ship to production
175
89
 
176
- **Insight Commands:**
177
- - `/see` - View analytics, refine vision, explore courses
178
-
179
- ### Benefits
180
-
181
- - **98% context reduction:** 150k tokens → 3k tokens per cycle
182
- - **5x faster execution:** 115s → 20s per feature average
183
- - **Flawless execution:** "Do the next thing, perfectly"
184
- - **Continuous learning:** Lessons captured after each cycle
185
- - **Parallel execution:** Multiple cycles running concurrently
186
-
187
- **Golden Rule:** Plan in cycles, not days. Where in the sequence does each thing belong?
188
-
189
- ## The 6-Dimension Ontology (Core Data Model)
190
-
191
- **CRITICAL:** Every feature MUST map to these 6 dimensions. If it doesn't, rethink your approach.
192
-
193
- ### 1. groups
194
-
195
- Hierarchical containers for collaboration - who belongs where and at what level
196
-
197
- - **Infinite nesting:** Groups can contain groups (parent → child → grandchild...)
198
- - **6 group types:** friend_circle, business, community, dao, government, organization
199
- - **Data scoping:** All dimensions (things, connections, events, knowledge) scoped to groupId
200
- - **Flexible scale:** From friend circles (2 people) to governments (billions of people)
201
- - **Multi-tenancy:** Each group has independent data, billing, quotas, and customization
202
- - **Hierarchical access:** Parent groups can access child group data (configurable)
203
- - **Plans:** starter, pro, enterprise (at organization level)
204
-
205
- ### 2. people
206
-
207
- Authorization & governance - who can do what
208
-
209
- - **4 roles**: platform_owner, org_owner, org_user, customer
210
- - Represented as things with `type: 'creator'` and `properties.role`
211
- - Every action has an actor (person)
212
-
213
- ### 3. things (entities table)
214
-
215
- All nouns in the system - users, agents, content, tokens, courses
216
-
217
- - **66+ entity types** defined in schema
218
- - Flexible `properties` field for type-specific data
219
- - Status lifecycle: draft → active → published → archived
220
- - Every thing belongs to a group (scoped via groupId)
221
-
222
- ### 4. connections
223
-
224
- All relationships between entities
225
-
226
- - **25+ connection types**: owns, authored, holds_tokens, enrolled_in, etc.
227
- - **7 consolidated types** with rich metadata: transacted, communicated, delegated, etc.
228
- - Bidirectional with temporal validity (validFrom/validTo)
229
- - Scoped to groups (via groupId)
230
-
231
- ### 5. events
232
-
233
- All actions and state changes over time
234
-
235
- - **67+ event types** including cycle and blockchain events
236
- - Complete audit trail with actor (person), target (thing), timestamp
237
- - **Consolidated event families** with metadata.protocol for multi-protocol support
238
- - Scoped to groups (via groupId)
239
-
240
- ### 6. knowledge
241
-
242
- Labels, embeddings, and semantic search
243
-
244
- - Vector storage for RAG (Retrieval-Augmented Generation)
245
- - Linked to things via junction table
246
- - Supports categorization and taxonomy
247
- - Scoped to groups (via groupId)
248
-
249
- **Golden Rule:** If you can't map a feature to these 6 dimensions, you're thinking about it wrong.
250
-
251
- **Implementation:** The 6 dimensions are implemented using 5 database tables (groups, things, connections, events, knowledge), with people represented as things with role metadata.
252
-
253
- **Schema Structure:**
254
-
255
- ```typescript
256
- // groups table
257
- {
258
- _id: Id<"groups">,
259
- name: string,
260
- type: "friend_circle" | "business" | "community" | "dao" | "government" | "organization",
261
- parentGroupId?: Id<"groups">, // For hierarchical nesting
262
- properties: {
263
- description?: string,
264
- plan?: "starter" | "pro" | "enterprise",
265
- settings?: any,
266
- // ... type-specific fields
267
- },
268
- status: "draft" | "active" | "archived",
269
- createdAt: number,
270
- updatedAt: number
271
- }
272
-
273
- // All other dimensions include groupId:
274
- things → groupId: Id<"groups">
275
- connections → groupId: Id<"groups">
276
- events → groupId: Id<"groups">
277
- knowledge → groupId: Id<"groups">
278
- ```
279
-
280
- ## Installation Folders
281
-
282
- **NEW:** Each ONE installation can have a top-level folder for organization-specific customization.
283
-
284
- ### Architecture
285
-
286
- ```
287
- /
288
- ├── one/ # Global templates (everyone uses these)
289
- │ └── knowledge/
290
- │ └── ontology.md # Universal 6-dimension ontology
291
- ├── <installation-name>/ # Customer-specific overrides
292
- │ ├── knowledge/
293
- │ │ ├── brand-guide.md # Custom branding only
294
- │ │ ├── features.md # Organization features
295
- │ │ └── rules.md # Org-specific rules
296
- │ └── groups/ # Hierarchical group docs
297
- ├── web/
298
- ├── backend/
299
- └── .claude/
300
- ```
301
-
302
- ### What Goes Where
303
-
304
- **Global (everyone uses):**
305
- - `/one/knowledge/ontology.md` - Universal 6-dimension ontology
306
- - `/one/knowledge/architecture.md` - Platform architecture
307
- - All `/one/*` documentation
308
-
309
- **Installation-specific (per organization):**
310
- - Brand identity (colors, logos, fonts, tone)
311
- - Organization features and capabilities
312
- - Group-specific documentation
313
- - Custom business rules
314
-
315
- ### Key Principle
316
-
317
- **Data isolation happens via `groupId` in the database, NOT via schema customization.**
318
-
319
- The 6-dimension ontology is universal and flexible enough for all use cases.
320
-
321
- ### Initialize Installation
322
-
323
- ```bash
324
- npx oneie init
325
- # Prompts for organization name and installation identifier
326
- # Creates folder structure and updates .env.local
327
- ```
328
-
329
- ### Usage
330
-
331
- **Add installation-specific branding:**
332
- ```bash
333
- mkdir -p /acme/knowledge
334
- echo "# Acme Brand Guide" > /acme/knowledge/brand-guide.md
335
- ```
336
-
337
- **Document organization features:**
338
- ```bash
339
- echo "# Acme Features" > /acme/knowledge/features.md
340
- ```
341
-
342
- **Add group-specific docs:**
343
- ```bash
344
- mkdir -p /acme/groups/engineering
345
- echo "# Engineering Practices" > /acme/groups/engineering/practices.md
346
- ```
347
-
348
- ### Important Distinctions
349
-
350
- - **Installation folder** = Filesystem customization for branding and features
351
- - **Database groups** = Runtime data isolation per group (via `groupId`)
352
- - One installation can serve many database groups
353
- - **ONE ontology** = Universal schema shared by all installations
354
-
355
- ### Security
356
-
357
- - Never store secrets in installation folders
358
- - Use `.env.local` for sensitive configuration
359
- - Installation folders excluded from git by default
360
-
361
- ## Development Commands
362
-
363
- ### Frontend Development
364
-
365
- ```bash
366
- cd web/
367
-
368
- # Development server (localhost:4321)
369
- bun run dev
370
-
371
- # Build for production (includes type checking)
372
- bun run build
373
-
374
- # Type checking only
375
- bunx astro check
376
-
377
- # Generate content collection types
378
- bunx astro sync
379
-
380
- # Linting
381
- bun run lint
382
-
383
- # Formatting
384
- bun run format
385
- ```
386
-
387
- ## Frontend-First Development (Default Mode)
388
-
389
- **CRITICAL:** All agents default to frontend-only development unless explicitly requested otherwise.
390
-
391
- ### Default Behavior
392
-
393
- **Frontend-only is the DEFAULT for ALL agents across the platform.**
394
-
395
- When building features, agents MUST:
396
- 1. Build ONLY frontend code by default
397
- 2. Use client-side state management (nanostores)
398
- 3. Integrate third-party services via direct API calls (Stripe.js, OpenAI client SDK, etc.)
399
- 4. Store data in browser (localStorage, IndexedDB) or third-party services
400
- 5. NEVER create backend code unless explicitly requested
401
-
402
- ### When Backend is NOT Needed
403
-
404
- Frontend-only works perfectly for:
405
-
406
- - **Ecommerce stores**: Stripe.js handles payments, no backend needed
407
- - **LMS platforms**: Content in Astro pages, progress in localStorage
408
- - **SaaS tools**: Third-party APIs (OpenAI, Anthropic, Stripe) via client SDKs
409
- - **Marketing sites**: Static pages with forms, analytics, chat widgets
410
- - **Documentation sites**: Content collections with search
411
- - **Landing pages**: Interactive demos, forms, newsletters
412
- - **Portfolio sites**: Projects, case studies, contact forms
413
- - **Blogs**: Content collections with comments (Giscus, Utterances)
414
-
415
- ### Frontend Stack (Default Tools)
416
-
417
- Use these tools for frontend-only development:
418
-
419
- - **State Management**: nanostores (persistent atoms, maps, computed)
420
- - **UI Components**: React 19 + shadcn/ui (50+ accessible components)
421
- - **Styling**: Tailwind CSS v4 (CSS-based configuration)
422
- - **Pages**: Astro 5 (file-based routing, SSR, islands)
423
- - **Forms**: React Hook Form + Zod validation
424
- - **Data Fetching**: fetch API, SWR, React Query
425
- - **Storage**: localStorage, sessionStorage, IndexedDB
426
- - **Payments**: Stripe.js (client-side only)
427
- - **Auth**: Better Auth (client-side hooks)
428
- - **Analytics**: Plausible, Fathom (script tags)
429
-
430
- ### When to Use Backend
431
-
432
- Backend is ONLY needed when user explicitly says:
433
-
434
- 1. **"Use backend"** - Direct request for backend integration
435
- 2. **"Add groups"** - Multi-tenant data isolation requires backend
436
- 3. **"Add multi-user"** - User collaboration requires backend
437
- 4. **"Track events"** - Immutable audit trail requires backend
438
- 5. **"Build RAG"** - Vector embeddings require backend
439
- 6. **"Real-time updates"** - WebSocket sync requires backend
440
-
441
- ### Backend Integration (Only When Requested)
442
-
443
- If user explicitly requests backend, integrate via:
444
-
445
- - **Services Layer**: `/web/src/services/` - Business logic and API wrappers
446
- - **Providers Layer**: `/web/src/providers/` - React context for state management
447
- - **Convex Client**: `useQuery` and `useMutation` hooks for backend calls
448
- - **API Routes**: `/web/src/pages/api/` for serverless functions
449
-
450
- Example structure when backend is explicitly requested:
451
-
452
- ```typescript
453
- // /web/src/services/products.ts
454
- import { ConvexHttpClient } from "convex/browser";
455
- import { api } from "@/convex/_generated/api";
456
-
457
- const client = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
458
-
459
- export const productService = {
460
- list: () => client.query(api.queries.products.list),
461
- create: (data) => client.mutation(api.mutations.products.create, data),
462
- };
463
-
464
- // /web/src/providers/ProductProvider.tsx
465
- import { createContext, useContext } from "react";
466
- import { useQuery } from "convex/react";
467
- import { api } from "@/convex/_generated/api";
468
-
469
- const ProductContext = createContext(null);
470
-
471
- export const ProductProvider = ({ children }) => {
472
- const products = useQuery(api.queries.products.list);
473
- return <ProductContext.Provider value={{ products }}>{children}</ProductContext.Provider>;
474
- };
475
-
476
- export const useProducts = () => useContext(ProductContext);
477
- ```
478
-
479
- ### Golden Rule
480
-
481
- **Default to frontend-only. Only add backend when explicitly requested.**
482
-
483
- - ✅ User says "build ecommerce store" → Frontend-only with Stripe.js
484
- - ✅ User says "build ecommerce store with groups" → Add backend for multi-tenancy
485
- - ✅ User says "build LMS" → Frontend-only with content collections
486
- - ✅ User says "build LMS with real-time progress" → Add backend for events
487
- - ✅ User says "add payments" → Frontend-only with Stripe.js
488
- - ✅ User says "add payments and track events" → Add backend for event logging
489
-
490
- **When in doubt, ask:** "Do you need multi-user groups, or can this work as a single-user frontend-only app?"
491
-
492
- ### Backend Development
493
-
494
- ```bash
495
- cd backend/
496
-
497
- # Start Convex dev server (watch mode)
498
- npx convex dev
499
-
500
- # Deploy to production
501
- npx convex deploy
502
-
503
- # Run query from CLI
504
- npx convex run queries/entities:list '{"type": "user"}'
505
-
506
- # View function logs
507
- npx convex logs --history 50 --success
508
- ```
90
+ **Benefits:** 98% context reduction (150k → 3k tokens), 5x faster execution, flawless execution through "do the next thing, perfectly."
509
91
 
510
- ### Testing
92
+ **Read full system:** `/one/knowledge/todo.md`
511
93
 
512
- ```bash
513
- cd web/
94
+ ---
514
95
 
515
- # Run all tests
516
- bun test
96
+ ## Development Workflow (6-Phase Process)
517
97
 
518
- # Run auth tests specifically
519
- bun test test/auth
98
+ **Before implementing ANY feature, follow this workflow:**
520
99
 
521
- # Watch mode
522
- bun test --watch
523
- ```
100
+ 1. **UNDERSTAND** → Read `/one/knowledge/ontology.md`, `/one/knowledge/rules.md`, identify category
101
+ 2. **MAP TO ONTOLOGY** → Identify groups, people, things, connections, events, knowledge
102
+ 3. **DESIGN SERVICES** → Design Effect.ts services (pure business logic)
103
+ 4. **IMPLEMENT BACKEND** → Create Convex mutations/queries (thin wrappers)
104
+ 5. **BUILD FRONTEND** → Create React components (render the 6 dimensions)
105
+ 6. **TEST & DOCUMENT** → Write tests, update documentation
524
106
 
525
- **Test Coverage:**
107
+ **Read full workflow:** `/one/connections/workflow.md`
526
108
 
527
- - 50+ test cases for authentication (6 methods: email/password, OAuth, magic links, password reset, email verification, 2FA)
528
- - Integration tests verify frontend → backend auth flows
529
- - Backend connection: `https://shocking-falcon-870.convex.cloud`
109
+ ---
530
110
 
531
111
  ## Technology Stack
532
112
 
533
- ### Frontend Layer
534
-
535
- - **Astro 5.14+**: Static site generation + server-side rendering
536
- - **React 19**: Islands architecture with selective hydration
537
- - **Tailwind CSS v4**: CSS-based configuration (no JS config)
538
- - **shadcn/ui**: 50+ pre-installed accessible components
539
- - **TypeScript 5.9+**: Strict mode with path aliases
540
- - **Better Auth**: Multi-method authentication
541
-
542
- ### Backend Layer
113
+ **Frontend:** Astro 5, React 19, Tailwind v4, shadcn/ui (50+ components), Better Auth
114
+ **Backend:** Convex (real-time database), Effect.ts (business logic), Better Auth + Convex Adapter
115
+ **Deployment:** Cloudflare Pages (frontend), Convex Cloud (backend at `shocking-falcon-870.convex.cloud`)
543
116
 
544
- - **Convex**: Real-time database with typed functions
545
- - **Better Auth + Convex Adapter**: Authentication system
546
- - **@convex-dev/resend**: Email component for transactional emails
547
- - **@convex-dev/rate-limiter**: Brute force protection
117
+ **Read full stack details:** `/one/knowledge/architecture.md#technology-stack`
548
118
 
549
- ### Deployment
550
-
551
- - **Frontend**: Cloudflare Pages with React 19 SSR (using `react-dom/server.edge`)
552
- - **Backend**: Convex Cloud (`shocking-falcon-870.convex.cloud`)
553
- - **Edge Runtime**: Cloudflare Workers compatibility
119
+ ---
554
120
 
555
121
  ## Root Directory File Policy
556
122
 
@@ -561,642 +127,169 @@ bun test --watch
561
127
  - **CLAUDE.md** - Claude Code instructions (this file)
562
128
  - **AGENTS.md** - AI agent coordination and rules
563
129
 
564
- All other documentation belongs in the `one/` directory following the 6-dimension ontology:
130
+ All other documentation belongs in `/one/` following the 6-dimension ontology:
565
131
  - **one/events/** - Deployment plans, release notes, test results, agent summaries
566
132
  - **one/knowledge/** - Architecture, patterns, rules, guides
567
133
  - **one/connections/** - Protocols, workflows, integrations
568
134
  - **one/things/** - Specifications, plans, agent definitions
569
135
  - **one/people/** - Roles, governance, organization
570
136
 
571
- **Why:** This keeps the root clean and scannable, while organizing all documentation by ontology dimensions.
137
+ ---
572
138
 
573
139
  ## File Structure
574
140
 
575
141
  ```
576
142
  ONE/
577
- ├── web/ # Main Astro application
143
+ ├── web/ # Frontend (see web/CLAUDE.md)
578
144
  │ ├── src/
579
- │ │ ├── pages/ # File-based routing
580
- │ │ ├── components/ # React components + shadcn/ui
581
- │ │ ├── layouts/ # Page layouts
582
- │ │ ├── content/ # Content collections (blog, etc.)
583
- │ │ ├── lib/ # Utilities
584
- │ │ └── styles/ # Global CSS + Tailwind config
585
- │ ├── convex/ # Convex schema and functions (legacy)
586
- │ └── test/ # Test suites
587
- │
588
- ├── backend/ # Headless Convex backend
589
- │ └── convex/
590
- │ ├── schema.ts # 6-dimension ontology schema (5 tables)
591
- │ ├── auth.ts # Better Auth configuration
592
- │ ├── queries/ # Read operations
593
- │ ├── mutations/ # Write operations
594
- │ └── _generated/ # Auto-generated types
595
- │
596
- ├── one/ # Platform documentation (41 files)
597
- │ ├── connections/ # Ontology, protocols, patterns
598
- │ ├── things/ # Architecture, specifications
599
- │ ├── events/ # Event specifications, deployment history
600
- │ ├── knowledge/ # RAG, AI, implementation
601
- │ └── people/ # Roles, governance, organization
602
- │
603
- ├── .claude/ # Claude Code configuration
604
- │ ├── agents/ # AI agent definitions (agent-ops, etc.)
605
- │ └── commands/ # Slash commands (/release, etc.)
606
- │
607
- └── apps/ # Example applications
608
- ├── one/ # Assembly repository (synced from root)
609
- ├── eliza/ # ElizaOS integration
610
- └── stack/ # Stack Auth example
611
- ```
612
-
613
- ## Development Workflow (6-Phase Process)
614
-
615
- Before implementing ANY feature, follow this workflow defined in `one/connections/workflow.md`:
616
-
617
- ### Phase 1: UNDERSTAND
618
-
619
- 1. Read `/one/knowledge/ontology.md` (universal 6-dimension ontology)
620
- 2. Read `web/AGENTS.md` (Convex patterns and quick reference)
621
- 3. Read `/one/knowledge/rules.md` (golden rules for AI agents)
622
- 4. Check installation folder for branding: `/<installation>/knowledge/brand-guide.md` (if exists)
623
- 5. Identify feature category (entity, relationship, action, query)
624
- 6. Find similar patterns in existing code
625
-
626
- ### Phase 2: MAP TO ONTOLOGY
627
-
628
- 1. Identify **groups** (which group owns this? any parent/child relationships?)
629
- 2. Identify **people** (who can access/modify this?)
630
- 3. Identify **things** (what entities are involved?)
631
- 4. Identify **connections** (how do they relate?)
632
- 5. Identify **events** (what actions need logging?)
633
- 6. Identify **knowledge** (what needs to be learned/searched?)
634
- 7. Check if group has specific docs in `/<installation-name>/groups/<group-slug>/`
635
-
636
- ### Phase 3: DESIGN SERVICES
637
-
638
- 1. Design Effect.ts service (pure business logic)
639
- 2. Define types (no `any` except in entity `properties`)
640
- 3. Define errors (tagged unions with `_tag`)
641
- 4. Plan dependencies and layers
642
-
643
- ### Phase 4: IMPLEMENT BACKEND
644
-
645
- 1. Update schema if needed (`backend/convex/schema.ts`)
646
- 2. Create Convex mutations/queries (thin wrappers)
647
- 3. Implement Effect.ts services (`convex/services/`)
648
- 4. Add proper error handling
649
-
650
- ### Phase 5: BUILD FRONTEND
651
-
652
- 1. Create React components (`src/components/features/`)
653
- 2. Use shadcn/ui components
654
- 3. Add loading/error states
655
- 4. Create Astro pages with SSR data fetching
656
- 5. Add `client:load` for interactive components
657
-
658
- ### Phase 6: TEST & DOCUMENT
659
-
660
- 1. Write unit tests for services
661
- 2. Write integration tests for full flows
662
- 3. Update documentation:
663
- - **Platform-wide features:** Add to `/one/<dimension>/`
664
- - **Organization features:** Add to `/<installation-name>/knowledge/features.md`
665
- - **Group-specific practices:** Add to `/<installation-name>/groups/<group-slug>/`
666
- 4. Run type checking (`bunx astro check`)
667
-
668
- ## Key Patterns and Best Practices
669
-
670
- ### Convex Query Pattern
671
-
672
- ```typescript
673
- // backend/convex/queries/entities.ts
674
- import { query } from "./_generated/server";
675
- import { v } from "convex/values";
676
-
677
- export const list = query({
678
- args: { type: v.string() },
679
- handler: async (ctx, args) => {
680
- return await ctx.db
681
- .query("entities")
682
- .withIndex("by_type", (q) => q.eq("type", args.type))
683
- .collect();
684
- },
685
- });
686
- ```
687
-
688
- ### Convex Mutation Pattern
689
-
690
- ```typescript
691
- // backend/convex/mutations/entities.ts
692
- import { mutation } from "./_generated/server";
693
- import { v } from "convex/values";
694
-
695
- export const create = mutation({
696
- args: {
697
- groupId: v.id("groups"),
698
- type: v.string(),
699
- name: v.string(),
700
- properties: v.any(),
701
- },
702
- handler: async (ctx, args) => {
703
- const entityId = await ctx.db.insert("things", {
704
- groupId: args.groupId,
705
- type: args.type,
706
- name: args.name,
707
- properties: args.properties,
708
- status: "draft",
709
- createdAt: Date.now(),
710
- updatedAt: Date.now(),
711
- });
712
-
713
- // Log creation event
714
- await ctx.db.insert("events", {
715
- groupId: args.groupId,
716
- type: "entity_created",
717
- actorId: ctx.auth?.getUserIdentity()?.tokenIdentifier,
718
- targetId: entityId,
719
- timestamp: Date.now(),
720
- metadata: { entityType: args.type },
721
- });
722
-
723
- return entityId;
724
- },
725
- });
726
- ```
727
-
728
- ### Hierarchical Group Pattern
729
-
730
- ```typescript
731
- // backend/convex/mutations/groups.ts
732
- import { mutation } from "./_generated/server";
733
- import { v } from "convex/values";
734
-
735
- // Create parent group
736
- export const createOrganization = mutation({
737
- args: {
738
- name: v.string(),
739
- plan: v.optional(v.union(v.literal("starter"), v.literal("pro"), v.literal("enterprise"))),
740
- },
741
- handler: async (ctx, args) => {
742
- const groupId = await ctx.db.insert("groups", {
743
- name: args.name,
744
- type: "organization",
745
- parentGroupId: undefined, // Top-level group
746
- properties: {
747
- plan: args.plan || "starter",
748
- },
749
- status: "active",
750
- createdAt: Date.now(),
751
- updatedAt: Date.now(),
752
- });
753
- return groupId;
754
- },
755
- });
756
-
757
- // Create child group (e.g., department within organization)
758
- export const createSubGroup = mutation({
759
- args: {
760
- parentGroupId: v.id("groups"),
761
- name: v.string(),
762
- type: v.union(
763
- v.literal("friend_circle"),
764
- v.literal("business"),
765
- v.literal("community"),
766
- v.literal("dao"),
767
- v.literal("government"),
768
- v.literal("organization")
769
- ),
770
- },
771
- handler: async (ctx, args) => {
772
- // Verify parent exists
773
- const parent = await ctx.db.get(args.parentGroupId);
774
- if (!parent) throw new Error("Parent group not found");
775
-
776
- const groupId = await ctx.db.insert("groups", {
777
- name: args.name,
778
- type: args.type,
779
- parentGroupId: args.parentGroupId, // Link to parent
780
- properties: {},
781
- status: "active",
782
- createdAt: Date.now(),
783
- updatedAt: Date.now(),
784
- });
785
-
786
- return groupId;
787
- },
788
- });
789
- ```
790
-
791
- ### React Component with Convex Hooks
792
-
793
- ```typescript
794
- // frontend/src/components/features/EntityList.tsx
795
- import { useQuery } from "convex/react";
796
- import { api } from "@/convex/_generated/api";
797
-
798
- export function EntityList({ groupId, type }: { groupId: string; type: string }) {
799
- const entities = useQuery(api.queries.entities.list, { groupId, type });
800
-
801
- if (entities === undefined) return <div>Loading...</div>;
802
-
803
- return (
804
- <div>
805
- {entities.map((entity) => (
806
- <div key={entity._id}>{entity.name}</div>
807
- ))}
808
- </div>
809
- );
810
- }
145
+ │ │ ├── pages/ # File-based routing (see web/src/pages/CLAUDE.md)
146
+ │ │ ├── components/ # React components (see web/src/components/CLAUDE.md)
147
+ │ │ ├── layouts/ # Page layouts
148
+ │ │ ├── content/ # Content collections
149
+ │ │ └── lib/ # Utilities
150
+ │ └── test/ # Test suites
151
+ ├── backend/ # Backend (see backend/CLAUDE.md)
152
+ │ └── convex/ # Convex schema and functions (see backend/convex/CLAUDE.md)
153
+ │ ├── schema.ts # 6-dimension ontology (5 tables)
154
+ │ ├── queries/ # Read operations
155
+ │ └── mutations/ # Write operations
156
+ ├── one/ # Platform documentation (41 files, 8 layers)
157
+ │ ├── connections/ # Ontology, protocols, patterns
158
+ │ ├── things/ # Architecture, specifications
159
+ │ ├── events/ # Event specs, deployment history
160
+ │ ├── knowledge/ # RAG, AI, implementation guides
161
+ │ └── people/ # Roles, governance, organization
162
+ ├── .claude/ # Claude Code configuration
163
+ │ ├── agents/ # AI agent definitions
164
+ │ └── commands/ # Slash commands (/deploy, /commit, etc.)
165
+ └── apps/ # Example applications
811
166
  ```
812
167
 
813
- ### Astro Page with SSR
814
-
815
- ```astro
816
- ---
817
- // frontend/src/pages/groups/[groupId]/entities/[type].astro
818
- import { ConvexHttpClient } from "convex/browser";
819
- import { api } from "@/convex/_generated/api";
820
- import EntityList from "@/components/features/EntityList";
821
-
822
- const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
823
- const entities = await convex.query(api.queries.entities.list, {
824
- groupId: Astro.params.groupId,
825
- type: Astro.params.type
826
- });
827
168
  ---
828
169
 
829
- <Layout>
830
- <h1>{Astro.params.type} Entities</h1>
831
- <EntityList
832
- client:load
833
- groupId={Astro.params.groupId}
834
- type={Astro.params.type}
835
- />
836
- </Layout>
837
- ```
838
-
839
- ### Tailwind v4 Styling
840
-
841
- ```css
842
- /* src/styles/global.css */
843
- @import "tailwindcss";
844
-
845
- @theme {
846
- --color-background: 0 0% 100%;
847
- --color-foreground: 222.2 84% 4.9%;
848
- --color-primary: 222.2 47.4% 11.2%;
849
- }
850
-
851
- /* Dark mode overrides */
852
- @variant dark (.dark &);
853
-
854
- .dark {
855
- --color-background: 222.2 84% 4.9%;
856
- --color-foreground: 210 40% 98%;
857
- }
858
-
859
- /* Use colors with hsl() wrapper */
860
- .my-component {
861
- background-color: hsl(var(--color-background));
862
- color: hsl(var(--color-foreground));
863
- }
864
- ```
865
-
866
- ## Important Guidelines
867
-
868
- ### Authentication
869
-
870
- - Backend handles all auth logic (`backend/convex/auth.ts`)
871
- - Frontend uses Better Auth client hooks
872
- - 6 authentication methods supported
873
- - All auth pages under `/account/*` route
874
-
875
- ### Environment Variables
170
+ ## Critical Reading Before Coding
876
171
 
877
- **Root (.env) - CRITICAL FOR DEPLOYMENTS:**
172
+ **For ANY feature implementation:**
173
+ 1. `/one/knowledge/ontology.md` - 6-dimension model (Version 1.0.0)
174
+ 2. `/one/connections/workflow.md` - 6-phase development process
175
+ 3. `/one/knowledge/rules.md` - Golden rules for AI development
176
+ 4. Subdirectory CLAUDE.md (web/, backend/, etc.) - Layer-specific patterns
878
177
 
879
- ```bash
880
- # Cloudflare Global API Key - FULL ACCESS to Cloudflare API
881
- # This provides complete programmatic access for automated deployments
882
- CLOUDFLARE_GLOBAL_API_KEY=your-cloudflare-global-api-key
883
- CLOUDFLARE_ACCOUNT_ID=your-cloudflare-account-id
884
- CLOUDFLARE_EMAIL=your-cloudflare-email
885
-
886
- # Alternative: Cloudflare API Token (scoped access)
887
- CLOUDFLARE_API_TOKEN=your-cloudflare-api-token
888
- ```
889
-
890
- **IMPORTANT:** The `CLOUDFLARE_GLOBAL_API_KEY` in `.env` provides **FULL ACCESS** to the Cloudflare API. This enables automated deployments via `./scripts/cloudflare-deploy.sh` and the `/release` command without manual intervention. Keep this key secure and never commit `.env` to version control.
178
+ **For specific feature types:**
179
+ - **Protocol integration:** `/one/connections/protocols.md` + specific protocol doc
180
+ - **External integration:** `/one/connections/communications.md`
181
+ - **Blockchain features:** `/one/connections/cryptonetworks.md`
182
+ - **Agent features:** `/one/things/agentkit.md`, `/one/things/copilotkit.md`
183
+ - **Frontend patterns:** `/one/knowledge/patterns/frontend/`
184
+ - **Backend patterns:** `/one/knowledge/patterns/backend/`
891
185
 
892
- **Web (.env.local):**
186
+ ---
893
187
 
894
- ```bash
895
- PUBLIC_CONVEX_URL=https://shocking-falcon-870.convex.cloud
896
- CONVEX_DEPLOYMENT=prod:shocking-falcon-870
897
- BETTER_AUTH_SECRET=your-secret-key
898
- BETTER_AUTH_URL=http://localhost:4321
899
- # OAuth credentials...
900
- ```
188
+ ## Installation Folders
901
189
 
902
- **Backend (.env.local):**
190
+ Each ONE installation can have a top-level folder for organization-specific customization:
903
191
 
904
- ```bash
905
- CONVEX_DEPLOYMENT=prod:shocking-falcon-870
906
- RESEND_API_KEY=your-resend-api-key
907
- RESEND_FROM_EMAIL=noreply@yourdomain.com
908
192
  ```
909
-
910
- ### Tailwind v4 Specifics
911
-
912
- - NO `tailwind.config.mjs` file - use CSS `@theme` blocks
913
- - ALWAYS use HSL format: `--color-name: 0 0% 100%`
914
- - ALWAYS wrap with `hsl()`: `hsl(var(--color-background))`
915
- - NO `@apply` directive in Tailwind v4
916
- - Use `@variant dark (.dark &)` for dark mode
917
- - Add `@source` directive to scan component files
918
-
919
- ### React 19 + Cloudflare
920
-
921
- - Uses `react-dom/server.edge` for SSR compatibility
922
- - Configured in `astro.config.mjs` with Vite alias
923
- - Deployed to Cloudflare Pages with edge rendering
924
-
925
- ### Content Collections
926
-
927
- - Blog posts in `src/content/blog/`
928
- - Type-safe schemas in `src/content/config.ts`
929
- - Run `bunx astro sync` after content changes
930
- - Use `CollectionEntry<"blog">` type (lowercase)
931
-
932
- ## Common Issues and Solutions
933
-
934
- ### Issue: TypeScript errors after schema changes
935
-
936
- ```bash
937
- cd backend && npx convex dev # Regenerate types
938
- cd web && bunx astro check
193
+ /<installation-name>/ # Customer-specific overrides
194
+ ├── knowledge/
195
+ │ ├── brand-guide.md # Custom branding
196
+ │ ├── features.md # Organization features
197
+ │ └── rules.md # Org-specific rules
198
+ └── groups/ # Hierarchical group docs
939
199
  ```
940
200
 
941
- ### Issue: Auth not working
201
+ **Key Principle:** Data isolation happens via `groupId` in the database, NOT via schema customization. The 6-dimension ontology is universal.
942
202
 
943
- Check that BETTER_AUTH_SECRET matches between frontend and backend `.env.local` files.
944
-
945
- ### Issue: Hydration mismatch
946
-
947
- Add `client:load` directive to interactive React components used in Astro pages.
948
-
949
- ### Issue: Tailwind styles not applying
950
-
951
- Ensure colors use HSL format wrapped with `hsl()` function, not OKLCH or raw values.
952
-
953
- ### Issue: Build fails on Cloudflare
954
-
955
- Verify `react-dom/server.edge` alias is set in `astro.config.mjs` under `vite.resolve.alias`.
956
-
957
- ## Critical Reading Before Coding
203
+ **Read full guide:** `/one/knowledge/installation-folders.md`
958
204
 
959
- **For ANY feature implementation, read in this order:**
960
-
961
- 1. **`/one/knowledge/ontology.md`** - Universal 6-dimension ontology specification (Version 1.0.0)
962
- 2. **`web/AGENTS.md`** - Quick reference for Convex patterns
963
- 3. **`/one/knowledge/rules.md`** - Golden rules for AI development
964
- 4. **`/one/connections/workflow.md`** - 6-phase development workflow
965
- 5. **`/one/connections/patterns.md`** - Proven code patterns to replicate
966
- 6. **Check installation folder** (if `INSTALLATION_NAME` is set):
967
- - `/<installation-name>/knowledge/brand-guide.md` (custom branding)
968
- - `/<installation-name>/knowledge/features.md` (organization features)
969
- - `/<installation-name>/knowledge/rules.md` (org-specific rules)
970
- - `/<installation-name>/groups/<group-slug>/` (group-specific docs)
971
-
972
- **For specific feature types:**
973
-
974
- - **Protocol integration**: `one/connections/protocols.md` + specific protocol doc
975
- - **External integration**: `one/connections/communications.md` + specific integration doc
976
- - **Blockchain features**: `one/connections/cryptonetworks.md`
977
- - **Agent features**: `one/things/agentkit.md`, `one/things/copilotkit.md`
978
- - **Cycle/AI**: `one/connections/cycle.md`
979
-
980
- ## Documentation Structure
981
-
982
- The `one/` directory contains **41 documentation files** organized in **8 layers**:
983
-
984
- 1. **Strategy Layer**: Vision, revenue, organization
985
- 2. **Ontology Layer**: Core data model and 6 dimensions
986
- 3. **Protocols Layer**: A2A, ACP, AP2, X402, AG-UI specifications
987
- 4. **Services Layer**: Effect.ts patterns, service providers
988
- 5. **Implementation Layer**: Frontend, architecture, patterns
989
- 6. **Integration Layer**: ElizaOS, CopilotKit, MCP, N8N
990
- 7. **Examples Layer**: Lemonade stand, enterprise CRM
991
- 8. **Plans Layer**: Future enhancements and technical debt
992
-
993
- **Use targeted reading:** Don't read everything - follow the critical path for your specific feature type.
205
+ ---
994
206
 
995
207
  ## Deployment
996
208
 
997
209
  ### Automated Release (v3.0.0+)
998
210
 
999
- **Use `/release` command for complete deployment:**
211
+ Use `/release` command for complete deployment:
1000
212
 
1001
213
  ```bash
1002
- # Patch release (bug fixes)
1003
- /release patch
1004
-
1005
- # Minor release (new features)
1006
- /release minor
1007
-
1008
- # Major release (breaking changes)
1009
- /release major
1010
-
1011
- # Sync files without version bump
1012
- /release sync
214
+ /release patch # Bug fixes
215
+ /release minor # New features
216
+ /release major # Breaking changes
217
+ /release sync # Sync files without version bump
1013
218
  ```
1014
219
 
1015
220
  **The release process automatically:**
1016
221
  1. Bumps version in `cli/package.json`
1017
- 2. Syncs 518+ files from root to `cli/` and `apps/one/`:
1018
- - `/one/*` → `cli/one/` and `apps/one/one/`
1019
- - `/.claude/*` → `cli/.claude/` and `apps/one/one/.claude/`
1020
- - `/web/*` → `apps/one/web/` (git subtree)
1021
- - `CLAUDE.md`, `README.md`, `LICENSE.md`, `SECURITY.md` → all targets
1022
- - `web/AGENTS.md` → `apps/one/one/AGENTS.md`
1023
- 3. Commits and pushes to:
1024
- - `github.com/one-ie/cli`
1025
- - `github.com/one-ie/web`
1026
- - `github.com/one-ie/one` (apps/one assembly repo)
222
+ 2. Syncs 518+ files to `cli/` and `apps/one/`
223
+ 3. Commits and pushes to GitHub repositories
1027
224
  4. Publishes to npm: `oneie@<version>`
1028
225
  5. Builds and deploys web to Cloudflare Pages
1029
226
 
1030
227
  **Live URLs:**
1031
228
  - npm: https://www.npmjs.com/package/oneie
1032
229
  - Web: https://web.one.ie
1033
- - CLI: https://github.com/one-ie/cli
1034
- - One: https://github.com/one-ie/one
1035
230
 
1036
- See `.claude/commands/release.md` and `.claude/agents/agent-ops.md` for details.
231
+ **Read release process:** `.claude/commands/release.md`, `.claude/agents/agent-ops.md`
1037
232
 
1038
233
  ### Manual Deployment
1039
234
 
1040
- **Web (Cloudflare Pages):**
1041
-
235
+ **Frontend:**
1042
236
  ```bash
1043
- cd web/
1044
- bun run build
1045
- wrangler pages deploy dist --project-name=web
237
+ cd web/ && bun run build && wrangler pages deploy dist
1046
238
  ```
1047
239
 
1048
- **Backend (Convex Cloud):**
1049
-
240
+ **Backend:**
1050
241
  ```bash
1051
- cd backend/
1052
- npx convex deploy
1053
- ```
1054
-
1055
- Convex automatically deploys on git push when connected to GitHub.
1056
-
1057
- ## The English → Code → Reality Workflow
1058
-
1059
- **In Minutes, Not Months**
1060
-
1061
- Describe your feature in plain English. The system validates it against the ontology, compiles to TypeScript, generates tests, and deploys to the edge.
1062
-
1063
- ### The Four-Step Workflow
1064
-
1065
- #### 1️⃣ Write in English
1066
-
1067
- Describe what you want: `"CREATE ai clone"`, `"CALL OpenAI"`, `"RECORD purchase"`. Use 15 simple commands anyone can understand.
1068
-
1069
- ```
1070
- Creator: "CREATE my AI clone"
1071
- Seller: "RECORD purchase event"
1072
- Engineer: "CONNECT to Stripe API"
242
+ cd backend/ && npx convex deploy
1073
243
  ```
1074
244
 
1075
- #### 2️⃣ System Validates
1076
-
1077
- Checks against the ontology: Do these entity types exist? Are connections valid? Are services available? Instant feedback.
1078
-
1079
- ```
1080
- ✓ ai_clone entity type exists
1081
- ✓ tokens_purchased event valid
1082
- ✓ Stripe service available
1083
- ```
1084
-
1085
- #### 3️⃣ Code Generated
245
+ ---
1086
246
 
1087
- Compiles to production TypeScript with Effect.ts, Convex functions, React components, full test suite. Type-safe, tested, ready.
247
+ ## Development Commands
1088
248
 
249
+ **Frontend:**
250
+ ```bash
251
+ cd web/
252
+ bun run dev # Development server (localhost:4321)
253
+ bun run build # Build for production
254
+ bunx astro check # Type checking
1089
255
  ```
1090
- Backend Frontend Tests
1091
- ├─ Mutations ├─ Components └─ 50+ cases
1092
- ├─ Queries └─ Pages
1093
- └─ Services
1094
- ```
1095
-
1096
- #### 4️⃣ Deploy to Edge
1097
256
 
1098
- Push to Cloudflare's global network. Unlimited requests, instant updates, zero configuration. Live in 60 seconds.
1099
-
1100
- ```
1101
- 330+ locations worldwide
1102
- < 330ms average response time
1103
- Free tier unlimited
257
+ **Backend:**
258
+ ```bash
259
+ cd backend/
260
+ npx convex dev # Start Convex dev server
261
+ npx convex deploy # Deploy to production
1104
262
  ```
1105
263
 
1106
- ### Why This Works
1107
-
1108
- Every feature follows this flow:
1109
-
1110
- 1. **English → Ontology** - Validates intent against 6 dimensions
1111
- 2. **Ontology → Code** - Generates type-safe services
1112
- 3. **Code → Tests** - Creates 50+ test cases automatically
1113
- 4. **Tests → Deploy** - Pushes to edge with zero downtime
1114
-
1115
- The ontology ensures consistency. The compiler ensures quality. The edge ensures performance.
1116
-
1117
- ## Plain English DSL
1118
-
1119
- ### Write Features in English. The System Builds Everything.
1120
-
1121
- Describe what you want in plain English. The compiler checks every line against the ontology, generates TypeScript and tests, and deploys to the edge.
1122
-
1123
- **Example: Chat with AI Clone**
1124
-
1125
- ```
1126
- FEATURE: Let fans chat with my AI clone
1127
-
1128
- WHEN a fan sends a message
1129
- CHECK they own tokens
1130
- GET conversation history
1131
- CALL OpenAI with my personality
1132
- RECORD the interaction
1133
- REWARD fan with 10 tokens
1134
- GIVE AI response to fan
264
+ **Testing:**
265
+ ```bash
266
+ cd web/
267
+ bun test # Run all tests
268
+ bun test --watch # Watch mode
1135
269
  ```
1136
270
 
1137
- **What maps to ontology:**
1138
-
1139
- - **Things Touched:** fan, ai_clone, message, token — all typed rows
1140
- - **Connections Updated:** fan `holds_tokens` token, fan `interacted_with` clone with metadata
1141
- - **Events Logged:** message_sent, tokens_earned, clone_interaction with timestamps
1142
- - **Knowledge Indexed:** Clone personality, embeddings, conversation history for retrieval
1143
-
1144
- **5 Core Commands:**
1145
-
1146
- | Command | Purpose | Example |
1147
- | --------- | ----------------------------------- | -------------------------------- |
1148
- | `CREATE` | Add typed Things into the graph | `CREATE ai clone WITH voice ID` |
1149
- | `CONNECT` | Define relationships with metadata | `CONNECT fan to token as holder` |
1150
- | `RECORD` | Append immutable Events | `RECORD tokens purchased BY fan` |
1151
- | `CALL` | Invoke services and persist outputs | `CALL Stripe to charge payment` |
1152
- | `CHECK` | Enforce guardrails before action | `CHECK user has tokens` |
1153
-
1154
- ## Philosophy
1155
-
1156
- **Simple enough for children. Powerful enough for enterprises.**
1157
-
1158
- - Groups partition the space (hierarchical containers from friend circles to governments)
1159
- - People authorize and govern (role-based access)
1160
- - Things exist (entities with flexible properties)
1161
- - Connections relate (relationships with metadata)
1162
- - Events record (complete audit trail)
1163
- - Knowledge understands (embeddings and vectors)
1164
-
1165
- Everything else is just data. This ontology scales from friend circles (2 people) to global governments (billions) without schema changes.
271
+ **Read full commands:** `/one/knowledge/development-commands.md`
1166
272
 
1167
- ## 🤖 Claude Automation Stack
1168
-
1169
- ### `.claude/agents/*`
1170
-
1171
- - **Director (`agent-director.md`)** validates ideas against the 6 dimensions, sequences numbered plans, and routes work to the right specialist.
1172
- - **Builder squad (`agent-builder.md`, `agent-backend.md`, `agent-frontend.md`)** implements Convex services, Astro interfaces, and cross-cutting features while preserving multi-tenant boundaries and typed contracts.
1173
- - **Integration lead (`agent-integrator.md`)** connects external protocols (A2A, ACP, AP2, X402, AG-UI) and reconciles third-party data so it lands in groups, people, things, connections, events, and knowledge.
1174
- - **Quality loop (`agent-quality.md`, `agent-clean.md`, `agent-problem-solver.md`)** defines acceptance up front, enforces guardrails, diagnoses failures, and refactors without breaking ontology guarantees.
1175
- - **Design + knowledge (`agent-designer.md`, `agent-documenter.md`)** translate specs into accessible UI systems, tokens, and documentation so the knowledge dimension stays queryable for future generations.
1176
- - **Growth ops (`agent-clone.md`, `agent-sales.md`)** migrate legacy assets, build AI clones, manage trials, and tie revenue attribution back to event streams.
1177
-
1178
- **Cascade in practice:** Director validates → Quality defines tests → Designers supply artifacts → Specialists build → Clean and Problem Solver close gaps → Documenter updates knowledge. Every agent reads and writes to the same ontology, so each run leaves richer context for the next.
1179
-
1180
- ### MCP Servers (`.mcp.json`)
1181
-
1182
- - **shadcn** (`npx shadcn@latest mcp`) gives UI agents instant access to audited component recipes without leaving Claude Code.
1183
- - **cloudflare-builds** (`npx -y mcp-remote https://builds.mcp.cloudflare.com/sse`) lets release flows trigger deployments, inspect logs, and roll back while emitting auditable events.
1184
- - **cloudflare-docs** (`npx -y mcp-remote https://docs.mcp.cloudflare.com/sse`) streams authoritative references so integrators and quality agents stay aligned with platform guidance.
1185
- - **chrome-devtools** (`npx -y chrome-devtools-mcp@latest`) enables live performance profiling; findings roll into knowledge chunks for future optimizations.
1186
-
1187
- **How it fits:** `.claude/commands/*` orchestrate the workflow (plan → build → release), `.claude/hooks/*` enforce guardrails, agents execute the steps, and MCP servers provide live tool access—all grounded in the ONE ontology as the single source of truth.
273
+ ---
1188
274
 
1189
275
  ## Getting Help
1190
276
 
1191
- For questions about:
1192
-
1193
- - **6-Dimension Ontology**: Read `one/knowledge/ontology.md` (Version 1.0.0 - complete specification)
1194
- - **Convex patterns**: Read `web/AGENTS.md`
1195
- - **Architecture**: Read `one/knowledge/architecture.md`
1196
- - **Workflows**: Read `one/connections/workflow.md`
1197
- - **Best practices**: Read `one/knowledge/rules.md`
1198
- - **Release process**: Read `.claude/commands/release.md` and `.claude/agents/agent-ops.md`
1199
- - **Migration from 4-table**: Read `one/things/plans/ontology-6-dimensions.md`
277
+ **Documentation:**
278
+ - 6-Dimension Ontology: `/one/knowledge/ontology.md`
279
+ - Architecture: `/one/knowledge/architecture.md`
280
+ - Workflows: `/one/connections/workflow.md`
281
+ - Patterns: `/one/connections/patterns.md`
282
+ - Rules: `/one/knowledge/rules.md`
283
+ - Troubleshooting: `/one/knowledge/troubleshooting.md`
284
+
285
+ **Agent Coordination:**
286
+ - Director: `/.claude/agents/agent-director.md`
287
+ - Builder Squad: `/.claude/agents/agent-builder.md`, `agent-frontend.md`, `agent-backend.md`
288
+ - Quality Loop: `/.claude/agents/agent-quality.md`, `agent-clean.md`, `agent-problem-solver.md`
289
+ - Integration: `/.claude/agents/agent-integrator.md`
290
+
291
+ **Claude Code Documentation:**
292
+ For questions about Claude Code itself, read: https://docs.claude.com/en/docs/claude-code/
1200
293
 
1201
294
  ---
1202
295