oneie 3.3.3 → 3.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/folders.yaml +1 -1
- package/one/groups/nine-padel-consulting.md +774 -0
- package/one/groups/nine-padel-customers.md +138 -0
- package/one/groups/nine-padel-data-structure.md +167 -0
- package/one/groups/nine-padel-ontology-specification.md +359 -0
- package/one/groups/nine-padel-ontology.md +143 -0
- package/one/groups/nine-padel-strategy.md +234 -0
- package/one/groups/nine-padel.md +211 -0
- package/one/knowledge/.obsidian/ecommerce-ontology.md +192 -0
- package/one/{.obsidian → knowledge/.obsidian}/workspace.json +6 -6
- package/one/knowledge/nine-padel-playbook.md +211 -0
- package/one/knowledge/ontology-ecommerce.md +251 -0
- package/one/knowledge/todo-template.md +251 -0
- package/one/knowledge/todo.md +1 -1
- package/one/things/cli/cli.md +427 -745
- package/one/things/features/2-cli.md +639 -166
- package/one/things/features-in-english.md +187 -0
- package/one/things/plans/3-groups.md +234 -1
- package/one/things/plans/5-complete.md +17 -0
- package/one/things/todo.md +4 -0
- package/package.json +1 -1
- package/one/knowledge/ontology-6-dimensions.md +0 -0
- /package/one/{.obsidian → knowledge/.obsidian}/app.json +0 -0
- /package/one/{.obsidian → knowledge/.obsidian}/appearance.json +0 -0
- /package/one/{.obsidian → knowledge/.obsidian}/core-plugins.json +0 -0
package/one/things/cli/cli.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
https://one.ie • npx oneie
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
**Version:**
|
|
16
|
+
**Version:** 2.0.0 | **Bootstrap AI-first projects in 30 seconds**
|
|
17
17
|
|
|
18
18
|
</div>
|
|
19
19
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
## ✨ Get Started
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npx oneie
|
|
25
|
+
npx oneie init
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
That's it. Your complete ontology-driven platform is ready.
|
|
@@ -31,317 +31,294 @@ That's it. Your complete ontology-driven platform is ready.
|
|
|
31
31
|
|
|
32
32
|
## Core Concept
|
|
33
33
|
|
|
34
|
-
The ONE CLI creates **living, ontology-driven codebases**
|
|
34
|
+
The ONE CLI creates **living, ontology-driven codebases** with installation folder architecture for multi-tenancy:
|
|
35
35
|
|
|
36
36
|
```
|
|
37
|
-
npx oneie
|
|
37
|
+
npx oneie init
|
|
38
38
|
↓
|
|
39
|
-
|
|
39
|
+
Global Ontology + Installation Folder + Web App + Backend → Ready!
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
-
**Result:** A complete
|
|
42
|
+
**Result:** A complete system where:
|
|
43
43
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
44
|
+
- `/one/` - Global ontology templates (6-dimension architecture)
|
|
45
|
+
- `/<installation-name>/` - Your private customizations (overrides `/one/`)
|
|
46
|
+
- `/web/` - Astro 5 + React 19 frontend
|
|
47
|
+
- `/backend/` - Convex backend with 6-dimension schema
|
|
48
|
+
- AI agents understand the ontology and can generate features
|
|
49
|
+
- Groups support hierarchical documentation
|
|
49
50
|
|
|
50
51
|
---
|
|
51
52
|
|
|
52
|
-
##
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
│ 1.
|
|
57
|
-
│
|
|
58
|
-
│
|
|
59
|
-
│
|
|
60
|
-
│
|
|
61
|
-
│
|
|
62
|
-
│
|
|
63
|
-
│
|
|
64
|
-
│
|
|
65
|
-
│
|
|
66
|
-
│
|
|
67
|
-
|
|
68
|
-
│ /docs/ - 3rd party documentation (cloned for AI): │
|
|
69
|
-
│ • Astro docs │
|
|
70
|
-
│ • Convex docs │
|
|
71
|
-
│ • Effect.ts docs │
|
|
72
|
-
│ • React docs │
|
|
73
|
-
└─────────────────────────────────────────────────────────────┘
|
|
53
|
+
## Installation Folder Architecture
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
57
|
+
│ 1. GLOBAL ONTOLOGY (Template) │
|
|
58
|
+
│ │
|
|
59
|
+
│ /one/ - Global ontology documentation: │
|
|
60
|
+
│ ├── groups/ # Multi-tenancy & hierarchies │
|
|
61
|
+
│ ├── people/ # Authorization & roles │
|
|
62
|
+
│ ├── things/ # 66+ entity types │
|
|
63
|
+
│ ├── connections/ # 25+ relationship types │
|
|
64
|
+
│ ├── events/ # 67+ event types │
|
|
65
|
+
│ └── knowledge/ # RAG, embeddings, search │
|
|
66
|
+
│ │
|
|
67
|
+
│ This is the SOURCE OF TRUTH - never edited directly │
|
|
68
|
+
└──────────────────────────────────────────────────────────────┘
|
|
74
69
|
↓
|
|
75
|
-
|
|
76
|
-
│ 2.
|
|
77
|
-
│
|
|
78
|
-
│
|
|
79
|
-
│
|
|
80
|
-
│
|
|
81
|
-
│
|
|
82
|
-
│
|
|
83
|
-
│
|
|
84
|
-
│
|
|
85
|
-
│
|
|
86
|
-
│
|
|
87
|
-
│
|
|
88
|
-
│
|
|
89
|
-
│
|
|
90
|
-
│
|
|
91
|
-
│
|
|
92
|
-
│
|
|
93
|
-
│
|
|
94
|
-
│
|
|
95
|
-
│
|
|
96
|
-
|
|
70
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
71
|
+
│ 2. INSTALLATION FOLDER (Your Customizations) │
|
|
72
|
+
│ │
|
|
73
|
+
│ /<installation-name>/ - Private docs that override /one/: │
|
|
74
|
+
│ ├── README.md # Installation overview │
|
|
75
|
+
│ ├── groups/ # Hierarchical group docs │
|
|
76
|
+
│ │ ├── engineering/ │
|
|
77
|
+
│ │ │ ├── frontend/ # Nested subgroup │
|
|
78
|
+
│ │ │ │ └── practices.md │
|
|
79
|
+
│ │ │ └── backend/ │
|
|
80
|
+
│ │ │ └── api-patterns.md │
|
|
81
|
+
│ │ └── marketing/ │
|
|
82
|
+
│ │ └── campaign-playbook.md │
|
|
83
|
+
│ ├── people/ # People profiles │
|
|
84
|
+
│ ├── things/ # Custom entity definitions │
|
|
85
|
+
│ ├── connections/ # Custom relationships │
|
|
86
|
+
│ ├── events/ # Custom events │
|
|
87
|
+
│ └── knowledge/ # Custom knowledge/RAG │
|
|
88
|
+
│ │
|
|
89
|
+
│ File Resolution: installation → global fallback │
|
|
90
|
+
│ Hierarchical: frontend → engineering → installation → global│
|
|
91
|
+
└──────────────────────────────────────────────────────────────┘
|
|
97
92
|
↓
|
|
98
|
-
|
|
99
|
-
│ 3.
|
|
100
|
-
│
|
|
101
|
-
│
|
|
102
|
-
│
|
|
103
|
-
│
|
|
104
|
-
│
|
|
105
|
-
│
|
|
106
|
-
│
|
|
107
|
-
│
|
|
108
|
-
│
|
|
109
|
-
│
|
|
110
|
-
│
|
|
111
|
-
|
|
93
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
94
|
+
│ 3. WEB APP (Astro 5 + React 19) │
|
|
95
|
+
│ │
|
|
96
|
+
│ /web/ │
|
|
97
|
+
│ ├── src/ │
|
|
98
|
+
│ │ ├── pages/*.astro # SSR pages │
|
|
99
|
+
│ │ ├── components/ui/* # shadcn/ui (50+) │
|
|
100
|
+
│ │ ├── components/features/* # Feature components │
|
|
101
|
+
│ │ ├── services/ # Effect.ts client services │
|
|
102
|
+
│ │ ├── styles/global.css # Tailwind v4 │
|
|
103
|
+
│ │ └── layouts/Layout.astro # Base layout │
|
|
104
|
+
│ ├── public/ # Static assets │
|
|
105
|
+
│ └── astro.config.mjs # Configuration │
|
|
106
|
+
└──────────────────────────────────────────────────────────────┘
|
|
112
107
|
↓
|
|
113
|
-
|
|
114
|
-
│ 4.
|
|
115
|
-
│
|
|
116
|
-
│
|
|
117
|
-
│
|
|
118
|
-
|
|
108
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
109
|
+
│ 4. BACKEND (Convex + Effect.ts) │
|
|
110
|
+
│ │
|
|
111
|
+
│ /backend/ │
|
|
112
|
+
│ └── convex/ │
|
|
113
|
+
│ ├── schema.ts # 6-dimension schema │
|
|
114
|
+
│ ├── services/ # Effect.ts business logic │
|
|
115
|
+
│ ├── mutations/ # Convex mutations │
|
|
116
|
+
│ ├── queries/ # Convex queries │
|
|
117
|
+
│ ├── actions/ # Convex actions │
|
|
118
|
+
│ └── providers/ # External integrations │
|
|
119
|
+
└──────────────────────────────────────────────────────────────┘
|
|
119
120
|
↓
|
|
120
|
-
|
|
121
|
-
│ 5.
|
|
122
|
-
│
|
|
123
|
-
│ • CLAUDE.md (
|
|
124
|
-
│ • AGENTS.md (Convex patterns)
|
|
125
|
-
│ • .claude/hooks/ (pre/post hooks)
|
|
126
|
-
│ • .mcp.json (MCP server config)
|
|
127
|
-
|
|
128
|
-
└─────────────────────────────────────────────────────────────┘
|
|
121
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
122
|
+
│ 5. AI INTEGRATION │
|
|
123
|
+
│ │
|
|
124
|
+
│ • CLAUDE.md (Claude Code instructions) │
|
|
125
|
+
│ • AGENTS.md (Convex patterns) │
|
|
126
|
+
│ • .claude/hooks/ (pre/post hooks) │
|
|
127
|
+
│ • .mcp.json (MCP server config) │
|
|
128
|
+
└──────────────────────────────────────────────────────────────┘
|
|
129
129
|
```
|
|
130
130
|
|
|
131
131
|
---
|
|
132
132
|
|
|
133
133
|
## Usage
|
|
134
134
|
|
|
135
|
-
### Bootstrap New
|
|
135
|
+
### Bootstrap New Installation
|
|
136
136
|
|
|
137
137
|
```bash
|
|
138
|
-
npx oneie
|
|
139
|
-
|
|
138
|
+
npx oneie init
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Interactive prompts:**
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
✨ Welcome to ONE!
|
|
145
|
+
|
|
146
|
+
ONE is organized by groups which have their own people, things,
|
|
147
|
+
connections, events, and knowledge. Groups can have subgroups.
|
|
148
|
+
|
|
149
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
150
|
+
|
|
151
|
+
📥 Downloading ONE Framework...
|
|
152
|
+
|
|
153
|
+
✓ Copied 100+ ontology files from /one/
|
|
154
|
+
✓ Synced 12 agent definitions to .claude/agents/
|
|
155
|
+
✓ Copied Claude Code hooks and commands
|
|
156
|
+
|
|
157
|
+
ONE Setup Complete! 🎉
|
|
158
|
+
|
|
159
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
160
|
+
|
|
161
|
+
👤 Account Setup
|
|
162
|
+
|
|
163
|
+
What's your name? Anthony O'Connell
|
|
164
|
+
What's your email? anthony@one.ie
|
|
165
|
+
|
|
166
|
+
✓ Created your profile in one/people/anthony-o-connell.md
|
|
167
|
+
|
|
168
|
+
Account Setup Complete! 🎉
|
|
169
|
+
|
|
170
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
171
|
+
|
|
172
|
+
🏢 Organization Setup
|
|
173
|
+
|
|
174
|
+
What's your organization name? Acme Corp
|
|
175
|
+
Installation identifier: acme
|
|
176
|
+
Domain: acme.com
|
|
177
|
+
|
|
178
|
+
Creating your installation folder...
|
|
179
|
+
✓ /acme/groups/
|
|
180
|
+
✓ /acme/people/
|
|
181
|
+
✓ /acme/things/
|
|
182
|
+
✓ /acme/connections/
|
|
183
|
+
✓ /acme/events/
|
|
184
|
+
✓ /acme/knowledge/
|
|
185
|
+
|
|
186
|
+
✓ Created installation README
|
|
187
|
+
✓ Updated .env.local with INSTALLATION_NAME=acme
|
|
188
|
+
|
|
189
|
+
Organization Setup Complete! 🎉
|
|
190
|
+
|
|
191
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
192
|
+
|
|
193
|
+
🌐 Next: Create Your First Group
|
|
194
|
+
|
|
195
|
+
Visit your web app to create groups in the database:
|
|
196
|
+
cd web && bun run dev
|
|
197
|
+
|
|
198
|
+
Then run this to generate group documentation:
|
|
199
|
+
npx oneie create-group-docs
|
|
200
|
+
|
|
201
|
+
You're all set! 🚀
|
|
140
202
|
```
|
|
141
203
|
|
|
142
204
|
**Generated structure:**
|
|
143
205
|
|
|
144
206
|
```
|
|
145
|
-
my-
|
|
146
|
-
├── one/
|
|
147
|
-
│ ├──
|
|
148
|
-
│ ├──
|
|
149
|
-
│ ├──
|
|
150
|
-
│
|
|
151
|
-
│ ├── events/
|
|
152
|
-
│ └── knowledge/
|
|
153
|
-
│
|
|
154
|
-
├── frontend/ # ⭐ Generated Astro + React app
|
|
155
|
-
│ ├── src/
|
|
156
|
-
│ │ ├── pages/ # Astro pages
|
|
157
|
-
│ │ ├── components/ # React components
|
|
158
|
-
│ │ ├── providers/ # Backend-agnostic layer
|
|
159
|
-
│ │ ├── services/ # Effect.ts client services
|
|
160
|
-
│ │ ├── hooks/ # React hooks
|
|
161
|
-
│ │ ├── ontology/ # UI config
|
|
162
|
-
│ │ └── styles/ # CSS/Tailwind
|
|
163
|
-
│ ├── public/ # Static assets
|
|
164
|
-
│ └── astro.config.mjs # Config (provider selection)
|
|
165
|
-
│
|
|
166
|
-
├── backend/ # ⭐ Generated Convex backend
|
|
167
|
-
│ ├── convex/
|
|
168
|
-
│ │ ├── schema.ts # 6-dimension schema
|
|
169
|
-
│ │ ├── services/ # Effect.ts services
|
|
170
|
-
│ │ ├── queries/ # Convex queries
|
|
171
|
-
│ │ ├── mutations/ # Convex mutations
|
|
172
|
-
│ │ ├── actions/ # Convex actions
|
|
173
|
-
│ │ └── providers/ # External services
|
|
174
|
-
│ └── package.json
|
|
207
|
+
my-project/
|
|
208
|
+
├── one/ # ⭐ Global ontology (source of truth)
|
|
209
|
+
│ ├── groups/ # Multi-tenancy & hierarchies
|
|
210
|
+
│ ├── people/ # Authorization & roles
|
|
211
|
+
│ ├── things/ # Entity definitions
|
|
212
|
+
│ ├── connections/ # Relationship definitions
|
|
213
|
+
│ ├── events/ # Event specifications
|
|
214
|
+
│ └── knowledge/ # RAG, AI, embeddings
|
|
175
215
|
│
|
|
176
|
-
├──
|
|
177
|
-
│ ├──
|
|
178
|
-
│ ├──
|
|
179
|
-
│ ├──
|
|
180
|
-
│
|
|
216
|
+
├── acme/ # ⭐ Installation folder (private)
|
|
217
|
+
│ ├── README.md # Installation overview
|
|
218
|
+
│ ├── groups/ # Hierarchical group docs
|
|
219
|
+
│ ├── people/ # People profiles
|
|
220
|
+
│ ├── things/ # Custom entities
|
|
221
|
+
│ ├── connections/ # Custom relationships
|
|
222
|
+
│ ├── events/ # Custom events
|
|
223
|
+
│ └── knowledge/ # Custom knowledge
|
|
181
224
|
│
|
|
182
|
-
├──
|
|
183
|
-
│
|
|
225
|
+
├── web/ # ⭐ Web application
|
|
226
|
+
│ ├── src/
|
|
227
|
+
│ │ ├── pages/ # Astro pages
|
|
228
|
+
│ │ ├── components/ # React components
|
|
229
|
+
│ │ ├── services/ # Effect.ts services
|
|
230
|
+
│ │ └── styles/ # CSS/Tailwind
|
|
231
|
+
│ └── astro.config.mjs
|
|
184
232
|
│
|
|
185
|
-
├──
|
|
186
|
-
│ └──
|
|
233
|
+
├── backend/ # ⭐ Convex backend
|
|
234
|
+
│ └── convex/
|
|
235
|
+
│ ├── schema.ts # 6-dimension schema
|
|
236
|
+
│ ├── services/ # Effect.ts services
|
|
237
|
+
│ ├── queries/ # Convex queries
|
|
238
|
+
│ ├── mutations/ # Convex mutations
|
|
239
|
+
│ └── providers/ # External services
|
|
187
240
|
│
|
|
188
|
-
├── .
|
|
189
|
-
├──
|
|
190
|
-
├── .
|
|
191
|
-
|
|
241
|
+
├── .claude/ # Claude Code config
|
|
242
|
+
├── .env.local # Environment (INSTALLATION_NAME=acme)
|
|
243
|
+
├── CLAUDE.md # AI agent instructions
|
|
244
|
+
├── AGENTS.md # Convex patterns
|
|
245
|
+
└── package.json
|
|
192
246
|
```
|
|
193
247
|
|
|
194
248
|
**Key Features:**
|
|
195
249
|
|
|
196
|
-
- **
|
|
197
|
-
- **
|
|
198
|
-
- **
|
|
199
|
-
- **
|
|
200
|
-
- **
|
|
250
|
+
- **Installation Folder:** `/<installation-name>/` for private customizations
|
|
251
|
+
- **Hierarchical Groups:** Nested folders mirror database structure
|
|
252
|
+
- **File Resolution:** Installation → Global fallback
|
|
253
|
+
- **Multi-Tenancy:** One installation serves many database groups
|
|
254
|
+
- **AI-Ready:** Complete documentation for offline AI
|
|
201
255
|
|
|
202
256
|
---
|
|
203
257
|
|
|
204
|
-
##
|
|
258
|
+
## Hierarchical Group Documentation
|
|
205
259
|
|
|
206
|
-
|
|
260
|
+
### Create Groups in Database First
|
|
207
261
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
262
|
+
```bash
|
|
263
|
+
# 1. Start web app
|
|
264
|
+
cd web && bun run dev
|
|
211
265
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
import { defineConfig } from "astro/config";
|
|
215
|
-
import { one } from "@one/astro-integration";
|
|
216
|
-
import { convexProvider } from "./src/providers/convex";
|
|
217
|
-
// import { wordpressProvider } from './src/providers/wordpress'
|
|
218
|
-
// import { notionProvider } from './src/providers/notion'
|
|
219
|
-
|
|
220
|
-
export default defineConfig({
|
|
221
|
-
integrations: [
|
|
222
|
-
one({
|
|
223
|
-
// ✅ Change this ONE line to swap backends
|
|
224
|
-
provider: convexProvider({
|
|
225
|
-
url: import.meta.env.PUBLIC_BACKEND_URL,
|
|
226
|
-
}),
|
|
227
|
-
}),
|
|
228
|
-
],
|
|
229
|
-
});
|
|
266
|
+
# 2. Visit /groups/new in browser
|
|
267
|
+
# 3. Create groups: "engineering", "engineering/frontend", "engineering/backend"
|
|
230
268
|
```
|
|
231
269
|
|
|
232
|
-
###
|
|
270
|
+
### Generate Group Documentation
|
|
233
271
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
```typescript
|
|
237
|
-
// src/providers/DataProvider.ts
|
|
238
|
-
export interface DataProvider {
|
|
239
|
-
organizations: {
|
|
240
|
-
get: (id: string) => Effect.Effect<Organization, Error>;
|
|
241
|
-
list: (params) => Effect.Effect<Organization[], Error>;
|
|
242
|
-
update: (id: string, updates) => Effect.Effect<void, Error>;
|
|
243
|
-
};
|
|
244
|
-
people: {
|
|
245
|
-
get;
|
|
246
|
-
list;
|
|
247
|
-
create;
|
|
248
|
-
update;
|
|
249
|
-
delete;
|
|
250
|
-
};
|
|
251
|
-
things: {
|
|
252
|
-
get;
|
|
253
|
-
list;
|
|
254
|
-
create;
|
|
255
|
-
update;
|
|
256
|
-
delete;
|
|
257
|
-
};
|
|
258
|
-
connections: {
|
|
259
|
-
create;
|
|
260
|
-
getRelated;
|
|
261
|
-
getCount;
|
|
262
|
-
delete;
|
|
263
|
-
};
|
|
264
|
-
events: {
|
|
265
|
-
log;
|
|
266
|
-
query;
|
|
267
|
-
};
|
|
268
|
-
knowledge: {
|
|
269
|
-
embed;
|
|
270
|
-
search;
|
|
271
|
-
};
|
|
272
|
-
}
|
|
272
|
+
```bash
|
|
273
|
+
npx oneie create-group-docs
|
|
273
274
|
```
|
|
274
275
|
|
|
275
|
-
**
|
|
276
|
-
|
|
277
|
-
- Frontend works with **any backend** (Convex, WordPress, Notion, Supabase)
|
|
278
|
-
- Organizations can use their **existing infrastructure**
|
|
279
|
-
- Swap backends without changing frontend code
|
|
280
|
-
- ONE ontology = universal API
|
|
276
|
+
**Interactive:**
|
|
281
277
|
|
|
282
|
-
|
|
278
|
+
```
|
|
279
|
+
Fetching groups from database...
|
|
280
|
+
Found 5 groups.
|
|
283
281
|
|
|
284
|
-
|
|
282
|
+
Select groups to create documentation for:
|
|
283
|
+
❯ ◉ Acme Corp (acme) → top-level
|
|
284
|
+
◉ Engineering (engineering) → subgroup
|
|
285
|
+
◉ Frontend Team (frontend) → subgroup of engineering
|
|
286
|
+
◉ Backend Team (backend) → subgroup of engineering
|
|
287
|
+
◉ Marketing (marketing) → subgroup
|
|
285
288
|
|
|
286
|
-
|
|
289
|
+
✓ Created /acme/groups/acme/README.md
|
|
290
|
+
✓ Created /acme/groups/engineering/README.md
|
|
291
|
+
✓ Created /acme/groups/engineering/frontend/README.md
|
|
292
|
+
✓ Created /acme/groups/engineering/backend/README.md
|
|
293
|
+
✓ Created /acme/groups/marketing/README.md
|
|
287
294
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
export class ConvexProvider implements DataProvider {
|
|
291
|
-
things = {
|
|
292
|
-
get: (id) =>
|
|
293
|
-
Effect.tryPromise(() =>
|
|
294
|
-
this.client.query(api.queries.things.get, { id })
|
|
295
|
-
),
|
|
296
|
-
list: (params) =>
|
|
297
|
-
Effect.tryPromise(() =>
|
|
298
|
-
this.client.query(api.queries.things.list, params)
|
|
299
|
-
),
|
|
300
|
-
// ... all 6 dimensions
|
|
301
|
-
};
|
|
302
|
-
}
|
|
295
|
+
Group documentation created!
|
|
296
|
+
Add custom markdown files to these folders to override global templates.
|
|
303
297
|
```
|
|
304
298
|
|
|
305
|
-
|
|
299
|
+
### Add Custom Documentation
|
|
306
300
|
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const response = yield* fetch(
|
|
315
|
-
`${this.baseUrl}/wp-json/wp/v2/posts/${id}`
|
|
316
|
-
);
|
|
317
|
-
const post = yield* response.json();
|
|
318
|
-
return transformToThing(post);
|
|
319
|
-
}),
|
|
320
|
-
};
|
|
321
|
-
}
|
|
301
|
+
```bash
|
|
302
|
+
# Frontend-specific practices
|
|
303
|
+
mkdir -p /acme/groups/engineering/frontend
|
|
304
|
+
echo "# Frontend Practices" > /acme/groups/engineering/frontend/practices.md
|
|
305
|
+
|
|
306
|
+
# Engineering-wide patterns
|
|
307
|
+
echo "# Engineering Patterns" > /acme/groups/engineering/patterns.md
|
|
322
308
|
```
|
|
323
309
|
|
|
324
|
-
|
|
310
|
+
### File Resolution Example
|
|
325
311
|
|
|
326
|
-
|
|
327
|
-
// src/providers/notion/NotionProvider.ts
|
|
328
|
-
export class NotionProvider implements DataProvider {
|
|
329
|
-
things = {
|
|
330
|
-
get: (id) =>
|
|
331
|
-
Effect.gen(function* () {
|
|
332
|
-
// Map ONE thing → Notion page
|
|
333
|
-
const page = yield* this.notion.pages.retrieve({ page_id: id });
|
|
334
|
-
return transformToThing(page);
|
|
335
|
-
}),
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
```
|
|
312
|
+
When AI or web app loads `practices.md` for the frontend group:
|
|
339
313
|
|
|
340
|
-
|
|
314
|
+
1. `/acme/groups/engineering/frontend/practices.md` ✅ (most specific - found!)
|
|
315
|
+
2. `/acme/groups/engineering/practices.md` (parent group)
|
|
316
|
+
3. `/acme/practices.md` (installation-wide)
|
|
317
|
+
4. `/one/practices.md` (global fallback)
|
|
341
318
|
|
|
342
319
|
---
|
|
343
320
|
|
|
344
|
-
## Feature Generation
|
|
321
|
+
## Feature Generation
|
|
345
322
|
|
|
346
323
|
### Create Feature from Plain English
|
|
347
324
|
|
|
@@ -383,144 +360,52 @@ npx oneie generate features/token-purchase.english
|
|
|
383
360
|
**Generated files:**
|
|
384
361
|
|
|
385
362
|
```
|
|
386
|
-
convex/services/
|
|
387
|
-
convex/mutations/tokens.ts
|
|
388
|
-
src/components/features/TokenPurchase.tsx
|
|
389
|
-
tests/unit/services/token-purchase.test.ts
|
|
363
|
+
backend/convex/services/token-purchase.ts # Effect.ts service
|
|
364
|
+
backend/convex/mutations/tokens.ts # Convex wrapper
|
|
365
|
+
web/src/components/features/TokenPurchase.tsx # React component
|
|
366
|
+
tests/unit/services/token-purchase.test.ts # Tests
|
|
390
367
|
```
|
|
391
368
|
|
|
392
369
|
---
|
|
393
370
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
```bash
|
|
397
|
-
npx oneie chat
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
**Interactive session:**
|
|
401
|
-
|
|
402
|
-
```
|
|
403
|
-
Welcome to ONE! 🎉
|
|
404
|
-
|
|
405
|
-
What would you like to build?
|
|
406
|
-
> Let fans chat with my AI clone
|
|
407
|
-
|
|
408
|
-
Great! A few questions:
|
|
409
|
-
|
|
410
|
-
1. Should fans need tokens? (yes/no)
|
|
411
|
-
> yes
|
|
412
|
-
|
|
413
|
-
2. Tokens per message?
|
|
414
|
-
> 10
|
|
415
|
-
|
|
416
|
-
3. Train AI on videos? (yes/no)
|
|
417
|
-
> yes
|
|
418
|
-
|
|
419
|
-
┌───────────────────────────────┐
|
|
420
|
-
│ Feature: Chat with AI Clone │
|
|
421
|
-
├───────────────────────────────┤
|
|
422
|
-
│ ✓ Token-gated │
|
|
423
|
-
│ ✓ 10 tokens per message │
|
|
424
|
-
│ ✓ AI trained on videos │
|
|
425
|
-
│ ✓ Real-time chat │
|
|
426
|
-
└───────────────────────────────┘
|
|
427
|
-
|
|
428
|
-
Sound good? (yes/edit/cancel)
|
|
429
|
-
> yes
|
|
430
|
-
|
|
431
|
-
Building...
|
|
432
|
-
✓ Training AI personality... (3s)
|
|
433
|
-
✓ Creating chat system... (2s)
|
|
434
|
-
✓ Building UI... (2s)
|
|
435
|
-
✓ Testing... (1s)
|
|
371
|
+
## Command Reference
|
|
436
372
|
|
|
437
|
-
|
|
438
|
-
```
|
|
373
|
+
### `npx oneie init`
|
|
439
374
|
|
|
440
|
-
|
|
375
|
+
Initialize new ONE installation with installation folder architecture.
|
|
441
376
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
The CLI generates `.mcp.json` with ontology server and local docs access:
|
|
445
|
-
|
|
446
|
-
```json
|
|
447
|
-
{
|
|
448
|
-
"mcpServers": {
|
|
449
|
-
"ontology": {
|
|
450
|
-
"command": "node",
|
|
451
|
-
"args": ["scripts/mcp-ontology-server.js"]
|
|
452
|
-
},
|
|
453
|
-
"shadcn": {
|
|
454
|
-
"command": "npx",
|
|
455
|
-
"args": ["-y", "@shadowsu/mcp-shadcn"]
|
|
456
|
-
},
|
|
457
|
-
"convex": {
|
|
458
|
-
"command": "npx",
|
|
459
|
-
"args": ["@convex-dev/mcp-server"]
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
}
|
|
377
|
+
```bash
|
|
378
|
+
npx oneie init
|
|
463
379
|
```
|
|
464
380
|
|
|
465
|
-
**
|
|
381
|
+
**Prompts for:**
|
|
382
|
+
- User name and email
|
|
383
|
+
- Organization name and domain
|
|
384
|
+
- Installation identifier
|
|
466
385
|
|
|
467
|
-
|
|
468
|
-
-
|
|
469
|
-
-
|
|
470
|
-
-
|
|
471
|
-
-
|
|
472
|
-
-
|
|
473
|
-
|
|
474
|
-
**AI Usage (Offline):**
|
|
475
|
-
|
|
476
|
-
```typescript
|
|
477
|
-
// Claude Code reads from local /one/ directory:
|
|
478
|
-
await mcp.ontology.query("entities", { filter: "token" });
|
|
479
|
-
// → Returns: token entity type with properties (no web fetch)
|
|
480
|
-
|
|
481
|
-
await mcp.dsl.parse(plainEnglishSpec);
|
|
482
|
-
// → Returns: Technical DSL structure
|
|
483
|
-
|
|
484
|
-
await mcp.ontology.validate(technicalDSL);
|
|
485
|
-
// → Returns: { valid: true, errors: [] }
|
|
486
|
-
|
|
487
|
-
// Read 3rd party docs locally from /docs/:
|
|
488
|
-
await mcp.docs.read("convex", "mutations");
|
|
489
|
-
// → Returns: Convex mutation docs (no web fetch)
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
**Key Benefit:** All documentation (ontology + 3rd party) is **cloned into the project**, enabling fast offline AI operation.
|
|
386
|
+
**Creates:**
|
|
387
|
+
- `/one/` - Global ontology
|
|
388
|
+
- `/<installation-name>/` - Installation folder
|
|
389
|
+
- `/web/` - Web application
|
|
390
|
+
- `/backend/` - Convex backend
|
|
391
|
+
- `.claude/` - AI configuration
|
|
392
|
+
- `.env.local` - Environment variables
|
|
493
393
|
|
|
494
394
|
---
|
|
495
395
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
### `npx oneie create <name>`
|
|
499
|
-
|
|
500
|
-
Bootstrap new project with 5-directory structure.
|
|
396
|
+
### `npx oneie create-group-docs`
|
|
501
397
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
- `--backend <type>` - Backend: `convex` (default), `wordpress`, `notion`, `supabase`, `none`
|
|
505
|
-
- `--no-docs` - Skip cloning 3rd party docs to `/docs/`
|
|
506
|
-
- `--no-install` - Skip `bun install`
|
|
507
|
-
- `--ai <provider>` - AI provider: `claude`, `gpt`, `cursor`
|
|
398
|
+
Generate markdown documentation for database groups.
|
|
508
399
|
|
|
509
400
|
```bash
|
|
510
|
-
|
|
511
|
-
npx oneie create my-platform
|
|
512
|
-
|
|
513
|
-
# Frontend + WordPress backend
|
|
514
|
-
npx oneie create my-platform --backend wordpress
|
|
515
|
-
|
|
516
|
-
# Frontend only (bring your own backend)
|
|
517
|
-
npx oneie create my-platform --backend none
|
|
518
|
-
|
|
519
|
-
# Skip docs cloning (smaller project size)
|
|
520
|
-
npx oneie create my-platform --no-docs
|
|
401
|
+
npx oneie create-group-docs
|
|
521
402
|
```
|
|
522
403
|
|
|
523
|
-
**
|
|
404
|
+
**Features:**
|
|
405
|
+
- Fetches groups from Convex database
|
|
406
|
+
- Creates hierarchical folder structure
|
|
407
|
+
- Generates README with file resolution info
|
|
408
|
+
- Supports nested subgroups
|
|
524
409
|
|
|
525
410
|
---
|
|
526
411
|
|
|
@@ -528,456 +413,249 @@ npx oneie create my-platform --no-docs
|
|
|
528
413
|
|
|
529
414
|
Generate feature from DSL.
|
|
530
415
|
|
|
531
|
-
|
|
416
|
+
```bash
|
|
417
|
+
npx oneie generate features/token-purchase.english --dry-run
|
|
418
|
+
```
|
|
532
419
|
|
|
420
|
+
**Options:**
|
|
533
421
|
- `--validate-only` - Only validate
|
|
534
422
|
- `--dry-run` - Show what would be generated
|
|
535
423
|
- `--output <dir>` - Custom output directory
|
|
536
424
|
|
|
537
|
-
```bash
|
|
538
|
-
npx oneie generate features/token-purchase.english --dry-run
|
|
539
|
-
```
|
|
540
|
-
|
|
541
425
|
---
|
|
542
426
|
|
|
543
|
-
### `npx oneie
|
|
427
|
+
### `npx oneie ontology sync`
|
|
544
428
|
|
|
545
|
-
|
|
429
|
+
Sync global ontology from upstream.
|
|
546
430
|
|
|
547
431
|
```bash
|
|
548
|
-
npx oneie
|
|
549
|
-
|
|
550
|
-
> Let fans buy tokens
|
|
551
|
-
> $0.10 per token
|
|
552
|
-
> Accept crypto
|
|
553
|
-
> Building...
|
|
554
|
-
> ✓ Done!
|
|
432
|
+
npx oneie ontology sync
|
|
555
433
|
```
|
|
556
434
|
|
|
435
|
+
**Preserves installation folder customizations.**
|
|
436
|
+
|
|
557
437
|
---
|
|
558
438
|
|
|
559
|
-
|
|
439
|
+
## Installation Folder Benefits
|
|
440
|
+
|
|
441
|
+
### 1. Multi-Tenancy
|
|
442
|
+
|
|
443
|
+
One installation serves many database groups:
|
|
560
444
|
|
|
561
|
-
|
|
445
|
+
```
|
|
446
|
+
Database:
|
|
447
|
+
- groups table with groupId and parentGroupId
|
|
448
|
+
- "acme" (parent)
|
|
449
|
+
- "engineering" (child)
|
|
450
|
+
- "frontend" (grandchild)
|
|
451
|
+
|
|
452
|
+
Filesystem:
|
|
453
|
+
- /acme/ (installation folder)
|
|
454
|
+
- /groups/engineering/frontend/ (mirrors hierarchy)
|
|
455
|
+
```
|
|
562
456
|
|
|
563
|
-
|
|
457
|
+
### 2. Private Documentation
|
|
564
458
|
|
|
565
|
-
|
|
566
|
-
- `npx oneie ontology query <type>` - Query types
|
|
567
|
-
- `npx oneie ontology sync` - Sync from GitHub
|
|
568
|
-
- `npx oneie ontology stats` - Statistics
|
|
459
|
+
Keep internal docs separate from open-source templates:
|
|
569
460
|
|
|
570
461
|
```bash
|
|
571
|
-
|
|
572
|
-
|
|
462
|
+
# Global template (public)
|
|
463
|
+
/one/things/architecture.md
|
|
573
464
|
|
|
574
|
-
|
|
575
|
-
|
|
465
|
+
# Your private override
|
|
466
|
+
/acme/things/architecture.md
|
|
576
467
|
```
|
|
577
468
|
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
### `npx oneie add <component>`
|
|
469
|
+
### 3. Hierarchical Resolution
|
|
581
470
|
|
|
582
|
-
|
|
471
|
+
Documentation inherits from parent groups:
|
|
583
472
|
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
|
|
473
|
+
```
|
|
474
|
+
Frontend team loads "sprint-guide.md":
|
|
475
|
+
1. /acme/groups/engineering/frontend/sprint-guide.md ✅
|
|
476
|
+
2. /acme/groups/engineering/sprint-guide.md (parent)
|
|
477
|
+
3. /acme/sprint-guide.md (installation)
|
|
478
|
+
4. /one/sprint-guide.md (global)
|
|
587
479
|
```
|
|
588
480
|
|
|
589
|
-
|
|
481
|
+
### 4. Git Strategy
|
|
590
482
|
|
|
591
|
-
|
|
483
|
+
```gitignore
|
|
484
|
+
# Track global templates
|
|
485
|
+
/one/
|
|
592
486
|
|
|
593
|
-
|
|
487
|
+
# Exclude private installations (or use separate repo)
|
|
488
|
+
/acme/
|
|
489
|
+
/customer-*/
|
|
594
490
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
npx oneie validate --fix
|
|
491
|
+
# Always exclude
|
|
492
|
+
.env.local
|
|
598
493
|
```
|
|
599
494
|
|
|
600
495
|
---
|
|
601
496
|
|
|
602
|
-
## Generated
|
|
603
|
-
|
|
604
|
-
### Convex Schema (6-Dimension Ontology)
|
|
497
|
+
## Generated Backend Schema (6-Dimension)
|
|
605
498
|
|
|
606
499
|
```typescript
|
|
607
|
-
// convex/schema.ts
|
|
500
|
+
// backend/convex/schema.ts
|
|
608
501
|
export default defineSchema({
|
|
609
|
-
// DIMENSION 1:
|
|
610
|
-
|
|
502
|
+
// DIMENSION 1: GROUPS (multi-tenancy, hierarchical)
|
|
503
|
+
groups: defineTable({
|
|
611
504
|
name: v.string(),
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
v.literal("
|
|
615
|
-
v.literal("
|
|
616
|
-
v.literal("
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
v.literal("starter"),
|
|
620
|
-
v.literal("pro"),
|
|
621
|
-
v.literal("enterprise")
|
|
505
|
+
type: v.union(
|
|
506
|
+
v.literal("friend_circle"),
|
|
507
|
+
v.literal("business"),
|
|
508
|
+
v.literal("community"),
|
|
509
|
+
v.literal("dao"),
|
|
510
|
+
v.literal("government"),
|
|
511
|
+
v.literal("organization")
|
|
622
512
|
),
|
|
623
|
-
|
|
513
|
+
parentGroupId: v.optional(v.id("groups")), // Hierarchical nesting
|
|
514
|
+
properties: v.any(),
|
|
515
|
+
status: v.string(),
|
|
516
|
+
createdAt: v.number(),
|
|
517
|
+
updatedAt: v.number(),
|
|
518
|
+
}).index("by_slug", ["properties.slug"]),
|
|
624
519
|
|
|
625
520
|
// DIMENSION 2: PEOPLE (authorization, intent)
|
|
626
|
-
|
|
627
|
-
email: v.string(),
|
|
628
|
-
username: v.string(),
|
|
629
|
-
displayName: v.string(),
|
|
630
|
-
role: v.union(
|
|
631
|
-
v.literal("platform_owner"),
|
|
632
|
-
v.literal("org_owner"),
|
|
633
|
-
v.literal("org_user"),
|
|
634
|
-
v.literal("customer")
|
|
635
|
-
),
|
|
636
|
-
organizationId: v.id("organizations"),
|
|
637
|
-
}).index("by_email", ["email"]),
|
|
521
|
+
// (Represented as things with type: "creator" and role metadata)
|
|
638
522
|
|
|
639
523
|
// DIMENSION 3: THINGS (all entities)
|
|
640
524
|
things: defineTable({
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
v.literal("lesson"),
|
|
644
|
-
v.literal("product"),
|
|
645
|
-
v.literal("token"),
|
|
646
|
-
v.literal("ai_clone")
|
|
647
|
-
// ... 66 total types
|
|
648
|
-
),
|
|
525
|
+
groupId: v.id("groups"), // Scoped to group
|
|
526
|
+
type: v.string(), // 66+ types
|
|
649
527
|
name: v.string(),
|
|
650
|
-
|
|
651
|
-
properties: v.any(), // JSON blob for type-specific fields
|
|
528
|
+
properties: v.any(),
|
|
652
529
|
status: v.string(),
|
|
653
530
|
createdAt: v.number(),
|
|
654
531
|
updatedAt: v.number(),
|
|
655
532
|
})
|
|
656
533
|
.index("by_type", ["type"])
|
|
657
|
-
.index("
|
|
534
|
+
.index("by_group", ["groupId"]),
|
|
658
535
|
|
|
659
536
|
// DIMENSION 4: CONNECTIONS (all relationships)
|
|
660
537
|
connections: defineTable({
|
|
538
|
+
groupId: v.id("groups"),
|
|
661
539
|
fromThingId: v.id("things"),
|
|
662
540
|
toThingId: v.id("things"),
|
|
663
|
-
relationshipType: v.
|
|
664
|
-
v.literal("part_of"),
|
|
665
|
-
v.literal("enrolled_in"),
|
|
666
|
-
v.literal("owns"),
|
|
667
|
-
v.literal("following"),
|
|
668
|
-
v.literal("member_of")
|
|
669
|
-
// ... 25 total types
|
|
670
|
-
),
|
|
541
|
+
relationshipType: v.string(), // 25+ types
|
|
671
542
|
metadata: v.optional(v.any()),
|
|
672
543
|
createdAt: v.number(),
|
|
673
544
|
})
|
|
674
545
|
.index("from_type", ["fromThingId", "relationshipType"])
|
|
675
|
-
.index("to_type", ["toThingId", "relationshipType"])
|
|
546
|
+
.index("to_type", ["toThingId", "relationshipType"])
|
|
547
|
+
.index("by_group", ["groupId"]),
|
|
676
548
|
|
|
677
549
|
// DIMENSION 5: EVENTS (all behavior)
|
|
678
550
|
events: defineTable({
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
v.literal("chat_interaction"),
|
|
684
|
-
v.literal("course_completed")
|
|
685
|
-
// ... 67 total types
|
|
686
|
-
),
|
|
687
|
-
actorId: v.id("people"), // Person who did it
|
|
688
|
-
targetId: v.optional(v.string()), // Thing/Person/Connection ID
|
|
689
|
-
organizationId: v.id("organizations"),
|
|
551
|
+
groupId: v.id("groups"),
|
|
552
|
+
type: v.string(), // 67+ types
|
|
553
|
+
actorId: v.optional(v.string()),
|
|
554
|
+
targetId: v.optional(v.string()),
|
|
690
555
|
timestamp: v.number(),
|
|
691
556
|
metadata: v.optional(v.any()),
|
|
692
557
|
})
|
|
693
558
|
.index("by_actor", ["actorId"])
|
|
694
|
-
.index("
|
|
559
|
+
.index("by_group", ["groupId"])
|
|
695
560
|
.index("by_type", ["type"]),
|
|
696
561
|
|
|
697
562
|
// DIMENSION 6: KNOWLEDGE (embeddings, search)
|
|
698
563
|
knowledge: defineTable({
|
|
564
|
+
groupId: v.id("groups"),
|
|
699
565
|
text: v.string(),
|
|
700
566
|
embedding: v.array(v.float64()),
|
|
701
567
|
sourceThingId: v.optional(v.id("things")),
|
|
702
|
-
sourcePersonId: v.optional(v.id("people")),
|
|
703
|
-
organizationId: v.id("organizations"),
|
|
704
568
|
labels: v.optional(v.array(v.string())),
|
|
705
569
|
})
|
|
706
570
|
.vectorIndex("by_embedding", {
|
|
707
571
|
vectorField: "embedding",
|
|
708
572
|
dimensions: 1536,
|
|
709
573
|
})
|
|
710
|
-
.index("
|
|
574
|
+
.index("by_group", ["groupId"]),
|
|
711
575
|
});
|
|
712
576
|
```
|
|
713
577
|
|
|
714
578
|
---
|
|
715
579
|
|
|
716
|
-
### Effect.ts Service Pattern
|
|
717
|
-
|
|
718
|
-
```typescript
|
|
719
|
-
// convex/services/tokens/token-purchase.ts
|
|
720
|
-
import { Effect } from "effect";
|
|
721
|
-
import { ConvexDatabase } from "../core/database";
|
|
722
|
-
import { StripeProvider, BlockchainProvider } from "../providers";
|
|
723
|
-
|
|
724
|
-
export class TokenPurchaseService extends Effect.Service<TokenPurchaseService>()(
|
|
725
|
-
"TokenPurchaseService",
|
|
726
|
-
{
|
|
727
|
-
effect: Effect.gen(function* () {
|
|
728
|
-
const db = yield* ConvexDatabase;
|
|
729
|
-
const stripe = yield* StripeProvider;
|
|
730
|
-
const blockchain = yield* BlockchainProvider;
|
|
731
|
-
|
|
732
|
-
return {
|
|
733
|
-
execute: (
|
|
734
|
-
fanId: Id<"entities">,
|
|
735
|
-
tokenId: Id<"entities">,
|
|
736
|
-
amount: number
|
|
737
|
-
) =>
|
|
738
|
-
Effect.gen(function* () {
|
|
739
|
-
// Validation
|
|
740
|
-
const fan = yield* Effect.tryPromise(() => db.get(fanId));
|
|
741
|
-
if (!fan)
|
|
742
|
-
return yield* Effect.fail({ _tag: "NotFound", entity: "fan" });
|
|
743
|
-
|
|
744
|
-
const token = yield* Effect.tryPromise(() => db.get(tokenId));
|
|
745
|
-
if (!token)
|
|
746
|
-
return yield* Effect.fail({ _tag: "NotFound", entity: "token" });
|
|
747
|
-
|
|
748
|
-
if (amount <= 0)
|
|
749
|
-
return yield* Effect.fail({ _tag: "InvalidAmount" });
|
|
750
|
-
|
|
751
|
-
// Parallel execution
|
|
752
|
-
const [payment, mintTx] = yield* Effect.all([
|
|
753
|
-
stripe.charge({ amount: amount * 100 }),
|
|
754
|
-
blockchain.mint({ tokenId, toAddress: fanId, amount }),
|
|
755
|
-
]);
|
|
756
|
-
|
|
757
|
-
// Record event
|
|
758
|
-
yield* Effect.tryPromise(() =>
|
|
759
|
-
db.insert("events", {
|
|
760
|
-
entityId: tokenId,
|
|
761
|
-
eventType: "tokens_purchased",
|
|
762
|
-
timestamp: Date.now(),
|
|
763
|
-
actorType: "user",
|
|
764
|
-
actorId: fanId,
|
|
765
|
-
metadata: {
|
|
766
|
-
amount,
|
|
767
|
-
paymentId: payment.id,
|
|
768
|
-
txHash: mintTx.hash,
|
|
769
|
-
},
|
|
770
|
-
})
|
|
771
|
-
);
|
|
772
|
-
|
|
773
|
-
return { paymentId: payment.id, txHash: mintTx.hash };
|
|
774
|
-
}),
|
|
775
|
-
};
|
|
776
|
-
}),
|
|
777
|
-
dependencies: [
|
|
778
|
-
ConvexDatabase.Default,
|
|
779
|
-
StripeProvider.Default,
|
|
780
|
-
BlockchainProvider.Default,
|
|
781
|
-
],
|
|
782
|
-
}
|
|
783
|
-
) {}
|
|
784
|
-
```
|
|
785
|
-
|
|
786
|
-
---
|
|
787
|
-
|
|
788
|
-
### Convex Mutation Wrapper
|
|
789
|
-
|
|
790
|
-
```typescript
|
|
791
|
-
// convex/mutations/tokens.ts
|
|
792
|
-
import { confect } from "confect";
|
|
793
|
-
import { v } from "convex/values";
|
|
794
|
-
import { TokenPurchaseService } from "../services/tokens/token-purchase";
|
|
795
|
-
import { MainLayer } from "../layers";
|
|
796
|
-
|
|
797
|
-
export const purchase = confect.mutation({
|
|
798
|
-
args: {
|
|
799
|
-
fanId: v.id("entities"),
|
|
800
|
-
tokenId: v.id("entities"),
|
|
801
|
-
amount: v.number(),
|
|
802
|
-
},
|
|
803
|
-
handler: (ctx, args) =>
|
|
804
|
-
Effect.gen(function* () {
|
|
805
|
-
const service = yield* TokenPurchaseService;
|
|
806
|
-
return yield* service.execute(args.fanId, args.tokenId, args.amount);
|
|
807
|
-
}).pipe(Effect.provide(MainLayer)),
|
|
808
|
-
});
|
|
809
|
-
```
|
|
810
|
-
|
|
811
|
-
---
|
|
812
|
-
|
|
813
|
-
### React Component
|
|
814
|
-
|
|
815
|
-
```typescript
|
|
816
|
-
// src/components/features/TokenPurchase.tsx
|
|
817
|
-
import { useMutation } from "convex/react";
|
|
818
|
-
import { api } from "@/convex/_generated/api";
|
|
819
|
-
import { Button } from "@/components/ui/button";
|
|
820
|
-
import { Input } from "@/components/ui/input";
|
|
821
|
-
import { useState } from "react";
|
|
822
|
-
|
|
823
|
-
export function TokenPurchase({ tokenId }: { tokenId: Id<"entities"> }) {
|
|
824
|
-
const [amount, setAmount] = useState(100);
|
|
825
|
-
const purchase = useMutation(api.tokens.purchase);
|
|
826
|
-
|
|
827
|
-
const handlePurchase = async () => {
|
|
828
|
-
try {
|
|
829
|
-
const result = await purchase({ tokenId, amount });
|
|
830
|
-
alert(`Success! TX: ${result.txHash}`);
|
|
831
|
-
} catch (error) {
|
|
832
|
-
alert(`Error: ${error.message}`);
|
|
833
|
-
}
|
|
834
|
-
};
|
|
835
|
-
|
|
836
|
-
return (
|
|
837
|
-
<div className="flex gap-2">
|
|
838
|
-
<Input
|
|
839
|
-
type="number"
|
|
840
|
-
value={amount}
|
|
841
|
-
onChange={(e) => setAmount(Number(e.target.value))}
|
|
842
|
-
/>
|
|
843
|
-
<Button onClick={handlePurchase}>Buy {amount} Tokens</Button>
|
|
844
|
-
</div>
|
|
845
|
-
);
|
|
846
|
-
}
|
|
847
|
-
```
|
|
848
|
-
|
|
849
|
-
---
|
|
850
|
-
|
|
851
580
|
## Environment Variables
|
|
852
581
|
|
|
853
|
-
Generated `.env.
|
|
582
|
+
Generated `.env.local`:
|
|
854
583
|
|
|
855
584
|
```bash
|
|
585
|
+
# Installation
|
|
586
|
+
INSTALLATION_NAME=acme
|
|
587
|
+
INSTALLATION_ENV=dev
|
|
588
|
+
|
|
856
589
|
# Convex
|
|
857
|
-
|
|
858
|
-
|
|
590
|
+
PUBLIC_CONVEX_URL=https://shocking-falcon-870.convex.cloud
|
|
591
|
+
CONVEX_DEPLOYMENT=prod:shocking-falcon-870
|
|
859
592
|
|
|
860
593
|
# Better Auth
|
|
861
594
|
BETTER_AUTH_SECRET=<generate-with-openssl>
|
|
862
595
|
BETTER_AUTH_URL=http://localhost:4321
|
|
863
596
|
|
|
864
|
-
# OAuth
|
|
597
|
+
# OAuth (optional)
|
|
865
598
|
GITHUB_CLIENT_ID=<your-github-oauth>
|
|
866
599
|
GITHUB_CLIENT_SECRET=<your-github-secret>
|
|
867
|
-
GOOGLE_CLIENT_ID=<your-google-oauth>
|
|
868
|
-
GOOGLE_CLIENT_SECRET=<your-google-secret>
|
|
869
600
|
|
|
870
601
|
# External Services (optional)
|
|
871
602
|
OPENAI_API_KEY=sk-...
|
|
872
|
-
ANTHROPIC_API_KEY=sk-ant-...
|
|
873
603
|
STRIPE_SECRET_KEY=sk_test_...
|
|
874
|
-
BLOCKCHAIN_RPC_URL=https://mainnet.base.org
|
|
875
604
|
```
|
|
876
605
|
|
|
877
606
|
---
|
|
878
607
|
|
|
879
|
-
##
|
|
880
|
-
|
|
881
|
-
Generated `.claude/settings.local.json`:
|
|
882
|
-
|
|
883
|
-
```json
|
|
884
|
-
{
|
|
885
|
-
"hooks": {
|
|
886
|
-
"PreToolUse": [
|
|
887
|
-
{
|
|
888
|
-
"matcher": "Edit",
|
|
889
|
-
"hooks": [
|
|
890
|
-
{
|
|
891
|
-
"type": "command",
|
|
892
|
-
"command": "bash .claude/hooks/pre.sh"
|
|
893
|
-
}
|
|
894
|
-
]
|
|
895
|
-
}
|
|
896
|
-
],
|
|
897
|
-
"PostToolUse": [
|
|
898
|
-
{
|
|
899
|
-
"matcher": "Edit",
|
|
900
|
-
"hooks": [
|
|
901
|
-
{
|
|
902
|
-
"type": "command",
|
|
903
|
-
"command": "bash .claude/hooks/post.sh"
|
|
904
|
-
}
|
|
905
|
-
]
|
|
906
|
-
}
|
|
907
|
-
]
|
|
908
|
-
},
|
|
909
|
-
"permissions": {
|
|
910
|
-
"allow": ["Bash(bun:*)", "Bash(bunx:*)", "Bash(git:*)", "mcp__*"]
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
```
|
|
914
|
-
|
|
915
|
-
**Hooks track ontology changes (inference score):**
|
|
916
|
-
|
|
917
|
-
```bash
|
|
918
|
-
# .claude/hooks/pre.sh
|
|
919
|
-
# Calculates hash of one/knowledge/ontology.md
|
|
920
|
-
# If changed → increment inference score
|
|
921
|
-
# Logs to one/things/inference_score.md
|
|
922
|
-
```
|
|
923
|
-
|
|
924
|
-
---
|
|
925
|
-
|
|
926
|
-
## Why This Works
|
|
608
|
+
## Why This Architecture Works
|
|
927
609
|
|
|
928
610
|
**Traditional approach:**
|
|
929
611
|
|
|
930
612
|
1. Manual setup (hours)
|
|
931
|
-
2. Configure
|
|
932
|
-
3.
|
|
933
|
-
4.
|
|
934
|
-
5.
|
|
613
|
+
2. Configure tools (days)
|
|
614
|
+
3. Write boilerplate (hours per feature)
|
|
615
|
+
4. No multi-tenancy support
|
|
616
|
+
5. No hierarchical documentation
|
|
935
617
|
|
|
936
618
|
**ONE CLI approach:**
|
|
937
619
|
|
|
938
|
-
1. `npx oneie
|
|
939
|
-
2.
|
|
940
|
-
3.
|
|
941
|
-
4.
|
|
942
|
-
5.
|
|
620
|
+
1. `npx oneie init` (5 minutes) ✅
|
|
621
|
+
2. Installation folder for customizations ✅
|
|
622
|
+
3. Hierarchical groups with documentation ✅
|
|
623
|
+
4. AI-ready with complete ontology ✅
|
|
624
|
+
5. Multi-tenant from day one ✅
|
|
943
625
|
|
|
944
626
|
**Key Innovations:**
|
|
945
627
|
|
|
946
|
-
1. **
|
|
947
|
-
|
|
948
|
-
-
|
|
949
|
-
-
|
|
950
|
-
-
|
|
951
|
-
- `/docs/` - 3rd party docs cloned locally (offline AI access)
|
|
952
|
-
- `/import/` - Data import utilities
|
|
628
|
+
1. **Installation Folder Architecture**
|
|
629
|
+
- Global templates in `/one/`
|
|
630
|
+
- Private customizations in `/<installation-name>/`
|
|
631
|
+
- Hierarchical file resolution
|
|
632
|
+
- Supports nested groups
|
|
953
633
|
|
|
954
|
-
2. **
|
|
634
|
+
2. **Database + Filesystem Sync**
|
|
635
|
+
- Groups in database (runtime isolation)
|
|
636
|
+
- Documentation in filesystem (AI context)
|
|
637
|
+
- Hierarchical structure mirrored in both
|
|
955
638
|
|
|
956
|
-
|
|
957
|
-
-
|
|
958
|
-
-
|
|
639
|
+
3. **Multi-Tenancy Built-In**
|
|
640
|
+
- One installation serves many groups
|
|
641
|
+
- Each group has private docs folder
|
|
642
|
+
- File resolution walks up hierarchy
|
|
959
643
|
|
|
960
|
-
|
|
961
|
-
- All documentation included (ontology + 3rd party)
|
|
962
|
-
- AI agents work offline (no web fetches needed)
|
|
963
|
-
- Clone project = clone complete knowledge base
|
|
964
|
-
|
|
965
|
-
**Result:** 100x faster, higher quality, AI-ready, backend-flexible, fully portable.
|
|
644
|
+
**Result:** 100x faster, organized, multi-tenant, AI-ready, fully scalable.
|
|
966
645
|
|
|
967
646
|
---
|
|
968
647
|
|
|
969
648
|
## Roadmap
|
|
970
649
|
|
|
971
|
-
### Phase 1: Core Bootstrap (Q1 2025)
|
|
650
|
+
### Phase 1: Core Bootstrap (v2.0.0 - Q1 2025)
|
|
972
651
|
|
|
973
|
-
- ✅ `npx oneie
|
|
974
|
-
- ✅
|
|
975
|
-
- ✅
|
|
976
|
-
- ✅
|
|
977
|
-
- ✅ Backend
|
|
978
|
-
- ✅
|
|
979
|
-
- ✅
|
|
980
|
-
- ✅ Better Auth configuration
|
|
652
|
+
- ✅ `npx oneie init` - Installation folder setup
|
|
653
|
+
- ✅ Global ontology sync
|
|
654
|
+
- ✅ Installation folder creation
|
|
655
|
+
- ✅ Web app generation (Astro + React)
|
|
656
|
+
- ✅ Backend generation (Convex + Effect.ts)
|
|
657
|
+
- ✅ Hierarchical group documentation
|
|
658
|
+
- ✅ File resolution logic
|
|
981
659
|
- ✅ MCP server setup
|
|
982
660
|
|
|
983
661
|
### Phase 2: Feature Generation (Q2 2025)
|
|
@@ -985,16 +663,15 @@ Generated `.claude/settings.local.json`:
|
|
|
985
663
|
- ⏳ `npx oneie generate` - DSL compilation
|
|
986
664
|
- ⏳ Plain English parser
|
|
987
665
|
- ⏳ Ontology validator
|
|
988
|
-
- ⏳
|
|
666
|
+
- ⏳ Multi-file generation
|
|
989
667
|
|
|
990
|
-
### Phase 3:
|
|
668
|
+
### Phase 3: Advanced Multi-Tenancy (Q2 2025)
|
|
991
669
|
|
|
992
|
-
- ⏳
|
|
993
|
-
- ⏳
|
|
994
|
-
- ⏳
|
|
995
|
-
- ⏳ Progress feedback
|
|
670
|
+
- ⏳ Multi-installation support (dev/staging/prod)
|
|
671
|
+
- ⏳ Group documentation templates
|
|
672
|
+
- ⏳ Cloud sync (KV/R2 for runtime updates)
|
|
996
673
|
|
|
997
|
-
### Phase 4:
|
|
674
|
+
### Phase 4: Enterprise (Q3 2025)
|
|
998
675
|
|
|
999
676
|
- 📋 `npx oneie deploy` - One-command deployment
|
|
1000
677
|
- 📋 `npx oneie upgrade` - Update ontology
|
|
@@ -1006,63 +683,68 @@ Generated `.claude/settings.local.json`:
|
|
|
1006
683
|
|
|
1007
684
|
**For Developers:**
|
|
1008
685
|
|
|
1009
|
-
- ⏱️ 5 minutes → Project bootstrap
|
|
1010
|
-
- 🎯 100% type-safe → Generated code
|
|
1011
|
-
- ✅
|
|
1012
|
-
- 📖 AI-ready →
|
|
686
|
+
- ⏱️ 5 minutes → Project bootstrap
|
|
687
|
+
- 🎯 100% type-safe → Generated code
|
|
688
|
+
- ✅ Multi-tenant → Group isolation
|
|
689
|
+
- 📖 AI-ready → Complete ontology
|
|
1013
690
|
|
|
1014
|
-
**For
|
|
691
|
+
**For Organizations:**
|
|
1015
692
|
|
|
1016
|
-
-
|
|
1017
|
-
-
|
|
1018
|
-
-
|
|
1019
|
-
-
|
|
693
|
+
- 🏢 Installation folder → Private docs
|
|
694
|
+
- 📁 Hierarchical groups → Nested documentation
|
|
695
|
+
- 🔄 File resolution → Smart overrides
|
|
696
|
+
- 🚀 Scalable → Friend circles to governments
|
|
1020
697
|
|
|
1021
698
|
---
|
|
1022
699
|
|
|
1023
700
|
## Related Documentation
|
|
1024
701
|
|
|
1025
|
-
### Architecture
|
|
702
|
+
### Installation Folder Architecture
|
|
703
|
+
|
|
704
|
+
- **[Installation Folder Multi-Tenancy Plan](../plans/group-folder-multi-tenancy.md)** - Complete architecture
|
|
705
|
+
- **[Feature 2: CLI](../features/2-cli.md)** - Detailed implementation guide
|
|
1026
706
|
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
- **[
|
|
1030
|
-
- **[
|
|
707
|
+
### 6-Dimension Ontology
|
|
708
|
+
|
|
709
|
+
- **[Ontology.md](../../knowledge/ontology.md)** - 6-dimension data model
|
|
710
|
+
- **[Groups](../../groups/groups.md)** - Group types and hierarchies
|
|
711
|
+
- **[People](../../people/people.md)** - Roles and authorization
|
|
712
|
+
- **[Things](../../things/things.md)** - 66+ entity types
|
|
713
|
+
- **[Connections](../../connections/connections.md)** - 25+ relationship types
|
|
714
|
+
- **[Events](../../events/events.md)** - 67+ event types
|
|
715
|
+
- **[Knowledge](../../knowledge/knowledge.md)** - RAG and embeddings
|
|
1031
716
|
|
|
1032
717
|
### Development Guides
|
|
1033
718
|
|
|
1034
|
-
- **[
|
|
1035
|
-
- **[
|
|
1036
|
-
- **[
|
|
1037
|
-
- **[
|
|
1038
|
-
- **[Workflow.md](../connections/workflow.md)** - Ontology-driven development flow
|
|
1039
|
-
- **[CLAUDE.md](../CLAUDE.md)** - Instructions for Claude Code
|
|
719
|
+
- **[Rules.md](../../knowledge/rules.md)** - Golden rules for AI agents
|
|
720
|
+
- **[Patterns.md](../../knowledge/patterns.md)** - Proven code patterns
|
|
721
|
+
- **[Workflow.md](../../connections/workflow.md)** - Development flow
|
|
722
|
+
- **[CLAUDE.md](../../../CLAUDE.md)** - Claude Code instructions
|
|
1040
723
|
|
|
1041
724
|
---
|
|
1042
725
|
|
|
1043
|
-
## Summary
|
|
726
|
+
## Summary
|
|
1044
727
|
|
|
1045
|
-
|
|
728
|
+
The ONE CLI v2.0.0 introduces **installation folder architecture** for enterprise-grade multi-tenancy:
|
|
1046
729
|
|
|
1047
730
|
```
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
└── import/ → 📥 Data import utilities
|
|
731
|
+
/one/ → Global templates (source of truth)
|
|
732
|
+
/<installation-name>/ → Private customizations (overrides global)
|
|
733
|
+
└── groups/ → Hierarchical documentation (mirrors database)
|
|
734
|
+
/web/ → Astro 5 + React 19 frontend
|
|
735
|
+
/backend/ → Convex backend (6-dimension schema)
|
|
1054
736
|
```
|
|
1055
737
|
|
|
1056
|
-
**Why
|
|
738
|
+
**Why It Matters:**
|
|
1057
739
|
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
740
|
+
- **Multi-Tenant:** One installation serves many database groups
|
|
741
|
+
- **Hierarchical:** Groups can have subgroups with inherited documentation
|
|
742
|
+
- **Private:** Installation folder for internal docs
|
|
743
|
+
- **AI-Ready:** Complete ontology for offline AI operation
|
|
744
|
+
- **Scalable:** From friend circles (2 people) to governments (billions)
|
|
1063
745
|
|
|
1064
|
-
**
|
|
746
|
+
**Core Principle:** The CLI makes it **easier for AI agents to build features** than humans. When that's true, we've succeeded.
|
|
1065
747
|
|
|
1066
748
|
---
|
|
1067
749
|
|
|
1068
|
-
**
|
|
750
|
+
**Built with simplicity, clarity, and infinite scale in mind.**
|