oneie 1.5.4 ā 1.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/engineering-developer.md +154 -34
- package/.claude/agents/engineering-product-manager.md +147 -18
- package/.claude/agents/engineering-quality-assurance.md +155 -35
- package/.claude/agents/engineering-user-experience.md +154 -34
- package/bin/folders.yaml +52 -0
- package/bin/oneie/index.js +122 -912
- package/one/stories/story-1.6-engineering-agents-cascade-integration.md +4 -4
- package/package.json +2 -9
- package/bin/create-turbo.js +0 -816
- package/bin/install.js +0 -354
package/bin/create-turbo.js
DELETED
|
@@ -1,816 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import fs from 'fs-extra';
|
|
5
|
-
import chalk from 'chalk';
|
|
6
|
-
import ora from 'ora';
|
|
7
|
-
import inquirer from 'inquirer';
|
|
8
|
-
import { execSync } from 'child_process';
|
|
9
|
-
import { fileURLToPath } from 'url';
|
|
10
|
-
|
|
11
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
-
const __dirname = path.dirname(__filename);
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Mission-3: Create Turbo-Powered Repository
|
|
16
|
-
* Generates fully-branded, deployable apps in under 5 minutes
|
|
17
|
-
*/
|
|
18
|
-
export async function createTurboRepo(args) {
|
|
19
|
-
try {
|
|
20
|
-
console.clear();
|
|
21
|
-
showTurboWelcome();
|
|
22
|
-
|
|
23
|
-
// Get project name
|
|
24
|
-
let projectName = args[0];
|
|
25
|
-
if (!projectName) {
|
|
26
|
-
const answer = await inquirer.prompt([
|
|
27
|
-
{
|
|
28
|
-
type: 'input',
|
|
29
|
-
name: 'projectName',
|
|
30
|
-
message: 'What would you like to name your project?',
|
|
31
|
-
validate: input => {
|
|
32
|
-
if (!input) return 'Project name is required';
|
|
33
|
-
if (!/^[a-z0-9-]+$/.test(input)) {
|
|
34
|
-
return 'Project name must be lowercase with hyphens only';
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
]);
|
|
40
|
-
projectName = answer.projectName;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Check if directory exists
|
|
44
|
-
if (await fs.pathExists(projectName)) {
|
|
45
|
-
console.error(chalk.red(`Directory ${projectName} already exists!`));
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// 1. Template Selection
|
|
50
|
-
const template = await selectTemplate(args);
|
|
51
|
-
|
|
52
|
-
// 2. Brand Customization
|
|
53
|
-
const branding = await configureBranding();
|
|
54
|
-
|
|
55
|
-
// 3. Deployment Setup
|
|
56
|
-
const deployment = await selectDeployment();
|
|
57
|
-
|
|
58
|
-
// 4. AI Agents Selection
|
|
59
|
-
const agents = await selectAgents();
|
|
60
|
-
|
|
61
|
-
// 5. Generation Process
|
|
62
|
-
console.log('');
|
|
63
|
-
const spinner = ora('Creating your turbo-powered universe...').start();
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
// Create project directory
|
|
67
|
-
spinner.text = 'Creating project structure...';
|
|
68
|
-
await fs.ensureDir(projectName);
|
|
69
|
-
|
|
70
|
-
// Generate base structure
|
|
71
|
-
spinner.text = 'Generating turbo monorepo...';
|
|
72
|
-
await generateBaseStructure(projectName, template);
|
|
73
|
-
|
|
74
|
-
// Generate turbo.json
|
|
75
|
-
spinner.text = 'Configuring turbo pipeline...';
|
|
76
|
-
await generateTurboJson(projectName, template);
|
|
77
|
-
|
|
78
|
-
// Apply template
|
|
79
|
-
spinner.text = `Applying ${template.name} template...`;
|
|
80
|
-
await applyTemplate(projectName, template);
|
|
81
|
-
|
|
82
|
-
// Brand customization
|
|
83
|
-
if (branding.type !== 'skip') {
|
|
84
|
-
spinner.text = 'Applying brand magic...';
|
|
85
|
-
await customizeBrand(projectName, branding);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
// Setup Trinity architecture
|
|
89
|
-
spinner.text = 'Setting up Trinity architecture (.claude/.one/one)...';
|
|
90
|
-
await setupTrinityArchitecture(projectName);
|
|
91
|
-
|
|
92
|
-
// Configure AI agents
|
|
93
|
-
if (agents.length > 0) {
|
|
94
|
-
spinner.text = 'Configuring AI agents...';
|
|
95
|
-
await configureAgents(projectName, agents);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// Setup deployment
|
|
99
|
-
if (deployment !== 'skip') {
|
|
100
|
-
spinner.text = `Configuring ${deployment} deployment...`;
|
|
101
|
-
await setupDeployment(projectName, deployment);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Initialize git
|
|
105
|
-
spinner.text = 'Initializing git repository...';
|
|
106
|
-
await initGit(projectName);
|
|
107
|
-
|
|
108
|
-
// Install dependencies
|
|
109
|
-
spinner.text = 'Installing dependencies with bun...';
|
|
110
|
-
await installDependencies(projectName);
|
|
111
|
-
|
|
112
|
-
spinner.succeed(chalk.green('Turbo repo created successfully!'));
|
|
113
|
-
|
|
114
|
-
// 6. Success Message
|
|
115
|
-
showSuccessMessage(projectName, template, deployment, agents);
|
|
116
|
-
|
|
117
|
-
} catch (error) {
|
|
118
|
-
spinner.fail('Creation failed');
|
|
119
|
-
throw error;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
} catch (error) {
|
|
123
|
-
console.error(chalk.red('\nš„ Error:'), error.message);
|
|
124
|
-
process.exit(1);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Show turbo welcome banner
|
|
130
|
-
*/
|
|
131
|
-
function showTurboWelcome() {
|
|
132
|
-
console.log(chalk.cyan(`
|
|
133
|
-
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
134
|
-
ā ā
|
|
135
|
-
ā š ONE Turbo Repo Generator ā
|
|
136
|
-
ā From idea to deployed app in under 5 minutes ā
|
|
137
|
-
ā ā
|
|
138
|
-
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
139
|
-
`));
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Template selection
|
|
144
|
-
*/
|
|
145
|
-
async function selectTemplate(args) {
|
|
146
|
-
// Check if template was provided via CLI
|
|
147
|
-
const templateArg = args.find(arg => arg.startsWith('--template='));
|
|
148
|
-
if (templateArg) {
|
|
149
|
-
const templateName = templateArg.split('=')[1];
|
|
150
|
-
return getTemplateByName(templateName);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
const { template } = await inquirer.prompt([
|
|
154
|
-
{
|
|
155
|
-
type: 'list',
|
|
156
|
-
name: 'template',
|
|
157
|
-
message: 'Choose your foundation:',
|
|
158
|
-
choices: [
|
|
159
|
-
{
|
|
160
|
-
name: 'š Astro - Lightning-fast marketing site',
|
|
161
|
-
value: 'astro'
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
name: 'š¼ Next.js SaaS - Full-stack application',
|
|
165
|
-
value: 'nextjs-saas'
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: 'šØ Portfolio - Creative showcase',
|
|
169
|
-
value: 'portfolio'
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
name: 'š± Mobile - React Native with Expo',
|
|
173
|
-
value: 'mobile'
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
name: 'š„ļø Desktop - Tauri cross-platform app',
|
|
177
|
-
value: 'desktop'
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
name: 'ā” Custom - Start from scratch',
|
|
181
|
-
value: 'custom'
|
|
182
|
-
}
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
]);
|
|
186
|
-
|
|
187
|
-
return getTemplateByName(template);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* Get template configuration by name
|
|
192
|
-
*/
|
|
193
|
-
function getTemplateByName(name) {
|
|
194
|
-
const templates = {
|
|
195
|
-
'astro': {
|
|
196
|
-
id: 'astro',
|
|
197
|
-
name: 'Astro Marketing',
|
|
198
|
-
description: 'Lightning-fast marketing site with islands',
|
|
199
|
-
packages: ['astro', 'tailwindcss', '@astrojs/react'],
|
|
200
|
-
deployment: ['vercel', 'netlify', 'cloudflare-pages']
|
|
201
|
-
},
|
|
202
|
-
'nextjs-saas': {
|
|
203
|
-
id: 'nextjs-saas',
|
|
204
|
-
name: 'Next.js SaaS',
|
|
205
|
-
description: 'Full-stack SaaS with auth, payments, database',
|
|
206
|
-
packages: ['next', 'react', 'tailwindcss', '@shadcn/ui'],
|
|
207
|
-
features: ['Stripe', 'Supabase', 'Tailwind', 'shadcn/ui'],
|
|
208
|
-
deployment: ['vercel', 'railway']
|
|
209
|
-
},
|
|
210
|
-
'portfolio': {
|
|
211
|
-
id: 'portfolio',
|
|
212
|
-
name: 'Creative Portfolio',
|
|
213
|
-
description: 'Stunning portfolio with animations',
|
|
214
|
-
packages: ['next', 'framer-motion', 'tailwindcss'],
|
|
215
|
-
deployment: ['vercel', 'netlify']
|
|
216
|
-
},
|
|
217
|
-
'mobile': {
|
|
218
|
-
id: 'mobile',
|
|
219
|
-
name: 'React Native',
|
|
220
|
-
description: 'Cross-platform mobile with Expo',
|
|
221
|
-
packages: ['expo', 'react-native'],
|
|
222
|
-
deployment: ['expo', 'app-store', 'google-play']
|
|
223
|
-
},
|
|
224
|
-
'desktop': {
|
|
225
|
-
id: 'desktop',
|
|
226
|
-
name: 'Tauri Desktop',
|
|
227
|
-
description: 'Native desktop app with web technologies',
|
|
228
|
-
packages: ['tauri', 'vite', 'react'],
|
|
229
|
-
deployment: ['github-releases']
|
|
230
|
-
},
|
|
231
|
-
'custom': {
|
|
232
|
-
id: 'custom',
|
|
233
|
-
name: 'Custom',
|
|
234
|
-
description: 'Start from scratch with turbo',
|
|
235
|
-
packages: ['turbo'],
|
|
236
|
-
deployment: ['vercel', 'netlify', 'cloudflare-pages']
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
return templates[name] || templates.custom;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Configure branding
|
|
245
|
-
*/
|
|
246
|
-
async function configureBranding() {
|
|
247
|
-
const { brandingChoice } = await inquirer.prompt([
|
|
248
|
-
{
|
|
249
|
-
type: 'list',
|
|
250
|
-
name: 'brandingChoice',
|
|
251
|
-
message: 'Brand customization:',
|
|
252
|
-
choices: [
|
|
253
|
-
{ name: 'šØ Upload logo for instant branding', value: 'logo' },
|
|
254
|
-
{ name: 'šÆ Manual brand configuration', value: 'manual' },
|
|
255
|
-
{ name: 'āļø Skip (use defaults)', value: 'skip' }
|
|
256
|
-
]
|
|
257
|
-
}
|
|
258
|
-
]);
|
|
259
|
-
|
|
260
|
-
if (brandingChoice === 'logo') {
|
|
261
|
-
const { logoPath } = await inquirer.prompt([
|
|
262
|
-
{
|
|
263
|
-
type: 'input',
|
|
264
|
-
name: 'logoPath',
|
|
265
|
-
message: 'Path to your logo file:',
|
|
266
|
-
validate: input => {
|
|
267
|
-
if (!input) return 'Logo path is required';
|
|
268
|
-
// In production, validate file exists
|
|
269
|
-
return true;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
]);
|
|
273
|
-
return { type: 'logo', logoPath };
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (brandingChoice === 'manual') {
|
|
277
|
-
const answers = await inquirer.prompt([
|
|
278
|
-
{
|
|
279
|
-
type: 'input',
|
|
280
|
-
name: 'companyName',
|
|
281
|
-
message: 'Company name:',
|
|
282
|
-
default: 'Acme Inc'
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
type: 'input',
|
|
286
|
-
name: 'primaryColor',
|
|
287
|
-
message: 'Primary color (hex):',
|
|
288
|
-
default: '#0070f3'
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
type: 'list',
|
|
292
|
-
name: 'industry',
|
|
293
|
-
message: 'Industry:',
|
|
294
|
-
choices: ['Tech', 'Finance', 'Healthcare', 'Education', 'Other']
|
|
295
|
-
}
|
|
296
|
-
]);
|
|
297
|
-
return { type: 'manual', ...answers };
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
return { type: 'skip' };
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Select deployment platform
|
|
305
|
-
*/
|
|
306
|
-
async function selectDeployment() {
|
|
307
|
-
const { deployment } = await inquirer.prompt([
|
|
308
|
-
{
|
|
309
|
-
type: 'list',
|
|
310
|
-
name: 'deployment',
|
|
311
|
-
message: 'Where will you deploy?',
|
|
312
|
-
choices: [
|
|
313
|
-
{ name: 'ā² Vercel', value: 'vercel' },
|
|
314
|
-
{ name: 'āļø Cloudflare Pages', value: 'cloudflare' },
|
|
315
|
-
{ name: 'š· Netlify', value: 'netlify' },
|
|
316
|
-
{ name: 'š Railway', value: 'railway' },
|
|
317
|
-
{ name: 'š GitHub Pages', value: 'github-pages' },
|
|
318
|
-
{ name: 'āļø Configure later', value: 'skip' }
|
|
319
|
-
]
|
|
320
|
-
}
|
|
321
|
-
]);
|
|
322
|
-
|
|
323
|
-
return deployment;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Select AI agents
|
|
328
|
-
*/
|
|
329
|
-
async function selectAgents() {
|
|
330
|
-
const { agents } = await inquirer.prompt([
|
|
331
|
-
{
|
|
332
|
-
type: 'checkbox',
|
|
333
|
-
name: 'agents',
|
|
334
|
-
message: 'Select AI agents to include:',
|
|
335
|
-
choices: [
|
|
336
|
-
{ name: 'š Marketing Director', value: 'marketing-director' },
|
|
337
|
-
{ name: 'š ļø Engineering Architect', value: 'engineering-architect' },
|
|
338
|
-
{ name: 'š Content Creator', value: 'content-creator' },
|
|
339
|
-
{ name: 'š¬ Research Analyst', value: 'research-analyst' },
|
|
340
|
-
{ name: 'š° Sales Manager', value: 'sales-manager' },
|
|
341
|
-
{ name: 'š¤ Customer Success', value: 'customer-success' },
|
|
342
|
-
{ name: 'šØ Design Expert', value: 'design-expert' },
|
|
343
|
-
{ name: 'š Data Analyst', value: 'data-analyst' }
|
|
344
|
-
]
|
|
345
|
-
}
|
|
346
|
-
]);
|
|
347
|
-
|
|
348
|
-
return agents;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Generate base turbo monorepo structure
|
|
353
|
-
*/
|
|
354
|
-
async function generateBaseStructure(projectPath, template) {
|
|
355
|
-
const structure = {
|
|
356
|
-
'apps/': {},
|
|
357
|
-
'packages/': {
|
|
358
|
-
'ui/': {},
|
|
359
|
-
'config/': {},
|
|
360
|
-
'utils/': {}
|
|
361
|
-
},
|
|
362
|
-
'.claude/': {
|
|
363
|
-
'agents/': {},
|
|
364
|
-
'commands/': {},
|
|
365
|
-
'hooks/': {}
|
|
366
|
-
},
|
|
367
|
-
'.one/': {
|
|
368
|
-
'workflows/': {},
|
|
369
|
-
'templates/': {},
|
|
370
|
-
'tools/': {}
|
|
371
|
-
},
|
|
372
|
-
'one/': {
|
|
373
|
-
'missions/': {},
|
|
374
|
-
'stories/': {},
|
|
375
|
-
'brand/': {}
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
// Create all directories
|
|
380
|
-
for (const [dir, subdirs] of Object.entries(structure)) {
|
|
381
|
-
const dirPath = path.join(projectPath, dir);
|
|
382
|
-
await fs.ensureDir(dirPath);
|
|
383
|
-
|
|
384
|
-
for (const subdir of Object.keys(subdirs)) {
|
|
385
|
-
await fs.ensureDir(path.join(dirPath, subdir));
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
// Create root package.json
|
|
390
|
-
const rootPackageJson = {
|
|
391
|
-
name: path.basename(projectPath),
|
|
392
|
-
version: '0.1.0',
|
|
393
|
-
private: true,
|
|
394
|
-
workspaces: ['apps/*', 'packages/*'],
|
|
395
|
-
scripts: {
|
|
396
|
-
dev: 'turbo run dev',
|
|
397
|
-
build: 'turbo run build',
|
|
398
|
-
test: 'turbo run test',
|
|
399
|
-
lint: 'turbo run lint',
|
|
400
|
-
deploy: 'turbo run deploy'
|
|
401
|
-
},
|
|
402
|
-
devDependencies: {
|
|
403
|
-
turbo: 'latest',
|
|
404
|
-
typescript: '^5.0.0'
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
await fs.writeJSON(
|
|
409
|
-
path.join(projectPath, 'package.json'),
|
|
410
|
-
rootPackageJson,
|
|
411
|
-
{ spaces: 2 }
|
|
412
|
-
);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Generate turbo.json configuration
|
|
417
|
-
*/
|
|
418
|
-
async function generateTurboJson(projectPath, template) {
|
|
419
|
-
const turboConfig = {
|
|
420
|
-
"$schema": "https://turbo.build/schema.json",
|
|
421
|
-
"globalDependencies": ["**/.env.*local"],
|
|
422
|
-
"pipeline": {
|
|
423
|
-
"build": {
|
|
424
|
-
"dependsOn": ["^build"],
|
|
425
|
-
"outputs": template.id === 'nextjs-saas'
|
|
426
|
-
? [".next/**", "!.next/cache/**"]
|
|
427
|
-
: template.id === 'astro'
|
|
428
|
-
? ["dist/**"]
|
|
429
|
-
: ["dist/**", "build/**"]
|
|
430
|
-
},
|
|
431
|
-
"dev": {
|
|
432
|
-
"cache": false,
|
|
433
|
-
"persistent": true
|
|
434
|
-
},
|
|
435
|
-
"lint": {
|
|
436
|
-
"outputs": []
|
|
437
|
-
},
|
|
438
|
-
"test": {
|
|
439
|
-
"outputs": ["coverage/**"],
|
|
440
|
-
"dependsOn": ["build"]
|
|
441
|
-
},
|
|
442
|
-
"deploy": {
|
|
443
|
-
"dependsOn": ["build", "test"],
|
|
444
|
-
"outputs": []
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
};
|
|
448
|
-
|
|
449
|
-
// Add template-specific configurations
|
|
450
|
-
if (template.id === 'nextjs-saas') {
|
|
451
|
-
turboConfig.pipeline.build.env = ["NEXT_PUBLIC_*"];
|
|
452
|
-
} else if (template.id === 'astro') {
|
|
453
|
-
turboConfig.pipeline.build.env = ["PUBLIC_*"];
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
await fs.writeJSON(
|
|
457
|
-
path.join(projectPath, 'turbo.json'),
|
|
458
|
-
turboConfig,
|
|
459
|
-
{ spaces: 2 }
|
|
460
|
-
);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* Apply template to project
|
|
465
|
-
*/
|
|
466
|
-
async function applyTemplate(projectPath, template) {
|
|
467
|
-
// In production, this would clone from template repos
|
|
468
|
-
// For now, create basic structure based on template
|
|
469
|
-
|
|
470
|
-
if (template.id === 'astro') {
|
|
471
|
-
await createAstroApp(projectPath);
|
|
472
|
-
} else if (template.id === 'nextjs-saas') {
|
|
473
|
-
await createNextApp(projectPath);
|
|
474
|
-
} else if (template.id === 'portfolio') {
|
|
475
|
-
await createPortfolioApp(projectPath);
|
|
476
|
-
} else {
|
|
477
|
-
await createCustomApp(projectPath);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Create Astro app structure
|
|
483
|
-
*/
|
|
484
|
-
async function createAstroApp(projectPath) {
|
|
485
|
-
const appPath = path.join(projectPath, 'apps/web');
|
|
486
|
-
await fs.ensureDir(appPath);
|
|
487
|
-
|
|
488
|
-
const packageJson = {
|
|
489
|
-
name: '@app/web',
|
|
490
|
-
version: '0.1.0',
|
|
491
|
-
private: true,
|
|
492
|
-
scripts: {
|
|
493
|
-
dev: 'astro dev',
|
|
494
|
-
build: 'astro build',
|
|
495
|
-
preview: 'astro preview'
|
|
496
|
-
},
|
|
497
|
-
dependencies: {
|
|
498
|
-
astro: 'latest',
|
|
499
|
-
'@astrojs/react': 'latest',
|
|
500
|
-
'@astrojs/tailwind': 'latest',
|
|
501
|
-
react: '^18.0.0',
|
|
502
|
-
'react-dom': '^18.0.0'
|
|
503
|
-
}
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
await fs.writeJSON(
|
|
507
|
-
path.join(appPath, 'package.json'),
|
|
508
|
-
packageJson,
|
|
509
|
-
{ spaces: 2 }
|
|
510
|
-
);
|
|
511
|
-
|
|
512
|
-
// Create basic Astro config
|
|
513
|
-
const astroConfig = `import { defineConfig } from 'astro/config';
|
|
514
|
-
import react from '@astrojs/react';
|
|
515
|
-
import tailwind from '@astrojs/tailwind';
|
|
516
|
-
|
|
517
|
-
export default defineConfig({
|
|
518
|
-
integrations: [react(), tailwind()]
|
|
519
|
-
});`;
|
|
520
|
-
|
|
521
|
-
await fs.writeFile(path.join(appPath, 'astro.config.mjs'), astroConfig);
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* Create Next.js app structure
|
|
526
|
-
*/
|
|
527
|
-
async function createNextApp(projectPath) {
|
|
528
|
-
const appPath = path.join(projectPath, 'apps/web');
|
|
529
|
-
await fs.ensureDir(appPath);
|
|
530
|
-
|
|
531
|
-
const packageJson = {
|
|
532
|
-
name: '@app/web',
|
|
533
|
-
version: '0.1.0',
|
|
534
|
-
private: true,
|
|
535
|
-
scripts: {
|
|
536
|
-
dev: 'next dev',
|
|
537
|
-
build: 'next build',
|
|
538
|
-
start: 'next start',
|
|
539
|
-
lint: 'next lint'
|
|
540
|
-
},
|
|
541
|
-
dependencies: {
|
|
542
|
-
next: 'latest',
|
|
543
|
-
react: '^18.0.0',
|
|
544
|
-
'react-dom': '^18.0.0',
|
|
545
|
-
'@repo/ui': 'workspace:*'
|
|
546
|
-
}
|
|
547
|
-
};
|
|
548
|
-
|
|
549
|
-
await fs.writeJSON(
|
|
550
|
-
path.join(appPath, 'package.json'),
|
|
551
|
-
packageJson,
|
|
552
|
-
{ spaces: 2 }
|
|
553
|
-
);
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* Create portfolio app structure
|
|
558
|
-
*/
|
|
559
|
-
async function createPortfolioApp(projectPath) {
|
|
560
|
-
// Similar to Next.js but with portfolio-specific setup
|
|
561
|
-
await createNextApp(projectPath);
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* Create custom app structure
|
|
566
|
-
*/
|
|
567
|
-
async function createCustomApp(projectPath) {
|
|
568
|
-
const appPath = path.join(projectPath, 'apps/web');
|
|
569
|
-
await fs.ensureDir(appPath);
|
|
570
|
-
|
|
571
|
-
const packageJson = {
|
|
572
|
-
name: '@app/web',
|
|
573
|
-
version: '0.1.0',
|
|
574
|
-
private: true,
|
|
575
|
-
scripts: {
|
|
576
|
-
dev: 'echo "Configure your dev script"',
|
|
577
|
-
build: 'echo "Configure your build script"'
|
|
578
|
-
}
|
|
579
|
-
};
|
|
580
|
-
|
|
581
|
-
await fs.writeJSON(
|
|
582
|
-
path.join(appPath, 'package.json'),
|
|
583
|
-
packageJson,
|
|
584
|
-
{ spaces: 2 }
|
|
585
|
-
);
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* Customize brand
|
|
590
|
-
*/
|
|
591
|
-
async function customizeBrand(projectPath, branding) {
|
|
592
|
-
// Create brand configuration
|
|
593
|
-
const brandConfig = {
|
|
594
|
-
type: branding.type,
|
|
595
|
-
timestamp: new Date().toISOString(),
|
|
596
|
-
config: branding
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
await fs.writeJSON(
|
|
600
|
-
path.join(projectPath, 'one/brand/config.json'),
|
|
601
|
-
brandConfig,
|
|
602
|
-
{ spaces: 2 }
|
|
603
|
-
);
|
|
604
|
-
|
|
605
|
-
// In production, this would:
|
|
606
|
-
// 1. Process logo to extract colors
|
|
607
|
-
// 2. Generate color palette
|
|
608
|
-
// 3. Update Tailwind config
|
|
609
|
-
// 4. Replace placeholder content
|
|
610
|
-
// 5. Generate favicons and social images
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* Setup Trinity architecture
|
|
615
|
-
*/
|
|
616
|
-
async function setupTrinityArchitecture(projectPath) {
|
|
617
|
-
// Create README in each Trinity directory
|
|
618
|
-
const trinityDocs = {
|
|
619
|
-
'.claude/README.md': `# .claude - Execution Layer
|
|
620
|
-
|
|
621
|
-
This directory contains AI agents and Claude Code integration.
|
|
622
|
-
|
|
623
|
-
- agents/ - 112+ specialized AI agents
|
|
624
|
-
- commands/ - Claude Code commands
|
|
625
|
-
- hooks/ - Automation hooks`,
|
|
626
|
-
|
|
627
|
-
'.one/README.md': `# .one - Foundation Layer
|
|
628
|
-
|
|
629
|
-
This directory contains platform resources and workflows.
|
|
630
|
-
|
|
631
|
-
- workflows/ - Mission ā Story ā Task ā Agent orchestration
|
|
632
|
-
- templates/ - Reusable templates
|
|
633
|
-
- tools/ - Build and automation tools`,
|
|
634
|
-
|
|
635
|
-
'one/README.md': `# one - Creation Layer
|
|
636
|
-
|
|
637
|
-
This directory is your workspace for missions and content.
|
|
638
|
-
|
|
639
|
-
- missions/ - Your strategic goals
|
|
640
|
-
- stories/ - Implementation narratives
|
|
641
|
-
- brand/ - Brand assets and configuration`
|
|
642
|
-
};
|
|
643
|
-
|
|
644
|
-
for (const [file, content] of Object.entries(trinityDocs)) {
|
|
645
|
-
await fs.writeFile(path.join(projectPath, file), content);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* Configure AI agents
|
|
651
|
-
*/
|
|
652
|
-
async function configureAgents(projectPath, agents) {
|
|
653
|
-
const agentConfig = {
|
|
654
|
-
enabled: agents,
|
|
655
|
-
timestamp: new Date().toISOString()
|
|
656
|
-
};
|
|
657
|
-
|
|
658
|
-
await fs.writeJSON(
|
|
659
|
-
path.join(projectPath, '.claude/agents/config.json'),
|
|
660
|
-
agentConfig,
|
|
661
|
-
{ spaces: 2 }
|
|
662
|
-
);
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
/**
|
|
666
|
-
* Setup deployment configuration
|
|
667
|
-
*/
|
|
668
|
-
async function setupDeployment(projectPath, platform) {
|
|
669
|
-
if (platform === 'vercel') {
|
|
670
|
-
const vercelConfig = {
|
|
671
|
-
framework: 'turbo',
|
|
672
|
-
buildCommand: 'turbo run build',
|
|
673
|
-
devCommand: 'turbo run dev',
|
|
674
|
-
outputDirectory: 'apps/web/.next'
|
|
675
|
-
};
|
|
676
|
-
|
|
677
|
-
await fs.writeJSON(
|
|
678
|
-
path.join(projectPath, 'vercel.json'),
|
|
679
|
-
vercelConfig,
|
|
680
|
-
{ spaces: 2 }
|
|
681
|
-
);
|
|
682
|
-
} else if (platform === 'cloudflare') {
|
|
683
|
-
const wranglerConfig = `name = "${path.basename(projectPath)}"
|
|
684
|
-
compatibility_date = "2024-01-01"
|
|
685
|
-
|
|
686
|
-
[build]
|
|
687
|
-
command = "turbo run build"
|
|
688
|
-
|
|
689
|
-
[[d1_databases]]
|
|
690
|
-
binding = "DB"
|
|
691
|
-
database_name = "production"
|
|
692
|
-
database_id = "YOUR_DATABASE_ID"`;
|
|
693
|
-
|
|
694
|
-
await fs.writeFile(
|
|
695
|
-
path.join(projectPath, 'wrangler.toml'),
|
|
696
|
-
wranglerConfig
|
|
697
|
-
);
|
|
698
|
-
} else if (platform === 'netlify') {
|
|
699
|
-
const netlifyConfig = `[build]
|
|
700
|
-
command = "turbo run build"
|
|
701
|
-
publish = "apps/web/dist"
|
|
702
|
-
|
|
703
|
-
[build.environment]
|
|
704
|
-
NODE_VERSION = "18"`;
|
|
705
|
-
|
|
706
|
-
await fs.writeFile(
|
|
707
|
-
path.join(projectPath, 'netlify.toml'),
|
|
708
|
-
netlifyConfig
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* Initialize git repository
|
|
715
|
-
*/
|
|
716
|
-
async function initGit(projectPath) {
|
|
717
|
-
try {
|
|
718
|
-
execSync('git init', { cwd: projectPath, stdio: 'ignore' });
|
|
719
|
-
|
|
720
|
-
// Create .gitignore
|
|
721
|
-
const gitignore = `# Dependencies
|
|
722
|
-
node_modules/
|
|
723
|
-
.pnp
|
|
724
|
-
.pnp.js
|
|
725
|
-
|
|
726
|
-
# Testing
|
|
727
|
-
coverage/
|
|
728
|
-
|
|
729
|
-
# Turbo
|
|
730
|
-
.turbo/
|
|
731
|
-
|
|
732
|
-
# Next.js
|
|
733
|
-
.next/
|
|
734
|
-
out/
|
|
735
|
-
|
|
736
|
-
# Production
|
|
737
|
-
build/
|
|
738
|
-
dist/
|
|
739
|
-
|
|
740
|
-
# Misc
|
|
741
|
-
.DS_Store
|
|
742
|
-
*.pem
|
|
743
|
-
.env*.local
|
|
744
|
-
|
|
745
|
-
# Debug
|
|
746
|
-
npm-debug.log*
|
|
747
|
-
yarn-debug.log*
|
|
748
|
-
yarn-error.log*
|
|
749
|
-
|
|
750
|
-
# IDE
|
|
751
|
-
.vscode/
|
|
752
|
-
.idea/`;
|
|
753
|
-
|
|
754
|
-
await fs.writeFile(path.join(projectPath, '.gitignore'), gitignore);
|
|
755
|
-
} catch (error) {
|
|
756
|
-
// Git not available, skip
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
/**
|
|
761
|
-
* Install dependencies
|
|
762
|
-
*/
|
|
763
|
-
async function installDependencies(projectPath) {
|
|
764
|
-
try {
|
|
765
|
-
// Check if bun is available
|
|
766
|
-
execSync('bun --version', { stdio: 'ignore' });
|
|
767
|
-
execSync('bun install', { cwd: projectPath, stdio: 'ignore' });
|
|
768
|
-
} catch {
|
|
769
|
-
try {
|
|
770
|
-
// Fallback to npm
|
|
771
|
-
execSync('npm install', { cwd: projectPath, stdio: 'ignore' });
|
|
772
|
-
} catch {
|
|
773
|
-
// Dependencies will need to be installed manually
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
/**
|
|
779
|
-
* Show success message
|
|
780
|
-
*/
|
|
781
|
-
function showSuccessMessage(projectName, template, deployment, agents) {
|
|
782
|
-
console.log(chalk.green(`
|
|
783
|
-
⨠Your turbo-powered app is ready!
|
|
784
|
-
|
|
785
|
-
š Project: ${chalk.cyan(projectName)}
|
|
786
|
-
šØ Template: ${chalk.cyan(template.name)}
|
|
787
|
-
š Deployment: ${chalk.cyan(deployment === 'skip' ? 'Not configured' : deployment)}
|
|
788
|
-
š¤ AI Agents: ${chalk.cyan(agents.length > 0 ? agents.join(', ') : 'None selected')}
|
|
789
|
-
|
|
790
|
-
${chalk.yellow('Next steps:')}
|
|
791
|
-
${chalk.gray('$')} cd ${projectName}
|
|
792
|
-
${chalk.gray('$')} bun install ${chalk.gray('# If not already installed')}
|
|
793
|
-
${chalk.gray('$')} bun run dev ${chalk.gray('# Start development')}
|
|
794
|
-
|
|
795
|
-
${chalk.yellow('Available commands:')}
|
|
796
|
-
${chalk.gray('bun run')} dev ${chalk.gray('# Start development server')}
|
|
797
|
-
${chalk.gray('bun run')} build ${chalk.gray('# Build for production')}
|
|
798
|
-
${chalk.gray('bun run')} test ${chalk.gray('# Run tests')}
|
|
799
|
-
${chalk.gray('bun run')} lint ${chalk.gray('# Lint code')}
|
|
800
|
-
${chalk.gray('bun run')} deploy ${chalk.gray('# Deploy to production')}
|
|
801
|
-
|
|
802
|
-
${chalk.magenta('š¤ AI Commands:')}
|
|
803
|
-
/one ${chalk.gray('# Launch mission control')}
|
|
804
|
-
/agent ${chalk.gray('# List available agents')}
|
|
805
|
-
/mission ${chalk.gray('# Create new mission')}
|
|
806
|
-
/story ${chalk.gray('# Write implementation story')}
|
|
807
|
-
|
|
808
|
-
${chalk.cyan('š Resources:')}
|
|
809
|
-
Documentation: https://one.ie/docs
|
|
810
|
-
Templates: https://one.ie/templates
|
|
811
|
-
Discord: https://discord.gg/one
|
|
812
|
-
GitHub: https://github.com/one-ie/one
|
|
813
|
-
|
|
814
|
-
${chalk.green.bold('šÆ Your turbo repo is ready to scale!')}
|
|
815
|
-
`));
|
|
816
|
-
}
|