create-byan-agent 1.1.3 โ 1.2.1
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/CHANGELOG.md +273 -202
- package/LICENSE +21 -21
- package/README.md +1251 -421
- package/bin/create-byan-agent-backup.js +220 -220
- package/bin/create-byan-agent-fixed.js +301 -301
- package/bin/create-byan-agent.js +155 -322
- package/lib/errors.js +61 -0
- package/lib/exit-codes.js +54 -0
- package/lib/platforms/claude-code.js +113 -0
- package/lib/platforms/codex.js +92 -0
- package/lib/platforms/copilot-cli.js +123 -0
- package/lib/platforms/index.js +14 -0
- package/lib/platforms/vscode.js +51 -0
- package/lib/utils/config-loader.js +79 -0
- package/lib/utils/file-utils.js +104 -0
- package/lib/utils/git-detector.js +35 -0
- package/lib/utils/logger.js +64 -0
- package/lib/utils/node-detector.js +58 -0
- package/lib/utils/os-detector.js +74 -0
- package/lib/utils/yaml-utils.js +87 -0
- package/lib/yanstaller/backuper.js +308 -0
- package/lib/yanstaller/detector.js +141 -0
- package/lib/yanstaller/index.js +93 -0
- package/lib/yanstaller/installer.js +225 -0
- package/lib/yanstaller/interviewer.js +250 -0
- package/lib/yanstaller/recommender.js +298 -0
- package/lib/yanstaller/troubleshooter.js +498 -0
- package/lib/yanstaller/validator.js +578 -0
- package/lib/yanstaller/wizard.js +211 -0
- package/package.json +61 -55
- package/templates/.github/agents/bmad-agent-bmad-master.md +15 -15
- package/templates/.github/agents/bmad-agent-bmb-agent-builder.md +15 -15
- package/templates/.github/agents/bmad-agent-bmb-module-builder.md +15 -15
- package/templates/.github/agents/bmad-agent-bmb-workflow-builder.md +15 -15
- package/templates/.github/agents/bmad-agent-bmm-analyst.md +15 -15
- package/templates/.github/agents/bmad-agent-bmm-architect.md +15 -15
- package/templates/.github/agents/bmad-agent-bmm-dev.md +15 -15
- package/templates/.github/agents/bmad-agent-bmm-pm.md +15 -15
- package/templates/.github/agents/bmad-agent-bmm-quick-flow-solo-dev.md +15 -15
- package/templates/.github/agents/bmad-agent-bmm-quinn.md +15 -15
- package/templates/.github/agents/bmad-agent-bmm-sm.md +15 -15
- package/templates/.github/agents/bmad-agent-bmm-tech-writer.md +15 -15
- package/templates/.github/agents/bmad-agent-bmm-ux-designer.md +15 -15
- package/templates/.github/agents/bmad-agent-byan-test.md +32 -0
- package/templates/.github/agents/bmad-agent-byan.md +224 -224
- package/templates/.github/agents/bmad-agent-carmack.md +18 -0
- package/templates/.github/agents/bmad-agent-cis-brainstorming-coach.md +15 -15
- package/templates/.github/agents/bmad-agent-cis-creative-problem-solver.md +15 -15
- package/templates/.github/agents/bmad-agent-cis-design-thinking-coach.md +15 -15
- package/templates/.github/agents/bmad-agent-cis-innovation-strategist.md +15 -15
- package/templates/.github/agents/bmad-agent-cis-presentation-master.md +15 -15
- package/templates/.github/agents/bmad-agent-cis-storyteller.md +15 -15
- package/templates/.github/agents/bmad-agent-marc.md +48 -48
- package/templates/.github/agents/bmad-agent-patnote.md +48 -0
- package/templates/.github/agents/bmad-agent-rachid.md +47 -47
- package/templates/.github/agents/bmad-agent-tea-tea.md +15 -15
- package/templates/.github/agents/bmad-agent-test-dynamic.md +21 -0
- package/templates/.github/agents/expert-merise-agile.md +1 -0
- package/templates/.github/agents/franck.md +379 -0
- package/templates/_bmad/bmb/agents/agent-builder.md +59 -59
- package/templates/_bmad/bmb/agents/byan-test.md +116 -116
- package/templates/_bmad/bmb/agents/byan.md +215 -215
- package/templates/_bmad/bmb/agents/marc.md +303 -303
- package/templates/_bmad/bmb/agents/module-builder.md +60 -60
- package/templates/_bmad/bmb/agents/patnote.md +495 -495
- package/templates/_bmad/bmb/agents/rachid.md +184 -184
- package/templates/_bmad/bmb/agents/workflow-builder.md +61 -61
- package/templates/_bmad/bmb/workflows/byan/data/mantras.yaml +272 -272
- package/templates/_bmad/bmb/workflows/byan/data/templates.yaml +59 -59
- package/templates/_bmad/bmb/workflows/byan/delete-agent-workflow.md +657 -657
- package/templates/_bmad/bmb/workflows/byan/edit-agent-workflow.md +688 -688
- package/templates/_bmad/bmb/workflows/byan/interview-workflow.md +753 -753
- package/templates/_bmad/bmb/workflows/byan/quick-create-workflow.md +450 -450
- package/templates/_bmad/bmb/workflows/byan/templates/base-agent-template.md +79 -79
- package/templates/_bmad/bmb/workflows/byan/validate-agent-workflow.md +676 -676
- package/templates/_bmad/core/agents/carmack.md +238 -238
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YANSTALLER - Main Orchestrator
|
|
3
|
+
*
|
|
4
|
+
* Coordinates all YANSTALLER modules to perform intelligent BYAN installation.
|
|
5
|
+
*
|
|
6
|
+
* @module yanstaller
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const detector = require('./detector');
|
|
10
|
+
const recommender = require('./recommender');
|
|
11
|
+
const installer = require('./installer');
|
|
12
|
+
const validator = require('./validator');
|
|
13
|
+
const troubleshooter = require('./troubleshooter');
|
|
14
|
+
const interviewer = require('./interviewer');
|
|
15
|
+
const backuper = require('./backuper');
|
|
16
|
+
const wizard = require('./wizard');
|
|
17
|
+
const logger = require('../utils/logger');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {Object} YanInstallerOptions
|
|
21
|
+
* @property {boolean} [yes] - Skip confirmations (--yes flag)
|
|
22
|
+
* @property {string} [mode] - Installation mode: 'full' | 'minimal' | 'custom'
|
|
23
|
+
* @property {boolean} [verbose] - Verbose output
|
|
24
|
+
* @property {boolean} [quiet] - Minimal output
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Main installation flow
|
|
29
|
+
*
|
|
30
|
+
* @param {YanInstallerOptions} [options={}] - Installation options
|
|
31
|
+
* @returns {Promise<void>}
|
|
32
|
+
*/
|
|
33
|
+
async function install(options = {}) {
|
|
34
|
+
let backupPath = null;
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
// TODO: Implement Phase 1-8 orchestration
|
|
38
|
+
// 1. Detect environment
|
|
39
|
+
// 2. Validate Node version (FAIL FAST)
|
|
40
|
+
// 3. Recommend configuration
|
|
41
|
+
// 4. Run interview (unless --yes)
|
|
42
|
+
// 5. Backup existing installation
|
|
43
|
+
// backupPath = await backuper.backup('_bmad');
|
|
44
|
+
// 6. Install agents
|
|
45
|
+
// 7. Validate installation
|
|
46
|
+
// 8. Show post-install wizard
|
|
47
|
+
} catch (error) {
|
|
48
|
+
// ROLLBACK STRATEGY: Leave partial state + clear message
|
|
49
|
+
// Rationale (Mantra #37 Ockham's Razor):
|
|
50
|
+
// - Installation = mostly file copies (low risk)
|
|
51
|
+
// - User can re-run (idempotent)
|
|
52
|
+
// - Backup exists for manual restore
|
|
53
|
+
// - Auto-rollback risks losing working partial install
|
|
54
|
+
|
|
55
|
+
logger.error('Installation failed:', error.message);
|
|
56
|
+
|
|
57
|
+
if (backupPath) {
|
|
58
|
+
logger.info('\nPartial installation completed.');
|
|
59
|
+
logger.info(`Backup available at: ${backupPath}`);
|
|
60
|
+
logger.info('\nOptions:');
|
|
61
|
+
logger.info('1. Re-run: npx create-byan-agent');
|
|
62
|
+
logger.info(`2. Restore backup: yanstaller restore ${backupPath}`);
|
|
63
|
+
logger.info('3. Troubleshoot: yanstaller doctor');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
throw error; // Re-throw for exit code handling
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Uninstall BYAN
|
|
72
|
+
*
|
|
73
|
+
* @returns {Promise<void>}
|
|
74
|
+
*/
|
|
75
|
+
async function uninstall() {
|
|
76
|
+
// TODO: Remove _bmad/, .github/agents/ stubs
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Update existing BYAN installation
|
|
81
|
+
*
|
|
82
|
+
* @param {string} version - Target version
|
|
83
|
+
* @returns {Promise<void>}
|
|
84
|
+
*/
|
|
85
|
+
async function update(version) {
|
|
86
|
+
// TODO: Backup โ Update agents โ Merge configs
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
module.exports = {
|
|
90
|
+
install,
|
|
91
|
+
uninstall,
|
|
92
|
+
update
|
|
93
|
+
};
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* INSTALLER Module
|
|
3
|
+
*
|
|
4
|
+
* Installs BYAN agents across multiple platforms.
|
|
5
|
+
* Most complex module: 56h development.
|
|
6
|
+
*
|
|
7
|
+
* Phase 3: 56h development
|
|
8
|
+
*
|
|
9
|
+
* @module yanstaller/installer
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const fileUtils = require('../utils/file-utils');
|
|
14
|
+
const logger = require('../utils/logger');
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @typedef {Object} InstallConfig
|
|
18
|
+
* @property {string} mode - 'full' | 'minimal' | 'custom'
|
|
19
|
+
* @property {string[]} agents - Agent names to install
|
|
20
|
+
* @property {string} userName - User's name
|
|
21
|
+
* @property {string} language - 'Francais' | 'English'
|
|
22
|
+
* @property {string[]} targetPlatforms - Platforms to install on
|
|
23
|
+
* @property {string} outputFolder - Output folder path
|
|
24
|
+
* @property {string} projectRoot - Project root directory
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @typedef {Object} InstallResult
|
|
29
|
+
* @property {boolean} success
|
|
30
|
+
* @property {number} agentsInstalled - Number of agents installed
|
|
31
|
+
* @property {string[]} platforms - Platforms installed on
|
|
32
|
+
* @property {string[]} errors - Installation errors
|
|
33
|
+
* @property {number} duration - Duration in ms
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Install BYAN agents
|
|
38
|
+
*
|
|
39
|
+
* @param {InstallConfig} config - Installation configuration
|
|
40
|
+
* @returns {Promise<InstallResult>}
|
|
41
|
+
*/
|
|
42
|
+
async function install(config) {
|
|
43
|
+
const startTime = Date.now();
|
|
44
|
+
const errors = [];
|
|
45
|
+
let agentsInstalled = 0;
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
logger.info(`Installing ${config.agents.length} agents in ${config.mode} mode...`);
|
|
49
|
+
|
|
50
|
+
// 1. Create _bmad/ structure
|
|
51
|
+
logger.info('Creating _bmad/ directory structure...');
|
|
52
|
+
await createBmadStructure(config.projectRoot);
|
|
53
|
+
|
|
54
|
+
// 2. Copy agent files from templates/
|
|
55
|
+
logger.info('Copying agent files...');
|
|
56
|
+
for (const agentName of config.agents) {
|
|
57
|
+
try {
|
|
58
|
+
await copyAgentFile(agentName, config.projectRoot);
|
|
59
|
+
agentsInstalled++;
|
|
60
|
+
logger.info(` โ ${agentName}`);
|
|
61
|
+
} catch (error) {
|
|
62
|
+
errors.push(`Failed to install ${agentName}: ${error.message}`);
|
|
63
|
+
logger.warn(` โ ${agentName} - ${error.message}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// 3. Generate platform-specific stubs
|
|
68
|
+
logger.info('Generating platform stubs...');
|
|
69
|
+
for (const platform of config.targetPlatforms) {
|
|
70
|
+
try {
|
|
71
|
+
await generatePlatformStubs(platform, config);
|
|
72
|
+
logger.info(` โ ${platform}`);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
errors.push(`Failed to generate ${platform} stubs: ${error.message}`);
|
|
75
|
+
logger.warn(` โ ${platform} - ${error.message}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 4. Create config files
|
|
80
|
+
logger.info('Creating configuration files...');
|
|
81
|
+
await createModuleConfig('bmb', config, config.projectRoot);
|
|
82
|
+
|
|
83
|
+
const success = errors.length === 0;
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
success,
|
|
87
|
+
agentsInstalled,
|
|
88
|
+
platforms: config.targetPlatforms,
|
|
89
|
+
errors,
|
|
90
|
+
duration: Date.now() - startTime
|
|
91
|
+
};
|
|
92
|
+
} catch (error) {
|
|
93
|
+
errors.push(error.message);
|
|
94
|
+
return {
|
|
95
|
+
success: false,
|
|
96
|
+
agentsInstalled,
|
|
97
|
+
platforms: [],
|
|
98
|
+
errors,
|
|
99
|
+
duration: Date.now() - startTime
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Create _bmad/ directory structure
|
|
106
|
+
*
|
|
107
|
+
* @param {string} projectRoot - Project root directory
|
|
108
|
+
* @returns {Promise<void>}
|
|
109
|
+
*/
|
|
110
|
+
async function createBmadStructure(projectRoot) {
|
|
111
|
+
const directories = [
|
|
112
|
+
'_bmad',
|
|
113
|
+
'_bmad/_config',
|
|
114
|
+
'_bmad/_memory',
|
|
115
|
+
'_bmad/_output',
|
|
116
|
+
'_bmad/core',
|
|
117
|
+
'_bmad/core/agents',
|
|
118
|
+
'_bmad/core/workflows',
|
|
119
|
+
'_bmad/bmm',
|
|
120
|
+
'_bmad/bmm/agents',
|
|
121
|
+
'_bmad/bmm/workflows',
|
|
122
|
+
'_bmad/bmb',
|
|
123
|
+
'_bmad/bmb/agents',
|
|
124
|
+
'_bmad/bmb/workflows',
|
|
125
|
+
'_bmad/tea',
|
|
126
|
+
'_bmad/tea/agents',
|
|
127
|
+
'_bmad/tea/workflows',
|
|
128
|
+
'_bmad/cis',
|
|
129
|
+
'_bmad/cis/agents',
|
|
130
|
+
'_bmad/cis/workflows'
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
for (const dir of directories) {
|
|
134
|
+
const dirPath = path.join(projectRoot, dir);
|
|
135
|
+
await fileUtils.ensureDir(dirPath);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Copy agent file from template
|
|
141
|
+
*
|
|
142
|
+
* @param {string} agentName - Agent name
|
|
143
|
+
* @param {string} projectRoot - Project root directory
|
|
144
|
+
* @returns {Promise<void>}
|
|
145
|
+
*/
|
|
146
|
+
async function copyAgentFile(agentName, projectRoot) {
|
|
147
|
+
// Template base path
|
|
148
|
+
const templateBase = path.join(__dirname, '../../templates/_bmad');
|
|
149
|
+
|
|
150
|
+
// Search for agent in all modules
|
|
151
|
+
const modules = ['core', 'bmm', 'bmb', 'tea', 'cis'];
|
|
152
|
+
|
|
153
|
+
for (const module of modules) {
|
|
154
|
+
const sourceFile = path.join(templateBase, module, 'agents', `${agentName}.md`);
|
|
155
|
+
|
|
156
|
+
if (await fileUtils.exists(sourceFile)) {
|
|
157
|
+
const targetFile = path.join(projectRoot, '_bmad', module, 'agents', `${agentName}.md`);
|
|
158
|
+
await fileUtils.copy(sourceFile, targetFile);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
throw new Error(`Agent template not found: ${agentName}`);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Generate platform stubs for all agents
|
|
168
|
+
*
|
|
169
|
+
* @param {string} platform - Platform name ('copilot-cli' | 'vscode' | 'claude' | 'codex')
|
|
170
|
+
* @param {InstallConfig} config - Installation config
|
|
171
|
+
* @returns {Promise<void>}
|
|
172
|
+
*/
|
|
173
|
+
async function generatePlatformStubs(platform, config) {
|
|
174
|
+
const platformModule = require(`../platforms/${platform}`);
|
|
175
|
+
|
|
176
|
+
if (!platformModule || typeof platformModule.install !== 'function') {
|
|
177
|
+
throw new Error(`Platform module not found or invalid: ${platform}`);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
await platformModule.install(config.projectRoot, config.agents, config);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Create module config file
|
|
185
|
+
*
|
|
186
|
+
* @param {string} moduleName - Module name (core, bmm, bmb, tea, cis)
|
|
187
|
+
* @param {InstallConfig} config - Installation config
|
|
188
|
+
* @param {string} projectRoot - Project root directory
|
|
189
|
+
* @returns {Promise<void>}
|
|
190
|
+
*/
|
|
191
|
+
async function createModuleConfig(moduleName, config, projectRoot) {
|
|
192
|
+
const yaml = require('js-yaml');
|
|
193
|
+
|
|
194
|
+
const configContent = {
|
|
195
|
+
user_name: config.userName,
|
|
196
|
+
communication_language: config.language,
|
|
197
|
+
document_output_language: config.language,
|
|
198
|
+
output_folder: config.outputFolder || '{project-root}/_bmad-output',
|
|
199
|
+
|
|
200
|
+
// Installation metadata
|
|
201
|
+
installed_by: 'yanstaller',
|
|
202
|
+
installed_at: new Date().toISOString(),
|
|
203
|
+
version: '1.2.0',
|
|
204
|
+
mode: config.mode,
|
|
205
|
+
agents_installed: config.agents
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// Add module-specific settings
|
|
209
|
+
if (moduleName === 'bmb') {
|
|
210
|
+
configContent.bmb_creations_output_folder = '{project-root}/_bmad-output/bmb-creations';
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const configPath = path.join(projectRoot, '_bmad', moduleName, 'config.yaml');
|
|
214
|
+
const yamlContent = yaml.dump(configContent, { indent: 2 });
|
|
215
|
+
|
|
216
|
+
await fileUtils.writeFile(configPath, yamlContent);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
module.exports = {
|
|
220
|
+
install,
|
|
221
|
+
createBmadStructure,
|
|
222
|
+
copyAgentFile,
|
|
223
|
+
generatePlatformStubs,
|
|
224
|
+
createModuleConfig
|
|
225
|
+
};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* INTERVIEWER Module
|
|
3
|
+
*
|
|
4
|
+
* Conducts quick interview (5-7 questions, <5 min) to personalize installation.
|
|
5
|
+
*
|
|
6
|
+
* Phase 7: 16h development
|
|
7
|
+
*
|
|
8
|
+
* @module yanstaller/interviewer
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const inquirer = require('inquirer');
|
|
12
|
+
const chalk = require('chalk');
|
|
13
|
+
const logger = require('../utils/logger');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {Object} InterviewResult
|
|
17
|
+
* @property {string} userName
|
|
18
|
+
* @property {string} language - 'Francais' | 'English'
|
|
19
|
+
* @property {string} mode - 'full' | 'minimal' | 'custom'
|
|
20
|
+
* @property {string[]} agents - Selected agents (if custom mode)
|
|
21
|
+
* @property {string[]} targetPlatforms - Platforms to install on
|
|
22
|
+
* @property {boolean} createSampleAgent - Whether to create sample agent after install
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Run quick interview
|
|
27
|
+
*
|
|
28
|
+
* @param {import('./recommender').Recommendation} recommendation - Recommended config
|
|
29
|
+
* @returns {Promise<InterviewResult>}
|
|
30
|
+
*/
|
|
31
|
+
async function ask(recommendation) {
|
|
32
|
+
logger.info(chalk.bold('\n๐๏ธ YANSTALLER Quick Interview\n'));
|
|
33
|
+
logger.info('Just 5-7 questions to personalize your BYAN installation (<5 min)\n');
|
|
34
|
+
|
|
35
|
+
// Q1: Your name
|
|
36
|
+
const nameAnswer = await inquirer.prompt([
|
|
37
|
+
{
|
|
38
|
+
type: 'input',
|
|
39
|
+
name: 'userName',
|
|
40
|
+
message: 'What\'s your name?',
|
|
41
|
+
default: 'Developer',
|
|
42
|
+
validate: (input) => input.trim().length > 0 || 'Name cannot be empty'
|
|
43
|
+
}
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
// Q2: Preferred language
|
|
47
|
+
const langAnswer = await inquirer.prompt([
|
|
48
|
+
{
|
|
49
|
+
type: 'list',
|
|
50
|
+
name: 'language',
|
|
51
|
+
message: 'Preferred communication language?',
|
|
52
|
+
choices: [
|
|
53
|
+
{ name: 'English', value: 'English' },
|
|
54
|
+
{ name: 'Franรงais', value: 'Francais' }
|
|
55
|
+
],
|
|
56
|
+
default: 'English'
|
|
57
|
+
}
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
// Q3: Installation mode (with recommendation)
|
|
61
|
+
const recommendedMode = recommendation ? recommendation.mode : 'recommended';
|
|
62
|
+
const modeChoices = [
|
|
63
|
+
{
|
|
64
|
+
name: `Recommended - Based on your project (${recommendation ? recommendation.agents.length : 7} agents)`,
|
|
65
|
+
value: 'recommended',
|
|
66
|
+
description: 'Best for most users'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'Minimal - Essential agents only (4 agents)',
|
|
70
|
+
value: 'minimal',
|
|
71
|
+
description: 'Fastest installation'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Full - All 29 agents',
|
|
75
|
+
value: 'full',
|
|
76
|
+
description: 'Complete BMAD platform'
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'Custom - Choose specific agents',
|
|
80
|
+
value: 'custom',
|
|
81
|
+
description: 'Advanced users'
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
const modeAnswer = await inquirer.prompt([
|
|
86
|
+
{
|
|
87
|
+
type: 'list',
|
|
88
|
+
name: 'mode',
|
|
89
|
+
message: 'Installation mode?',
|
|
90
|
+
choices: modeChoices,
|
|
91
|
+
default: recommendedMode
|
|
92
|
+
}
|
|
93
|
+
]);
|
|
94
|
+
|
|
95
|
+
// Q4: Agent selection (if custom mode)
|
|
96
|
+
let selectedAgents = [];
|
|
97
|
+
if (modeAnswer.mode === 'custom') {
|
|
98
|
+
const agentAnswer = await inquirer.prompt([
|
|
99
|
+
{
|
|
100
|
+
type: 'checkbox',
|
|
101
|
+
name: 'agents',
|
|
102
|
+
message: 'Select agents to install:',
|
|
103
|
+
choices: getAgentChoices(),
|
|
104
|
+
pageSize: 15,
|
|
105
|
+
validate: (input) => input.length > 0 || 'Select at least one agent'
|
|
106
|
+
}
|
|
107
|
+
]);
|
|
108
|
+
selectedAgents = agentAnswer.agents;
|
|
109
|
+
} else if (modeAnswer.mode === 'recommended' && recommendation) {
|
|
110
|
+
selectedAgents = recommendation.agents;
|
|
111
|
+
} else if (modeAnswer.mode === 'minimal') {
|
|
112
|
+
selectedAgents = ['byan', 'rachid', 'dev', 'tech-writer'];
|
|
113
|
+
} else if (modeAnswer.mode === 'full') {
|
|
114
|
+
selectedAgents = getAllAgents();
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Q5: Target platforms
|
|
118
|
+
const platformAnswer = await inquirer.prompt([
|
|
119
|
+
{
|
|
120
|
+
type: 'checkbox',
|
|
121
|
+
name: 'platforms',
|
|
122
|
+
message: 'Which platforms to install on?',
|
|
123
|
+
choices: [
|
|
124
|
+
{ name: 'GitHub Copilot CLI (.github/agents/)', value: 'copilot-cli', checked: true },
|
|
125
|
+
{ name: 'VSCode Copilot Extension', value: 'vscode', checked: true },
|
|
126
|
+
{ name: 'Codex (.codex/prompts/)', value: 'codex', checked: false },
|
|
127
|
+
{ name: 'Claude Code (MCP server)', value: 'claude-code', checked: false }
|
|
128
|
+
],
|
|
129
|
+
validate: (input) => input.length > 0 || 'Select at least one platform'
|
|
130
|
+
}
|
|
131
|
+
]);
|
|
132
|
+
|
|
133
|
+
// Q6: Create sample agent
|
|
134
|
+
const sampleAnswer = await inquirer.prompt([
|
|
135
|
+
{
|
|
136
|
+
type: 'confirm',
|
|
137
|
+
name: 'createSample',
|
|
138
|
+
message: 'Launch BYAN agent creator after installation?',
|
|
139
|
+
default: false
|
|
140
|
+
}
|
|
141
|
+
]);
|
|
142
|
+
|
|
143
|
+
// Q7: Create backup (optional)
|
|
144
|
+
const backupAnswer = await inquirer.prompt([
|
|
145
|
+
{
|
|
146
|
+
type: 'confirm',
|
|
147
|
+
name: 'createBackup',
|
|
148
|
+
message: 'Create backup of existing _bmad/ directory? (if exists)',
|
|
149
|
+
default: true
|
|
150
|
+
}
|
|
151
|
+
]);
|
|
152
|
+
|
|
153
|
+
logger.info('');
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
userName: nameAnswer.userName,
|
|
157
|
+
language: langAnswer.language,
|
|
158
|
+
mode: modeAnswer.mode,
|
|
159
|
+
agents: selectedAgents,
|
|
160
|
+
targetPlatforms: platformAnswer.platforms,
|
|
161
|
+
createSampleAgent: sampleAnswer.createSample,
|
|
162
|
+
createBackup: backupAnswer.createBackup
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Ask single question
|
|
168
|
+
*
|
|
169
|
+
* @param {string} question - Question text
|
|
170
|
+
* @param {string} type - 'input' | 'list' | 'confirm' | 'checkbox'
|
|
171
|
+
* @param {Array} [choices] - Choices for list/checkbox
|
|
172
|
+
* @returns {Promise<any>}
|
|
173
|
+
*/
|
|
174
|
+
async function askQuestion(question, type, choices = []) {
|
|
175
|
+
// TODO: Use inquirer
|
|
176
|
+
const answer = await inquirer.prompt([
|
|
177
|
+
{
|
|
178
|
+
type,
|
|
179
|
+
name: 'answer',
|
|
180
|
+
message: question,
|
|
181
|
+
choices
|
|
182
|
+
}
|
|
183
|
+
]);
|
|
184
|
+
|
|
185
|
+
return answer.answer;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Get available agents list for custom selection
|
|
190
|
+
*
|
|
191
|
+
* @returns {Array<{name: string, value: string, checked: boolean}>}
|
|
192
|
+
*/
|
|
193
|
+
function getAgentChoices() {
|
|
194
|
+
return [
|
|
195
|
+
// BMB Module - Builders
|
|
196
|
+
{ name: '๐๏ธ BYAN - Agent Creator & Intelligent Interview', value: 'byan', checked: true },
|
|
197
|
+
{ name: '๐ฆ RACHID - NPM/NPX Deployment Specialist', value: 'rachid', checked: true },
|
|
198
|
+
{ name: '๐ง Agent Builder - Direct agent creation', value: 'agent-builder', checked: false },
|
|
199
|
+
{ name: '๐ Module Builder - Module scaffolding', value: 'module-builder', checked: false },
|
|
200
|
+
{ name: '๐ Workflow Builder - Workflow creation', value: 'workflow-builder', checked: false },
|
|
201
|
+
|
|
202
|
+
// BMM Module - Development Team
|
|
203
|
+
{ name: '๐ MARY (Analyst) - Requirements & Domain Expert', value: 'analyst', checked: false },
|
|
204
|
+
{ name: '๐ JOHN (PM) - Product Management', value: 'pm', checked: false },
|
|
205
|
+
{ name: '๐๏ธ WINSTON (Architect) - System Architecture', value: 'architect', checked: false },
|
|
206
|
+
{ name: '๐ป AMELIA (Dev) - Implementation Specialist', value: 'dev', checked: true },
|
|
207
|
+
{ name: '๐ BOB (SM) - Scrum Master', value: 'sm', checked: false },
|
|
208
|
+
{ name: '๐งช QUINN (QA) - Quality Assurance', value: 'quinn', checked: false },
|
|
209
|
+
{ name: '๐จ SALLY (UX) - UX/UI Design', value: 'ux-designer', checked: false },
|
|
210
|
+
{ name: '๐ PAIGE (Tech Writer) - Documentation', value: 'tech-writer', checked: true },
|
|
211
|
+
|
|
212
|
+
// TEA Module - Testing
|
|
213
|
+
{ name: '๐งฌ MURAT (TEA) - Test Architecture Expert', value: 'tea', checked: false },
|
|
214
|
+
|
|
215
|
+
// CIS Module - Innovation
|
|
216
|
+
{ name: '๐ก CARSON - Brainstorming Coach', value: 'brainstorming-coach', checked: false },
|
|
217
|
+
{ name: '๐ฏ DR. QUINN - Design Thinking Coach', value: 'design-thinking-coach', checked: false },
|
|
218
|
+
{ name: '๐งฉ MAYA - Creative Problem Solver', value: 'creative-problem-solver', checked: false },
|
|
219
|
+
{ name: '๐ VICTOR - Innovation Strategist', value: 'innovation-strategist', checked: false },
|
|
220
|
+
{ name: '๐ฝ๏ธ Presentation Master', value: 'presentation-master', checked: false },
|
|
221
|
+
{ name: '๐ Storyteller', value: 'storyteller', checked: false },
|
|
222
|
+
|
|
223
|
+
// Core Module
|
|
224
|
+
{ name: '๐ญ Party Mode - Multi-agent orchestration', value: 'party-mode', checked: false },
|
|
225
|
+
{ name: '๐ง BMAD Master - Platform orchestrator', value: 'bmad-master', checked: false },
|
|
226
|
+
|
|
227
|
+
// Specialized
|
|
228
|
+
{ name: '๐ MARC - GitHub Copilot CLI Integration', value: 'marc', checked: false },
|
|
229
|
+
{ name: '๐ PATNOTE - Update Manager', value: 'patnote', checked: false },
|
|
230
|
+
|
|
231
|
+
// Quick Flow Variants
|
|
232
|
+
{ name: 'โก Quick Flow Solo Dev', value: 'quick-flow-solo-dev', checked: false }
|
|
233
|
+
];
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Get all agent names
|
|
238
|
+
*
|
|
239
|
+
* @returns {string[]}
|
|
240
|
+
*/
|
|
241
|
+
function getAllAgents() {
|
|
242
|
+
return getAgentChoices().map(choice => choice.value);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
module.exports = {
|
|
246
|
+
ask,
|
|
247
|
+
askQuestion,
|
|
248
|
+
getAgentChoices,
|
|
249
|
+
getAllAgents
|
|
250
|
+
};
|