feat: add VS Code workflow prompt recommendations#1205
feat: add VS Code workflow prompt recommendations#1205Sjoerd-Bo3 wants to merge 1 commit intobmad-code-org:mainfrom
Conversation
There was a problem hiding this comment.
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.
...bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md
Outdated
Show resolved
Hide resolved
|
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. |
3fe9831 to
d662aee
Compare
- 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
|
Addressed all Copilot review comments in commit 9317ef5: ✅ Step 6 structure - Moved step 6 before WORKFLOW COMPLETE marker |
bmadcode
left a comment
There was a problem hiding this comment.
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
|
Thanks for the feedback @bmadcode. I've updated the approach: Changes made:
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. |
|
Note Other AI code review bot(s) detectedCodeRabbit 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. 📝 WalkthroughWalkthroughThis 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
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.writeFilefails 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 conditionrelativeBmadDir !== '_bmad'would pass for values like_bmad_customor_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
catchblocks 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.
...bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md
Outdated
Show resolved
Hide resolved
|
Changes made:
|
- 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
e1fefc3 to
d0e80e7
Compare
There was a problem hiding this comment.
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.
| // Add prompt file recommendations for new chat starters | ||
| if (options.promptRecommendations && Object.keys(options.promptRecommendations).length > 0) { | ||
| bmadSettings['chat.promptFilesRecommendations'] = options.promptRecommendations; | ||
| } | ||
|
|
There was a problem hiding this comment.
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.
| // Add prompt file recommendations for new chat starters | |
| if (options.promptRecommendations && Object.keys(options.promptRecommendations).length > 0) { | |
| bmadSettings['chat.promptFilesRecommendations'] = options.promptRecommendations; | |
| } |
| const recommendations = {}; | ||
|
|
||
| for (const prompt of mergedPrompts) { | ||
| const frontmatter = ['---', `agent: ${prompt.agent}`, `description: "${prompt.description}"`]; |
There was a problem hiding this comment.
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")
| const frontmatter = ['---', `agent: ${prompt.agent}`, `description: "${prompt.description}"`]; | |
| const escapedDescription = (prompt.description ?? '').replaceAll('"', String.raw`\"`); | |
| const frontmatter = ['---', `agent: ${prompt.agent}`, `description: "${escapedDescription}"`]; |
|
this is not compliant with current format / redundant potentially with bmad-help. Thank you for the submission, closing for now. |
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
workflow-status/paths/*.yamlfiles instead of hardcoding prompt configurations in installer codeModel Assignments
claude-opus-4.5(best reasoning for architectural decisions)gpt-5.2-codex(optimized for code generation)Refactored Workflow Instructions
Files Changed
tools/cli/installers/lib/ide/shared/workflow-prompt-generator.js- Added path file parsing and dynamic prompt generationtools/cli/installers/lib/ide/shared/workflow-prompts-config.js- Static prompts for implementation-cycle workflows onlytools/cli/installers/lib/ide/github-copilot.js- Pass project paths to generatorsrc/modules/bmm/workflows/*- Removed hardcoded IDE update instructionsRelated Issues
Addresses feedback in VS Code regarding prompt file discovery:
Testing