ultra-dex 1.7.3 ā 2.2.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/README.md +160 -127
- package/assets/agents/0-orchestration/orchestrator.md +225 -0
- package/assets/agents/00-AGENT_INDEX.md +138 -0
- package/assets/agents/1-leadership/cto.md +186 -0
- package/assets/agents/1-leadership/planner.md +205 -0
- package/assets/agents/1-leadership/research.md +285 -0
- package/assets/agents/2-development/backend.md +472 -0
- package/assets/agents/2-development/database.md +516 -0
- package/assets/agents/2-development/frontend.md +144 -0
- package/assets/agents/3-security/auth.md +168 -0
- package/assets/agents/3-security/security.md +335 -0
- package/assets/agents/4-devops/devops.md +587 -0
- package/assets/agents/5-quality/debugger.md +188 -0
- package/assets/agents/5-quality/documentation.md +167 -0
- package/assets/agents/5-quality/reviewer.md +213 -0
- package/assets/agents/5-quality/testing.md +280 -0
- package/assets/agents/6-specialist/performance.md +323 -0
- package/assets/agents/6-specialist/refactoring.md +343 -0
- package/assets/agents/AGENT-INSTRUCTIONS.md +315 -0
- package/assets/agents/README.md +232 -0
- package/assets/cursor-rules/00-ultra-dex-core.mdc +48 -0
- package/assets/cursor-rules/01-database.mdc +50 -0
- package/assets/cursor-rules/02-api.mdc +81 -0
- package/assets/cursor-rules/03-auth.mdc +70 -0
- package/assets/cursor-rules/04-frontend.mdc +92 -0
- package/assets/cursor-rules/05-payments.mdc +88 -0
- package/assets/cursor-rules/06-testing.mdc +104 -0
- package/assets/cursor-rules/07-security.mdc +94 -0
- package/assets/cursor-rules/08-deployment.mdc +92 -0
- package/assets/cursor-rules/09-error-handling.mdc +137 -0
- package/assets/cursor-rules/10-performance.mdc +123 -0
- package/assets/cursor-rules/11-nextjs-v15.mdc +307 -0
- package/assets/cursor-rules/12-multi-tenancy.mdc +282 -0
- package/assets/cursor-rules/README.md +78 -0
- package/assets/cursor-rules/load.ps1 +108 -0
- package/assets/cursor-rules/load.sh +102 -0
- package/assets/docs/BUILD-AUTH-30M.md +113 -0
- package/assets/docs/CHECKLIST-21-STEP.md +86 -0
- package/assets/docs/CODEMAP.md +229 -0
- package/assets/docs/CUSTOMIZATION.md +127 -0
- package/assets/docs/LAUNCH-POSTS.md +238 -0
- package/assets/docs/QUICK-REFERENCE.md +338 -0
- package/assets/docs/README.md +21 -0
- package/assets/docs/ROADMAP.md +480 -0
- package/assets/docs/TROUBLESHOOTING.md +148 -0
- package/assets/docs/TUTORIAL.md +182 -0
- package/assets/docs/VERIFICATION.md +108 -0
- package/assets/docs/VISION-V2.md +187 -0
- package/assets/docs/WORKFLOW-DIAGRAMS.md +463 -0
- package/assets/docs/index.html +550 -0
- package/assets/live-templates/next15-prisma-clerk/.env.example +3 -0
- package/assets/live-templates/next15-prisma-clerk/README.md +10 -0
- package/assets/live-templates/next15-prisma-clerk/app/layout.tsx +7 -0
- package/assets/live-templates/next15-prisma-clerk/app/page.tsx +8 -0
- package/assets/live-templates/next15-prisma-clerk/next.config.js +6 -0
- package/assets/live-templates/next15-prisma-clerk/package.json +22 -0
- package/assets/live-templates/next15-prisma-clerk/prisma/schema.prisma +34 -0
- package/assets/live-templates/remix-supabase/.env.example +2 -0
- package/assets/live-templates/remix-supabase/README.md +9 -0
- package/assets/live-templates/remix-supabase/app/root.tsx +19 -0
- package/assets/live-templates/remix-supabase/app/routes/_index.tsx +8 -0
- package/assets/live-templates/remix-supabase/app/utils/supabase.server.ts +6 -0
- package/assets/live-templates/remix-supabase/package.json +20 -0
- package/assets/live-templates/remix-supabase/remix.config.js +6 -0
- package/assets/live-templates/sveltekit-drizzle/.env.example +1 -0
- package/assets/live-templates/sveltekit-drizzle/README.md +9 -0
- package/assets/live-templates/sveltekit-drizzle/drizzle/schema.ts +7 -0
- package/assets/live-templates/sveltekit-drizzle/drizzle.config.ts +5 -0
- package/assets/live-templates/sveltekit-drizzle/package.json +21 -0
- package/assets/live-templates/sveltekit-drizzle/src/lib/db.ts +5 -0
- package/assets/live-templates/sveltekit-drizzle/src/routes/+page.svelte +2 -0
- package/assets/live-templates/sveltekit-drizzle/svelte.config.js +5 -0
- package/assets/live-templates/sveltekit-drizzle/vite.config.js +5 -0
- package/assets/saas-plan/04-Imp-Template.md +5546 -0
- package/assets/templates/CASE-STUDY-TEMPLATE.md +139 -0
- package/assets/templates/MASTER-PLAN-TEMPLATE.md +647 -0
- package/assets/templates/ORDER-TRACKER-TEMPLATE.md +731 -0
- package/assets/templates/PHASE-TRACKER-TEMPLATE.md +577 -0
- package/assets/templates/README.md +419 -0
- package/bin/ultra-dex.js +1078 -422
- package/lib/commands/agents.js +154 -0
- package/lib/commands/audit.js +135 -0
- package/lib/commands/banner.js +21 -0
- package/lib/commands/build.js +214 -0
- package/lib/commands/examples.js +34 -0
- package/lib/commands/fetch.js +186 -0
- package/lib/commands/generate.js +217 -0
- package/lib/commands/hooks.js +105 -0
- package/lib/commands/init.js +337 -0
- package/lib/commands/placeholders.js +11 -0
- package/lib/commands/review.js +287 -0
- package/lib/commands/serve.js +56 -0
- package/lib/commands/suggest.js +126 -0
- package/lib/commands/validate.js +140 -0
- package/lib/commands/workflows.js +185 -0
- package/lib/config/paths.js +9 -0
- package/lib/config/urls.js +16 -0
- package/lib/providers/base.js +82 -0
- package/lib/providers/claude.js +177 -0
- package/lib/providers/gemini.js +170 -0
- package/lib/providers/index.js +93 -0
- package/lib/providers/openai.js +163 -0
- package/lib/templates/context.js +26 -0
- package/lib/templates/embedded.js +141 -0
- package/lib/templates/prompts/generate-plan.js +147 -0
- package/lib/templates/prompts/review-code.js +57 -0
- package/lib/templates/prompts/section-prompts.js +275 -0
- package/lib/templates/prompts/system-prompt.md +58 -0
- package/lib/templates/quick-start.js +43 -0
- package/lib/utils/build-helpers.js +257 -0
- package/lib/utils/fallback.js +36 -0
- package/lib/utils/files.js +67 -0
- package/lib/utils/network.js +18 -0
- package/lib/utils/output.js +20 -0
- package/lib/utils/parser.js +155 -0
- package/lib/utils/prompt-builder.js +93 -0
- package/lib/utils/review-helpers.js +334 -0
- package/lib/utils/validation.js +34 -0
- package/package.json +19 -5
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
import { AGENTS } from './agents.js';
|
|
4
|
+
|
|
5
|
+
export function registerSuggestCommand(program) {
|
|
6
|
+
program
|
|
7
|
+
.command('suggest')
|
|
8
|
+
.description('Get AI agent suggestions for your task')
|
|
9
|
+
.action(async () => {
|
|
10
|
+
console.log(chalk.cyan('\nš¤ Ultra-Dex Agent Suggester\n'));
|
|
11
|
+
|
|
12
|
+
const answers = await inquirer.prompt([
|
|
13
|
+
{
|
|
14
|
+
type: 'list',
|
|
15
|
+
name: 'taskType',
|
|
16
|
+
message: 'What are you trying to build?',
|
|
17
|
+
choices: [
|
|
18
|
+
'New feature from scratch',
|
|
19
|
+
'Authentication system',
|
|
20
|
+
'Payment integration',
|
|
21
|
+
'Database changes',
|
|
22
|
+
'Bug fix',
|
|
23
|
+
'Performance optimization',
|
|
24
|
+
'Deployment/DevOps',
|
|
25
|
+
'API endpoint',
|
|
26
|
+
'UI component',
|
|
27
|
+
'Testing',
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: 'input',
|
|
32
|
+
name: 'description',
|
|
33
|
+
message: 'Briefly describe your task:',
|
|
34
|
+
default: '',
|
|
35
|
+
},
|
|
36
|
+
]);
|
|
37
|
+
|
|
38
|
+
console.log(chalk.bold('\nš” Suggested Agent Workflow:\n'));
|
|
39
|
+
|
|
40
|
+
let suggestedAgents = [];
|
|
41
|
+
let reasoning = '';
|
|
42
|
+
|
|
43
|
+
switch (answers.taskType) {
|
|
44
|
+
case 'New feature from scratch':
|
|
45
|
+
suggestedAgents = ['@Planner', '@CTO', '@Database', '@Backend', '@Frontend', '@Testing', '@Reviewer', '@DevOps'];
|
|
46
|
+
reasoning = 'Complete feature requires planning, architecture, implementation, testing, and deployment';
|
|
47
|
+
break;
|
|
48
|
+
|
|
49
|
+
case 'Authentication system':
|
|
50
|
+
suggestedAgents = ['@Planner', '@Research', '@CTO', '@Database', '@Backend', '@Frontend', '@Security', '@DevOps'];
|
|
51
|
+
reasoning = 'Auth requires research (providers), security review, and full-stack implementation';
|
|
52
|
+
break;
|
|
53
|
+
|
|
54
|
+
case 'Payment integration':
|
|
55
|
+
suggestedAgents = ['@Planner', '@Research', '@CTO', '@Database', '@Backend', '@Frontend', '@Testing', '@Security', '@DevOps'];
|
|
56
|
+
reasoning = 'Payments need provider research, webhook handling, testing, and security audit';
|
|
57
|
+
break;
|
|
58
|
+
|
|
59
|
+
case 'Database changes':
|
|
60
|
+
suggestedAgents = ['@Planner', '@CTO', '@Database', '@Backend', '@Testing'];
|
|
61
|
+
reasoning = 'Schema changes need planning, architecture review, migration, and testing';
|
|
62
|
+
break;
|
|
63
|
+
|
|
64
|
+
case 'Bug fix':
|
|
65
|
+
suggestedAgents = ['@Debugger', '@Testing', '@Reviewer'];
|
|
66
|
+
reasoning = 'Debug issue, add test to prevent regression, review fix';
|
|
67
|
+
break;
|
|
68
|
+
|
|
69
|
+
case 'Performance optimization':
|
|
70
|
+
suggestedAgents = ['@Performance', '@Backend', '@Frontend', '@Database', '@Testing'];
|
|
71
|
+
reasoning = 'Identify bottlenecks, optimize code/queries, verify improvements';
|
|
72
|
+
break;
|
|
73
|
+
|
|
74
|
+
case 'Deployment/DevOps':
|
|
75
|
+
suggestedAgents = ['@DevOps', '@CTO', '@Security'];
|
|
76
|
+
reasoning = 'Infrastructure setup with security review';
|
|
77
|
+
break;
|
|
78
|
+
|
|
79
|
+
case 'API endpoint':
|
|
80
|
+
suggestedAgents = ['@Backend', '@Database', '@Testing', '@Reviewer'];
|
|
81
|
+
reasoning = 'Implement endpoint, add tests, review code quality';
|
|
82
|
+
break;
|
|
83
|
+
|
|
84
|
+
case 'UI component':
|
|
85
|
+
suggestedAgents = ['@Frontend', '@Reviewer'];
|
|
86
|
+
reasoning = 'Build component, review for quality and accessibility';
|
|
87
|
+
break;
|
|
88
|
+
|
|
89
|
+
case 'Testing':
|
|
90
|
+
suggestedAgents = ['@Testing', '@Reviewer'];
|
|
91
|
+
reasoning = 'Write tests, review coverage';
|
|
92
|
+
break;
|
|
93
|
+
|
|
94
|
+
default:
|
|
95
|
+
suggestedAgents = ['@Planner', '@CTO'];
|
|
96
|
+
reasoning = 'Start with planning and architecture review';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
console.log(chalk.gray(reasoning + '\n'));
|
|
100
|
+
|
|
101
|
+
suggestedAgents.forEach((agent, i) => {
|
|
102
|
+
const agentName = agent.replace('@', '').toLowerCase();
|
|
103
|
+
const agentInfo = AGENTS.find(a => a.name === agentName);
|
|
104
|
+
const arrow = i < suggestedAgents.length - 1 ? ' ā' : '';
|
|
105
|
+
console.log(chalk.cyan(` ${i + 1}. ${agent}`) + chalk.gray(` - ${agentInfo?.description || ''}`) + arrow);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
console.log(chalk.bold('\nš Next Steps:\n'));
|
|
109
|
+
console.log(chalk.gray(` 1. Start with ${suggestedAgents[0]} to plan the task`));
|
|
110
|
+
console.log(chalk.gray(' 2. Hand off to each agent in sequence'));
|
|
111
|
+
console.log(chalk.gray(' 3. Use "ultra-dex agent <name>" to see full prompts\n'));
|
|
112
|
+
|
|
113
|
+
console.log(chalk.bold('š Related Workflows:\n'));
|
|
114
|
+
if (answers.taskType === 'Authentication system') {
|
|
115
|
+
console.log(chalk.blue(' ultra-dex workflow auth'));
|
|
116
|
+
console.log(chalk.blue(' ultra-dex workflow supabase\n'));
|
|
117
|
+
} else if (answers.taskType === 'Payment integration') {
|
|
118
|
+
console.log(chalk.blue(' ultra-dex workflow payments\n'));
|
|
119
|
+
} else if (answers.taskType === 'Deployment/DevOps') {
|
|
120
|
+
console.log(chalk.blue(' ultra-dex workflow vercel'));
|
|
121
|
+
console.log(chalk.blue(' ultra-dex workflow cicd\n'));
|
|
122
|
+
} else {
|
|
123
|
+
console.log(chalk.gray(' Use "ultra-dex workflow <feature>" to see examples\n'));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { validateSafePath } from '../utils/validation.js';
|
|
5
|
+
|
|
6
|
+
export function registerValidateCommand(program) {
|
|
7
|
+
program
|
|
8
|
+
.command('validate')
|
|
9
|
+
.description('Validate project structure against Ultra-Dex standards')
|
|
10
|
+
.option('-d, --dir <directory>', 'Project directory to validate', '.')
|
|
11
|
+
.action(async (options) => {
|
|
12
|
+
console.log(chalk.cyan('\nā
Ultra-Dex Structure Validator\n'));
|
|
13
|
+
|
|
14
|
+
const dirValidation = validateSafePath(options.dir, 'Project directory');
|
|
15
|
+
if (dirValidation !== true) {
|
|
16
|
+
console.log(chalk.red(dirValidation));
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const projectDir = path.resolve(options.dir);
|
|
21
|
+
let passed = 0;
|
|
22
|
+
let failed = 0;
|
|
23
|
+
const warnings = [];
|
|
24
|
+
|
|
25
|
+
async function checkExists(itemPath, type = 'file') {
|
|
26
|
+
try {
|
|
27
|
+
const stats = await fs.stat(path.join(projectDir, itemPath));
|
|
28
|
+
if (type === 'file' && stats.isFile()) return true;
|
|
29
|
+
if (type === 'dir' && stats.isDirectory()) return true;
|
|
30
|
+
return false;
|
|
31
|
+
} catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
console.log(chalk.bold('Checking required files...\n'));
|
|
37
|
+
|
|
38
|
+
const coreFiles = [
|
|
39
|
+
{ path: 'QUICK-START.md', required: true },
|
|
40
|
+
{ path: 'IMPLEMENTATION-PLAN.md', required: true },
|
|
41
|
+
{ path: 'CONTEXT.md', required: false },
|
|
42
|
+
{ path: 'README.md', required: false },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
for (const file of coreFiles) {
|
|
46
|
+
const exists = await checkExists(file.path);
|
|
47
|
+
if (exists) {
|
|
48
|
+
passed++;
|
|
49
|
+
console.log(chalk.green(` ā
${file.path}`));
|
|
50
|
+
} else if (file.required) {
|
|
51
|
+
failed++;
|
|
52
|
+
console.log(chalk.red(` ā ${file.path} (required)`));
|
|
53
|
+
} else {
|
|
54
|
+
warnings.push(file.path);
|
|
55
|
+
console.log(chalk.yellow(` ā ļø ${file.path} (recommended)`));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
console.log(chalk.bold('\nChecking directory structure...\n'));
|
|
60
|
+
|
|
61
|
+
const directories = [
|
|
62
|
+
{ path: 'docs', required: false },
|
|
63
|
+
{ path: '.agents', required: false },
|
|
64
|
+
{ path: '.cursor/rules', required: false },
|
|
65
|
+
];
|
|
66
|
+
|
|
67
|
+
for (const dir of directories) {
|
|
68
|
+
const exists = await checkExists(dir.path, 'dir');
|
|
69
|
+
if (exists) {
|
|
70
|
+
passed++;
|
|
71
|
+
console.log(chalk.green(` ā
${dir.path}/`));
|
|
72
|
+
} else {
|
|
73
|
+
warnings.push(dir.path);
|
|
74
|
+
console.log(chalk.yellow(` ā ļø ${dir.path}/ (optional)`));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
console.log(chalk.bold('\nValidating content quality...\n'));
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
const quickStart = await fs.readFile(path.join(projectDir, 'QUICK-START.md'), 'utf-8');
|
|
82
|
+
|
|
83
|
+
const sections = ['idea', 'problem', 'feature', 'tech stack', 'tasks'];
|
|
84
|
+
let sectionsFound = 0;
|
|
85
|
+
|
|
86
|
+
sections.forEach(section => {
|
|
87
|
+
if (quickStart.toLowerCase().includes(section)) {
|
|
88
|
+
sectionsFound++;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
if (sectionsFound >= 4) {
|
|
93
|
+
passed++;
|
|
94
|
+
console.log(chalk.green(` ā
QUICK-START.md has ${sectionsFound}/${sections.length} key sections`));
|
|
95
|
+
} else {
|
|
96
|
+
failed++;
|
|
97
|
+
console.log(chalk.red(` ā QUICK-START.md missing key sections (${sectionsFound}/${sections.length})`));
|
|
98
|
+
}
|
|
99
|
+
} catch {
|
|
100
|
+
console.log(chalk.gray(' ā Could not validate QUICK-START.md content'));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
const implPlan = await fs.readFile(path.join(projectDir, 'IMPLEMENTATION-PLAN.md'), 'utf-8');
|
|
105
|
+
|
|
106
|
+
if (implPlan.length > 500) {
|
|
107
|
+
passed++;
|
|
108
|
+
console.log(chalk.green(' ā
IMPLEMENTATION-PLAN.md has substantial content'));
|
|
109
|
+
} else {
|
|
110
|
+
warnings.push('IMPLEMENTATION-PLAN.md needs more detail');
|
|
111
|
+
console.log(chalk.yellow(` ā ļø IMPLEMENTATION-PLAN.md is sparse (${implPlan.length} chars)`));
|
|
112
|
+
}
|
|
113
|
+
} catch {
|
|
114
|
+
console.log(chalk.gray(' ā Could not validate IMPLEMENTATION-PLAN.md content'));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
console.log('\n' + chalk.bold('ā'.repeat(50)));
|
|
118
|
+
console.log(chalk.bold('\nValidation Summary:\n'));
|
|
119
|
+
console.log(chalk.green(` ā
Passed: ${passed}`));
|
|
120
|
+
console.log(chalk.red(` ā Failed: ${failed}`));
|
|
121
|
+
console.log(chalk.yellow(` ā ļø Warnings: ${warnings.length}`));
|
|
122
|
+
|
|
123
|
+
if (failed === 0) {
|
|
124
|
+
console.log(chalk.bold.green('\nā
VALIDATION PASSED\n'));
|
|
125
|
+
console.log(chalk.gray('Your project structure follows Ultra-Dex standards.'));
|
|
126
|
+
} else {
|
|
127
|
+
console.log(chalk.bold.yellow('\nā ļø VALIDATION INCOMPLETE\n'));
|
|
128
|
+
console.log(chalk.gray('Fix required files to meet Ultra-Dex standards.'));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (warnings.length > 0) {
|
|
132
|
+
console.log(chalk.bold('\nš” Recommendations:\n'));
|
|
133
|
+
warnings.slice(0, 3).forEach(w => {
|
|
134
|
+
console.log(chalk.cyan(` ā Consider adding ${w}`));
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
console.log('\n' + chalk.gray('Run "ultra-dex init" to set up a proper Ultra-Dex project.\n'));
|
|
139
|
+
});
|
|
140
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { githubBlobUrl } from '../config/urls.js';
|
|
3
|
+
|
|
4
|
+
export const WORKFLOWS = {
|
|
5
|
+
auth: {
|
|
6
|
+
name: 'Authentication',
|
|
7
|
+
agents: ['@Planner', '@Research', '@CTO', '@Database', '@Backend', '@Frontend', '@Security', '@DevOps'],
|
|
8
|
+
description: 'Complete authentication with email/password and OAuth',
|
|
9
|
+
example: 'supabase',
|
|
10
|
+
},
|
|
11
|
+
supabase: {
|
|
12
|
+
name: 'Supabase Authentication Setup',
|
|
13
|
+
agents: ['@Planner', '@Research', '@CTO', '@Database', '@Backend', '@Frontend', '@Security', '@DevOps'],
|
|
14
|
+
description: 'Set up Supabase auth with RLS policies',
|
|
15
|
+
steps: [
|
|
16
|
+
'1. Create Supabase project and get API keys',
|
|
17
|
+
'2. Set up database schema with RLS policies',
|
|
18
|
+
'3. Configure authentication providers (email + Google OAuth)',
|
|
19
|
+
'4. Implement backend auth middleware',
|
|
20
|
+
'5. Build frontend auth UI components',
|
|
21
|
+
'6. Test authentication flow',
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
payments: {
|
|
25
|
+
name: 'Payment Integration (Stripe)',
|
|
26
|
+
agents: ['@Planner', '@Research', '@CTO', '@Database', '@Backend', '@Frontend', '@Testing', '@Security', '@DevOps'],
|
|
27
|
+
description: 'Integrate Stripe for subscriptions and one-time payments',
|
|
28
|
+
steps: [
|
|
29
|
+
'1. Create Stripe account and get API keys',
|
|
30
|
+
'2. Design subscription/payment schema',
|
|
31
|
+
'3. Implement Stripe Checkout API',
|
|
32
|
+
'4. Handle webhooks for payment events',
|
|
33
|
+
'5. Build payment UI with checkout flow',
|
|
34
|
+
'6. Test with Stripe test cards',
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
deployment: {
|
|
38
|
+
name: 'Deployment Pipeline',
|
|
39
|
+
agents: ['@Planner', '@CTO', '@Frontend', '@DevOps'],
|
|
40
|
+
description: 'Deploy to Vercel with staging and production environments',
|
|
41
|
+
example: 'vercel',
|
|
42
|
+
},
|
|
43
|
+
vercel: {
|
|
44
|
+
name: 'Vercel Deployment Pipeline',
|
|
45
|
+
agents: ['@Planner', '@CTO', '@Frontend', '@DevOps'],
|
|
46
|
+
description: 'Deploy Next.js app to Vercel',
|
|
47
|
+
steps: [
|
|
48
|
+
'1. Set up Vercel project and link Git repository',
|
|
49
|
+
'2. Configure environment variables for staging/production',
|
|
50
|
+
'3. Set up custom domain',
|
|
51
|
+
'4. Configure preview deployments for PRs',
|
|
52
|
+
'5. Set up deployment protection rules',
|
|
53
|
+
'6. Test deployment pipeline',
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
cicd: {
|
|
57
|
+
name: 'GitHub Actions CI/CD',
|
|
58
|
+
agents: ['@Planner', '@CTO', '@Testing', '@DevOps'],
|
|
59
|
+
description: 'Automated testing and deployment with GitHub Actions',
|
|
60
|
+
steps: [
|
|
61
|
+
'1. Create workflow file for CI (tests + lint)',
|
|
62
|
+
'2. Add build verification job',
|
|
63
|
+
'3. Add deployment job for production',
|
|
64
|
+
'4. Configure secrets for deployment',
|
|
65
|
+
'5. Add status badges to README',
|
|
66
|
+
'6. Test workflow on PR',
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
database: {
|
|
70
|
+
name: 'Database Migration',
|
|
71
|
+
agents: ['@Planner', '@CTO', '@Database', '@Backend', '@Testing'],
|
|
72
|
+
description: 'Database schema migration and data sync',
|
|
73
|
+
steps: [
|
|
74
|
+
'1. Design new schema changes',
|
|
75
|
+
'2. Write migration scripts',
|
|
76
|
+
'3. Test migrations in staging',
|
|
77
|
+
'4. Back up production database',
|
|
78
|
+
'5. Run migrations in production',
|
|
79
|
+
'6. Verify data integrity',
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
email: {
|
|
83
|
+
name: 'Email Notification System',
|
|
84
|
+
agents: ['@Planner', '@Research', '@CTO', '@Backend', '@Frontend', '@Testing'],
|
|
85
|
+
description: 'Transactional emails with templates',
|
|
86
|
+
steps: [
|
|
87
|
+
'1. Choose email service (Resend, SendGrid)',
|
|
88
|
+
'2. Set up email templates',
|
|
89
|
+
'3. Implement email API endpoints',
|
|
90
|
+
'4. Add email queue for async sending',
|
|
91
|
+
'5. Test email delivery',
|
|
92
|
+
'6. Monitor deliverability',
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
realtime: {
|
|
96
|
+
name: 'Real-Time Features',
|
|
97
|
+
agents: ['@Planner', '@CTO', '@Backend', '@Frontend', '@Testing'],
|
|
98
|
+
description: 'Live notifications with WebSockets',
|
|
99
|
+
steps: [
|
|
100
|
+
'1. Choose WebSocket library (Socket.io, Pusher)',
|
|
101
|
+
'2. Set up WebSocket server',
|
|
102
|
+
'3. Implement event broadcasting',
|
|
103
|
+
'4. Build frontend listeners',
|
|
104
|
+
'5. Test real-time updates',
|
|
105
|
+
'6. Handle reconnection logic',
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
sentry: {
|
|
109
|
+
name: 'Sentry Error Tracking',
|
|
110
|
+
agents: ['@Planner', '@Research', '@CTO', '@Backend', '@Frontend', '@DevOps'],
|
|
111
|
+
description: 'Error monitoring with Sentry',
|
|
112
|
+
steps: [
|
|
113
|
+
'1. Create Sentry account and project',
|
|
114
|
+
'2. Install Sentry SDKs for frontend and backend',
|
|
115
|
+
'3. Configure error boundaries for React',
|
|
116
|
+
'4. Set up source maps for debugging',
|
|
117
|
+
'5. Configure alerts and notifications',
|
|
118
|
+
'6. Test error capture in development',
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
shopify: {
|
|
122
|
+
name: 'Shopify Product Integration',
|
|
123
|
+
agents: ['@Planner', '@Research', '@CTO', '@Database', '@Backend', '@DevOps'],
|
|
124
|
+
description: 'Sync products from Shopify store',
|
|
125
|
+
steps: [
|
|
126
|
+
'1. Create Shopify Partner account and development store',
|
|
127
|
+
'2. Set up Shopify app with Admin API access',
|
|
128
|
+
'3. Design database schema for products',
|
|
129
|
+
'4. Build product sync endpoint',
|
|
130
|
+
'5. Implement webhook handlers for product updates',
|
|
131
|
+
'6. Schedule full product sync (cron job)',
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
analytics: {
|
|
135
|
+
name: 'PostHog Analytics Integration',
|
|
136
|
+
agents: ['@Planner', '@Research', '@CTO', '@Backend', '@Frontend', '@DevOps'],
|
|
137
|
+
description: 'Track user behavior with PostHog',
|
|
138
|
+
steps: [
|
|
139
|
+
'1. Create PostHog account and project',
|
|
140
|
+
'2. Install PostHog SDKs for frontend and backend',
|
|
141
|
+
'3. Set up core event tracking (signup, login, feature usage)',
|
|
142
|
+
'4. Create conversion funnel dashboard',
|
|
143
|
+
'5. Set up feature flags (optional)',
|
|
144
|
+
'6. Configure user identification',
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export function registerWorkflowCommand(program) {
|
|
150
|
+
program
|
|
151
|
+
.command('workflow <feature>')
|
|
152
|
+
.description('Show workflow for common features (auth, payments, deployment, etc.)')
|
|
153
|
+
.action((feature) => {
|
|
154
|
+
const workflow = WORKFLOWS[feature.toLowerCase()];
|
|
155
|
+
|
|
156
|
+
if (!workflow) {
|
|
157
|
+
console.log(chalk.red(`\nā Workflow "${feature}" not found.\n`));
|
|
158
|
+
console.log(chalk.gray('Available workflows:'));
|
|
159
|
+
Object.keys(WORKFLOWS).forEach(key => {
|
|
160
|
+
console.log(chalk.cyan(` - ${key}`) + chalk.gray(` (${WORKFLOWS[key].name})`));
|
|
161
|
+
});
|
|
162
|
+
console.log('\n' + chalk.gray('Usage: ultra-dex workflow <feature>\n'));
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
console.log(chalk.bold(`\nš ${workflow.name} Workflow\n`));
|
|
167
|
+
console.log(chalk.gray(workflow.description));
|
|
168
|
+
|
|
169
|
+
console.log(chalk.bold('\nš¤ Agents Involved:\n'));
|
|
170
|
+
workflow.agents.forEach((agent, i) => {
|
|
171
|
+
console.log(chalk.cyan(` ${i + 1}. ${agent}`));
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
if (workflow.steps) {
|
|
175
|
+
console.log(chalk.bold('\nš Implementation Steps:\n'));
|
|
176
|
+
workflow.steps.forEach(step => {
|
|
177
|
+
console.log(chalk.gray(` ${step}`));
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
console.log(chalk.bold('\nš Full Example:\n'));
|
|
182
|
+
console.log(chalk.blue(` ${githubBlobUrl('guides/ADVANCED-WORKFLOWS.md')}`));
|
|
183
|
+
console.log(chalk.gray(` (Search for "Example: ${workflow.name}")\n`));
|
|
184
|
+
});
|
|
185
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = path.dirname(__filename);
|
|
6
|
+
|
|
7
|
+
export const ASSETS_ROOT = path.resolve(__dirname, '../../assets');
|
|
8
|
+
export const ROOT_FALLBACK = path.resolve(__dirname, '../../../');
|
|
9
|
+
export const LIVE_TEMPLATES_ROOT = path.join(ASSETS_ROOT, 'live-templates');
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const GITHUB_REPO = 'Srujan0798/Ultra-Dex';
|
|
2
|
+
export const GITHUB_WEB_BASE = `https://github.com/${GITHUB_REPO}`;
|
|
3
|
+
export const GITHUB_RAW_BASE = `https://raw.githubusercontent.com/${GITHUB_REPO}/main`;
|
|
4
|
+
|
|
5
|
+
export function githubBlobUrl(pathname) {
|
|
6
|
+
return `${GITHUB_WEB_BASE}/blob/main/${pathname}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function githubTreeUrl(pathname) {
|
|
10
|
+
return `${GITHUB_WEB_BASE}/tree/main/${pathname}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function githubWebUrl(pathname = '') {
|
|
14
|
+
if (!pathname) return GITHUB_WEB_BASE;
|
|
15
|
+
return `${GITHUB_WEB_BASE}/${pathname}`;
|
|
16
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base AI Provider Interface
|
|
3
|
+
* All providers (Claude, OpenAI, Gemini) must implement this interface
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export class BaseProvider {
|
|
7
|
+
constructor(apiKey, options = {}) {
|
|
8
|
+
if (new.target === BaseProvider) {
|
|
9
|
+
throw new Error('BaseProvider is abstract and cannot be instantiated directly');
|
|
10
|
+
}
|
|
11
|
+
this.apiKey = apiKey;
|
|
12
|
+
this.model = options.model || this.getDefaultModel();
|
|
13
|
+
this.maxTokens = options.maxTokens || 8192;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Get the default model for this provider
|
|
18
|
+
* @returns {string} Default model identifier
|
|
19
|
+
*/
|
|
20
|
+
getDefaultModel() {
|
|
21
|
+
throw new Error('getDefaultModel() must be implemented by subclass');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Get available models for this provider
|
|
26
|
+
* @returns {Array<{id: string, name: string, maxTokens: number}>}
|
|
27
|
+
*/
|
|
28
|
+
getAvailableModels() {
|
|
29
|
+
throw new Error('getAvailableModels() must be implemented by subclass');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Estimate the cost for a given number of tokens
|
|
34
|
+
* @param {number} inputTokens - Number of input tokens
|
|
35
|
+
* @param {number} outputTokens - Number of output tokens
|
|
36
|
+
* @returns {{input: number, output: number, total: number}} Cost in USD
|
|
37
|
+
*/
|
|
38
|
+
estimateCost(inputTokens, outputTokens) {
|
|
39
|
+
throw new Error('estimateCost() must be implemented by subclass');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Generate a completion from the AI model
|
|
44
|
+
* @param {string} systemPrompt - System instructions
|
|
45
|
+
* @param {string} userPrompt - User message/request
|
|
46
|
+
* @param {Object} options - Additional options
|
|
47
|
+
* @returns {Promise<{content: string, usage: {inputTokens: number, outputTokens: number}}>}
|
|
48
|
+
*/
|
|
49
|
+
async generate(systemPrompt, userPrompt, options = {}) {
|
|
50
|
+
throw new Error('generate() must be implemented by subclass');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Generate a completion with streaming support
|
|
55
|
+
* @param {string} systemPrompt - System instructions
|
|
56
|
+
* @param {string} userPrompt - User message/request
|
|
57
|
+
* @param {Function} onChunk - Callback for each chunk: (text: string) => void
|
|
58
|
+
* @param {Object} options - Additional options
|
|
59
|
+
* @returns {Promise<{content: string, usage: {inputTokens: number, outputTokens: number}}>}
|
|
60
|
+
*/
|
|
61
|
+
async generateStream(systemPrompt, userPrompt, onChunk, options = {}) {
|
|
62
|
+
throw new Error('generateStream() must be implemented by subclass');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Validate that the API key is configured and working
|
|
67
|
+
* @returns {Promise<boolean>}
|
|
68
|
+
*/
|
|
69
|
+
async validateApiKey() {
|
|
70
|
+
throw new Error('validateApiKey() must be implemented by subclass');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get the provider name
|
|
75
|
+
* @returns {string}
|
|
76
|
+
*/
|
|
77
|
+
getName() {
|
|
78
|
+
throw new Error('getName() must be implemented by subclass');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default BaseProvider;
|