create-byan-agent 1.2.2 → 1.2.3

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 CHANGED
@@ -5,14 +5,109 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.2.3] - 2026-02-03
9
+
10
+ ### Added
11
+ - **E2E Test Suite** - Automated end-to-end testing before npm publish
12
+ - Tests complete installation flow (7 steps)
13
+ - Validates directory structure, agent files, config, platform stubs
14
+ - Smoke tests for all 8 YANSTALLER modules
15
+ - Runs automatically via `prepublishOnly` hook
16
+ - Prevents broken releases (caught 8 bugs before production)
17
+ - Command: `npm run test:e2e`
18
+ - Documentation: TEST-E2E-GUIDE.md
19
+
20
+ ### Fixed
21
+ - **CRITICAL BUG #1**: Fixed recommender crash when platforms is undefined
22
+ - `recommender.recommend()` now properly handles both direct detection object and options wrapper
23
+ - Added default empty array for platforms parameter in `getRecommendedAgents()`
24
+ - Added null-check before calling `.some()` on platforms array
25
+ - Fixed display of detected platforms in CLI (was showing "[object Object]")
26
+
27
+ - **CRITICAL BUG #2**: Fixed backup crash on wrong parameter format
28
+ - Fixed `backuper.backup()` call - now passes bmadPath directly instead of object wrapper
29
+
30
+ - **CRITICAL BUG #3**: Fixed installation result property access
31
+ - Fixed `installResult` property access - uses `agentsInstalled` instead of `installedAgents.length`
32
+ - Removed references to non-existent properties (`createdDirectories`, `generatedStubs`)
33
+ - Added error reporting for installation failures
34
+
35
+ - **CRITICAL BUG #4**: Fixed wizard crash on undefined properties
36
+ - Added null-checks for `config.agents`, `config.targetPlatforms`, `config.platforms`
37
+ - Fixed wizard call to pass correct config object with all required properties
38
+ - Prevents crash when displaying installation summary
39
+
40
+ - **CRITICAL BUG #5**: Fixed agent templates not found
41
+ - Limited recommendations to available agents only (byan, rachid, patnote, marc, etc.)
42
+ - Removed recommendations for non-existent agents (architect, dev, quinn, pm, ux-designer, tech-writer)
43
+ - Prevents installation failures due to missing template files
44
+
45
+ - **CRITICAL BUG #6**: Fixed missing fileUtils.readDir function
46
+ - Added `readDir()` function to file-utils.js
47
+ - Fixes validator crashes when checking workflow directories
48
+ - Properly exports readDir in module.exports
49
+
50
+ - **CRITICAL BUG #7**: Fixed installer config parameter mismatch
51
+ - Fixed installer.install() call to pass `targetPlatforms` instead of `platforms`
52
+ - Config file now created correctly during installation
53
+ - Matches InstallConfig typedef definition
54
+
55
+ - **BUG #8**: Removed carmack from recommendations
56
+ - carmack.md template does not exist in templates/_bmad/
57
+ - Removed from baseAgents to prevent installation failures
58
+ - Updated E2E test to not expect carmack agent
59
+
8
60
  ## [1.2.2] - 2026-02-03
9
61
 
62
+ ### Added
63
+ - **E2E Test Suite** - Automated end-to-end testing before npm publish
64
+ - Tests complete installation flow (7 steps)
65
+ - Validates directory structure, agent files, config, platform stubs
66
+ - Smoke tests for all 8 YANSTALLER modules
67
+ - Runs automatically via `prepublishOnly` hook
68
+ - Prevents broken releases (caught 7 bugs before production)
69
+ - Command: `npm run test:e2e`
70
+ - Documentation: TEST-E2E-GUIDE.md
71
+
10
72
  ### Fixed
11
- - **CRITICAL BUG**: Fixed recommender crash when platforms is undefined
73
+ - **CRITICAL BUG #1**: Fixed recommender crash when platforms is undefined
12
74
  - `recommender.recommend()` now properly handles both direct detection object and options wrapper
13
75
  - Added default empty array for platforms parameter in `getRecommendedAgents()`
14
76
  - Added null-check before calling `.some()` on platforms array
15
77
  - Fixed display of detected platforms in CLI (was showing "[object Object]")
78
+
79
+ - **CRITICAL BUG #2**: Fixed backup crash on wrong parameter format
80
+ - Fixed `backuper.backup()` call - now passes bmadPath directly instead of object wrapper
81
+
82
+ - **CRITICAL BUG #3**: Fixed installation result property access
83
+ - Fixed `installResult` property access - uses `agentsInstalled` instead of `installedAgents.length`
84
+ - Removed references to non-existent properties (`createdDirectories`, `generatedStubs`)
85
+ - Added error reporting for installation failures
86
+
87
+ - **CRITICAL BUG #4**: Fixed wizard crash on undefined properties
88
+ - Added null-checks for `config.agents`, `config.targetPlatforms`, `config.platforms`
89
+ - Fixed wizard call to pass correct config object with all required properties
90
+ - Prevents crash when displaying installation summary
91
+
92
+ - **CRITICAL BUG #5**: Fixed agent templates not found
93
+ - Limited recommendations to available agents only (byan, rachid, patnote, carmack, marc, etc.)
94
+ - Removed recommendations for non-existent agents (architect, dev, quinn, pm, ux-designer, tech-writer)
95
+ - Prevents installation failures due to missing template files
96
+
97
+ - **CRITICAL BUG #6**: Fixed missing fileUtils.readDir function
98
+ - Added `readDir()` function to file-utils.js
99
+ - Fixes validator crashes when checking workflow directories
100
+ - Properly exports readDir in module.exports
101
+
102
+ - **CRITICAL BUG #7**: Fixed installer config parameter mismatch
103
+ - Fixed installer.install() call to pass `targetPlatforms` instead of `platforms`
104
+ - Config file now created correctly during installation
105
+ - Matches InstallConfig typedef definition
106
+
107
+ - **BUG #8**: Removed carmack from recommendations
108
+ - carmack.md template does not exist in templates/_bmad/
109
+ - Removed from baseAgents to prevent installation failures
110
+ - Updated E2E test to not expect carmack agent
16
111
 
17
112
  ## [1.2.1] - 2026-02-03
18
113
 
package/README.md CHANGED
@@ -846,7 +846,7 @@ SOFTWARE.
846
846
 
847
847
  # šŸ—ļø YANSTALLER - Intelligent BYAN Installer
848
848
 
849
- [![Version](https://img.shields.io/badge/version-1.2.2-blue.svg)](https://www.npmjs.com/package/create-byan-agent)
849
+ [![Version](https://img.shields.io/badge/version-1.2.3-blue.svg)](https://www.npmjs.com/package/create-byan-agent)
850
850
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
851
851
  [![Node](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen.svg)](https://nodejs.org)
852
852
  [![Tests](https://img.shields.io/badge/tests-168%20passing-success.svg)](#tests)
@@ -14,7 +14,7 @@ const wizard = require('../lib/yanstaller/wizard');
14
14
  const backuper = require('../lib/yanstaller/backuper');
15
15
  const logger = require('../lib/utils/logger');
16
16
 
17
- const YANSTALLER_VERSION = '1.2.0';
17
+ const YANSTALLER_VERSION = '1.2.3';
18
18
 
19
19
  // ASCII Art Banner
20
20
  const banner = `
@@ -80,7 +80,8 @@ async function main() {
80
80
  if (answers.createBackup) {
81
81
  logger.info(chalk.bold('\nšŸ’¾ STEP 4/7: Backup\n'));
82
82
  try {
83
- const backup = await backuper.backup({ projectRoot });
83
+ const bmadPath = path.join(projectRoot, '_bmad');
84
+ const backup = await backuper.backup(bmadPath);
84
85
  logger.info(`āœ“ Backup created: ${chalk.cyan(backup.backupPath)}`);
85
86
  } catch (error) {
86
87
  logger.warn(`⚠ Backup failed (non-critical): ${error.message}`);
@@ -94,15 +95,16 @@ async function main() {
94
95
  const installResult = await installer.install({
95
96
  projectRoot,
96
97
  agents: answers.agents,
97
- platforms: answers.targetPlatforms,
98
+ targetPlatforms: answers.targetPlatforms,
98
99
  userName: answers.userName,
99
100
  language: answers.language,
100
101
  mode: answers.mode
101
102
  });
102
103
 
103
- logger.info(`āœ“ Installed ${chalk.cyan(installResult.installedAgents.length)} agents`);
104
- logger.info(`āœ“ Created ${chalk.cyan(installResult.createdDirectories)} directories`);
105
- logger.info(`āœ“ Generated ${chalk.cyan(installResult.generatedStubs)} platform stubs`);
104
+ logger.info(`āœ“ Installed ${chalk.cyan(installResult.agentsInstalled)} agents`);
105
+ if (installResult.errors && installResult.errors.length > 0) {
106
+ logger.warn(`⚠ ${installResult.errors.length} installation errors`);
107
+ }
106
108
 
107
109
  // STEP 6: VALIDATE - 10 Automated Checks
108
110
  logger.info(chalk.bold('\nāœ… STEP 6/7: Validation\n'));
@@ -123,8 +125,10 @@ async function main() {
123
125
  // STEP 7: WIZARD - Post-Install Actions
124
126
  logger.info(chalk.bold('\nšŸ§™ STEP 7/7: Post-Install Wizard\n'));
125
127
  await wizard.show({
126
- installedAgents: installResult.installedAgents,
127
- platforms: answers.targetPlatforms,
128
+ agents: answers.agents,
129
+ targetPlatforms: answers.targetPlatforms,
130
+ mode: answers.mode,
131
+ projectRoot,
128
132
  userName: answers.userName,
129
133
  language: answers.language
130
134
  });
@@ -92,6 +92,16 @@ async function writeFile(filePath, content) {
92
92
  await fs.writeFile(filePath, content, 'utf8');
93
93
  }
94
94
 
95
+ /**
96
+ * Read directory contents
97
+ *
98
+ * @param {string} dirPath - Directory path
99
+ * @returns {Promise<string[]>} - Array of file/directory names
100
+ */
101
+ async function readDir(dirPath) {
102
+ return fs.readdir(dirPath);
103
+ }
104
+
95
105
  module.exports = {
96
106
  copy,
97
107
  exists,
@@ -100,5 +110,6 @@ module.exports = {
100
110
  readJSON,
101
111
  writeJSON,
102
112
  readFile,
103
- writeFile
113
+ writeFile,
114
+ readDir
104
115
  };
@@ -176,18 +176,23 @@ function detectFramework(deps) {
176
176
  * @returns {string[]} - Agent names
177
177
  */
178
178
  function getRecommendedAgents(projectType, platforms = []) {
179
- const baseAgents = ['byan', 'rachid', 'patnote', 'carmack'];
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'];
180
184
 
181
185
  // Add MARC if Copilot CLI detected
182
186
  if (platforms && platforms.some(p => p.name === 'copilot-cli' && p.detected)) {
183
187
  baseAgents.push('marc');
184
188
  }
185
189
 
190
+ // Simple recommendations based on available agents only
186
191
  const recommendations = {
187
- frontend: [...baseAgents, 'ux-designer', 'dev', 'quinn'],
188
- backend: [...baseAgents, 'architect', 'dev', 'quinn'],
189
- fullstack: [...baseAgents, 'architect', 'dev', 'ux-designer', 'quinn', 'pm'],
190
- library: [...baseAgents, 'dev', 'tech-writer', 'quinn'],
192
+ frontend: [...baseAgents],
193
+ backend: [...baseAgents],
194
+ fullstack: [...baseAgents],
195
+ library: [...baseAgents],
191
196
  unknown: baseAgents
192
197
  };
193
198
 
@@ -25,12 +25,30 @@ async function show(config) {
25
25
  logger.info(chalk.gray('═'.repeat(60)));
26
26
  logger.info('');
27
27
 
28
- // Show installation summary
28
+ // Show installation summary with null-checks
29
29
  logger.info(chalk.bold('šŸ“Š Installation Summary:'));
30
- logger.info(` • Agents installed: ${chalk.cyan(config.agents.length)}`);
31
- logger.info(` • Platforms: ${chalk.cyan(config.targetPlatforms.join(', '))}`);
32
- logger.info(` • Mode: ${chalk.cyan(config.mode)}`);
33
- logger.info(` • Location: ${chalk.gray(config.projectRoot)}`);
30
+
31
+ if (config && config.agents && Array.isArray(config.agents)) {
32
+ logger.info(` • Agents installed: ${chalk.cyan(config.agents.length)}`);
33
+ } else {
34
+ logger.info(` • Agents installed: ${chalk.cyan(0)}`);
35
+ }
36
+
37
+ if (config && config.targetPlatforms && Array.isArray(config.targetPlatforms)) {
38
+ logger.info(` • Platforms: ${chalk.cyan(config.targetPlatforms.join(', '))}`);
39
+ } else if (config && config.platforms && Array.isArray(config.platforms)) {
40
+ logger.info(` • Platforms: ${chalk.cyan(config.platforms.join(', '))}`);
41
+ } else {
42
+ logger.info(` • Platforms: ${chalk.cyan('none')}`);
43
+ }
44
+
45
+ if (config && config.mode) {
46
+ logger.info(` • Mode: ${chalk.cyan(config.mode)}`);
47
+ }
48
+
49
+ if (config && config.projectRoot) {
50
+ logger.info(` • Location: ${chalk.gray(config.projectRoot)}`);
51
+ }
34
52
  logger.info('');
35
53
 
36
54
  const choices = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-byan-agent",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "NPX installer for BYAN ecosystem - Agent creators (BYAN, BYAN-Test) with deployment (RACHID), integration (MARC), updates (PATNOTE), and optimization (CARMACK)",
5
5
  "bin": {
6
6
  "create-byan-agent": "bin/create-byan-agent.js"
@@ -9,7 +9,10 @@
9
9
  "start": "node bin/create-byan-agent.js",
10
10
  "test": "jest",
11
11
  "test:watch": "jest --watch",
12
- "test:coverage": "jest --coverage"
12
+ "test:coverage": "jest --coverage",
13
+ "test:e2e": "node test-e2e.js",
14
+ "pretest:e2e": "echo '\nšŸ” Running E2E test before publish...\n'",
15
+ "prepublishOnly": "npm run test:e2e"
13
16
  },
14
17
  "keywords": [
15
18
  "byan",