ma-agents 2.17.0 → 2.17.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/lib/agents.js CHANGED
@@ -152,7 +152,7 @@ const agents = [
152
152
  version: '1.0.0',
153
153
  category: 'bmad',
154
154
  description: 'Specialized SRE Agent for BMAD-METHOD',
155
- getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills'),
155
+ getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills', 'sre'),
156
156
  getGlobalPath: () => {
157
157
  const platform = os.platform();
158
158
  if (platform === 'win32') {
@@ -194,7 +194,7 @@ const agents = [
194
194
  version: '1.0.0',
195
195
  category: 'bmad',
196
196
  description: 'Specialized DevOps Agent for BMAD-METHOD',
197
- getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills'),
197
+ getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills', 'devops'),
198
198
  getGlobalPath: () => {
199
199
  const platform = os.platform();
200
200
  if (platform === 'win32') {
@@ -215,7 +215,7 @@ const agents = [
215
215
  version: '1.0.0',
216
216
  category: 'bmad',
217
217
  description: 'Specialized Cyber Security Analyst (Yael) for BMAD-METHOD',
218
- getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills'),
218
+ getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills', 'cyber'),
219
219
  getGlobalPath: () => {
220
220
  const platform = os.platform();
221
221
  if (platform === 'win32') {
@@ -236,7 +236,7 @@ const agents = [
236
236
  version: '1.0.0',
237
237
  category: 'bmad',
238
238
  description: 'MIL-STD-498 Documentation Expert',
239
- getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills'),
239
+ getProjectPath: () => path.join(process.cwd(), '_bmad', 'skills', 'mil498'),
240
240
  getGlobalPath: () => {
241
241
  const platform = os.platform();
242
242
  if (platform === 'win32') {
package/lib/bmad.js CHANGED
@@ -74,6 +74,7 @@ async function applyCustomizations(projectRoot = process.cwd(), modules = ['bmm'
74
74
  };
75
75
 
76
76
  // 1. Apply YAML customizations (filtered by selected agents)
77
+ // These must be in place BEFORE recompile so BMAD can use them during compilation
77
78
  if (fs.existsSync(sourceDir)) {
78
79
  await fs.ensureDir(configTargetDir);
79
80
  const files = await fs.readdir(sourceDir);
@@ -89,7 +90,8 @@ async function applyCustomizations(projectRoot = process.cwd(), modules = ['bmm'
89
90
  }
90
91
  }
91
92
 
92
- // 2. Apply detailed agent templates (.md files, filtered by selected agents)
93
+ // 2. Apply detailed agent templates to custom dir (.md files, filtered by selected agents)
94
+ // These go to _bmad/custom/agents/ for BMAD's custom agent resolution
93
95
  if (fs.existsSync(sourceDir)) {
94
96
  await fs.ensureDir(agentTargetDir);
95
97
  const files = await fs.readdir(sourceDir);
@@ -104,21 +106,9 @@ async function applyCustomizations(projectRoot = process.cwd(), modules = ['bmm'
104
106
  }
105
107
  }
106
108
 
107
- // 3. Apply workflows
108
- if (fs.existsSync(workflowSourceDir)) {
109
- await fs.ensureDir(workflowTargetDir);
110
- await fs.copy(workflowSourceDir, workflowTargetDir);
111
- console.log(chalk.cyan(` + Applied BMAD workflows`));
112
- }
113
-
114
- // 4. Apply MIL-STD-498 templates
115
- if (fs.existsSync(templateSourceDir)) {
116
- await fs.ensureDir(templateTargetDir);
117
- await fs.copy(templateSourceDir, templateTargetDir);
118
- console.log(chalk.cyan(` + Applied MIL-STD-498 templates`));
119
- }
120
-
121
- // Recompile agents to apply changes
109
+ // Recompile agents to apply YAML customizations
110
+ // IMPORTANT: Steps 3-5 must run AFTER recompile because the recompile regenerates
111
+ // the _bmad/bmm/ tree and would wipe any files placed there beforehand.
122
112
  let command = 'npx bmad-method install --yes';
123
113
  if (modules && modules.length > 0) {
124
114
  command += ` --modules ${modules.join(',')}`;
@@ -135,7 +125,39 @@ async function applyCustomizations(projectRoot = process.cwd(), modules = ['bmm'
135
125
  console.error(chalk.red(` BMAD recompile failed: ${error.message}`));
136
126
  }
137
127
 
138
- // 5. Register custom workflows in BMAD CSV registries (after recompile)
128
+ // 3. Apply workflows (AFTER recompile so they persist)
129
+ if (fs.existsSync(workflowSourceDir)) {
130
+ await fs.ensureDir(workflowTargetDir);
131
+ await fs.copy(workflowSourceDir, workflowTargetDir);
132
+ console.log(chalk.cyan(` + Applied BMAD workflows`));
133
+ }
134
+
135
+ // 4. Apply MIL-STD-498 templates (AFTER recompile so they persist)
136
+ if (fs.existsSync(templateSourceDir)) {
137
+ await fs.ensureDir(templateTargetDir);
138
+ await fs.copy(templateSourceDir, templateTargetDir);
139
+ console.log(chalk.cyan(` + Applied MIL-STD-498 templates`));
140
+ }
141
+
142
+ // 5. Copy agent templates to compiled location (AFTER recompile)
143
+ // BMAD recompile doesn't generate custom agents (mil498, cyber) in _bmad/bmm/agents/.
144
+ // Without this, updateAgentInstructions() creates the file with only the MA-AGENTS block.
145
+ if (fs.existsSync(sourceDir)) {
146
+ const compiledAgentDir = path.join(projectRoot, BMAD_DIR, 'bmm', 'agents');
147
+ await fs.ensureDir(compiledAgentDir);
148
+ const files = await fs.readdir(sourceDir);
149
+ for (const file of files) {
150
+ if (file.endsWith('.md')) {
151
+ const matchingAgentId = Object.entries(agentMdMap).find(([, mdFile]) => mdFile === file)?.[0];
152
+ if (!matchingAgentId || selectedAgentIds.length === 0 || selectedAgentIds.includes(matchingAgentId)) {
153
+ await fs.copy(path.join(sourceDir, file), path.join(compiledAgentDir, file));
154
+ console.log(chalk.cyan(` + Applied compiled agent: ${file}`));
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ // 6. Register custom workflows in BMAD CSV registries (after recompile)
139
161
  if (selectedAgentIds.length === 0 || selectedAgentIds.includes('bmm-mil498')) {
140
162
  await registerMilWorkflows(projectRoot);
141
163
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ma-agents",
3
- "version": "2.17.0",
3
+ "version": "2.17.1",
4
4
  "description": "NPX tool to install skills for AI coding agents (Claude Code, Gemini, Copilot, Kilocode, Cline, Cursor)",
5
5
  "main": "index.js",
6
6
  "bin": {