bmad-method 4.37.0-beta.2 → 4.37.0-beta.4

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 (206) hide show
  1. package/README.md +3 -214
  2. package/package.json +26 -63
  3. package/.github/FUNDING.yaml +0 -15
  4. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
  5. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -22
  6. package/.github/workflows/discord.yaml +0 -16
  7. package/.github/workflows/release.yaml +0 -60
  8. package/.releaserc.json +0 -21
  9. package/.vscode/settings.json +0 -44
  10. package/CHANGELOG.md +0 -689
  11. package/CONTRIBUTING.md +0 -209
  12. package/LICENSE +0 -21
  13. package/bmad-core/agent-teams/team-all.yaml +0 -14
  14. package/bmad-core/agent-teams/team-fullstack.yaml +0 -18
  15. package/bmad-core/agent-teams/team-ide-minimal.yaml +0 -10
  16. package/bmad-core/agent-teams/team-no-ui.yaml +0 -13
  17. package/bmad-core/agents/analyst.md +0 -81
  18. package/bmad-core/agents/architect.md +0 -84
  19. package/bmad-core/agents/bmad-master.md +0 -108
  20. package/bmad-core/agents/bmad-orchestrator.md +0 -150
  21. package/bmad-core/agents/dev.md +0 -76
  22. package/bmad-core/agents/pm.md +0 -81
  23. package/bmad-core/agents/po.md +0 -76
  24. package/bmad-core/agents/qa.md +0 -69
  25. package/bmad-core/agents/sm.md +0 -62
  26. package/bmad-core/agents/ux-expert.md +0 -66
  27. package/bmad-core/checklists/architect-checklist.md +0 -443
  28. package/bmad-core/checklists/change-checklist.md +0 -182
  29. package/bmad-core/checklists/pm-checklist.md +0 -375
  30. package/bmad-core/checklists/po-master-checklist.md +0 -441
  31. package/bmad-core/checklists/story-dod-checklist.md +0 -101
  32. package/bmad-core/checklists/story-draft-checklist.md +0 -156
  33. package/bmad-core/core-config.yaml +0 -20
  34. package/bmad-core/data/bmad-kb.md +0 -803
  35. package/bmad-core/data/brainstorming-techniques.md +0 -36
  36. package/bmad-core/data/elicitation-methods.md +0 -134
  37. package/bmad-core/data/technical-preferences.md +0 -3
  38. package/bmad-core/tasks/advanced-elicitation.md +0 -117
  39. package/bmad-core/tasks/brownfield-create-epic.md +0 -160
  40. package/bmad-core/tasks/brownfield-create-story.md +0 -147
  41. package/bmad-core/tasks/correct-course.md +0 -70
  42. package/bmad-core/tasks/create-brownfield-story.md +0 -304
  43. package/bmad-core/tasks/create-deep-research-prompt.md +0 -289
  44. package/bmad-core/tasks/create-next-story.md +0 -112
  45. package/bmad-core/tasks/document-project.md +0 -341
  46. package/bmad-core/tasks/facilitate-brainstorming-session.md +0 -136
  47. package/bmad-core/tasks/generate-ai-frontend-prompt.md +0 -51
  48. package/bmad-core/tasks/index-docs.md +0 -179
  49. package/bmad-core/tasks/kb-mode-interaction.md +0 -75
  50. package/bmad-core/tasks/review-story.md +0 -145
  51. package/bmad-core/tasks/shard-doc.md +0 -187
  52. package/bmad-core/tasks/validate-next-story.md +0 -134
  53. package/bmad-core/templates/architecture-tmpl.yaml +0 -650
  54. package/bmad-core/templates/brainstorming-output-tmpl.yaml +0 -156
  55. package/bmad-core/templates/brownfield-architecture-tmpl.yaml +0 -476
  56. package/bmad-core/templates/brownfield-prd-tmpl.yaml +0 -280
  57. package/bmad-core/templates/competitor-analysis-tmpl.yaml +0 -293
  58. package/bmad-core/templates/front-end-architecture-tmpl.yaml +0 -206
  59. package/bmad-core/templates/front-end-spec-tmpl.yaml +0 -349
  60. package/bmad-core/templates/fullstack-architecture-tmpl.yaml +0 -805
  61. package/bmad-core/templates/market-research-tmpl.yaml +0 -252
  62. package/bmad-core/templates/prd-tmpl.yaml +0 -202
  63. package/bmad-core/templates/project-brief-tmpl.yaml +0 -221
  64. package/bmad-core/templates/story-tmpl.yaml +0 -137
  65. package/bmad-core/workflows/brownfield-fullstack.yaml +0 -297
  66. package/bmad-core/workflows/brownfield-service.yaml +0 -187
  67. package/bmad-core/workflows/brownfield-ui.yaml +0 -197
  68. package/bmad-core/workflows/greenfield-fullstack.yaml +0 -240
  69. package/bmad-core/workflows/greenfield-service.yaml +0 -206
  70. package/bmad-core/workflows/greenfield-ui.yaml +0 -235
  71. package/common/tasks/create-doc.md +0 -101
  72. package/common/tasks/execute-checklist.md +0 -93
  73. package/common/utils/bmad-doc-template.md +0 -325
  74. package/common/utils/workflow-management.md +0 -69
  75. package/dist/agents/analyst.txt +0 -2882
  76. package/dist/agents/architect.txt +0 -3543
  77. package/dist/agents/bmad-master.txt +0 -8756
  78. package/dist/agents/bmad-orchestrator.txt +0 -1490
  79. package/dist/agents/dev.txt +0 -428
  80. package/dist/agents/pm.txt +0 -2229
  81. package/dist/agents/po.txt +0 -1364
  82. package/dist/agents/qa.txt +0 -386
  83. package/dist/agents/sm.txt +0 -668
  84. package/dist/agents/ux-expert.txt +0 -701
  85. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +0 -2408
  86. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +0 -1631
  87. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +0 -822
  88. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +0 -10989
  89. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt +0 -4047
  90. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt +0 -3744
  91. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.txt +0 -465
  92. package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.txt +0 -990
  93. package/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt +0 -15467
  94. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +0 -2077
  95. package/dist/teams/team-all.txt +0 -11062
  96. package/dist/teams/team-fullstack.txt +0 -10392
  97. package/dist/teams/team-ide-minimal.txt +0 -3507
  98. package/dist/teams/team-no-ui.txt +0 -8951
  99. package/docs/GUIDING-PRINCIPLES.md +0 -91
  100. package/docs/core-architecture.md +0 -219
  101. package/docs/enhanced-ide-development-workflow.md +0 -43
  102. package/docs/expansion-packs.md +0 -280
  103. package/docs/how-to-contribute-with-pull-requests.md +0 -158
  104. package/docs/user-guide.md +0 -251
  105. package/docs/versioning-and-releases.md +0 -77
  106. package/docs/versions.md +0 -48
  107. package/docs/working-in-the-brownfield.md +0 -364
  108. package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/Complete AI Agent System - Flowchart.svg +0 -102
  109. package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.1 Google Cloud Project Setup/1.1.1 - Initial Project Configuration - bash copy.txt +0 -13
  110. package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.1 Google Cloud Project Setup/1.1.1 - Initial Project Configuration - bash.txt +0 -13
  111. package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.2 Agent Development Kit Installation/1.2.2 - Basic Project Structure - txt.txt +0 -25
  112. package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.3 Core Configuration Files/1.3.1 - settings.py +0 -34
  113. package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.3 Core Configuration Files/1.3.2 - main.py - Base Application.py +0 -70
  114. package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/PART 1 - Google Cloud Vertex AI Setup Documentation/1.4 Deployment Configuration/1.4.2 - cloudbuild.yaml +0 -26
  115. package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/README.md +0 -109
  116. package/expansion-packs/README.md +0 -3
  117. package/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml +0 -13
  118. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +0 -71
  119. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +0 -78
  120. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +0 -64
  121. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-design-checklist.md +0 -201
  122. package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md +0 -160
  123. package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +0 -8
  124. package/expansion-packs/bmad-2d-phaser-game-dev/data/bmad-kb.md +0 -254
  125. package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +0 -651
  126. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md +0 -111
  127. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/create-game-story.md +0 -216
  128. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md +0 -308
  129. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +0 -613
  130. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +0 -356
  131. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +0 -343
  132. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +0 -253
  133. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +0 -484
  134. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml +0 -183
  135. package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml +0 -175
  136. package/expansion-packs/bmad-2d-unity-game-dev/agent-teams/unity-2d-game-team.yaml +0 -14
  137. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.md +0 -80
  138. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.md +0 -77
  139. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.md +0 -78
  140. package/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.md +0 -65
  141. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-architect-checklist.md +0 -396
  142. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-change-checklist.md +0 -203
  143. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-design-checklist.md +0 -201
  144. package/expansion-packs/bmad-2d-unity-game-dev/checklists/game-story-dod-checklist.md +0 -132
  145. package/expansion-packs/bmad-2d-unity-game-dev/config.yaml +0 -6
  146. package/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md +0 -776
  147. package/expansion-packs/bmad-2d-unity-game-dev/data/development-guidelines.md +0 -590
  148. package/expansion-packs/bmad-2d-unity-game-dev/tasks/advanced-elicitation.md +0 -111
  149. package/expansion-packs/bmad-2d-unity-game-dev/tasks/correct-course-game.md +0 -151
  150. package/expansion-packs/bmad-2d-unity-game-dev/tasks/create-game-story.md +0 -184
  151. package/expansion-packs/bmad-2d-unity-game-dev/tasks/game-design-brainstorming.md +0 -308
  152. package/expansion-packs/bmad-2d-unity-game-dev/tasks/validate-game-story.md +0 -200
  153. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-architecture-tmpl.yaml +0 -1030
  154. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-brief-tmpl.yaml +0 -356
  155. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml +0 -705
  156. package/expansion-packs/bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml +0 -256
  157. package/expansion-packs/bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml +0 -484
  158. package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-dev-greenfield.yaml +0 -183
  159. package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-prototype.yaml +0 -175
  160. package/expansion-packs/bmad-infrastructure-devops/README.md +0 -147
  161. package/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.md +0 -71
  162. package/expansion-packs/bmad-infrastructure-devops/checklists/infrastructure-checklist.md +0 -484
  163. package/expansion-packs/bmad-infrastructure-devops/config.yaml +0 -9
  164. package/expansion-packs/bmad-infrastructure-devops/data/bmad-kb.md +0 -308
  165. package/expansion-packs/bmad-infrastructure-devops/tasks/review-infrastructure.md +0 -160
  166. package/expansion-packs/bmad-infrastructure-devops/tasks/validate-infrastructure.md +0 -154
  167. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +0 -424
  168. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +0 -629
  169. package/tools/bmad-npx-wrapper.js +0 -39
  170. package/tools/builders/web-builder.js +0 -681
  171. package/tools/bump-all-versions.js +0 -106
  172. package/tools/bump-expansion-version.js +0 -83
  173. package/tools/cli.js +0 -154
  174. package/tools/flattener/aggregate.js +0 -76
  175. package/tools/flattener/binary.js +0 -53
  176. package/tools/flattener/discovery.js +0 -70
  177. package/tools/flattener/files.js +0 -35
  178. package/tools/flattener/ignoreRules.js +0 -176
  179. package/tools/flattener/main.js +0 -217
  180. package/tools/flattener/projectRoot.js +0 -45
  181. package/tools/flattener/prompts.js +0 -44
  182. package/tools/flattener/stats.js +0 -30
  183. package/tools/flattener/xml.js +0 -86
  184. package/tools/installer/README.md +0 -8
  185. package/tools/installer/package.json +0 -44
  186. package/tools/lib/dependency-resolver.js +0 -179
  187. package/tools/lib/yaml-utils.js +0 -29
  188. package/tools/md-assets/web-agent-startup-instructions.md +0 -39
  189. package/tools/semantic-release-sync-installer.js +0 -30
  190. package/tools/shared/bannerArt.js +0 -105
  191. package/tools/sync-installer-version.js +0 -34
  192. package/tools/update-expansion-version.js +0 -54
  193. package/tools/upgraders/v3-to-v4-upgrader.js +0 -763
  194. package/tools/version-bump.js +0 -79
  195. package/tools/yaml-format.js +0 -240
  196. /package/{tools/installer/bin → bin}/bmad.js +0 -0
  197. /package/{tools/installer/config → config}/ide-agent-config.yaml +0 -0
  198. /package/{tools/installer/config → config}/install.config.yaml +0 -0
  199. /package/{tools/installer/lib → lib}/config-loader.js +0 -0
  200. /package/{tools/installer/lib → lib}/file-manager.js +0 -0
  201. /package/{tools/installer/lib → lib}/ide-base-setup.js +0 -0
  202. /package/{tools/installer/lib → lib}/ide-setup.js +0 -0
  203. /package/{tools/installer/lib → lib}/installer.js +0 -0
  204. /package/{tools/installer/lib → lib}/memory-profiler.js +0 -0
  205. /package/{tools/installer/lib → lib}/module-manager.js +0 -0
  206. /package/{tools/installer/lib → lib}/resource-locator.js +0 -0
@@ -1,106 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
- const yaml = require('js-yaml');
6
-
7
- const args = process.argv.slice(2);
8
- const bumpType = args[0] || 'minor'; // default to minor
9
-
10
- if (!['major', 'minor', 'patch'].includes(bumpType)) {
11
- console.log('Usage: node bump-all-versions.js [major|minor|patch]');
12
- console.log('Default: minor');
13
- process.exit(1);
14
- }
15
-
16
- function bumpVersion(currentVersion, type) {
17
- const [major, minor, patch] = currentVersion.split('.').map(Number);
18
-
19
- switch (type) {
20
- case 'major':
21
- return `${major + 1}.0.0`;
22
- case 'minor':
23
- return `${major}.${minor + 1}.0`;
24
- case 'patch':
25
- return `${major}.${minor}.${patch + 1}`;
26
- default:
27
- return currentVersion;
28
- }
29
- }
30
-
31
- async function bumpAllVersions() {
32
- const updatedItems = [];
33
-
34
- // First, bump the core version (package.json)
35
- const packagePath = path.join(__dirname, '..', 'package.json');
36
- try {
37
- const packageContent = fs.readFileSync(packagePath, 'utf8');
38
- const packageJson = JSON.parse(packageContent);
39
- const oldCoreVersion = packageJson.version || '1.0.0';
40
- const newCoreVersion = bumpVersion(oldCoreVersion, bumpType);
41
-
42
- packageJson.version = newCoreVersion;
43
-
44
- fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2) + '\n');
45
-
46
- updatedItems.push({ type: 'core', name: 'BMad Core', oldVersion: oldCoreVersion, newVersion: newCoreVersion });
47
- console.log(`✓ BMad Core (package.json): ${oldCoreVersion} → ${newCoreVersion}`);
48
- } catch (error) {
49
- console.error(`✗ Failed to update BMad Core: ${error.message}`);
50
- }
51
-
52
- // Then, bump all expansion packs
53
- const expansionPacksDir = path.join(__dirname, '..', 'expansion-packs');
54
-
55
- try {
56
- const entries = fs.readdirSync(expansionPacksDir, { withFileTypes: true });
57
-
58
- for (const entry of entries) {
59
- if (entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'README.md') {
60
- const packId = entry.name;
61
- const configPath = path.join(expansionPacksDir, packId, 'config.yaml');
62
-
63
- if (fs.existsSync(configPath)) {
64
- try {
65
- const configContent = fs.readFileSync(configPath, 'utf8');
66
- const config = yaml.load(configContent);
67
- const oldVersion = config.version || '1.0.0';
68
- const newVersion = bumpVersion(oldVersion, bumpType);
69
-
70
- config.version = newVersion;
71
-
72
- const updatedYaml = yaml.dump(config, { indent: 2 });
73
- fs.writeFileSync(configPath, updatedYaml);
74
-
75
- updatedItems.push({ type: 'expansion', name: packId, oldVersion, newVersion });
76
- console.log(`✓ ${packId}: ${oldVersion} → ${newVersion}`);
77
-
78
- } catch (error) {
79
- console.error(`✗ Failed to update ${packId}: ${error.message}`);
80
- }
81
- }
82
- }
83
- }
84
-
85
- if (updatedItems.length > 0) {
86
- const coreCount = updatedItems.filter(i => i.type === 'core').length;
87
- const expansionCount = updatedItems.filter(i => i.type === 'expansion').length;
88
-
89
- console.log(`\n✓ Successfully bumped ${updatedItems.length} item(s) with ${bumpType} version bump`);
90
- if (coreCount > 0) console.log(` - ${coreCount} core`);
91
- if (expansionCount > 0) console.log(` - ${expansionCount} expansion pack(s)`);
92
-
93
- console.log('\nNext steps:');
94
- console.log('1. Test the changes');
95
- console.log('2. Commit: git add -A && git commit -m "chore: bump all versions (' + bumpType + ')"');
96
- } else {
97
- console.log('No items found to update');
98
- }
99
-
100
- } catch (error) {
101
- console.error('Error reading expansion packs directory:', error.message);
102
- process.exit(1);
103
- }
104
- }
105
-
106
- bumpAllVersions();
@@ -1,83 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Load required modules
4
- const fs = require('fs');
5
- const path = require('path');
6
- const yaml = require('js-yaml');
7
-
8
- // Parse CLI arguments
9
- const args = process.argv.slice(2);
10
- const packId = args[0];
11
- const bumpType = args[1] || 'minor';
12
-
13
- // Validate arguments
14
- if (!packId || args.length > 2) {
15
- console.log('Usage: node bump-expansion-version.js <expansion-pack-id> [major|minor|patch]');
16
- console.log('Default: minor');
17
- console.log('Example: node bump-expansion-version.js bmad-creator-tools patch');
18
- process.exit(1);
19
- }
20
-
21
- if (!['major', 'minor', 'patch'].includes(bumpType)) {
22
- console.error('Error: Bump type must be major, minor, or patch');
23
- process.exit(1);
24
- }
25
-
26
- // Version bump logic
27
- function bumpVersion(currentVersion, type) {
28
- const [major, minor, patch] = currentVersion.split('.').map(Number);
29
-
30
- switch (type) {
31
- case 'major': return `${major + 1}.0.0`;
32
- case 'minor': return `${major}.${minor + 1}.0`;
33
- case 'patch': return `${major}.${minor}.${patch + 1}`;
34
- default: return currentVersion;
35
- }
36
- }
37
-
38
- // Main function to bump version
39
- async function updateVersion() {
40
- const configPath = path.join(__dirname, '..', 'expansion-packs', packId, 'config.yaml');
41
-
42
- // Check if config exists
43
- if (!fs.existsSync(configPath)) {
44
- console.error(`Error: Expansion pack '${packId}' not found`);
45
- console.log('\nAvailable expansion packs:');
46
-
47
- const packsDir = path.join(__dirname, '..', 'expansion-packs');
48
- const entries = fs.readdirSync(packsDir, { withFileTypes: true });
49
-
50
- entries.forEach(entry => {
51
- if (entry.isDirectory() && !entry.name.startsWith('.')) {
52
- console.log(` - ${entry.name}`);
53
- }
54
- });
55
-
56
- process.exit(1);
57
- }
58
-
59
- try {
60
- const configContent = fs.readFileSync(configPath, 'utf8');
61
- const config = yaml.load(configContent);
62
-
63
- const oldVersion = config.version || '1.0.0';
64
- const newVersion = bumpVersion(oldVersion, bumpType);
65
-
66
- config.version = newVersion;
67
-
68
- const updatedYaml = yaml.dump(config, { indent: 2 });
69
- fs.writeFileSync(configPath, updatedYaml);
70
-
71
- console.log(`✓ ${packId}: ${oldVersion} → ${newVersion}`);
72
- console.log(`\n✓ Successfully bumped ${packId} with ${bumpType} version bump`);
73
- console.log('\nNext steps:');
74
- console.log(`1. Test the changes`);
75
- console.log(`2. Commit: git add -A && git commit -m "chore: bump ${packId} version (${bumpType})"`);
76
-
77
- } catch (error) {
78
- console.error('Error updating version:', error.message);
79
- process.exit(1);
80
- }
81
- }
82
-
83
- updateVersion();
package/tools/cli.js DELETED
@@ -1,154 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { Command } = require('commander');
4
- const WebBuilder = require('./builders/web-builder');
5
- const V3ToV4Upgrader = require('./upgraders/v3-to-v4-upgrader');
6
- const IdeSetup = require('./installer/lib/ide-setup');
7
- const path = require('path');
8
-
9
- const program = new Command();
10
-
11
- program
12
- .name('bmad-build')
13
- .description('BMad-Method build tool for creating web bundles')
14
- .version('4.0.0');
15
-
16
- program
17
- .command('build')
18
- .description('Build web bundles for agents and teams')
19
- .option('-a, --agents-only', 'Build only agent bundles')
20
- .option('-t, --teams-only', 'Build only team bundles')
21
- .option('-e, --expansions-only', 'Build only expansion pack bundles')
22
- .option('--no-expansions', 'Skip building expansion packs')
23
- .option('--no-clean', 'Skip cleaning output directories')
24
- .action(async (options) => {
25
- const builder = new WebBuilder({
26
- rootDir: process.cwd()
27
- });
28
-
29
- try {
30
- if (options.clean) {
31
- console.log('Cleaning output directories...');
32
- await builder.cleanOutputDirs();
33
- }
34
-
35
- if (options.expansionsOnly) {
36
- console.log('Building expansion pack bundles...');
37
- await builder.buildAllExpansionPacks({ clean: false });
38
- } else {
39
- if (!options.teamsOnly) {
40
- console.log('Building agent bundles...');
41
- await builder.buildAgents();
42
- }
43
-
44
- if (!options.agentsOnly) {
45
- console.log('Building team bundles...');
46
- await builder.buildTeams();
47
- }
48
-
49
- if (!options.noExpansions) {
50
- console.log('Building expansion pack bundles...');
51
- await builder.buildAllExpansionPacks({ clean: false });
52
- }
53
- }
54
-
55
- console.log('Build completed successfully!');
56
- } catch (error) {
57
- console.error('Build failed:', error.message);
58
- process.exit(1);
59
- }
60
- });
61
-
62
- program
63
- .command('build:expansions')
64
- .description('Build web bundles for all expansion packs')
65
- .option('--expansion <name>', 'Build specific expansion pack only')
66
- .option('--no-clean', 'Skip cleaning output directories')
67
- .action(async (options) => {
68
- const builder = new WebBuilder({
69
- rootDir: process.cwd()
70
- });
71
-
72
- try {
73
- if (options.expansion) {
74
- console.log(`Building expansion pack: ${options.expansion}`);
75
- await builder.buildExpansionPack(options.expansion, { clean: options.clean });
76
- } else {
77
- console.log('Building all expansion packs...');
78
- await builder.buildAllExpansionPacks({ clean: options.clean });
79
- }
80
-
81
- console.log('Expansion pack build completed successfully!');
82
- } catch (error) {
83
- console.error('Expansion pack build failed:', error.message);
84
- process.exit(1);
85
- }
86
- });
87
-
88
- program
89
- .command('list:agents')
90
- .description('List all available agents')
91
- .action(async () => {
92
- const builder = new WebBuilder({ rootDir: process.cwd() });
93
- const agents = await builder.resolver.listAgents();
94
- console.log('Available agents:');
95
- agents.forEach(agent => console.log(` - ${agent}`));
96
- process.exit(0);
97
- });
98
-
99
- program
100
- .command('list:expansions')
101
- .description('List all available expansion packs')
102
- .action(async () => {
103
- const builder = new WebBuilder({ rootDir: process.cwd() });
104
- const expansions = await builder.listExpansionPacks();
105
- console.log('Available expansion packs:');
106
- expansions.forEach(expansion => console.log(` - ${expansion}`));
107
- process.exit(0);
108
- });
109
-
110
- program
111
- .command('validate')
112
- .description('Validate agent and team configurations')
113
- .action(async () => {
114
- const builder = new WebBuilder({ rootDir: process.cwd() });
115
- try {
116
- // Validate by attempting to build all agents and teams
117
- const agents = await builder.resolver.listAgents();
118
- const teams = await builder.resolver.listTeams();
119
-
120
- console.log('Validating agents...');
121
- for (const agent of agents) {
122
- await builder.resolver.resolveAgentDependencies(agent);
123
- console.log(` ✓ ${agent}`);
124
- }
125
-
126
- console.log('\nValidating teams...');
127
- for (const team of teams) {
128
- await builder.resolver.resolveTeamDependencies(team);
129
- console.log(` ✓ ${team}`);
130
- }
131
-
132
- console.log('\nAll configurations are valid!');
133
- } catch (error) {
134
- console.error('Validation failed:', error.message);
135
- process.exit(1);
136
- }
137
- });
138
-
139
- program
140
- .command('upgrade')
141
- .description('Upgrade a BMad-Method V3 project to V4')
142
- .option('-p, --project <path>', 'Path to V3 project (defaults to current directory)')
143
- .option('--dry-run', 'Show what would be changed without making changes')
144
- .option('--no-backup', 'Skip creating backup (not recommended)')
145
- .action(async (options) => {
146
- const upgrader = new V3ToV4Upgrader();
147
- await upgrader.upgrade({
148
- projectPath: options.project,
149
- dryRun: options.dryRun,
150
- backup: options.backup
151
- });
152
- });
153
-
154
- program.parse();
@@ -1,76 +0,0 @@
1
- const fs = require("fs-extra");
2
- const path = require("node:path");
3
- const os = require("node:os");
4
- const { isBinaryFile } = require("./binary.js");
5
-
6
- /**
7
- * Aggregate file contents with bounded concurrency.
8
- * Returns text files, binary files (with size), and errors.
9
- * @param {string[]} files absolute file paths
10
- * @param {string} rootDir
11
- * @param {{ text?: string, warn?: (msg: string) => void } | null} spinner
12
- */
13
- async function aggregateFileContents(files, rootDir, spinner = null) {
14
- const results = {
15
- textFiles: [],
16
- binaryFiles: [],
17
- errors: [],
18
- totalFiles: files.length,
19
- processedFiles: 0,
20
- };
21
-
22
- // Automatic concurrency selection based on CPU count and workload size.
23
- // - Base on 2x logical CPUs, clamped to [2, 64]
24
- // - For very small workloads, avoid excessive parallelism
25
- const cpuCount = (os.cpus && Array.isArray(os.cpus()) ? os.cpus().length : (os.cpus?.length || 4));
26
- let concurrency = Math.min(64, Math.max(2, (Number(cpuCount) || 4) * 2));
27
- if (files.length > 0 && files.length < concurrency) {
28
- concurrency = Math.max(1, Math.min(concurrency, Math.ceil(files.length / 2)));
29
- }
30
-
31
- async function processOne(filePath) {
32
- try {
33
- const relativePath = path.relative(rootDir, filePath);
34
- if (spinner) {
35
- spinner.text = `Processing: ${relativePath} (${results.processedFiles + 1}/${results.totalFiles})`;
36
- }
37
-
38
- const binary = await isBinaryFile(filePath);
39
- if (binary) {
40
- const size = (await fs.stat(filePath)).size;
41
- results.binaryFiles.push({ path: relativePath, absolutePath: filePath, size });
42
- } else {
43
- const content = await fs.readFile(filePath, "utf8");
44
- results.textFiles.push({
45
- path: relativePath,
46
- absolutePath: filePath,
47
- content,
48
- size: content.length,
49
- lines: content.split("\n").length,
50
- });
51
- }
52
- } catch (error) {
53
- const relativePath = path.relative(rootDir, filePath);
54
- const errorInfo = { path: relativePath, absolutePath: filePath, error: error.message };
55
- results.errors.push(errorInfo);
56
- if (spinner) {
57
- spinner.warn(`Warning: Could not read file ${relativePath}: ${error.message}`);
58
- } else {
59
- console.warn(`Warning: Could not read file ${relativePath}: ${error.message}`);
60
- }
61
- } finally {
62
- results.processedFiles++;
63
- }
64
- }
65
-
66
- for (let i = 0; i < files.length; i += concurrency) {
67
- const slice = files.slice(i, i + concurrency);
68
- await Promise.all(slice.map(processOne));
69
- }
70
-
71
- return results;
72
- }
73
-
74
- module.exports = {
75
- aggregateFileContents,
76
- };
@@ -1,53 +0,0 @@
1
- const fsp = require("node:fs/promises");
2
- const path = require("node:path");
3
- const { Buffer } = require("node:buffer");
4
-
5
- /**
6
- * Efficiently determine if a file is binary without reading the whole file.
7
- * - Fast path by extension for common binaries
8
- * - Otherwise read a small prefix and check for NUL bytes
9
- * @param {string} filePath
10
- * @returns {Promise<boolean>}
11
- */
12
- async function isBinaryFile(filePath) {
13
- try {
14
- const stats = await fsp.stat(filePath);
15
- if (stats.isDirectory()) {
16
- throw new Error("EISDIR: illegal operation on a directory");
17
- }
18
-
19
- const binaryExtensions = new Set([
20
- ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".ico", ".svg",
21
- ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx",
22
- ".zip", ".tar", ".gz", ".rar", ".7z",
23
- ".exe", ".dll", ".so", ".dylib",
24
- ".mp3", ".mp4", ".avi", ".mov", ".wav",
25
- ".ttf", ".otf", ".woff", ".woff2",
26
- ".bin", ".dat", ".db", ".sqlite",
27
- ]);
28
-
29
- const ext = path.extname(filePath).toLowerCase();
30
- if (binaryExtensions.has(ext)) return true;
31
- if (stats.size === 0) return false;
32
-
33
- const sampleSize = Math.min(4096, stats.size);
34
- const fd = await fsp.open(filePath, "r");
35
- try {
36
- const buffer = Buffer.allocUnsafe(sampleSize);
37
- const { bytesRead } = await fd.read(buffer, 0, sampleSize, 0);
38
- const slice = bytesRead === sampleSize ? buffer : buffer.subarray(0, bytesRead);
39
- return slice.includes(0);
40
- } finally {
41
- await fd.close();
42
- }
43
- } catch (error) {
44
- console.warn(
45
- `Warning: Could not determine if file is binary: ${filePath} - ${error.message}`,
46
- );
47
- return false;
48
- }
49
- }
50
-
51
- module.exports = {
52
- isBinaryFile,
53
- };
@@ -1,70 +0,0 @@
1
- const path = require("node:path");
2
- const { execFile } = require("node:child_process");
3
- const { promisify } = require("node:util");
4
- const { glob } = require("glob");
5
- const { loadIgnore } = require("./ignoreRules.js");
6
-
7
- const pExecFile = promisify(execFile);
8
-
9
- async function isGitRepo(rootDir) {
10
- try {
11
- const { stdout } = await pExecFile("git", [
12
- "rev-parse",
13
- "--is-inside-work-tree",
14
- ], { cwd: rootDir });
15
- return String(stdout || "").toString().trim() === "true";
16
- } catch {
17
- return false;
18
- }
19
- }
20
-
21
- async function gitListFiles(rootDir) {
22
- try {
23
- const { stdout } = await pExecFile("git", [
24
- "ls-files",
25
- "-co",
26
- "--exclude-standard",
27
- ], { cwd: rootDir });
28
- return String(stdout || "")
29
- .split(/\r?\n/)
30
- .map((s) => s.trim())
31
- .filter(Boolean);
32
- } catch {
33
- return [];
34
- }
35
- }
36
-
37
- /**
38
- * Discover files under rootDir.
39
- * - Prefer git ls-files when available for speed/correctness
40
- * - Fallback to glob and apply unified ignore rules
41
- * @param {string} rootDir
42
- * @param {object} [options]
43
- * @param {boolean} [options.preferGit=true]
44
- * @returns {Promise<string[]>} absolute file paths
45
- */
46
- async function discoverFiles(rootDir, options = {}) {
47
- const { preferGit = true } = options;
48
- const { filter } = await loadIgnore(rootDir);
49
-
50
- // Try git first
51
- if (preferGit && await isGitRepo(rootDir)) {
52
- const relFiles = await gitListFiles(rootDir);
53
- const filteredRel = relFiles.filter((p) => filter(p));
54
- return filteredRel.map((p) => path.resolve(rootDir, p));
55
- }
56
-
57
- // Glob fallback
58
- const globbed = await glob("**/*", {
59
- cwd: rootDir,
60
- nodir: true,
61
- dot: true,
62
- follow: false,
63
- });
64
- const filteredRel = globbed.filter((p) => filter(p));
65
- return filteredRel.map((p) => path.resolve(rootDir, p));
66
- }
67
-
68
- module.exports = {
69
- discoverFiles,
70
- };
@@ -1,35 +0,0 @@
1
- const path = require("node:path");
2
- const discovery = require("./discovery.js");
3
- const ignoreRules = require("./ignoreRules.js");
4
- const { isBinaryFile } = require("./binary.js");
5
- const { aggregateFileContents } = require("./aggregate.js");
6
-
7
- // Backward-compatible signature; delegate to central loader
8
- async function parseGitignore(gitignorePath) {
9
- return await ignoreRules.parseGitignore(gitignorePath);
10
- }
11
-
12
- async function discoverFiles(rootDir) {
13
- try {
14
- // Delegate to discovery module which respects .gitignore and defaults
15
- return await discovery.discoverFiles(rootDir, { preferGit: true });
16
- } catch (error) {
17
- console.error("Error discovering files:", error.message);
18
- return [];
19
- }
20
- }
21
-
22
- async function filterFiles(files, rootDir) {
23
- const { filter } = await ignoreRules.loadIgnore(rootDir);
24
- const relativeFiles = files.map((f) => path.relative(rootDir, f));
25
- const filteredRelative = relativeFiles.filter((p) => filter(p));
26
- return filteredRelative.map((p) => path.resolve(rootDir, p));
27
- }
28
-
29
- module.exports = {
30
- parseGitignore,
31
- discoverFiles,
32
- isBinaryFile,
33
- aggregateFileContents,
34
- filterFiles,
35
- };