Skip to content

fix: support legacy baut automator installs#15

Closed
bma-d wants to merge 2 commits into
mainfrom
bma-d/baut-compat
Closed

fix: support legacy baut automator installs#15
bma-d wants to merge 2 commits into
mainfrom
bma-d/baut-compat

Conversation

@bma-d
Copy link
Copy Markdown
Contributor

@bma-d bma-d commented May 18, 2026

Summary

Adds compatibility for existing BMAD installations that still contain a legacy baut module entry after the automator rename.

Implemented

  • Adds a legacy baut marketplace alias that points at the automator skill source, so source lookup can still resolve old manifests.
  • Runs a targeted installer migration before dependency resolution:
    • searches _bmad/ YAML manifests for a modules: list entry named baut
    • creates a manifest backup before editing
    • removes only the complete baut module block
    • leaves all other module entries intact
    • avoids touching _bmad/config.toml and _bmad/config.user.toml
  • Keeps normal custom-source installs selecting automator, not the compatibility alias.
  • Adds scripts/compat-test.sh and wires it into npm run verify.
  • Documents the legacy compatibility behavior and troubleshooting path.

Verification

  • npm run verify
  • Manual custom-source install check: confirmed normal installs include automator only.
  • Manual legacy-source check: confirmed cached legacy baut source lookup resolves successfully.
  • Manual stale-manifest check: confirmed npx bmad-method@next install --action update --modules automator --tools codex --yes succeeds after the migration.

Summary by CodeRabbit

  • New Features

    • Added automatic legacy compatibility support for users upgrading from older Automator installations. The installer now detects and removes stale module references from configuration manifests, with backups created for safety.
  • Documentation

    • Added legacy compatibility guide explaining the migration process and supported upgrade paths.
    • Added troubleshooting section for legacy-related installation issues.
  • Tests

    • Added compatibility test suite to verify legacy migration functionality.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Warning

Rate limit exceeded

@bma-d has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 38 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57b38f44-03db-4dda-89f6-0589a395ca0e

📥 Commits

Reviewing files that changed from the base of the PR and between 4bea07b and 4a1bcd3.

📒 Files selected for processing (2)
  • install.sh
  • scripts/compat-test.sh

Walkthrough

This PR adds legacy compatibility for the previous baut module-code rename. It introduces a marketplace alias, implements manifest migration that removes stale baut entries during installation, documents the compatibility behavior and recovery workflow, and validates the migration end-to-end through a comprehensive test.

Changes

Legacy baut Compatibility

Layer / File(s) Summary
Marketplace legacy alias setup
.claude-plugin/marketplace.json
Adds a baut plugin entry as a legacy-compatibility alias pointing to ./skills, enabling older installs with cached custom sources to resolve the deprecated module code.
Manifest migration implementation
install.sh
Implements migrate_legacy_baut_manifest() function that scans _bmad/ YAML files for modules: ... - name: baut entries, removes them with timestamped .bak backups, and logs each migration. Invoked early in the installer before skill detection and installation.
Documentation and troubleshooting
README.md, docs/installation-and-layout.md, docs/troubleshooting.md
Documents the two legacy compatibility paths (marketplace alias and installer migration), updates the installer flow diagram to show the early migration step, and adds a troubleshooting section explaining the stale-entry failure and recovery using bmad-story-automator to remove the entry.
Compatibility test harness
scripts/compat-test.sh
Implements end-to-end test that scaffolds a fixture with legacy baut manifest entries, packs the installer, runs install via npx, and validates manifest migration (.bak backup, baut removal, config preservation, expected skills produced, migration logged).
Verification pipeline integration
package.json
Adds test:compat script and updates verify to run the compatibility test as the final verification step after Python, pack, and smoke tests.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • bmad-code-org/bmad-automator#10: Implements the original bautautomator module-code rename by updating skills/module.yaml; this PR adds the legacy compatibility layer to support older installs.

Poem

🐰 Once baut was bold, but automator took the crown,
Now old installs can migrate with a safe, backed-up renown—
Manifests are scanned, the stale entries removed with care,
Config files untouched, while Claude skills flourish everywhere!
The test harness hops through fixtures to ensure all works true. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: adding legacy baut automator install support to handle pre-rename BMAD Automator installations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bma-d/baut-compat

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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@install.sh`:
- Around line 157-179: The code currently matches "- name: baut" globally after
the first "modules:" and can remove YAML outside a modules list or in
non-manifest files; update the loop so you only treat a baut match when
moduleIndent is set and the item's indentation places it directly under that
modules block (i.e., require moduleIndent !== null and compute itemIndent from
bautMatch then ensure itemIndent > moduleIndent before marking changed and
skipping the block), and apply the same guard to the later scan (the block at
lines ~184-190) so both uses of bautMatch/shouldEndBlock only run when inside an
actual modules: section; keep references to moduleIndent, bautMatch, itemIndent,
shouldEndBlock and changed when making the checks.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f4f0de72-5f7c-4f70-90b5-6e65d619a1a9

📥 Commits

Reviewing files that changed from the base of the PR and between 95fa9f9 and 4bea07b.

📒 Files selected for processing (7)
  • .claude-plugin/marketplace.json
  • README.md
  • docs/installation-and-layout.md
  • docs/troubleshooting.md
  • install.sh
  • package.json
  • scripts/compat-test.sh

Comment thread install.sh
@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 18, 2026

🤖 Augment PR Summary

Summary: This PR adds backward compatibility for legacy BMAD Automator installs that still reference the pre-rename module code baut.

Changes:

  • Adds a baut marketplace alias in .claude-plugin/marketplace.json so old manifests can still resolve a source.
  • Adds an install-time migration that scans _bmad/ YAML manifests and removes stale - name: baut module entries (writing a .bak first).
  • Ensures the migration leaves _bmad/config.toml and _bmad/config.user.toml untouched.
  • Updates installation docs and troubleshooting notes to explain the legacy behavior and recovery steps.
  • Adds scripts/compat-test.sh and wires it into npm run verify to validate the migration path.

Technical Notes: Migration is implemented as a small Node script embedded in install.sh and runs before skill dependency checks/copy steps.

🤖 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. 4 suggestions posted.

Fix All in Augment

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

},
{
"name": "baut",
"source": "./skills",
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 18, 2026

Choose a reason for hiding this comment

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

In .claude-plugin/marketplace.json line 41, the new baut plugin entry doesn’t include a skills list (unlike bmad-automator) and uses source: "./skills", which may not match the custom-source resolver expectations (docs/plans mention plugin-level skills entries). This could cause legacy source discovery to still fail or to pull an unexpected set of skills.

Severity: medium

Fix This in Augment

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

Comment thread install.sh
const yamlNames = new Set([".yaml", ".yml"]);
const timestamp = new Date().toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z");

function walk(dir, files = []) {
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 18, 2026

Choose a reason for hiding this comment

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

In install.sh line 125, walk() collects all .yml/.yaml files under _bmad/, but the PR description/docs describe targeting _bmad/**/manifest.y*ml. If any other YAML under _bmad/ contains modules: plus a - name: baut line, it will also be backed up and rewritten unexpectedly.

Severity: medium

Fix This in Augment

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

Comment thread install.sh
continue;
}

const bautMatch = moduleIndent === null ? null : line.match(/^(\s*)-\s+name:\s+['"]?baut['"]?\s*$/);
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 18, 2026

Choose a reason for hiding this comment

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

In install.sh line 166, bautMatch only checks that a modules: key was seen somewhere earlier (moduleIndent !== null), but doesn’t verify the matched - name: baut line is actually inside the modules: list (indentation-wise). This can remove a name: baut block from a later, unrelated YAML list if it appears in the same file after modules:.

Severity: medium

Fix This in Augment

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

Comment thread install.sh
}

function shouldEndBlock(line, itemIndent, moduleIndent) {
if (/^\s*$/.test(line) || /^\s*#/.test(line)) return false;
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 18, 2026

Choose a reason for hiding this comment

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

In install.sh line 143, shouldEndBlock() treats blank/comment-only lines as never ending the baut block, so comments/whitespace separating module entries can be removed along with the baut entry. If preserving surrounding YAML formatting/comments is important (as the docs suggest), this behavior may be surprising.

Severity: low

Fix This in Augment

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

@bma-d
Copy link
Copy Markdown
Contributor Author

bma-d commented May 18, 2026

Review follow-up pushed in 4a1bcd3.

Addressed:

  • Restricted legacy baut migration scanning to _bmad/**/manifest.yml / manifest.yaml files.
  • Constrained removal to - name: baut entries directly under a modules: list by indentation.
  • Preserved trailing separator comments/blank lines before the next module entry.
  • Added compat regression coverage for non-manifest YAML, unrelated later name: baut lists, and preserved separator comments.

Verified:

  • npm run test:compat
  • npm run verify

Not changed:

  • The legacy baut marketplace alias intentionally omits a skills list and uses source: "./skills"; prior custom-source checks confirmed this lets stale baut source lookup resolve without making normal installs select the alias as an extra module.

@bma-d
Copy link
Copy Markdown
Contributor Author

bma-d commented May 18, 2026

Addressed via bmad-code-org/BMAD-METHOD#2391

@bma-d bma-d closed this May 18, 2026
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