Skip to content

refactor(installer): discover skills by SKILL.md instead of manifest YAML#2081

Closed
alexeyv wants to merge 0 commit intomainfrom
remove-skill-manifest-yaml
Closed

refactor(installer): discover skills by SKILL.md instead of manifest YAML#2081
alexeyv wants to merge 0 commit intomainfrom
remove-skill-manifest-yaml

Conversation

@alexeyv
Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv commented Mar 21, 2026

Summary

  • Switch skill discovery gate from requiring bmad-skill-manifest.yaml with type: skill to detecting any directory with a valid SKILL.md (frontmatter name + description, name matches directory name)
  • Delete 34 stub manifest YAML files that carried no data beyond type: skill (including distillator's legacy capabilities block)
  • Remove dead helpers isNativeSkillDirType() and hasNativeSkillManifest(), rename _hasSkillManifestRecursive()_hasSkillMdRecursive()
  • 9 agent manifests retained — they carry persona metadata consumed by agent-manifest.csv

Test plan

  • npm run quality passes (lint, format, markdownlint, docs build, 231 tests, ref validation, skill validation)
  • Suite 29 (Unified Skill Scanner) passes — skills discovered without manifest YAML
  • Suite 30 (parseSkillMd validation) passes
  • test-install-to-bmad.js passes unchanged — shared skill-manifest.js module untouched
  • validate:skills finds all 43 skills (no regressions from manifest removal)

Follows remove-agent-compilation-pipeline (parent branch).

@alexeyv alexeyv force-pushed the remove-skill-manifest-yaml branch from c533ccf to cf22a7d Compare March 21, 2026 04:55
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 21, 2026

🤖 Augment PR Summary

Summary: This PR refactors the installer’s “native skill” discovery to use SKILL.md as the source of truth instead of requiring stub bmad-skill-manifest.yaml files.

Changes:

  • Switches skill discovery to detect any directory with a valid SKILL.md (frontmatter name/description, with name matching the directory name).
  • Deletes a large set of stub bmad-skill-manifest.yaml files that only declared type: skill (including distillator’s legacy block).
  • Simplifies the manifest generator by removing native-skill manifest helpers and updating the recursive “skill-only module” detection to scan for SKILL.md.
  • Removes the deprecated agent compilation / activation-injection pipeline (compile-agents action, XML handler, YAML→XML builder/analyzer utilities).
  • Updates installer and custom-content handling to copy agent artifacts directly rather than compiling .agent.yaml sources.
  • Updates CLI/UI text and test fixtures to reflect the new discovery mechanism and removed compilation action.

Technical Notes: Manifest YAML is still loaded opportunistically when present (e.g., for install_to_bmad flags / metadata), but it no longer gates whether a directory is recognized as a skill.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

// Copy agents directory
const agentsDir = path.join(customPath, 'agents');
if (await fs.pathExists(agentsDir)) {
await this.copyDirectory(agentsDir, bmadAgentsDir, results, fileTrackingCallback, config);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyDirectory() increments results.workflowsInstalled for every copied .md; when it’s used for the agents/ directory, installs that include only custom agents (no workflows/) can end up reporting non-zero workflowsInstalled in the results summary.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 21, 2026

📝 Walkthrough

Walkthrough

This PR removes legacy agent compilation infrastructure and shifts skill discovery from bmad-skill-manifest.yaml files to SKILL.md frontmatter validation. It eliminates XML/YAML agent builders, agent installation workflows, and CLI compile-agents functionality, while updating the installer to discover skills exclusively through SKILL.md presence.

Changes

Cohort / File(s) Summary
Manifest File Updates
src/bmm-skills/1-analysis/bmad-document-project/bmad-skill-manifest.yaml, src/bmm-skills/1-analysis/bmad-product-brief/bmad-skill-manifest.yaml, src/bmm-skills/1-analysis/research/bmad-*-research/bmad-skill-manifest.yaml, src/bmm-skills/2-plan-workflows/bmad-*/bmad-skill-manifest.yaml, src/bmm-skills/3-solutioning/bmad-*/bmad-skill-manifest.yaml, src/bmm-skills/4-implementation/bmad-*/bmad-skill-manifest.yaml, src/core-skills/bmad-*/bmad-skill-manifest.yaml
Removed or emptied 26 bmad-skill-manifest.yaml files by deleting type: skill declaration; one file (bmad-distillator) removed entirely with full manifest content (15 lines). These files no longer explicitly identify skills via top-level manifest metadata.
Agent Compilation Module Deletions
tools/cli/lib/agent/compiler.js, tools/cli/lib/agent/installer.js, tools/cli/lib/agent/template-engine.js
Deleted three core agent modules: compiler (516 lines) handling YAML→XML compilation with customization overlays and template processing; installer (680 lines) for agent discovery, interactive configuration, and installation workflows; and template-engine (152 lines) for conditional/variable processing in agent YAML.
XML/Activation Infrastructure Removal
tools/cli/lib/xml-handler.js, tools/cli/lib/activation-builder.js, tools/cli/lib/yaml-xml-builder.js, tools/cli/lib/agent-analyzer.js, tools/cli/lib/agent-party-generator.js, tools/cli/lib/xml-to-markdown.js
Removed six utility modules totaling ~1,200 lines: XmlHandler (177 lines) for XML parsing/activation injection; ActivationBuilder (165 lines) for activation block construction; YamlXmlBuilder (572 lines) for YAML→XML conversion with deep-merge and menu generation; AgentAnalyzer (97 lines) for agent profile extraction; AgentPartyGenerator (194 lines) for manifest CSV/XML generation; and xml-to-markdown (82 lines) for XML file conversion.
Installer Core Logic Refactoring
tools/cli/installers/lib/core/installer.js, tools/cli/installers/lib/core/manifest-generator.js
Updated installer (−209 lines): removed processAgentFiles() method, eliminated agent compilation calls from install/update flows, changed file-copy logic to include .agent.yaml and sidecar directories, and removed compileAgents() public method. Updated manifest-generator (±57/105 lines): replaced bmad-skill-manifest.yaml type-checking with SKILL.md frontmatter validation; refactored collectSkills() and scanInstalledModules() to discover skills via SKILL.md presence with optional manifest augmentation.
Module & Custom Handler Updates
tools/cli/installers/lib/modules/manager.js, tools/cli/installers/lib/custom/handler.js, tools/cli/installers/lib/ide/_base-ide.js
Removed XmlHandler usage and agent compilation: manager.js (−343 lines) deleted compileModuleAgents(), processAgentFiles(), and copySidecarToMemory() methods; custom handler (±3/77 lines) removed compileAndCopyAgents() and now performs direct recursive copy with placeholder replacement; base-ide (−16 lines) removed XmlHandler import and getAgentCommandHeader() method with activation-block injection.
CLI Commands & UI Updates
tools/cli/commands/install.js, tools/cli/lib/ui.js
Removed compile-agents action type: install.js (±1/8 lines) deleted the CLI branch for actionType === 'compile-agents' and updated help text; ui.js (−19 lines) removed "Recompile Agents" menu option from existing-installation flow.
Test Suite Updates
test/test-installation-components.js
Modified test file (±2/75 lines): removed YamlXmlBuilder dependency and deleted legacy YAML→XML compilation test suites (Tests 1–3); renumbered remaining test (now Test 1 instead of Test 4); removed type: skill manifest generation from BMAD and skill-scanner fixtures.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Suggested reviewers

  • bmadcode
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'refactor(installer): discover skills by SKILL.md instead of manifest YAML' accurately summarizes the main change: switching skill discovery from requiring bmad-skill-manifest.yaml with type: skill to detecting directories with valid SKILL.md files.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about switching skill discovery to SKILL.md, deleting stub manifest files, removing dead helpers, and detailing the test plan confirming the changes work as intended.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Important

Merge conflicts detected (Beta)

  • Resolve merge conflict in branch remove-skill-manifest-yaml
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch remove-skill-manifest-yaml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
tools/cli/installers/lib/core/manifest-generator.js (1)

1342-1381: ⚠️ Potential issue | 🟡 Minor

Use SKILL validation in scanInstalledModules() too.

_hasSkillMdRecursive() now treats any file named SKILL.md as enough to classify a skill-only module. That includes the same invalid cases parseSkillMd() skips, so a module with a stub or malformed SKILL.md still lands in installedModules even though no skill will ever be collected from it. Reuse parseSkillMd() here so module detection and discovery stay in sync.

♻️ Keep module scanning aligned with the real SKILL contract
-          hasSkills = await this._hasSkillMdRecursive(modulePath);
+          hasSkills = await this._hasValidSkillMdRecursive(modulePath);
...
-  async _hasSkillMdRecursive(dir) {
+  async _hasValidSkillMdRecursive(dir) {
     let entries;
     try {
       entries = await fs.readdir(dir, { withFileTypes: true });
     } catch {
       return false;
     }
 
-    // Check for SKILL.md in this directory
-    if (entries.some((e) => !e.isDirectory() && e.name === 'SKILL.md')) return true;
+    if (entries.some((e) => !e.isDirectory() && e.name === 'SKILL.md')) {
+      const dirName = path.basename(dir);
+      if (await this.parseSkillMd(path.join(dir, 'SKILL.md'), dir, dirName)) {
+        return true;
+      }
+    }
 
     // Recurse into subdirectories
     for (const entry of entries) {
       if (!entry.isDirectory()) continue;
       if (entry.name.startsWith('.') || entry.name.startsWith('_')) continue;
-      if (await this._hasSkillMdRecursive(path.join(dir, entry.name))) return true;
+      if (await this._hasValidSkillMdRecursive(path.join(dir, entry.name))) return true;
     }
tools/cli/installers/lib/modules/manager.js (1)

422-466: ⚠️ Potential issue | 🟠 Major

Fail fast on legacy .agent.yaml modules now that compilation is gone.

The compile/process phase has been removed from install() and update(), but copyModuleWithFiltering() still skips .agent.yaml and syncModule() never regenerates their .md outputs. Fresh installs and force updates will drop those agents entirely; selective updates can copy the raw source files without updating the usable artifacts. Any custom/external module still on the old format now ends up partially installed while the command still reports success.

🛡️ Add an explicit guard for unsupported legacy agent sources
+  async assertNoLegacyAgentYaml(sourcePath, moduleName) {
+    const legacyAgentFiles = (await this.getFileList(sourcePath)).filter((file) => file.endsWith('.agent.yaml'));
+    if (legacyAgentFiles.length > 0) {
+      throw new Error(
+        `Module "${moduleName}" still ships legacy .agent.yaml agents, but agent compilation has been removed. ` +
+        `Migrate them to prebuilt Markdown/SKILL.md before installing or updating.`
+      );
+    }
+  }
...
   async install(moduleName, bmadDir, fileTrackingCallback = null, options = {}) {
     const sourcePath = await this.findModuleSource(moduleName, { silent: options.silent });
     const targetPath = path.join(bmadDir, moduleName);
 
     // Check if source module exists
     if (!sourcePath) {
       throw new Error(
         `Source for module '${moduleName}' is not available. It will be retained but cannot be updated without its source files.`,
       );
     }
+
+    await this.assertNoLegacyAgentYaml(sourcePath, moduleName);
...
   async update(moduleName, bmadDir, force = false, options = {}) {
     const sourcePath = await this.findModuleSource(moduleName);
     const targetPath = path.join(bmadDir, moduleName);
 
     // Check if source module exists
     if (!sourcePath) {
       throw new Error(`Module '${moduleName}' not found in any source location`);
     }
+
+    await this.assertNoLegacyAgentYaml(sourcePath, moduleName);

As per coding guidelines, tools/**: Build script/tooling. Check error handling and proper exit codes.

Also applies to: 498-519, 599-636, 985-1006

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/modules/manager.js` around lines 422 - 466, The
installer currently allows legacy modules that contain .agent.yaml files to be
copied (via copyModuleWithFiltering) even though compilation/processing was
removed; add a fail-fast guard that detects legacy agent source files and throws
a clear error instead of partially installing them. Specifically, in install()
(and mirror the same check in update() and any force-update paths) after
resolving sourcePath (before vendorCrossModuleWorkflows and
copyModuleWithFiltering) scan sourcePath for any "*.agent.yaml" or legacy
"agent.yaml" files and if any are present throw an Error explaining legacy-agent
format is unsupported and must be migrated; also add the same validation to
syncModule() (and any callers that assume processed artifacts) so legacy sources
never produce partial installs. Use the existing symbols install(), update(),
syncModule(), copyModuleWithFiltering(), vendorCrossModuleWorkflows(), and
findModuleSource() to locate where to add the check and error.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tools/cli/installers/lib/custom/handler.js`:
- Around line 144-150: The installer currently copies the entire agentsDir
(variable agentsDir -> bmadAgentsDir) but only counts Markdown agents via
findFilesRecursively, which lets legacy *.agent.yaml packs succeed with
agentsInstalled === 0; update the handler in this block to detect legacy agent
YAML files before copying (e.g., scan agentsDir for files matching *.agent.yaml
or *.agent.yml) and either (A) perform a compatibility conversion into the
supported .md artifact format or (B) throw a clear error and abort the install
with a non-zero exit code; the change should reference the existing
copyDirectory, findFilesRecursively usage and ensure any error path logs a
descriptive message about unsupported legacy custom agent YAML and prevents
copying to bmadAgentsDir.

---

Outside diff comments:
In `@tools/cli/installers/lib/modules/manager.js`:
- Around line 422-466: The installer currently allows legacy modules that
contain .agent.yaml files to be copied (via copyModuleWithFiltering) even though
compilation/processing was removed; add a fail-fast guard that detects legacy
agent source files and throws a clear error instead of partially installing
them. Specifically, in install() (and mirror the same check in update() and any
force-update paths) after resolving sourcePath (before
vendorCrossModuleWorkflows and copyModuleWithFiltering) scan sourcePath for any
"*.agent.yaml" or legacy "agent.yaml" files and if any are present throw an
Error explaining legacy-agent format is unsupported and must be migrated; also
add the same validation to syncModule() (and any callers that assume processed
artifacts) so legacy sources never produce partial installs. Use the existing
symbols install(), update(), syncModule(), copyModuleWithFiltering(),
vendorCrossModuleWorkflows(), and findModuleSource() to locate where to add the
check and error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a59a9248-b747-4bcd-88d3-73b3fac782e9

📥 Commits

Reviewing files that changed from the base of the PR and between c28206d and c533ccf.

📒 Files selected for processing (51)
  • src/bmm-skills/1-analysis/bmad-document-project/bmad-skill-manifest.yaml
  • src/bmm-skills/1-analysis/bmad-product-brief/bmad-skill-manifest.yaml
  • src/bmm-skills/1-analysis/research/bmad-domain-research/bmad-skill-manifest.yaml
  • src/bmm-skills/1-analysis/research/bmad-market-research/bmad-skill-manifest.yaml
  • src/bmm-skills/1-analysis/research/bmad-technical-research/bmad-skill-manifest.yaml
  • src/bmm-skills/2-plan-workflows/bmad-create-prd/bmad-skill-manifest.yaml
  • src/bmm-skills/2-plan-workflows/bmad-create-ux-design/bmad-skill-manifest.yaml
  • src/bmm-skills/2-plan-workflows/bmad-edit-prd/bmad-skill-manifest.yaml
  • src/bmm-skills/2-plan-workflows/bmad-validate-prd/bmad-skill-manifest.yaml
  • src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/bmad-skill-manifest.yaml
  • src/bmm-skills/3-solutioning/bmad-create-architecture/bmad-skill-manifest.yaml
  • src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/bmad-skill-manifest.yaml
  • src/bmm-skills/3-solutioning/bmad-generate-project-context/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-code-review/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-correct-course/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-create-story/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-dev-story/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-quick-dev/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-retrospective/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-sprint-planning/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-sprint-status/bmad-skill-manifest.yaml
  • src/core-skills/bmad-advanced-elicitation/bmad-skill-manifest.yaml
  • src/core-skills/bmad-brainstorming/bmad-skill-manifest.yaml
  • src/core-skills/bmad-distillator/bmad-skill-manifest.yaml
  • src/core-skills/bmad-editorial-review-prose/bmad-skill-manifest.yaml
  • src/core-skills/bmad-editorial-review-structure/bmad-skill-manifest.yaml
  • src/core-skills/bmad-help/bmad-skill-manifest.yaml
  • src/core-skills/bmad-index-docs/bmad-skill-manifest.yaml
  • src/core-skills/bmad-init/bmad-skill-manifest.yaml
  • src/core-skills/bmad-party-mode/bmad-skill-manifest.yaml
  • src/core-skills/bmad-review-adversarial-general/bmad-skill-manifest.yaml
  • src/core-skills/bmad-review-edge-case-hunter/bmad-skill-manifest.yaml
  • src/core-skills/bmad-shard-doc/bmad-skill-manifest.yaml
  • test/test-installation-components.js
  • tools/cli/commands/install.js
  • tools/cli/installers/lib/core/installer.js
  • tools/cli/installers/lib/core/manifest-generator.js
  • tools/cli/installers/lib/custom/handler.js
  • tools/cli/installers/lib/ide/_base-ide.js
  • tools/cli/installers/lib/modules/manager.js
  • tools/cli/lib/activation-builder.js
  • tools/cli/lib/agent-analyzer.js
  • tools/cli/lib/agent-party-generator.js
  • tools/cli/lib/agent/compiler.js
  • tools/cli/lib/agent/installer.js
  • tools/cli/lib/agent/template-engine.js
  • tools/cli/lib/ui.js
  • tools/cli/lib/xml-handler.js
  • tools/cli/lib/xml-to-markdown.js
  • tools/cli/lib/yaml-xml-builder.js
💤 Files with no reviewable changes (45)
  • src/bmm-skills/4-implementation/bmad-create-story/bmad-skill-manifest.yaml
  • src/bmm-skills/1-analysis/research/bmad-domain-research/bmad-skill-manifest.yaml
  • src/bmm-skills/1-analysis/bmad-document-project/bmad-skill-manifest.yaml
  • src/core-skills/bmad-review-adversarial-general/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-code-review/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-sprint-planning/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-dev-story/bmad-skill-manifest.yaml
  • src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-retrospective/bmad-skill-manifest.yaml
  • src/core-skills/bmad-editorial-review-structure/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-correct-course/bmad-skill-manifest.yaml
  • src/bmm-skills/1-analysis/research/bmad-market-research/bmad-skill-manifest.yaml
  • src/bmm-skills/1-analysis/research/bmad-technical-research/bmad-skill-manifest.yaml
  • src/core-skills/bmad-index-docs/bmad-skill-manifest.yaml
  • src/core-skills/bmad-review-edge-case-hunter/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/bmad-skill-manifest.yaml
  • src/bmm-skills/2-plan-workflows/bmad-validate-prd/bmad-skill-manifest.yaml
  • src/core-skills/bmad-init/bmad-skill-manifest.yaml
  • src/bmm-skills/2-plan-workflows/bmad-edit-prd/bmad-skill-manifest.yaml
  • src/bmm-skills/4-implementation/bmad-sprint-status/bmad-skill-manifest.yaml
  • src/core-skills/bmad-editorial-review-prose/bmad-skill-manifest.yaml
  • src/core-skills/bmad-party-mode/bmad-skill-manifest.yaml
  • src/bmm-skills/3-solutioning/bmad-generate-project-context/bmad-skill-manifest.yaml
  • src/core-skills/bmad-advanced-elicitation/bmad-skill-manifest.yaml
  • src/bmm-skills/2-plan-workflows/bmad-create-ux-design/bmad-skill-manifest.yaml
  • src/core-skills/bmad-shard-doc/bmad-skill-manifest.yaml
  • src/bmm-skills/3-solutioning/bmad-create-architecture/bmad-skill-manifest.yaml
  • tools/cli/lib/agent-analyzer.js
  • src/core-skills/bmad-brainstorming/bmad-skill-manifest.yaml
  • tools/cli/installers/lib/ide/_base-ide.js
  • src/core-skills/bmad-help/bmad-skill-manifest.yaml
  • tools/cli/lib/xml-handler.js
  • tools/cli/lib/ui.js
  • src/core-skills/bmad-distillator/bmad-skill-manifest.yaml
  • src/bmm-skills/1-analysis/bmad-product-brief/bmad-skill-manifest.yaml
  • src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/bmad-skill-manifest.yaml
  • tools/cli/lib/xml-to-markdown.js
  • src/bmm-skills/4-implementation/bmad-quick-dev/bmad-skill-manifest.yaml
  • tools/cli/lib/agent/compiler.js
  • tools/cli/lib/agent/template-engine.js
  • src/bmm-skills/2-plan-workflows/bmad-create-prd/bmad-skill-manifest.yaml
  • tools/cli/lib/activation-builder.js
  • tools/cli/lib/yaml-xml-builder.js
  • tools/cli/lib/agent-party-generator.js
  • tools/cli/lib/agent/installer.js

Comment on lines +144 to +150
// Copy agents directory
const agentsDir = path.join(customPath, 'agents');
if (await fs.pathExists(agentsDir)) {
await this.copyDirectory(agentsDir, bmadAgentsDir, results, fileTrackingCallback, config);

// Count agent files
const agentFiles = await this.findFilesRecursively(agentsDir, ['.md']);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Reject legacy custom agent YAML instead of silently copying it.

This path now copies agents/ verbatim, but only .md files are treated as installed agents. A custom pack that still ships *.agent.yaml will now return success with agentsInstalled === 0 and no usable agent artifact. Please either preserve a compatibility conversion here or throw a clear error before copying unsupported agent sources.

🛠️ Fail fast on unsupported legacy custom agents
       const agentsDir = path.join(customPath, 'agents');
       if (await fs.pathExists(agentsDir)) {
+        const legacyAgentFiles = await this.findFilesRecursively(agentsDir, ['.agent.yaml']);
+        if (legacyAgentFiles.length > 0) {
+          throw new Error(
+            `Legacy custom agent sources are no longer supported: ${legacyAgentFiles
+              .map((file) => path.relative(customPath, file))
+              .join(', ')}`
+          );
+        }
+
         await this.copyDirectory(agentsDir, bmadAgentsDir, results, fileTrackingCallback, config);
 
         // Count agent files
         const agentFiles = await this.findFilesRecursively(agentsDir, ['.md']);

As per coding guidelines, tools/**: Build script/tooling. Check error handling and proper exit codes.

Also applies to: 249-265

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/custom/handler.js` around lines 144 - 150, The
installer currently copies the entire agentsDir (variable agentsDir ->
bmadAgentsDir) but only counts Markdown agents via findFilesRecursively, which
lets legacy *.agent.yaml packs succeed with agentsInstalled === 0; update the
handler in this block to detect legacy agent YAML files before copying (e.g.,
scan agentsDir for files matching *.agent.yaml or *.agent.yml) and either (A)
perform a compatibility conversion into the supported .md artifact format or (B)
throw a clear error and abort the install with a non-zero exit code; the change
should reference the existing copyDirectory, findFilesRecursively usage and
ensure any error path logs a descriptive message about unsupported legacy custom
agent YAML and prevents copying to bmadAgentsDir.

@alexeyv alexeyv closed this Mar 21, 2026
@alexeyv alexeyv force-pushed the remove-skill-manifest-yaml branch from cf22a7d to c28206d Compare March 21, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant