mad-pro-cli 1.1.0 → 1.3.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/index.js CHANGED
@@ -2,17 +2,46 @@
2
2
 
3
3
  import { program } from 'commander';
4
4
  import initCommand from './lib/commands/init.js';
5
+ import addCommand from './lib/commands/add.js';
6
+ import listCommand from './lib/commands/list.js';
7
+ import createCommand from './lib/commands/create.js';
8
+ import doctorCommand from './lib/commands/doctor.js';
9
+ import promptCommand from './lib/commands/prompt.js';
5
10
 
6
11
  program
7
12
  .name('mad-pro')
8
13
  .description('MAD Pro CLI - Boost your project with AI Expert Skills')
9
- .version('1.0.0');
14
+ .version('1.3.0');
10
15
 
11
16
  program
12
17
  .command('init')
13
- .description('Initialize AI skills for your project')
14
- .option('--ai <name>', 'Specify the AI bridge to use (e.g., antigravity)')
18
+ .description('Initialize AI skills for your project (Interactive Wizard)')
15
19
  .option('--ide <type>', 'Specify the IDE (vscode, cursor, windsurf, android-studio, intellij, sublime, vim, neovim, zed, code-insiders)')
16
20
  .action(initCommand);
17
21
 
22
+ program
23
+ .command('create [name]')
24
+ .description('Scaffold a fresh MAD-compliant Android project')
25
+ .action(createCommand);
26
+
27
+ program
28
+ .command('add')
29
+ .description('Add specific skills to your current project')
30
+ .action(addCommand);
31
+
32
+ program
33
+ .command('list')
34
+ .description('List skills installed in the current project')
35
+ .action(listCommand);
36
+
37
+ program
38
+ .command('doctor')
39
+ .description('Check architectural health of your project')
40
+ .action(doctorCommand);
41
+
42
+ program
43
+ .command('prompt')
44
+ .description('Generate optimized system instructions for your AI Agent')
45
+ .action(promptCommand);
46
+
18
47
  program.parse();
@@ -0,0 +1,72 @@
1
+ import fs from 'fs-extra';
2
+ import path from 'path';
3
+ import chalk from 'chalk';
4
+ import inquirer from 'inquirer';
5
+ import { fileURLToPath } from 'url';
6
+
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+
10
+ export default async function addCommand() {
11
+ console.log(chalk.bold.magenta('\nšŸ“„ MAD Pro CLI - Add Skills'));
12
+ console.log(chalk.gray('Search and install specific skills to your project...\n'));
13
+
14
+ const rootDir = process.cwd();
15
+ const sourceDir = path.join(__dirname, '../../../references');
16
+
17
+ if (!fs.existsSync(sourceDir)) {
18
+ console.error(chalk.red('Error: Skill library not found. Please reinstall the CLI.'));
19
+ process.exit(1);
20
+ }
21
+
22
+ // 1. Get all available skills
23
+ const coreFiles = fs.readdirSync(sourceDir).filter(f => f.endsWith('.md'));
24
+ const industryPath = path.join(sourceDir, 'industry');
25
+ const industryFiles = fs.existsSync(industryPath) ? fs.readdirSync(industryPath).filter(f => f.endsWith('.md')).map(f => `industry/${f}`) : [];
26
+ const tokenPath = path.join(sourceDir, 'design-tokens');
27
+ const tokenFiles = fs.existsSync(tokenPath) ? fs.readdirSync(tokenPath).filter(f => f.endsWith('.md')).map(f => `design-tokens/${f}`) : [];
28
+
29
+ const allSkills = [...coreFiles, ...industryFiles, ...tokenFiles].map(f => ({
30
+ name: f.replace('.md', '').replace(/_/g, ' ').toUpperCase(),
31
+ value: f
32
+ })).sort((a, b) => a.name.localeCompare(b.name));
33
+
34
+ // 2. Interactive Selection (Searchable)
35
+ const answers = await inquirer.prompt([
36
+ {
37
+ type: 'checkbox',
38
+ name: 'skills',
39
+ message: 'Search and select skills to add:',
40
+ choices: allSkills,
41
+ pageSize: 15
42
+ }
43
+ ]);
44
+
45
+ if (answers.skills.length === 0) {
46
+ console.log(chalk.yellow('\nNo skills selected. Exit.'));
47
+ return;
48
+ }
49
+
50
+ // 3. Perform Copying
51
+ const targetRefDir = path.join(rootDir, 'references');
52
+ const targetIndustryDir = path.join(targetRefDir, 'industry');
53
+ const targetTokenDir = path.join(targetRefDir, 'design-tokens');
54
+ await fs.ensureDir(targetRefDir);
55
+ await fs.ensureDir(targetIndustryDir);
56
+ await fs.ensureDir(targetTokenDir);
57
+
58
+ console.log(chalk.cyan('\nšŸ“¦ Adding selected skills...'));
59
+
60
+ for (const skill of answers.skills) {
61
+ const src = path.join(sourceDir, skill);
62
+ const dest = path.join(targetRefDir, skill.replace('industry/', 'industry/').replace('design-tokens/', 'design-tokens/'));
63
+
64
+ if (fs.existsSync(src)) {
65
+ await fs.copy(src, dest);
66
+ console.log(`${chalk.green('āœ“')} Added ${chalk.gray(skill)}`);
67
+ }
68
+ }
69
+
70
+ console.log(chalk.bold.green(`\nšŸŽ‰ Successfully added ${answers.skills.length} skills!`));
71
+ console.log(chalk.gray('Your AI Agent can now use these additional patterns.\n'));
72
+ }