create-byan-agent 1.2.6 → 2.0.0-alpha.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +196 -388
  2. package/LICENSE +21 -21
  3. package/README.md +420 -1264
  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-v2.js +492 -0
  7. package/bin/create-byan-agent.js +296 -561
  8. package/package.json +68 -64
  9. package/templates/.github/agents/bmad-agent-bmad-master.md +15 -15
  10. package/templates/.github/agents/bmad-agent-bmb-agent-builder.md +15 -15
  11. package/templates/.github/agents/bmad-agent-bmb-module-builder.md +15 -15
  12. package/templates/.github/agents/bmad-agent-bmb-workflow-builder.md +15 -15
  13. package/templates/.github/agents/bmad-agent-bmm-analyst.md +15 -15
  14. package/templates/.github/agents/bmad-agent-bmm-architect.md +15 -15
  15. package/templates/.github/agents/bmad-agent-bmm-dev.md +15 -15
  16. package/templates/.github/agents/bmad-agent-bmm-pm.md +15 -15
  17. package/templates/.github/agents/bmad-agent-bmm-quick-flow-solo-dev.md +15 -15
  18. package/templates/.github/agents/bmad-agent-bmm-quinn.md +15 -15
  19. package/templates/.github/agents/bmad-agent-bmm-sm.md +15 -15
  20. package/templates/.github/agents/bmad-agent-bmm-tech-writer.md +15 -15
  21. package/templates/.github/agents/bmad-agent-bmm-ux-designer.md +15 -15
  22. package/templates/.github/agents/bmad-agent-byan-test.md +32 -32
  23. package/templates/.github/agents/bmad-agent-byan.md +224 -224
  24. package/templates/.github/agents/bmad-agent-carmack.md +18 -18
  25. package/templates/.github/agents/bmad-agent-cis-brainstorming-coach.md +15 -15
  26. package/templates/.github/agents/bmad-agent-cis-creative-problem-solver.md +15 -15
  27. package/templates/.github/agents/bmad-agent-cis-design-thinking-coach.md +15 -15
  28. package/templates/.github/agents/bmad-agent-cis-innovation-strategist.md +15 -15
  29. package/templates/.github/agents/bmad-agent-cis-presentation-master.md +15 -15
  30. package/templates/.github/agents/bmad-agent-cis-storyteller.md +15 -15
  31. package/templates/.github/agents/bmad-agent-marc.md +48 -48
  32. package/templates/.github/agents/bmad-agent-patnote.md +48 -48
  33. package/templates/.github/agents/bmad-agent-rachid.md +47 -47
  34. package/templates/.github/agents/bmad-agent-tea-tea.md +15 -15
  35. package/templates/.github/agents/bmad-agent-test-dynamic.md +21 -21
  36. package/templates/.github/agents/franck.md +379 -379
  37. package/templates/_bmad/bmb/agents/agent-builder.md +59 -59
  38. package/templates/_bmad/bmb/agents/byan-test.md +116 -116
  39. package/templates/_bmad/bmb/agents/byan.md +215 -215
  40. package/templates/_bmad/bmb/agents/marc.md +303 -303
  41. package/templates/_bmad/bmb/agents/module-builder.md +60 -60
  42. package/templates/_bmad/bmb/agents/patnote.md +495 -495
  43. package/templates/_bmad/bmb/agents/rachid.md +184 -184
  44. package/templates/_bmad/bmb/agents/workflow-builder.md +61 -61
  45. package/templates/_bmad/bmb/workflows/byan/data/mantras.yaml +272 -272
  46. package/templates/_bmad/bmb/workflows/byan/data/templates.yaml +59 -59
  47. package/templates/_bmad/bmb/workflows/byan/delete-agent-workflow.md +657 -657
  48. package/templates/_bmad/bmb/workflows/byan/edit-agent-workflow.md +688 -688
  49. package/templates/_bmad/bmb/workflows/byan/interview-workflow.md +753 -753
  50. package/templates/_bmad/bmb/workflows/byan/quick-create-workflow.md +450 -450
  51. package/templates/_bmad/bmb/workflows/byan/templates/base-agent-template.md +79 -79
  52. package/templates/_bmad/bmb/workflows/byan/validate-agent-workflow.md +676 -676
  53. package/templates/_bmad/core/agents/carmack.md +238 -238
  54. package/lib/errors.js +0 -61
  55. package/lib/exit-codes.js +0 -54
  56. package/lib/platforms/claude-code.js +0 -113
  57. package/lib/platforms/codex.js +0 -92
  58. package/lib/platforms/copilot-cli.js +0 -123
  59. package/lib/platforms/index.js +0 -14
  60. package/lib/platforms/vscode.js +0 -51
  61. package/lib/utils/config-loader.js +0 -79
  62. package/lib/utils/file-utils.js +0 -117
  63. package/lib/utils/git-detector.js +0 -35
  64. package/lib/utils/logger.js +0 -64
  65. package/lib/utils/node-detector.js +0 -58
  66. package/lib/utils/os-detector.js +0 -74
  67. package/lib/utils/yaml-utils.js +0 -87
  68. package/lib/yanstaller/backuper.js +0 -308
  69. package/lib/yanstaller/detector.js +0 -141
  70. package/lib/yanstaller/index.js +0 -93
  71. package/lib/yanstaller/installer.js +0 -226
  72. package/lib/yanstaller/interviewer.js +0 -301
  73. package/lib/yanstaller/recommender.js +0 -308
  74. package/lib/yanstaller/troubleshooter.js +0 -498
  75. package/lib/yanstaller/validator.js +0 -602
  76. package/lib/yanstaller/wizard.js +0 -229
  77. package/templates/.github/agents/expert-merise-agile.md +0 -1
@@ -1,308 +0,0 @@
1
- /**
2
- * RECOMMENDER Module
3
- *
4
- * Analyzes project and recommends optimal BYAN configuration.
5
- *
6
- * Phase 2: 24h development
7
- *
8
- * @module yanstaller/recommender
9
- */
10
-
11
- const path = require('path');
12
- const fileUtils = require('../utils/file-utils');
13
-
14
- /**
15
- * @typedef {Object} Recommendation
16
- * @property {string} mode - 'full' | 'minimal' | 'custom'
17
- * @property {string[]} agents - Recommended agent names
18
- * @property {string} reason - Why this recommendation
19
- * @property {string} projectType - 'frontend' | 'backend' | 'fullstack' | 'library' | 'unknown'
20
- */
21
-
22
- /**
23
- * Analyze project and recommend configuration
24
- *
25
- * @param {Object} options - Options object
26
- * @param {string} [options.projectRoot] - Project root path
27
- * @param {import('./detector').DetectionResult} options.detection - Detection results
28
- * @returns {Promise<Recommendation>}
29
- */
30
- async function recommend(options) {
31
- // Support both old API (direct detection) and new API (options object)
32
- const detection = options.detection || options;
33
- const projectRoot = options.projectRoot || process.cwd();
34
-
35
- // 1. Analyze project type
36
- let projectType = 'unknown';
37
- let framework = 'unknown';
38
-
39
- const packageJsonPath = path.join(projectRoot, 'package.json');
40
- if (await fileUtils.exists(packageJsonPath)) {
41
- const analysis = await analyzePackageJson(packageJsonPath);
42
- projectType = detectProjectType(analysis);
43
- framework = analysis.framework;
44
- }
45
-
46
- // 2. Recommend agents based on type + platforms
47
- const platforms = detection.platforms || [];
48
- const agents = getRecommendedAgents(projectType, platforms);
49
-
50
- // 3. Determine mode
51
- const mode = agents.length > 10 ? 'full' : 'minimal';
52
-
53
- // 4. Generate rationale
54
- const reason = generateRationale(projectType, framework, agents, detection);
55
-
56
- return {
57
- mode,
58
- agents,
59
- reason,
60
- projectType
61
- };
62
- }
63
-
64
- /**
65
- * Analyze package.json to detect stack
66
- *
67
- * @param {string} packageJsonPath - Path to package.json
68
- * @returns {Promise<{isFrontend: boolean, isBackend: boolean, framework: string, deps: Object}>}
69
- */
70
- async function analyzePackageJson(packageJsonPath) {
71
- try {
72
- const pkg = await fileUtils.readJSON(packageJsonPath);
73
- const deps = { ...pkg.dependencies, ...pkg.devDependencies };
74
-
75
- const isFrontend = hasAny(deps, [
76
- 'react', 'react-dom',
77
- 'vue', '@vue/cli',
78
- 'angular', '@angular/core',
79
- 'svelte', '@sveltejs/kit',
80
- 'next', 'nuxt',
81
- 'gatsby', 'astro'
82
- ]);
83
-
84
- const isBackend = hasAny(deps, [
85
- 'express', 'fastify', 'koa', 'hapi',
86
- 'nestjs', '@nestjs/core',
87
- 'apollo-server', 'graphql',
88
- 'prisma', 'typeorm', 'sequelize',
89
- 'mongoose'
90
- ]);
91
-
92
- const framework = detectFramework(deps);
93
-
94
- return {
95
- isFrontend,
96
- isBackend,
97
- framework,
98
- deps
99
- };
100
- } catch (error) {
101
- // File read error or invalid JSON
102
- return {
103
- isFrontend: false,
104
- isBackend: false,
105
- framework: 'unknown',
106
- deps: {}
107
- };
108
- }
109
- }
110
-
111
- /**
112
- * Detect project type from analysis
113
- *
114
- * @param {Object} analysis - Package.json analysis
115
- * @returns {string} - 'frontend' | 'backend' | 'fullstack' | 'library' | 'unknown'
116
- */
117
- function detectProjectType(analysis) {
118
- if (analysis.isFrontend && analysis.isBackend) {
119
- return 'fullstack';
120
- }
121
- if (analysis.isFrontend) {
122
- return 'frontend';
123
- }
124
- if (analysis.isBackend) {
125
- return 'backend';
126
- }
127
-
128
- // Check if it's a library (no UI dependencies, has build tools)
129
- if (hasAny(analysis.deps, ['typescript', 'rollup', 'webpack', 'vite', 'tsup'])) {
130
- return 'library';
131
- }
132
-
133
- return 'unknown';
134
- }
135
-
136
- /**
137
- * Detect framework from dependencies
138
- *
139
- * @param {Object} deps - Package dependencies
140
- * @returns {string} - Framework name or 'unknown'
141
- */
142
- function detectFramework(deps) {
143
- const frameworks = {
144
- 'react': 'React',
145
- 'react-dom': 'React',
146
- 'next': 'Next.js',
147
- 'vue': 'Vue',
148
- '@vue/cli': 'Vue',
149
- 'nuxt': 'Nuxt',
150
- 'angular': 'Angular',
151
- '@angular/core': 'Angular',
152
- 'svelte': 'Svelte',
153
- '@sveltejs/kit': 'SvelteKit',
154
- 'express': 'Express',
155
- 'fastify': 'Fastify',
156
- 'nestjs': 'NestJS',
157
- '@nestjs/core': 'NestJS',
158
- 'gatsby': 'Gatsby',
159
- 'astro': 'Astro'
160
- };
161
-
162
- for (const [dep, framework] of Object.entries(frameworks)) {
163
- if (deps[dep]) {
164
- return framework;
165
- }
166
- }
167
-
168
- return 'unknown';
169
- }
170
-
171
- /**
172
- * Get recommended agents based on project type
173
- *
174
- * @param {string} projectType - Project type
175
- * @param {Array} platforms - Detected platforms (array of platform objects)
176
- * @returns {string[]} - Agent names
177
- */
178
- function getRecommendedAgents(projectType, platforms = []) {
179
- // Only recommend agents that exist in templates/_bmad/
180
- // Available: byan, byan-test, rachid, patnote, marc, agent-builder, module-builder, workflow-builder
181
- const availableAgents = ['byan', 'byan-test', 'rachid', 'patnote', 'marc', 'agent-builder', 'module-builder', 'workflow-builder'];
182
-
183
- const baseAgents = ['byan', 'rachid', 'patnote'];
184
-
185
- // Add MARC if Copilot CLI detected
186
- if (platforms && platforms.some(p => p.name === 'copilot-cli' && p.detected)) {
187
- baseAgents.push('marc');
188
- }
189
-
190
- // Simple recommendations based on available agents only
191
- const recommendations = {
192
- frontend: [...baseAgents],
193
- backend: [...baseAgents],
194
- fullstack: [...baseAgents],
195
- library: [...baseAgents],
196
- unknown: baseAgents
197
- };
198
-
199
- return recommendations[projectType] || baseAgents;
200
- }
201
-
202
- /**
203
- * Generate rationale for recommendation
204
- *
205
- * @param {string} projectType - Project type
206
- * @param {string} framework - Framework name
207
- * @param {string[]} agents - Recommended agents
208
- * @param {Object} detection - Detection results
209
- * @returns {string} - Rationale text
210
- */
211
- function generateRationale(projectType, framework, agents, detection) {
212
- const reasons = [];
213
-
214
- // Project type specific
215
- switch (projectType) {
216
- case 'frontend':
217
- reasons.push(`Frontend project${framework !== 'unknown' ? ` (${framework})` : ''} benefits from UX design guidance`);
218
- break;
219
- case 'backend':
220
- reasons.push(`Backend project${framework !== 'unknown' ? ` (${framework})` : ''} benefits from architecture patterns`);
221
- break;
222
- case 'fullstack':
223
- reasons.push(`Fullstack project${framework !== 'unknown' ? ` (${framework})` : ''} needs both frontend and backend expertise`);
224
- break;
225
- case 'library':
226
- reasons.push('Library project benefits from documentation and testing focus');
227
- break;
228
- default:
229
- reasons.push('Default configuration for general projects');
230
- }
231
-
232
- // Platform specific
233
- const copilotDetected = detection.platforms.some(p => p.name === 'copilot-cli' && p.detected);
234
- if (copilotDetected) {
235
- reasons.push('MARC agent included for Copilot CLI integration');
236
- }
237
-
238
- // Agent specific
239
- if (agents.includes('dev')) {
240
- reasons.push('DEV agent accelerates implementation with code generation');
241
- }
242
- if (agents.includes('quinn')) {
243
- reasons.push('QUINN ensures test coverage and quality assurance');
244
- }
245
- if (agents.includes('architect')) {
246
- reasons.push('ARCHITECT provides design patterns and system architecture');
247
- }
248
-
249
- return reasons.join('. ') + '.';
250
- }
251
-
252
- /**
253
- * Check if any of the keys exist in object
254
- *
255
- * @param {Object} obj - Object to check
256
- * @param {string[]} keys - Keys to look for
257
- * @returns {boolean}
258
- */
259
- function hasAny(obj, keys) {
260
- return keys.some(key => obj[key]);
261
- }
262
-
263
- /**
264
- * Get agent list for installation mode
265
- *
266
- * @param {string} mode - 'full' | 'minimal' | 'custom'
267
- * @param {string[]} [customAgents] - Custom agent selection
268
- * @returns {string[]}
269
- */
270
- function getAgentList(mode, customAgents = []) {
271
- const MINIMAL_AGENTS = ['byan', 'rachid', 'marc', 'patnote', 'carmack'];
272
- const FULL_AGENTS = [
273
- // Core (5)
274
- 'byan', 'rachid', 'marc', 'patnote', 'carmack',
275
- // BMM (9)
276
- 'analyst', 'pm', 'architect', 'dev', 'sm', 'quinn', 'ux-designer', 'tech-writer', 'quick-flow-solo-dev',
277
- // BMB (3)
278
- 'agent-builder', 'module-builder', 'workflow-builder',
279
- // TEA (1)
280
- 'tea',
281
- // CIS (6)
282
- 'brainstorming-coach', 'creative-problem-solver', 'design-thinking-coach',
283
- 'innovation-strategist', 'presentation-master', 'storyteller',
284
- // BYAN Test (1)
285
- 'byan-test'
286
- ];
287
-
288
- switch (mode) {
289
- case 'full':
290
- return FULL_AGENTS;
291
- case 'minimal':
292
- return MINIMAL_AGENTS;
293
- case 'custom':
294
- return customAgents;
295
- default:
296
- return MINIMAL_AGENTS;
297
- }
298
- }
299
-
300
- module.exports = {
301
- recommend,
302
- analyzePackageJson,
303
- getAgentList,
304
- detectProjectType,
305
- detectFramework,
306
- getRecommendedAgents,
307
- generateRationale
308
- };