oneie 3.4.2 → 3.6.0
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/agents/agent-director.md +902 -22
- package/.claude/agents/agent-onboard-example-output.md +600 -0
- package/.claude/agents/agent-onboard.md +576 -0
- package/.claude/commands/ONBOARDING_ENHANCEMENT_SUMMARY.md +266 -0
- package/.claude/commands/one.md +411 -10
- package/.claude/commands/release.md +64 -3
- package/CLAUDE.md +55 -69
- package/dist/commands/init.d.ts +5 -6
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +101 -101
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/utils/installation-setup.d.ts +24 -1
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +85 -1
- package/dist/utils/installation-setup.js.map +1 -1
- package/dist/utils/launch-claude.d.ts +6 -0
- package/dist/utils/launch-claude.d.ts.map +1 -0
- package/dist/utils/launch-claude.js +51 -0
- package/dist/utils/launch-claude.js.map +1 -0
- package/dist/utils/validation.d.ts +48 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +73 -0
- package/dist/utils/validation.js.map +1 -0
- package/folders.yaml +1 -1
- package/one/.obsidian/app.json +8 -0
- package/one/.obsidian/appearance.json +1 -0
- package/one/.obsidian/community-plugins.json +3 -0
- package/one/.obsidian/core-plugins.json +33 -0
- package/one/.obsidian/plugins/easy-bake/main.js +361 -0
- package/one/.obsidian/plugins/easy-bake/manifest.json +11 -0
- package/one/.obsidian/plugins/easy-bake/styles.css +10 -0
- package/one/.obsidian/workspace.json +240 -0
- package/one/connections/workflow-onboarding.md +683 -0
- package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +354 -0
- package/one/events/CRITICAL-FIXES-COMPLETE.md +504 -0
- package/one/events/DEPLOYMENT.md +178 -0
- package/one/events/ECOMMERCE-DEMO-PLAN.md +225 -0
- package/one/events/ECOMMERCE-LIVE-DEMO.md +363 -0
- package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +735 -0
- package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +923 -0
- package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +223 -0
- package/one/events/HANDOFF.md +313 -0
- package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +503 -0
- package/one/events/IMPLEMENTATION_SUMMARY.md +529 -0
- package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +666 -0
- package/one/events/LANDING-PAGE-IMPLEMENTATION.md +642 -0
- package/one/events/LANDING-PAGE-QUICKSTART.md +407 -0
- package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +1627 -0
- package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +573 -0
- package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +398 -0
- package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +525 -0
- package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +455 -0
- package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +486 -0
- package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +203 -0
- package/one/events/SECURITY-AUDIT-FIXES.md +376 -0
- package/one/events/SECURITY-SCAN-COMPLETE.md +281 -0
- package/one/events/SHOP-BUILD-STATUS.md +114 -0
- package/one/events/SHOP-PREMIUM-UPDATE.md +149 -0
- package/one/events/SITE-WIDE-GRADIENT-FIX.md +299 -0
- package/one/events/STORE-PRODUCTION-READY-STATUS.md +359 -0
- package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +429 -0
- package/one/events/agent-director-enhancement-summary.md +386 -0
- package/one/events/agent-onboard-implementation-summary.md +457 -0
- package/one/events/clean-agent-ontology-cleanup-report.md +353 -0
- package/one/events/landing-page-generator.md +458 -0
- package/one/events/onboarding-implementation-complete.md +505 -0
- package/one/events/release.md +254 -0
- package/one/events/separate-implementation-status.md +537 -0
- package/one/groups/nine-padle-contents.baked.md +1252 -0
- package/one/groups/nine-padle-contents.md +6 -0
- package/one/knowledge/100-inference-quick-reference.md +431 -0
- package/one/knowledge/agent-onboard-usage.md +612 -0
- package/one/knowledge/cli-claude-handoff.md +718 -0
- package/one/knowledge/installation-folders.md +45 -1
- package/one/knowledge/ontology-blog.yaml +31 -0
- package/one/knowledge/ontology-cheatsheet.md +591 -0
- package/one/knowledge/ontology-community.yaml +42 -0
- package/one/knowledge/ontology-core-universal.md +722 -0
- package/one/knowledge/ontology-core.yaml +50 -0
- package/one/knowledge/ontology-courses.yaml +53 -0
- package/one/knowledge/ontology-creator.md +376 -0
- package/one/knowledge/ontology-developer-guide.md +789 -0
- package/one/knowledge/ontology-education.md +920 -0
- package/one/knowledge/ontology-index.md +354 -0
- package/one/knowledge/ontology-migration-guide.md +811 -0
- package/one/knowledge/ontology-minimal.yaml +1 -1
- package/one/knowledge/ontology-portfolio.yaml +31 -0
- package/one/knowledge/ontology-quickstart.md +576 -0
- package/one/knowledge/ontology-shop.yaml +121 -0
- package/one/knowledge/ontology-tokens.yaml +32 -0
- package/one/knowledge/ontology-tutorial.md +434 -0
- package/one/knowledge/ontology-video-script.md +890 -0
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +467 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +408 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +369 -0
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +396 -0
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +468 -0
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +582 -0
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +449 -0
- package/one/things/docs/ecommerce/QUICK-START.md +368 -0
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +498 -0
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +237 -0
- package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +171 -0
- package/one/things/docs/ecommerce/demo.astro +309 -0
- package/one/things/plans/agent-director-100-inference-plans.md +410 -0
- package/one/things/plans/dual-website-strategy.md +612 -0
- package/one/things/plans/feature-based-sites.md +821 -0
- package/one/things/plans/multi-ontology-architecture.md +836 -0
- package/one/things/plans/onboarding.md +32 -0
- package/one/things/plans/separate.md +15 -17
- package/one/things/plans/start-new.md +738 -0
- package/one/things/templates.md +254 -0
- package/one/things/todo.md +23 -5
- package/package.json +2 -2
- package/one/things/claude/hooks/agent-hook-manager.js +0 -525
- package/one/things/claude/hooks/agent-load-balancer.js +0 -271
- package/one/things/claude/hooks/agent-request-interceptor.js +0 -70
- package/one/things/claude/hooks/cascade-feedback.js +0 -297
- package/one/things/claude/hooks/cascade-integration-hooks.js +0 -648
- package/one/things/claude/hooks/continuous-improvement-monitor.js +0 -510
- package/one/things/claude/hooks/file-organization-engine.js +0 -427
- package/one/things/claude/hooks/file-organization-monitor.js +0 -269
- package/one/things/claude/hooks/hook-config-manager.js +0 -202
- package/one/things/claude/hooks/hook-orchestrator.js +0 -662
- package/one/things/claude/hooks/hook-performance-report.js +0 -120
- package/one/things/claude/hooks/mcp-cascade-integration.js +0 -816
- package/one/things/claude/hooks/memory-optimizer.js +0 -510
- package/one/things/claude/hooks/ontology-compliance.js +0 -394
- package/one/things/claude/hooks/ontology-hook-manager.js +0 -316
- package/one/things/claude/hooks/ontology-validation-engine.js +0 -317
- package/one/things/claude/hooks/performance-monitoring-hook.js +0 -422
- package/one/things/claude/hooks/quality-scoring-engine.js +0 -834
- package/one/things/claude/hooks/simple-load-balancer.js +0 -238
- package/one/things/claude/hooks/startup-optimizer.js +0 -625
- package/one/things/claude/hooks/story-scoring-system.js +0 -445
- package/one/things/claude/hooks/story-validation-engine.js +0 -473
- package/one/things/claude/hooks/structure-synchronizer.js +0 -194
- package/one/things/claude/hooks/sub-agent-output-validator.js +0 -647
- package/one/things/claude/hooks/sub-agent-validation-hook.js +0 -343
- package/one/things/claude/hooks/trinity-validation-system.js +0 -392
- package/one/things/plans/organizations-to-groups.md +0 -705
|
@@ -0,0 +1,612 @@
|
|
|
1
|
+
# Agent-Onboard Usage Guide
|
|
2
|
+
|
|
3
|
+
**Version:** 1.0.0
|
|
4
|
+
**Status:** Production Ready
|
|
5
|
+
**Purpose:** How to use the agent-onboard system
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
### From CLI (Recommended)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx oneie init
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The CLI will:
|
|
18
|
+
1. Prompt for user details
|
|
19
|
+
2. Call the onboarding mutation
|
|
20
|
+
3. Display analysis results
|
|
21
|
+
4. Write files to installation folder
|
|
22
|
+
5. Present feature recommendations
|
|
23
|
+
6. Hand off to Claude Code
|
|
24
|
+
|
|
25
|
+
### From Convex Console (Testing)
|
|
26
|
+
|
|
27
|
+
```javascript
|
|
28
|
+
// backend/convex/mutations/onboarding.ts
|
|
29
|
+
await ctx.runMutation(api.mutations.onboarding.analyzeWebsite, {
|
|
30
|
+
name: "Tom O'Connor",
|
|
31
|
+
organizationName: "ONE Platform",
|
|
32
|
+
websiteUrl: "https://one.ie",
|
|
33
|
+
email: "tom@one.ie"
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## API Reference
|
|
40
|
+
|
|
41
|
+
### analyzeWebsite Mutation
|
|
42
|
+
|
|
43
|
+
**Purpose:** Main entry point for onboarding analysis
|
|
44
|
+
|
|
45
|
+
**Input:**
|
|
46
|
+
```typescript
|
|
47
|
+
{
|
|
48
|
+
name: string; // User's full name
|
|
49
|
+
organizationName: string; // Organization name
|
|
50
|
+
websiteUrl: string; // Website to analyze
|
|
51
|
+
email: string; // User's email
|
|
52
|
+
installationSlug?: string; // Optional custom slug
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Output (Success):**
|
|
57
|
+
```typescript
|
|
58
|
+
{
|
|
59
|
+
success: true;
|
|
60
|
+
data: {
|
|
61
|
+
installationSlug: string; // Generated slug
|
|
62
|
+
analysis: {
|
|
63
|
+
url: string;
|
|
64
|
+
brand: BrandIdentity;
|
|
65
|
+
features: DetectedFeatures;
|
|
66
|
+
businessModel: string;
|
|
67
|
+
analyzedAt: number;
|
|
68
|
+
};
|
|
69
|
+
ontology: {
|
|
70
|
+
document: OntologyDocument;
|
|
71
|
+
markdown: string;
|
|
72
|
+
};
|
|
73
|
+
brandGuide: {
|
|
74
|
+
guide: BrandGuide;
|
|
75
|
+
markdown: string;
|
|
76
|
+
};
|
|
77
|
+
recommendations: FeatureRecommendation[];
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Output (Error):**
|
|
83
|
+
```typescript
|
|
84
|
+
{
|
|
85
|
+
success: false;
|
|
86
|
+
error: string; // Error message
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### createOnboardingGroup Mutation
|
|
91
|
+
|
|
92
|
+
**Purpose:** Create initial group for new organization
|
|
93
|
+
|
|
94
|
+
**Input:**
|
|
95
|
+
```typescript
|
|
96
|
+
{
|
|
97
|
+
name: string; // Group name
|
|
98
|
+
slug: string; // URL slug
|
|
99
|
+
ownerEmail: string; // Owner email
|
|
100
|
+
plan?: 'starter' | 'pro' | 'enterprise';
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Output:**
|
|
105
|
+
```typescript
|
|
106
|
+
{
|
|
107
|
+
success: boolean;
|
|
108
|
+
groupId?: Id<"groups">; // If successful
|
|
109
|
+
error?: string; // If failed
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### checkSlugAvailability Query
|
|
114
|
+
|
|
115
|
+
**Purpose:** Check if installation slug is available
|
|
116
|
+
|
|
117
|
+
**Input:**
|
|
118
|
+
```typescript
|
|
119
|
+
{
|
|
120
|
+
slug: string; // Desired slug
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Output:**
|
|
125
|
+
```typescript
|
|
126
|
+
{
|
|
127
|
+
available: boolean;
|
|
128
|
+
slug: string;
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Service Layer API
|
|
135
|
+
|
|
136
|
+
### Website Analyzer
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
import { runWebsiteAnalysis } from '../services/websiteAnalyzer';
|
|
140
|
+
|
|
141
|
+
const analysis = await runWebsiteAnalysis('https://example.com');
|
|
142
|
+
|
|
143
|
+
// Returns:
|
|
144
|
+
{
|
|
145
|
+
url: string;
|
|
146
|
+
brand: {
|
|
147
|
+
colors: { primary, secondary, accent? };
|
|
148
|
+
logo: { url, format };
|
|
149
|
+
fonts: { heading, body };
|
|
150
|
+
voice: { tone, audience };
|
|
151
|
+
};
|
|
152
|
+
features: {
|
|
153
|
+
contentTypes: string[];
|
|
154
|
+
monetization: string[];
|
|
155
|
+
community: string[];
|
|
156
|
+
techStack: { frontend?, backend?, hosting? };
|
|
157
|
+
};
|
|
158
|
+
businessModel: string;
|
|
159
|
+
analyzedAt: number;
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Ontology Generator
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
import { runOntologyGeneration } from '../services/ontologyGenerator';
|
|
167
|
+
|
|
168
|
+
const { document, markdown } = await runOntologyGeneration(
|
|
169
|
+
analysis,
|
|
170
|
+
'Organization Name'
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
// document: OntologyDocument with 6 dimensions
|
|
174
|
+
// markdown: Ready-to-write string
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Brand Guide Generator
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
import { runBrandGuideGeneration } from '../services/brandGuideGenerator';
|
|
181
|
+
|
|
182
|
+
const { guide, markdown } = await runBrandGuideGeneration(
|
|
183
|
+
analysis.brand,
|
|
184
|
+
'Organization Name',
|
|
185
|
+
'https://example.com'
|
|
186
|
+
);
|
|
187
|
+
|
|
188
|
+
// guide: BrandGuide object
|
|
189
|
+
// markdown: Ready-to-write string
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Feature Recommender
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
import { runFeatureRecommendation } from '../services/featureRecommender';
|
|
196
|
+
|
|
197
|
+
const recommendations = await runFeatureRecommendation(
|
|
198
|
+
analysis.features
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
// Returns: FeatureRecommendation[]
|
|
202
|
+
// Each with: feature, reason, priority
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Common Workflows
|
|
208
|
+
|
|
209
|
+
### Workflow 1: Complete Onboarding
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
// 1. Analyze website
|
|
213
|
+
const result = await ctx.runMutation(
|
|
214
|
+
api.mutations.onboarding.analyzeWebsite,
|
|
215
|
+
{
|
|
216
|
+
name: "Jane Doe",
|
|
217
|
+
organizationName: "Acme Corp",
|
|
218
|
+
websiteUrl: "https://acme.com",
|
|
219
|
+
email: "jane@acme.com"
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
if (!result.success) {
|
|
224
|
+
console.error(result.error);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// 2. Write files to installation folder
|
|
229
|
+
const { installationSlug, ontology, brandGuide } = result.data;
|
|
230
|
+
|
|
231
|
+
await writeFile(
|
|
232
|
+
`/${installationSlug}/knowledge/ontology.md`,
|
|
233
|
+
ontology.markdown
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
await writeFile(
|
|
237
|
+
`/${installationSlug}/knowledge/brand-guide.md`,
|
|
238
|
+
brandGuide.markdown
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
// 3. Create group
|
|
242
|
+
await ctx.runMutation(
|
|
243
|
+
api.mutations.onboarding.createOnboardingGroup,
|
|
244
|
+
{
|
|
245
|
+
name: "Acme Corp",
|
|
246
|
+
slug: installationSlug,
|
|
247
|
+
ownerEmail: "jane@acme.com",
|
|
248
|
+
plan: "pro"
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
// 4. Update .onboarding.json
|
|
253
|
+
await writeFile('.onboarding.json', JSON.stringify({
|
|
254
|
+
status: "features_presented",
|
|
255
|
+
...result.data
|
|
256
|
+
}, null, 2));
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Workflow 2: Check Availability First
|
|
260
|
+
|
|
261
|
+
```typescript
|
|
262
|
+
// 1. Generate slug from org name
|
|
263
|
+
const slug = organizationName
|
|
264
|
+
.toLowerCase()
|
|
265
|
+
.replace(/[^a-z0-9]+/g, '-');
|
|
266
|
+
|
|
267
|
+
// 2. Check if available
|
|
268
|
+
const { available } = await ctx.runQuery(
|
|
269
|
+
api.queries.onboarding.checkSlugAvailability,
|
|
270
|
+
{ slug }
|
|
271
|
+
);
|
|
272
|
+
|
|
273
|
+
if (!available) {
|
|
274
|
+
// Prompt for alternative slug
|
|
275
|
+
// Or append number: 'acme-corp-2'
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// 3. Proceed with analysis
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### Workflow 3: Re-analyze Existing Installation
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
// 1. Get current analysis from .onboarding.json
|
|
285
|
+
const current = JSON.parse(
|
|
286
|
+
await readFile('.onboarding.json', 'utf8')
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
// 2. Re-analyze (e.g., after website update)
|
|
290
|
+
const updated = await ctx.runMutation(
|
|
291
|
+
api.mutations.onboarding.analyzeWebsite,
|
|
292
|
+
{
|
|
293
|
+
...current.user,
|
|
294
|
+
...current.organization,
|
|
295
|
+
installationSlug: current.organization.slug
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
// 3. Compare changes
|
|
300
|
+
const changes = compareAnalysis(current.analysis, updated.data.analysis);
|
|
301
|
+
|
|
302
|
+
// 4. Optionally regenerate files
|
|
303
|
+
if (changes.brand.colorsChanged) {
|
|
304
|
+
await writeFile(
|
|
305
|
+
`/${current.organization.slug}/knowledge/brand-guide.md`,
|
|
306
|
+
updated.data.brandGuide.markdown
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Error Handling
|
|
314
|
+
|
|
315
|
+
### Website Not Accessible
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
try {
|
|
319
|
+
const result = await analyzeWebsite({...});
|
|
320
|
+
} catch (error) {
|
|
321
|
+
if (error._tag === 'WebsiteNotAccessible') {
|
|
322
|
+
console.error(`Cannot access ${error.url}: ${error.reason}`);
|
|
323
|
+
// Offer manual input option
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Invalid URL
|
|
329
|
+
|
|
330
|
+
```typescript
|
|
331
|
+
if (result.success === false && result.error.includes('invalid')) {
|
|
332
|
+
console.error('Invalid website URL. Please check and try again.');
|
|
333
|
+
// Prompt for corrected URL
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Slug Already Exists
|
|
338
|
+
|
|
339
|
+
```typescript
|
|
340
|
+
const groupResult = await createOnboardingGroup({...});
|
|
341
|
+
|
|
342
|
+
if (!groupResult.success) {
|
|
343
|
+
if (groupResult.error.includes('already exists')) {
|
|
344
|
+
// Generate alternative: 'acme-corp-2'
|
|
345
|
+
// Or prompt user for custom slug
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## File Structure After Onboarding
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
/
|
|
356
|
+
├── .onboarding.json # Onboarding state
|
|
357
|
+
├── {installation-slug}/
|
|
358
|
+
│ ├── knowledge/
|
|
359
|
+
│ │ ├── ontology.md # Generated ontology
|
|
360
|
+
│ │ └── brand-guide.md # Brand identity
|
|
361
|
+
│ ├── groups/
|
|
362
|
+
│ │ └── {org-slug}/
|
|
363
|
+
│ │ └── README.md # Organization overview
|
|
364
|
+
│ └── things/
|
|
365
|
+
│ └── vision.md # Optional custom vision
|
|
366
|
+
└── .env.local # Updated with brand colors
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
371
|
+
## Environment Variables
|
|
372
|
+
|
|
373
|
+
### Generated in .env.local
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
# Organization
|
|
377
|
+
INSTALLATION_NAME="{installation-slug}"
|
|
378
|
+
ORG_NAME="{Organization Name}"
|
|
379
|
+
ORG_SLUG="{installation-slug}"
|
|
380
|
+
ORG_OWNER_EMAIL="{email}"
|
|
381
|
+
ORG_OWNER_NAME="{name}"
|
|
382
|
+
|
|
383
|
+
# Branding (from analysis)
|
|
384
|
+
BRAND_PRIMARY_COLOR="{primary-color}"
|
|
385
|
+
BRAND_SECONDARY_COLOR="{secondary-color}"
|
|
386
|
+
BRAND_LOGO_URL="{logo-url}"
|
|
387
|
+
|
|
388
|
+
# Website
|
|
389
|
+
ORIGINAL_WEBSITE="{analyzed-website}"
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
---
|
|
393
|
+
|
|
394
|
+
## Testing
|
|
395
|
+
|
|
396
|
+
### Unit Test Example
|
|
397
|
+
|
|
398
|
+
```typescript
|
|
399
|
+
import { describe, it, expect } from 'vitest';
|
|
400
|
+
import { analyzeWebsite } from './websiteAnalyzer';
|
|
401
|
+
|
|
402
|
+
describe('Website Analyzer', () => {
|
|
403
|
+
it('should extract brand colors', async () => {
|
|
404
|
+
const result = await runWebsiteAnalysis('https://example.com');
|
|
405
|
+
|
|
406
|
+
expect(result.brand.colors.primary).toMatch(/^#[0-9A-F]{6}$/i);
|
|
407
|
+
expect(result.brand.colors.secondary).toMatch(/^#[0-9A-F]{6}$/i);
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
it('should detect content types', async () => {
|
|
411
|
+
const result = await runWebsiteAnalysis('https://blog-site.com');
|
|
412
|
+
|
|
413
|
+
expect(result.features.contentTypes).toContain('blog');
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### Integration Test Example
|
|
419
|
+
|
|
420
|
+
```typescript
|
|
421
|
+
import { convexTest } from 'convex-test';
|
|
422
|
+
import { describe, it, expect } from 'vitest';
|
|
423
|
+
import schema from '../schema';
|
|
424
|
+
|
|
425
|
+
describe('Onboarding Flow', () => {
|
|
426
|
+
it('should complete full onboarding', async () => {
|
|
427
|
+
const t = convexTest(schema);
|
|
428
|
+
|
|
429
|
+
// 1. Analyze website
|
|
430
|
+
const result = await t.mutation(api.mutations.onboarding.analyzeWebsite, {
|
|
431
|
+
name: 'Test User',
|
|
432
|
+
organizationName: 'Test Org',
|
|
433
|
+
websiteUrl: 'https://test.com',
|
|
434
|
+
email: 'test@test.com'
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
expect(result.success).toBe(true);
|
|
438
|
+
expect(result.data.installationSlug).toBe('test-org');
|
|
439
|
+
|
|
440
|
+
// 2. Verify ontology generated
|
|
441
|
+
expect(result.data.ontology.document.ontology.groups).toBeDefined();
|
|
442
|
+
expect(result.data.ontology.document.ontology.things.length).toBeGreaterThan(0);
|
|
443
|
+
|
|
444
|
+
// 3. Create group
|
|
445
|
+
const groupResult = await t.mutation(
|
|
446
|
+
api.mutations.onboarding.createOnboardingGroup,
|
|
447
|
+
{
|
|
448
|
+
name: 'Test Org',
|
|
449
|
+
slug: result.data.installationSlug,
|
|
450
|
+
ownerEmail: 'test@test.com'
|
|
451
|
+
}
|
|
452
|
+
);
|
|
453
|
+
|
|
454
|
+
expect(groupResult.success).toBe(true);
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
## Performance Tips
|
|
462
|
+
|
|
463
|
+
### 1. Parallel Extraction
|
|
464
|
+
|
|
465
|
+
The website analyzer already runs extraction in parallel:
|
|
466
|
+
|
|
467
|
+
```typescript
|
|
468
|
+
const [colors, logo, fonts, voice, ...] = yield* _(Effect.all([
|
|
469
|
+
extractColors(html),
|
|
470
|
+
extractLogo(html),
|
|
471
|
+
extractFonts(html),
|
|
472
|
+
// ... all run concurrently
|
|
473
|
+
]));
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
### 2. Caching
|
|
477
|
+
|
|
478
|
+
For repeated analyses of the same website:
|
|
479
|
+
|
|
480
|
+
```typescript
|
|
481
|
+
// Cache analysis results
|
|
482
|
+
const cacheKey = `analysis:${websiteUrl}`;
|
|
483
|
+
const cached = await redis.get(cacheKey);
|
|
484
|
+
|
|
485
|
+
if (cached && !forceRefresh) {
|
|
486
|
+
return JSON.parse(cached);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
const analysis = await runWebsiteAnalysis(websiteUrl);
|
|
490
|
+
await redis.setex(cacheKey, 3600, JSON.stringify(analysis));
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### 3. Batching
|
|
494
|
+
|
|
495
|
+
For multiple organizations:
|
|
496
|
+
|
|
497
|
+
```typescript
|
|
498
|
+
const analyses = await Promise.all(
|
|
499
|
+
organizations.map(org =>
|
|
500
|
+
runWebsiteAnalysis(org.websiteUrl)
|
|
501
|
+
)
|
|
502
|
+
);
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
---
|
|
506
|
+
|
|
507
|
+
## Customization
|
|
508
|
+
|
|
509
|
+
### Custom Business Model Detection
|
|
510
|
+
|
|
511
|
+
```typescript
|
|
512
|
+
// In ontologyGenerator.ts
|
|
513
|
+
const generateBusinessDescription = (analysis: WebsiteAnalysis): string => {
|
|
514
|
+
// Add custom logic
|
|
515
|
+
if (analysis.features.contentTypes.includes('courses') &&
|
|
516
|
+
analysis.features.monetization.includes('subscriptions')) {
|
|
517
|
+
return 'Educational SaaS platform';
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// ... existing logic
|
|
521
|
+
};
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
### Custom Feature Recommendations
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
// In featureRecommender.ts
|
|
528
|
+
if (detected.contentTypes.includes('podcast')) {
|
|
529
|
+
recommendations.push({
|
|
530
|
+
feature: FEATURES['podcast-platform'],
|
|
531
|
+
reason: 'Detected podcast content',
|
|
532
|
+
priority: 'high'
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
### Custom Ontology Mapping
|
|
538
|
+
|
|
539
|
+
```typescript
|
|
540
|
+
// In ontologyGenerator.ts
|
|
541
|
+
const mapContentToThings = (contentTypes: string[]): string[] => {
|
|
542
|
+
const thingMapping: Record<string, string[]> = {
|
|
543
|
+
// Add custom mappings
|
|
544
|
+
'courses': ['course', 'lesson', 'certificate', 'quiz'],
|
|
545
|
+
'webinars': ['livestream', 'recording', 'replay'],
|
|
546
|
+
// ... existing mappings
|
|
547
|
+
};
|
|
548
|
+
};
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
---
|
|
552
|
+
|
|
553
|
+
## Troubleshooting
|
|
554
|
+
|
|
555
|
+
### Issue: Analysis Returns Mock Data
|
|
556
|
+
|
|
557
|
+
**Cause:** WebFetch integration not complete
|
|
558
|
+
|
|
559
|
+
**Solution:** The services are structured to accept real data. Integrate WebFetch tool:
|
|
560
|
+
|
|
561
|
+
```typescript
|
|
562
|
+
const fetchWebsite = (url: URL): Effect.Effect<string, WebsiteNotAccessible> =>
|
|
563
|
+
Effect.tryPromise({
|
|
564
|
+
try: () => webFetch.fetch(url.toString()),
|
|
565
|
+
catch: (error) => new WebsiteNotAccessible(url.toString(), String(error))
|
|
566
|
+
});
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
### Issue: Slug Generation Conflicts
|
|
570
|
+
|
|
571
|
+
**Cause:** Multiple orgs with similar names
|
|
572
|
+
|
|
573
|
+
**Solution:** Always check availability and append counter:
|
|
574
|
+
|
|
575
|
+
```typescript
|
|
576
|
+
let slug = baseSlug;
|
|
577
|
+
let counter = 2;
|
|
578
|
+
|
|
579
|
+
while (!(await checkSlugAvailability(slug)).available) {
|
|
580
|
+
slug = `${baseSlug}-${counter}`;
|
|
581
|
+
counter++;
|
|
582
|
+
}
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
### Issue: Brand Colors Not Detected
|
|
586
|
+
|
|
587
|
+
**Cause:** Website uses inline styles or complex CSS
|
|
588
|
+
|
|
589
|
+
**Solution:** Enhance color extraction:
|
|
590
|
+
|
|
591
|
+
```typescript
|
|
592
|
+
const extractColors = (html: string): Effect.Effect<BrandIdentity['colors'], never> => {
|
|
593
|
+
// Parse <style> tags
|
|
594
|
+
// Parse inline styles
|
|
595
|
+
// Parse CSS files
|
|
596
|
+
// Use OpenAI Vision on screenshots
|
|
597
|
+
};
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
---
|
|
601
|
+
|
|
602
|
+
## See Also
|
|
603
|
+
|
|
604
|
+
- **Agent Definition:** `/.claude/agents/agent-onboard.md`
|
|
605
|
+
- **Example Output:** `/.claude/agents/agent-onboard-example-output.md`
|
|
606
|
+
- **Implementation Summary:** `/one/events/agent-onboard-implementation-summary.md`
|
|
607
|
+
- **Ontology Spec:** `/one/knowledge/ontology.md`
|
|
608
|
+
- **Installation Folders:** `/one/knowledge/installation-folders.md`
|
|
609
|
+
|
|
610
|
+
---
|
|
611
|
+
|
|
612
|
+
**Ready to onboard users intelligently!** 🚀
|