bmad-method 4.27.6 → 5.0.0
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/.bmad-core/agent-teams/team-all.yml +16 -0
- package/.bmad-core/agent-teams/team-fullstack.yml +26 -0
- package/.bmad-core/agent-teams/team-no-ui.yml +15 -0
- package/{bmad-core → .bmad-core}/agents/analyst.md +23 -29
- package/.bmad-core/agents/architect.md +66 -0
- package/.bmad-core/agents/bmad-master.md +104 -0
- package/.bmad-core/agents/bmad-orchestrator.md +81 -0
- package/.bmad-core/agents/dev.md +70 -0
- package/{bmad-core → .bmad-core}/agents/pm.md +24 -24
- package/{bmad-core → .bmad-core}/agents/po.md +24 -27
- package/.bmad-core/agents/qa.md +52 -0
- package/.bmad-core/agents/sm.md +55 -0
- package/.bmad-core/agents/ux-expert.md +66 -0
- package/{bmad-core → .bmad-core}/checklists/change-checklist.md +2 -2
- package/{bmad-core → .bmad-core}/checklists/story-draft-checklist.md +1 -1
- package/.bmad-core/data/bmad-kb.md +47 -0
- package/.bmad-core/schemas/agent-team-schema.yml +153 -0
- package/.bmad-core/tasks/advanced-elicitation.md +92 -0
- package/.bmad-core/tasks/brainstorming-techniques.md +238 -0
- package/.bmad-core/tasks/core-dump.md +74 -0
- package/{expansion-packs/bmad-creator-tools → .bmad-core}/tasks/create-agent.md +11 -9
- package/.bmad-core/tasks/create-doc.md +74 -0
- package/.bmad-core/tasks/create-expansion-pack.md +425 -0
- package/.bmad-core/tasks/create-next-story.md +206 -0
- package/.bmad-core/tasks/create-team.md +229 -0
- package/{bmad-core → .bmad-core}/tasks/doc-migration-task.md +9 -9
- package/{common → .bmad-core}/tasks/execute-checklist.md +6 -2
- package/.bmad-core/tasks/generate-ai-frontend-prompt.md +58 -0
- package/{bmad-core → .bmad-core}/tasks/index-docs.md +7 -3
- package/{bmad-core → .bmad-core}/tasks/shard-doc.md +7 -25
- package/.bmad-core/templates/agent-tmpl.md +58 -0
- package/.bmad-core/templates/architecture-tmpl.md +771 -0
- package/.bmad-core/templates/brownfield-architecture-tmpl.md +542 -0
- package/.bmad-core/templates/brownfield-prd-tmpl.md +240 -0
- package/.bmad-core/templates/competitor-analysis-tmpl.md +289 -0
- package/.bmad-core/templates/expansion-pack-plan-tmpl.md +91 -0
- package/.bmad-core/templates/front-end-architecture-tmpl.md +173 -0
- package/.bmad-core/templates/front-end-spec-tmpl.md +411 -0
- package/.bmad-core/templates/fullstack-architecture-tmpl.md +1016 -0
- package/.bmad-core/templates/market-research-tmpl.md +261 -0
- package/.bmad-core/templates/prd-tmpl.md +200 -0
- package/.bmad-core/templates/project-brief-tmpl.md +228 -0
- package/.bmad-core/templates/simple-project-prd-tmpl.md +461 -0
- package/.bmad-core/templates/story-tmpl.md +61 -0
- package/.bmad-core/templates/web-agent-startup-instructions-template.md +39 -0
- package/.bmad-core/utils/agent-switcher.ide.md +112 -0
- package/.bmad-core/utils/template-format.md +26 -0
- package/.bmad-core/utils/workflow-management.md +224 -0
- package/.bmad-core/web-bundles/agents/analyst.txt +1684 -0
- package/.bmad-core/web-bundles/agents/architect.txt +3584 -0
- package/.bmad-core/web-bundles/agents/bmad-master.txt +9491 -0
- package/.bmad-core/web-bundles/agents/bmad-orchestrator.txt +1466 -0
- package/{dist → .bmad-core/web-bundles}/agents/dev.txt +71 -179
- package/{dist → .bmad-core/web-bundles}/agents/pm.txt +1058 -624
- package/{dist → .bmad-core/web-bundles}/agents/po.txt +138 -337
- package/.bmad-core/web-bundles/agents/qa.txt +129 -0
- package/.bmad-core/web-bundles/agents/sm.txt +658 -0
- package/.bmad-core/web-bundles/agents/ux-expert.txt +1099 -0
- package/.bmad-core/web-bundles/teams/team-all.txt +10757 -0
- package/.bmad-core/web-bundles/teams/team-fullstack.txt +10109 -0
- package/.bmad-core/web-bundles/teams/team-no-ui.txt +8950 -0
- package/.bmad-core/workflows/brownfield-fullstack.yml +116 -0
- package/.bmad-core/workflows/brownfield-service.yml +117 -0
- package/.bmad-core/workflows/brownfield-ui.yml +127 -0
- package/.bmad-core/workflows/greenfield-fullstack.yml +177 -0
- package/.bmad-core/workflows/greenfield-service.yml +143 -0
- package/.bmad-core/workflows/greenfield-ui.yml +172 -0
- package/.claude/commands/analyst.md +63 -0
- package/.claude/commands/architect.md +70 -0
- package/.claude/commands/bmad-master.md +108 -0
- package/.claude/commands/bmad-orchestrator.md +85 -0
- package/.claude/commands/dev.md +74 -0
- package/.claude/commands/pm.md +63 -0
- package/.claude/commands/po.md +64 -0
- package/.claude/commands/qa.md +56 -0
- package/.claude/commands/sm.md +59 -0
- package/.claude/commands/ux-expert.md +70 -0
- package/.cursor/rules/analyst.mdc +77 -0
- package/.cursor/rules/architect.mdc +84 -0
- package/.cursor/rules/bmad-master.mdc +122 -0
- package/.cursor/rules/bmad-orchestrator.mdc +99 -0
- package/.cursor/rules/dev.mdc +88 -0
- package/.cursor/rules/pm.mdc +77 -0
- package/.cursor/rules/po.mdc +78 -0
- package/.cursor/rules/qa.mdc +70 -0
- package/.cursor/rules/sm.mdc +73 -0
- package/.cursor/rules/ux-expert.mdc +84 -0
- package/.roo/.roomodes +95 -0
- package/.roo/README.md +38 -0
- package/.vscode/extensions.json +6 -0
- package/.vscode/settings.json +75 -49
- package/.windsurf/rules/analyst.md +71 -0
- package/.windsurf/rules/architect.md +78 -0
- package/.windsurf/rules/bmad-master.md +116 -0
- package/.windsurf/rules/bmad-orchestrator.md +93 -0
- package/.windsurf/rules/dev.md +82 -0
- package/.windsurf/rules/pm.md +71 -0
- package/.windsurf/rules/po.md +72 -0
- package/.windsurf/rules/qa.md +64 -0
- package/.windsurf/rules/sm.md +67 -0
- package/.windsurf/rules/ux-expert.md +78 -0
- package/CHANGELOG.md +16 -459
- package/CONTRIBUTING.md +5 -168
- package/LICENSE +1 -1
- package/README.md +230 -77
- package/docs/bmad-workflow-guide.md +15 -19
- package/docs/claude-code-guide.md +119 -0
- package/docs/cursor-guide.md +127 -0
- package/docs/roo-code-guide.md +140 -0
- package/docs/sample-output/simple-fullstack-greenfield/prd.md +42 -0
- package/docs/versioning-and-releases.md +16 -8
- package/docs/versions.md +5 -4
- package/docs/windsurf-guide.md +127 -0
- package/expansion-packs/README.md +112 -2
- package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/README.md +9 -9
- package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/agents/infra-devops-platform.md +15 -14
- package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/checklists/infrastructure-checklist.md +1 -1
- package/expansion-packs/infrastructure-devops/manifest.yml +38 -0
- package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/tasks/review-infrastructure.md +4 -4
- package/expansion-packs/{bmad-infrastructure-devops → infrastructure-devops}/tasks/validate-infrastructure.md +4 -4
- package/expansion-packs/infrastructure-devops/templates/infrastructure-architecture-tmpl.md +415 -0
- package/expansion-packs/infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.md +0 -0
- package/package.json +11 -19
- package/tools/bmad-npx-wrapper.js +1 -1
- package/tools/builders/web-builder.js +28 -563
- package/tools/cli.js +22 -55
- package/tools/installer/README.md +53 -3
- package/tools/installer/bin/bmad.js +56 -294
- package/tools/installer/config/install.config.yml +139 -0
- package/tools/installer/lib/config-loader.js +34 -198
- package/tools/installer/lib/file-manager.js +7 -200
- package/tools/installer/lib/ide-setup.js +189 -545
- package/tools/installer/lib/installer.js +61 -1171
- package/tools/installer/package-lock.json +3 -3
- package/tools/installer/package.json +4 -4
- package/tools/installer/templates/claude-commands.md +7 -0
- package/tools/installer/templates/cursor-rules.md +22 -0
- package/tools/installer/templates/windsurf-rules.md +22 -0
- package/tools/lib/dependency-resolver.js +22 -22
- package/tools/upgraders/v3-to-v4-upgrader.js +43 -35
- package/tools/version-bump.js +1 -1
- package/tools/yaml-format.js +2 -2
- package/.github/FUNDING.yaml +0 -15
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -22
- package/.prettierignore +0 -21
- package/.prettierrc +0 -23
- package/bmad-core/agent-teams/team-all.yaml +0 -14
- package/bmad-core/agent-teams/team-fullstack.yaml +0 -18
- package/bmad-core/agent-teams/team-ide-minimal.yaml +0 -10
- package/bmad-core/agent-teams/team-no-ui.yaml +0 -13
- package/bmad-core/agents/architect.md +0 -62
- package/bmad-core/agents/bmad-master.md +0 -88
- package/bmad-core/agents/bmad-orchestrator.md +0 -135
- package/bmad-core/agents/dev.md +0 -56
- package/bmad-core/agents/qa.md +0 -54
- package/bmad-core/agents/sm.md +0 -45
- package/bmad-core/agents/ux-expert.md +0 -53
- package/bmad-core/core-config.yaml +0 -25
- package/bmad-core/data/bmad-kb.md +0 -803
- package/bmad-core/data/brainstorming-techniques.md +0 -36
- package/bmad-core/data/elicitation-methods.md +0 -134
- package/bmad-core/tasks/advanced-elicitation.md +0 -117
- package/bmad-core/tasks/create-brownfield-story.md +0 -355
- package/bmad-core/tasks/create-next-story.md +0 -113
- package/bmad-core/tasks/create-workflow-plan.md +0 -289
- package/bmad-core/tasks/document-project.md +0 -317
- package/bmad-core/tasks/facilitate-brainstorming-session.md +0 -136
- package/bmad-core/tasks/generate-ai-frontend-prompt.md +0 -51
- package/bmad-core/tasks/kb-mode-interaction.md +0 -70
- package/bmad-core/tasks/review-story.md +0 -145
- package/bmad-core/tasks/update-workflow-plan.md +0 -248
- package/bmad-core/tasks/validate-next-story.md +0 -134
- package/bmad-core/templates/architecture-tmpl.yaml +0 -650
- package/bmad-core/templates/brainstorming-output-tmpl.yaml +0 -156
- package/bmad-core/templates/brownfield-architecture-tmpl.yaml +0 -476
- package/bmad-core/templates/brownfield-prd-tmpl.yaml +0 -280
- package/bmad-core/templates/competitor-analysis-tmpl.yaml +0 -293
- package/bmad-core/templates/front-end-architecture-tmpl.yaml +0 -206
- package/bmad-core/templates/front-end-spec-tmpl.yaml +0 -349
- package/bmad-core/templates/fullstack-architecture-tmpl.yaml +0 -805
- package/bmad-core/templates/market-research-tmpl.yaml +0 -252
- package/bmad-core/templates/prd-tmpl.yaml +0 -202
- package/bmad-core/templates/project-brief-tmpl.yaml +0 -221
- package/bmad-core/templates/story-tmpl.yaml +0 -137
- package/bmad-core/workflows/brownfield-fullstack.yaml +0 -297
- package/bmad-core/workflows/brownfield-service.yaml +0 -187
- package/bmad-core/workflows/brownfield-ui.yaml +0 -197
- package/bmad-core/workflows/greenfield-fullstack.yaml +0 -240
- package/bmad-core/workflows/greenfield-service.yaml +0 -206
- package/bmad-core/workflows/greenfield-ui.yaml +0 -235
- package/common/tasks/create-doc.md +0 -79
- package/common/utils/bmad-doc-template.md +0 -325
- package/common/utils/workflow-management.md +0 -69
- package/dist/agents/analyst.txt +0 -2849
- package/dist/agents/architect.txt +0 -3505
- package/dist/agents/bmad-master.txt +0 -9271
- package/dist/agents/bmad-orchestrator.txt +0 -2006
- package/dist/agents/qa.txt +0 -388
- package/dist/agents/sm.txt +0 -672
- package/dist/agents/ux-expert.txt +0 -987
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +0 -2401
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +0 -1635
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +0 -825
- package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +0 -11504
- package/dist/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.txt +0 -2023
- package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +0 -2052
- package/dist/teams/team-all.txt +0 -11572
- package/dist/teams/team-fullstack.txt +0 -10903
- package/dist/teams/team-ide-minimal.txt +0 -4346
- package/dist/teams/team-no-ui.txt +0 -9458
- package/docs/GUIDING-PRINCIPLES.md +0 -91
- package/docs/agentic-tools/claude-code-guide.md +0 -19
- package/docs/agentic-tools/cline-guide.md +0 -16
- package/docs/agentic-tools/cursor-guide.md +0 -14
- package/docs/agentic-tools/gemini-cli-guide.md +0 -32
- package/docs/agentic-tools/github-copilot-guide.md +0 -42
- package/docs/agentic-tools/roo-code-guide.md +0 -15
- package/docs/agentic-tools/trae-guide.md +0 -14
- package/docs/agentic-tools/windsurf-guide.md +0 -14
- package/docs/core-architecture.md +0 -219
- package/docs/expansion-packs.md +0 -280
- package/docs/how-to-contribute-with-pull-requests.md +0 -158
- package/docs/template-markup-references.md +0 -86
- package/docs/user-guide.md +0 -1142
- package/docs/working-in-the-brownfield.md +0 -361
- package/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml +0 -13
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +0 -59
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +0 -67
- package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +0 -52
- package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-design-checklist.md +0 -201
- package/expansion-packs/bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md +0 -160
- package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +0 -7
- package/expansion-packs/bmad-2d-phaser-game-dev/data/bmad-kb.md +0 -254
- package/expansion-packs/bmad-2d-phaser-game-dev/data/development-guidelines.md +0 -651
- package/expansion-packs/bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md +0 -111
- package/expansion-packs/bmad-2d-phaser-game-dev/tasks/create-game-story.md +0 -216
- package/expansion-packs/bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md +0 -308
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +0 -613
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +0 -356
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +0 -343
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +0 -253
- package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +0 -484
- package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml +0 -183
- package/expansion-packs/bmad-2d-phaser-game-dev/workflows/game-prototype.yaml +0 -175
- package/expansion-packs/bmad-creator-tools/README.md +0 -8
- package/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.md +0 -54
- package/expansion-packs/bmad-creator-tools/config.yaml +0 -5
- package/expansion-packs/bmad-creator-tools/tasks/generate-expansion-pack.md +0 -1020
- package/expansion-packs/bmad-creator-tools/templates/agent-teams-tmpl.yaml +0 -178
- package/expansion-packs/bmad-creator-tools/templates/agent-tmpl.yaml +0 -154
- package/expansion-packs/bmad-creator-tools/templates/expansion-pack-plan-tmpl.yaml +0 -120
- package/expansion-packs/bmad-infrastructure-devops/config.yaml +0 -8
- package/expansion-packs/bmad-infrastructure-devops/data/bmad-kb.md +0 -308
- package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +0 -424
- package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +0 -629
- package/tools/bump-all-versions.js +0 -107
- package/tools/bump-core-version.js +0 -57
- package/tools/bump-expansion-version.js +0 -78
- package/tools/installer/config/ide-agent-config.yaml +0 -58
- package/tools/installer/config/install.config.yaml +0 -91
- package/tools/lib/yaml-utils.js +0 -29
- package/tools/md-assets/web-agent-startup-instructions.md +0 -39
- package/tools/update-expansion-version.js +0 -54
- /package/{bmad-core → .bmad-core}/checklists/architect-checklist.md +0 -0
- /package/{bmad-core → .bmad-core}/checklists/pm-checklist.md +0 -0
- /package/{bmad-core → .bmad-core}/checklists/po-master-checklist.md +0 -0
- /package/{bmad-core → .bmad-core}/checklists/story-dod-checklist.md +0 -0
- /package/{bmad-core → .bmad-core}/data/technical-preferences.md +0 -0
- /package/{bmad-core → .bmad-core}/tasks/brownfield-create-epic.md +0 -0
- /package/{bmad-core → .bmad-core}/tasks/brownfield-create-story.md +0 -0
- /package/{bmad-core → .bmad-core}/tasks/correct-course.md +0 -0
- /package/{bmad-core → .bmad-core}/tasks/create-deep-research-prompt.md +0 -0
- /package/.github/workflows/{release.yaml → release.yml} +0 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
installation-options:
|
|
2
|
+
full:
|
|
3
|
+
name: Complete BMAD Core
|
|
4
|
+
description: Copy the entire .bmad-core folder with all agents, templates, and tools
|
|
5
|
+
action: copy-folder
|
|
6
|
+
source: .bmad-core
|
|
7
|
+
single-agent:
|
|
8
|
+
name: Single Agent
|
|
9
|
+
description: Select and install a single agent with its dependencies
|
|
10
|
+
action: copy-agent
|
|
11
|
+
agent-dependencies:
|
|
12
|
+
core-files:
|
|
13
|
+
- .bmad-core/utils/template-format.md
|
|
14
|
+
dev:
|
|
15
|
+
- .bmad-core/templates/story-tmpl.md
|
|
16
|
+
- .bmad-core/checklists/story-dod-checklist.md
|
|
17
|
+
pm:
|
|
18
|
+
- .bmad-core/templates/prd-tmpl.md
|
|
19
|
+
- .bmad-core/templates/brownfield-prd-tmpl.md
|
|
20
|
+
- .bmad-core/checklists/pm-checklist.md
|
|
21
|
+
- .bmad-core/checklists/change-checklist.md
|
|
22
|
+
- .bmad-core/tasks/advanced-elicitation.md
|
|
23
|
+
- .bmad-core/tasks/create-doc.md
|
|
24
|
+
- .bmad-core/tasks/correct-course.md
|
|
25
|
+
- .bmad-core/tasks/create-deep-research-prompt.md
|
|
26
|
+
- .bmad-core/tasks/brownfield-create-epic.md
|
|
27
|
+
- .bmad-core/tasks/brownfield-create-story.md
|
|
28
|
+
- .bmad-core/tasks/execute-checklist.md
|
|
29
|
+
- .bmad-core/tasks/shard-doc.md
|
|
30
|
+
architect:
|
|
31
|
+
- .bmad-core/templates/architecture-tmpl.md
|
|
32
|
+
- .bmad-core/checklists/architect-checklist.md
|
|
33
|
+
sm:
|
|
34
|
+
- .bmad-core/templates/story-tmpl.md
|
|
35
|
+
- .bmad-core/checklists/story-draft-checklist.md
|
|
36
|
+
- .bmad-core/workflows/*.yml
|
|
37
|
+
po:
|
|
38
|
+
- .bmad-core/checklists/po-master-checklist.md
|
|
39
|
+
- .bmad-core/templates/acceptance-criteria-tmpl.md
|
|
40
|
+
analyst:
|
|
41
|
+
- .bmad-core/templates/prd-tmpl.md
|
|
42
|
+
- .bmad-core/tasks/advanced-elicitation.md
|
|
43
|
+
qa:
|
|
44
|
+
- .bmad-core/checklists/story-dod-checklist.md
|
|
45
|
+
- .bmad-core/templates/test-plan-tmpl.md
|
|
46
|
+
ux-expert:
|
|
47
|
+
- .bmad-core/templates/ux-tmpl.md
|
|
48
|
+
bmad-master:
|
|
49
|
+
- .bmad-core/templates/*.md
|
|
50
|
+
- .bmad-core/tasks/*.md
|
|
51
|
+
- .bmad-core/schemas/*.yml
|
|
52
|
+
bmad-orchestrator:
|
|
53
|
+
- .bmad-core/agent-teams/*.yml
|
|
54
|
+
- .bmad-core/workflows/*.yml
|
|
55
|
+
ide-configurations:
|
|
56
|
+
cursor:
|
|
57
|
+
name: Cursor
|
|
58
|
+
rule-dir: .cursor/rules/
|
|
59
|
+
format: multi-file
|
|
60
|
+
command-suffix: .mdc
|
|
61
|
+
instructions: |
|
|
62
|
+
# To use BMAD agents in Cursor:
|
|
63
|
+
# 1. Press Ctrl+L (Cmd+L on Mac) to open the chat
|
|
64
|
+
# 2. Type @agent-name (e.g., "@dev", "@pm", "@architect")
|
|
65
|
+
# 3. The agent will adopt that persona for the conversation
|
|
66
|
+
claude-code:
|
|
67
|
+
name: Claude Code
|
|
68
|
+
rule-dir: .claude/commands/
|
|
69
|
+
format: multi-file
|
|
70
|
+
command-suffix: .md
|
|
71
|
+
instructions: |
|
|
72
|
+
# To use BMAD agents in Claude Code:
|
|
73
|
+
# 1. Type /agent-name (e.g., "/dev", "/pm", "/architect")
|
|
74
|
+
# 2. Claude will switch to that agent's persona
|
|
75
|
+
windsurf:
|
|
76
|
+
name: Windsurf
|
|
77
|
+
rule-dir: .windsurf/rules/
|
|
78
|
+
format: multi-file
|
|
79
|
+
command-suffix: .md
|
|
80
|
+
instructions: |
|
|
81
|
+
# To use BMAD agents in Windsurf:
|
|
82
|
+
# 1. Type @agent-name (e.g., "@dev", "@pm")
|
|
83
|
+
# 2. Windsurf will adopt that agent's persona
|
|
84
|
+
roo:
|
|
85
|
+
name: Roo Code
|
|
86
|
+
format: custom-modes
|
|
87
|
+
file: .roomodes
|
|
88
|
+
instructions: |
|
|
89
|
+
# To use BMAD agents in Roo Code:
|
|
90
|
+
# 1. Open the mode selector (usually in the status bar)
|
|
91
|
+
# 2. Select any bmad-{agent} mode (e.g., "bmad-dev", "bmad-pm")
|
|
92
|
+
# 3. The AI will adopt that agent's full personality and capabilities
|
|
93
|
+
cline:
|
|
94
|
+
name: Cline
|
|
95
|
+
format: unknown
|
|
96
|
+
instructions: |
|
|
97
|
+
# Cline configuration coming soon
|
|
98
|
+
# Manual setup: Copy IDE agent files to your Cline configuration
|
|
99
|
+
available-agents:
|
|
100
|
+
- id: analyst
|
|
101
|
+
name: Business Analyst
|
|
102
|
+
file: .bmad-core/agents/analyst.md
|
|
103
|
+
description: Requirements gathering and analysis
|
|
104
|
+
- id: pm
|
|
105
|
+
name: Product Manager
|
|
106
|
+
file: .bmad-core/agents/pm.md
|
|
107
|
+
description: Product strategy and roadmap planning
|
|
108
|
+
- id: architect
|
|
109
|
+
name: Solution Architect
|
|
110
|
+
file: .bmad-core/agents/architect.md
|
|
111
|
+
description: Technical design and architecture
|
|
112
|
+
- id: po
|
|
113
|
+
name: Product Owner
|
|
114
|
+
file: .bmad-core/agents/po.md
|
|
115
|
+
description: Backlog management and prioritization
|
|
116
|
+
- id: sm
|
|
117
|
+
name: Scrum Master
|
|
118
|
+
file: .bmad-core/agents/sm.md
|
|
119
|
+
description: Agile process and story creation
|
|
120
|
+
- id: dev
|
|
121
|
+
name: Developer
|
|
122
|
+
file: .bmad-core/agents/dev.md
|
|
123
|
+
description: Code implementation and testing
|
|
124
|
+
- id: qa
|
|
125
|
+
name: QA Engineer
|
|
126
|
+
file: .bmad-core/agents/qa.md
|
|
127
|
+
description: Quality assurance and testing
|
|
128
|
+
- id: ux-expert
|
|
129
|
+
name: UX Expert
|
|
130
|
+
file: .bmad-core/agents/ux-expert.md
|
|
131
|
+
description: User experience design
|
|
132
|
+
- id: bmad-master
|
|
133
|
+
name: BMAD Master
|
|
134
|
+
file: .bmad-core/agents/bmad-master.md
|
|
135
|
+
description: BMAD framework expert and guide
|
|
136
|
+
- id: bmad-orchestrator
|
|
137
|
+
name: BMAD Orchestrator
|
|
138
|
+
file: .bmad-core/agents/bmad-orchestrator.md
|
|
139
|
+
description: Multi-agent workflow coordinator
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
const fs = require('fs-extra');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const yaml = require('js-yaml');
|
|
4
|
-
const { extractYamlFromAgent } = require('../../lib/yaml-utils');
|
|
5
4
|
|
|
6
5
|
class ConfigLoader {
|
|
7
6
|
constructor() {
|
|
8
|
-
this.configPath = path.join(__dirname, '..', 'config', 'install.config.
|
|
7
|
+
this.configPath = path.join(__dirname, '..', 'config', 'install.config.yml');
|
|
9
8
|
this.config = null;
|
|
10
9
|
}
|
|
11
10
|
|
|
@@ -27,130 +26,48 @@ class ConfigLoader {
|
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
async getAvailableAgents() {
|
|
30
|
-
const
|
|
29
|
+
const config = await this.load();
|
|
30
|
+
return config['available-agents'] || [];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async getAgentDependencies(agentId) {
|
|
34
|
+
// Use DependencyResolver to dynamically parse agent dependencies
|
|
35
|
+
const DependencyResolver = require('../../lib/dependency-resolver');
|
|
36
|
+
const resolver = new DependencyResolver(path.join(__dirname, '..', '..', '..'));
|
|
31
37
|
|
|
32
38
|
try {
|
|
33
|
-
const
|
|
34
|
-
const agents = [];
|
|
39
|
+
const agentDeps = await resolver.resolveAgentDependencies(agentId);
|
|
35
40
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const agentPath = path.join(agentsDir, entry.name);
|
|
39
|
-
const agentId = path.basename(entry.name, '.md');
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
const agentContent = await fs.readFile(agentPath, 'utf8');
|
|
43
|
-
|
|
44
|
-
// Extract YAML block from agent file
|
|
45
|
-
const yamlContentText = extractYamlFromAgent(agentContent);
|
|
46
|
-
if (yamlContentText) {
|
|
47
|
-
const yamlContent = yaml.load(yamlContentText);
|
|
48
|
-
const agentConfig = yamlContent.agent || {};
|
|
49
|
-
|
|
50
|
-
agents.push({
|
|
51
|
-
id: agentId,
|
|
52
|
-
name: agentConfig.title || agentConfig.name || agentId,
|
|
53
|
-
file: `bmad-core/agents/${entry.name}`,
|
|
54
|
-
description: agentConfig.whenToUse || 'No description available'
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
} catch (error) {
|
|
58
|
-
console.warn(`Failed to read agent ${entry.name}: ${error.message}`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
41
|
+
// Convert to flat list of file paths
|
|
42
|
+
const depPaths = [];
|
|
62
43
|
|
|
63
|
-
//
|
|
64
|
-
|
|
44
|
+
// Add core files
|
|
45
|
+
const config = await this.load();
|
|
46
|
+
const coreFiles = config['agent-dependencies']?.['core-files'] || [];
|
|
47
|
+
depPaths.push(...coreFiles);
|
|
65
48
|
|
|
66
|
-
|
|
67
|
-
} catch (error) {
|
|
68
|
-
console.warn(`Failed to read agents directory: ${error.message}`);
|
|
69
|
-
return [];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
async getAvailableExpansionPacks() {
|
|
74
|
-
const expansionPacksDir = path.join(this.getBmadCorePath(), '..', 'expansion-packs');
|
|
75
|
-
|
|
76
|
-
try {
|
|
77
|
-
const entries = await fs.readdir(expansionPacksDir, { withFileTypes: true });
|
|
78
|
-
const expansionPacks = [];
|
|
49
|
+
// Add agent file itself is already handled by installer
|
|
79
50
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
try {
|
|
86
|
-
// Read config.yaml
|
|
87
|
-
const configContent = await fs.readFile(configPath, 'utf8');
|
|
88
|
-
const config = yaml.load(configContent);
|
|
89
|
-
|
|
90
|
-
expansionPacks.push({
|
|
91
|
-
id: entry.name,
|
|
92
|
-
name: config.name || entry.name,
|
|
93
|
-
description: config['short-title'] || config.description || 'No description available',
|
|
94
|
-
fullDescription: config.description || config['short-title'] || 'No description available',
|
|
95
|
-
version: config.version || '1.0.0',
|
|
96
|
-
author: config.author || 'BMad Team',
|
|
97
|
-
packPath: packPath,
|
|
98
|
-
dependencies: config.dependencies?.agents || []
|
|
99
|
-
});
|
|
100
|
-
} catch (error) {
|
|
101
|
-
// Fallback if config.yaml doesn't exist or can't be read
|
|
102
|
-
console.warn(`Failed to read config for expansion pack ${entry.name}: ${error.message}`);
|
|
103
|
-
|
|
104
|
-
// Try to derive info from directory name as fallback
|
|
105
|
-
const name = entry.name
|
|
106
|
-
.split('-')
|
|
107
|
-
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
|
108
|
-
.join(' ');
|
|
109
|
-
|
|
110
|
-
expansionPacks.push({
|
|
111
|
-
id: entry.name,
|
|
112
|
-
name: name,
|
|
113
|
-
description: 'No description available',
|
|
114
|
-
fullDescription: 'No description available',
|
|
115
|
-
version: '1.0.0',
|
|
116
|
-
author: 'BMad Team',
|
|
117
|
-
packPath: packPath,
|
|
118
|
-
dependencies: []
|
|
119
|
-
});
|
|
120
|
-
}
|
|
51
|
+
// Add all resolved resources
|
|
52
|
+
for (const resource of agentDeps.resources) {
|
|
53
|
+
const filePath = `.bmad-core/${resource.type}/${resource.id}.md`;
|
|
54
|
+
if (!depPaths.includes(filePath)) {
|
|
55
|
+
depPaths.push(filePath);
|
|
121
56
|
}
|
|
122
57
|
}
|
|
123
58
|
|
|
124
|
-
return
|
|
59
|
+
return depPaths;
|
|
125
60
|
} catch (error) {
|
|
126
|
-
console.warn(`Failed to
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const agentDeps = await resolver.resolveAgentDependencies(agentId);
|
|
137
|
-
|
|
138
|
-
// Convert to flat list of file paths
|
|
139
|
-
const depPaths = [];
|
|
140
|
-
|
|
141
|
-
// Core files and utilities are included automatically by DependencyResolver
|
|
142
|
-
|
|
143
|
-
// Add agent file itself is already handled by installer
|
|
144
|
-
|
|
145
|
-
// Add all resolved resources
|
|
146
|
-
for (const resource of agentDeps.resources) {
|
|
147
|
-
const filePath = `.bmad-core/${resource.type}/${resource.id}.md`;
|
|
148
|
-
if (!depPaths.includes(filePath)) {
|
|
149
|
-
depPaths.push(filePath);
|
|
150
|
-
}
|
|
61
|
+
console.warn(`Failed to dynamically resolve dependencies for ${agentId}: ${error.message}`);
|
|
62
|
+
|
|
63
|
+
// Fall back to static config
|
|
64
|
+
const config = await this.load();
|
|
65
|
+
const dependencies = config['agent-dependencies'] || {};
|
|
66
|
+
const coreFiles = dependencies['core-files'] || [];
|
|
67
|
+
const agentDeps = dependencies[agentId] || [];
|
|
68
|
+
|
|
69
|
+
return [...coreFiles, ...agentDeps];
|
|
151
70
|
}
|
|
152
|
-
|
|
153
|
-
return depPaths;
|
|
154
71
|
}
|
|
155
72
|
|
|
156
73
|
async getIdeConfiguration(ide) {
|
|
@@ -160,94 +77,13 @@ class ConfigLoader {
|
|
|
160
77
|
}
|
|
161
78
|
|
|
162
79
|
getBmadCorePath() {
|
|
163
|
-
// Get the path to bmad-core relative to the installer (now under tools)
|
|
164
|
-
return path.join(__dirname, '..', '..', '..', 'bmad-core');
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
getDistPath() {
|
|
168
|
-
// Get the path to dist directory relative to the installer
|
|
169
|
-
return path.join(__dirname, '..', '..', '..', 'dist');
|
|
80
|
+
// Get the path to .bmad-core relative to the installer (now under tools)
|
|
81
|
+
return path.join(__dirname, '..', '..', '..', '.bmad-core');
|
|
170
82
|
}
|
|
171
83
|
|
|
172
84
|
getAgentPath(agentId) {
|
|
173
85
|
return path.join(this.getBmadCorePath(), 'agents', `${agentId}.md`);
|
|
174
86
|
}
|
|
175
|
-
|
|
176
|
-
async getAvailableTeams() {
|
|
177
|
-
const teamsDir = path.join(this.getBmadCorePath(), 'agent-teams');
|
|
178
|
-
|
|
179
|
-
try {
|
|
180
|
-
const entries = await fs.readdir(teamsDir, { withFileTypes: true });
|
|
181
|
-
const teams = [];
|
|
182
|
-
|
|
183
|
-
for (const entry of entries) {
|
|
184
|
-
if (entry.isFile() && entry.name.endsWith('.yaml')) {
|
|
185
|
-
const teamPath = path.join(teamsDir, entry.name);
|
|
186
|
-
|
|
187
|
-
try {
|
|
188
|
-
const teamContent = await fs.readFile(teamPath, 'utf8');
|
|
189
|
-
const teamConfig = yaml.load(teamContent);
|
|
190
|
-
|
|
191
|
-
if (teamConfig.bundle) {
|
|
192
|
-
teams.push({
|
|
193
|
-
id: path.basename(entry.name, '.yaml'),
|
|
194
|
-
name: teamConfig.bundle.name || entry.name,
|
|
195
|
-
description: teamConfig.bundle.description || 'Team configuration',
|
|
196
|
-
icon: teamConfig.bundle.icon || '📋'
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
} catch (error) {
|
|
200
|
-
console.warn(`Warning: Could not load team config ${entry.name}: ${error.message}`);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return teams;
|
|
206
|
-
} catch (error) {
|
|
207
|
-
console.warn(`Warning: Could not scan teams directory: ${error.message}`);
|
|
208
|
-
return [];
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
getTeamPath(teamId) {
|
|
213
|
-
return path.join(this.getBmadCorePath(), 'agent-teams', `${teamId}.yaml`);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
async getTeamDependencies(teamId) {
|
|
217
|
-
// Use DependencyResolver to dynamically parse team dependencies
|
|
218
|
-
const DependencyResolver = require('../../lib/dependency-resolver');
|
|
219
|
-
const resolver = new DependencyResolver(path.join(__dirname, '..', '..', '..'));
|
|
220
|
-
|
|
221
|
-
try {
|
|
222
|
-
const teamDeps = await resolver.resolveTeamDependencies(teamId);
|
|
223
|
-
|
|
224
|
-
// Convert to flat list of file paths
|
|
225
|
-
const depPaths = [];
|
|
226
|
-
|
|
227
|
-
// Add team config file
|
|
228
|
-
depPaths.push(`.bmad-core/agent-teams/${teamId}.yaml`);
|
|
229
|
-
|
|
230
|
-
// Add all agents
|
|
231
|
-
for (const agent of teamDeps.agents) {
|
|
232
|
-
const filePath = `.bmad-core/agents/${agent.id}.md`;
|
|
233
|
-
if (!depPaths.includes(filePath)) {
|
|
234
|
-
depPaths.push(filePath);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
// Add all resolved resources
|
|
239
|
-
for (const resource of teamDeps.resources) {
|
|
240
|
-
const filePath = `.bmad-core/${resource.type}/${resource.id}.${resource.type === 'workflows' ? 'yaml' : 'md'}`;
|
|
241
|
-
if (!depPaths.includes(filePath)) {
|
|
242
|
-
depPaths.push(filePath);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
return depPaths;
|
|
247
|
-
} catch (error) {
|
|
248
|
-
throw new Error(`Failed to resolve team dependencies for ${teamId}: ${error.message}`);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
87
|
}
|
|
252
88
|
|
|
253
89
|
module.exports = new ConfigLoader();
|
|
@@ -2,7 +2,6 @@ const fs = require("fs-extra");
|
|
|
2
2
|
const path = require("path");
|
|
3
3
|
const crypto = require("crypto");
|
|
4
4
|
const glob = require("glob");
|
|
5
|
-
const yaml = require("js-yaml");
|
|
6
5
|
|
|
7
6
|
// Dynamic import for ES module
|
|
8
7
|
let chalk;
|
|
@@ -17,7 +16,7 @@ async function initializeModules() {
|
|
|
17
16
|
class FileManager {
|
|
18
17
|
constructor() {
|
|
19
18
|
this.manifestDir = ".bmad-core";
|
|
20
|
-
this.manifestFile = "install-manifest.
|
|
19
|
+
this.manifestFile = "install-manifest.yml";
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
async copyFile(source, destination) {
|
|
@@ -47,7 +46,7 @@ class FileManager {
|
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
async copyGlobPattern(pattern, sourceDir, destDir
|
|
49
|
+
async copyGlobPattern(pattern, sourceDir, destDir) {
|
|
51
50
|
const files = glob.sync(pattern, { cwd: sourceDir });
|
|
52
51
|
const copied = [];
|
|
53
52
|
|
|
@@ -55,17 +54,7 @@ class FileManager {
|
|
|
55
54
|
const sourcePath = path.join(sourceDir, file);
|
|
56
55
|
const destPath = path.join(destDir, file);
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
const needsRootReplacement = rootValue && (file.endsWith('.md') || file.endsWith('.yaml') || file.endsWith('.yml'));
|
|
60
|
-
|
|
61
|
-
let success = false;
|
|
62
|
-
if (needsRootReplacement) {
|
|
63
|
-
success = await this.copyFileWithRootReplacement(sourcePath, destPath, rootValue);
|
|
64
|
-
} else {
|
|
65
|
-
success = await this.copyFile(sourcePath, destPath);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (success) {
|
|
57
|
+
if (await this.copyFile(sourcePath, destPath)) {
|
|
69
58
|
copied.push(file);
|
|
70
59
|
}
|
|
71
60
|
}
|
|
@@ -93,24 +82,13 @@ class FileManager {
|
|
|
93
82
|
this.manifestFile
|
|
94
83
|
);
|
|
95
84
|
|
|
96
|
-
// Read version from core-config.yaml
|
|
97
|
-
const coreConfigPath = path.join(__dirname, "../../../bmad-core/core-config.yaml");
|
|
98
|
-
let coreVersion = "unknown";
|
|
99
|
-
try {
|
|
100
|
-
const coreConfigContent = await fs.readFile(coreConfigPath, "utf8");
|
|
101
|
-
const coreConfig = yaml.load(coreConfigContent);
|
|
102
|
-
coreVersion = coreConfig.version || "unknown";
|
|
103
|
-
} catch (error) {
|
|
104
|
-
console.warn("Could not read version from core-config.yaml, using 'unknown'");
|
|
105
|
-
}
|
|
106
|
-
|
|
107
85
|
const manifest = {
|
|
108
|
-
version:
|
|
86
|
+
version: require("../../../package.json").version,
|
|
109
87
|
installed_at: new Date().toISOString(),
|
|
110
88
|
install_type: config.installType,
|
|
111
89
|
agent: config.agent || null,
|
|
90
|
+
ide_setup: config.ide || null,
|
|
112
91
|
ides_setup: config.ides || [],
|
|
113
|
-
expansion_packs: config.expansionPacks || [],
|
|
114
92
|
files: [],
|
|
115
93
|
};
|
|
116
94
|
|
|
@@ -128,7 +106,7 @@ class FileManager {
|
|
|
128
106
|
|
|
129
107
|
// Write manifest
|
|
130
108
|
await fs.ensureDir(path.dirname(manifestPath));
|
|
131
|
-
await fs.writeFile(manifestPath,
|
|
109
|
+
await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2));
|
|
132
110
|
|
|
133
111
|
return manifest;
|
|
134
112
|
}
|
|
@@ -142,22 +120,7 @@ class FileManager {
|
|
|
142
120
|
|
|
143
121
|
try {
|
|
144
122
|
const content = await fs.readFile(manifestPath, "utf8");
|
|
145
|
-
return
|
|
146
|
-
} catch (error) {
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
async readExpansionPackManifest(installDir, packId) {
|
|
152
|
-
const manifestPath = path.join(
|
|
153
|
-
installDir,
|
|
154
|
-
`.${packId}`,
|
|
155
|
-
this.manifestFile
|
|
156
|
-
);
|
|
157
|
-
|
|
158
|
-
try {
|
|
159
|
-
const content = await fs.readFile(manifestPath, "utf8");
|
|
160
|
-
return yaml.load(content);
|
|
123
|
+
return JSON.parse(content);
|
|
161
124
|
} catch (error) {
|
|
162
125
|
return null;
|
|
163
126
|
}
|
|
@@ -178,33 +141,6 @@ class FileManager {
|
|
|
178
141
|
return modified;
|
|
179
142
|
}
|
|
180
143
|
|
|
181
|
-
async checkFileIntegrity(installDir, manifest) {
|
|
182
|
-
const result = {
|
|
183
|
-
missing: [],
|
|
184
|
-
modified: []
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
for (const file of manifest.files) {
|
|
188
|
-
const filePath = path.join(installDir, file.path);
|
|
189
|
-
|
|
190
|
-
// Skip checking the manifest file itself - it will always be different due to timestamps
|
|
191
|
-
if (file.path.endsWith('install-manifest.yaml')) {
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
if (!(await this.pathExists(filePath))) {
|
|
196
|
-
result.missing.push(file.path);
|
|
197
|
-
} else {
|
|
198
|
-
const currentHash = await this.calculateFileHash(filePath);
|
|
199
|
-
if (currentHash && currentHash !== file.hash) {
|
|
200
|
-
result.modified.push(file.path);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
return result;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
144
|
async backupFile(filePath) {
|
|
209
145
|
const backupPath = filePath + ".bak";
|
|
210
146
|
let counter = 1;
|
|
@@ -245,135 +181,6 @@ class FileManager {
|
|
|
245
181
|
async removeDirectory(dirPath) {
|
|
246
182
|
await fs.remove(dirPath);
|
|
247
183
|
}
|
|
248
|
-
|
|
249
|
-
async createExpansionPackManifest(installDir, packId, config, files) {
|
|
250
|
-
const manifestPath = path.join(
|
|
251
|
-
installDir,
|
|
252
|
-
`.${packId}`,
|
|
253
|
-
this.manifestFile
|
|
254
|
-
);
|
|
255
|
-
|
|
256
|
-
const manifest = {
|
|
257
|
-
version: config.expansionPackVersion || require("../../../package.json").version,
|
|
258
|
-
installed_at: new Date().toISOString(),
|
|
259
|
-
install_type: config.installType,
|
|
260
|
-
expansion_pack_id: config.expansionPackId,
|
|
261
|
-
expansion_pack_name: config.expansionPackName,
|
|
262
|
-
ides_setup: config.ides || [],
|
|
263
|
-
files: [],
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
// Add file information
|
|
267
|
-
for (const file of files) {
|
|
268
|
-
const filePath = path.join(installDir, file);
|
|
269
|
-
const hash = await this.calculateFileHash(filePath);
|
|
270
|
-
|
|
271
|
-
manifest.files.push({
|
|
272
|
-
path: file,
|
|
273
|
-
hash: hash,
|
|
274
|
-
modified: false,
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// Write manifest
|
|
279
|
-
await fs.ensureDir(path.dirname(manifestPath));
|
|
280
|
-
await fs.writeFile(manifestPath, yaml.dump(manifest, { indent: 2 }));
|
|
281
|
-
|
|
282
|
-
return manifest;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
async modifyCoreConfig(installDir, config) {
|
|
286
|
-
const coreConfigPath = path.join(installDir, '.bmad-core', 'core-config.yaml');
|
|
287
|
-
|
|
288
|
-
try {
|
|
289
|
-
// Read the existing core-config.yaml
|
|
290
|
-
const coreConfigContent = await fs.readFile(coreConfigPath, 'utf8');
|
|
291
|
-
const coreConfig = yaml.load(coreConfigContent);
|
|
292
|
-
|
|
293
|
-
// Modify sharding settings if provided
|
|
294
|
-
if (config.prdSharded !== undefined) {
|
|
295
|
-
coreConfig.prd.prdSharded = config.prdSharded;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
if (config.architectureSharded !== undefined) {
|
|
299
|
-
coreConfig.architecture.architectureSharded = config.architectureSharded;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
// Write back the modified config
|
|
303
|
-
await fs.writeFile(coreConfigPath, yaml.dump(coreConfig, { indent: 2 }));
|
|
304
|
-
|
|
305
|
-
return true;
|
|
306
|
-
} catch (error) {
|
|
307
|
-
await initializeModules();
|
|
308
|
-
console.error(chalk.red(`Failed to modify core-config.yaml:`), error.message);
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
async copyFileWithRootReplacement(source, destination, rootValue) {
|
|
314
|
-
try {
|
|
315
|
-
// Read the source file content
|
|
316
|
-
const fs = require('fs').promises;
|
|
317
|
-
const content = await fs.readFile(source, 'utf8');
|
|
318
|
-
|
|
319
|
-
// Replace {root} with the specified root value
|
|
320
|
-
const updatedContent = content.replace(/\{root\}/g, rootValue);
|
|
321
|
-
|
|
322
|
-
// Ensure directory exists
|
|
323
|
-
await this.ensureDirectory(path.dirname(destination));
|
|
324
|
-
|
|
325
|
-
// Write the updated content
|
|
326
|
-
await fs.writeFile(destination, updatedContent, 'utf8');
|
|
327
|
-
|
|
328
|
-
return true;
|
|
329
|
-
} catch (error) {
|
|
330
|
-
await initializeModules();
|
|
331
|
-
console.error(chalk.red(`Failed to copy ${source} with root replacement:`), error.message);
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
async copyDirectoryWithRootReplacement(source, destination, rootValue, fileExtensions = ['.md', '.yaml', '.yml']) {
|
|
337
|
-
try {
|
|
338
|
-
await initializeModules(); // Ensure chalk is initialized
|
|
339
|
-
await this.ensureDirectory(destination);
|
|
340
|
-
|
|
341
|
-
// Get all files in source directory
|
|
342
|
-
const files = glob.sync('**/*', {
|
|
343
|
-
cwd: source,
|
|
344
|
-
nodir: true
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
let replacedCount = 0;
|
|
348
|
-
|
|
349
|
-
for (const file of files) {
|
|
350
|
-
const sourcePath = path.join(source, file);
|
|
351
|
-
const destPath = path.join(destination, file);
|
|
352
|
-
|
|
353
|
-
// Check if this file type should have {root} replacement
|
|
354
|
-
const shouldReplace = fileExtensions.some(ext => file.endsWith(ext));
|
|
355
|
-
|
|
356
|
-
if (shouldReplace) {
|
|
357
|
-
if (await this.copyFileWithRootReplacement(sourcePath, destPath, rootValue)) {
|
|
358
|
-
replacedCount++;
|
|
359
|
-
}
|
|
360
|
-
} else {
|
|
361
|
-
// Regular copy for files that don't need replacement
|
|
362
|
-
await this.copyFile(sourcePath, destPath);
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
if (replacedCount > 0) {
|
|
367
|
-
console.log(chalk.dim(` Processed ${replacedCount} files with {root} replacement`));
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
return true;
|
|
371
|
-
} catch (error) {
|
|
372
|
-
await initializeModules();
|
|
373
|
-
console.error(chalk.red(`Failed to copy directory ${source} with root replacement:`), error.message);
|
|
374
|
-
return false;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
184
|
}
|
|
378
185
|
|
|
379
186
|
module.exports = new FileManager();
|