bmad-method 6.3.1-next.2 → 6.3.1-next.21

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 (160) hide show
  1. package/package.json +3 -3
  2. package/src/bmm-skills/1-analysis/bmad-agent-analyst/SKILL.md +51 -36
  3. package/src/bmm-skills/1-analysis/bmad-agent-analyst/customize.toml +90 -0
  4. package/src/bmm-skills/1-analysis/bmad-agent-tech-writer/SKILL.md +50 -33
  5. package/src/bmm-skills/1-analysis/bmad-agent-tech-writer/customize.toml +81 -0
  6. package/src/bmm-skills/1-analysis/bmad-document-project/SKILL.md +57 -1
  7. package/src/bmm-skills/1-analysis/bmad-document-project/customize.toml +41 -0
  8. package/src/bmm-skills/1-analysis/bmad-document-project/workflows/deep-dive-instructions.md +1 -0
  9. package/src/bmm-skills/1-analysis/bmad-document-project/workflows/full-scan-instructions.md +1 -0
  10. package/src/bmm-skills/1-analysis/bmad-prfaq/SKILL.md +48 -9
  11. package/src/bmm-skills/1-analysis/bmad-prfaq/customize.toml +41 -0
  12. package/src/bmm-skills/1-analysis/bmad-prfaq/references/verdict.md +4 -0
  13. package/src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md +44 -9
  14. package/src/bmm-skills/1-analysis/bmad-product-brief/customize.toml +47 -0
  15. package/src/bmm-skills/1-analysis/bmad-product-brief/prompts/contextual-discovery.md +8 -7
  16. package/src/bmm-skills/1-analysis/bmad-product-brief/prompts/draft-and-review.md +6 -5
  17. package/src/bmm-skills/1-analysis/bmad-product-brief/prompts/finalize.md +4 -1
  18. package/src/bmm-skills/1-analysis/bmad-product-brief/prompts/guided-elicitation.md +3 -2
  19. package/src/bmm-skills/1-analysis/research/bmad-domain-research/SKILL.md +91 -1
  20. package/src/bmm-skills/1-analysis/research/bmad-domain-research/customize.toml +41 -0
  21. package/src/bmm-skills/1-analysis/research/bmad-domain-research/domain-steps/step-06-research-synthesis.md +6 -0
  22. package/src/bmm-skills/1-analysis/research/bmad-market-research/SKILL.md +91 -1
  23. package/src/bmm-skills/1-analysis/research/bmad-market-research/customize.toml +41 -0
  24. package/src/bmm-skills/1-analysis/research/bmad-market-research/steps/step-06-research-completion.md +6 -0
  25. package/src/bmm-skills/1-analysis/research/bmad-technical-research/SKILL.md +91 -1
  26. package/src/bmm-skills/1-analysis/research/bmad-technical-research/customize.toml +41 -0
  27. package/src/bmm-skills/1-analysis/research/bmad-technical-research/technical-steps/step-06-research-synthesis.md +6 -0
  28. package/src/bmm-skills/2-plan-workflows/bmad-agent-pm/SKILL.md +50 -35
  29. package/src/bmm-skills/2-plan-workflows/bmad-agent-pm/customize.toml +85 -0
  30. package/src/bmm-skills/2-plan-workflows/bmad-agent-ux-designer/SKILL.md +50 -31
  31. package/src/bmm-skills/2-plan-workflows/bmad-agent-ux-designer/customize.toml +60 -0
  32. package/src/bmm-skills/2-plan-workflows/bmad-create-prd/SKILL.md +99 -1
  33. package/src/bmm-skills/2-plan-workflows/bmad-create-prd/customize.toml +41 -0
  34. package/src/bmm-skills/2-plan-workflows/bmad-create-prd/steps-c/step-08-scoping.md +70 -23
  35. package/src/bmm-skills/2-plan-workflows/bmad-create-prd/steps-c/step-11-polish.md +1 -1
  36. package/src/bmm-skills/2-plan-workflows/bmad-create-prd/steps-c/step-12-complete.md +6 -0
  37. package/src/bmm-skills/2-plan-workflows/bmad-create-ux-design/SKILL.md +70 -1
  38. package/src/bmm-skills/2-plan-workflows/bmad-create-ux-design/customize.toml +41 -0
  39. package/src/bmm-skills/2-plan-workflows/bmad-create-ux-design/steps/step-14-complete.md +6 -0
  40. package/src/bmm-skills/2-plan-workflows/bmad-edit-prd/SKILL.md +97 -1
  41. package/src/bmm-skills/2-plan-workflows/bmad-edit-prd/customize.toml +42 -0
  42. package/src/bmm-skills/2-plan-workflows/bmad-edit-prd/steps-e/step-e-04-complete.md +2 -0
  43. package/src/bmm-skills/2-plan-workflows/bmad-validate-prd/SKILL.md +99 -1
  44. package/src/bmm-skills/2-plan-workflows/bmad-validate-prd/customize.toml +42 -0
  45. package/src/bmm-skills/2-plan-workflows/bmad-validate-prd/steps-v/step-v-13-report-complete.md +1 -0
  46. package/src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md +50 -30
  47. package/src/bmm-skills/3-solutioning/bmad-agent-architect/customize.toml +65 -0
  48. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/SKILL.md +86 -1
  49. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/customize.toml +41 -0
  50. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/steps/step-06-final-assessment.md +6 -0
  51. package/src/bmm-skills/3-solutioning/bmad-create-architecture/SKILL.md +69 -1
  52. package/src/bmm-skills/3-solutioning/bmad-create-architecture/customize.toml +41 -0
  53. package/src/bmm-skills/3-solutioning/bmad-create-architecture/steps/step-08-complete.md +6 -0
  54. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/SKILL.md +88 -1
  55. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/customize.toml +41 -0
  56. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/steps/step-04-final-validation.md +6 -0
  57. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/SKILL.md +76 -1
  58. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/customize.toml +41 -0
  59. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/steps/step-03-complete.md +6 -0
  60. package/src/bmm-skills/4-implementation/bmad-agent-dev/SKILL.md +48 -43
  61. package/src/bmm-skills/4-implementation/bmad-agent-dev/customize.toml +90 -0
  62. package/src/bmm-skills/4-implementation/bmad-correct-course/SKILL.md +296 -1
  63. package/src/bmm-skills/4-implementation/bmad-correct-course/customize.toml +41 -0
  64. package/src/bmm-skills/4-implementation/bmad-create-story/SKILL.md +412 -1
  65. package/src/bmm-skills/4-implementation/bmad-create-story/customize.toml +41 -0
  66. package/src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/SKILL.md +171 -1
  67. package/src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/customize.toml +41 -0
  68. package/src/bmm-skills/4-implementation/bmad-retrospective/SKILL.md +1507 -1
  69. package/src/bmm-skills/4-implementation/bmad-retrospective/customize.toml +41 -0
  70. package/src/bmm-skills/module.yaml +49 -0
  71. package/src/core-skills/bmad-advanced-elicitation/SKILL.md +7 -1
  72. package/src/core-skills/bmad-customize/SKILL.md +111 -0
  73. package/src/core-skills/bmad-customize/scripts/list_customizable_skills.py +231 -0
  74. package/src/core-skills/bmad-customize/scripts/tests/test_list_customizable_skills.py +249 -0
  75. package/src/core-skills/bmad-distillator/resources/distillate-format-reference.md +1 -1
  76. package/src/core-skills/bmad-party-mode/SKILL.md +13 -10
  77. package/src/core-skills/module-help.csv +1 -0
  78. package/src/core-skills/module.yaml +3 -0
  79. package/src/scripts/resolve_config.py +176 -0
  80. package/src/scripts/resolve_customization.py +230 -0
  81. package/tools/installer/cli-utils.js +0 -137
  82. package/tools/installer/commands/install.js +13 -0
  83. package/tools/installer/commands/status.js +1 -1
  84. package/tools/installer/commands/uninstall.js +1 -1
  85. package/tools/installer/core/config.js +4 -1
  86. package/tools/installer/core/existing-install.js +1 -1
  87. package/tools/installer/core/install-paths.js +12 -6
  88. package/tools/installer/core/installer.js +182 -95
  89. package/tools/installer/core/manifest-generator.js +347 -190
  90. package/tools/installer/core/manifest.js +49 -642
  91. package/tools/installer/file-ops.js +1 -1
  92. package/tools/installer/fs-native.js +116 -0
  93. package/tools/installer/ide/_config-driven.js +1 -1
  94. package/tools/installer/ide/platform-codes.js +1 -1
  95. package/tools/installer/ide/shared/path-utils.js +0 -145
  96. package/tools/installer/ide/shared/skill-manifest.js +1 -1
  97. package/tools/installer/message-loader.js +1 -1
  98. package/tools/installer/modules/channel-plan.js +203 -0
  99. package/tools/installer/modules/channel-resolver.js +241 -0
  100. package/tools/installer/modules/community-manager.js +131 -24
  101. package/tools/installer/modules/custom-module-manager.js +161 -47
  102. package/tools/installer/modules/external-manager.js +236 -73
  103. package/tools/installer/modules/official-modules.js +61 -63
  104. package/tools/installer/modules/plugin-resolver.js +1 -1
  105. package/tools/installer/modules/registry-client.js +133 -12
  106. package/tools/installer/modules/registry-fallback.yaml +8 -0
  107. package/tools/installer/modules/version-resolver.js +336 -0
  108. package/tools/installer/project-root.js +55 -1
  109. package/tools/installer/prompts.js +0 -106
  110. package/tools/installer/ui.js +457 -51
  111. package/tools/migrate-custom-module-paths.js +1 -1
  112. package/src/bmm-skills/1-analysis/bmad-agent-analyst/bmad-skill-manifest.yaml +0 -11
  113. package/src/bmm-skills/1-analysis/bmad-agent-tech-writer/bmad-skill-manifest.yaml +0 -11
  114. package/src/bmm-skills/1-analysis/bmad-document-project/workflow.md +0 -25
  115. package/src/bmm-skills/1-analysis/research/bmad-domain-research/workflow.md +0 -51
  116. package/src/bmm-skills/1-analysis/research/bmad-market-research/workflow.md +0 -51
  117. package/src/bmm-skills/1-analysis/research/bmad-technical-research/workflow.md +0 -52
  118. package/src/bmm-skills/2-plan-workflows/bmad-agent-pm/bmad-skill-manifest.yaml +0 -11
  119. package/src/bmm-skills/2-plan-workflows/bmad-agent-ux-designer/bmad-skill-manifest.yaml +0 -11
  120. package/src/bmm-skills/2-plan-workflows/bmad-create-prd/workflow.md +0 -61
  121. package/src/bmm-skills/2-plan-workflows/bmad-create-ux-design/workflow.md +0 -35
  122. package/src/bmm-skills/2-plan-workflows/bmad-edit-prd/workflow.md +0 -62
  123. package/src/bmm-skills/2-plan-workflows/bmad-validate-prd/workflow.md +0 -61
  124. package/src/bmm-skills/3-solutioning/bmad-agent-architect/bmad-skill-manifest.yaml +0 -11
  125. package/src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/workflow.md +0 -47
  126. package/src/bmm-skills/3-solutioning/bmad-create-architecture/workflow.md +0 -32
  127. package/src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/workflow.md +0 -51
  128. package/src/bmm-skills/3-solutioning/bmad-generate-project-context/workflow.md +0 -39
  129. package/src/bmm-skills/4-implementation/bmad-agent-dev/bmad-skill-manifest.yaml +0 -11
  130. package/src/bmm-skills/4-implementation/bmad-correct-course/workflow.md +0 -267
  131. package/src/bmm-skills/4-implementation/bmad-create-story/workflow.md +0 -380
  132. package/src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/workflow.md +0 -136
  133. package/src/bmm-skills/4-implementation/bmad-retrospective/workflow.md +0 -1479
  134. package/tools/installer/ide/shared/agent-command-generator.js +0 -180
  135. package/tools/installer/ide/shared/bmad-artifacts.js +0 -208
  136. package/tools/installer/ide/shared/module-injections.js +0 -136
  137. package/tools/installer/ide/templates/agent-command-template.md +0 -14
  138. package/tools/installer/ide/templates/combined/antigravity.md +0 -8
  139. package/tools/installer/ide/templates/combined/default-agent.md +0 -15
  140. package/tools/installer/ide/templates/combined/default-task.md +0 -10
  141. package/tools/installer/ide/templates/combined/default-tool.md +0 -10
  142. package/tools/installer/ide/templates/combined/default-workflow.md +0 -6
  143. package/tools/installer/ide/templates/combined/gemini-agent.toml +0 -14
  144. package/tools/installer/ide/templates/combined/gemini-task.toml +0 -11
  145. package/tools/installer/ide/templates/combined/gemini-tool.toml +0 -11
  146. package/tools/installer/ide/templates/combined/gemini-workflow-yaml.toml +0 -16
  147. package/tools/installer/ide/templates/combined/gemini-workflow.toml +0 -14
  148. package/tools/installer/ide/templates/combined/kiro-agent.md +0 -16
  149. package/tools/installer/ide/templates/combined/kiro-task.md +0 -9
  150. package/tools/installer/ide/templates/combined/kiro-tool.md +0 -9
  151. package/tools/installer/ide/templates/combined/kiro-workflow.md +0 -7
  152. package/tools/installer/ide/templates/combined/opencode-agent.md +0 -15
  153. package/tools/installer/ide/templates/combined/opencode-task.md +0 -13
  154. package/tools/installer/ide/templates/combined/opencode-tool.md +0 -13
  155. package/tools/installer/ide/templates/combined/opencode-workflow-yaml.md +0 -16
  156. package/tools/installer/ide/templates/combined/opencode-workflow.md +0 -16
  157. package/tools/installer/ide/templates/combined/rovodev.md +0 -9
  158. package/tools/installer/ide/templates/combined/trae.md +0 -9
  159. package/tools/installer/ide/templates/combined/windsurf-workflow.md +0 -10
  160. package/tools/installer/ide/templates/split/.gitkeep +0 -0
@@ -1,180 +0,0 @@
1
- const path = require('node:path');
2
- const fs = require('fs-extra');
3
- const { toColonPath, toDashPath, customAgentColonName, customAgentDashName, BMAD_FOLDER_NAME } = require('./path-utils');
4
-
5
- /**
6
- * Generates launcher command files for each agent
7
- */
8
- class AgentCommandGenerator {
9
- constructor(bmadFolderName = BMAD_FOLDER_NAME) {
10
- this.templatePath = path.join(__dirname, '../templates/agent-command-template.md');
11
- this.bmadFolderName = bmadFolderName;
12
- }
13
-
14
- /**
15
- * Collect agent artifacts for IDE installation
16
- * @param {string} bmadDir - BMAD installation directory
17
- * @param {Array} selectedModules - Modules to include
18
- * @returns {Object} Artifacts array with metadata
19
- */
20
- async collectAgentArtifacts(bmadDir, selectedModules = []) {
21
- const { getAgentsFromBmad } = require('./bmad-artifacts');
22
-
23
- // Get agents from INSTALLED bmad/ directory
24
- const agents = await getAgentsFromBmad(bmadDir, selectedModules);
25
-
26
- const artifacts = [];
27
-
28
- for (const agent of agents) {
29
- const launcherContent = await this.generateLauncherContent(agent);
30
- // Use relativePath if available (for nested agents), otherwise just name with .md
31
- const agentPathInModule = agent.relativePath || `${agent.name}.md`;
32
- // Calculate the relative agent path (e.g., bmm/agents/pm.md)
33
- let agentRelPath = agent.path || '';
34
- // Normalize path separators for cross-platform compatibility
35
- agentRelPath = agentRelPath.replaceAll('\\', '/');
36
- // Remove _bmad/ prefix if present to get relative path from project root
37
- // Handle both absolute paths (/path/to/_bmad/...) and relative paths (_bmad/...)
38
- if (agentRelPath.includes('_bmad/')) {
39
- const parts = agentRelPath.split(/_bmad\//);
40
- if (parts.length > 1) {
41
- agentRelPath = parts.slice(1).join('/');
42
- }
43
- }
44
- artifacts.push({
45
- type: 'agent-launcher',
46
- name: agent.name,
47
- description: agent.description || `${agent.name} agent`,
48
- module: agent.module,
49
- canonicalId: agent.canonicalId || '',
50
- relativePath: path.join(agent.module, 'agents', agentPathInModule), // For command filename
51
- agentPath: agentRelPath, // Relative path to actual agent file
52
- content: launcherContent,
53
- sourcePath: agent.path,
54
- });
55
- }
56
-
57
- return {
58
- artifacts,
59
- counts: {
60
- agents: agents.length,
61
- },
62
- };
63
- }
64
-
65
- /**
66
- * Generate launcher content for an agent
67
- * @param {Object} agent - Agent metadata
68
- * @returns {string} Launcher file content
69
- */
70
- async generateLauncherContent(agent) {
71
- // Load the template
72
- const template = await fs.readFile(this.templatePath, 'utf8');
73
-
74
- // Replace template variables
75
- // Use relativePath if available (for nested agents), otherwise just name with .md
76
- const agentPathInModule = agent.relativePath || `${agent.name}.md`;
77
- return template
78
- .replaceAll('{{name}}', agent.name)
79
- .replaceAll('{{module}}', agent.module)
80
- .replaceAll('{{path}}', agentPathInModule)
81
- .replaceAll('{{description}}', agent.description || `${agent.name} agent`)
82
- .replaceAll('_bmad', this.bmadFolderName)
83
- .replaceAll('_bmad', '_bmad');
84
- }
85
-
86
- /**
87
- * Write agent launcher artifacts to IDE commands directory
88
- * @param {string} baseCommandsDir - Base commands directory for the IDE
89
- * @param {Array} artifacts - Agent launcher artifacts
90
- * @returns {number} Count of launchers written
91
- */
92
- async writeAgentLaunchers(baseCommandsDir, artifacts) {
93
- let writtenCount = 0;
94
-
95
- for (const artifact of artifacts) {
96
- if (artifact.type === 'agent-launcher') {
97
- const moduleAgentsDir = path.join(baseCommandsDir, artifact.module, 'agents');
98
- await fs.ensureDir(moduleAgentsDir);
99
-
100
- const launcherPath = path.join(moduleAgentsDir, `${artifact.name}.md`);
101
- await fs.writeFile(launcherPath, artifact.content);
102
- writtenCount++;
103
- }
104
- }
105
-
106
- return writtenCount;
107
- }
108
-
109
- /**
110
- * Write agent launcher artifacts using underscore format (Windows-compatible)
111
- * Creates flat files like: bmad_bmm_pm.md
112
- *
113
- * @param {string} baseCommandsDir - Base commands directory for the IDE
114
- * @param {Array} artifacts - Agent launcher artifacts
115
- * @returns {number} Count of launchers written
116
- */
117
- async writeColonArtifacts(baseCommandsDir, artifacts) {
118
- let writtenCount = 0;
119
-
120
- for (const artifact of artifacts) {
121
- if (artifact.type === 'agent-launcher') {
122
- // Convert relativePath to underscore format: bmm/agents/pm.md → bmad_bmm_pm.md
123
- const flatName = toColonPath(artifact.relativePath);
124
- const launcherPath = path.join(baseCommandsDir, flatName);
125
- await fs.ensureDir(path.dirname(launcherPath));
126
- await fs.writeFile(launcherPath, artifact.content);
127
- writtenCount++;
128
- }
129
- }
130
-
131
- return writtenCount;
132
- }
133
-
134
- /**
135
- * Write agent launcher artifacts using dash format (NEW STANDARD)
136
- * Creates flat files like: bmad-agent-bmm-pm.md
137
- *
138
- * The bmad-agent- prefix distinguishes agents from workflows/tasks/tools.
139
- *
140
- * @param {string} baseCommandsDir - Base commands directory for the IDE
141
- * @param {Array} artifacts - Agent launcher artifacts
142
- * @returns {number} Count of launchers written
143
- */
144
- async writeDashArtifacts(baseCommandsDir, artifacts) {
145
- let writtenCount = 0;
146
-
147
- for (const artifact of artifacts) {
148
- if (artifact.type === 'agent-launcher') {
149
- // Convert relativePath to dash format: bmm/agents/pm.md → bmad-agent-bmm-pm.md
150
- const flatName = toDashPath(artifact.relativePath);
151
- const launcherPath = path.join(baseCommandsDir, flatName);
152
- await fs.ensureDir(path.dirname(launcherPath));
153
- await fs.writeFile(launcherPath, artifact.content);
154
- writtenCount++;
155
- }
156
- }
157
-
158
- return writtenCount;
159
- }
160
-
161
- /**
162
- * Get the custom agent name in underscore format (Windows-compatible)
163
- * @param {string} agentName - Custom agent name
164
- * @returns {string} Underscore-formatted filename
165
- */
166
- getCustomAgentColonName(agentName) {
167
- return customAgentColonName(agentName);
168
- }
169
-
170
- /**
171
- * Get the custom agent name in underscore format (Windows-compatible)
172
- * @param {string} agentName - Custom agent name
173
- * @returns {string} Underscore-formatted filename
174
- */
175
- getCustomAgentDashName(agentName) {
176
- return customAgentDashName(agentName);
177
- }
178
- }
179
-
180
- module.exports = { AgentCommandGenerator };
@@ -1,208 +0,0 @@
1
- const path = require('node:path');
2
- const fs = require('fs-extra');
3
- const { loadSkillManifest, getCanonicalId } = require('./skill-manifest');
4
-
5
- /**
6
- * Helpers for gathering BMAD agents/tasks from the installed tree.
7
- * Shared by installers that need Claude-style exports.
8
- *
9
- * TODO: Dead code cleanup — compiled XML agents are retired.
10
- *
11
- * All agents now use the SKILL.md directory format with bmad-skill-manifest.yaml
12
- * (type: agent). The legacy pipeline below only discovers compiled .md files
13
- * containing <agent> XML tags, which no longer exist. The following are dead:
14
- *
15
- * - getAgentsFromBmad() — scans {module}/agents/ for .md files with <agent> tags
16
- * - getAgentsFromDir() — recursive helper for the above
17
- * - AgentCommandGenerator — (agent-command-generator.js) generates launcher .md files
18
- * that tell the LLM to load a compiled agent .md file
19
- * - agent-command-template.md — (templates/) the launcher template with hardcoded
20
- * {module}/agents/{{path}} reference
21
- *
22
- * Agent metadata for agent-manifest.csv is now handled entirely by
23
- * ManifestGenerator.getAgentsFromDirRecursive() in manifest-generator.js,
24
- * which walks the full module tree and finds type:agent directories.
25
- *
26
- * IDE installation of agents is handled by the native skill pipeline —
27
- * each agent's SKILL.md directory is installed directly to the IDE's
28
- * skills path, so no launcher intermediary is needed.
29
- *
30
- * Cleanup: remove getAgentsFromBmad, getAgentsFromDir, their exports,
31
- * AgentCommandGenerator, agent-command-template.md, and all call sites
32
- * in IDE installers that invoke collectAgentArtifacts / writeAgentLaunchers /
33
- * writeColonArtifacts / writeDashArtifacts.
34
- * getTasksFromBmad and getTasksFromDir may still be live — verify before removing.
35
- */
36
- async function getAgentsFromBmad(bmadDir, selectedModules = []) {
37
- const agents = [];
38
-
39
- // Get core agents
40
- if (await fs.pathExists(path.join(bmadDir, 'core', 'agents'))) {
41
- const coreAgents = await getAgentsFromDir(path.join(bmadDir, 'core', 'agents'), 'core');
42
- agents.push(...coreAgents);
43
- }
44
-
45
- // Get module agents
46
- for (const moduleName of selectedModules) {
47
- const agentsPath = path.join(bmadDir, moduleName, 'agents');
48
-
49
- if (await fs.pathExists(agentsPath)) {
50
- const moduleAgents = await getAgentsFromDir(agentsPath, moduleName);
51
- agents.push(...moduleAgents);
52
- }
53
- }
54
-
55
- // Get standalone agents from bmad/agents/ directory
56
- const standaloneAgentsDir = path.join(bmadDir, 'agents');
57
- if (await fs.pathExists(standaloneAgentsDir)) {
58
- const agentDirs = await fs.readdir(standaloneAgentsDir, { withFileTypes: true });
59
-
60
- for (const agentDir of agentDirs) {
61
- if (!agentDir.isDirectory()) continue;
62
-
63
- const agentDirPath = path.join(standaloneAgentsDir, agentDir.name);
64
- const agentFiles = await fs.readdir(agentDirPath);
65
- const skillManifest = await loadSkillManifest(agentDirPath);
66
-
67
- for (const file of agentFiles) {
68
- if (!file.endsWith('.md')) continue;
69
- if (file.includes('.customize.')) continue;
70
-
71
- const filePath = path.join(agentDirPath, file);
72
- const content = await fs.readFile(filePath, 'utf8');
73
-
74
- if (content.includes('localskip="true"')) continue;
75
-
76
- agents.push({
77
- path: filePath,
78
- name: file.replace('.md', ''),
79
- module: 'standalone', // Mark as standalone agent
80
- canonicalId: getCanonicalId(skillManifest, file),
81
- });
82
- }
83
- }
84
- }
85
-
86
- return agents;
87
- }
88
-
89
- async function getTasksFromBmad(bmadDir, selectedModules = []) {
90
- const tasks = [];
91
-
92
- if (await fs.pathExists(path.join(bmadDir, 'core', 'tasks'))) {
93
- const coreTasks = await getTasksFromDir(path.join(bmadDir, 'core', 'tasks'), 'core');
94
- tasks.push(...coreTasks);
95
- }
96
-
97
- for (const moduleName of selectedModules) {
98
- const tasksPath = path.join(bmadDir, moduleName, 'tasks');
99
-
100
- if (await fs.pathExists(tasksPath)) {
101
- const moduleTasks = await getTasksFromDir(tasksPath, moduleName);
102
- tasks.push(...moduleTasks);
103
- }
104
- }
105
-
106
- return tasks;
107
- }
108
-
109
- async function getAgentsFromDir(dirPath, moduleName, relativePath = '') {
110
- const agents = [];
111
-
112
- if (!(await fs.pathExists(dirPath))) {
113
- return agents;
114
- }
115
-
116
- const entries = await fs.readdir(dirPath, { withFileTypes: true });
117
- const skillManifest = await loadSkillManifest(dirPath);
118
-
119
- for (const entry of entries) {
120
- // Skip if entry.name is undefined or not a string
121
- if (!entry.name || typeof entry.name !== 'string') {
122
- continue;
123
- }
124
-
125
- const fullPath = path.join(dirPath, entry.name);
126
- const newRelativePath = relativePath ? `${relativePath}/${entry.name}` : entry.name;
127
-
128
- if (entry.isDirectory()) {
129
- // Recurse into subdirectories
130
- const subDirAgents = await getAgentsFromDir(fullPath, moduleName, newRelativePath);
131
- agents.push(...subDirAgents);
132
- } else if (entry.name.endsWith('.md')) {
133
- // Skip README files and other non-agent files
134
- if (entry.name.toLowerCase() === 'readme.md' || entry.name.toLowerCase().startsWith('readme-')) {
135
- continue;
136
- }
137
-
138
- if (entry.name.includes('.customize.')) {
139
- continue;
140
- }
141
-
142
- const content = await fs.readFile(fullPath, 'utf8');
143
-
144
- if (content.includes('localskip="true"')) {
145
- continue;
146
- }
147
-
148
- // Only include files that have agent-specific content (compiled agents have <agent> tag)
149
- if (!content.includes('<agent')) {
150
- continue;
151
- }
152
-
153
- agents.push({
154
- path: fullPath,
155
- name: entry.name.replace('.md', ''),
156
- module: moduleName,
157
- relativePath: newRelativePath, // Keep the .md extension for the full path
158
- canonicalId: getCanonicalId(skillManifest, entry.name),
159
- });
160
- }
161
- }
162
-
163
- return agents;
164
- }
165
-
166
- async function getTasksFromDir(dirPath, moduleName) {
167
- const tasks = [];
168
-
169
- if (!(await fs.pathExists(dirPath))) {
170
- return tasks;
171
- }
172
-
173
- const files = await fs.readdir(dirPath);
174
- const skillManifest = await loadSkillManifest(dirPath);
175
-
176
- for (const file of files) {
177
- // Include both .md and .xml task files
178
- if (!file.endsWith('.md') && !file.endsWith('.xml')) {
179
- continue;
180
- }
181
-
182
- const filePath = path.join(dirPath, file);
183
- const content = await fs.readFile(filePath, 'utf8');
184
-
185
- // Skip internal/engine files (not user-facing tasks)
186
- if (content.includes('internal="true"')) {
187
- continue;
188
- }
189
-
190
- // Remove extension to get task name
191
- const ext = file.endsWith('.xml') ? '.xml' : '.md';
192
- tasks.push({
193
- path: filePath,
194
- name: file.replace(ext, ''),
195
- module: moduleName,
196
- canonicalId: getCanonicalId(skillManifest, file),
197
- });
198
- }
199
-
200
- return tasks;
201
- }
202
-
203
- module.exports = {
204
- getAgentsFromBmad,
205
- getTasksFromBmad,
206
- getAgentsFromDir,
207
- getTasksFromDir,
208
- };
@@ -1,136 +0,0 @@
1
- const path = require('node:path');
2
- const fs = require('fs-extra');
3
- const yaml = require('yaml');
4
- const { glob } = require('glob');
5
- const { getSourcePath } = require('../../project-root');
6
-
7
- async function loadModuleInjectionConfig(handler, moduleName) {
8
- const sourceModulesPath = getSourcePath('modules');
9
- const handlerBaseDir = path.join(sourceModulesPath, moduleName, 'sub-modules', handler);
10
- const configPath = path.join(handlerBaseDir, 'injections.yaml');
11
-
12
- if (!(await fs.pathExists(configPath))) {
13
- return null;
14
- }
15
-
16
- const configContent = await fs.readFile(configPath, 'utf8');
17
- const config = yaml.parse(configContent) || {};
18
-
19
- return {
20
- config,
21
- handlerBaseDir,
22
- configPath,
23
- };
24
- }
25
-
26
- function shouldApplyInjection(injection, subagentChoices) {
27
- if (!subagentChoices || subagentChoices.install === 'none') {
28
- return false;
29
- }
30
-
31
- if (subagentChoices.install === 'all') {
32
- return true;
33
- }
34
-
35
- if (subagentChoices.install === 'selective') {
36
- const selected = subagentChoices.selected || [];
37
-
38
- if (injection.requires === 'any' && selected.length > 0) {
39
- return true;
40
- }
41
-
42
- if (injection.requires) {
43
- const required = `${injection.requires}.md`;
44
- return selected.includes(required);
45
- }
46
-
47
- if (injection.point) {
48
- const selectedNames = selected.map((file) => file.replace('.md', ''));
49
- return selectedNames.some((name) => injection.point.includes(name));
50
- }
51
- }
52
-
53
- return false;
54
- }
55
-
56
- function filterAgentInstructions(content, selectedFiles) {
57
- if (!selectedFiles || selectedFiles.length === 0) {
58
- return '';
59
- }
60
-
61
- const selectedAgents = selectedFiles.map((file) => file.replace('.md', ''));
62
- const lines = content.split('\n');
63
- const filteredLines = [];
64
-
65
- for (const line of lines) {
66
- if (line.includes('<llm') || line.includes('</llm>')) {
67
- filteredLines.push(line);
68
- } else if (line.includes('subagent')) {
69
- let shouldInclude = false;
70
- for (const agent of selectedAgents) {
71
- if (line.includes(agent)) {
72
- shouldInclude = true;
73
- break;
74
- }
75
- }
76
-
77
- if (shouldInclude) {
78
- filteredLines.push(line);
79
- }
80
- } else if (line.includes('When creating PRDs') || line.includes('ACTIVELY delegate')) {
81
- filteredLines.push(line);
82
- }
83
- }
84
-
85
- if (filteredLines.length > 2) {
86
- return filteredLines.join('\n');
87
- }
88
-
89
- return '';
90
- }
91
-
92
- async function resolveSubagentFiles(handlerBaseDir, subagentConfig, subagentChoices) {
93
- if (!subagentConfig || !subagentConfig.files) {
94
- return [];
95
- }
96
-
97
- if (!subagentChoices || subagentChoices.install === 'none') {
98
- return [];
99
- }
100
-
101
- let filesToCopy = subagentConfig.files;
102
-
103
- if (subagentChoices.install === 'selective') {
104
- filesToCopy = subagentChoices.selected || [];
105
- }
106
-
107
- const sourceDir = path.join(handlerBaseDir, subagentConfig.source || '');
108
- const resolved = [];
109
-
110
- for (const file of filesToCopy) {
111
- // Use forward slashes for glob pattern (works on both Windows and Unix)
112
- // Convert backslashes to forward slashes for glob compatibility
113
- const normalizedSourceDir = sourceDir.replaceAll('\\', '/');
114
- const pattern = `${normalizedSourceDir}/**/${file}`;
115
- const matches = await glob(pattern);
116
-
117
- if (matches.length > 0) {
118
- const absolutePath = matches[0];
119
- resolved.push({
120
- file,
121
- absolutePath,
122
- relativePath: path.relative(sourceDir, absolutePath),
123
- sourceDir,
124
- });
125
- }
126
- }
127
-
128
- return resolved;
129
- }
130
-
131
- module.exports = {
132
- loadModuleInjectionConfig,
133
- shouldApplyInjection,
134
- filterAgentInstructions,
135
- resolveSubagentFiles,
136
- };
@@ -1,14 +0,0 @@
1
- ---
2
- name: '{{name}}'
3
- description: '{{description}}'
4
- ---
5
-
6
- You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
7
-
8
- <agent-activation CRITICAL="TRUE">
9
- 1. LOAD the FULL agent file from {project-root}/_bmad/{{module}}/agents/{{path}}
10
- 2. READ its entire contents - this contains the complete agent persona, menu, and instructions
11
- 3. Execute ALL activation steps exactly as written in the agent file
12
- 4. Follow the agent's persona and menu system precisely
13
- 5. Stay in character throughout the session
14
- </agent-activation>
@@ -1,8 +0,0 @@
1
- ---
2
- name: '{{name}}'
3
- description: '{{description}}'
4
- ---
5
-
6
- Read the entire workflow file at: {project-root}/_bmad/{{workflow_path}}
7
-
8
- Follow all instructions in the workflow file exactly as written.
@@ -1,15 +0,0 @@
1
- ---
2
- name: '{{name}}'
3
- description: '{{description}}'
4
- ---
5
-
6
- You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
7
-
8
- <agent-activation CRITICAL="TRUE">
9
- 1. LOAD the FULL agent file from {project-root}/_bmad/{{path}}
10
- 2. READ its entire contents - this contains the complete agent persona, menu, and instructions
11
- 3. FOLLOW every step in the <activation> section precisely
12
- 4. DISPLAY the welcome/greeting as instructed
13
- 5. PRESENT the numbered menu
14
- 6. WAIT for user input before proceeding
15
- </agent-activation>
@@ -1,10 +0,0 @@
1
- ---
2
- name: '{{name}}'
3
- description: '{{description}}'
4
- ---
5
-
6
- # {{name}}
7
-
8
- Read the entire task file at: {project-root}/{{bmadFolderName}}/{{path}}
9
-
10
- Follow all instructions in the task file exactly as written.
@@ -1,10 +0,0 @@
1
- ---
2
- name: '{{name}}'
3
- description: '{{description}}'
4
- ---
5
-
6
- # {{name}}
7
-
8
- Read the entire tool file at: {project-root}/{{bmadFolderName}}/{{path}}
9
-
10
- Follow all instructions in the tool file exactly as written.
@@ -1,6 +0,0 @@
1
- ---
2
- name: '{{name}}'
3
- description: '{{description}}'
4
- ---
5
-
6
- IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL {project-root}/{{bmadFolderName}}/{{path}}, READ its entire contents and follow its directions exactly!
@@ -1,14 +0,0 @@
1
- description = "Activates the {{name}} agent from the BMad Method."
2
- prompt = """
3
- CRITICAL: You are now the BMad '{{name}}' agent.
4
-
5
- PRE-FLIGHT CHECKLIST:
6
- 1. [ ] IMMEDIATE ACTION: Load and parse {project-root}/{{bmadFolderName}}/{{module}}/config.yaml - store ALL config values in memory for use throughout the session.
7
- 2. [ ] IMMEDIATE ACTION: Read and internalize the full agent definition at {project-root}/{{bmadFolderName}}/{{path}}.
8
- 3. [ ] CONFIRM: The user's name from config is {user_name}.
9
-
10
- Only after all checks are complete, greet the user by name and display the menu.
11
- Acknowledge this checklist is complete in your first response.
12
-
13
- AGENT DEFINITION: {project-root}/{{bmadFolderName}}/{{path}}
14
- """
@@ -1,11 +0,0 @@
1
- description = "Executes the {{name}} task from the BMAD Method."
2
- prompt = """
3
- Execute the BMAD '{{name}}' task.
4
-
5
- TASK INSTRUCTIONS:
6
- 1. LOAD the task file from {project-root}/{{bmadFolderName}}/{{path}}
7
- 2. READ its entire contents
8
- 3. FOLLOW every instruction precisely as specified
9
-
10
- TASK FILE: {project-root}/{{bmadFolderName}}/{{path}}
11
- """
@@ -1,11 +0,0 @@
1
- description = "Executes the {{name}} tool from the BMAD Method."
2
- prompt = """
3
- Execute the BMAD '{{name}}' tool.
4
-
5
- TOOL INSTRUCTIONS:
6
- 1. LOAD the tool file from {project-root}/{{bmadFolderName}}/{{path}}
7
- 2. READ its entire contents
8
- 3. FOLLOW every instruction precisely as specified
9
-
10
- TOOL FILE: {project-root}/{{bmadFolderName}}/{{path}}
11
- """
@@ -1,16 +0,0 @@
1
- description = '{{description}}'
2
- prompt = """
3
- Execute the BMAD '{{name}}' workflow.
4
-
5
- CRITICAL: This is a structured YAML workflow. Follow these steps precisely:
6
-
7
- 1. LOAD the workflow definition from {project-root}/{{bmadFolderName}}/{{workflow_path}}
8
- 2. PARSE the YAML structure to understand:
9
- - Workflow phases and steps
10
- - Required inputs and outputs
11
- - Dependencies between steps
12
- 3. EXECUTE each step in order
13
- 4. VALIDATE outputs before proceeding to next step
14
-
15
- WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{workflow_path}}
16
- """
@@ -1,14 +0,0 @@
1
- description = '{{description}}'
2
- prompt = """
3
- Execute the BMAD '{{name}}' workflow.
4
-
5
- CRITICAL: You must load and follow the workflow definition exactly.
6
-
7
- WORKFLOW INSTRUCTIONS:
8
- 1. LOAD the workflow file from {project-root}/{{bmadFolderName}}/{{workflow_path}}
9
- 2. READ its entire contents
10
- 3. FOLLOW every step precisely as specified
11
- 4. DO NOT skip or modify any steps
12
-
13
- WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{workflow_path}}
14
- """
@@ -1,16 +0,0 @@
1
- ---
2
- inclusion: manual
3
- ---
4
-
5
- # {{name}}
6
-
7
- You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
8
-
9
- <agent-activation CRITICAL="TRUE">
10
- 1. LOAD the FULL agent file from #[[file:{{bmadFolderName}}/{{path}}]]
11
- 2. READ its entire contents - this contains the complete agent persona, menu, and instructions
12
- 3. FOLLOW every step in the <activation> section precisely
13
- 4. DISPLAY the welcome/greeting as instructed
14
- 5. PRESENT the numbered menu
15
- 6. WAIT for user input before proceeding
16
- </agent-activation>