bmad-method 4.37.0 → 4.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +3 -3
- package/.github/ISSUE_TEMPLATE/feature_request.md +3 -3
- package/.github/workflows/discord.yaml +11 -2
- package/.github/workflows/format-check.yaml +42 -0
- package/.github/workflows/manual-release.yaml +173 -0
- package/.husky/pre-commit +3 -0
- package/.vscode/settings.json +26 -1
- package/CHANGELOG.md +2 -23
- package/README.md +2 -0
- package/bmad-core/agent-teams/team-all.yaml +1 -1
- package/bmad-core/agents/analyst.md +16 -15
- package/bmad-core/agents/architect.md +11 -11
- package/bmad-core/agents/bmad-master.md +23 -22
- package/bmad-core/agents/bmad-orchestrator.md +13 -17
- package/bmad-core/agents/dev.md +14 -11
- package/bmad-core/agents/pm.md +15 -14
- package/bmad-core/agents/po.md +9 -8
- package/bmad-core/agents/qa.md +42 -22
- package/bmad-core/agents/sm.md +7 -6
- package/bmad-core/agents/ux-expert.md +6 -5
- package/bmad-core/core-config.yaml +2 -0
- package/bmad-core/data/bmad-kb.md +1 -1
- package/bmad-core/data/test-levels-framework.md +146 -0
- package/bmad-core/data/test-priorities-matrix.md +172 -0
- package/bmad-core/tasks/apply-qa-fixes.md +148 -0
- package/bmad-core/tasks/facilitate-brainstorming-session.md +1 -1
- package/bmad-core/tasks/nfr-assess.md +343 -0
- package/bmad-core/tasks/qa-gate.md +161 -0
- package/bmad-core/tasks/review-story.md +234 -74
- package/bmad-core/tasks/risk-profile.md +353 -0
- package/bmad-core/tasks/test-design.md +174 -0
- package/bmad-core/tasks/trace-requirements.md +264 -0
- package/bmad-core/templates/architecture-tmpl.yaml +49 -49
- package/bmad-core/templates/brainstorming-output-tmpl.yaml +5 -5
- package/bmad-core/templates/brownfield-architecture-tmpl.yaml +31 -31
- package/bmad-core/templates/brownfield-prd-tmpl.yaml +13 -13
- package/bmad-core/templates/competitor-analysis-tmpl.yaml +19 -6
- package/bmad-core/templates/front-end-architecture-tmpl.yaml +21 -9
- package/bmad-core/templates/front-end-spec-tmpl.yaml +24 -24
- package/bmad-core/templates/fullstack-architecture-tmpl.yaml +122 -104
- package/bmad-core/templates/market-research-tmpl.yaml +2 -2
- package/bmad-core/templates/prd-tmpl.yaml +9 -9
- package/bmad-core/templates/project-brief-tmpl.yaml +4 -4
- package/bmad-core/templates/qa-gate-tmpl.yaml +102 -0
- package/bmad-core/templates/story-tmpl.yaml +12 -12
- package/bmad-core/workflows/brownfield-fullstack.yaml +9 -9
- package/bmad-core/workflows/brownfield-service.yaml +1 -1
- package/bmad-core/workflows/brownfield-ui.yaml +1 -1
- package/bmad-core/workflows/greenfield-fullstack.yaml +1 -1
- package/bmad-core/workflows/greenfield-service.yaml +1 -1
- package/bmad-core/workflows/greenfield-ui.yaml +1 -1
- package/common/utils/bmad-doc-template.md +5 -5
- package/dist/agents/analyst.txt +1086 -1079
- package/dist/agents/architect.txt +1534 -1526
- package/dist/agents/bmad-master.txt +646 -632
- package/dist/agents/bmad-orchestrator.txt +40 -18
- package/dist/agents/dev.txt +158 -19
- package/dist/agents/pm.txt +1082 -1107
- package/dist/agents/po.txt +314 -332
- package/dist/agents/qa.txt +1754 -151
- package/dist/agents/sm.txt +88 -98
- package/dist/agents/ux-expert.txt +80 -87
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +109 -146
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +75 -86
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +41 -48
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +1903 -1941
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-architect.txt +15 -50
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-designer.txt +149 -195
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.txt +0 -15
- package/dist/expansion-packs/bmad-2d-unity-game-dev/agents/game-sm.txt +20 -37
- package/dist/expansion-packs/bmad-2d-unity-game-dev/teams/unity-2d-game-team.txt +2660 -2752
- package/dist/expansion-packs/bmad-creative-writing/agents/beta-reader.txt +871 -0
- package/dist/expansion-packs/bmad-creative-writing/agents/book-critic.txt +78 -0
- package/dist/expansion-packs/bmad-creative-writing/agents/character-psychologist.txt +839 -0
- package/dist/expansion-packs/bmad-creative-writing/agents/cover-designer.txt +85 -0
- package/dist/expansion-packs/bmad-creative-writing/agents/dialog-specialist.txt +861 -0
- package/dist/expansion-packs/bmad-creative-writing/agents/editor.txt +796 -0
- package/dist/expansion-packs/bmad-creative-writing/agents/genre-specialist.txt +927 -0
- package/dist/expansion-packs/bmad-creative-writing/agents/narrative-designer.txt +842 -0
- package/dist/expansion-packs/bmad-creative-writing/agents/plot-architect.txt +1126 -0
- package/dist/expansion-packs/bmad-creative-writing/agents/world-builder.txt +864 -0
- package/dist/expansion-packs/bmad-creative-writing/teams/agent-team.txt +5917 -0
- package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +25 -27
- package/dist/teams/team-all.txt +5541 -3768
- package/dist/teams/team-fullstack.txt +3014 -2987
- package/dist/teams/team-ide-minimal.txt +2219 -469
- package/dist/teams/team-no-ui.txt +2993 -2966
- package/docs/enhanced-ide-development-workflow.md +220 -15
- package/docs/user-guide.md +271 -18
- package/docs/versioning-and-releases.md +122 -44
- package/docs/working-in-the-brownfield.md +264 -31
- package/eslint.config.mjs +119 -0
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +4 -4
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +1 -1
- package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +1 -1
- package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +26 -28
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +50 -50
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +23 -23
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +24 -24
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +42 -42
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +65 -65
- package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml +5 -5
- package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml +1 -1
- package/expansion-packs/bmad-2d-unity-game-dev/agents/game-developer.md +3 -3
- package/expansion-packs/bmad-2d-unity-game-dev/config.yaml +1 -1
- package/expansion-packs/bmad-2d-unity-game-dev/data/bmad-kb.md +1 -1
- package/expansion-packs/bmad-2d-unity-game-dev/templates/game-brief-tmpl.yaml +23 -23
- package/expansion-packs/bmad-2d-unity-game-dev/templates/game-design-doc-tmpl.yaml +63 -63
- package/expansion-packs/bmad-2d-unity-game-dev/templates/game-story-tmpl.yaml +20 -20
- package/expansion-packs/bmad-2d-unity-game-dev/templates/level-design-doc-tmpl.yaml +65 -65
- package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-dev-greenfield.yaml +5 -5
- package/expansion-packs/bmad-2d-unity-game-dev/workflows/game-prototype.yaml +1 -1
- package/expansion-packs/bmad-creative-writing/README.md +132 -0
- package/expansion-packs/bmad-creative-writing/agent-teams/agent-team.yaml +19 -0
- package/expansion-packs/bmad-creative-writing/agents/beta-reader.md +91 -0
- package/expansion-packs/bmad-creative-writing/agents/book-critic.md +35 -0
- package/expansion-packs/bmad-creative-writing/agents/character-psychologist.md +90 -0
- package/expansion-packs/bmad-creative-writing/agents/cover-designer.md +41 -0
- package/expansion-packs/bmad-creative-writing/agents/dialog-specialist.md +89 -0
- package/expansion-packs/bmad-creative-writing/agents/editor.md +90 -0
- package/expansion-packs/bmad-creative-writing/agents/genre-specialist.md +92 -0
- package/expansion-packs/bmad-creative-writing/agents/narrative-designer.md +90 -0
- package/expansion-packs/bmad-creative-writing/agents/plot-architect.md +92 -0
- package/expansion-packs/bmad-creative-writing/agents/world-builder.md +91 -0
- package/expansion-packs/bmad-creative-writing/checklists/beta-feedback-closure-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/character-consistency-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/comedic-timing-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/cyberpunk-aesthetic-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/ebook-formatting-checklist.md +15 -0
- package/expansion-packs/bmad-creative-writing/checklists/epic-poetry-meter-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/fantasy-magic-system-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/foreshadowing-payoff-checklist.md +15 -0
- package/expansion-packs/bmad-creative-writing/checklists/genre-tropes-checklist.md +15 -0
- package/expansion-packs/bmad-creative-writing/checklists/historical-accuracy-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/horror-suspense-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/kdp-cover-ready-checklist.md +18 -0
- package/expansion-packs/bmad-creative-writing/checklists/line-edit-quality-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/marketing-copy-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/mystery-clue-trail-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/orbital-mechanics-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/plot-structure-checklist.md +49 -0
- package/expansion-packs/bmad-creative-writing/checklists/publication-readiness-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/romance-emotional-beats-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/scene-quality-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/scifi-technology-plausibility-checklist.md +15 -0
- package/expansion-packs/bmad-creative-writing/checklists/sensitivity-representation-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/steampunk-gadget-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/thriller-pacing-stakes-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/timeline-continuity-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/world-building-continuity-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/checklists/ya-appropriateness-checklist.md +16 -0
- package/expansion-packs/bmad-creative-writing/config.yaml +11 -0
- package/expansion-packs/bmad-creative-writing/data/bmad-kb.md +197 -0
- package/expansion-packs/bmad-creative-writing/data/story-structures.md +58 -0
- package/expansion-packs/bmad-creative-writing/docs/brief.md +183 -0
- package/expansion-packs/bmad-creative-writing/tasks/advanced-elicitation.md +117 -0
- package/expansion-packs/bmad-creative-writing/tasks/analyze-reader-feedback.md +16 -0
- package/expansion-packs/bmad-creative-writing/tasks/analyze-story-structure.md +55 -0
- package/expansion-packs/bmad-creative-writing/tasks/assemble-kdp-package.md +22 -0
- package/expansion-packs/bmad-creative-writing/tasks/brainstorm-premise.md +16 -0
- package/expansion-packs/bmad-creative-writing/tasks/build-world.md +17 -0
- package/expansion-packs/bmad-creative-writing/tasks/character-depth-pass.md +15 -0
- package/expansion-packs/bmad-creative-writing/tasks/create-doc.md +101 -0
- package/expansion-packs/bmad-creative-writing/tasks/create-draft-section.md +19 -0
- package/expansion-packs/bmad-creative-writing/tasks/critical-review.md +19 -0
- package/expansion-packs/bmad-creative-writing/tasks/develop-character.md +17 -0
- package/expansion-packs/bmad-creative-writing/tasks/execute-checklist.md +93 -0
- package/expansion-packs/bmad-creative-writing/tasks/expand-premise.md +16 -0
- package/expansion-packs/bmad-creative-writing/tasks/expand-synopsis.md +16 -0
- package/expansion-packs/bmad-creative-writing/tasks/final-polish.md +16 -0
- package/expansion-packs/bmad-creative-writing/tasks/generate-cover-brief.md +18 -0
- package/expansion-packs/bmad-creative-writing/tasks/generate-cover-prompts.md +19 -0
- package/expansion-packs/bmad-creative-writing/tasks/generate-scene-list.md +16 -0
- package/expansion-packs/bmad-creative-writing/tasks/incorporate-feedback.md +18 -0
- package/expansion-packs/bmad-creative-writing/tasks/outline-scenes.md +16 -0
- package/expansion-packs/bmad-creative-writing/tasks/provide-feedback.md +17 -0
- package/expansion-packs/bmad-creative-writing/tasks/publish-chapter.md +16 -0
- package/expansion-packs/bmad-creative-writing/tasks/quick-feedback.md +15 -0
- package/expansion-packs/bmad-creative-writing/tasks/select-next-arc.md +16 -0
- package/expansion-packs/bmad-creative-writing/tasks/workshop-dialog.md +51 -0
- package/expansion-packs/bmad-creative-writing/templates/beta-feedback-form.yaml +96 -0
- package/expansion-packs/bmad-creative-writing/templates/chapter-draft-tmpl.yaml +81 -0
- package/expansion-packs/bmad-creative-writing/templates/character-profile-tmpl.yaml +92 -0
- package/expansion-packs/bmad-creative-writing/templates/cover-design-brief-tmpl.yaml +97 -0
- package/expansion-packs/bmad-creative-writing/templates/premise-brief-tmpl.yaml +77 -0
- package/expansion-packs/bmad-creative-writing/templates/scene-list-tmpl.yaml +54 -0
- package/expansion-packs/bmad-creative-writing/templates/story-outline-tmpl.yaml +96 -0
- package/expansion-packs/bmad-creative-writing/templates/world-guide-tmpl.yaml +88 -0
- package/expansion-packs/bmad-creative-writing/workflows/book-cover-design-workflow.md +176 -0
- package/expansion-packs/bmad-creative-writing/workflows/novel-greenfield-workflow.yaml +58 -0
- package/expansion-packs/bmad-creative-writing/workflows/novel-serial-workflow.yaml +51 -0
- package/expansion-packs/bmad-creative-writing/workflows/novel-snowflake-workflow.yaml +69 -0
- package/expansion-packs/bmad-creative-writing/workflows/novel-writing.yaml +92 -0
- package/expansion-packs/bmad-creative-writing/workflows/screenplay-development.yaml +86 -0
- package/expansion-packs/bmad-creative-writing/workflows/series-planning.yaml +79 -0
- package/expansion-packs/bmad-creative-writing/workflows/short-story-creation.yaml +65 -0
- package/expansion-packs/bmad-infrastructure-devops/config.yaml +1 -1
- package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +20 -20
- package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +7 -7
- package/package.json +62 -39
- package/prettier.config.mjs +32 -0
- package/sync-version.sh +23 -0
- package/tools/bmad-npx-wrapper.js +10 -10
- package/tools/builders/web-builder.js +124 -130
- package/tools/bump-all-versions.js +42 -33
- package/tools/bump-expansion-version.js +23 -16
- package/tools/cli.js +10 -12
- package/tools/flattener/aggregate.js +10 -10
- package/tools/flattener/binary.js +44 -17
- package/tools/flattener/discovery.js +19 -18
- package/tools/flattener/files.js +6 -6
- package/tools/flattener/ignoreRules.js +125 -125
- package/tools/flattener/main.js +426 -70
- package/tools/flattener/projectRoot.js +186 -25
- package/tools/flattener/prompts.js +9 -9
- package/tools/flattener/stats.helpers.js +395 -0
- package/tools/flattener/stats.js +64 -14
- package/tools/flattener/test-matrix.js +413 -0
- package/tools/flattener/xml.js +33 -31
- package/tools/installer/bin/bmad.js +156 -113
- package/tools/installer/config/ide-agent-config.yaml +1 -1
- package/tools/installer/config/install.config.yaml +13 -3
- package/tools/installer/lib/config-loader.js +46 -42
- package/tools/installer/lib/file-manager.js +91 -113
- package/tools/installer/lib/ide-base-setup.js +57 -56
- package/tools/installer/lib/ide-setup.js +545 -399
- package/tools/installer/lib/installer.js +875 -714
- package/tools/installer/lib/memory-profiler.js +54 -53
- package/tools/installer/lib/module-manager.js +19 -15
- package/tools/installer/lib/resource-locator.js +26 -28
- package/tools/installer/package.json +19 -19
- package/tools/lib/dependency-resolver.js +26 -30
- package/tools/lib/yaml-utils.js +7 -7
- package/tools/preview-release-notes.js +66 -0
- package/tools/shared/bannerArt.js +3 -3
- package/tools/sync-installer-version.js +7 -9
- package/tools/update-expansion-version.js +14 -15
- package/tools/upgraders/v3-to-v4-upgrader.js +203 -294
- package/tools/version-bump.js +41 -26
- package/tools/yaml-format.js +56 -43
- package/.github/workflows/release.yaml +0 -60
- package/.releaserc.json +0 -21
- package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/Complete AI Agent System - Flowchart.svg +0 -102
- 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
- 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
- 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
- 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
- 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
- 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
- package/expansion-packs/Complete AI Agent System - Blank Templates & Google Cloud Setup/README.md +0 -109
- package/tools/semantic-release-sync-installer.js +0 -30
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const fs = require(
|
|
2
|
-
const path = require(
|
|
3
|
-
const DependencyResolver = require(
|
|
4
|
-
const
|
|
1
|
+
const fs = require('node:fs').promises;
|
|
2
|
+
const path = require('node:path');
|
|
3
|
+
const DependencyResolver = require('../lib/dependency-resolver');
|
|
4
|
+
const yamlUtilities = require('../lib/yaml-utils');
|
|
5
5
|
|
|
6
6
|
class WebBuilder {
|
|
7
7
|
constructor(options = {}) {
|
|
8
8
|
this.rootDir = options.rootDir || process.cwd();
|
|
9
|
-
this.outputDirs = options.outputDirs || [path.join(this.rootDir,
|
|
9
|
+
this.outputDirs = options.outputDirs || [path.join(this.rootDir, 'dist')];
|
|
10
10
|
this.resolver = new DependencyResolver(this.rootDir);
|
|
11
11
|
this.templatePath = path.join(
|
|
12
12
|
this.rootDir,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
'tools',
|
|
14
|
+
'md-assets',
|
|
15
|
+
'web-agent-startup-instructions.md',
|
|
16
16
|
);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
parseYaml(content) {
|
|
20
|
-
const yaml = require(
|
|
20
|
+
const yaml = require('js-yaml');
|
|
21
21
|
return yaml.load(content);
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -26,7 +26,7 @@ class WebBuilder {
|
|
|
26
26
|
// All resources get installed under the bundle root, so use that path
|
|
27
27
|
const relativePath = path.relative(this.rootDir, filePath);
|
|
28
28
|
const pathParts = relativePath.split(path.sep);
|
|
29
|
-
|
|
29
|
+
|
|
30
30
|
let resourcePath;
|
|
31
31
|
if (pathParts[0] === 'expansion-packs') {
|
|
32
32
|
// For expansion packs, remove 'expansion-packs/packname' and use the rest
|
|
@@ -35,18 +35,28 @@ class WebBuilder {
|
|
|
35
35
|
// For bmad-core, common, etc., remove the first part
|
|
36
36
|
resourcePath = pathParts.slice(1).join('/');
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
return `.${bundleRoot}/${resourcePath}`;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
generateWebInstructions(bundleType, packName = null) {
|
|
43
43
|
// Generate dynamic web instructions based on bundle type
|
|
44
44
|
const rootExample = packName ? `.${packName}` : '.bmad-core';
|
|
45
|
-
const examplePath = packName
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
45
|
+
const examplePath = packName
|
|
46
|
+
? `.${packName}/folder/filename.md`
|
|
47
|
+
: '.bmad-core/folder/filename.md';
|
|
48
|
+
const personasExample = packName
|
|
49
|
+
? `.${packName}/personas/analyst.md`
|
|
50
|
+
: '.bmad-core/personas/analyst.md';
|
|
51
|
+
const tasksExample = packName
|
|
52
|
+
? `.${packName}/tasks/create-story.md`
|
|
53
|
+
: '.bmad-core/tasks/create-story.md';
|
|
54
|
+
const utilitiesExample = packName
|
|
55
|
+
? `.${packName}/utils/template-format.md`
|
|
56
|
+
: '.bmad-core/utils/template-format.md';
|
|
57
|
+
const tasksReference = packName
|
|
58
|
+
? `.${packName}/tasks/create-story.md`
|
|
59
|
+
: '.bmad-core/tasks/create-story.md';
|
|
50
60
|
|
|
51
61
|
return `# Web Agent Bundle Instructions
|
|
52
62
|
|
|
@@ -79,8 +89,8 @@ dependencies:
|
|
|
79
89
|
|
|
80
90
|
These references map directly to bundle sections:
|
|
81
91
|
|
|
82
|
-
- \`utils: template-format\` → Look for \`==================== START: ${
|
|
83
|
-
- \`tasks: create-story\` → Look for \`==================== START: ${
|
|
92
|
+
- \`utils: template-format\` → Look for \`==================== START: ${utilitiesExample} ====================\`
|
|
93
|
+
- \`tasks: create-story\` → Look for \`==================== START: ${tasksReference} ====================\`
|
|
84
94
|
|
|
85
95
|
3. **Execution Context**: You are operating in a web environment. All your capabilities and knowledge are contained within this bundle. Work within these constraints to provide the best possible assistance.
|
|
86
96
|
|
|
@@ -112,10 +122,10 @@ These references map directly to bundle sections:
|
|
|
112
122
|
|
|
113
123
|
// Write to all output directories
|
|
114
124
|
for (const outputDir of this.outputDirs) {
|
|
115
|
-
const outputPath = path.join(outputDir,
|
|
125
|
+
const outputPath = path.join(outputDir, 'agents');
|
|
116
126
|
await fs.mkdir(outputPath, { recursive: true });
|
|
117
127
|
const outputFile = path.join(outputPath, `${agentId}.txt`);
|
|
118
|
-
await fs.writeFile(outputFile, bundle,
|
|
128
|
+
await fs.writeFile(outputFile, bundle, 'utf8');
|
|
119
129
|
}
|
|
120
130
|
}
|
|
121
131
|
|
|
@@ -131,10 +141,10 @@ These references map directly to bundle sections:
|
|
|
131
141
|
|
|
132
142
|
// Write to all output directories
|
|
133
143
|
for (const outputDir of this.outputDirs) {
|
|
134
|
-
const outputPath = path.join(outputDir,
|
|
144
|
+
const outputPath = path.join(outputDir, 'teams');
|
|
135
145
|
await fs.mkdir(outputPath, { recursive: true });
|
|
136
146
|
const outputFile = path.join(outputPath, `${teamId}.txt`);
|
|
137
|
-
await fs.writeFile(outputFile, bundle,
|
|
147
|
+
await fs.writeFile(outputFile, bundle, 'utf8');
|
|
138
148
|
}
|
|
139
149
|
}
|
|
140
150
|
|
|
@@ -157,7 +167,7 @@ These references map directly to bundle sections:
|
|
|
157
167
|
sections.push(this.formatSection(resourcePath, resource.content, 'bmad-core'));
|
|
158
168
|
}
|
|
159
169
|
|
|
160
|
-
return sections.join(
|
|
170
|
+
return sections.join('\n');
|
|
161
171
|
}
|
|
162
172
|
|
|
163
173
|
async buildTeamBundle(teamId) {
|
|
@@ -182,40 +192,40 @@ These references map directly to bundle sections:
|
|
|
182
192
|
sections.push(this.formatSection(resourcePath, resource.content, 'bmad-core'));
|
|
183
193
|
}
|
|
184
194
|
|
|
185
|
-
return sections.join(
|
|
195
|
+
return sections.join('\n');
|
|
186
196
|
}
|
|
187
197
|
|
|
188
198
|
processAgentContent(content) {
|
|
189
199
|
// First, replace content before YAML with the template
|
|
190
|
-
const yamlContent =
|
|
200
|
+
const yamlContent = yamlUtilities.extractYamlFromAgent(content);
|
|
191
201
|
if (!yamlContent) return content;
|
|
192
202
|
|
|
193
203
|
const yamlMatch = content.match(/```ya?ml\n([\s\S]*?)\n```/);
|
|
194
204
|
if (!yamlMatch) return content;
|
|
195
|
-
|
|
205
|
+
|
|
196
206
|
const yamlStartIndex = content.indexOf(yamlMatch[0]);
|
|
197
207
|
const yamlEndIndex = yamlStartIndex + yamlMatch[0].length;
|
|
198
208
|
|
|
199
209
|
// Parse YAML and remove root and IDE-FILE-RESOLUTION properties
|
|
200
210
|
try {
|
|
201
|
-
const yaml = require(
|
|
211
|
+
const yaml = require('js-yaml');
|
|
202
212
|
const parsed = yaml.load(yamlContent);
|
|
203
213
|
|
|
204
214
|
// Remove the properties if they exist at root level
|
|
205
215
|
delete parsed.root;
|
|
206
|
-
delete parsed[
|
|
207
|
-
delete parsed[
|
|
216
|
+
delete parsed['IDE-FILE-RESOLUTION'];
|
|
217
|
+
delete parsed['REQUEST-RESOLUTION'];
|
|
208
218
|
|
|
209
219
|
// Also remove from activation-instructions if they exist
|
|
210
|
-
if (parsed[
|
|
211
|
-
parsed[
|
|
220
|
+
if (parsed['activation-instructions'] && Array.isArray(parsed['activation-instructions'])) {
|
|
221
|
+
parsed['activation-instructions'] = parsed['activation-instructions'].filter(
|
|
212
222
|
(instruction) => {
|
|
213
223
|
return (
|
|
214
224
|
typeof instruction === 'string' &&
|
|
215
|
-
!instruction.startsWith(
|
|
216
|
-
!instruction.startsWith(
|
|
225
|
+
!instruction.startsWith('IDE-FILE-RESOLUTION:') &&
|
|
226
|
+
!instruction.startsWith('REQUEST-RESOLUTION:')
|
|
217
227
|
);
|
|
218
|
-
}
|
|
228
|
+
},
|
|
219
229
|
);
|
|
220
230
|
}
|
|
221
231
|
|
|
@@ -223,25 +233,25 @@ These references map directly to bundle sections:
|
|
|
223
233
|
const cleanedYaml = yaml.dump(parsed, { lineWidth: -1 });
|
|
224
234
|
|
|
225
235
|
// Get the agent name from the YAML for the header
|
|
226
|
-
const agentName = parsed.agent?.id ||
|
|
236
|
+
const agentName = parsed.agent?.id || 'agent';
|
|
227
237
|
|
|
228
238
|
// Build the new content with just the agent header and YAML
|
|
229
239
|
const newHeader = `# ${agentName}\n\nCRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode:\n\n`;
|
|
230
|
-
const afterYaml = content.
|
|
240
|
+
const afterYaml = content.slice(Math.max(0, yamlEndIndex));
|
|
231
241
|
|
|
232
|
-
return newHeader +
|
|
242
|
+
return newHeader + '```yaml\n' + cleanedYaml.trim() + '\n```' + afterYaml;
|
|
233
243
|
} catch (error) {
|
|
234
|
-
console.warn(
|
|
244
|
+
console.warn('Failed to process agent YAML:', error.message);
|
|
235
245
|
// If parsing fails, return original content
|
|
236
246
|
return content;
|
|
237
247
|
}
|
|
238
248
|
}
|
|
239
249
|
|
|
240
250
|
formatSection(path, content, bundleRoot = 'bmad-core') {
|
|
241
|
-
const separator =
|
|
251
|
+
const separator = '====================';
|
|
242
252
|
|
|
243
253
|
// Process agent content if this is an agent file
|
|
244
|
-
if (path.includes(
|
|
254
|
+
if (path.includes('/agents/')) {
|
|
245
255
|
content = this.processAgentContent(content);
|
|
246
256
|
}
|
|
247
257
|
|
|
@@ -252,17 +262,17 @@ These references map directly to bundle sections:
|
|
|
252
262
|
`${separator} START: ${path} ${separator}`,
|
|
253
263
|
content.trim(),
|
|
254
264
|
`${separator} END: ${path} ${separator}`,
|
|
255
|
-
|
|
256
|
-
].join(
|
|
265
|
+
'',
|
|
266
|
+
].join('\n');
|
|
257
267
|
}
|
|
258
268
|
|
|
259
269
|
replaceRootReferences(content, bundleRoot) {
|
|
260
270
|
// Replace {root} with the appropriate bundle root path
|
|
261
|
-
return content.
|
|
271
|
+
return content.replaceAll('{root}', `.${bundleRoot}`);
|
|
262
272
|
}
|
|
263
273
|
|
|
264
274
|
async validate() {
|
|
265
|
-
console.log(
|
|
275
|
+
console.log('Validating agent configurations...');
|
|
266
276
|
const agents = await this.resolver.listAgents();
|
|
267
277
|
for (const agentId of agents) {
|
|
268
278
|
try {
|
|
@@ -274,7 +284,7 @@ These references map directly to bundle sections:
|
|
|
274
284
|
}
|
|
275
285
|
}
|
|
276
286
|
|
|
277
|
-
console.log(
|
|
287
|
+
console.log('\nValidating team configurations...');
|
|
278
288
|
const teams = await this.resolver.listTeams();
|
|
279
289
|
for (const teamId of teams) {
|
|
280
290
|
try {
|
|
@@ -299,54 +309,54 @@ These references map directly to bundle sections:
|
|
|
299
309
|
}
|
|
300
310
|
|
|
301
311
|
async buildExpansionPack(packName, options = {}) {
|
|
302
|
-
const packDir = path.join(this.rootDir,
|
|
303
|
-
const
|
|
312
|
+
const packDir = path.join(this.rootDir, 'expansion-packs', packName);
|
|
313
|
+
const outputDirectories = [path.join(this.rootDir, 'dist', 'expansion-packs', packName)];
|
|
304
314
|
|
|
305
315
|
// Clean output directories if requested
|
|
306
316
|
if (options.clean !== false) {
|
|
307
|
-
for (const outputDir of
|
|
317
|
+
for (const outputDir of outputDirectories) {
|
|
308
318
|
try {
|
|
309
319
|
await fs.rm(outputDir, { recursive: true, force: true });
|
|
310
|
-
} catch
|
|
320
|
+
} catch {
|
|
311
321
|
// Directory might not exist, that's fine
|
|
312
322
|
}
|
|
313
323
|
}
|
|
314
324
|
}
|
|
315
325
|
|
|
316
326
|
// Build individual agents first
|
|
317
|
-
const agentsDir = path.join(packDir,
|
|
327
|
+
const agentsDir = path.join(packDir, 'agents');
|
|
318
328
|
try {
|
|
319
329
|
const agentFiles = await fs.readdir(agentsDir);
|
|
320
|
-
const agentMarkdownFiles = agentFiles.filter((f) => f.endsWith(
|
|
330
|
+
const agentMarkdownFiles = agentFiles.filter((f) => f.endsWith('.md'));
|
|
321
331
|
|
|
322
332
|
if (agentMarkdownFiles.length > 0) {
|
|
323
333
|
console.log(` Building individual agents for ${packName}:`);
|
|
324
334
|
|
|
325
335
|
for (const agentFile of agentMarkdownFiles) {
|
|
326
|
-
const agentName = agentFile.replace(
|
|
336
|
+
const agentName = agentFile.replace('.md', '');
|
|
327
337
|
console.log(` - ${agentName}`);
|
|
328
338
|
|
|
329
339
|
// Build individual agent bundle
|
|
330
340
|
const bundle = await this.buildExpansionAgentBundle(packName, packDir, agentName);
|
|
331
341
|
|
|
332
342
|
// Write to all output directories
|
|
333
|
-
for (const outputDir of
|
|
334
|
-
const agentsOutputDir = path.join(outputDir,
|
|
343
|
+
for (const outputDir of outputDirectories) {
|
|
344
|
+
const agentsOutputDir = path.join(outputDir, 'agents');
|
|
335
345
|
await fs.mkdir(agentsOutputDir, { recursive: true });
|
|
336
346
|
const outputFile = path.join(agentsOutputDir, `${agentName}.txt`);
|
|
337
|
-
await fs.writeFile(outputFile, bundle,
|
|
347
|
+
await fs.writeFile(outputFile, bundle, 'utf8');
|
|
338
348
|
}
|
|
339
349
|
}
|
|
340
350
|
}
|
|
341
|
-
} catch
|
|
351
|
+
} catch {
|
|
342
352
|
console.debug(` No agents directory found for ${packName}`);
|
|
343
353
|
}
|
|
344
354
|
|
|
345
355
|
// Build team bundle
|
|
346
|
-
const agentTeamsDir = path.join(packDir,
|
|
356
|
+
const agentTeamsDir = path.join(packDir, 'agent-teams');
|
|
347
357
|
try {
|
|
348
358
|
const teamFiles = await fs.readdir(agentTeamsDir);
|
|
349
|
-
const teamFile = teamFiles.find((f) => f.endsWith(
|
|
359
|
+
const teamFile = teamFiles.find((f) => f.endsWith('.yaml'));
|
|
350
360
|
|
|
351
361
|
if (teamFile) {
|
|
352
362
|
console.log(` Building team bundle for ${packName}`);
|
|
@@ -356,17 +366,17 @@ These references map directly to bundle sections:
|
|
|
356
366
|
const bundle = await this.buildExpansionTeamBundle(packName, packDir, teamConfigPath);
|
|
357
367
|
|
|
358
368
|
// Write to all output directories
|
|
359
|
-
for (const outputDir of
|
|
360
|
-
const teamsOutputDir = path.join(outputDir,
|
|
369
|
+
for (const outputDir of outputDirectories) {
|
|
370
|
+
const teamsOutputDir = path.join(outputDir, 'teams');
|
|
361
371
|
await fs.mkdir(teamsOutputDir, { recursive: true });
|
|
362
|
-
const outputFile = path.join(teamsOutputDir, teamFile.replace(
|
|
363
|
-
await fs.writeFile(outputFile, bundle,
|
|
372
|
+
const outputFile = path.join(teamsOutputDir, teamFile.replace('.yaml', '.txt'));
|
|
373
|
+
await fs.writeFile(outputFile, bundle, 'utf8');
|
|
364
374
|
console.log(` ✓ Created bundle: ${path.relative(this.rootDir, outputFile)}`);
|
|
365
375
|
}
|
|
366
376
|
} else {
|
|
367
377
|
console.warn(` ⚠ No team configuration found in ${packName}/agent-teams/`);
|
|
368
378
|
}
|
|
369
|
-
} catch
|
|
379
|
+
} catch {
|
|
370
380
|
console.warn(` ⚠ No agent-teams directory found for ${packName}`);
|
|
371
381
|
}
|
|
372
382
|
}
|
|
@@ -376,16 +386,16 @@ These references map directly to bundle sections:
|
|
|
376
386
|
const sections = [template];
|
|
377
387
|
|
|
378
388
|
// Add agent configuration
|
|
379
|
-
const agentPath = path.join(packDir,
|
|
380
|
-
const agentContent = await fs.readFile(agentPath,
|
|
389
|
+
const agentPath = path.join(packDir, 'agents', `${agentName}.md`);
|
|
390
|
+
const agentContent = await fs.readFile(agentPath, 'utf8');
|
|
381
391
|
const agentWebPath = this.convertToWebPath(agentPath, packName);
|
|
382
392
|
sections.push(this.formatSection(agentWebPath, agentContent, packName));
|
|
383
393
|
|
|
384
394
|
// Resolve and add agent dependencies
|
|
385
|
-
const yamlContent =
|
|
395
|
+
const yamlContent = yamlUtilities.extractYamlFromAgent(agentContent);
|
|
386
396
|
if (yamlContent) {
|
|
387
397
|
try {
|
|
388
|
-
const yaml = require(
|
|
398
|
+
const yaml = require('js-yaml');
|
|
389
399
|
const agentConfig = yaml.load(yamlContent);
|
|
390
400
|
|
|
391
401
|
if (agentConfig.dependencies) {
|
|
@@ -398,59 +408,43 @@ These references map directly to bundle sections:
|
|
|
398
408
|
// Try expansion pack first
|
|
399
409
|
const resourcePath = path.join(packDir, resourceType, resourceName);
|
|
400
410
|
try {
|
|
401
|
-
const resourceContent = await fs.readFile(resourcePath,
|
|
411
|
+
const resourceContent = await fs.readFile(resourcePath, 'utf8');
|
|
402
412
|
const resourceWebPath = this.convertToWebPath(resourcePath, packName);
|
|
403
|
-
sections.push(
|
|
404
|
-
this.formatSection(resourceWebPath, resourceContent, packName)
|
|
405
|
-
);
|
|
413
|
+
sections.push(this.formatSection(resourceWebPath, resourceContent, packName));
|
|
406
414
|
found = true;
|
|
407
|
-
} catch
|
|
415
|
+
} catch {
|
|
408
416
|
// Not in expansion pack, continue
|
|
409
417
|
}
|
|
410
418
|
|
|
411
419
|
// If not found in expansion pack, try core
|
|
412
420
|
if (!found) {
|
|
413
|
-
const corePath = path.join(
|
|
414
|
-
this.rootDir,
|
|
415
|
-
"bmad-core",
|
|
416
|
-
resourceType,
|
|
417
|
-
resourceName
|
|
418
|
-
);
|
|
421
|
+
const corePath = path.join(this.rootDir, 'bmad-core', resourceType, resourceName);
|
|
419
422
|
try {
|
|
420
|
-
const coreContent = await fs.readFile(corePath,
|
|
423
|
+
const coreContent = await fs.readFile(corePath, 'utf8');
|
|
421
424
|
const coreWebPath = this.convertToWebPath(corePath, packName);
|
|
422
|
-
sections.push(
|
|
423
|
-
this.formatSection(coreWebPath, coreContent, packName)
|
|
424
|
-
);
|
|
425
|
+
sections.push(this.formatSection(coreWebPath, coreContent, packName));
|
|
425
426
|
found = true;
|
|
426
|
-
} catch
|
|
427
|
+
} catch {
|
|
427
428
|
// Not in core either, continue
|
|
428
429
|
}
|
|
429
430
|
}
|
|
430
431
|
|
|
431
432
|
// If not found in core, try common folder
|
|
432
433
|
if (!found) {
|
|
433
|
-
const commonPath = path.join(
|
|
434
|
-
this.rootDir,
|
|
435
|
-
"common",
|
|
436
|
-
resourceType,
|
|
437
|
-
resourceName
|
|
438
|
-
);
|
|
434
|
+
const commonPath = path.join(this.rootDir, 'common', resourceType, resourceName);
|
|
439
435
|
try {
|
|
440
|
-
const commonContent = await fs.readFile(commonPath,
|
|
436
|
+
const commonContent = await fs.readFile(commonPath, 'utf8');
|
|
441
437
|
const commonWebPath = this.convertToWebPath(commonPath, packName);
|
|
442
|
-
sections.push(
|
|
443
|
-
this.formatSection(commonWebPath, commonContent, packName)
|
|
444
|
-
);
|
|
438
|
+
sections.push(this.formatSection(commonWebPath, commonContent, packName));
|
|
445
439
|
found = true;
|
|
446
|
-
} catch
|
|
440
|
+
} catch {
|
|
447
441
|
// Not in common either, continue
|
|
448
442
|
}
|
|
449
443
|
}
|
|
450
444
|
|
|
451
445
|
if (!found) {
|
|
452
446
|
console.warn(
|
|
453
|
-
` ⚠ Dependency ${resourceType}#${resourceName} not found in expansion pack or core
|
|
447
|
+
` ⚠ Dependency ${resourceType}#${resourceName} not found in expansion pack or core`,
|
|
454
448
|
);
|
|
455
449
|
}
|
|
456
450
|
}
|
|
@@ -462,7 +456,7 @@ These references map directly to bundle sections:
|
|
|
462
456
|
}
|
|
463
457
|
}
|
|
464
458
|
|
|
465
|
-
return sections.join(
|
|
459
|
+
return sections.join('\n');
|
|
466
460
|
}
|
|
467
461
|
|
|
468
462
|
async buildExpansionTeamBundle(packName, packDir, teamConfigPath) {
|
|
@@ -471,38 +465,38 @@ These references map directly to bundle sections:
|
|
|
471
465
|
const sections = [template];
|
|
472
466
|
|
|
473
467
|
// Add team configuration and parse to get agent list
|
|
474
|
-
const teamContent = await fs.readFile(teamConfigPath,
|
|
475
|
-
const teamFileName = path.basename(teamConfigPath,
|
|
468
|
+
const teamContent = await fs.readFile(teamConfigPath, 'utf8');
|
|
469
|
+
const teamFileName = path.basename(teamConfigPath, '.yaml');
|
|
476
470
|
const teamConfig = this.parseYaml(teamContent);
|
|
477
471
|
const teamWebPath = this.convertToWebPath(teamConfigPath, packName);
|
|
478
472
|
sections.push(this.formatSection(teamWebPath, teamContent, packName));
|
|
479
473
|
|
|
480
474
|
// Get list of expansion pack agents
|
|
481
475
|
const expansionAgents = new Set();
|
|
482
|
-
const agentsDir = path.join(packDir,
|
|
476
|
+
const agentsDir = path.join(packDir, 'agents');
|
|
483
477
|
try {
|
|
484
478
|
const agentFiles = await fs.readdir(agentsDir);
|
|
485
|
-
for (const agentFile of agentFiles.filter((f) => f.endsWith(
|
|
486
|
-
const agentName = agentFile.replace(
|
|
479
|
+
for (const agentFile of agentFiles.filter((f) => f.endsWith('.md'))) {
|
|
480
|
+
const agentName = agentFile.replace('.md', '');
|
|
487
481
|
expansionAgents.add(agentName);
|
|
488
482
|
}
|
|
489
|
-
} catch
|
|
483
|
+
} catch {
|
|
490
484
|
console.warn(` ⚠ No agents directory found in ${packName}`);
|
|
491
485
|
}
|
|
492
486
|
|
|
493
487
|
// Build a map of all available expansion pack resources for override checking
|
|
494
488
|
const expansionResources = new Map();
|
|
495
|
-
const
|
|
496
|
-
for (const resourceDir of
|
|
489
|
+
const resourceDirectories = ['templates', 'tasks', 'checklists', 'workflows', 'data'];
|
|
490
|
+
for (const resourceDir of resourceDirectories) {
|
|
497
491
|
const resourcePath = path.join(packDir, resourceDir);
|
|
498
492
|
try {
|
|
499
493
|
const resourceFiles = await fs.readdir(resourcePath);
|
|
500
494
|
for (const resourceFile of resourceFiles.filter(
|
|
501
|
-
(f) => f.endsWith(
|
|
495
|
+
(f) => f.endsWith('.md') || f.endsWith('.yaml'),
|
|
502
496
|
)) {
|
|
503
497
|
expansionResources.set(`${resourceDir}#${resourceFile}`, true);
|
|
504
498
|
}
|
|
505
|
-
} catch
|
|
499
|
+
} catch {
|
|
506
500
|
// Directory might not exist, that's fine
|
|
507
501
|
}
|
|
508
502
|
}
|
|
@@ -511,9 +505,9 @@ These references map directly to bundle sections:
|
|
|
511
505
|
const agentsToProcess = teamConfig.agents || [];
|
|
512
506
|
|
|
513
507
|
// Ensure bmad-orchestrator is always included for teams
|
|
514
|
-
if (!agentsToProcess.includes(
|
|
508
|
+
if (!agentsToProcess.includes('bmad-orchestrator')) {
|
|
515
509
|
console.warn(` ⚠ Team ${teamFileName} missing bmad-orchestrator, adding automatically`);
|
|
516
|
-
agentsToProcess.unshift(
|
|
510
|
+
agentsToProcess.unshift('bmad-orchestrator');
|
|
517
511
|
}
|
|
518
512
|
|
|
519
513
|
// Track all dependencies from all agents (deduplicated)
|
|
@@ -523,7 +517,7 @@ These references map directly to bundle sections:
|
|
|
523
517
|
if (expansionAgents.has(agentId)) {
|
|
524
518
|
// Use expansion pack version (override)
|
|
525
519
|
const agentPath = path.join(agentsDir, `${agentId}.md`);
|
|
526
|
-
const agentContent = await fs.readFile(agentPath,
|
|
520
|
+
const agentContent = await fs.readFile(agentPath, 'utf8');
|
|
527
521
|
const expansionAgentWebPath = this.convertToWebPath(agentPath, packName);
|
|
528
522
|
sections.push(this.formatSection(expansionAgentWebPath, agentContent, packName));
|
|
529
523
|
|
|
@@ -551,13 +545,13 @@ These references map directly to bundle sections:
|
|
|
551
545
|
} else {
|
|
552
546
|
// Use core BMad version
|
|
553
547
|
try {
|
|
554
|
-
const coreAgentPath = path.join(this.rootDir,
|
|
555
|
-
const coreAgentContent = await fs.readFile(coreAgentPath,
|
|
548
|
+
const coreAgentPath = path.join(this.rootDir, 'bmad-core', 'agents', `${agentId}.md`);
|
|
549
|
+
const coreAgentContent = await fs.readFile(coreAgentPath, 'utf8');
|
|
556
550
|
const coreAgentWebPath = this.convertToWebPath(coreAgentPath, packName);
|
|
557
551
|
sections.push(this.formatSection(coreAgentWebPath, coreAgentContent, packName));
|
|
558
552
|
|
|
559
553
|
// Parse and collect dependencies from core agent
|
|
560
|
-
const yamlContent =
|
|
554
|
+
const yamlContent = yamlUtilities.extractYamlFromAgent(coreAgentContent, true);
|
|
561
555
|
if (yamlContent) {
|
|
562
556
|
try {
|
|
563
557
|
const agentConfig = this.parseYaml(yamlContent);
|
|
@@ -577,7 +571,7 @@ These references map directly to bundle sections:
|
|
|
577
571
|
console.debug(`Failed to parse agent YAML for ${agentId}:`, error.message);
|
|
578
572
|
}
|
|
579
573
|
}
|
|
580
|
-
} catch
|
|
574
|
+
} catch {
|
|
581
575
|
console.warn(` ⚠ Agent ${agentId} not found in core or expansion pack`);
|
|
582
576
|
}
|
|
583
577
|
}
|
|
@@ -593,38 +587,38 @@ These references map directly to bundle sections:
|
|
|
593
587
|
// We know it exists in expansion pack, find and load it
|
|
594
588
|
const expansionPath = path.join(packDir, dep.type, dep.name);
|
|
595
589
|
try {
|
|
596
|
-
const content = await fs.readFile(expansionPath,
|
|
590
|
+
const content = await fs.readFile(expansionPath, 'utf8');
|
|
597
591
|
const expansionWebPath = this.convertToWebPath(expansionPath, packName);
|
|
598
592
|
sections.push(this.formatSection(expansionWebPath, content, packName));
|
|
599
593
|
console.log(` ✓ Using expansion override for ${key}`);
|
|
600
594
|
found = true;
|
|
601
|
-
} catch
|
|
595
|
+
} catch {
|
|
602
596
|
// Try next extension
|
|
603
597
|
}
|
|
604
598
|
}
|
|
605
599
|
|
|
606
600
|
// If not found in expansion pack (or doesn't exist there), try core
|
|
607
601
|
if (!found) {
|
|
608
|
-
const corePath = path.join(this.rootDir,
|
|
602
|
+
const corePath = path.join(this.rootDir, 'bmad-core', dep.type, dep.name);
|
|
609
603
|
try {
|
|
610
|
-
const content = await fs.readFile(corePath,
|
|
604
|
+
const content = await fs.readFile(corePath, 'utf8');
|
|
611
605
|
const coreWebPath = this.convertToWebPath(corePath, packName);
|
|
612
606
|
sections.push(this.formatSection(coreWebPath, content, packName));
|
|
613
607
|
found = true;
|
|
614
|
-
} catch
|
|
608
|
+
} catch {
|
|
615
609
|
// Not in core either, continue
|
|
616
610
|
}
|
|
617
611
|
}
|
|
618
612
|
|
|
619
613
|
// If not found in core, try common folder
|
|
620
614
|
if (!found) {
|
|
621
|
-
const commonPath = path.join(this.rootDir,
|
|
615
|
+
const commonPath = path.join(this.rootDir, 'common', dep.type, dep.name);
|
|
622
616
|
try {
|
|
623
|
-
const content = await fs.readFile(commonPath,
|
|
617
|
+
const content = await fs.readFile(commonPath, 'utf8');
|
|
624
618
|
const commonWebPath = this.convertToWebPath(commonPath, packName);
|
|
625
619
|
sections.push(this.formatSection(commonWebPath, content, packName));
|
|
626
620
|
found = true;
|
|
627
|
-
} catch
|
|
621
|
+
} catch {
|
|
628
622
|
// Not in common either, continue
|
|
629
623
|
}
|
|
630
624
|
}
|
|
@@ -635,16 +629,16 @@ These references map directly to bundle sections:
|
|
|
635
629
|
}
|
|
636
630
|
|
|
637
631
|
// Add remaining expansion pack resources not already included as dependencies
|
|
638
|
-
for (const resourceDir of
|
|
632
|
+
for (const resourceDir of resourceDirectories) {
|
|
639
633
|
const resourcePath = path.join(packDir, resourceDir);
|
|
640
634
|
try {
|
|
641
635
|
const resourceFiles = await fs.readdir(resourcePath);
|
|
642
636
|
for (const resourceFile of resourceFiles.filter(
|
|
643
|
-
(f) => f.endsWith(
|
|
637
|
+
(f) => f.endsWith('.md') || f.endsWith('.yaml'),
|
|
644
638
|
)) {
|
|
645
639
|
const filePath = path.join(resourcePath, resourceFile);
|
|
646
|
-
const fileContent = await fs.readFile(filePath,
|
|
647
|
-
const fileName = resourceFile.replace(/\.(md|yaml)$/,
|
|
640
|
+
const fileContent = await fs.readFile(filePath, 'utf8');
|
|
641
|
+
const fileName = resourceFile.replace(/\.(md|yaml)$/, '');
|
|
648
642
|
|
|
649
643
|
// Only add if not already included as a dependency
|
|
650
644
|
const resourceKey = `${resourceDir}#${fileName}`;
|
|
@@ -654,21 +648,21 @@ These references map directly to bundle sections:
|
|
|
654
648
|
sections.push(this.formatSection(resourceWebPath, fileContent, packName));
|
|
655
649
|
}
|
|
656
650
|
}
|
|
657
|
-
} catch
|
|
651
|
+
} catch {
|
|
658
652
|
// Directory might not exist, that's fine
|
|
659
653
|
}
|
|
660
654
|
}
|
|
661
655
|
|
|
662
|
-
return sections.join(
|
|
656
|
+
return sections.join('\n');
|
|
663
657
|
}
|
|
664
658
|
|
|
665
659
|
async listExpansionPacks() {
|
|
666
|
-
const expansionPacksDir = path.join(this.rootDir,
|
|
660
|
+
const expansionPacksDir = path.join(this.rootDir, 'expansion-packs');
|
|
667
661
|
try {
|
|
668
662
|
const entries = await fs.readdir(expansionPacksDir, { withFileTypes: true });
|
|
669
663
|
return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
670
|
-
} catch
|
|
671
|
-
console.warn(
|
|
664
|
+
} catch {
|
|
665
|
+
console.warn('No expansion-packs directory found');
|
|
672
666
|
return [];
|
|
673
667
|
}
|
|
674
668
|
}
|