Skip to content

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

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

fix(skills): stop activation from executing project resolvers#2632
rashidiff wants to merge 6 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

Greptile Summary

This PR replaces activation-time resolve_customization.py / resolve_config.py shell-outs in 31 SKILL.md files with inline TOML-merge instructions, so _bmad/ stays data-only during skill startup and no project-supplied script runs at activation.

  • 31 of the affected skills are updated; four are not: bmad-project-context, bmad-sprint-planning, bmad-retrospective, and bmad-sprint-status still call resolve_customization.py during activation, leaving the execution path partially open.
  • Several updated files retain an orphaned **If the script fails** fallback block that logically presupposes a script was attempted, directly contradicting the new "never by executing resolver code" instruction in Step 1 (previously flagged).
  • The config-layer merge instructions in some files describe "the two base config files…then their two matching override files" without naming the specific filenames, which may cause an LLM to resolve the wrong files (previously flagged).

Confidence Score: 3/5

  • The fix is correct for the 31 skills it touches, but four activation paths that call resolve_customization.py were not updated and still allow arbitrary project-tree code to run at skill startup.
  • Four SKILL.md files outside the changeset (bmad-project-context, bmad-sprint-planning, bmad-retrospective, bmad-sprint-status) still execute resolve_customization.py during activation. Because the stated goal of this PR is to close exactly that execution path, shipping without patching these files leaves the security boundary partially open. The gap is narrow but real, and it directly contradicts the fix's intent.
  • src/bmm-skills/plan/bmad-project-context/SKILL.md, 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

Important Files Changed

Filename Overview
src/bmm-skills/agents/bmad-agent-analyst/SKILL.md Step 1 updated to prohibit resolver-script execution during activation; orphaned "If the script fails" fallback block (lines 25–31) still implies a script was attempted, contradicting the new instruction (previously flagged).
src/bmm-skills/agents/bmad-agent-architect/SKILL.md Same pattern as analyst: Step 1 correctly blocks resolver execution, but the "If the script fails" fallback (line 25) remains, creating an instruction-level contradiction.
src/bmm-skills/plan/bmad-project-context/SKILL.md Not included in the PR changeset; line 21 still runs resolve_customization.py at activation, leaving the security boundary from issue #2624 unpatched for this skill.
src/bmm-skills/plan/bmad-sprint-planning/SKILL.md Not included in the PR changeset; line 12 still executes resolve_customization.py during activation.
src/bmm-skills/ship/bmad-retrospective/SKILL.md Not included in the PR changeset; line 28 runs resolve_customization.py (with --no-cache) during activation.
src/bmm-skills/v6-shims/bmad-sprint-status/SKILL.md Not included in the PR changeset; line 12 still calls resolve_customization.py during activation for this deprecated shim.
src/core-skills/bmad-party-mode/SKILL.md Activation steps patched correctly; Conventions section (line 13) still describes resolve_config.py and resolve_customization.py as the tools for config and workflow resolution without noting the activation-time restriction (previously flagged).
src/bmm-skills/plan/bmad-spec/SKILL.md Config resolve step updated from script to four-layer merge description; the layer description omits specific file names (previously flagged inline thread).
src/core-skills/bmad-forge-idea/SKILL.md Activation steps correctly updated; Conventions section (line 20) still mentions resolve_customization.py and resolve_config.py as shared scripts without noting they must not be invoked during activation.
docs/zh-cn/explanation/build.md Whitespace-only change (trailing space removed); no logic impact.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Skill Activation] --> B{Resolve Customization}
    B -->|Old path — REMOVED in this PR| C["Execute resolve_customization.py\nfrom {project-root}/_bmad/scripts/"]
    B -->|New path — 31 of 35 SKILL.md files| D["Read {skill-root}/customize.toml\n+ merge custom/*.toml layers\ndirectly in-context"]
    B -->|Still old path — 4 files NOT in PR| E["bmad-project-context\nbmad-sprint-planning\nbmad-retrospective\nbmad-sprint-status"]
    C --> F["Arbitrary project-tree code\nexecuted at startup"]
    D --> G["Config resolved safely\nfrom TOML only"]
    E --> F
    F --> H["Security boundary\nnot fully closed"]
    G --> I[Activation complete]
Loading

Reviews (6): 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

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