create-byan-agent 1.0.0 → 1.0.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.
- package/CHANGELOG.md +64 -0
- package/LICENSE +21 -0
- package/README.md +54 -6
- package/bin/create-byan-agent-backup.js +220 -0
- package/bin/create-byan-agent-fixed.js +301 -0
- package/bin/create-byan-agent.js +111 -30
- package/package.json +21 -9
- package/templates/.github/agents/bmad-agent-bmad-master.md +15 -0
- package/templates/.github/agents/bmad-agent-bmb-agent-builder.md +15 -0
- package/templates/.github/agents/bmad-agent-bmb-module-builder.md +15 -0
- package/templates/.github/agents/bmad-agent-bmb-workflow-builder.md +15 -0
- package/templates/.github/agents/bmad-agent-bmm-analyst.md +15 -0
- package/templates/.github/agents/bmad-agent-bmm-architect.md +15 -0
- package/templates/.github/agents/bmad-agent-bmm-dev.md +15 -0
- package/templates/.github/agents/bmad-agent-bmm-pm.md +15 -0
- package/templates/.github/agents/bmad-agent-bmm-quick-flow-solo-dev.md +15 -0
- package/templates/.github/agents/bmad-agent-bmm-quinn.md +15 -0
- package/templates/.github/agents/bmad-agent-bmm-sm.md +15 -0
- package/templates/.github/agents/bmad-agent-bmm-tech-writer.md +15 -0
- package/templates/.github/agents/bmad-agent-bmm-ux-designer.md +15 -0
- package/templates/.github/agents/bmad-agent-byan.md +224 -0
- package/templates/.github/agents/bmad-agent-cis-brainstorming-coach.md +15 -0
- package/templates/.github/agents/bmad-agent-cis-creative-problem-solver.md +15 -0
- package/templates/.github/agents/bmad-agent-cis-design-thinking-coach.md +15 -0
- package/templates/.github/agents/bmad-agent-cis-innovation-strategist.md +15 -0
- package/templates/.github/agents/bmad-agent-cis-presentation-master.md +15 -0
- package/templates/.github/agents/bmad-agent-cis-storyteller.md +15 -0
- package/templates/.github/agents/bmad-agent-marc.md +48 -0
- package/templates/.github/agents/bmad-agent-rachid.md +47 -0
- package/templates/.github/agents/bmad-agent-tea-tea.md +15 -0
- package/templates/_bmad/bmb/agents/agent-builder.md +59 -0
- package/templates/_bmad/bmb/agents/byan.md +215 -0
- package/templates/_bmad/bmb/agents/marc.md +303 -0
- package/templates/_bmad/bmb/agents/module-builder.md +60 -0
- package/templates/_bmad/bmb/agents/rachid.md +184 -0
- package/templates/_bmad/bmb/agents/workflow-builder.md +61 -0
- package/templates/_bmad/bmb/workflows/byan/data/mantras.yaml +272 -0
- package/templates/_bmad/bmb/workflows/byan/data/templates.yaml +59 -0
- package/templates/_bmad/bmb/workflows/byan/delete-agent-workflow.md +657 -0
- package/templates/_bmad/bmb/workflows/byan/edit-agent-workflow.md +688 -0
- package/templates/_bmad/bmb/workflows/byan/interview-workflow.md +753 -0
- package/templates/_bmad/bmb/workflows/byan/quick-create-workflow.md +450 -0
- package/templates/_bmad/bmb/workflows/byan/templates/base-agent-template.md +79 -0
- package/templates/_bmad/bmb/workflows/byan/validate-agent-workflow.md +676 -0
- package/install.sh +0 -239
- package/package-npm.json +0 -55
|
@@ -0,0 +1,301 @@
|
|
|
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.2';
|
|
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
|
+
// Source template directory (where BYAN package files are)
|
|
26
|
+
const getTemplateDir = () => {
|
|
27
|
+
// Check if running from npm package
|
|
28
|
+
const nodeModulesPath = path.join(__dirname, '..', '..', 'create-byan-agent', 'templates');
|
|
29
|
+
if (fs.existsSync(nodeModulesPath)) {
|
|
30
|
+
return nodeModulesPath;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Check if running from local installation
|
|
34
|
+
const localPath = path.join(__dirname, '..', 'templates');
|
|
35
|
+
if (fs.existsSync(localPath)) {
|
|
36
|
+
return localPath;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Fallback: assume we're in development
|
|
40
|
+
return path.join(__dirname, '..', '_bmad');
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Main installer
|
|
44
|
+
async function install() {
|
|
45
|
+
console.clear();
|
|
46
|
+
console.log(banner);
|
|
47
|
+
|
|
48
|
+
const projectRoot = process.cwd();
|
|
49
|
+
|
|
50
|
+
// Step 1: Detect project type
|
|
51
|
+
const spinner = ora('Detecting project type...').start();
|
|
52
|
+
|
|
53
|
+
const isGitRepo = await fs.pathExists(path.join(projectRoot, '.git'));
|
|
54
|
+
const hasPackageJson = await fs.pathExists(path.join(projectRoot, 'package.json'));
|
|
55
|
+
const hasPyProject = await fs.pathExists(path.join(projectRoot, 'pyproject.toml'));
|
|
56
|
+
|
|
57
|
+
if (!isGitRepo && !hasPackageJson && !hasPyProject) {
|
|
58
|
+
spinner.warn('Not in a recognized project directory');
|
|
59
|
+
|
|
60
|
+
const { continueAnyway } = await inquirer.prompt([
|
|
61
|
+
{
|
|
62
|
+
type: 'confirm',
|
|
63
|
+
name: 'continueAnyway',
|
|
64
|
+
message: 'BYAN works best in a project with version control. Continue anyway?',
|
|
65
|
+
default: false
|
|
66
|
+
}
|
|
67
|
+
]);
|
|
68
|
+
|
|
69
|
+
if (!continueAnyway) {
|
|
70
|
+
console.log(chalk.yellow('Installation cancelled.'));
|
|
71
|
+
process.exit(0);
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
spinner.succeed('Project detected');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Step 2: Platform selection
|
|
78
|
+
const { platform } = await inquirer.prompt([
|
|
79
|
+
{
|
|
80
|
+
type: 'list',
|
|
81
|
+
name: 'platform',
|
|
82
|
+
message: 'Select platform to install for:',
|
|
83
|
+
choices: [
|
|
84
|
+
{ name: 'GitHub Copilot CLI', value: 'copilot' },
|
|
85
|
+
{ name: 'VSCode', value: 'vscode' },
|
|
86
|
+
{ name: 'Claude Code', value: 'claude' },
|
|
87
|
+
{ name: 'Codex', value: 'codex' },
|
|
88
|
+
{ name: 'All platforms', value: 'all' }
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
]);
|
|
92
|
+
|
|
93
|
+
// Step 3: User configuration
|
|
94
|
+
const config = await inquirer.prompt([
|
|
95
|
+
{
|
|
96
|
+
type: 'input',
|
|
97
|
+
name: 'userName',
|
|
98
|
+
message: 'Your name:',
|
|
99
|
+
default: 'Developer'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
type: 'list',
|
|
103
|
+
name: 'language',
|
|
104
|
+
message: 'Communication language:',
|
|
105
|
+
choices: ['Francais', 'English'],
|
|
106
|
+
default: 'English'
|
|
107
|
+
}
|
|
108
|
+
]);
|
|
109
|
+
|
|
110
|
+
// Step 4: Create directory structure
|
|
111
|
+
const installSpinner = ora('Creating directory structure...').start();
|
|
112
|
+
|
|
113
|
+
const bmadDir = path.join(projectRoot, '_bmad');
|
|
114
|
+
const bmbDir = path.join(bmadDir, 'bmb');
|
|
115
|
+
const githubAgentsDir = path.join(projectRoot, '.github', 'agents');
|
|
116
|
+
|
|
117
|
+
await fs.ensureDir(path.join(bmadDir, 'bmb', 'agents'));
|
|
118
|
+
await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'steps'));
|
|
119
|
+
await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'templates'));
|
|
120
|
+
await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'data'));
|
|
121
|
+
await fs.ensureDir(path.join(bmadDir, 'core'));
|
|
122
|
+
await fs.ensureDir(path.join(bmadDir, '_config'));
|
|
123
|
+
await fs.ensureDir(path.join(bmadDir, '_memory'));
|
|
124
|
+
await fs.ensureDir(path.join(bmadDir, '_output'));
|
|
125
|
+
await fs.ensureDir(githubAgentsDir);
|
|
126
|
+
|
|
127
|
+
installSpinner.succeed('Directory structure created');
|
|
128
|
+
|
|
129
|
+
// Step 5: Copy BYAN files from template
|
|
130
|
+
const copySpinner = ora('Installing BYAN files...').start();
|
|
131
|
+
|
|
132
|
+
const templateDir = getTemplateDir();
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
// Copy agent files
|
|
136
|
+
const agentsSource = path.join(templateDir, 'bmb', 'agents');
|
|
137
|
+
const agentsDest = path.join(bmbDir, 'agents');
|
|
138
|
+
|
|
139
|
+
if (await fs.pathExists(agentsSource)) {
|
|
140
|
+
await fs.copy(agentsSource, agentsDest, { overwrite: true });
|
|
141
|
+
copySpinner.text = 'Copied agent files...';
|
|
142
|
+
} else {
|
|
143
|
+
copySpinner.warn(`Agent source not found: ${agentsSource}`);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Copy workflow files
|
|
147
|
+
const workflowsSource = path.join(templateDir, 'bmb', 'workflows', 'byan');
|
|
148
|
+
const workflowsDest = path.join(bmbDir, 'workflows', 'byan');
|
|
149
|
+
|
|
150
|
+
if (await fs.pathExists(workflowsSource)) {
|
|
151
|
+
await fs.copy(workflowsSource, workflowsDest, { overwrite: true });
|
|
152
|
+
copySpinner.text = 'Copied workflow files...';
|
|
153
|
+
} else {
|
|
154
|
+
copySpinner.warn(`Workflow source not found: ${workflowsSource}`);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Copy .github/agents files for Copilot CLI detection
|
|
158
|
+
const githubAgentsSource = path.join(templateDir, '..', '.github', 'agents');
|
|
159
|
+
|
|
160
|
+
if (await fs.pathExists(githubAgentsSource)) {
|
|
161
|
+
await fs.copy(githubAgentsSource, githubAgentsDir, { overwrite: true });
|
|
162
|
+
copySpinner.text = 'Copied Copilot CLI agent stubs...';
|
|
163
|
+
} else {
|
|
164
|
+
copySpinner.warn(`GitHub agents source not found: ${githubAgentsSource}`);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
copySpinner.succeed('BYAN files installed');
|
|
168
|
+
} catch (error) {
|
|
169
|
+
copySpinner.fail('Error copying files');
|
|
170
|
+
console.error(chalk.red('Details:'), error.message);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Step 6: Create config.yaml
|
|
174
|
+
const configSpinner = ora('Generating configuration...').start();
|
|
175
|
+
|
|
176
|
+
const configContent = {
|
|
177
|
+
bmb_creations_output_folder: "{project-root}/_bmad-output/bmb-creations",
|
|
178
|
+
user_name: config.userName,
|
|
179
|
+
communication_language: config.language,
|
|
180
|
+
document_output_language: config.language,
|
|
181
|
+
output_folder: "{project-root}/_bmad-output",
|
|
182
|
+
platform: platform
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
const configPath = path.join(bmbDir, 'config.yaml');
|
|
186
|
+
await fs.writeFile(configPath, yaml.dump(configContent), 'utf8');
|
|
187
|
+
|
|
188
|
+
configSpinner.succeed('Configuration generated');
|
|
189
|
+
|
|
190
|
+
// Step 7: Create package.json script
|
|
191
|
+
const shortcutSpinner = ora('Creating shortcuts...').start();
|
|
192
|
+
|
|
193
|
+
if (hasPackageJson) {
|
|
194
|
+
const pkgPath = path.join(projectRoot, 'package.json');
|
|
195
|
+
const pkg = await fs.readJson(pkgPath);
|
|
196
|
+
|
|
197
|
+
if (!pkg.scripts) pkg.scripts = {};
|
|
198
|
+
|
|
199
|
+
if (!pkg.scripts.byan) {
|
|
200
|
+
pkg.scripts.byan = 'echo "BYAN agent installed. Use: copilot and type /agent"';
|
|
201
|
+
await fs.writeJson(pkgPath, pkg, { spaces: 2 });
|
|
202
|
+
shortcutSpinner.succeed('NPM script added');
|
|
203
|
+
} else {
|
|
204
|
+
shortcutSpinner.info('NPM script already exists');
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
shortcutSpinner.succeed('Shortcuts created');
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Step 8: Verification
|
|
211
|
+
const verifySpinner = ora('Verifying installation...').start();
|
|
212
|
+
|
|
213
|
+
const checks = [
|
|
214
|
+
{ name: 'Agents directory', path: path.join(bmbDir, 'agents') },
|
|
215
|
+
{ name: 'BYAN agent', path: path.join(bmbDir, 'agents', 'byan.md') },
|
|
216
|
+
{ name: 'RACHID agent', path: path.join(bmbDir, 'agents', 'rachid.md') },
|
|
217
|
+
{ name: 'MARC agent', path: path.join(bmbDir, 'agents', 'marc.md') },
|
|
218
|
+
{ name: 'Workflows', path: path.join(bmbDir, 'workflows', 'byan') },
|
|
219
|
+
{ name: 'Config', path: configPath },
|
|
220
|
+
{ name: 'GitHub agents dir', path: githubAgentsDir },
|
|
221
|
+
{ name: 'BYAN stub', path: path.join(githubAgentsDir, 'bmad-agent-byan.md') },
|
|
222
|
+
{ name: 'RACHID stub', path: path.join(githubAgentsDir, 'bmad-agent-rachid.md') },
|
|
223
|
+
{ name: 'MARC stub', path: path.join(githubAgentsDir, 'bmad-agent-marc.md') }
|
|
224
|
+
];
|
|
225
|
+
|
|
226
|
+
let passed = 0;
|
|
227
|
+
let failed = [];
|
|
228
|
+
|
|
229
|
+
for (const check of checks) {
|
|
230
|
+
if (await fs.pathExists(check.path)) {
|
|
231
|
+
passed++;
|
|
232
|
+
} else {
|
|
233
|
+
failed.push(check.name);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (passed === checks.length) {
|
|
238
|
+
verifySpinner.succeed(`Verification: ${passed}/${checks.length} checks passed ✅`);
|
|
239
|
+
} else {
|
|
240
|
+
verifySpinner.warn(`Verification: ${passed}/${checks.length} checks passed`);
|
|
241
|
+
if (failed.length > 0) {
|
|
242
|
+
console.log(chalk.yellow(' Missing:'), failed.join(', '));
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Success message
|
|
247
|
+
console.log('');
|
|
248
|
+
console.log(chalk.green('╔════════════════════════════════════════════════════════════╗'));
|
|
249
|
+
console.log(chalk.green('║ ║'));
|
|
250
|
+
console.log(chalk.green('║ ✅ BYAN INSTALLATION COMPLETE! ║'));
|
|
251
|
+
console.log(chalk.green('║ ║'));
|
|
252
|
+
console.log(chalk.green('╚════════════════════════════════════════════════════════════╝'));
|
|
253
|
+
console.log('');
|
|
254
|
+
|
|
255
|
+
console.log(chalk.bold('Installation Summary:'));
|
|
256
|
+
console.log(` • Platform: ${chalk.cyan(platform)}`);
|
|
257
|
+
console.log(` • Installation Directory: ${chalk.cyan(bmbDir)}`);
|
|
258
|
+
console.log(` • Configuration: ${chalk.cyan(configPath)}`);
|
|
259
|
+
console.log(` • User: ${chalk.cyan(config.userName)}`);
|
|
260
|
+
console.log(` • Language: ${chalk.cyan(config.language)}`);
|
|
261
|
+
console.log(` • Agents Installed: ${chalk.cyan('BYAN, RACHID, MARC')}`);
|
|
262
|
+
console.log('');
|
|
263
|
+
|
|
264
|
+
console.log(chalk.bold('Next Steps:'));
|
|
265
|
+
console.log('');
|
|
266
|
+
console.log(chalk.yellow('1. Activate agents in GitHub Copilot CLI:'));
|
|
267
|
+
console.log(` ${chalk.blue('copilot')}`);
|
|
268
|
+
console.log(` Then type: ${chalk.blue('/agent')}`);
|
|
269
|
+
console.log(` Select: ${chalk.cyan('byan')} (create agents)`);
|
|
270
|
+
console.log(` ${chalk.cyan('rachid')} (NPM deployment)`);
|
|
271
|
+
console.log(` ${chalk.cyan('marc')} (Copilot CLI integration)`);
|
|
272
|
+
console.log('');
|
|
273
|
+
|
|
274
|
+
console.log(chalk.yellow('2. Create your first agent with BYAN:'));
|
|
275
|
+
console.log(' [INT] Start Intelligent Interview (30-45 min)');
|
|
276
|
+
console.log(' [QC] Quick Create (10 min)');
|
|
277
|
+
console.log('');
|
|
278
|
+
|
|
279
|
+
console.log(chalk.yellow('3. Deploy with RACHID:'));
|
|
280
|
+
console.log(' Use RACHID to publish BYAN to npm');
|
|
281
|
+
console.log(' Validate package.json and dependencies');
|
|
282
|
+
console.log('');
|
|
283
|
+
|
|
284
|
+
console.log(chalk.yellow('4. Integrate with MARC:'));
|
|
285
|
+
console.log(' Use MARC to test /agent detection');
|
|
286
|
+
console.log(' Validate .github/agents/ structure');
|
|
287
|
+
console.log('');
|
|
288
|
+
|
|
289
|
+
console.log(chalk.gray('Need help? Type \'/bmad-help\' when BYAN is active'));
|
|
290
|
+
console.log('');
|
|
291
|
+
console.log(chalk.blue('Happy agent building! 🏗️'));
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// CLI Program
|
|
295
|
+
program
|
|
296
|
+
.name('create-byan-agent')
|
|
297
|
+
.description('Install BYAN - Builder of YAN agent creator with RACHID and MARC')
|
|
298
|
+
.version(BYAN_VERSION)
|
|
299
|
+
.action(install);
|
|
300
|
+
|
|
301
|
+
program.parse(process.argv);
|
package/bin/create-byan-agent.js
CHANGED
|
@@ -8,7 +8,7 @@ const chalk = require('chalk');
|
|
|
8
8
|
const ora = require('ora');
|
|
9
9
|
const yaml = require('js-yaml');
|
|
10
10
|
|
|
11
|
-
const BYAN_VERSION = '1.0.
|
|
11
|
+
const BYAN_VERSION = '1.0.2';
|
|
12
12
|
|
|
13
13
|
// ASCII Art Banner
|
|
14
14
|
const banner = `
|
|
@@ -22,6 +22,24 @@ ${chalk.blue('║')}
|
|
|
22
22
|
${chalk.blue('╚════════════════════════════════════════════════════════════╝')}
|
|
23
23
|
`;
|
|
24
24
|
|
|
25
|
+
// Source template directory (where BYAN package files are)
|
|
26
|
+
const getTemplateDir = () => {
|
|
27
|
+
// Check if running from npm package
|
|
28
|
+
const nodeModulesPath = path.join(__dirname, '..', '..', 'create-byan-agent', 'templates');
|
|
29
|
+
if (fs.existsSync(nodeModulesPath)) {
|
|
30
|
+
return nodeModulesPath;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Check if running from local installation
|
|
34
|
+
const localPath = path.join(__dirname, '..', 'templates');
|
|
35
|
+
if (fs.existsSync(localPath)) {
|
|
36
|
+
return localPath;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Fallback: assume we're in development
|
|
40
|
+
return path.join(__dirname, '..', '_bmad');
|
|
41
|
+
};
|
|
42
|
+
|
|
25
43
|
// Main installer
|
|
26
44
|
async function install() {
|
|
27
45
|
console.clear();
|
|
@@ -94,6 +112,7 @@ async function install() {
|
|
|
94
112
|
|
|
95
113
|
const bmadDir = path.join(projectRoot, '_bmad');
|
|
96
114
|
const bmbDir = path.join(bmadDir, 'bmb');
|
|
115
|
+
const githubAgentsDir = path.join(projectRoot, '.github', 'agents');
|
|
97
116
|
|
|
98
117
|
await fs.ensureDir(path.join(bmadDir, 'bmb', 'agents'));
|
|
99
118
|
await fs.ensureDir(path.join(bmadDir, 'bmb', 'workflows', 'byan', 'steps'));
|
|
@@ -103,14 +122,56 @@ async function install() {
|
|
|
103
122
|
await fs.ensureDir(path.join(bmadDir, '_config'));
|
|
104
123
|
await fs.ensureDir(path.join(bmadDir, '_memory'));
|
|
105
124
|
await fs.ensureDir(path.join(bmadDir, '_output'));
|
|
125
|
+
await fs.ensureDir(githubAgentsDir);
|
|
106
126
|
|
|
107
127
|
installSpinner.succeed('Directory structure created');
|
|
108
128
|
|
|
109
|
-
// Step 5: Copy BYAN files
|
|
129
|
+
// Step 5: Copy BYAN files from template
|
|
110
130
|
const copySpinner = ora('Installing BYAN files...').start();
|
|
111
131
|
|
|
112
|
-
|
|
113
|
-
|
|
132
|
+
const templateDir = getTemplateDir();
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
// Copy agent files
|
|
136
|
+
const agentsSource = path.join(templateDir, 'bmb', 'agents');
|
|
137
|
+
const agentsDest = path.join(bmbDir, 'agents');
|
|
138
|
+
|
|
139
|
+
if (await fs.pathExists(agentsSource)) {
|
|
140
|
+
await fs.copy(agentsSource, agentsDest, { overwrite: true });
|
|
141
|
+
copySpinner.text = 'Copied agent files...';
|
|
142
|
+
} else {
|
|
143
|
+
copySpinner.warn(`Agent source not found: ${agentsSource}`);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Copy workflow files
|
|
147
|
+
const workflowsSource = path.join(templateDir, 'bmb', 'workflows', 'byan');
|
|
148
|
+
const workflowsDest = path.join(bmbDir, 'workflows', 'byan');
|
|
149
|
+
|
|
150
|
+
if (await fs.pathExists(workflowsSource)) {
|
|
151
|
+
await fs.copy(workflowsSource, workflowsDest, { overwrite: true });
|
|
152
|
+
copySpinner.text = 'Copied workflow files...';
|
|
153
|
+
} else {
|
|
154
|
+
copySpinner.warn(`Workflow source not found: ${workflowsSource}`);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// Copy .github/agents files for Copilot CLI detection
|
|
158
|
+
const githubAgentsSource = path.join(templateDir, '..', '.github', 'agents');
|
|
159
|
+
|
|
160
|
+
if (await fs.pathExists(githubAgentsSource)) {
|
|
161
|
+
await fs.copy(githubAgentsSource, githubAgentsDir, { overwrite: true });
|
|
162
|
+
copySpinner.text = 'Copied Copilot CLI agent stubs...';
|
|
163
|
+
} else {
|
|
164
|
+
copySpinner.warn(`GitHub agents source not found: ${githubAgentsSource}`);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
copySpinner.succeed('BYAN files installed');
|
|
168
|
+
} catch (error) {
|
|
169
|
+
copySpinner.fail('Error copying files');
|
|
170
|
+
console.error(chalk.red('Details:'), error.message);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Step 6: Create config.yaml
|
|
174
|
+
const configSpinner = ora('Generating configuration...').start();
|
|
114
175
|
|
|
115
176
|
const configContent = {
|
|
116
177
|
bmb_creations_output_folder: "{project-root}/_bmad-output/bmb-creations",
|
|
@@ -124,12 +185,11 @@ async function install() {
|
|
|
124
185
|
const configPath = path.join(bmbDir, 'config.yaml');
|
|
125
186
|
await fs.writeFile(configPath, yaml.dump(configContent), 'utf8');
|
|
126
187
|
|
|
127
|
-
|
|
188
|
+
configSpinner.succeed('Configuration generated');
|
|
128
189
|
|
|
129
|
-
// Step
|
|
190
|
+
// Step 7: Create package.json script
|
|
130
191
|
const shortcutSpinner = ora('Creating shortcuts...').start();
|
|
131
192
|
|
|
132
|
-
// Create package.json scripts if it exists
|
|
133
193
|
if (hasPackageJson) {
|
|
134
194
|
const pkgPath = path.join(projectRoot, 'package.json');
|
|
135
195
|
const pkg = await fs.readJson(pkgPath);
|
|
@@ -137,7 +197,7 @@ async function install() {
|
|
|
137
197
|
if (!pkg.scripts) pkg.scripts = {};
|
|
138
198
|
|
|
139
199
|
if (!pkg.scripts.byan) {
|
|
140
|
-
pkg.scripts.byan = 'echo "BYAN agent installed.
|
|
200
|
+
pkg.scripts.byan = 'echo "BYAN agent installed. Use: copilot and type /agent"';
|
|
141
201
|
await fs.writeJson(pkgPath, pkg, { spaces: 2 });
|
|
142
202
|
shortcutSpinner.succeed('NPM script added');
|
|
143
203
|
} else {
|
|
@@ -147,21 +207,40 @@ async function install() {
|
|
|
147
207
|
shortcutSpinner.succeed('Shortcuts created');
|
|
148
208
|
}
|
|
149
209
|
|
|
150
|
-
// Step
|
|
210
|
+
// Step 8: Verification
|
|
151
211
|
const verifySpinner = ora('Verifying installation...').start();
|
|
152
212
|
|
|
153
213
|
const checks = [
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
214
|
+
{ name: 'Agents directory', path: path.join(bmbDir, 'agents') },
|
|
215
|
+
{ name: 'BYAN agent', path: path.join(bmbDir, 'agents', 'byan.md') },
|
|
216
|
+
{ name: 'RACHID agent', path: path.join(bmbDir, 'agents', 'rachid.md') },
|
|
217
|
+
{ name: 'MARC agent', path: path.join(bmbDir, 'agents', 'marc.md') },
|
|
218
|
+
{ name: 'Workflows', path: path.join(bmbDir, 'workflows', 'byan') },
|
|
219
|
+
{ name: 'Config', path: configPath },
|
|
220
|
+
{ name: 'GitHub agents dir', path: githubAgentsDir },
|
|
221
|
+
{ name: 'BYAN stub', path: path.join(githubAgentsDir, 'bmad-agent-byan.md') },
|
|
222
|
+
{ name: 'RACHID stub', path: path.join(githubAgentsDir, 'bmad-agent-rachid.md') },
|
|
223
|
+
{ name: 'MARC stub', path: path.join(githubAgentsDir, 'bmad-agent-marc.md') }
|
|
157
224
|
];
|
|
158
225
|
|
|
159
|
-
|
|
226
|
+
let passed = 0;
|
|
227
|
+
let failed = [];
|
|
228
|
+
|
|
229
|
+
for (const check of checks) {
|
|
230
|
+
if (await fs.pathExists(check.path)) {
|
|
231
|
+
passed++;
|
|
232
|
+
} else {
|
|
233
|
+
failed.push(check.name);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
160
236
|
|
|
161
237
|
if (passed === checks.length) {
|
|
162
|
-
verifySpinner.succeed(`Verification: ${passed}/${checks.length} checks passed
|
|
238
|
+
verifySpinner.succeed(`Verification: ${passed}/${checks.length} checks passed ✅`);
|
|
163
239
|
} else {
|
|
164
240
|
verifySpinner.warn(`Verification: ${passed}/${checks.length} checks passed`);
|
|
241
|
+
if (failed.length > 0) {
|
|
242
|
+
console.log(chalk.yellow(' Missing:'), failed.join(', '));
|
|
243
|
+
}
|
|
165
244
|
}
|
|
166
245
|
|
|
167
246
|
// Success message
|
|
@@ -179,30 +258,32 @@ async function install() {
|
|
|
179
258
|
console.log(` • Configuration: ${chalk.cyan(configPath)}`);
|
|
180
259
|
console.log(` • User: ${chalk.cyan(config.userName)}`);
|
|
181
260
|
console.log(` • Language: ${chalk.cyan(config.language)}`);
|
|
261
|
+
console.log(` • Agents Installed: ${chalk.cyan('BYAN, RACHID, MARC')}`);
|
|
182
262
|
console.log('');
|
|
183
263
|
|
|
184
264
|
console.log(chalk.bold('Next Steps:'));
|
|
185
265
|
console.log('');
|
|
186
|
-
console.log(chalk.yellow('1. Activate
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
console.log(' Type: "Activate BYAN Agent"');
|
|
193
|
-
} else if (platform === 'claude') {
|
|
194
|
-
console.log(` ${chalk.blue('claude chat --agent byan')}`);
|
|
195
|
-
}
|
|
196
|
-
|
|
266
|
+
console.log(chalk.yellow('1. Activate agents in GitHub Copilot CLI:'));
|
|
267
|
+
console.log(` ${chalk.blue('copilot')}`);
|
|
268
|
+
console.log(` Then type: ${chalk.blue('/agent')}`);
|
|
269
|
+
console.log(` Select: ${chalk.cyan('byan')} (create agents)`);
|
|
270
|
+
console.log(` ${chalk.cyan('rachid')} (NPM deployment)`);
|
|
271
|
+
console.log(` ${chalk.cyan('marc')} (Copilot CLI integration)`);
|
|
197
272
|
console.log('');
|
|
198
|
-
|
|
273
|
+
|
|
274
|
+
console.log(chalk.yellow('2. Create your first agent with BYAN:'));
|
|
199
275
|
console.log(' [INT] Start Intelligent Interview (30-45 min)');
|
|
200
276
|
console.log(' [QC] Quick Create (10 min)');
|
|
201
277
|
console.log('');
|
|
202
278
|
|
|
203
|
-
console.log(chalk.yellow('3.
|
|
204
|
-
console.log(
|
|
205
|
-
console.log(
|
|
279
|
+
console.log(chalk.yellow('3. Deploy with RACHID:'));
|
|
280
|
+
console.log(' Use RACHID to publish BYAN to npm');
|
|
281
|
+
console.log(' Validate package.json and dependencies');
|
|
282
|
+
console.log('');
|
|
283
|
+
|
|
284
|
+
console.log(chalk.yellow('4. Integrate with MARC:'));
|
|
285
|
+
console.log(' Use MARC to test /agent detection');
|
|
286
|
+
console.log(' Validate .github/agents/ structure');
|
|
206
287
|
console.log('');
|
|
207
288
|
|
|
208
289
|
console.log(chalk.gray('Need help? Type \'/bmad-help\' when BYAN is active'));
|
|
@@ -213,7 +294,7 @@ async function install() {
|
|
|
213
294
|
// CLI Program
|
|
214
295
|
program
|
|
215
296
|
.name('create-byan-agent')
|
|
216
|
-
.description('Install BYAN - Builder of YAN agent creator')
|
|
297
|
+
.description('Install BYAN - Builder of YAN agent creator with RACHID and MARC')
|
|
217
298
|
.version(BYAN_VERSION)
|
|
218
299
|
.action(install);
|
|
219
300
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-byan-agent",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "NPX installer for BYAN - Builder of YAN agent creator",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "NPX installer for BYAN - Builder of YAN agent creator with RACHID and MARC",
|
|
5
5
|
"bin": {
|
|
6
|
-
"create-byan-agent": "
|
|
6
|
+
"create-byan-agent": "bin/create-byan-agent.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"start": "node bin/create-byan-agent.js"
|
|
9
|
+
"start": "node bin/create-byan-agent.js",
|
|
10
|
+
"test": "node bin/create-byan-agent.js"
|
|
10
11
|
},
|
|
11
12
|
"keywords": [
|
|
12
13
|
"byan",
|
|
@@ -18,19 +19,30 @@
|
|
|
18
19
|
"tdd",
|
|
19
20
|
"copilot",
|
|
20
21
|
"vscode",
|
|
21
|
-
"claude"
|
|
22
|
+
"claude",
|
|
23
|
+
"rachid",
|
|
24
|
+
"marc",
|
|
25
|
+
"npm",
|
|
26
|
+
"deployment"
|
|
22
27
|
],
|
|
23
28
|
"author": "Yan",
|
|
24
29
|
"license": "MIT",
|
|
25
30
|
"dependencies": {
|
|
26
|
-
"chalk": "^
|
|
31
|
+
"chalk": "^4.1.2",
|
|
27
32
|
"commander": "^11.1.0",
|
|
28
|
-
"inquirer": "^
|
|
33
|
+
"inquirer": "^8.2.5",
|
|
29
34
|
"fs-extra": "^11.2.0",
|
|
30
35
|
"js-yaml": "^4.1.0",
|
|
31
|
-
"ora": "^
|
|
36
|
+
"ora": "^5.4.1"
|
|
32
37
|
},
|
|
33
38
|
"engines": {
|
|
34
39
|
"node": ">=18.0.0"
|
|
35
|
-
}
|
|
40
|
+
},
|
|
41
|
+
"files": [
|
|
42
|
+
"bin/",
|
|
43
|
+
"templates/",
|
|
44
|
+
"README.md",
|
|
45
|
+
"CHANGELOG.md",
|
|
46
|
+
"LICENSE"
|
|
47
|
+
]
|
|
36
48
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'bmad-master'
|
|
3
|
+
description: 'bmad-master agent'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
|
|
7
|
+
|
|
8
|
+
<agent-activation CRITICAL="TRUE">
|
|
9
|
+
1. LOAD the FULL agent file from {project-root}/_bmad/core/agents/bmad-master.md
|
|
10
|
+
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
|
|
11
|
+
3. FOLLOW every step in the <activation> section precisely
|
|
12
|
+
4. DISPLAY the welcome/greeting as instructed
|
|
13
|
+
5. PRESENT the numbered menu
|
|
14
|
+
6. WAIT for user input before proceeding
|
|
15
|
+
</agent-activation>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'agent-builder'
|
|
3
|
+
description: 'agent-builder agent'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
|
|
7
|
+
|
|
8
|
+
<agent-activation CRITICAL="TRUE">
|
|
9
|
+
1. LOAD the FULL agent file from {project-root}/_bmad/bmb/agents/agent-builder.md
|
|
10
|
+
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
|
|
11
|
+
3. FOLLOW every step in the <activation> section precisely
|
|
12
|
+
4. DISPLAY the welcome/greeting as instructed
|
|
13
|
+
5. PRESENT the numbered menu
|
|
14
|
+
6. WAIT for user input before proceeding
|
|
15
|
+
</agent-activation>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'module-builder'
|
|
3
|
+
description: 'module-builder agent'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
|
|
7
|
+
|
|
8
|
+
<agent-activation CRITICAL="TRUE">
|
|
9
|
+
1. LOAD the FULL agent file from {project-root}/_bmad/bmb/agents/module-builder.md
|
|
10
|
+
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
|
|
11
|
+
3. FOLLOW every step in the <activation> section precisely
|
|
12
|
+
4. DISPLAY the welcome/greeting as instructed
|
|
13
|
+
5. PRESENT the numbered menu
|
|
14
|
+
6. WAIT for user input before proceeding
|
|
15
|
+
</agent-activation>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'workflow-builder'
|
|
3
|
+
description: 'workflow-builder agent'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
|
|
7
|
+
|
|
8
|
+
<agent-activation CRITICAL="TRUE">
|
|
9
|
+
1. LOAD the FULL agent file from {project-root}/_bmad/bmb/agents/workflow-builder.md
|
|
10
|
+
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
|
|
11
|
+
3. FOLLOW every step in the <activation> section precisely
|
|
12
|
+
4. DISPLAY the welcome/greeting as instructed
|
|
13
|
+
5. PRESENT the numbered menu
|
|
14
|
+
6. WAIT for user input before proceeding
|
|
15
|
+
</agent-activation>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: 'analyst'
|
|
3
|
+
description: 'analyst agent'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
|
|
7
|
+
|
|
8
|
+
<agent-activation CRITICAL="TRUE">
|
|
9
|
+
1. LOAD the FULL agent file from {project-root}/_bmad/bmm/agents/analyst.md
|
|
10
|
+
2. READ its entire contents - this contains the complete agent persona, menu, and instructions
|
|
11
|
+
3. FOLLOW every step in the <activation> section precisely
|
|
12
|
+
4. DISPLAY the welcome/greeting as instructed
|
|
13
|
+
5. PRESENT the numbered menu
|
|
14
|
+
6. WAIT for user input before proceeding
|
|
15
|
+
</agent-activation>
|