Skip to content

feat: add platform capability flags for conditional workflow execution#1897

Open
Dynokostya wants to merge 3 commits intobmad-code-org:mainfrom
Dynokostya:feature/platform-capabilities
Open

feat: add platform capability flags for conditional workflow execution#1897
Dynokostya wants to merge 3 commits intobmad-code-org:mainfrom
Dynokostya:feature/platform-capabilities

Conversation

@Dynokostya
Copy link
Copy Markdown

@Dynokostya Dynokostya commented Mar 11, 2026

What

Add a platform capabilities system that allows BMAD workflows to adapt behavior based on what the IDE/CLI tool supports — specifically sub-agent delegation, task tracking, and structured user prompting.

Why

BMAD supports 20+ IDE platforms, but implementation workflows (quick-dev, dev-story) previously had no way to leverage advanced platform features like sub-agent delegation or task tracking. This meant workflows either used platform-specific features (breaking other platforms) or avoided them entirely (leaving capabilities on the table).

This was targeted mainly for Claude Code which currently has the richest tool support. Other coding tools should explore adding capabilities support as their platforms evolve — the infrastructure is ready, just flip the flags in platform-codes.yaml.

Fixes #1898

How

  • Added capabilities schema to platform-codes.yaml with three flags per platform: sub_agents, task_tracking, structured_ask
  • Currently only Claude Code has all three enabled; all others default to false (conservative — expand as verified)
  • Installer persists capabilities to _config/ides/{platform}.yaml at install time via ide-config-manager.js
  • Updated quick-dev/step-03-execute.md: loads capabilities, conditionally registers tasks, uses orchestrator pattern (agent delegation) when sub_agents available, falls back to direct implementation
  • Updated dev-story/workflow.md: step 4 conditionally registers tasks, step 5 conditionally delegates to agents or implements directly with red-green-refactor

Testing

  • All 215 installation component tests pass
  • Schema validation: 10/10 agents pass
  • File reference validation: 498 references, 0 broken
  • Lint + format: clean

Add capabilities schema (sub_agents, task_tracking, structured_ask) to
platform-codes.yaml for all 21 platforms. Capabilities are persisted to
_config/ides/{platform}.yaml at install time.

Update quick-dev step-03-execute and dev-story workflow to conditionally
use agent delegation and task tracking when the platform supports them,
falling back to direct implementation otherwise.

Currently only Claude Code has all capabilities enabled. Other platforms
default to false and should be updated as their capabilities are verified.
@Dynokostya
Copy link
Copy Markdown
Author

Worth noting: most BMAD users run Claude Code since it has the strongest coding models, so this feature will be immediately beneficial for the majority of the user base. The capability flags infrastructure is ready for other platforms to opt in as they add similar tooling — just a one-line change in platform-codes.yaml per capability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

This PR introduces a capability-driven execution model for workflows and IDE configuration. It adds a capabilities metadata structure (sub_agents, task_tracking, structured_ask) to platform definitions, persists capabilities through IDE configuration, and extends workflows to conditionally enable task tracking registration and agent delegation based on available capabilities.

Changes

Cohort / File(s) Summary
Workflow Logic Enhancement
src/bmm/workflows/4-implementation/dev-story/workflow.md, src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md
Add LOAD CAPABILITIES section, capability-conditional task tracking registration, and agent delegation paths. When capabilities.sub_agents is available, treat main session as orchestrator and delegate to agents; otherwise implement directly. Includes agent selection logic, delegation prompts with task details and project conventions, and DoD validation checkpoints.
IDE Configuration Persistence
tools/cli/installers/lib/core/ide-config-manager.js, tools/cli/installers/lib/core/installer.js
Extend saveIdeConfig() with optional capabilities parameter. Installer now retrieves platform capabilities and passes them to config save, enabling persistence of capability flags alongside IDE configuration.
Platform Capabilities Schema
tools/cli/installers/lib/ide/platform-codes.yaml
Define new capabilities block for each platform with three boolean flags: sub_agents, task_tracking, and structured_ask. Defaults to false; claude-code enables all three. Add Capabilities Schema documentation section.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #1861: Modifies the same dev-story workflow file with YAML→Markdown conversion; this PR adds capability-driven delegation and task-tracking logic on top.
  • PR #1388: Updates the same step-03-execute.md file with standardized menu/next-step wording; this PR adds capabilities, delegation, and task-tracking logic to the same file.
  • PR #1827: Also manages capability flags for tools/platforms, focusing on removing stale subagent/team keys while this PR introduces new persistent capability structures.

Suggested reviewers

  • bmadcode
  • alexeyv
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add platform capability flags for conditional workflow execution' accurately summarizes the main change: introducing a capability system for conditional workflow behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the motivation for adding a platform capabilities system and detailing specific files modified.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 (1)
tools/cli/installers/lib/core/ide-config-manager.js (1)

119-125: ⚠️ Potential issue | 🟡 Minor

loadAllIdeConfigs returns only configuration, not capabilities.

The saveIdeConfig method now persists capabilities alongside configuration, but loadAllIdeConfigs (line 124) returns only config.configuration. This means callers using loadAllIdeConfigs won't have access to the capabilities block.

If any code path needs to load capabilities for all IDEs (e.g., to refresh or compare capabilities during updates), it would need to call loadIdeConfig for each IDE individually.

Consider whether loadAllIdeConfigs should return the full config object or a structure that includes capabilities:

           if (config) {
-            configs[ideName] = config.configuration;
+            configs[ideName] = {
+              configuration: config.configuration,
+              capabilities: config.capabilities,
+            };
           }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tools/cli/installers/lib/core/ide-config-manager.js` around lines 119 - 125,
loadAllIdeConfigs currently only stores config.configuration, dropping the
capabilities saved by saveIdeConfig; update loadAllIdeConfigs (the loop that
calls loadIdeConfig and populates configs) to store the full loaded object (or
an explicit {configuration, capabilities} shape) for each ideName instead of
only config.configuration, and ensure any callers that expect the old shape are
updated to read configuration from the new object (or adapt to the new
structure); reference the methods loadAllIdeConfigs, loadIdeConfig and
saveIdeConfig when making the change.
🧹 Nitpick comments (1)
src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md (1)

44-49: TaskCreate/TaskUpdate assumed but not defined.

The REGISTER TASKS section references TaskCreate and TaskUpdate tools without specifying their API or fallback if the tools don't exist. If capabilities.task_tracking is true but the tools are unavailable (misconfiguration), the workflow would fail.

Consider adding validation or fallback:

 If `{capabilities.task_tracking}` available: Register all identified tasks...
+Verify the TaskCreate tool is accessible before attempting registration; if unavailable, fall back to document checkboxes.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md` around
lines 44 - 49, The REGISTER TASKS section assumes TaskCreate and TaskUpdate
exist when capabilities.task_tracking is true; add a validation and fallback:
check that TaskCreate and TaskUpdate handlers (or their client objects) are
present before using them, and if missing, log a clear warning and fall back to
the document-checkbox progress method or create an in-memory/task-buffer queue.
Update the code paths around capabilities.task_tracking, TaskCreate, and
TaskUpdate to perform this presence check and graceful fallback so the workflow
won’t throw if the task-tracking tools are misconfigured.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/bmm/workflows/4-implementation/dev-story/workflow.md`:
- Around line 291-296: The agent discovery path is hardcoded to
".claude/agents/" in the "Agent Selection" step; update the workflow to
parameterize the discovery location based on the detected IDE or capability
instead of a fixed path. Use the existing capability key
(capabilities.sub_agents) or introduce a new capability like
capabilities.agent_paths to map IDE identifiers (e.g., "claude" ->
".claude/agents/", "cursor" -> ".cursor/agents/") and change the actions that
"Identify target file types and task domain" and "Check for a specialized agent
in .claude/agents/" to consult that capability mapping at runtime and fall back
to a general-purpose agent when no mapping or match is found.

---

Outside diff comments:
In `@tools/cli/installers/lib/core/ide-config-manager.js`:
- Around line 119-125: loadAllIdeConfigs currently only stores
config.configuration, dropping the capabilities saved by saveIdeConfig; update
loadAllIdeConfigs (the loop that calls loadIdeConfig and populates configs) to
store the full loaded object (or an explicit {configuration, capabilities}
shape) for each ideName instead of only config.configuration, and ensure any
callers that expect the old shape are updated to read configuration from the new
object (or adapt to the new structure); reference the methods loadAllIdeConfigs,
loadIdeConfig and saveIdeConfig when making the change.

---

Nitpick comments:
In `@src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md`:
- Around line 44-49: The REGISTER TASKS section assumes TaskCreate and
TaskUpdate exist when capabilities.task_tracking is true; add a validation and
fallback: check that TaskCreate and TaskUpdate handlers (or their client
objects) are present before using them, and if missing, log a clear warning and
fall back to the document-checkbox progress method or create an
in-memory/task-buffer queue. Update the code paths around
capabilities.task_tracking, TaskCreate, and TaskUpdate to perform this presence
check and graceful fallback so the workflow won’t throw if the task-tracking
tools are misconfigured.
🪄 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: 249b1f79-d752-4d59-8116-fc0aade3c93c

📥 Commits

Reviewing files that changed from the base of the PR and between 874ae40 and f02dbce.

📒 Files selected for processing (5)
  • src/bmm/workflows/4-implementation/dev-story/workflow.md
  • src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md
  • tools/cli/installers/lib/core/ide-config-manager.js
  • tools/cli/installers/lib/core/installer.js
  • tools/cli/installers/lib/ide/platform-codes.yaml

Comment on lines +291 to +296
<check if="{capabilities.sub_agents} is available">
<!-- Agent Selection -->
<action>Identify target file types and task domain for the current task/subtask</action>
<action>Check for a specialized agent in .claude/agents/ (or IDE equivalent) whose description matches the target file types and task domain</action>
<action>If no specialized agent matches, use a general-purpose agent as fallback</action>

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 | 🟡 Minor

Agent discovery path hardcoded to .claude/agents/.

The agent selection step specifies checking .claude/agents/ for specialized agents. This is Claude-specific and won't work for other IDEs that may have agents in different locations (e.g., .cursor/agents/).

If this workflow should support capability-driven execution across multiple IDEs, the agent discovery path should be parameterized based on the detected IDE:

- <action>Check for a specialized agent in .claude/agents/ (or IDE equivalent) whose description matches the target file types and task domain</action>
+ <action>Check for a specialized agent in the current IDE's agents directory (e.g., .{ide}/agents/) whose description matches the target file types and task domain</action>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/dev-story/workflow.md` around lines 291 -
296, The agent discovery path is hardcoded to ".claude/agents/" in the "Agent
Selection" step; update the workflow to parameterize the discovery location
based on the detected IDE or capability instead of a fixed path. Use the
existing capability key (capabilities.sub_agents) or introduce a new capability
like capabilities.agent_paths to map IDE identifiers (e.g., "claude" ->
".claude/agents/", "cursor" -> ".cursor/agents/") and change the actions that
"Identify target file types and task domain" and "Check for a specialized agent
in .claude/agents/" to consult that capability mapping at runtime and fall back
to a general-purpose agent when no mapping or match is found.

Replace hardcoded .claude/agents/ references with generic phrasing
that uses the IDE's own agents directory, keeping .claude/agents/
only as an example.
@Dynokostya
Copy link
Copy Markdown
Author

Re: agent discovery path hardcoded to .claude/agents/ — Fixed in 5b2003d. Both workflow files now use platform-agnostic phrasing with .claude/agents/ only as an example.

Re: loadAllIdeConfigs doesn't return capabilities — Valid observation, but changing the return shape would be a breaking change. All 4 callers in installer.js use savedIdeConfigs[ide] directly as the raw configuration object (e.g., ideConfigurations[ide] = savedIdeConfigs[ide]). Wrapping it in { configuration, capabilities } would require updating all call sites.

In practice there's no gap: workflows read the YAML file directly at runtime and get the full object including capabilities. The loadAllIdeConfigs path is only used by the installer for re-applying saved configs during updates. If a future feature needs programmatic access to all capabilities, that refactor can be scoped separately.

@bmadcode
Copy link
Copy Markdown
Collaborator

@Dynokostya I like this idea, not sure we want to maintain it though - I have a skill coming soon called bmad-init or something similar that every workflow will call at the start, and pulling in tool capabilities also at that time is a great idea, then as we are converting to skills there will be common language or phrasing that can exist and progressive disclosure to different prompts based on capabilities.

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.

feat: platform capability flags for conditional workflow behavior

2 participants