create-byan-agent 1.1.2 → 1.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +250 -177
  2. package/LICENSE +21 -21
  3. package/README.md +1245 -421
  4. package/bin/create-byan-agent-backup.js +220 -220
  5. package/bin/create-byan-agent-fixed.js +301 -301
  6. package/bin/create-byan-agent.js +322 -301
  7. package/lib/errors.js +61 -0
  8. package/lib/exit-codes.js +54 -0
  9. package/lib/platforms/claude-code.js +113 -0
  10. package/lib/platforms/codex.js +92 -0
  11. package/lib/platforms/copilot-cli.js +123 -0
  12. package/lib/platforms/index.js +14 -0
  13. package/lib/platforms/vscode.js +51 -0
  14. package/lib/utils/config-loader.js +79 -0
  15. package/lib/utils/file-utils.js +104 -0
  16. package/lib/utils/git-detector.js +35 -0
  17. package/lib/utils/logger.js +64 -0
  18. package/lib/utils/node-detector.js +58 -0
  19. package/lib/utils/os-detector.js +74 -0
  20. package/lib/utils/yaml-utils.js +87 -0
  21. package/lib/yanstaller/backuper.js +308 -0
  22. package/lib/yanstaller/detector.js +141 -0
  23. package/lib/yanstaller/index.js +93 -0
  24. package/lib/yanstaller/installer.js +225 -0
  25. package/lib/yanstaller/interviewer.js +250 -0
  26. package/lib/yanstaller/recommender.js +298 -0
  27. package/lib/yanstaller/troubleshooter.js +498 -0
  28. package/lib/yanstaller/validator.js +578 -0
  29. package/lib/yanstaller/wizard.js +211 -0
  30. package/package.json +61 -55
  31. package/templates/.github/agents/bmad-agent-bmad-master.md +15 -15
  32. package/templates/.github/agents/bmad-agent-bmb-agent-builder.md +15 -15
  33. package/templates/.github/agents/bmad-agent-bmb-module-builder.md +15 -15
  34. package/templates/.github/agents/bmad-agent-bmb-workflow-builder.md +15 -15
  35. package/templates/.github/agents/bmad-agent-bmm-analyst.md +15 -15
  36. package/templates/.github/agents/bmad-agent-bmm-architect.md +15 -15
  37. package/templates/.github/agents/bmad-agent-bmm-dev.md +15 -15
  38. package/templates/.github/agents/bmad-agent-bmm-pm.md +15 -15
  39. package/templates/.github/agents/bmad-agent-bmm-quick-flow-solo-dev.md +15 -15
  40. package/templates/.github/agents/bmad-agent-bmm-quinn.md +15 -15
  41. package/templates/.github/agents/bmad-agent-bmm-sm.md +15 -15
  42. package/templates/.github/agents/bmad-agent-bmm-tech-writer.md +15 -15
  43. package/templates/.github/agents/bmad-agent-bmm-ux-designer.md +15 -15
  44. package/templates/.github/agents/bmad-agent-byan-test.md +32 -0
  45. package/templates/.github/agents/bmad-agent-byan.md +224 -224
  46. package/templates/.github/agents/bmad-agent-carmack.md +18 -0
  47. package/templates/.github/agents/bmad-agent-cis-brainstorming-coach.md +15 -15
  48. package/templates/.github/agents/bmad-agent-cis-creative-problem-solver.md +15 -15
  49. package/templates/.github/agents/bmad-agent-cis-design-thinking-coach.md +15 -15
  50. package/templates/.github/agents/bmad-agent-cis-innovation-strategist.md +15 -15
  51. package/templates/.github/agents/bmad-agent-cis-presentation-master.md +15 -15
  52. package/templates/.github/agents/bmad-agent-cis-storyteller.md +15 -15
  53. package/templates/.github/agents/bmad-agent-marc.md +48 -48
  54. package/templates/.github/agents/bmad-agent-patnote.md +48 -0
  55. package/templates/.github/agents/bmad-agent-rachid.md +47 -47
  56. package/templates/.github/agents/bmad-agent-tea-tea.md +15 -15
  57. package/templates/.github/agents/bmad-agent-test-dynamic.md +21 -0
  58. package/templates/.github/agents/expert-merise-agile.md +1 -0
  59. package/templates/.github/agents/franck.md +379 -0
  60. package/templates/_bmad/bmb/agents/agent-builder.md +59 -59
  61. package/templates/_bmad/bmb/agents/byan-test.md +116 -116
  62. package/templates/_bmad/bmb/agents/byan.md +215 -215
  63. package/templates/_bmad/bmb/agents/marc.md +303 -303
  64. package/templates/_bmad/bmb/agents/module-builder.md +60 -60
  65. package/templates/_bmad/bmb/agents/patnote.md +495 -495
  66. package/templates/_bmad/bmb/agents/rachid.md +184 -184
  67. package/templates/_bmad/bmb/agents/workflow-builder.md +61 -61
  68. package/templates/_bmad/bmb/workflows/byan/data/mantras.yaml +272 -272
  69. package/templates/_bmad/bmb/workflows/byan/data/templates.yaml +59 -59
  70. package/templates/_bmad/bmb/workflows/byan/delete-agent-workflow.md +657 -657
  71. package/templates/_bmad/bmb/workflows/byan/edit-agent-workflow.md +688 -688
  72. package/templates/_bmad/bmb/workflows/byan/interview-workflow.md +753 -753
  73. package/templates/_bmad/bmb/workflows/byan/quick-create-workflow.md +450 -450
  74. package/templates/_bmad/bmb/workflows/byan/templates/base-agent-template.md +79 -79
  75. package/templates/_bmad/bmb/workflows/byan/validate-agent-workflow.md +676 -676
  76. package/templates/_bmad/core/agents/carmack.md +238 -238
@@ -1,220 +1,220 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs-extra');
4
- const path = require('path');
5
- const { program } = require('commander');
6
- const inquirer = require('inquirer');
7
- const chalk = require('chalk');
8
- const ora = require('ora');
9
- const yaml = require('js-yaml');
10
-
11
- const BYAN_VERSION = '1.0.0';
12
-
13
- // ASCII Art Banner
14
- const banner = `
15
- ${chalk.blue('╔════════════════════════════════════════════════════════════╗')}
16
- ${chalk.blue('║')} ${chalk.blue('║')}
17
- ${chalk.blue('║')} ${chalk.bold('🏗️ BYAN INSTALLER v' + BYAN_VERSION)} ${chalk.blue('║')}
18
- ${chalk.blue('║')} ${chalk.gray('Builder of YAN - Agent Creator')} ${chalk.blue('║')}
19
- ${chalk.blue('║')} ${chalk.blue('║')}
20
- ${chalk.blue('║')} ${chalk.gray('Methodology: Merise Agile + TDD + 64 Mantras')} ${chalk.blue('║')}
21
- ${chalk.blue('║')} ${chalk.blue('║')}
22
- ${chalk.blue('╚════════════════════════════════════════════════════════════╝')}
23
- `;
24
-
25
- // Main installer
26
- async function install() {
27
- console.clear();
28
- console.log(banner);
29
-
30
- const projectRoot = process.cwd();
31
-
32
- // Step 1: Detect project type
33
- const spinner = ora('Detecting project type...').start();
34
-
35
- const isGitRepo = await fs.pathExists(path.join(projectRoot, '.git'));
36
- const hasPackageJson = await fs.pathExists(path.join(projectRoot, 'package.json'));
37
- const hasPyProject = await fs.pathExists(path.join(projectRoot, 'pyproject.toml'));
38
-
39
- if (!isGitRepo && !hasPackageJson && !hasPyProject) {
40
- spinner.warn('Not in a recognized project directory');
41
-
42
- const { continueAnyway } = await inquirer.prompt([
43
- {
44
- type: 'confirm',
45
- name: 'continueAnyway',
46
- message: 'BYAN works best in a project with version control. Continue anyway?',
47
- default: false
48
- }
49
- ]);
50
-
51
- if (!continueAnyway) {
52
- console.log(chalk.yellow('Installation cancelled.'));
53
- process.exit(0);
54
- }
55
- } else {
56
- spinner.succeed('Project detected');
57
- }
58
-
59
- // Step 2: Platform selection
60
- const { platform } = await inquirer.prompt([
61
- {
62
- type: 'list',
63
- name: 'platform',
64
- message: 'Select platform to install for:',
65
- choices: [
66
- { name: 'GitHub Copilot CLI', value: 'copilot' },
67
- { name: 'VSCode', value: 'vscode' },
68
- { name: 'Claude Code', value: 'claude' },
69
- { name: 'Codex', value: 'codex' },
70
- { name: 'All platforms', value: 'all' }
71
- ]
72
- }
73
- ]);
74
-
75
- // Step 3: User configuration
76
- const config = await inquirer.prompt([
77
- {
78
- type: 'input',
79
- name: 'userName',
80
- message: 'Your name:',
81
- default: 'Developer'
82
- },
83
- {
84
- type: 'list',
85
- name: 'language',
86
- message: 'Communication language:',
87
- choices: ['Francais', 'English'],
88
- default: 'English'
89
- }
90
- ]);
91
-
92
- // Step 4: Create directory structure
93
- const installSpinner = ora('Creating directory structure...').start();
94
-
95
- const bmadDir = path.join(projectRoot, '_bmad');
96
- const bmbDir = path.join(bmadDir, 'bmb');
97
-
98
- await fs.ensureDir(path.join(bmadDir, 'bmb', 'agents'));
99
- await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'steps'));
100
- await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'templates'));
101
- await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'data'));
102
- await fs.ensureDir(path.join(bmadDir, 'core'));
103
- await fs.ensureDir(path.join(bmadDir, '_config'));
104
- await fs.ensureDir(path.join(bmadDir, '_memory'));
105
- await fs.ensureDir(path.join(bmadDir, '_output'));
106
-
107
- installSpinner.succeed('Directory structure created');
108
-
109
- // Step 5: Copy BYAN files
110
- const copySpinner = ora('Installing BYAN files...').start();
111
-
112
- // In production, these would be copied from the package
113
- // For now, we'll create minimal config
114
-
115
- const configContent = {
116
- bmb_creations_output_folder: "{project-root}/_bmad-output/bmb-creations",
117
- user_name: config.userName,
118
- communication_language: config.language,
119
- document_output_language: config.language,
120
- output_folder: "{project-root}/_bmad-output",
121
- platform: platform
122
- };
123
-
124
- const configPath = path.join(bmbDir, 'config.yaml');
125
- await fs.writeFile(configPath, yaml.dump(configContent), 'utf8');
126
-
127
- copySpinner.succeed('BYAN files installed');
128
-
129
- // Step 6: Create shortcuts
130
- const shortcutSpinner = ora('Creating shortcuts...').start();
131
-
132
- // Create package.json scripts if it exists
133
- if (hasPackageJson) {
134
- const pkgPath = path.join(projectRoot, 'package.json');
135
- const pkg = await fs.readJson(pkgPath);
136
-
137
- if (!pkg.scripts) pkg.scripts = {};
138
-
139
- if (!pkg.scripts.byan) {
140
- pkg.scripts.byan = 'echo "BYAN agent installed. Activate in your AI platform."';
141
- await fs.writeJson(pkgPath, pkg, { spaces: 2 });
142
- shortcutSpinner.succeed('NPM script added');
143
- } else {
144
- shortcutSpinner.info('NPM script already exists');
145
- }
146
- } else {
147
- shortcutSpinner.succeed('Shortcuts created');
148
- }
149
-
150
- // Step 7: Verification
151
- const verifySpinner = ora('Verifying installation...').start();
152
-
153
- const checks = [
154
- await fs.pathExists(path.join(bmbDir, 'agents')),
155
- await fs.pathExists(path.join(bmbDir, 'workflows', 'byan')),
156
- await fs.pathExists(configPath)
157
- ];
158
-
159
- const passed = checks.filter(Boolean).length;
160
-
161
- if (passed === checks.length) {
162
- verifySpinner.succeed(`Verification: ${passed}/${checks.length} checks passed`);
163
- } else {
164
- verifySpinner.warn(`Verification: ${passed}/${checks.length} checks passed`);
165
- }
166
-
167
- // Success message
168
- console.log('');
169
- console.log(chalk.green('╔════════════════════════════════════════════════════════════╗'));
170
- console.log(chalk.green('║ ║'));
171
- console.log(chalk.green('║ ✅ BYAN INSTALLATION COMPLETE! ║'));
172
- console.log(chalk.green('║ ║'));
173
- console.log(chalk.green('╚════════════════════════════════════════════════════════════╝'));
174
- console.log('');
175
-
176
- console.log(chalk.bold('Installation Summary:'));
177
- console.log(` • Platform: ${chalk.cyan(platform)}`);
178
- console.log(` • Installation Directory: ${chalk.cyan(bmbDir)}`);
179
- console.log(` • Configuration: ${chalk.cyan(configPath)}`);
180
- console.log(` • User: ${chalk.cyan(config.userName)}`);
181
- console.log(` • Language: ${chalk.cyan(config.language)}`);
182
- console.log('');
183
-
184
- console.log(chalk.bold('Next Steps:'));
185
- console.log('');
186
- console.log(chalk.yellow('1. Activate BYAN:'));
187
-
188
- if (platform === 'copilot') {
189
- console.log(` ${chalk.blue('gh copilot suggest "activate byan agent"')}`);
190
- } else if (platform === 'vscode') {
191
- console.log(' Open VSCode Command Palette (Ctrl+Shift+P)');
192
- console.log(' Type: "Activate BYAN Agent"');
193
- } else if (platform === 'claude') {
194
- console.log(` ${chalk.blue('claude chat --agent byan')}`);
195
- }
196
-
197
- console.log('');
198
- console.log(chalk.yellow('2. Create your first agent:'));
199
- console.log(' [INT] Start Intelligent Interview (30-45 min)');
200
- console.log(' [QC] Quick Create (10 min)');
201
- console.log('');
202
-
203
- console.log(chalk.yellow('3. Explore documentation:'));
204
- console.log(` • Configuration: ${chalk.cyan(configPath)}`);
205
- console.log(` • Workflows: ${chalk.cyan(path.join(bmbDir, 'workflows', 'byan'))}`);
206
- console.log('');
207
-
208
- console.log(chalk.gray('Need help? Type \'/bmad-help\' when BYAN is active'));
209
- console.log('');
210
- console.log(chalk.blue('Happy agent building! 🏗️'));
211
- }
212
-
213
- // CLI Program
214
- program
215
- .name('create-byan-agent')
216
- .description('Install BYAN - Builder of YAN agent creator')
217
- .version(BYAN_VERSION)
218
- .action(install);
219
-
220
- program.parse(process.argv);
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs-extra');
4
+ const path = require('path');
5
+ const { program } = require('commander');
6
+ const inquirer = require('inquirer');
7
+ const chalk = require('chalk');
8
+ const ora = require('ora');
9
+ const yaml = require('js-yaml');
10
+
11
+ const BYAN_VERSION = '1.0.0';
12
+
13
+ // ASCII Art Banner
14
+ const banner = `
15
+ ${chalk.blue('╔════════════════════════════════════════════════════════════╗')}
16
+ ${chalk.blue('║')} ${chalk.blue('║')}
17
+ ${chalk.blue('║')} ${chalk.bold('🏗️ BYAN INSTALLER v' + BYAN_VERSION)} ${chalk.blue('║')}
18
+ ${chalk.blue('║')} ${chalk.gray('Builder of YAN - Agent Creator')} ${chalk.blue('║')}
19
+ ${chalk.blue('║')} ${chalk.blue('║')}
20
+ ${chalk.blue('║')} ${chalk.gray('Methodology: Merise Agile + TDD + 64 Mantras')} ${chalk.blue('║')}
21
+ ${chalk.blue('║')} ${chalk.blue('║')}
22
+ ${chalk.blue('╚════════════════════════════════════════════════════════════╝')}
23
+ `;
24
+
25
+ // Main installer
26
+ async function install() {
27
+ console.clear();
28
+ console.log(banner);
29
+
30
+ const projectRoot = process.cwd();
31
+
32
+ // Step 1: Detect project type
33
+ const spinner = ora('Detecting project type...').start();
34
+
35
+ const isGitRepo = await fs.pathExists(path.join(projectRoot, '.git'));
36
+ const hasPackageJson = await fs.pathExists(path.join(projectRoot, 'package.json'));
37
+ const hasPyProject = await fs.pathExists(path.join(projectRoot, 'pyproject.toml'));
38
+
39
+ if (!isGitRepo && !hasPackageJson && !hasPyProject) {
40
+ spinner.warn('Not in a recognized project directory');
41
+
42
+ const { continueAnyway } = await inquirer.prompt([
43
+ {
44
+ type: 'confirm',
45
+ name: 'continueAnyway',
46
+ message: 'BYAN works best in a project with version control. Continue anyway?',
47
+ default: false
48
+ }
49
+ ]);
50
+
51
+ if (!continueAnyway) {
52
+ console.log(chalk.yellow('Installation cancelled.'));
53
+ process.exit(0);
54
+ }
55
+ } else {
56
+ spinner.succeed('Project detected');
57
+ }
58
+
59
+ // Step 2: Platform selection
60
+ const { platform } = await inquirer.prompt([
61
+ {
62
+ type: 'list',
63
+ name: 'platform',
64
+ message: 'Select platform to install for:',
65
+ choices: [
66
+ { name: 'GitHub Copilot CLI', value: 'copilot' },
67
+ { name: 'VSCode', value: 'vscode' },
68
+ { name: 'Claude Code', value: 'claude' },
69
+ { name: 'Codex', value: 'codex' },
70
+ { name: 'All platforms', value: 'all' }
71
+ ]
72
+ }
73
+ ]);
74
+
75
+ // Step 3: User configuration
76
+ const config = await inquirer.prompt([
77
+ {
78
+ type: 'input',
79
+ name: 'userName',
80
+ message: 'Your name:',
81
+ default: 'Developer'
82
+ },
83
+ {
84
+ type: 'list',
85
+ name: 'language',
86
+ message: 'Communication language:',
87
+ choices: ['Francais', 'English'],
88
+ default: 'English'
89
+ }
90
+ ]);
91
+
92
+ // Step 4: Create directory structure
93
+ const installSpinner = ora('Creating directory structure...').start();
94
+
95
+ const bmadDir = path.join(projectRoot, '_bmad');
96
+ const bmbDir = path.join(bmadDir, 'bmb');
97
+
98
+ await fs.ensureDir(path.join(bmadDir, 'bmb', 'agents'));
99
+ await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'steps'));
100
+ await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'templates'));
101
+ await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'data'));
102
+ await fs.ensureDir(path.join(bmadDir, 'core'));
103
+ await fs.ensureDir(path.join(bmadDir, '_config'));
104
+ await fs.ensureDir(path.join(bmadDir, '_memory'));
105
+ await fs.ensureDir(path.join(bmadDir, '_output'));
106
+
107
+ installSpinner.succeed('Directory structure created');
108
+
109
+ // Step 5: Copy BYAN files
110
+ const copySpinner = ora('Installing BYAN files...').start();
111
+
112
+ // In production, these would be copied from the package
113
+ // For now, we'll create minimal config
114
+
115
+ const configContent = {
116
+ bmb_creations_output_folder: "{project-root}/_bmad-output/bmb-creations",
117
+ user_name: config.userName,
118
+ communication_language: config.language,
119
+ document_output_language: config.language,
120
+ output_folder: "{project-root}/_bmad-output",
121
+ platform: platform
122
+ };
123
+
124
+ const configPath = path.join(bmbDir, 'config.yaml');
125
+ await fs.writeFile(configPath, yaml.dump(configContent), 'utf8');
126
+
127
+ copySpinner.succeed('BYAN files installed');
128
+
129
+ // Step 6: Create shortcuts
130
+ const shortcutSpinner = ora('Creating shortcuts...').start();
131
+
132
+ // Create package.json scripts if it exists
133
+ if (hasPackageJson) {
134
+ const pkgPath = path.join(projectRoot, 'package.json');
135
+ const pkg = await fs.readJson(pkgPath);
136
+
137
+ if (!pkg.scripts) pkg.scripts = {};
138
+
139
+ if (!pkg.scripts.byan) {
140
+ pkg.scripts.byan = 'echo "BYAN agent installed. Activate in your AI platform."';
141
+ await fs.writeJson(pkgPath, pkg, { spaces: 2 });
142
+ shortcutSpinner.succeed('NPM script added');
143
+ } else {
144
+ shortcutSpinner.info('NPM script already exists');
145
+ }
146
+ } else {
147
+ shortcutSpinner.succeed('Shortcuts created');
148
+ }
149
+
150
+ // Step 7: Verification
151
+ const verifySpinner = ora('Verifying installation...').start();
152
+
153
+ const checks = [
154
+ await fs.pathExists(path.join(bmbDir, 'agents')),
155
+ await fs.pathExists(path.join(bmbDir, 'workflows', 'byan')),
156
+ await fs.pathExists(configPath)
157
+ ];
158
+
159
+ const passed = checks.filter(Boolean).length;
160
+
161
+ if (passed === checks.length) {
162
+ verifySpinner.succeed(`Verification: ${passed}/${checks.length} checks passed`);
163
+ } else {
164
+ verifySpinner.warn(`Verification: ${passed}/${checks.length} checks passed`);
165
+ }
166
+
167
+ // Success message
168
+ console.log('');
169
+ console.log(chalk.green('╔════════════════════════════════════════════════════════════╗'));
170
+ console.log(chalk.green('║ ║'));
171
+ console.log(chalk.green('║ ✅ BYAN INSTALLATION COMPLETE! ║'));
172
+ console.log(chalk.green('║ ║'));
173
+ console.log(chalk.green('╚════════════════════════════════════════════════════════════╝'));
174
+ console.log('');
175
+
176
+ console.log(chalk.bold('Installation Summary:'));
177
+ console.log(` • Platform: ${chalk.cyan(platform)}`);
178
+ console.log(` • Installation Directory: ${chalk.cyan(bmbDir)}`);
179
+ console.log(` • Configuration: ${chalk.cyan(configPath)}`);
180
+ console.log(` • User: ${chalk.cyan(config.userName)}`);
181
+ console.log(` • Language: ${chalk.cyan(config.language)}`);
182
+ console.log('');
183
+
184
+ console.log(chalk.bold('Next Steps:'));
185
+ console.log('');
186
+ console.log(chalk.yellow('1. Activate BYAN:'));
187
+
188
+ if (platform === 'copilot') {
189
+ console.log(` ${chalk.blue('gh copilot suggest "activate byan agent"')}`);
190
+ } else if (platform === 'vscode') {
191
+ console.log(' Open VSCode Command Palette (Ctrl+Shift+P)');
192
+ console.log(' Type: "Activate BYAN Agent"');
193
+ } else if (platform === 'claude') {
194
+ console.log(` ${chalk.blue('claude chat --agent byan')}`);
195
+ }
196
+
197
+ console.log('');
198
+ console.log(chalk.yellow('2. Create your first agent:'));
199
+ console.log(' [INT] Start Intelligent Interview (30-45 min)');
200
+ console.log(' [QC] Quick Create (10 min)');
201
+ console.log('');
202
+
203
+ console.log(chalk.yellow('3. Explore documentation:'));
204
+ console.log(` • Configuration: ${chalk.cyan(configPath)}`);
205
+ console.log(` • Workflows: ${chalk.cyan(path.join(bmbDir, 'workflows', 'byan'))}`);
206
+ console.log('');
207
+
208
+ console.log(chalk.gray('Need help? Type \'/bmad-help\' when BYAN is active'));
209
+ console.log('');
210
+ console.log(chalk.blue('Happy agent building! 🏗️'));
211
+ }
212
+
213
+ // CLI Program
214
+ program
215
+ .name('create-byan-agent')
216
+ .description('Install BYAN - Builder of YAN agent creator')
217
+ .version(BYAN_VERSION)
218
+ .action(install);
219
+
220
+ program.parse(process.argv);