ultra-dex 1.7.1 → 1.7.2

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.
Files changed (3) hide show
  1. package/README.md +21 -3
  2. package/bin/ultra-dex.js +210 -12
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -13,12 +13,12 @@ cd your-project
13
13
  cat QUICK-START.md
14
14
 
15
15
  # 3. Load Cursor rules for AI assistance (1 min)
16
- # Download from: https://github.com/Srujan0798/Ultra-Dex/tree/main/cursor-rules
17
- # Then: ./load.sh database api auth
16
+ npx degit Srujan0798/Ultra-Dex/cursor-rules .cursor/rules
17
+ # Then: cd .cursor/rules && ./load.sh database api auth
18
18
 
19
19
  # 4. Start building with AI agents (4 min)
20
20
  # Use @Backend, @Frontend, @Database agents
21
- # See: npx ultra-dex agents
21
+ npx ultra-dex agents
22
22
 
23
23
  # You're ready to code!
24
24
  ```
@@ -92,6 +92,19 @@ npx ultra-dex agent backend
92
92
 
93
93
  Prints the full agent prompt. Copy and paste into your AI tool (Cursor, Claude, ChatGPT).
94
94
 
95
+ ### Set up git hooks
96
+
97
+ ```bash
98
+ npx ultra-dex hooks
99
+ ```
100
+
101
+ Installs a pre-commit hook that:
102
+ - Validates project structure before each commit
103
+ - Blocks commits if required files are missing
104
+ - Can be bypassed with `git commit --no-verify`
105
+
106
+ Remove with: `npx ultra-dex hooks --remove`
107
+
95
108
  ## Commands
96
109
 
97
110
  | Command | Description |
@@ -101,6 +114,11 @@ Prints the full agent prompt. Copy and paste into your AI tool (Cursor, Claude,
101
114
  | `ultra-dex examples` | List available examples |
102
115
  | `ultra-dex agents` | List available AI agents |
103
116
  | `ultra-dex agent <name>` | Show specific agent prompt |
117
+ | `ultra-dex pack <agent>` | Package context + agent for any AI |
118
+ | `ultra-dex hooks` | Set up git pre-commit hooks |
119
+ | `ultra-dex validate` | Validate project structure |
120
+ | `ultra-dex workflow <feature>` | Show workflow for a feature |
121
+ | `ultra-dex suggest` | Get AI agent suggestions |
104
122
  | `ultra-dex --help` | Show help |
105
123
  | `ultra-dex --version` | Show version |
106
124
 
package/bin/ultra-dex.js CHANGED
@@ -300,10 +300,21 @@ ${answers.ideaWhat} for ${answers.ideaFor}.
300
300
  path.join(rulesDir, file)
301
301
  );
302
302
  }
303
+ // Also generate .github/copilot-instructions.md for Copilot users
304
+ const coreRulePath = path.join(cursorRulesPath, '00-ultra-dex-core.mdc');
305
+ try {
306
+ const coreContent = await fs.readFile(coreRulePath, 'utf-8');
307
+ const dotGithub = path.join(outputDir, '.github');
308
+ await fs.mkdir(dotGithub, { recursive: true });
309
+ await fs.writeFile(path.join(dotGithub, 'copilot-instructions.md'), coreContent);
310
+ } catch (e) {
311
+ // Core rule not available - skip Copilot setup
312
+ }
303
313
  } catch (err) {
304
- // Cursor rules not available (npm package, not local) - this is expected
305
- console.log(chalk.gray('\n Cursor rules: Download from GitHub for AI-assisted development'));
306
- console.log(chalk.blue(' https://github.com/Srujan0798/Ultra-Dex/tree/main/cursor-rules'));
314
+ // Cursor rules not bundled - intentional design choice for npm package size
315
+ console.log(chalk.gray('\n šŸ“¦ Cursor rules not bundled (keeps npm package <50KB)'));
316
+ console.log(chalk.cyan(' Quick setup: npx degit Srujan0798/Ultra-Dex/cursor-rules .cursor/rules'));
317
+ console.log(chalk.blue(' Or download: https://github.com/Srujan0798/Ultra-Dex/tree/main/cursor-rules'));
307
318
  }
308
319
  }
309
320
 
@@ -313,9 +324,10 @@ ${answers.ideaWhat} for ${answers.ideaFor}.
313
324
  try {
314
325
  await fs.copyFile(templatePath, path.join(outputDir, 'docs', 'MASTER-PLAN.md'));
315
326
  } catch (err) {
316
- // Template not available locally - this is expected for npm installs
317
- console.log(chalk.gray('\n Full 34-section template: Download from GitHub'));
318
- console.log(chalk.blue(' https://github.com/Srujan0798/Ultra-Dex/blob/main/%40%20Ultra%20DeX/Saas%20plan/04-Imp-Template.md'));
327
+ // Template not bundled - keeps npm package lightweight
328
+ console.log(chalk.gray('\n šŸ“¦ Full template not bundled (5,500 lines - too large for npm)'));
329
+ console.log(chalk.cyan(' Quick fetch: curl -O https://raw.githubusercontent.com/Srujan0798/Ultra-Dex/main/%40%20Ultra%20DeX/Saas%20plan/04-Imp-Template.md'));
330
+ console.log(chalk.blue(' Or view: https://github.com/Srujan0798/Ultra-Dex/blob/main/%40%20Ultra%20DeX/Saas%20plan/04-Imp-Template.md'));
319
331
  }
320
332
  }
321
333
 
@@ -327,9 +339,10 @@ ${answers.ideaWhat} for ${answers.ideaFor}.
327
339
  await fs.copyFile(verificationPath, path.join(outputDir, 'docs', 'CHECKLIST.md'));
328
340
  await fs.copyFile(agentPath, path.join(outputDir, 'docs', 'AI-PROMPTS.md'));
329
341
  } catch (err) {
330
- // Docs not available locally - this is expected for npm installs
331
- console.log(chalk.gray('\n Verification checklist & agent instructions: Download from GitHub'));
332
- console.log(chalk.blue(' https://github.com/Srujan0798/Ultra-Dex/tree/main/docs'));
342
+ // Docs not bundled - intentional for npm package size
343
+ console.log(chalk.gray('\n šŸ“¦ Verification & instructions not bundled (npm size optimization)'));
344
+ console.log(chalk.cyan(' Quick setup: npx degit Srujan0798/Ultra-Dex/docs docs'));
345
+ console.log(chalk.blue(' Or view: https://github.com/Srujan0798/Ultra-Dex/tree/main/docs'));
333
346
  }
334
347
  }
335
348
 
@@ -366,9 +379,10 @@ ${answers.ideaWhat} for ${answers.ideaFor}.
366
379
  path.join(agentsDir, 'README.md')
367
380
  );
368
381
  } catch (err) {
369
- // Agents not available locally - this is expected for npm installs
370
- console.log(chalk.gray('\n 15 AI agent prompts: Download from GitHub'));
371
- console.log(chalk.blue(' https://github.com/Srujan0798/Ultra-Dex/tree/main/agents'));
382
+ // Agents not bundled - intentional for npm package size
383
+ console.log(chalk.gray('\n šŸ“¦ Agent prompts not bundled (npm size optimization)'));
384
+ console.log(chalk.cyan(' Quick setup: npx degit Srujan0798/Ultra-Dex/agents .agents'));
385
+ console.log(chalk.blue(' Or view: https://github.com/Srujan0798/Ultra-Dex/tree/main/agents'));
372
386
  }
373
387
  }
374
388
 
@@ -651,6 +665,80 @@ program
651
665
  }
652
666
  });
653
667
 
668
+ // Pack command - assemble context for any AI tool
669
+ program
670
+ .command('pack <agent>')
671
+ .description('Package project context + agent prompt for any AI tool')
672
+ .option('-c, --clipboard', 'Copy to clipboard (requires pbcopy/xclip)')
673
+ .action(async (agentName, options) => {
674
+ // Find agent
675
+ const agent = AGENTS.find(a => a.name.toLowerCase() === agentName.toLowerCase());
676
+ if (!agent) {
677
+ console.log(chalk.red(`\nāŒ Agent "${agentName}" not found.\n`));
678
+ console.log(chalk.gray('Available agents:'));
679
+ AGENTS.forEach(a => console.log(chalk.cyan(` - ${a.name}`)));
680
+ process.exit(1);
681
+ }
682
+
683
+ let output = '';
684
+
685
+ // 1. Read Agent Prompt
686
+ const agentPath = path.resolve(__dirname, '../../agents', agent.file);
687
+ try {
688
+ const agentPrompt = await fs.readFile(agentPath, 'utf-8');
689
+ output += agentPrompt + '\n\n';
690
+ } catch (err) {
691
+ output += `# ${agent.name.toUpperCase()} Agent\n\nSee: https://github.com/Srujan0798/Ultra-Dex/blob/main/agents/${agent.file}\n\n`;
692
+ }
693
+
694
+ output += '---\n\n';
695
+
696
+ // 2. Read CONTEXT.md
697
+ try {
698
+ const context = await fs.readFile('CONTEXT.md', 'utf-8');
699
+ output += '# PROJECT CONTEXT\n\n' + context + '\n\n';
700
+ } catch (err) {
701
+ output += '# PROJECT CONTEXT\n\n*No CONTEXT.md found. Run `ultra-dex init` first.*\n\n';
702
+ }
703
+
704
+ output += '---\n\n';
705
+
706
+ // 3. Read IMPLEMENTATION-PLAN.md
707
+ try {
708
+ const plan = await fs.readFile('IMPLEMENTATION-PLAN.md', 'utf-8');
709
+ output += '# IMPLEMENTATION PLAN\n\n' + plan + '\n';
710
+ } catch (err) {
711
+ output += '# IMPLEMENTATION PLAN\n\n*No IMPLEMENTATION-PLAN.md found. Run `ultra-dex init` first.*\n';
712
+ }
713
+
714
+ // Output
715
+ console.log(chalk.bold(`\nšŸ“¦ Packed context for @${agent.name}\n`));
716
+ console.log(chalk.gray('─'.repeat(60)));
717
+ console.log(output);
718
+ console.log(chalk.gray('─'.repeat(60)));
719
+
720
+ // Try to copy to clipboard if requested
721
+ if (options.clipboard) {
722
+ try {
723
+ const { execSync } = require('child_process');
724
+ const platform = process.platform;
725
+ if (platform === 'darwin') {
726
+ execSync('pbcopy', { input: output });
727
+ console.log(chalk.green('\nāœ… Copied to clipboard!\n'));
728
+ } else if (platform === 'linux') {
729
+ execSync('xclip -selection clipboard', { input: output });
730
+ console.log(chalk.green('\nāœ… Copied to clipboard!\n'));
731
+ } else {
732
+ console.log(chalk.yellow('\nāš ļø Clipboard not supported on this platform. Copy manually.\n'));
733
+ }
734
+ } catch (err) {
735
+ console.log(chalk.yellow('\nāš ļø Could not copy to clipboard. Copy manually.\n'));
736
+ }
737
+ } else {
738
+ console.log(chalk.cyan('\nšŸ’” Tip: Use --clipboard flag to copy directly\n'));
739
+ }
740
+ });
741
+
654
742
  // Workflow examples map
655
743
  const WORKFLOWS = {
656
744
  auth: {
@@ -1090,4 +1178,114 @@ program
1090
1178
  console.log('\n' + chalk.gray('Run "ultra-dex init" to set up a proper Ultra-Dex project.\n'));
1091
1179
  });
1092
1180
 
1181
+ // ========================================
1182
+ // HOOKS COMMAND - Automated Verification
1183
+ // ========================================
1184
+ program
1185
+ .command('hooks')
1186
+ .description('Set up git hooks for automated verification')
1187
+ .option('--remove', 'Remove Ultra-Dex git hooks')
1188
+ .action(async (options) => {
1189
+ console.log(chalk.cyan('\nšŸŖ Ultra-Dex Git Hooks Setup\n'));
1190
+
1191
+ const gitDir = path.join(process.cwd(), '.git');
1192
+ const hooksDir = path.join(gitDir, 'hooks');
1193
+
1194
+ // Check if git repo exists
1195
+ try {
1196
+ await fs.access(gitDir);
1197
+ } catch {
1198
+ console.log(chalk.red('āŒ Not a git repository. Run "git init" first.\n'));
1199
+ process.exit(1);
1200
+ }
1201
+
1202
+ // Create hooks directory if it doesn't exist
1203
+ await fs.mkdir(hooksDir, { recursive: true });
1204
+
1205
+ const preCommitPath = path.join(hooksDir, 'pre-commit');
1206
+
1207
+ if (options.remove) {
1208
+ // Remove hooks
1209
+ try {
1210
+ const content = await fs.readFile(preCommitPath, 'utf-8');
1211
+ if (content.includes('ultra-dex')) {
1212
+ await fs.unlink(preCommitPath);
1213
+ console.log(chalk.green('āœ… Ultra-Dex pre-commit hook removed.\n'));
1214
+ } else {
1215
+ console.log(chalk.yellow('āš ļø Pre-commit hook exists but is not from Ultra-Dex.\n'));
1216
+ }
1217
+ } catch {
1218
+ console.log(chalk.gray('No Ultra-Dex hooks found.\n'));
1219
+ }
1220
+ return;
1221
+ }
1222
+
1223
+ // Generate pre-commit hook
1224
+ const preCommitScript = `#!/bin/sh
1225
+ # Ultra-Dex Pre-Commit Hook
1226
+ # Validates project structure before allowing commits
1227
+ # Remove with: npx ultra-dex hooks --remove
1228
+
1229
+ echo "šŸ” Ultra-Dex: Validating project structure..."
1230
+
1231
+ # Run validation
1232
+ npx ultra-dex validate --dir . > /tmp/ultra-dex-validate.log 2>&1
1233
+ RESULT=$?
1234
+
1235
+ if [ $RESULT -ne 0 ]; then
1236
+ echo ""
1237
+ echo "āŒ Ultra-Dex validation failed. Commit blocked."
1238
+ echo ""
1239
+ echo "Run 'npx ultra-dex validate' to see details."
1240
+ echo "Fix issues or bypass with: git commit --no-verify"
1241
+ echo ""
1242
+ exit 1
1243
+ fi
1244
+
1245
+ # Check for required files
1246
+ if [ ! -f "QUICK-START.md" ]; then
1247
+ echo "āš ļø Warning: QUICK-START.md not found"
1248
+ fi
1249
+
1250
+ if [ ! -f "IMPLEMENTATION-PLAN.md" ]; then
1251
+ echo "āš ļø Warning: IMPLEMENTATION-PLAN.md not found"
1252
+ fi
1253
+
1254
+ echo "āœ… Ultra-Dex validation passed."
1255
+ exit 0
1256
+ `;
1257
+
1258
+ // Check if pre-commit already exists
1259
+ try {
1260
+ const existing = await fs.readFile(preCommitPath, 'utf-8');
1261
+ if (existing.includes('ultra-dex')) {
1262
+ console.log(chalk.yellow('āš ļø Ultra-Dex pre-commit hook already exists.\n'));
1263
+ console.log(chalk.gray(' Use --remove to remove it first.\n'));
1264
+ return;
1265
+ } else {
1266
+ // Append to existing hook
1267
+ const combined = existing + '\n\n' + preCommitScript;
1268
+ await fs.writeFile(preCommitPath, combined);
1269
+ await fs.chmod(preCommitPath, '755');
1270
+ console.log(chalk.green('āœ… Ultra-Dex hook appended to existing pre-commit.\n'));
1271
+ }
1272
+ } catch {
1273
+ // No existing hook, create new
1274
+ await fs.writeFile(preCommitPath, preCommitScript);
1275
+ await fs.chmod(preCommitPath, '755');
1276
+ console.log(chalk.green('āœ… Pre-commit hook installed.\n'));
1277
+ }
1278
+
1279
+ console.log(chalk.bold('What this does:\n'));
1280
+ console.log(chalk.gray(' • Runs "ultra-dex validate" before each commit'));
1281
+ console.log(chalk.gray(' • Blocks commits if required files are missing'));
1282
+ console.log(chalk.gray(' • Warns about incomplete sections\n'));
1283
+
1284
+ console.log(chalk.bold('To bypass (not recommended):\n'));
1285
+ console.log(chalk.cyan(' git commit --no-verify\n'));
1286
+
1287
+ console.log(chalk.bold('To remove:\n'));
1288
+ console.log(chalk.cyan(' npx ultra-dex hooks --remove\n'));
1289
+ });
1290
+
1093
1291
  program.parse();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultra-dex",
3
- "version": "1.7.1",
4
- "description": "CLI for Ultra-Dex SaaS Implementation Framework with 15 Production Agents",
3
+ "version": "1.7.2",
4
+ "description": "CLI for Ultra-Dex SaaS Implementation Framework with 16 Production Agents",
5
5
  "keywords": [
6
6
  "saas",
7
7
  "template",