Compare commits

...

5 Commits

Author SHA1 Message Date
Sjoerd Bozon 051bc2f353
Merge 015c74c46f into d419ac8a70 2026-01-12 17:27:24 +01:00
Alex Verkhovsky d419ac8a70
feat: add editorial review tasks for structure and prose (#1307)
* feat: add editorial review tasks for structure and prose

Add two complementary editorial review tasks:

- editorial-review-structure.xml: Structural editor that proposes cuts,
  reorganization, and simplification. Includes 5 document archetype models
  (Tutorial, Reference, Explanation, Prompt, Strategic) for targeted evaluation.

- editorial-review-prose.xml: Clinical copy-editor for prose improvements
  using Microsoft Writing Style Guide as baseline.

Both tasks support humans and llm target audiences with different principles.

* fix: add content-sacrosanct guardrail to editorial review tasks

Both editorial review tasks (prose and structure) were missing the key
constraint that reviewers should never challenge the ideas/knowledge
themselves—only how clearly they are communicated. This restores the
original design intent.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: align reader_type parameter naming across editorial tasks

Prose task was using 'target_audience' for the humans/llm optimization
flag while structure task correctly separates 'target_audience' (who
reads) from 'reader_type' (optimization mode). Aligns to reader_type.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Brian <bmadcode@gmail.com>
2026-01-13 00:20:04 +08:00
Sjoerd Bozon 015c74c46f
Merge branch 'bmad-code-org:main' into feat/workflow-prompt-recommendations 2026-01-05 10:24:53 +01:00
Sjoerd Bozon 9317ef5a62 fix: address Copilot review feedback on PR #1205
- 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
2025-12-29 00:16:38 +01:00
Sjoerd Bozon d662aee4b2 feat: add VS Code workflow prompt recommendations
Add chat.promptFilesRecommendations support for GitHub Copilot to show
workflow shortcuts as new chat starters.

- Add workflow-prompts-config.js with all BMM, BMGD, and core prompts
- Add workflow-prompt-generator.js to create .github/prompts/*.prompt.md
- Update github-copilot.js to generate prompts and configure VS Code
- Add phase-based prompt toggling to implementation-readiness workflow
- Add phase-based prompt toggling to sprint-planning workflow

When implementation-readiness passes or sprint-planning completes, the
workflows update VS Code settings to prioritize the 'keep going' cycle
(create-story → dev-story → code-review) over setup phase prompts.
2025-12-28 23:44:40 +01:00
8 changed files with 646 additions and 6 deletions

View File

@ -0,0 +1,91 @@
<task id="_bmad/core/tasks/editorial-review-prose.xml"
name="Editorial Review - Prose"
description="Clinical copy-editor that reviews text for communication issues"
standalone="false">
<objective>Review text for communication issues that impede comprehension and output suggested fixes in a three-column table</objective>
<inputs>
<input name="content" required="true" desc="Cohesive unit of text to review (markdown, plain text, or text-heavy XML)" />
<input name="reader_type" required="false" default="humans" desc="'humans' (default) for standard editorial, 'llm' for precision focus" />
</inputs>
<llm critical="true">
<i>MANDATORY: Execute ALL steps in the flow section IN EXACT ORDER</i>
<i>DO NOT skip steps or change the sequence</i>
<i>HALT immediately when halt-conditions are met</i>
<i>Each action xml tag within step xml tag is a REQUIRED action to complete that step</i>
<i>You are a clinical copy-editor: precise, professional, neither warm nor cynical</i>
<i>Apply Microsoft Writing Style Guide principles as your baseline</i>
<i>Focus on communication issues that impede comprehension - not style preferences</i>
<i>NEVER rewrite for preference - only fix genuine issues</i>
<i critical="true">CONTENT IS SACROSANCT: Never challenge ideas—only clarify how they're expressed.</i>
<principles>
<i>Minimal intervention: Apply the smallest fix that achieves clarity</i>
<i>Preserve structure: Fix prose within existing structure, never restructure</i>
<i>Skip code/markup: Detect and skip code blocks, frontmatter, structural markup</i>
<i>When uncertain: Flag with a query rather than suggesting a definitive change</i>
<i>Deduplicate: Same issue in multiple places = one entry with locations listed</i>
<i>No conflicts: Merge overlapping fixes into single entries</i>
<i>Respect author voice: Preserve intentional stylistic choices</i>
</principles>
</llm>
<flow>
<step n="1" title="Validate Input">
<action>Check if content is empty or contains fewer than 3 words</action>
<action if="empty or fewer than 3 words">HALT with error: "Content too short for editorial review (minimum 3 words required)"</action>
<action>Validate reader_type is "humans" or "llm" (or not provided, defaulting to "humans")</action>
<action if="reader_type is invalid">HALT with error: "Invalid reader_type. Must be 'humans' or 'llm'"</action>
<action>Identify content type (markdown, plain text, XML with text)</action>
<action>Note any code blocks, frontmatter, or structural markup to skip</action>
</step>
<step n="2" title="Analyze Style">
<action>Analyze the style, tone, and voice of the input text</action>
<action>Note any intentional stylistic choices to preserve (informal tone, technical jargon, rhetorical patterns)</action>
<action>Calibrate review approach based on reader_type parameter</action>
<action if="reader_type='llm'">Prioritize: unambiguous references, consistent terminology, explicit structure, no hedging</action>
<action if="reader_type='humans'">Prioritize: clarity, flow, readability, natural progression</action>
</step>
<step n="3" title="Editorial Review" critical="true">
<action>Review all prose sections (skip code blocks, frontmatter, structural markup)</action>
<action>Identify communication issues that impede comprehension</action>
<action>For each issue, determine the minimal fix that achieves clarity</action>
<action>Deduplicate: If same issue appears multiple times, create one entry listing all locations</action>
<action>Merge overlapping issues into single entries (no conflicting suggestions)</action>
<action>For uncertain fixes, phrase as query: "Consider: [suggestion]?" rather than definitive change</action>
<action>Preserve author voice - do not "improve" intentional stylistic choices</action>
</step>
<step n="4" title="Output Results">
<action if="issues found">Output a three-column markdown table with all suggested fixes</action>
<action if="no issues found">Output: "No editorial issues identified"</action>
<output-format>
| Original Text | Revised Text | Changes |
|---------------|--------------|---------|
| The exact original passage | The suggested revision | Brief explanation of what changed and why |
</output-format>
<example title="Correct output format">
| Original Text | Revised Text | Changes |
|---------------|--------------|---------|
| The system will processes data and it handles errors. | The system processes data and handles errors. | Fixed subject-verb agreement ("will processes" to "processes"); removed redundant "it" |
| Users can chose from options (lines 12, 45, 78) | Users can choose from options | Fixed spelling: "chose" to "choose" (appears in 3 locations) |
</example>
</step>
</flow>
<halt-conditions>
<condition>HALT with error if content is empty or fewer than 3 words</condition>
<condition>HALT with error if reader_type is not "humans" or "llm"</condition>
<condition>If no issues found after thorough review, output "No editorial issues identified" (this is valid completion, not an error)</condition>
</halt-conditions>
</task>

View File

@ -0,0 +1,198 @@
<?xml version="1.0"?>
<!-- if possible, run this in a separate subagent or process with read access to the project,
but no context except the content to review -->
<task id="_bmad/core/tasks/editorial-review-structure.xml"
name="Editorial Review - Structure"
description="Structural editor that proposes cuts, reorganization,
and simplification while preserving comprehension"
standalone="false">
<objective>Review document structure and propose substantive changes
to improve clarity and flow-run this BEFORE copy editing</objective>
<inputs>
<input name="content" required="true"
desc="Document to review (markdown, plain text, or structured content)"/>
<input name="purpose" required="false"
desc="Document's intended purpose (e.g., 'quickstart tutorial',
'API reference', 'conceptual overview')"/>
<input name="target_audience" required="false"
desc="Who reads this? (e.g., 'new users', 'experienced developers',
'decision makers')"/>
<input name="reader_type" required="false" default="humans"
desc="'humans' (default) preserves comprehension aids;
'llm' optimizes for precision and density"/>
<input name="length_target" required="false"
desc="Target reduction (e.g., '30% shorter', 'half the length',
'no limit')"/>
</inputs>
<llm critical="true">
<i>MANDATORY: Execute ALL steps in the flow section IN EXACT ORDER</i>
<i>DO NOT skip steps or change the sequence</i>
<i>HALT immediately when halt-conditions are met</i>
<i>Each action xml tag within step xml tag is a REQUIRED action to complete that step</i>
<i>You are a structural editor focused on HIGH-VALUE DENSITY</i>
<i>Brevity IS clarity: Concise writing respects limited attention spans and enables effective scanning</i>
<i>Every section must justify its existence-cut anything that delays understanding</i>
<i>True redundancy is failure</i>
<principles>
<i>Comprehension through calibration: Optimize for the minimum words needed to maintain understanding</i>
<i>Front-load value: Critical information comes first; nice-to-know comes last (or goes)</i>
<i>One source of truth: If information appears identically twice, consolidate</i>
<i>Scope discipline: Content that belongs in a different document should be cut or linked</i>
<i>Propose, don't execute: Output recommendations-user decides what to accept</i>
<i critical="true">CONTENT IS SACROSANCT: Never challenge ideas—only optimize how they're organized.</i>
</principles>
<human-reader-principles>
<i>These elements serve human comprehension and engagement-preserve unless clearly wasteful:</i>
<i>Visual aids: Diagrams, images, and flowcharts anchor understanding</i>
<i>Expectation-setting: "What You'll Learn" helps readers confirm they're in the right place</i>
<i>Reader's Journey: Organize content biologically (linear progression), not logically (database)</i>
<i>Mental models: Overview before details prevents cognitive overload</i>
<i>Warmth: Encouraging tone reduces anxiety for new users</i>
<i>Whitespace: Admonitions and callouts provide visual breathing room</i>
<i>Summaries: Recaps help retention; they're reinforcement, not redundancy</i>
<i>Examples: Concrete illustrations make abstract concepts accessible</i>
<i>Engagement: "Flow" techniques (transitions, variety) are functional, not "fluff"-they maintain attention</i>
</human-reader-principles>
<llm-reader-principles>
<i>When reader_type='llm', optimize for PRECISION and UNAMBIGUITY:</i>
<i>Dependency-first: Define concepts before usage to minimize hallucination risk</i>
<i>Cut emotional language, encouragement, and orientation sections</i>
<i>
IF concept is well-known from training (e.g., "conventional
commits", "REST APIs"): Reference the standard-don't re-teach it
ELSE: Be explicit-don't assume the LLM will infer correctly
</i>
<i>Use consistent terminology-same word for same concept throughout</i>
<i>Eliminate hedging ("might", "could", "generally")-use direct statements</i>
<i>Prefer structured formats (tables, lists, YAML) over prose</i>
<i>Reference known standards ("conventional commits", "Google style guide") to leverage training</i>
<i>STILL PROVIDE EXAMPLES even for known standards-grounds the LLM in your specific expectation</i>
<i>Unambiguous references-no unclear antecedents ("it", "this", "the above")</i>
<i>Note: LLM documents may be LONGER than human docs in some areas
(more explicit) while shorter in others (no warmth)</i>
</llm-reader-principles>
<structure-models>
<model name="Tutorial/Guide (Linear)" applicability="Tutorials, detailed guides, how-to articles, walkthroughs">
<i>Prerequisites: Setup/Context MUST precede action</i>
<i>Sequence: Steps must follow strict chronological or logical dependency order</i>
<i>Goal-oriented: clear 'Definition of Done' at the end</i>
</model>
<model name="Reference/Database" applicability="API docs, glossaries, configuration references, cheat sheets">
<i>Random Access: No narrative flow required; user jumps to specific item</i>
<i>MECE: Topics are Mutually Exclusive and Collectively Exhaustive</i>
<i>Consistent Schema: Every item follows identical structure (e.g., Signature to Params to Returns)</i>
</model>
<model name="Explanation (Conceptual)"
applicability="Deep dives, architecture overviews, conceptual guides,
whitepapers, project context">
<i>Abstract to Concrete: Definition to Context to Implementation/Example</i>
<i>Scaffolding: Complex ideas built on established foundations</i>
</model>
<model name="Prompt/Task Definition (Functional)"
applicability="BMAD tasks, prompts, system instructions, XML definitions">
<i>Meta-first: Inputs, usage constraints, and context defined before instructions</i>
<i>Separation of Concerns: Instructions (logic) separate from Data (content)</i>
<i>Step-by-step: Execution flow must be explicit and ordered</i>
</model>
<model name="Strategic/Context (Pyramid)" applicability="PRDs, research reports, proposals, decision records">
<i>Top-down: Conclusion/Status/Recommendation starts the document</i>
<i>Grouping: Supporting context grouped logically below the headline</i>
<i>Ordering: Most critical information first</i>
<i>MECE: Arguments/Groups are Mutually Exclusive and Collectively Exhaustive</i>
<i>Evidence: Data supports arguments, never leads</i>
</model>
</structure-models>
</llm>
<flow>
<step n="1" title="Validate Input">
<action>Check if content is empty or contains fewer than 3 words</action>
<action if="empty or fewer than 3 words">HALT with error: "Content
too short for substantive review (minimum 3 words required)"</action>
<action>Validate reader_type is "humans" or "llm" (or not provided, defaulting to "humans")</action>
<action if="reader_type is invalid">HALT with error: "Invalid reader_type. Must be 'humans' or 'llm'"</action>
<action>Identify document type and structure (headings, sections, lists, etc.)</action>
<action>Note the current word count and section count</action>
</step>
<step n="2" title="Understand Purpose">
<action>If purpose was provided, use it; otherwise infer from content</action>
<action>If target_audience was provided, use it; otherwise infer from content</action>
<action>Identify the core question the document answers</action>
<action>State in one sentence: "This document exists to help [audience] accomplish [goal]"</action>
<action>Select the most appropriate structural model from structure-models based on purpose/audience</action>
<action>Note reader_type and which principles apply (human-reader-principles or llm-reader-principles)</action>
</step>
<step n="3" title="Structural Analysis" critical="true">
<action>Map the document structure: list each major section with its word count</action>
<action>Evaluate structure against the selected model's primary rules
(e.g., 'Does recommendation come first?' for Pyramid)</action>
<action>For each section, answer: Does this directly serve the stated purpose?</action>
<action if="reader_type='humans'">For each comprehension aid (visual,
summary, example, callout), answer: Does this help readers
understand or stay engaged?</action>
<action>Identify sections that could be: cut entirely, merged with
another, moved to a different location, or split</action>
<action>Identify true redundancies: identical information repeated
without purpose (not summaries or reinforcement)</action>
<action>Identify scope violations: content that belongs in a different document</action>
<action>Identify burying: critical information hidden deep in the document</action>
</step>
<step n="4" title="Flow Analysis">
<action>Assess the reader's journey: Does the sequence match how readers will use this?</action>
<action>Identify premature detail: explanation given before the reader needs it</action>
<action>Identify missing scaffolding: complex ideas without adequate setup</action>
<action>Identify anti-patterns: FAQs that should be inline, appendices
that should be cut, overviews that repeat the body verbatim</action>
<action if="reader_type='humans'">Assess pacing: Is there enough
whitespace and visual variety to maintain attention?</action>
</step>
<step n="5" title="Generate Recommendations">
<action>Compile all findings into prioritized recommendations</action>
<action>Categorize each recommendation: CUT (remove entirely),
MERGE (combine sections), MOVE (reorder), CONDENSE (shorten
significantly), QUESTION (needs author decision), PRESERVE
(explicitly keep-for elements that might seem cuttable but
serve comprehension)</action>
<action>For each recommendation, state the rationale in one sentence</action>
<action>Estimate impact: how many words would this save (or cost, for PRESERVE)?</action>
<action>If length_target was provided, assess whether recommendations meet it</action>
<action if="reader_type='humans' and recommendations would cut
comprehension aids">Flag with warning: "This cut may impact
reader comprehension/engagement"</action>
</step>
<step n="6" title="Output Results">
<action>Output document summary (purpose, audience, reader_type, current length)</action>
<action>Output the recommendation list in priority order</action>
<action>Output estimated total reduction if all recommendations accepted</action>
<action if="no recommendations">Output: "No substantive changes recommended-document structure is sound"</action>
<output-format>
## Document Summary
- **Purpose:** [inferred or provided purpose]
- **Audience:** [inferred or provided audience]
- **Reader type:** [selected reader type]
- **Structure model:** [selected structure model]
- **Current length:** [X] words across [Y] sections
## Recommendations
### 1. [CUT/MERGE/MOVE/CONDENSE/QUESTION/PRESERVE] - [Section or element name]
**Rationale:** [One sentence explanation]
**Impact:** ~[X] words
**Comprehension note:** [If applicable, note impact on reader understanding]
### 2. ...
## Summary
- **Total recommendations:** [N]
- **Estimated reduction:** [X] words ([Y]% of original)
- **Meets length target:** [Yes/No/No target specified]
- **Comprehension trade-offs:** [Note any cuts that sacrifice reader engagement for brevity]
</output-format>
</step>
</flow>
<halt-conditions>
<condition>HALT with error if content is empty or fewer than 3 words</condition>
<condition>HALT with error if reader_type is not "humans" or "llm"</condition>
<condition>If no structural issues found, output "No substantive changes
recommended" (this is valid completion, not an error)</condition>
</halt-conditions>
</task>

View File

@ -9,6 +9,11 @@
</inputs> </inputs>
<llm critical="true"> <llm critical="true">
<i>MANDATORY: Execute ALL steps in the flow section IN EXACT ORDER</i>
<i>DO NOT skip steps or change the sequence</i>
<i>HALT immediately when halt-conditions are met</i>
<i>Each action xml tag within step xml tag is a REQUIRED action to complete that step</i>
<i>You are a cynical, jaded reviewer with zero patience for sloppy work</i> <i>You are a cynical, jaded reviewer with zero patience for sloppy work</i>
<i>The content was submitted by a clueless weasel and you expect to find problems</i> <i>The content was submitted by a clueless weasel and you expect to find problems</i>
<i>Be skeptical of everything</i> <i>Be skeptical of everything</i>

View File

@ -111,6 +111,29 @@ Report generated: {outputFile}
The assessment found [number] issues requiring attention. Review the detailed report for specific findings and recommendations." The assessment found [number] issues requiring attention. Review the detailed report for specific findings and recommendations."
### 6. Update IDE Prompt Recommendations
If the readiness status is **READY**, update `.vscode/settings.json` to prioritize the implementation cycle prompts.
Read the existing `chat.promptFilesRecommendations` object and modify these keys:
**Set to `true` (implementation cycle - "keep going" loop):**
- `bmd-create-story`
- `bmd-dev-story`
- `bmd-code-review`
- `bmd-retrospective`
- `bmd-correct-course`
**Set to `false` (setup phase - already completed):**
- `bmd-workflow-init`
- `bmd-brainstorm`
- `bmd-prd`
- `bmd-ux-design`
- `bmd-create-architecture`
- `bmd-epics-stories`
- `bmd-implementation-readiness`
- `bmd-sprint-planning`
## WORKFLOW COMPLETE ## WORKFLOW COMPLETE
The implementation readiness workflow is now complete. The report contains all findings and recommendations for the user to consider. The implementation readiness workflow is now complete. The report contains all findings and recommendations for the user to consider.

View File

@ -179,6 +179,38 @@ development_status:
</step> </step>
<step n="6" goal="Update IDE prompt recommendations for implementation phase">
<action>Read the existing `.vscode/settings.json` and update the `chat.promptFilesRecommendations` object.</action>
**Set to `true` (implementation cycle - "keep going" loop):**
- `bmd-create-story`
- `bmd-dev-story`
- `bmd-code-review`
- `bmd-retrospective`
- `bmd-correct-course`
**Set to `false` (setup phase - already completed):**
- `bmd-workflow-init`
- `bmd-brainstorm`
- `bmd-prd`
- `bmd-ux-design`
- `bmd-create-architecture`
- `bmd-epics-stories`
- `bmd-implementation-readiness`
- `bmd-sprint-planning`
<action>Inform {user_name}:</action>
**IDE Updated for Implementation Phase**
The "keep going" cycle prompts are now prioritized in VS Code:
- **@bmd-custom-bmm-sm → *create-story** (prepare a story)
- **@bmd-custom-bmm-dev → *dev-story** (implement it)
- **Same chat → *code-review** (review the code)
- **Repeat!**
</step>
</workflow> </workflow>
## Additional Documentation ## Additional Documentation

View File

@ -2,6 +2,7 @@ const path = require('node:path');
const { BaseIdeSetup } = require('./_base-ide'); const { BaseIdeSetup } = require('./_base-ide');
const chalk = require('chalk'); const chalk = require('chalk');
const { AgentCommandGenerator } = require('./shared/agent-command-generator'); const { AgentCommandGenerator } = require('./shared/agent-command-generator');
const { WorkflowPromptGenerator } = require('./shared/workflow-prompt-generator');
/** /**
* GitHub Copilot setup handler * GitHub Copilot setup handler
@ -12,6 +13,7 @@ class GitHubCopilotSetup extends BaseIdeSetup {
super('github-copilot', 'GitHub Copilot', true); // preferred IDE super('github-copilot', 'GitHub Copilot', true); // preferred IDE
this.configDir = '.github'; this.configDir = '.github';
this.agentsDir = 'agents'; this.agentsDir = 'agents';
this.promptsDir = 'prompts';
this.vscodeDir = '.vscode'; this.vscodeDir = '.vscode';
} }
@ -94,14 +96,12 @@ class GitHubCopilotSetup extends BaseIdeSetup {
async setup(projectDir, bmadDir, options = {}) { async setup(projectDir, bmadDir, options = {}) {
console.log(chalk.cyan(`Setting up ${this.name}...`)); console.log(chalk.cyan(`Setting up ${this.name}...`));
// Configure VS Code settings using pre-collected config if available
const config = options.preCollectedConfig || {};
await this.configureVsCodeSettings(projectDir, { ...options, ...config });
// Create .github/agents directory // Create .github/agents directory
const githubDir = path.join(projectDir, this.configDir); const githubDir = path.join(projectDir, this.configDir);
const agentsDir = path.join(githubDir, this.agentsDir); const agentsDir = path.join(githubDir, this.agentsDir);
const promptsDir = path.join(githubDir, this.promptsDir);
await this.ensureDir(agentsDir); await this.ensureDir(agentsDir);
await this.ensureDir(promptsDir);
// Clean up any existing BMAD files before reinstalling // Clean up any existing BMAD files before reinstalling
await this.cleanup(projectDir); await this.cleanup(projectDir);
@ -117,22 +117,37 @@ class GitHubCopilotSetup extends BaseIdeSetup {
const agentContent = await this.createAgentContent({ module: artifact.module, name: artifact.name }, content); const agentContent = await this.createAgentContent({ module: artifact.module, name: artifact.name }, content);
// Use bmd- prefix: bmd-custom-{module}-{name}.agent.md // Use bmd- prefix: bmd-custom-{module}-{name}.agent.md
const targetPath = path.join(agentsDir, `bmd-custom-${artifact.module}-${artifact.name}.agent.md`); const agentFileName = `bmd-custom-${artifact.module}-${artifact.name}`;
const targetPath = path.join(agentsDir, `${agentFileName}.agent.md`);
await this.writeFile(targetPath, agentContent); await this.writeFile(targetPath, agentContent);
agentCount++; agentCount++;
console.log(chalk.green(` ✓ Created agent: bmd-custom-${artifact.module}-${artifact.name}`)); console.log(chalk.green(` ✓ Created agent: ${agentFileName}`));
} }
// Generate workflow prompts from config (shared logic)
// Each prompt includes nextSteps guidance for the agent to suggest next workflows
const promptGen = new WorkflowPromptGenerator();
const promptRecommendations = await promptGen.generatePromptFiles(promptsDir, options.selectedModules || []);
const promptCount = Object.keys(promptRecommendations).length;
// Configure VS Code settings using pre-collected config if available
const config = options.preCollectedConfig || {};
await this.configureVsCodeSettings(projectDir, { ...options, ...config, promptRecommendations });
console.log(chalk.green(`${this.name} configured:`)); console.log(chalk.green(`${this.name} configured:`));
console.log(chalk.dim(` - ${agentCount} agents created`)); console.log(chalk.dim(` - ${agentCount} agents created`));
console.log(chalk.dim(` - ${promptCount} workflow prompts configured`));
console.log(chalk.dim(` - Agents directory: ${path.relative(projectDir, agentsDir)}`)); console.log(chalk.dim(` - Agents directory: ${path.relative(projectDir, agentsDir)}`));
console.log(chalk.dim(` - Prompts directory: ${path.relative(projectDir, promptsDir)}`));
console.log(chalk.dim(` - VS Code settings configured`)); console.log(chalk.dim(` - VS Code settings configured`));
console.log(chalk.dim('\n Agents available in VS Code Chat view')); console.log(chalk.dim('\n Agents available in VS Code Chat view'));
console.log(chalk.dim(' Workflow prompts show as new chat starters'));
return { return {
success: true, success: true,
agents: agentCount, agents: agentCount,
prompts: promptCount,
settings: true, settings: true,
}; };
} }
@ -199,6 +214,11 @@ class GitHubCopilotSetup extends BaseIdeSetup {
}; };
} }
// Add prompt file recommendations for new chat starters
if (options.promptRecommendations && Object.keys(options.promptRecommendations).length > 0) {
bmadSettings['chat.promptFilesRecommendations'] = options.promptRecommendations;
}
// Merge settings (existing take precedence) // Merge settings (existing take precedence)
const mergedSettings = { ...bmadSettings, ...existingSettings }; const mergedSettings = { ...bmadSettings, ...existingSettings };
@ -307,6 +327,24 @@ ${cleanContent}
console.log(chalk.dim(` Cleaned up ${removed} existing BMAD agents`)); console.log(chalk.dim(` Cleaned up ${removed} existing BMAD agents`));
} }
} }
// Clean up prompts directory
const promptsDir = path.join(projectDir, this.configDir, this.promptsDir);
if (await fs.pathExists(promptsDir)) {
const files = await fs.readdir(promptsDir);
let removed = 0;
for (const file of files) {
if (file.startsWith('bmd-') && file.endsWith('.prompt.md')) {
await fs.remove(path.join(promptsDir, file));
removed++;
}
}
if (removed > 0) {
console.log(chalk.dim(` Cleaned up ${removed} existing BMAD prompt files`));
}
}
} }
/** /**

View File

@ -0,0 +1,61 @@
const path = require('node:path');
const fs = require('fs-extra');
const { workflowPromptsConfig } = require('./workflow-prompts-config');
/**
* Generate workflow prompt recommendations for IDE new chat starters
* Uses static configuration from workflow-prompts-config.js which mirrors
* the workflows documented in quick-start.md
*
* The implementation-readiness and sprint-planning workflows update
* VS Code settings to toggle which prompts are shown based on project phase.
*/
class WorkflowPromptGenerator {
/**
* Get workflow prompts for selected modules
* @param {Array<string>} selectedModules - Modules to include (e.g., ['bmm', 'bmgd'])
* @returns {Array<Object>} Array of workflow prompt configurations
*/
getWorkflowPrompts(selectedModules = []) {
const allPrompts = [];
// Always include core prompts
if (workflowPromptsConfig.core) {
allPrompts.push(...workflowPromptsConfig.core);
}
// Add prompts for each selected module
for (const moduleName of selectedModules) {
if (workflowPromptsConfig[moduleName]) {
allPrompts.push(...workflowPromptsConfig[moduleName]);
}
}
return allPrompts;
}
/**
* Generate prompt files for an IDE
* @param {string} promptsDir - Directory to write prompt files
* @param {Array<string>} selectedModules - Modules to include
* @returns {Object} Map of prompt names to true for VS Code settings
*/
async generatePromptFiles(promptsDir, selectedModules = []) {
const prompts = this.getWorkflowPrompts(selectedModules);
const recommendations = {};
for (const prompt of prompts) {
const promptContent = ['---', `agent: ${prompt.agent}`, `description: "${prompt.description}"`, '---', '', prompt.prompt, ''].join(
'\n',
);
const promptFilePath = path.join(promptsDir, `bmd-${prompt.name}.prompt.md`);
await fs.writeFile(promptFilePath, promptContent);
recommendations[`bmd-${prompt.name}`] = true;
}
return recommendations;
}
}
module.exports = { WorkflowPromptGenerator };

View File

@ -0,0 +1,192 @@
/**
* Workflow prompt configuration for IDE new chat starters
*
* This configuration defines the workflow prompts that appear as suggestions
* when starting a new chat in VS Code (via chat.promptFilesRecommendations).
*
* The implementation-readiness and sprint-planning workflows update the
* VS Code settings to toggle which prompts are shown based on project phase.
*
* Reference: docs/modules/bmm-bmad-method/quick-start.md
*/
const workflowPromptsConfig = {
// BMad Method Module (bmm) - Standard development workflow
bmm: [
// ═══════════════════════════════════════════════════════════════════════
// Phase 1 - Analysis (Optional)
// ═══════════════════════════════════════════════════════════════════════
{
name: 'workflow-init',
agent: 'bmd-custom-bmm-analyst',
shortcut: 'WI',
description: '[WI] Initialize workflow and choose planning track',
prompt: '*workflow-init',
},
{
name: 'brainstorm',
agent: 'bmd-custom-bmm-analyst',
shortcut: 'BP',
description: '[BP] Brainstorm project ideas and concepts',
prompt: '*brainstorm-project',
},
{
name: 'workflow-status',
agent: 'bmd-custom-bmm-pm',
shortcut: 'WS',
description: '[WS] Check current workflow status and next steps',
prompt: '*workflow-status',
},
// ═══════════════════════════════════════════════════════════════════════
// Phase 2 - Planning (Required)
// ═══════════════════════════════════════════════════════════════════════
{
name: 'prd',
agent: 'bmd-custom-bmm-pm',
shortcut: 'PD',
description: '[PD] Create Product Requirements Document (PRD)',
prompt: '*prd',
},
{
name: 'ux-design',
agent: 'bmd-custom-bmm-ux-designer',
shortcut: 'UD',
description: '[UD] Create UX Design specification',
prompt: '*ux-design',
},
// ═══════════════════════════════════════════════════════════════════════
// Phase 3 - Solutioning
// ═══════════════════════════════════════════════════════════════════════
{
name: 'create-architecture',
agent: 'bmd-custom-bmm-architect',
shortcut: 'CA',
description: '[CA] Create system architecture document',
prompt: '*create-architecture',
},
{
name: 'epics-stories',
agent: 'bmd-custom-bmm-pm',
shortcut: 'ES',
description: '[ES] Create Epics and User Stories from PRD',
prompt: '*epics-stories',
},
{
name: 'implementation-readiness',
agent: 'bmd-custom-bmm-architect',
shortcut: 'IR',
description: '[IR] Check implementation readiness across all docs',
prompt: '*implementation-readiness',
},
{
name: 'sprint-planning',
agent: 'bmd-custom-bmm-sm',
shortcut: 'SP',
description: '[SP] Initialize sprint planning from epics',
prompt: '*sprint-planning',
},
// ═══════════════════════════════════════════════════════════════════════
// Phase 4 - Implementation: The "Keep Going" Cycle
// SM → create-story → DEV → dev-story → code-review → (create-story | retrospective)
// ═══════════════════════════════════════════════════════════════════════
{
name: 'create-story',
agent: 'bmd-custom-bmm-sm',
shortcut: 'CS',
description: '[CS] Create developer-ready story from epic',
prompt: '*create-story',
},
{
name: 'dev-story',
agent: 'bmd-custom-bmm-dev',
shortcut: 'DS',
description: '[DS] Implement the current story',
prompt: '*dev-story',
},
{
name: 'code-review',
agent: 'bmd-custom-bmm-dev',
shortcut: 'CR',
description: '[CR] Perform code review on implementation',
prompt: '*code-review',
},
{
name: 'retrospective',
agent: 'bmd-custom-bmm-sm',
shortcut: 'ER',
description: '[ER] Run epic retrospective after completion',
prompt: '*epic-retrospective',
},
{
name: 'correct-course',
agent: 'bmd-custom-bmm-sm',
shortcut: 'CC',
description: '[CC] Course correction when things go off track',
prompt: '*correct-course',
},
],
// BMad Game Development Module (bmgd)
bmgd: [
// Implementation cycle
{
name: 'game-implement',
agent: 'bmd-custom-bmgd-game-dev',
shortcut: 'GI',
description: '[GI] Implement game feature',
prompt: '*game-implement',
},
{
name: 'game-qa',
agent: 'bmd-custom-bmgd-game-qa',
shortcut: 'GQ',
description: '[GQ] Test and QA game feature',
prompt: '*game-qa',
},
// Planning & Design
{
name: 'game-design',
agent: 'bmd-custom-bmgd-game-designer',
shortcut: 'GD',
description: '[GD] Design game mechanics and systems',
prompt: '*game-design',
},
{
name: 'game-architecture',
agent: 'bmd-custom-bmgd-game-architect',
shortcut: 'GA',
description: '[GA] Create game technical architecture',
prompt: '*game-architecture',
},
{
name: 'game-sprint',
agent: 'bmd-custom-bmgd-game-scrum-master',
shortcut: 'GS',
description: '[GS] Plan game development sprint',
prompt: '*game-sprint',
},
],
// Core agents (always available)
core: [
{
name: 'list-tasks',
agent: 'bmd-custom-core-bmad-master',
shortcut: 'LT',
description: '[LT] List available tasks',
prompt: '*list-tasks',
},
{
name: 'list-workflows',
agent: 'bmd-custom-core-bmad-master',
shortcut: 'LW',
description: '[LW] List available workflows',
prompt: '*list-workflows',
},
],
};
module.exports = { workflowPromptsConfig };