From f02dbceaab92579fa179529560b32df2fa8c8ae1 Mon Sep 17 00:00:00 2001 From: Kostiantyn Hlomozda Date: Wed, 11 Mar 2026 22:52:59 +0200 Subject: [PATCH] feat: add platform capability flags for conditional workflow execution 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. --- .../4-implementation/dev-story/workflow.md | 70 +++++++++++--- .../quick-dev/steps/step-03-execute.md | 71 +++++++++++--- .../installers/lib/core/ide-config-manager.js | 4 +- tools/cli/installers/lib/core/installer.js | 4 +- .../installers/lib/ide/platform-codes.yaml | 95 +++++++++++++++++++ 5 files changed, 219 insertions(+), 25 deletions(-) diff --git a/src/bmm/workflows/4-implementation/dev-story/workflow.md b/src/bmm/workflows/4-implementation/dev-story/workflow.md index c2200d398..bfb4e3770 100644 --- a/src/bmm/workflows/4-implementation/dev-story/workflow.md +++ b/src/bmm/workflows/4-implementation/dev-story/workflow.md @@ -41,6 +41,10 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: - `project_context` = `**/project-context.md` (load if exists) +### Capabilities + +- `capabilities` = Load from `{project-root}/_bmad/_config/ides/*.yaml` → `capabilities` block + --- ## EXECUTION @@ -265,26 +269,70 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: ℹ️ No sprint status file exists - story progress will be tracked in story file only Set {{current_sprint_status}} = "no-sprint-tracking" + + + + For each unchecked [ ] task and subtask in the story's Tasks/Subtasks section: + - Register with the IDE's task tracking tool using the task description and pending status + - Store the mapping between story checkbox items and tracked task IDs + + If review_continuation == true, also register unchecked review follow-up items + Throughout steps 5-8, update task status to in_progress when starting and completed when marking [x] + FOLLOW THE STORY FILE TASKS/SUBTASKS SEQUENCE EXACTLY AS WRITTEN - NO DEVIATION + If {capabilities.sub_agents} is available, the main session is the ORCHESTRATOR - delegate actual implementation to agents, do not implement directly. Otherwise, implement directly in the main session. Review the current task/subtask from the story file - this is your authoritative implementation guide - Plan implementation following red-green-refactor cycle - - Write FAILING tests first for the task/subtask functionality - Confirm tests fail before implementation - this validates test correctness + + + + Identify target file types and task domain for the current task/subtask + Check for a specialized agent in .claude/agents/ (or IDE equivalent) whose description matches the target file types and task domain + If no specialized agent matches, use a general-purpose agent as fallback - - Implement MINIMAL code to make tests pass - Run tests to confirm they now pass - Handle error conditions and edge cases as specified in task/subtask + + + Set the current task to in_progress in the IDE's task tracking tool + - - Improve code structure while keeping tests green - Ensure code follows architecture patterns and coding standards from Dev Notes + + Launch the selected agent with a detailed prompt containing: + - Task description and acceptance criteria from the story file + - Target file paths and expected changes + - Red-green-refactor instructions: write failing tests first, implement minimal code to pass, then refactor + - Architecture patterns and coding standards from Dev Notes + - Project conventions from {project_context} + + + + When the agent completes, verify: + - Implementation matches the task/subtask specification exactly + - Tests exist and pass for the implemented functionality + - Code follows architecture patterns and coding standards from Dev Notes + + + + + + Plan implementation following red-green-refactor cycle + + + Write FAILING tests first for the task/subtask functionality + Confirm tests fail before implementation - this validates test correctness + + + Implement MINIMAL code to make tests pass + Run tests to confirm they now pass + Handle error conditions and edge cases as specified in task/subtask + + + Improve code structure while keeping tests green + Ensure code follows architecture patterns and coding standards from Dev Notes + Document technical approach and decisions in Dev Agent Record → Implementation Plan diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md b/src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md index 81be97fba..98deb7c0a 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md +++ b/src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md @@ -29,31 +29,73 @@ From context: --- +## LOAD CAPABILITIES + +Load platform capabilities from `{project-root}/_bmad/_config/ides/*.yaml`. Read the `capabilities` block to determine available features. Store as `{capabilities}` for use in subsequent sections. + +Relevant flags: + +- `{capabilities.sub_agents}` - Can the IDE launch sub-agents for delegated work? +- `{capabilities.task_tracking}` - Does the IDE have built-in task management tools? +- `{capabilities.structured_ask}` - Does the IDE have a dedicated tool for prompting users? + +--- + +## REGISTER TASKS + +If `{capabilities.task_tracking}` available: Register all identified tasks for structured progress tracking. For Mode A, use tasks from the tech-spec. For Mode B, use tasks from the mental plan. For each task, call TaskCreate with a description and `pending` status. Throughout execution, call TaskUpdate to set `in_progress` when starting and `completed` when done. + +Otherwise: Track progress by marking checkboxes in the document as tasks are completed. + +--- + ## EXECUTION LOOP +If `{capabilities.sub_agents}` available, the main session acts as **orchestrator** -- delegate actual implementation to agents, do not implement directly. If not available, implement directly in the main session. + For each task: -### 1. Load Context +### 1. Select Agent (when sub_agents available) + +- Identify target file types and task nature +- Check for a specialized agent whose description matches (scan both global and project-level `.claude/agents/` directories or equivalent) +- If a specialized agent matches, use it +- If no match, use a general-purpose agent + +### 2. Update Tracking + +- If `{capabilities.task_tracking}` available: Call TaskUpdate to set `in_progress` +- Otherwise: Note task start + +### 3. Delegate / Implement + +**If sub_agents available:** Launch agent with a detailed prompt containing: + +- Exact task description and acceptance criteria +- Target file paths +- Relevant patterns from project-context +- Project conventions (CLAUDE.md, etc.) +- Instruction to write tests and confirm they pass + +**If sub_agents not available:** Implement directly: - Read files relevant to this task -- Review patterns from project-context or observed code -- Understand dependencies +- Follow existing patterns and conventions +- Write code, handle errors appropriately +- Add comments where non-obvious +- Write tests if appropriate for the change -### 2. Implement - -- Write code following existing patterns -- Handle errors appropriately -- Follow conventions observed in codebase -- Add appropriate comments where non-obvious - -### 3. Test +### 4. Test - Write tests if appropriate for the change - Run existing tests to catch regressions - Verify the specific AC for this task -### 4. Mark Complete +### 5. Validate and Mark Complete +- If sub_agents available: Verify agent's result matches the task spec and tests pass +- Confirm all tests pass (new and existing) +- If `{capabilities.task_tracking}` available: Call TaskUpdate to set `completed` - Check off task: `- [x] Task N` - Continue to next task immediately @@ -101,6 +143,8 @@ When ALL tasks are complete (or halted on blocker), read fully and follow: `{pro - Tests written where appropriate - Tests passing - No unnecessary halts +- If sub_agents available: All tasks delegated to appropriate agents (specialized when matching, general-purpose otherwise) +- If task_tracking available: All tasks registered, updated through lifecycle, and marked completed ## FAILURE MODES @@ -109,3 +153,6 @@ When ALL tasks are complete (or halted on blocker), read fully and follow: `{pro - Not running tests after changes - Giving up after first failure - Not following project-context rules (if exists) +- Implementing directly when sub_agents are available (orchestrator should delegate) +- Delegating without verifying agent results match task spec +- Not registering or updating task status when task_tracking is available diff --git a/tools/cli/installers/lib/core/ide-config-manager.js b/tools/cli/installers/lib/core/ide-config-manager.js index c00c00d48..339fe27a1 100644 --- a/tools/cli/installers/lib/core/ide-config-manager.js +++ b/tools/cli/installers/lib/core/ide-config-manager.js @@ -34,8 +34,9 @@ class IdeConfigManager { * @param {string} bmadDir - BMAD installation directory * @param {string} ideName - IDE name * @param {Object} configuration - IDE-specific configuration object + * @param {Object} [capabilities] - Platform capability flags (sub_agents, task_tracking, structured_ask) */ - async saveIdeConfig(bmadDir, ideName, configuration) { + async saveIdeConfig(bmadDir, ideName, configuration, capabilities) { const configDir = this.getIdeConfigDir(bmadDir); await fs.ensureDir(configDir); @@ -59,6 +60,7 @@ class IdeConfigManager { ide: ideName, configured_date: configuredDate, last_updated: now, + ...(capabilities && Object.keys(capabilities).length > 0 ? { capabilities } : {}), configuration: configuration || {}, }; diff --git a/tools/cli/installers/lib/core/installer.js b/tools/cli/installers/lib/core/installer.js index c9ea83182..eb15ac73c 100644 --- a/tools/cli/installers/lib/core/installer.js +++ b/tools/cli/installers/lib/core/installer.js @@ -1233,7 +1233,9 @@ class Installer { }); if (ideConfigurations[ide] && !ideConfigurations[ide]._alreadyConfigured) { - await this.ideConfigManager.saveIdeConfig(bmadDir, ide, ideConfigurations[ide]); + const handler = this.ideManager.handlers.get(ide); + const capabilities = handler?.platformConfig?.capabilities; + await this.ideConfigManager.saveIdeConfig(bmadDir, ide, ideConfigurations[ide], capabilities); } if (setupResult.success) { diff --git a/tools/cli/installers/lib/ide/platform-codes.yaml b/tools/cli/installers/lib/ide/platform-codes.yaml index 9d5f171f1..241c5255a 100644 --- a/tools/cli/installers/lib/ide/platform-codes.yaml +++ b/tools/cli/installers/lib/ide/platform-codes.yaml @@ -19,6 +19,10 @@ platforms: preferred: false category: ide description: "Google's AI development environment" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .agent/workflows @@ -31,6 +35,10 @@ platforms: preferred: false category: cli description: "AI development tool" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .augment/commands @@ -43,6 +51,10 @@ platforms: preferred: true category: cli description: "Anthropic's official CLI for Claude" + capabilities: + sub_agents: true + task_tracking: true + structured_ask: true installer: legacy_targets: - .claude/commands @@ -56,6 +68,10 @@ platforms: preferred: false category: ide description: "AI coding assistant" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .clinerules/workflows @@ -68,6 +84,10 @@ platforms: preferred: false category: cli description: "OpenAI Codex integration" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .codex/prompts @@ -83,6 +103,10 @@ platforms: preferred: false category: ide description: "Tencent Cloud Code Assistant - AI-powered coding companion" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .codebuddy/commands @@ -95,6 +119,10 @@ platforms: preferred: false category: ide description: "AI development assistant" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .crush/commands @@ -107,6 +135,10 @@ platforms: preferred: true category: ide description: "AI-first code editor" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .cursor/commands @@ -119,6 +151,10 @@ platforms: preferred: false category: cli description: "Google's CLI for Gemini" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .gemini/commands @@ -131,6 +167,10 @@ platforms: preferred: false category: ide description: "GitHub's AI pair programmer" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .github/agents @@ -144,6 +184,10 @@ platforms: preferred: false category: ide description: "AI workflow automation" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .iflow/commands @@ -157,6 +201,10 @@ platforms: category: ide description: "AI coding platform" suspended: "Kilo Code does not yet support the Agent Skills standard. Support is paused until they implement it. See https://github.com/kilocode/kilo-code/issues for updates." + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .kilocode/workflows @@ -169,6 +217,10 @@ platforms: preferred: false category: ide description: "Amazon's AI-powered IDE" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .kiro/steering @@ -181,6 +233,10 @@ platforms: preferred: false category: ide description: "OpenCode terminal coding assistant" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .opencode/agents @@ -197,6 +253,10 @@ platforms: preferred: false category: cli description: "Provider-agnostic terminal-native AI coding agent" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: target_dir: .pi/skills template_type: default @@ -207,6 +267,10 @@ platforms: preferred: false category: ide description: "Qwen AI coding assistant" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .qwen/commands @@ -219,6 +283,10 @@ platforms: preferred: false category: ide description: "Enhanced Cline fork" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .roo/commands @@ -231,6 +299,10 @@ platforms: preferred: false category: ide description: "Atlassian's Rovo development environment" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .rovodev/workflows @@ -243,6 +315,10 @@ platforms: preferred: false category: ide description: "AI coding tool" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .trae/rules @@ -255,6 +331,10 @@ platforms: preferred: false category: ide description: "AI-powered IDE with cascade flows" + capabilities: + sub_agents: false + task_tracking: false + structured_ask: false installer: legacy_targets: - .windsurf/workflows @@ -262,6 +342,21 @@ platforms: template_type: windsurf skill_format: true +# ============================================================================ +# Capabilities Schema +# ============================================================================ +# +# capabilities: +# sub_agents: boolean # IDE supports launching sub-agents for delegated implementation +# task_tracking: boolean # IDE has built-in task management tools (create/update/list) +# structured_ask: boolean # IDE has a dedicated tool for prompting the user (vs inline text) +# +# Capabilities are written to _config/ides/{platform}.yaml at install time. +# Workflows use these flags to adapt behavior — e.g., delegating to sub-agents +# when available, or implementing directly when not. +# +# Default all to false for new platforms. Set true only when verified. + # ============================================================================ # Installer Config Schema # ============================================================================