Skip to content

fix(skills): stop activation from executing project resolvers - #2632

Closed
rashidiff wants to merge 8 commits into
bmad-code-org:mainfrom
rashidiff:main
Closed

rashidiff wants to merge 8 commits into
bmad-code-org:mainfrom
rashidiff:main

Conversation

@rashidiff

@rashidiff rashidiff commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

What

Updated BMAD skill activation instructions so they no longer execute resolve_customization.py or resolve_config.py from {project-root}/_bmad/scripts during activation, and instead resolve customization/config by directly merging the documented TOML layers.

Why

This removes the activation-time execution path for project-supplied resolver scripts, so _bmad/ stays data-only during activation and skill startup no longer trusts arbitrary code from the working tree. (#2624)

How

  • Replaced activation-time resolve_customization.py calls in affected SKILL.md files with explicit TOML merge instructions using base, team, and user customization layers.
  • Replaced activation-time resolve_config.py calls in affected SKILL.md files with direct four-layer config merge instructions.
  • Kept non-activation resolver references such as workflow.on_complete untouched so the fix stays scoped to the reported issue.

Testing

I did not add or run tests per your instruction. I did run npm ci && npm run quality, but the repo’s docs:build step fails on Windows by design because that pipeline explicitly does not support Windows.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

The activation documentation for BMM, core, and legacy shim skills now specifies direct TOML customization merging instead of runtime resolver scripts. Selected skills also define ordered config TOML merging, field extraction, and neutral defaults.

Activation Resolution

Layer / File(s) Summary
BMM skill customization resolution
src/bmm-skills/1-analysis/*, src/bmm-skills/2-plan-workflows/*, src/bmm-skills/3-solutioning/*, src/bmm-skills/4-implementation/*
Activation instructions load customize.toml, merge optional team/user overrides, and apply scalar, table, and array merge rules.
BMM customization and config resolution
src/bmm-skills/2-plan-workflows/bmad-spec/SKILL.md, src/bmm-skills/3-solutioning/bmad-architecture/SKILL.md
Customization and configuration are resolved from ordered TOML layers, with activation fields extracted and missing values given neutral defaults.
Legacy shim customization forwarding
src/bmm-skills/v6-shims/*
Compatibility shims directly merge TOML customization layers while preserving legacy fields for forwarding.
Core skill activation resolution
src/core-skills/*
Core activation flows replace customization and selected config scripts with direct TOML merges while retaining hooks, context handling, and defaults.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers: bmadcode

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: stopping activation from executing project resolver scripts.
Description check ✅ Passed The description is clearly aligned with the changeset and explains the what, why, how, and testing scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

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

⚠️ Outside diff range comments (1)
src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md (1)

23-31: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Replace the impossible “If the script fails” branch.

The preceding sentence forbids executing scripts, so this fallback is contradictory and unreachable. Replace it with explicit TOML error handling: the base customize.toml is required and should fail activation if missing or invalid; optional team/user files may be skipped with a warning when absent or unreadable, matching the existing resolver behavior.

🤖 Prompt for 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.

In `@src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md` around lines 23 -
31, Replace the contradictory “If the script fails” fallback in the activation
instructions with explicit TOML error handling: require the base customize.toml
and fail activation when it is missing or invalid; skip absent or unreadable
team and user override files with warnings, matching the existing resolver
behavior. Apply this change in
src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md:23-31,
src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/SKILL.md:52-60,
src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/SKILL.md:54-62,
src/bmm-skills/3-solutioning/bmad-generate-project-context/SKILL.md:33-41,
src/bmm-skills/4-implementation/bmad-agent-dev/SKILL.md:23-31,
src/bmm-skills/4-implementation/bmad-checkpoint-preview/SKILL.md:23-31,
src/bmm-skills/4-implementation/bmad-code-review/SKILL.md:24-32,
src/bmm-skills/4-implementation/bmad-correct-course/SKILL.md:23-31,
src/bmm-skills/4-implementation/bmad-create-story/SKILL.md:33-41,
src/bmm-skills/4-implementation/bmad-dev-auto/SKILL.md:81-89, and
src/bmm-skills/4-implementation/bmad-dev-story/SKILL.md:30-38.
🤖 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 `@src/bmm-skills/1-analysis/bmad-agent-analyst/SKILL.md`:
- Around line 23-25: Remove the obsolete “If the script fails” fallback from the
activation instructions in src/bmm-skills/1-analysis/bmad-agent-analyst/SKILL.md
lines 23-25, src/bmm-skills/1-analysis/bmad-agent-tech-writer/SKILL.md lines
23-25, src/bmm-skills/1-analysis/bmad-document-project/SKILL.md lines 23-25,
src/bmm-skills/1-analysis/bmad-prfaq/SKILL.md lines 33-35,
src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/SKILL.md lines 23-25,
src/bmm-skills/4-implementation/bmad-retrospective/SKILL.md lines 39-41,
src/bmm-skills/4-implementation/bmad-sprint-planning/SKILL.md lines 23-25, and
src/bmm-skills/4-implementation/bmad-sprint-status/SKILL.md lines 23-25; if
retaining fallback behavior, rewrite each branch to handle only TOML read
failures while preserving data-only activation and never executing resolver
scripts.
- Line 23: Update the customization resolver documentation in the English,
French, and Vietnamese guides to describe direct TOML loading and merging during
activation instead of invoking resolve_customization.py. Revise examples and
fallback text to reflect the base customize.toml plus optional project and user
override files, without directing users to installer-owned scripts.

In `@src/bmm-skills/2-plan-workflows/bmad-agent-pm/SKILL.md`:
- Line 23: Remove the obsolete script-failure fallback blocks immediately
following the activation instructions in both
src/bmm-skills/2-plan-workflows/bmad-agent-pm/SKILL.md (Lines 25–31) and
src/bmm-skills/2-plan-workflows/bmad-agent-ux-designer/SKILL.md (Lines 25–31);
retain the direct-TOML resolution instructions and resolved agent values in each
activation section.

In `@src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md`:
- Around line 21-23: Update the relevant activation documentation under docs/ to
describe the TOML-based customization contract: read skill-root customize.toml
first, then optionally merge the project and user override files in order, with
scalar overrides, deep table merges, and the specified array handling.
Explicitly document that project scripts are not executed during activation and
that resolved agent values drive activation.

In `@src/bmm-skills/3-solutioning/bmad-architecture/SKILL.md`:
- Around line 53-54: The activation flow in bmad-architecture must defer
`{workflow.activation_steps_append}` until after merged configuration is
resolved and the user is greeted. Update the instructions around the workflow
activation steps so prepend hooks run first, config resolution and greeting
follow, and append hooks run last, matching the ordering used by the other
activation flows.

In `@src/core-skills/bmad-advanced-elicitation/SKILL.md`:
- Line 17: Document the activation contract in all six affected files:
src/core-skills/bmad-advanced-elicitation/SKILL.md:17-17 must describe direct
customization TOML merging; src/core-skills/bmad-brainstorming/SKILL.md:21-23
and src/core-skills/bmad-forge-idea/SKILL.md:25-27 and
src/core-skills/bmad-party-mode/SKILL.md:19-20 must describe direct
customization and core-config TOML merging;
src/core-skills/bmad-deep-recon/SKILL.md:40-41 must describe direct
customization/config merging and hook ordering; and
src/core-skills/bmad-review/SKILL.md:27-27 must describe direct customization
merging and forwarded activation behavior. State that activation reads and
merges the relevant TOML layers directly rather than executing resolver scripts.

In `@src/core-skills/bmad-deep-recon/SKILL.md`:
- Around line 40-41: Reorder activation so central configuration is fully
resolved before executing {workflow.activation_steps_append}. In the activation
flow described by items 1–2, resolve user_name, project_name, output_folder, and
related values first, then run the append hooks while preserving the existing
prepend-hook ordering.

---

Outside diff comments:
In `@src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md`:
- Around line 23-31: Replace the contradictory “If the script fails” fallback in
the activation instructions with explicit TOML error handling: require the base
customize.toml and fail activation when it is missing or invalid; skip absent or
unreadable team and user override files with warnings, matching the existing
resolver behavior. Apply this change in
src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md:23-31,
src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/SKILL.md:52-60,
src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/SKILL.md:54-62,
src/bmm-skills/3-solutioning/bmad-generate-project-context/SKILL.md:33-41,
src/bmm-skills/4-implementation/bmad-agent-dev/SKILL.md:23-31,
src/bmm-skills/4-implementation/bmad-checkpoint-preview/SKILL.md:23-31,
src/bmm-skills/4-implementation/bmad-code-review/SKILL.md:24-32,
src/bmm-skills/4-implementation/bmad-correct-course/SKILL.md:23-31,
src/bmm-skills/4-implementation/bmad-create-story/SKILL.md:33-41,
src/bmm-skills/4-implementation/bmad-dev-auto/SKILL.md:81-89, and
src/bmm-skills/4-implementation/bmad-dev-story/SKILL.md:30-38.
🪄 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 Plus

Run ID: 0e0a44d8-a2e1-4fb8-b29f-684a840f8482

📥 Commits

Reviewing files that changed from the base of the PR and between bb45db4 and d067f3f.

📒 Files selected for processing (39)
  • src/bmm-skills/1-analysis/bmad-agent-analyst/SKILL.md
  • src/bmm-skills/1-analysis/bmad-agent-tech-writer/SKILL.md
  • src/bmm-skills/1-analysis/bmad-document-project/SKILL.md
  • src/bmm-skills/1-analysis/bmad-prfaq/SKILL.md
  • src/bmm-skills/1-analysis/bmad-product-brief/SKILL.md
  • src/bmm-skills/2-plan-workflows/bmad-agent-pm/SKILL.md
  • src/bmm-skills/2-plan-workflows/bmad-agent-ux-designer/SKILL.md
  • src/bmm-skills/2-plan-workflows/bmad-prd/SKILL.md
  • src/bmm-skills/2-plan-workflows/bmad-spec/SKILL.md
  • src/bmm-skills/2-plan-workflows/bmad-ux/SKILL.md
  • src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md
  • src/bmm-skills/3-solutioning/bmad-architecture/SKILL.md
  • src/bmm-skills/3-solutioning/bmad-check-implementation-readiness/SKILL.md
  • src/bmm-skills/3-solutioning/bmad-create-epics-and-stories/SKILL.md
  • src/bmm-skills/3-solutioning/bmad-generate-project-context/SKILL.md
  • src/bmm-skills/4-implementation/bmad-agent-dev/SKILL.md
  • src/bmm-skills/4-implementation/bmad-checkpoint-preview/SKILL.md
  • src/bmm-skills/4-implementation/bmad-code-review/SKILL.md
  • src/bmm-skills/4-implementation/bmad-correct-course/SKILL.md
  • src/bmm-skills/4-implementation/bmad-create-story/SKILL.md
  • src/bmm-skills/4-implementation/bmad-dev-auto/SKILL.md
  • src/bmm-skills/4-implementation/bmad-dev-story/SKILL.md
  • src/bmm-skills/4-implementation/bmad-qa-generate-e2e-tests/SKILL.md
  • src/bmm-skills/4-implementation/bmad-retrospective/SKILL.md
  • src/bmm-skills/4-implementation/bmad-sprint-planning/SKILL.md
  • src/bmm-skills/4-implementation/bmad-sprint-status/SKILL.md
  • src/bmm-skills/v6-shims/bmad-create-architecture/SKILL.md
  • src/bmm-skills/v6-shims/bmad-create-prd/SKILL.md
  • src/bmm-skills/v6-shims/bmad-domain-research/SKILL.md
  • src/bmm-skills/v6-shims/bmad-edit-prd/SKILL.md
  • src/bmm-skills/v6-shims/bmad-market-research/SKILL.md
  • src/bmm-skills/v6-shims/bmad-technical-research/SKILL.md
  • src/bmm-skills/v6-shims/bmad-validate-prd/SKILL.md
  • src/core-skills/bmad-advanced-elicitation/SKILL.md
  • src/core-skills/bmad-brainstorming/SKILL.md
  • src/core-skills/bmad-deep-recon/SKILL.md
  • src/core-skills/bmad-forge-idea/SKILL.md
  • src/core-skills/bmad-party-mode/SKILL.md
  • src/core-skills/bmad-review/SKILL.md

Comment thread src/bmm-skills/1-analysis/bmad-agent-analyst/SKILL.md Outdated
Comment thread src/bmm-skills/1-analysis/bmad-agent-analyst/SKILL.md Outdated
Comment thread src/bmm-skills/2-plan-workflows/bmad-agent-pm/SKILL.md Outdated
Comment thread src/bmm-skills/3-solutioning/bmad-agent-architect/SKILL.md Outdated
Comment thread src/bmm-skills/3-solutioning/bmad-architecture/SKILL.md Outdated
Comment thread src/core-skills/bmad-advanced-elicitation/SKILL.md Outdated
Comment thread src/core-skills/bmad-deep-recon/SKILL.md Outdated
@greptile-apps

greptile-apps Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces activation-time resolve_customization.py and resolve_config.py script invocations across 31 SKILL.md files with equivalent direct TOML-merge instructions, so _bmad/ stays data-only during skill startup. The intent is correct and the mechanics of the replacement are consistent across all changed files.

  • 31 SKILL.md files updated to merge customization/config TOML layers directly instead of shelling out to project-supplied Python scripts at activation time.
  • 4 SKILL.md files missed — bmad-sprint-planning, bmad-retrospective, bmad-sprint-status, and bmad-project-context were not updated and still invoke resolver scripts in their On Activation sections, leaving the same execution vector open for those skills.
  • Contradictory "If the script fails" fallback blocks remain in ~21 files (previously flagged): the new instruction says "never by executing resolver code" but the immediately-following paragraph still treats a script failure as the trigger for the TOML merge, implying a script should have been attempted first.

Confidence Score: 3/5

  • Safe to merge only after adding the four uncovered SKILL.md files to the fix — activating any of those skills still runs project-supplied Python at startup.
  • The fix is correctly applied to 31 files and the replacement instructions are consistent, but four SKILL.md files (bmad-sprint-planning, bmad-retrospective, bmad-sprint-status, bmad-project-context) were not updated and still shell out to resolver scripts in their On Activation sections. Any project that targets those skills retains the same code-execution vector the PR is meant to close. Additionally, ~21 updated files still contain "If the script fails" fallback blocks that logically imply a script should have been attempted first, creating an instruction contradiction an LLM could exploit to reintroduce the execution path.
  • src/bmm-skills/plan/bmad-sprint-planning/SKILL.md, src/bmm-skills/ship/bmad-retrospective/SKILL.md, src/bmm-skills/v6-shims/bmad-sprint-status/SKILL.md, src/bmm-skills/plan/bmad-project-context/SKILL.md — all four retain activation-time resolver script calls that were not addressed by this PR.

Important Files Changed

Filename Overview
src/bmm-skills/agents/bmad-agent-analyst/SKILL.md Step 1 now correctly prohibits script execution, but the immediately-following "If the script fails" block (lines 25–31) still describes the same TOML merge as a fallback for a script that was never supposed to run — creating a logical contradiction an LLM could misinterpret as permission to try the script first.
src/core-skills/bmad-party-mode/SKILL.md On Activation steps 1–2 correctly prohibit resolver script execution; however, the Conventions section (line 13) still lists both resolve_config.py and resolve_customization.py as the canonical scripts for config/customization resolution without any "activation-only" carve-out, conflicting with the new instructions.
src/bmm-skills/plan/bmad-sprint-planning/SKILL.md Not included in the PR changeset; On Activation step 1 still runs uv run … resolve_customization.py — the exact pattern this fix is supposed to eliminate.
src/bmm-skills/plan/bmad-architecture/SKILL.md Both resolve_customization.py (step 1) and resolve_config.py (step 2) replaced with direct TOML-merge instructions; config layer description omits the specific four file names (a pre-existing omission also noted in the review thread for several other files).
src/bmm-skills/plan/bmad-spec/SKILL.md Both resolver calls replaced with direct TOML-merge; the new config step 3 still doesn't name the four specific files (_bmad/config.toml, _bmad/config.user.toml, _bmad/custom/config.toml, _bmad/custom/config.user.toml), as already noted in the review thread.
src/bmm-skills/ship/bmad-retrospective/SKILL.md Not included in the PR changeset; activation step 1 still executes uv run --no-cache resolve_customization.py, leaving the arbitrary-code-execution path open for this skill.
src/bmm-skills/plan/bmad-project-context/SKILL.md Not in the PR; activation steps 1 and 2 both call resolver scripts (resolve_customization.py and resolve_config.py) — the only uncovered file with two activation-time resolver calls.
src/core-skills/bmad-brainstorming/SKILL.md Both resolver calls replaced; the new step 3 config resolution follows the same underspecified "two base + two override" pattern as other files.
src/bmm-skills/v6-shims/bmad-sprint-status/SKILL.md Not in the PR; On Activation step 1 still runs uv run resolve_customization.py.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Skill Activation] --> B{PR Changed\nThis File?}
    B -- Yes --> C[Direct TOML Merge]
    B -- No --> D{Has Resolver\nCall in Activation?}
    C --> E[Read skill-root/customize.toml]
    E --> F[Merge _bmad/custom/skill-name.toml]
    F --> G[Merge _bmad/custom/skill-name.user.toml]
    G --> H[✅ Safe — no code execution]
    D -- No --> I[✅ Not applicable]
    D -- Yes --> J[⚠️ Still runs uv run resolve_customization.py\nor resolve_config.py]
    J --> K[bmad-sprint-planning\nbmad-retrospective\nbmad-sprint-status\nbmad-project-context]
    K --> L[❌ Arbitrary project code\nexecuted at startup]
Loading

Reviews (8): Last reviewed commit: "Merge branch 'main' into main" | Re-trigger Greptile

Comment thread src/bmm-skills/plan/bmad-spec/SKILL.md
@rashidiff

Copy link
Copy Markdown
Contributor Author

Conflict solved

@rashidiff

Copy link
Copy Markdown
Contributor Author

Ready to merge

@bmadcode

Copy link
Copy Markdown
Collaborator

Thank you for raising this — the concern in #2624 (activation executing unverified project-local scripts) is real and worth tracking. Closing this PR in its current form: the conflict-resolution merge in early August dropped the core-skills coverage the original diff had, every edited file still carries the "if the script fails, resolve the block yourself" fallback that contradicts the new instruction, and the branch is conflicting with main again. More fundamentally, replacing the deterministic resolver scripts with in-chat TOML merging is a design change we are not taking right now — the v7 rework in flight will reshape how skills resolve config, and #2624 stays open as the record of the concern.

—
Closed by the BMad Code AI Bot during an open-PR triage sweep. If you believe this closing is unwarranted, you are welcome to reopen with a comment explaining why it is still valid — it will get another look.

@bmadcode bmadcode closed this Aug 24, 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.

2 participants