Skip to content

feat: add VS Code workflow prompt recommendations#1205

Closed
Sjoerd-Bo3 wants to merge 1 commit intobmad-code-org:mainfrom
Sjoerd-Bo3:feat/workflow-prompt-recommendations
Closed

feat: add VS Code workflow prompt recommendations#1205
Sjoerd-Bo3 wants to merge 1 commit intobmad-code-org:mainfrom
Sjoerd-Bo3:feat/workflow-prompt-recommendations

Conversation

@Sjoerd-Bo3
Copy link
Copy Markdown

@Sjoerd-Bo3 Sjoerd-Bo3 commented Dec 28, 2025

Summary

Adds VS Code workflow prompt recommendations (chat.promptFilesRecommendations) that are dynamically generated from path file metadata, with appropriate model assignments for different workflow phases.

Changes

Dynamic Prompt Generation

  • Path-based prompts: Reads workflow metadata from workflow-status/paths/*.yaml files instead of hardcoding prompt configurations in installer code
  • Automatic discovery: Prompts are generated for all workflows listed in path files, with proper phase context, agent info, and descriptions

Model Assignments

  • Analysis/Planning/Solutioning phasesclaude-opus-4.5 (best reasoning for architectural decisions)
  • Implementation workflowsgpt-5.2-codex (optimized for code generation)
  • Assignments are configurable per-workflow in the static config

Refactored Workflow Instructions

  • Removed hardcoded IDE prompt recommendation sections from workflow files
  • Workflows no longer instruct agents to manually modify VS Code settings

Files Changed

  • tools/cli/installers/lib/ide/shared/workflow-prompt-generator.js - Added path file parsing and dynamic prompt generation
  • tools/cli/installers/lib/ide/shared/workflow-prompts-config.js - Static prompts for implementation-cycle workflows only
  • tools/cli/installers/lib/ide/github-copilot.js - Pass project paths to generator
  • src/modules/bmm/workflows/* - Removed hardcoded IDE update instructions

Related Issues

Addresses feedback in VS Code regarding prompt file discovery:

Testing

  • All schema validation tests pass
  • Installation component tests pass
  • Linting passes

Copilot AI review requested due to automatic review settings December 28, 2025 22:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds VS Code workflow prompt recommendations support for GitHub Copilot, enabling users to discover and start BMAD workflows directly from the VS Code chat interface. It introduces static configuration for workflow prompts across BMM, BMGD, and core modules, along with a generator to create .github/prompts/*.prompt.md files and configure VS Code settings. Additionally, it extends the bmad-master agent with orchestration capabilities for subagent coordination.

Key changes:

  • Added workflow prompt configuration and generator for IDE new chat starters
  • Updated implementation-readiness and sprint-planning workflows to toggle prompts based on project phase
  • Extended agent schema to support orchestration and subagent metadata
  • Enhanced bmad-master agent with parallel research, delegated review, and specialized task orchestration patterns

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tools/schema/agent.js Added optional orchestration, subagent_examples, subagent_capable, and orchestrator fields to agent schema
tools/cli/installers/lib/ide/shared/workflow-prompts-config.js Defined workflow prompt configuration for BMM, BMGD, and core modules with shortcuts and descriptions
tools/cli/installers/lib/ide/shared/workflow-prompt-generator.js Created generator class to produce .prompt.md files and VS Code settings from config
tools/cli/installers/lib/ide/github-copilot.js Integrated prompt generation into setup process and added cleanup for prompt files
src/modules/bmm/workflows/4-implementation/sprint-planning/instructions.md Added step 6 to update VS Code prompt recommendations for implementation phase
src/modules/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md Added section 6 to update IDE prompts when project is ready for implementation
src/core/agents/bmad-master.agent.yaml Extended with orchestration patterns, subagent coordination capabilities, and new menu items for orchestration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Sjoerd-Bo3
Copy link
Copy Markdown
Author

Linking to feature request issue: #1206

Note: I should have created the issue and discussed in Discord before submitting this PR - apologies for the process gap. Happy to close this and resubmit after discussion if preferred.

@Sjoerd-Bo3 Sjoerd-Bo3 force-pushed the feat/workflow-prompt-recommendations branch from 3fe9831 to d662aee Compare December 28, 2025 22:44
Sjoerd-Bo3 added a commit to Sjoerd-Bo3/BMAD-METHOD that referenced this pull request Dec 28, 2025
- Move step 6 before WORKFLOW COMPLETE marker (fixes workflow structure)
- Change PRD shortcut from PR to PD (avoids conflict with parallel-research)
- Clarify instructions for reading/updating VS Code settings
- Update phase 4 comment to match actual handoff flow
@Sjoerd-Bo3
Copy link
Copy Markdown
Author

Addressed all Copilot review comments in commit 9317ef5:

Step 6 structure - Moved step 6 before WORKFLOW COMPLETE marker
Shortcut conflict - Changed PRD shortcut from 'PR' to 'PD' to avoid conflict with parallel-research
Instructions clarity - Clarified that agents should read existing settings and modify specific keys

Copy link
Copy Markdown
Collaborator

@bmadcode bmadcode left a comment

Choose a reason for hiding this comment

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

I like this idea @Sjoerd-Bo3 - but I would not want to hardcode any paths into the installer code. The project already has a concept of path files with netadata for the chosen path - this should be aligned with and use those files somehow so that if they change or new paths are added this will continue to evolve.

Also re the prompt file changes in the workflow - it needs to remain consistent for non vscode usage

@Sjoerd-Bo3
Copy link
Copy Markdown
Author

Thanks for the feedback @bmadcode. I've updated the approach:

Changes made:

  1. No more hardcoded paths in installer - Prompts are now generated dynamically by reading the path_files from each module's workflow-status/workflow.yaml, then parsing the actual path file YAML for workflow metadata (phase, agent, description, etc.)

  2. Path files are the source of truth - The generator discovers workflows from workflow-status/paths/*.yaml and builds prompt recommendations automatically. This means:

    • New workflows in path files automatically get prompt recommendations
    • No duplication between path files and installer config
    • Works consistently across different IDEs/platforms
  3. Removed hardcoded sections from workflow instructions - The sprint-planning/instructions.md and check-implementation-readiness/step-06-final-assessment.md no longer tell agents to manually edit VS Code settings with specific prompt names.

  4. Static config only for non-path-file workflows - Implementation-cycle prompts (create-story, dev-story, code-review, etc.) that aren't in path files are still defined in workflow-prompts-config.js.

The installer now reads from path files at install time, so if you add/rename workflows in the path files, the prompt recommendations update automatically.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 19, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

This PR introduces IDE workflow prompt generation for VS Code integration. It adds automated configuration of chat.promptFilesRecommendations in .vscode/settings.json during installer setup and workflow progression, enabling phase-aware prompt toggling across implementation workflows with new prompt generation and configuration modules.

Changes

Cohort / File(s) Summary
Workflow Documentation Updates
src/modules/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md, src/modules/bmm/workflows/4-implementation/sprint-planning/instructions.md
Added workflow step instructions to update IDE prompt recommendations by configuring chat.promptFilesRecommendations in .vscode/settings.json; enables implementation-phase prompts (create-story, dev-story, code-review, retrospective, correct-course) and disables prior-phase prompts.
Prompt Generation Infrastructure
tools/cli/installers/lib/ide/shared/workflow-prompts-config.js, tools/cli/installers/lib/ide/shared/workflow-prompt-generator.js
New modules: workflowPromptsConfig defines centralized static prompt configurations organized by module (bmm, bmgd, core); WorkflowPromptGenerator orchestrates prompt assembly from static/dynamic sources, generates .md files with YAML frontmatter, and returns prompt recommendations map.
IDE Installer Integration
tools/cli/installers/lib/ide/github-copilot.js
Integrated WorkflowPromptGenerator into setup flow: creates prompts directory, generates workflow prompts, merges promptRecommendations into VS Code settings (chat.promptFilesRecommendations), and logs prompt configuration; expanded cleanup to remove existing prompt files.

Sequence Diagram

sequenceDiagram
    participant Installer as CLI Installer<br/>(github-copilot.js)
    participant Generator as WorkflowPromptGenerator
    participant Config as WorkflowPromptsConfig
    participant FS as File System
    participant VSCode as VS Code<br/>Settings

    Installer->>Config: Load static prompt configs
    Config-->>Installer: Return prompt definitions
    
    Installer->>Generator: generatePromptFiles(dir, modules)
    Generator->>Config: getWorkflowPrompts()
    Config-->>Generator: Static prompts
    
    Generator->>FS: Read workflow files
    FS-->>Generator: Workflow YAML data
    Generator->>Generator: Merge static + dynamic prompts
    
    Generator->>FS: Write prompt .md files
    FS-->>Generator: Files written
    Generator-->>Installer: Prompt recommendations map
    
    Installer->>VSCode: Merge promptRecommendations into<br/>chat.promptFilesRecommendations
    VSCode-->>Installer: Settings configured
    
    Installer-->>Installer: Return setup result<br/>with prompts count
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • bmadcode
  • pbean
  • cecil-the-coder
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding VS Code workflow prompt recommendations. It directly reflects the core feature introduced across the changeset.
Description check ✅ Passed The description is well-structured with What/Why/How sections that clearly explain the feature, rationale, implementation approach, and testing performed. It directly relates to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 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: 2

🤖 Fix all issues with AI agents
In
`@src/modules/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md`:
- Around line 114-136: Section 6's IDE settings update uses wrong prompt keys;
update the "Set to false" list to match the keys generated by buildPromptName()
(path-based names include the module prefix). Replace the incorrect keys with
their generated counterparts: use bmd-bmm-brainstorming instead of
bmd-brainstorm, bmd-bmm-prd instead of bmd-prd, bmd-bmm-create-ux-design instead
of bmd-ux-design, bmd-bmm-create-architecture instead of
bmd-create-architecture, bmd-bmm-create-epics-and-stories instead of
bmd-epics-stories, bmd-bmm-implementation-readiness instead of
bmd-implementation-readiness, and bmd-bmm-sprint-planning instead of
bmd-sprint-planning so the .vscode/settings.json updates align with
buildPromptName() output.

In `@tools/cli/installers/lib/ide/github-copilot.js`:
- Around line 220-226: The merge currently does `{ ...bmadSettings,
...existingSettings }` so an existing `chat.promptFilesRecommendations` key in
`existingSettings` will completely override the generated recommendations in
`bmadSettings`; change the merge to ensure `chat.promptFilesRecommendations` is
deep-merged or that `bmadSettings['chat.promptFilesRecommendations']` is applied
after spreading `existingSettings`. Specifically, when building `mergedSettings`
(the variable created from `bmadSettings` and `existingSettings`), perform a
targeted merge for the `chat.promptFilesRecommendations` key (merge objects
rather than overwrite) or assign
`mergedSettings['chat.promptFilesRecommendations'] = {
...existingSettings['chat.promptFilesRecommendations'],
...bmadSettings['chat.promptFilesRecommendations'] }` so new recommendations are
registered while preserving user entries.
🧹 Nitpick comments (4)
tools/cli/installers/lib/ide/shared/workflow-prompt-generator.js (3)

54-66: Missing error handling for prompt file writes.

If fs.writeFile fails for any prompt file (e.g., permissions, disk full), the error propagates unhandled. Consider wrapping in try/catch to provide a clear error message or continue with remaining prompts.

♻️ Suggested improvement
     for (const prompt of mergedPrompts) {
       const frontmatter = ['---', `agent: ${prompt.agent}`, `description: "${prompt.description}"`];

       if (prompt.model) {
         frontmatter.push(`model: ${prompt.model}`);
       }

       const promptContent = [...frontmatter, '---', '', prompt.prompt, ''].join('\n');

       const promptFilePath = path.join(promptsDir, `bmd-${prompt.name}.prompt.md`);
-      await fs.writeFile(promptFilePath, promptContent);
+      try {
+        await fs.writeFile(promptFilePath, promptContent);
+      } catch (err) {
+        console.error(`Failed to write prompt file ${promptFilePath}: ${err.message}`);
+        continue;
+      }
       recommendations[`bmd-${prompt.name}`] = true;
     }

199-202: Path replacement may not handle edge cases.

The replacement at line 201 uses .replace() which only replaces the first occurrence. Also, the condition relativeBmadDir !== '_bmad' would pass for values like _bmad_custom or _bmad/nested, potentially causing unexpected substitutions.

If these edge cases are possible, consider a more precise check:

-      if (relativeBmadDir && relativeBmadDir !== '_bmad') {
-        resolved = resolved.replace('/_bmad/', `/${relativeBmadDir}/`);
+      if (relativeBmadDir && !/^_bmad\/?$/.test(relativeBmadDir)) {
+        resolved = resolved.replaceAll('/_bmad/', `/${relativeBmadDir}/`);
       }

101-117: Silent error handling hinders debugging.

The empty catch blocks at lines 103-105 and 115-117 silently swallow errors. While graceful degradation is appropriate, consider adding debug-level logging to aid troubleshooting when prompt generation fails unexpectedly.

src/modules/bmm/workflows/4-implementation/sprint-planning/instructions.md (1)

182-212: Duplicated prompt toggling logic across workflows.

This step 6 content is nearly identical to the one in step-06-final-assessment.md. If the prompt keys or logic need to change, both files must be updated in sync. Consider extracting this to a shared instruction snippet or documenting the relationship to prevent divergence.

The implementation looks correct and consistent with the final assessment workflow.

@Sjoerd-Bo3
Copy link
Copy Markdown
Author

Changes made:

  1. No more hardcoded paths in installer - Prompts are now generated dynamically by reading the path_files from each module's workflow-status/workflow.yaml, then parsing the actual path file YAML for workflow metadata.

  2. Path files are the source of truth - The generator discovers workflows from workflow-status/paths/*.yaml and builds prompt recommendations automatically.

  3. Removed hardcoded sections from workflow instructions - The sprint-planning/instructions.md and check-implementation-readiness/step-06-final-assessment.md no longer contain IDE update instructions.

  4. Fixed settings merge - New prompt recommendations are now deep-merged with existing user settings (addressed CodeRabbit feedback).

  5. Static config only for non-path-file workflows - Implementation-cycle prompts (create-story, dev-story, code-review, etc.) are still in workflow-prompts-config.js.

- Add workflow-prompt-generator.js for dynamic prompt generation from path files

- Add workflow-prompts-config.js for static workflow prompt configuration

- Update github-copilot.js to use WorkflowPromptGenerator

- Include model frontmatter and new-chat notes in prompts

- Deep-merge prompt recommendations to preserve existing settings
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +216 to +220
// Add prompt file recommendations for new chat starters
if (options.promptRecommendations && Object.keys(options.promptRecommendations).length > 0) {
bmadSettings['chat.promptFilesRecommendations'] = options.promptRecommendations;
}

Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

The assignment of prompt recommendations to bmadSettings on line 218 is redundant because it gets overridden by the merge on line 222, and then overridden again by the deep-merge on lines 225-229. Consider removing lines 217-219 since the deep-merge logic on lines 224-230 handles all cases correctly.

Suggested change
// Add prompt file recommendations for new chat starters
if (options.promptRecommendations && Object.keys(options.promptRecommendations).length > 0) {
bmadSettings['chat.promptFilesRecommendations'] = options.promptRecommendations;
}

Copilot uses AI. Check for mistakes.
const recommendations = {};

for (const prompt of mergedPrompts) {
const frontmatter = ['---', `agent: ${prompt.agent}`, `description: "${prompt.description}"`];
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

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

The description should be escaped to handle double quotes properly. If prompt.description contains a double quote character, it will break the YAML frontmatter syntax. Consider escaping double quotes similar to how it's done in the createAgentContent method on line 273 of github-copilot.js: prompt.description.replaceAll('"', String.raw")

Suggested change
const frontmatter = ['---', `agent: ${prompt.agent}`, `description: "${prompt.description}"`];
const escapedDescription = (prompt.description ?? '').replaceAll('"', String.raw`\"`);
const frontmatter = ['---', `agent: ${prompt.agent}`, `description: "${escapedDescription}"`];

Copilot uses AI. Check for mistakes.
@bmadcode
Copy link
Copy Markdown
Collaborator

this is not compliant with current format / redundant potentially with bmad-help. Thank you for the submission, closing for now.

@bmadcode bmadcode closed this Jan 27, 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.

4 participants