From 44ba15f9a1bff9ac5419a7247f4234d2cf877d22 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sat, 7 Mar 2026 18:51:05 -0700 Subject: [PATCH 01/12] feat: add skill manifest for advanced-elicitation workflow (#1840) * feat: add skill manifest for advanced-elicitation workflow Register advanced-elicitation as an invocable skill so it can be triggered as a standalone slash command, matching the pattern used by party-mode and brainstorming. Co-Authored-By: Claude Opus 4.6 * refactor: convert advanced-elicitation from XML to markdown workflow The installer only discovers workflow.yaml and workflow.md files, so workflow.xml was never registered. Convert to workflow.md with YAML frontmatter while preserving all elicitation logic verbatim. Co-Authored-By: Claude Opus 4.6 * fix: update all references from workflow.xml to workflow.md Update 67 references across 50 files to point to the new markdown workflow. Also fix incorrect methods.csv filename and bare advanced-elicitation.xml reference in generate-project-context. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 Co-authored-by: Brian --- .../steps/step-02-vision.md | 2 +- .../steps/step-03-users.md | 2 +- .../steps/step-04-metrics.md | 2 +- .../steps/step-05-scope.md | 2 +- .../create-prd/steps-c/step-02-discovery.md | 2 +- .../create-prd/steps-c/step-02b-vision.md | 2 +- .../steps-c/step-02c-executive-summary.md | 2 +- .../create-prd/steps-c/step-03-success.md | 2 +- .../create-prd/steps-c/step-04-journeys.md | 2 +- .../create-prd/steps-c/step-05-domain.md | 2 +- .../create-prd/steps-c/step-06-innovation.md | 2 +- .../steps-c/step-07-project-type.md | 2 +- .../create-prd/steps-c/step-08-scoping.md | 2 +- .../create-prd/steps-c/step-09-functional.md | 2 +- .../steps-c/step-10-nonfunctional.md | 2 +- .../create-prd/steps-c/step-11-polish.md | 2 +- .../create-prd/steps-e/step-e-01-discovery.md | 2 +- .../create-prd/steps-e/step-e-02-review.md | 2 +- .../create-prd/steps-v/step-v-01-discovery.md | 2 +- .../steps-v/step-v-10-smart-validation.md | 2 +- .../step-v-11-holistic-quality-validation.md | 2 +- .../steps/step-02-discovery.md | 2 +- .../steps/step-03-core-experience.md | 4 +- .../steps/step-04-emotional-response.md | 4 +- .../steps/step-05-inspiration.md | 4 +- .../steps/step-06-design-system.md | 4 +- .../steps/step-07-defining-experience.md | 4 +- .../steps/step-08-visual-foundation.md | 4 +- .../steps/step-09-design-directions.md | 4 +- .../steps/step-10-user-journeys.md | 4 +- .../steps/step-11-component-strategy.md | 4 +- .../steps/step-12-ux-patterns.md | 4 +- .../steps/step-13-responsive-accessibility.md | 4 +- .../steps/step-02-context.md | 4 +- .../steps/step-03-starter.md | 4 +- .../steps/step-04-decisions.md | 4 +- .../steps/step-05-patterns.md | 4 +- .../steps/step-06-structure.md | 4 +- .../steps/step-07-validation.md | 4 +- .../steps/step-01-validate-prerequisites.md | 2 +- .../steps/step-02-design-epics.md | 2 +- .../steps/step-03-create-stories.md | 2 +- .../steps/step-04-final-validation.md | 2 +- .../quick-dev-new-preview/workflow.md | 2 +- .../bmad-quick-flow/quick-dev/workflow.md | 2 +- .../bmad-quick-flow/quick-spec/workflow.md | 2 +- .../steps/step-02-generate.md | 4 +- src/core/tasks/workflow.xml | 2 +- .../bmad-skill-manifest.yaml | 3 + .../advanced-elicitation/workflow.md | 138 ++++++++++++++++++ .../advanced-elicitation/workflow.xml | 118 --------------- .../steps/step-03-technique-execution.md | 2 +- src/core/workflows/brainstorming/workflow.md | 2 +- 53 files changed, 209 insertions(+), 186 deletions(-) create mode 100644 src/core/workflows/advanced-elicitation/bmad-skill-manifest.yaml create mode 100644 src/core/workflows/advanced-elicitation/workflow.md delete mode 100644 src/core/workflows/advanced-elicitation/workflow.xml diff --git a/src/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md b/src/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md index fbbdffd01..82dc7e190 100644 --- a/src/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md +++ b/src/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/1-analysis/create-product-brie outputFile: '{planning_artifacts}/product-brief-{{project_name}}-{{date}}.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md b/src/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md index eb8fd1168..773fbdcd0 100644 --- a/src/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md +++ b/src/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/1-analysis/create-product-brie outputFile: '{planning_artifacts}/product-brief-{{project_name}}-{{date}}.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md b/src/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md index 04c67edc4..b60be4bc8 100644 --- a/src/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md +++ b/src/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/1-analysis/create-product-brie outputFile: '{planning_artifacts}/product-brief-{{project_name}}-{{date}}.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md b/src/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md index 04339f41f..111a0c1f8 100644 --- a/src/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md +++ b/src/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/1-analysis/create-product-brie outputFile: '{planning_artifacts}/product-brief-{{project_name}}-{{date}}.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02-discovery.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02-discovery.md index 7d337b47d..639302567 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02-discovery.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02-discovery.md @@ -11,7 +11,7 @@ projectTypesCSV: '../data/project-types.csv' domainComplexityCSV: '../data/domain-complexity.csv' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02b-vision.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02b-vision.md index 9b7b2a975..b8048932c 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02b-vision.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02b-vision.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/st outputFile: '{planning_artifacts}/prd.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02c-executive-summary.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02c-executive-summary.md index 3f024decd..0e4d4ff68 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02c-executive-summary.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-02c-executive-summary.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/st outputFile: '{planning_artifacts}/prd.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-03-success.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-03-success.md index 79722289a..2190f8dae 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-03-success.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-03-success.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/st outputFile: '{planning_artifacts}/prd.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-04-journeys.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-04-journeys.md index fc919ff07..6c6a22bbe 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-04-journeys.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-04-journeys.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/st outputFile: '{planning_artifacts}/prd.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-05-domain.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-05-domain.md index bb95ea16f..5ad1c88ac 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-05-domain.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-05-domain.md @@ -8,7 +8,7 @@ outputFile: '{planning_artifacts}/prd.md' domainComplexityCSV: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/domain-complexity.csv' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-06-innovation.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-06-innovation.md index 708eac7b1..38a804d65 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-06-innovation.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-06-innovation.md @@ -10,7 +10,7 @@ outputFile: '{planning_artifacts}/prd.md' projectTypesCSV: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/project-types.csv' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-07-project-type.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-07-project-type.md index 63c9070b6..891db0f43 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-07-project-type.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-07-project-type.md @@ -10,7 +10,7 @@ outputFile: '{planning_artifacts}/prd.md' projectTypesCSV: '../data/project-types.csv' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-08-scoping.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-08-scoping.md index e9df0caba..fa620d991 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-08-scoping.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-08-scoping.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/st outputFile: '{planning_artifacts}/prd.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-09-functional.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-09-functional.md index a39150c0c..be22355e2 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-09-functional.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-09-functional.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/st outputFile: '{planning_artifacts}/prd.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-10-nonfunctional.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-10-nonfunctional.md index d42323046..3dcf3aa25 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-10-nonfunctional.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-10-nonfunctional.md @@ -7,7 +7,7 @@ nextStepFile: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/st outputFile: '{planning_artifacts}/prd.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-11-polish.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-11-polish.md index 257afbc27..d6df4caea 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-11-polish.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-c/step-11-polish.md @@ -8,7 +8,7 @@ outputFile: '{planning_artifacts}/prd.md' purposeFile: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/prd-purpose.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-01-discovery.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-01-discovery.md index 8f47cd551..cfe2a0335 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-01-discovery.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-01-discovery.md @@ -5,7 +5,7 @@ description: 'Discovery & Understanding - Understand what user wants to edit and # File references (ONLY variables used in this step) altStepFile: './step-e-01b-legacy-conversion.md' prdPurpose: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/prd-purpose.md' -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-02-review.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-02-review.md index f34de79ff..1f7f9215e 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-02-review.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-e/step-e-02-review.md @@ -7,7 +7,7 @@ nextStepFile: './step-e-03-edit.md' prdFile: '{prd_file_path}' validationReport: '{validation_report_path}' # If provided prdPurpose: '{project-root}/_bmad/bmm/workflows/2-plan-workflows/create-prd/data/prd-purpose.md' -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' --- # Step E-2: Deep Review & Analysis diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md index 6c591c2dd..37d47f3e2 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md @@ -4,7 +4,7 @@ description: 'Document Discovery & Confirmation - Handle fresh context validatio # File references (ONLY variables used in this step) nextStepFile: './step-v-02-format-detection.md' -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' prdPurpose: '../data/prd-purpose.md' --- diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md index e937c7526..1a135dcf0 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-10-smart-validation.md @@ -6,7 +6,7 @@ description: 'SMART Requirements Validation - Validate Functional Requirements m nextStepFile: './step-v-11-holistic-quality-validation.md' prdFile: '{prd_file_path}' validationReportPath: '{validation_report_path}' -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' --- # Step 10: SMART Requirements Validation diff --git a/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md b/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md index 698b6f654..581bf15f5 100644 --- a/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md +++ b/src/bmm/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md @@ -6,7 +6,7 @@ description: 'Holistic Quality Assessment - Assess PRD as cohesive, compelling d nextStepFile: './step-v-12-completeness-validation.md' prdFile: '{prd_file_path}' validationReportPath: '{validation_report_path}' -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' --- # Step 11: Holistic Quality Assessment diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md index 41821e326..29ff47265 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md index 9dc98e70f..af370a165 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -161,7 +161,7 @@ Show the generated core experience content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current core experience content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current core experience content - Process the enhanced experience insights that come back - Ask user: "Accept these improvements to the core experience definition? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md index f25bf0528..660f7cb09 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -164,7 +164,7 @@ Show the generated emotional response content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current emotional response content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current emotional response content - Process the enhanced emotional insights that come back - Ask user: "Accept these improvements to the emotional response definition? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md index 890048b74..554360778 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -179,7 +179,7 @@ Show the generated inspiration analysis content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current inspiration analysis content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current inspiration analysis content - Process the enhanced pattern insights that come back - Ask user: "Accept these improvements to the inspiration analysis? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md index 26caf73db..e21c514bc 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -197,7 +197,7 @@ Show the generated design system content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current design system content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current design system content - Process the enhanced design system insights that come back - Ask user: "Accept these improvements to the design system decision? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md index 8cd5ff3b8..d6ebd29ce 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -199,7 +199,7 @@ Show the generated defining experience content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current defining experience content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current defining experience content - Process the enhanced experience insights that come back - Ask user: "Accept these improvements to the defining experience? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md index 430aab043..ad728c551 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -169,7 +169,7 @@ Show the generated visual foundation content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current visual foundation content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current visual foundation content - Process the enhanced visual insights that come back - Ask user: "Accept these improvements to the visual foundation? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md index 09864e0b4..ce0daefde 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -169,7 +169,7 @@ Show the generated design direction content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current design direction content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current design direction content - Process the enhanced design insights that come back - Ask user: "Accept these improvements to the design direction? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md index 9f05201fe..f0e0a59d9 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -187,7 +187,7 @@ Show the generated user journey content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current user journey content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current user journey content - Process the enhanced journey insights that come back - Ask user: "Accept these improvements to the user journeys? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md index 95f2f294a..5dd50ac77 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -193,7 +193,7 @@ Show the generated component strategy content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current component strategy content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current component strategy content - Process the enhanced component insights that come back - Ask user: "Accept these improvements to the component strategy? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md index 08f272a62..6a7b416bb 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -182,7 +182,7 @@ Show the generated UX patterns content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current UX patterns content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current UX patterns content - Process the enhanced pattern insights that come back - Ask user: "Accept these improvements to the UX patterns? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md index d13ffa5c4..f73558325 100644 --- a/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md +++ b/src/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md @@ -30,7 +30,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to this step's A/P/C menu - User accepts/rejects protocol changes before proceeding @@ -209,7 +209,7 @@ Show the generated responsive and accessibility content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current responsive/accessibility content +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current responsive/accessibility content - Process the enhanced insights that come back - Ask user: "Accept these improvements to the responsive/accessibility strategy? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md index d4c908711..7682abe3b 100644 --- a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md +++ b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md @@ -31,7 +31,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed - User accepts/rejects protocol changes before proceeding @@ -170,7 +170,7 @@ Show the generated content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current context analysis +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with the current context analysis - Process the enhanced architectural insights that come back - Ask user: "Accept these enhancements to the project context analysis? (y/n)" - If yes: Update content with improvements, then return to A/P/C menu diff --git a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md index 45dc74c55..5c4e796f9 100644 --- a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md +++ b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md @@ -31,7 +31,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed - User accepts/rejects protocol changes before proceeding @@ -276,7 +276,7 @@ Show the generated content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with current starter analysis +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with current starter analysis - Process enhanced insights about starter options or custom approaches - Ask user: "Accept these changes to the starter template evaluation? (y/n)" - If yes: Update content, then return to A/P/C menu diff --git a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md index 2fe2d3469..4e1944d10 100644 --- a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md +++ b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md @@ -32,7 +32,7 @@ This step will generate content and present choices for each decision category: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed - User accepts/rejects protocol changes before proceeding @@ -264,7 +264,7 @@ Show the generated decisions content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with specific decision categories +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with specific decision categories - Process enhanced insights about particular decisions - Ask user: "Accept these enhancements to the architectural decisions? (y/n)" - If yes: Update content, then return to A/P/C menu diff --git a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md index cb0641afb..0e3c0334b 100644 --- a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md +++ b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md @@ -32,7 +32,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed - User accepts/rejects protocol changes before proceeding @@ -305,7 +305,7 @@ Show the generated patterns content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with current patterns +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with current patterns - Process enhanced consistency rules that come back - Ask user: "Accept these additional pattern refinements? (y/n)" - If yes: Update content, then return to A/P/C menu diff --git a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md index 7a2019a9f..f98cea981 100644 --- a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md +++ b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md @@ -32,7 +32,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed - User accepts/rejects protocol changes before proceeding @@ -325,7 +325,7 @@ Show the generated project structure content and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with current project structure +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with current project structure - Process enhanced organizational insights that come back - Ask user: "Accept these changes to the project structure? (y/n)" - If yes: Update content, then return to A/P/C menu diff --git a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md index 580a957fe..d98bf974c 100644 --- a/src/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md +++ b/src/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md @@ -32,7 +32,7 @@ This step will generate content and present choices: ## PROTOCOL INTEGRATION: -- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed - User accepts/rejects protocol changes before proceeding @@ -305,7 +305,7 @@ Show the validation results and present choices: #### If 'A' (Advanced Elicitation): -- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with validation issues +- Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with validation issues - Process enhanced solutions for complex concerns - Ask user: "Accept these architectural improvements? (y/n)" - If yes: Update content, then return to A/P/C menu diff --git a/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md b/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md index c8d6b1330..5d2b0add9 100644 --- a/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md +++ b/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md @@ -13,7 +13,7 @@ outputFile: '{planning_artifacts}/epics.md' epicsTemplate: '{workflow_path}/templates/epics-template.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' # Template References diff --git a/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md b/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md index 1b497c2ad..46ca5e47a 100644 --- a/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md +++ b/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md @@ -12,7 +12,7 @@ workflowFile: '{workflow_path}/workflow.md' outputFile: '{planning_artifacts}/epics.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' # Template References diff --git a/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md b/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md index 2e13f9b2c..07e666e03 100644 --- a/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md +++ b/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md @@ -12,7 +12,7 @@ workflowFile: '{workflow_path}/workflow.md' outputFile: '{planning_artifacts}/epics.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' # Template References diff --git a/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md b/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md index 4ee791a7a..adc3f497c 100644 --- a/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md +++ b/src/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md @@ -11,7 +11,7 @@ workflowFile: '{workflow_path}/workflow.md' outputFile: '{planning_artifacts}/epics.md' # Task References -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' partyModeWorkflow: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' # Template References diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/workflow.md b/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/workflow.md index e0eb0a21e..08733ea47 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/workflow.md +++ b/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/workflow.md @@ -4,7 +4,7 @@ description: 'Unified quick flow - clarify intent, plan, implement, review, pres main_config: '{project-root}/_bmad/bmm/config.yaml' # Related workflows -advanced_elicitation: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advanced_elicitation: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' party_mode_exec: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' # Review building block diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md b/src/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md index 29349a5d8..ee8fcaf41 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md +++ b/src/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md @@ -41,7 +41,7 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: - `quick_spec_workflow` = `{project-root}/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md` - `party_mode_exec` = `{project-root}/_bmad/core/workflows/party-mode/workflow.md` -- `advanced_elicitation` = `{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml` +- `advanced_elicitation` = `{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md` --- diff --git a/src/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md b/src/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md index 462f41741..a0acd7707 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md +++ b/src/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md @@ -4,7 +4,7 @@ description: 'Very quick process to create implementation-ready quick specs for main_config: '{project-root}/_bmad/bmm/config.yaml' # Checkpoint handler paths -advanced_elicitation: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advanced_elicitation: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' party_mode_exec: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' quick_dev_workflow: '{project-root}/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md' --- diff --git a/src/bmm/workflows/generate-project-context/steps/step-02-generate.md b/src/bmm/workflows/generate-project-context/steps/step-02-generate.md index dcb2f0097..e51078422 100644 --- a/src/bmm/workflows/generate-project-context/steps/step-02-generate.md +++ b/src/bmm/workflows/generate-project-context/steps/step-02-generate.md @@ -29,7 +29,7 @@ This step will generate content and present choices for each rule category: ## PROTOCOL INTEGRATION: -- When 'A' selected: Execute {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml +- When 'A' selected: Execute {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - When 'P' selected: Execute {project-root}/_bmad/core/workflows/party-mode - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed - User accepts/rejects protocol changes before proceeding @@ -267,7 +267,7 @@ After each category, show the generated rules and present choices: #### If 'A' (Advanced Elicitation): -- Execute advanced-elicitation.xml with current category rules +- Execute {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md with current category rules - Process enhanced rules that come back - Ask user: "Accept these enhanced rules for {{category}}? (y/n)" - If yes: Update content, then return to A/P/C menu diff --git a/src/core/tasks/workflow.xml b/src/core/tasks/workflow.xml index 536c9d8e7..351872ac8 100644 --- a/src/core/tasks/workflow.xml +++ b/src/core/tasks/workflow.xml @@ -74,7 +74,7 @@ Display generated content [a] Advanced Elicitation, [c] Continue, [p] Party-Mode, [y] YOLO the rest of this document only. WAIT for response. - Start the advanced elicitation workflow {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml + Start the advanced elicitation workflow {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md diff --git a/src/core/workflows/advanced-elicitation/bmad-skill-manifest.yaml b/src/core/workflows/advanced-elicitation/bmad-skill-manifest.yaml new file mode 100644 index 000000000..81feebd87 --- /dev/null +++ b/src/core/workflows/advanced-elicitation/bmad-skill-manifest.yaml @@ -0,0 +1,3 @@ +canonicalId: bmad-advanced-elicitation +type: workflow +description: "Push the LLM to reconsider, refine, and improve its recent output using structured reasoning methods" diff --git a/src/core/workflows/advanced-elicitation/workflow.md b/src/core/workflows/advanced-elicitation/workflow.md new file mode 100644 index 000000000..1efddf0e3 --- /dev/null +++ b/src/core/workflows/advanced-elicitation/workflow.md @@ -0,0 +1,138 @@ +--- +name: advanced-elicitation +description: 'Push the LLM to reconsider refine and improve its recent output. Use when the user asks for advanced elicitation.' +methods: '{project-root}/_bmad/core/workflows/advanced-elicitation/methods.csv' +agent_party: '{project-root}/_bmad/_config/agent-manifest.csv' +--- + +# Advanced Elicitation Workflow + +**Goal:** Push the LLM to reconsider, refine, and improve its recent output. Use when the user asks for advanced elicitation. + +--- + +## CRITICAL LLM INSTRUCTIONS + +- **MANDATORY:** Execute ALL steps in the flow section IN EXACT ORDER +- DO NOT skip steps or change the sequence +- HALT immediately when halt-conditions are met +- Each action within a step is a REQUIRED action to complete that step +- Sections outside flow (validation, output, critical-context) provide essential context - review and apply throughout execution +- **YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the `communication_language`** + +--- + +## INTEGRATION (When Called from Workflow) + +When called during template workflow processing: + +1. Receive or review the current section content that was just generated +2. Apply elicitation methods iteratively to enhance that specific content +3. Return the enhanced version back when user selects 'x' to proceed and return back +4. The enhanced content replaces the original section content in the output document + +--- + +## FLOW + +### Step 1: Method Registry Loading + +**Action:** Load and read `{methods}` and `{agent_party}` + +#### CSV Structure + +- **category:** Method grouping (core, structural, risk, etc.) +- **method_name:** Display name for the method +- **description:** Rich explanation of what the method does, when to use it, and why it's valuable +- **output_pattern:** Flexible flow guide using arrows (e.g., "analysis -> insights -> action") + +#### Context Analysis + +- Use conversation history +- Analyze: content type, complexity, stakeholder needs, risk level, and creative potential + +#### Smart Selection + +1. Analyze context: Content type, complexity, stakeholder needs, risk level, creative potential +2. Parse descriptions: Understand each method's purpose from the rich descriptions in CSV +3. Select 5 methods: Choose methods that best match the context based on their descriptions +4. Balance approach: Include mix of foundational and specialized techniques as appropriate + +--- + +### Step 2: Present Options and Handle Responses + +#### Display Format + +``` +**Advanced Elicitation Options** +_If party mode is active, agents will join in._ +Choose a number (1-5), [r] to Reshuffle, [a] List All, or [x] to Proceed: + +1. [Method Name] +2. [Method Name] +3. [Method Name] +4. [Method Name] +5. [Method Name] +r. Reshuffle the list with 5 new options +a. List all methods with descriptions +x. Proceed / No Further Actions +``` + +#### Response Handling + +**Case 1-5 (User selects a numbered method):** + +- Execute the selected method using its description from the CSV +- Adapt the method's complexity and output format based on the current context +- Apply the method creatively to the current section content being enhanced +- Display the enhanced version showing what the method revealed or improved +- **CRITICAL:** Ask the user if they would like to apply the changes to the doc (y/n/other) and HALT to await response. +- **CRITICAL:** ONLY if Yes, apply the changes. IF No, discard your memory of the proposed changes. If any other reply, try best to follow the instructions given by the user. +- **CRITICAL:** Re-present the same 1-5,r,x prompt to allow additional elicitations + +**Case r (Reshuffle):** + +- Select 5 random methods from methods.csv, present new list with same prompt format +- When selecting, try to think and pick a diverse set of methods covering different categories and approaches, with 1 and 2 being potentially the most useful for the document or section being discovered + +**Case x (Proceed):** + +- Complete elicitation and proceed +- Return the fully enhanced content back to create-doc.md +- The enhanced content becomes the final version for that section +- Signal completion back to create-doc.md to continue with next section + +**Case a (List All):** + +- List all methods with their descriptions from the CSV in a compact table +- Allow user to select any method by name or number from the full list +- After selection, execute the method as described in the Case 1-5 above + +**Case: Direct Feedback:** + +- Apply changes to current section content and re-present choices + +**Case: Multiple Numbers:** + +- Execute methods in sequence on the content, then re-offer choices + +--- + +### Step 3: Execution Guidelines + +- **Method execution:** Use the description from CSV to understand and apply each method +- **Output pattern:** Use the pattern as a flexible guide (e.g., "paths -> evaluation -> selection") +- **Dynamic adaptation:** Adjust complexity based on content needs (simple to sophisticated) +- **Creative application:** Interpret methods flexibly based on context while maintaining pattern consistency +- Focus on actionable insights +- **Stay relevant:** Tie elicitation to specific content being analyzed (the current section from the document being created unless user indicates otherwise) +- **Identify personas:** For single or multi-persona methods, clearly identify viewpoints, and use party members if available in memory already +- **Critical loop behavior:** Always re-offer the 1-5,r,a,x choices after each method execution +- Continue until user selects 'x' to proceed with enhanced content, confirm or ask the user what should be accepted from the session +- Each method application builds upon previous enhancements +- **Content preservation:** Track all enhancements made during elicitation +- **Iterative enhancement:** Each selected method (1-5) should: + 1. Apply to the current enhanced version of the content + 2. Show the improvements made + 3. Return to the prompt for additional elicitations or completion diff --git a/src/core/workflows/advanced-elicitation/workflow.xml b/src/core/workflows/advanced-elicitation/workflow.xml deleted file mode 100644 index 56e9f18ca..000000000 --- a/src/core/workflows/advanced-elicitation/workflow.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - MANDATORY: Execute ALL steps in the flow section IN EXACT ORDER - DO NOT skip steps or change the sequence - HALT immediately when halt-conditions are met - Each action xml tag within step xml tag is a REQUIRED action to complete that step - Sections outside flow (validation, output, critical-context) provide essential context - review and apply throughout execution - YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the `communication_language` - - - - When called during template workflow processing: - 1. Receive or review the current section content that was just generated or - 2. Apply elicitation methods iteratively to enhance that specific content - 3. Return the enhanced version back when user selects 'x' to proceed and return back - 4. The enhanced content replaces the original section content in the output document - - - - - Load and read {{methods}} and {{agent-party}} - - - category: Method grouping (core, structural, risk, etc.) - method_name: Display name for the method - description: Rich explanation of what the method does, when to use it, and why it's valuable - output_pattern: Flexible flow guide using → arrows (e.g., "analysis → insights → action") - - - - Use conversation history - Analyze: content type, complexity, stakeholder needs, risk level, and creative potential - - - - 1. Analyze context: Content type, complexity, stakeholder needs, risk level, creative potential - 2. Parse descriptions: Understand each method's purpose from the rich descriptions in CSV - 3. Select 5 methods: Choose methods that best match the context based on their descriptions - 4. Balance approach: Include mix of foundational and specialized techniques as appropriate - - - - - - - **Advanced Elicitation Options (If you launched Party Mode, they will participate randomly)** - Choose a number (1-5), [r] to Reshuffle, [a] List All, or [x] to Proceed: - - 1. [Method Name] - 2. [Method Name] - 3. [Method Name] - 4. [Method Name] - 5. [Method Name] - r. Reshuffle the list with 5 new options - a. List all methods with descriptions - x. Proceed / No Further Actions - - - - - Execute the selected method using its description from the CSV - Adapt the method's complexity and output format based on the current context - Apply the method creatively to the current section content being enhanced - Display the enhanced version showing what the method revealed or improved - CRITICAL: Ask the user if they would like to apply the changes to the doc (y/n/other) and HALT to await response. - CRITICAL: ONLY if Yes, apply the changes. IF No, discard your memory of the proposed changes. If any other reply, try best to - follow the instructions given by the user. - CRITICAL: Re-present the same 1-5,r,x prompt to allow additional elicitations - - - Select 5 random methods from advanced-elicitation-methods.csv, present new list with same prompt format - When selecting, try to think and pick a diverse set of methods covering different categories and approaches, with 1 and 2 being - potentially the most useful for the document or section being discovered - - - Complete elicitation and proceed - Return the fully enhanced content back to create-doc.md - The enhanced content becomes the final version for that section - Signal completion back to create-doc.md to continue with next section - - - List all methods with their descriptions from the CSV in a compact table - Allow user to select any method by name or number from the full list - After selection, execute the method as described in the n="1-5" case above - - - Apply changes to current section content and re-present choices - - - Execute methods in sequence on the content, then re-offer choices - - - - - - Method execution: Use the description from CSV to understand and apply each method - Output pattern: Use the pattern as a flexible guide (e.g., "paths → evaluation → selection") - Dynamic adaptation: Adjust complexity based on content needs (simple to sophisticated) - Creative application: Interpret methods flexibly based on context while maintaining pattern consistency - Focus on actionable insights - Stay relevant: Tie elicitation to specific content being analyzed (the current section from the document being created unless user - indicates otherwise) - Identify personas: For single or multi-persona methods, clearly identify viewpoints, and use party members if available in memory - already - Critical loop behavior: Always re-offer the 1-5,r,a,x choices after each method execution - Continue until user selects 'x' to proceed with enhanced content, confirm or ask the user what should be accepted from the session - Each method application builds upon previous enhancements - Content preservation: Track all enhancements made during elicitation - Iterative enhancement: Each selected method (1-5) should: - 1. Apply to the current enhanced version of the content - 2. Show the improvements made - 3. Return to the prompt for additional elicitations or completion - - - \ No newline at end of file diff --git a/src/core/workflows/brainstorming/steps/step-03-technique-execution.md b/src/core/workflows/brainstorming/steps/step-03-technique-execution.md index 59388e1aa..34e2d9c72 100644 --- a/src/core/workflows/brainstorming/steps/step-03-technique-execution.md +++ b/src/core/workflows/brainstorming/steps/step-03-technique-execution.md @@ -1,7 +1,7 @@ # Step 3: Interactive Technique Execution and Facilitation --- -advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml' +advancedElicitationTask: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' --- ## MANDATORY EXECUTION RULES (READ FIRST): diff --git a/src/core/workflows/brainstorming/workflow.md b/src/core/workflows/brainstorming/workflow.md index 81bc1b2a1..3a05e93f9 100644 --- a/src/core/workflows/brainstorming/workflow.md +++ b/src/core/workflows/brainstorming/workflow.md @@ -49,7 +49,7 @@ Load config from `{project-root}/_bmad/core/config.yaml` and resolve: All steps MUST reference `{brainstorming_session_output_file}` instead of the full path pattern. - `context_file` = Optional context file path from workflow invocation for project-specific guidance -- `advancedElicitationTask` = `{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml` +- `advancedElicitationTask` = `{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md` --- From 8e5898e8626f40264c61dce7efadb0fe88c6ea16 Mon Sep 17 00:00:00 2001 From: Gani Mohamed Parakadhullah Date: Sun, 8 Mar 2026 14:51:26 +0800 Subject: [PATCH 02/12] feat: add pi coding agent as supported platform (#1854) * feat: add pi coding agent as supported platform Add pi (provider-agnostic terminal-native AI coding agent) to platform-codes.yaml with native skills format output to .pi/skills/. Pi follows the open Agent Skills specification and uses the same subdirectory/SKILL.md structure that BMAD already generates for other platforms. Fixes #1853 * fix: address PR review comments for Pi test suite - Assert template_type === 'default' to pin config contract - Verify Pi appears in getAvailableIdes() list - Test detect() returns false before install, true after - Parse frontmatter between --- delimiters instead of regex on full file - Assert description is present and non-empty - Assert frontmatter contains only name and description keys - Validate body content is non-empty with expected activation instructions - Add reinstall/upgrade coverage (rerun setup over existing output) - Move temp directory cleanup to finally block --- test/test-installation-components.js | 90 +++++++++++++++++++ .../installers/lib/ide/platform-codes.yaml | 10 +++ 2 files changed, 100 insertions(+) diff --git a/test/test-installation-components.js b/test/test-installation-components.js index 56f37b365..2eff6e5ee 100644 --- a/test/test-installation-components.js +++ b/test/test-installation-components.js @@ -1500,6 +1500,96 @@ async function runTests() { console.log(''); + // ============================================================ + // Suite 28: Pi Native Skills + // ============================================================ + console.log(`${colors.yellow}Test Suite 28: Pi Native Skills${colors.reset}\n`); + + let tempProjectDir28; + let installedBmadDir28; + try { + clearCache(); + const platformCodes28 = await loadPlatformCodes(); + const piInstaller = platformCodes28.platforms.pi?.installer; + + assert(piInstaller?.target_dir === '.pi/skills', 'Pi target_dir uses native skills path'); + assert(piInstaller?.skill_format === true, 'Pi installer enables native skill output'); + assert(piInstaller?.template_type === 'default', 'Pi installer uses default skill template'); + + tempProjectDir28 = await fs.mkdtemp(path.join(os.tmpdir(), 'bmad-pi-test-')); + installedBmadDir28 = await createTestBmadFixture(); + + const ideManager28 = new IdeManager(); + await ideManager28.ensureInitialized(); + + // Verify Pi is selectable in available IDEs list + const availableIdes28 = ideManager28.getAvailableIdes(); + assert( + availableIdes28.some((ide) => ide.value === 'pi'), + 'Pi appears in available IDEs list', + ); + + // Verify Pi is NOT detected before install + const detectedBefore28 = await ideManager28.detectInstalledIdes(tempProjectDir28); + assert(!detectedBefore28.includes('pi'), 'Pi is not detected before install'); + + const result28 = await ideManager28.setup('pi', tempProjectDir28, installedBmadDir28, { + silent: true, + selectedModules: ['bmm'], + }); + + assert(result28.success === true, 'Pi setup succeeds against temp project'); + + // Verify Pi IS detected after install + const detectedAfter28 = await ideManager28.detectInstalledIdes(tempProjectDir28); + assert(detectedAfter28.includes('pi'), 'Pi is detected after install'); + + const skillFile28 = path.join(tempProjectDir28, '.pi', 'skills', 'bmad-master', 'SKILL.md'); + assert(await fs.pathExists(skillFile28), 'Pi install writes SKILL.md directory output'); + + // Parse YAML frontmatter between --- markers + const skillContent28 = await fs.readFile(skillFile28, 'utf8'); + const fmMatch28 = skillContent28.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/); + assert(fmMatch28, 'Pi SKILL.md contains valid frontmatter delimiters'); + + const frontmatter28 = fmMatch28[1]; + const body28 = fmMatch28[2]; + + // Verify name in frontmatter matches directory name + const fmName28 = frontmatter28.match(/^name:\s*(.+)$/m); + assert(fmName28 && fmName28[1].trim() === 'bmad-master', 'Pi skill name frontmatter matches directory name exactly'); + + // Verify description exists and is non-empty + const fmDesc28 = frontmatter28.match(/^description:\s*(.+)$/m); + assert(fmDesc28 && fmDesc28[1].trim().length > 0, 'Pi skill description frontmatter is present and non-empty'); + + // Verify frontmatter contains only name and description keys + const fmKeys28 = [...frontmatter28.matchAll(/^([a-zA-Z0-9_-]+):/gm)].map((m) => m[1]); + assert( + fmKeys28.length === 2 && fmKeys28.includes('name') && fmKeys28.includes('description'), + 'Pi skill frontmatter contains only name and description keys', + ); + + // Verify body content is non-empty and contains expected activation instructions + assert(body28.trim().length > 0, 'Pi skill body content is non-empty'); + assert(body28.includes('agent-activation'), 'Pi skill body contains expected agent activation instructions'); + + // Reinstall/upgrade: run setup again over existing output + const result28b = await ideManager28.setup('pi', tempProjectDir28, installedBmadDir28, { + silent: true, + selectedModules: ['bmm'], + }); + assert(result28b.success === true, 'Pi reinstall/upgrade succeeds over existing skills'); + assert(await fs.pathExists(skillFile28), 'Pi reinstall preserves SKILL.md output'); + } catch (error) { + assert(false, 'Pi native skills test succeeds', error.message); + } finally { + if (tempProjectDir28) await fs.remove(tempProjectDir28).catch(() => {}); + if (installedBmadDir28) await fs.remove(installedBmadDir28).catch(() => {}); + } + + console.log(''); + // ============================================================ // Summary // ============================================================ diff --git a/tools/cli/installers/lib/ide/platform-codes.yaml b/tools/cli/installers/lib/ide/platform-codes.yaml index 82d45f562..9d5f171f1 100644 --- a/tools/cli/installers/lib/ide/platform-codes.yaml +++ b/tools/cli/installers/lib/ide/platform-codes.yaml @@ -192,6 +192,16 @@ platforms: skill_format: true ancestor_conflict_check: true + pi: + name: "Pi" + preferred: false + category: cli + description: "Provider-agnostic terminal-native AI coding agent" + installer: + target_dir: .pi/skills + template_type: default + skill_format: true + qwen: name: "QwenCoder" preferred: false From 7f1a55ca8c08621bfcc6c8b38fd319b6152967bf Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 01:23:26 -0700 Subject: [PATCH 03/12] feat(skills): add type:skill manifest for verbatim directory copying (#1851) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(skills): add type:skill manifest for verbatim skill directory copying Introduce `type: skill` in bmad-skill-manifest.yaml to signal the installer to copy entire skill directories verbatim into IDE skill directories, replacing the launcher-based approach. Changes: - skill-manifest.js: fix single-entry detection for type-only manifests, add getArtifactType export - manifest-generator.js: collect type:skill entries separately, write skill-manifest.csv, derive canonicalId from directory name - _config-driven.js: add installVerbatimSkills with YAML-safe SKILL.md generation, stale file cleanup, and warning on parse failures - Rename quick-dev-new-preview to bmad-quick-dev-new-preview so directory name is the canonical ID - Update workflow.md installed_path to reference IDE skill base directory Co-Authored-By: Claude Opus 4.6 * refactor: replace {installed_path} with relative paths in quick-dev skill Skills resolve paths relative to the skill root directory per the open agent standard, so the installed_path variable is unnecessary. Co-Authored-By: Claude Opus 4.6 * feat(skills): add install_to_bmad flag and skill: help catalog reference Add install_to_bmad flag to skill manifests (default true) enabling skills to opt out of _bmad/ copy while retaining .claude/skills/ installation. Support skill: references in module-help.csv workflow-file column. Fix stale quick-dev-new-preview directory references in agent YAML and help catalog. Co-Authored-By: Claude Opus 4.6 * test: add install_to_bmad design contract tests Unit tests against getInstallToBmad and loadSkillManifest that nail down the 4 core design decisions for the install_to_bmad flag. Co-Authored-By: Claude Opus 4.6 * fix: reset skills array between runs and allow skill-only targets - Reset this.skills and this.files in ManifestGenerator to prevent stale data when instance is reused across multiple manifest runs - Allow targets with empty artifact_types to still install verbatim skills by checking skill_format before short-circuiting Co-Authored-By: Claude Opus 4.6 * fix: resolve broken file references in quick-dev-new-preview workflow - Fix step-02-plan.md templateFile path (./tech-spec-template.md → ../tech-spec-template.md) - Teach validate-file-refs.js to skip skill: prefixed references in CSV Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- src/bmm/agents/quick-flow-solo-dev.agent.yaml | 4 +- src/bmm/module-help.csv | 2 +- .../bmad-skill-manifest.yaml | 1 + .../steps/step-01-clarify-and-route.md | 4 +- .../steps/step-02-plan.md | 4 +- .../steps/step-03-implement.md | 2 +- .../steps/step-04-review.md | 4 +- .../steps/step-05-present.md | 0 .../tech-spec-template.md | 0 .../workflow.md | 5 +- .../bmad-skill-manifest.yaml | 3 - src/core/tasks/help.md | 6 + test/test-install-to-bmad.js | 154 ++++++++++++++++++ .../installers/lib/core/manifest-generator.js | 68 +++++++- .../cli/installers/lib/ide/_config-driven.js | 148 ++++++++++++++--- .../lib/ide/shared/skill-manifest.js | 46 +++++- tools/validate-file-refs.js | 2 + 17 files changed, 410 insertions(+), 43 deletions(-) create mode 100644 src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/bmad-skill-manifest.yaml rename src/bmm/workflows/bmad-quick-flow/{quick-dev-new-preview => bmad-quick-dev-new-preview}/steps/step-01-clarify-and-route.md (94%) rename src/bmm/workflows/bmad-quick-flow/{quick-dev-new-preview => bmad-quick-dev-new-preview}/steps/step-02-plan.md (93%) rename src/bmm/workflows/bmad-quick-flow/{quick-dev-new-preview => bmad-quick-dev-new-preview}/steps/step-03-implement.md (94%) rename src/bmm/workflows/bmad-quick-flow/{quick-dev-new-preview => bmad-quick-dev-new-preview}/steps/step-04-review.md (95%) rename src/bmm/workflows/bmad-quick-flow/{quick-dev-new-preview => bmad-quick-dev-new-preview}/steps/step-05-present.md (100%) rename src/bmm/workflows/bmad-quick-flow/{quick-dev-new-preview => bmad-quick-dev-new-preview}/tech-spec-template.md (100%) rename src/bmm/workflows/bmad-quick-flow/{quick-dev-new-preview => bmad-quick-dev-new-preview}/workflow.md (93%) delete mode 100644 src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/bmad-skill-manifest.yaml create mode 100644 test/test-install-to-bmad.js diff --git a/src/bmm/agents/quick-flow-solo-dev.agent.yaml b/src/bmm/agents/quick-flow-solo-dev.agent.yaml index a999bb56d..553cc9d4d 100644 --- a/src/bmm/agents/quick-flow-solo-dev.agent.yaml +++ b/src/bmm/agents/quick-flow-solo-dev.agent.yaml @@ -27,8 +27,8 @@ agent: exec: "{project-root}/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md" description: "[QD] Quick-flow Develop: Implement a story tech spec end-to-end (Core of Quick Flow)" - - trigger: QQ or fuzzy match on quick-dev-new-preview - exec: "{project-root}/_bmad/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/workflow.md" + - trigger: QQ or fuzzy match on bmad-quick-dev-new-preview + exec: "{project-root}/_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md" description: "[QQ] Quick Dev New (Preview): Unified quick flow — clarify intent, plan, implement, review, present (experimental)" - trigger: CR or fuzzy match on code-review diff --git a/src/bmm/module-help.csv b/src/bmm/module-help.csv index b8378cf3c..98da248dc 100644 --- a/src/bmm/module-help.csv +++ b/src/bmm/module-help.csv @@ -3,7 +3,7 @@ bmm,anytime,Document Project,DP,,_bmad/bmm/workflows/document-project/workflow.y bmm,anytime,Generate Project Context,GPC,,_bmad/bmm/workflows/generate-project-context/workflow.md,bmad-bmm-generate-project-context,false,analyst,Create Mode,"Scan existing codebase to generate a lean LLM-optimized project-context.md containing critical implementation rules patterns and conventions for AI agents. Essential for brownfield projects and quick-flow.",output_folder,"project context", bmm,anytime,Quick Spec,QS,,_bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md,bmad-bmm-quick-spec,false,quick-flow-solo-dev,Create Mode,"Do not suggest for potentially very complex things unless requested or if the user complains that they do not want to follow the extensive planning of the bmad method. Quick one-off tasks small changes simple apps brownfield additions to well established patterns utilities without extensive planning",planning_artifacts,"tech spec", bmm,anytime,Quick Dev,QD,,_bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md,bmad-bmm-quick-dev,false,quick-flow-solo-dev,Create Mode,"Quick one-off tasks small changes simple apps utilities without extensive planning - Do not suggest for potentially very complex things unless requested or if the user complains that they do not want to follow the extensive planning of the bmad method, unless the user is already working through the implementation phase and just requests a 1 off things not already in the plan",,, -bmm,anytime,Quick Dev New Preview,QQ,,_bmad/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/workflow.md,bmad-bmm-quick-dev-new-preview,false,quick-flow-solo-dev,Create Mode,"Unified quick flow (experimental): clarify intent plan implement review and present in a single workflow",implementation_artifacts,"tech spec implementation", +bmm,anytime,Quick Dev New Preview,QQ,,skill:bmad-quick-dev-new-preview,bmad-bmm-quick-dev-new-preview,false,quick-flow-solo-dev,Create Mode,"Unified quick flow (experimental): clarify intent plan implement review and present in a single workflow",implementation_artifacts,"tech spec implementation", bmm,anytime,Correct Course,CC,,_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml,bmad-bmm-correct-course,false,sm,Create Mode,"Anytime: Navigate significant changes. May recommend start over update PRD redo architecture sprint planning or correct epics and stories",planning_artifacts,"change proposal", bmm,anytime,Write Document,WD,,_bmad/bmm/agents/tech-writer/tech-writer.agent.yaml,,false,tech-writer,,"Describe in detail what you want, and the agent will follow the documentation best practices defined in agent memory. Multi-turn conversation with subprocess for research/review.",project-knowledge,"document", bmm,anytime,Update Standards,US,,_bmad/bmm/agents/tech-writer/tech-writer.agent.yaml,,false,tech-writer,,"Update agent memory documentation-standards.md with your specific preferences if you discover missing document conventions.",_bmad/_memory/tech-writer-sidecar,"standards", diff --git a/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/bmad-skill-manifest.yaml b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/bmad-skill-manifest.yaml new file mode 100644 index 000000000..d0f08abdb --- /dev/null +++ b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/bmad-skill-manifest.yaml @@ -0,0 +1 @@ +type: skill diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-01-clarify-and-route.md b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-01-clarify-and-route.md similarity index 94% rename from src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-01-clarify-and-route.md rename to src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-01-clarify-and-route.md index 1d84cbf22..6f856a30f 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-01-clarify-and-route.md +++ b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-01-clarify-and-route.md @@ -48,5 +48,5 @@ spec_file: '' # set at runtime before leaving this step ## NEXT -- One-shot / ready-for-dev: Read fully and follow `{installed_path}/steps/step-03-implement.md` -- Plan-code-review: Read fully and follow `{installed_path}/steps/step-02-plan.md` +- One-shot / ready-for-dev: Read fully and follow `./steps/step-03-implement.md` +- Plan-code-review: Read fully and follow `./steps/step-02-plan.md` diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-02-plan.md b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-02-plan.md similarity index 93% rename from src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-02-plan.md rename to src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-02-plan.md index 4d102bc0a..87e5c86cb 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-02-plan.md +++ b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-02-plan.md @@ -2,7 +2,7 @@ name: 'step-02-plan' description: 'Investigate, generate spec, present for approval' -templateFile: '{installed_path}/tech-spec-template.md' +templateFile: '../tech-spec-template.md' wipFile: '{implementation_artifacts}/tech-spec-wip.md' deferred_work_file: '{implementation_artifacts}/deferred-work.md' --- @@ -36,4 +36,4 @@ Present summary. If token count exceeded 1600 and user chose [K], include the to ## NEXT -Read fully and follow `{installed_path}/steps/step-03-implement.md` +Read fully and follow `./steps/step-03-implement.md` diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-03-implement.md b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-03-implement.md similarity index 94% rename from src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-03-implement.md rename to src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-03-implement.md index c9aa55472..97d189272 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-03-implement.md +++ b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-03-implement.md @@ -32,4 +32,4 @@ Otherwise (`execution_mode = "plan-code-review"`): hand `{spec_file}` to a sub-a ## NEXT -Read fully and follow `{installed_path}/steps/step-04-review.md` +Read fully and follow `./steps/step-04-review.md` diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-04-review.md b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md similarity index 95% rename from src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-04-review.md rename to src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md index d9ebbc182..e13e7652c 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-04-review.md +++ b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md @@ -46,7 +46,7 @@ Do NOT `git add` anything — this is read-only inspection. - **reject** — noise. Drop silently. When unsure between defer and reject, prefer reject — only defer findings you are confident are real. 3. Process findings in cascading order. If intent_gap or bad_spec findings exist, they trigger a loopback — lower findings are moot since code will be re-derived. If neither exists, process patch and defer normally. Increment `{specLoopIteration}` on each loopback. If it exceeds 5, HALT and escalate to the human. On any loopback, re-evaluate routing — if scope has grown beyond one-shot, escalate `execution_mode` to plan-code-review. - **intent_gap** — Root cause is inside ``. Revert code changes. Loop back to the human to resolve, then re-run steps 2–4. - - **bad_spec** — Root cause is outside ``. Before reverting code: extract KEEP instructions for positive preservation (what worked well and must survive re-derivation). Revert code changes. Read the `## Spec Change Log` in `{spec_file}` and strictly respect all logged constraints when amending the non-frozen sections that contain the root cause. Append a new change-log entry recording: the triggering finding, what was amended, the known-bad state avoided, and the KEEP instructions. Read fully and follow `{installed_path}/steps/step-03-implement.md` to re-derive the code, then this step will run again. + - **bad_spec** — Root cause is outside ``. Before reverting code: extract KEEP instructions for positive preservation (what worked well and must survive re-derivation). Revert code changes. Read the `## Spec Change Log` in `{spec_file}` and strictly respect all logged constraints when amending the non-frozen sections that contain the root cause. Append a new change-log entry recording: the triggering finding, what was amended, the known-bad state avoided, and the KEEP instructions. Read fully and follow `./steps/step-03-implement.md` to re-derive the code, then this step will run again. - **patch** — Auto-fix. These are the only findings that survive loopbacks. - **defer** — Append to `{deferred_work_file}`. - **reject** — Drop silently. @@ -54,4 +54,4 @@ Do NOT `git add` anything — this is read-only inspection. ## NEXT -Read fully and follow `{installed_path}/steps/step-05-present.md` +Read fully and follow `./steps/step-05-present.md` diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-05-present.md b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-05-present.md similarity index 100% rename from src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/steps/step-05-present.md rename to src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-05-present.md diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/tech-spec-template.md b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/tech-spec-template.md similarity index 100% rename from src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/tech-spec-template.md rename to src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/tech-spec-template.md diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/workflow.md b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md similarity index 93% rename from src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/workflow.md rename to src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md index 08733ea47..eae636173 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/workflow.md +++ b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md @@ -81,10 +81,9 @@ YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config ` ### 2. Paths -- `installed_path` = `{project-root}/_bmad/bmm/workflows/bmad-quick-flow/quick-dev-new-preview` -- `templateFile` = `{installed_path}/tech-spec-template.md` +- `templateFile` = `./tech-spec-template.md` - `wipFile` = `{implementation_artifacts}/tech-spec-wip.md` ### 3. First Step Execution -Read fully and follow: `{installed_path}/steps/step-01-clarify-and-route.md` to begin the workflow. +Read fully and follow: `./steps/step-01-clarify-and-route.md` to begin the workflow. diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/bmad-skill-manifest.yaml b/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/bmad-skill-manifest.yaml deleted file mode 100644 index 913c63629..000000000 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev-new-preview/bmad-skill-manifest.yaml +++ /dev/null @@ -1,3 +0,0 @@ -canonicalId: bmad-quick-dev-new-preview -type: workflow -description: "Unified quick flow - clarify intent, plan, implement, review, present" diff --git a/src/core/tasks/help.md b/src/core/tasks/help.md index 54a23b5f1..88f4a4d55 100644 --- a/src/core/tasks/help.md +++ b/src/core/tasks/help.md @@ -21,6 +21,12 @@ description: 'Analyzes what is done and the users query and offers advice on wha When `command` field has a value: - Show the command prefixed with `/` (e.g., `/bmad-bmm-create-prd`) +### Skill-Referenced Workflows +When `workflow-file` starts with `skill:`: +- The value is a skill reference (e.g., `skill:bmad-quick-dev-new-preview`), NOT a file path +- Do NOT attempt to resolve or load it as a file path +- Display using the `command` column value prefixed with `/` (same as command-based workflows) + ### Agent-Based Workflows When `command` field is empty: - User loads agent first via `/agent-command` diff --git a/test/test-install-to-bmad.js b/test/test-install-to-bmad.js new file mode 100644 index 000000000..0367dbe93 --- /dev/null +++ b/test/test-install-to-bmad.js @@ -0,0 +1,154 @@ +/** + * install_to_bmad Flag — Design Contract Tests + * + * Unit tests against the functions that implement the install_to_bmad flag. + * These nail down the 4 core design decisions: + * + * 1. true/omitted → skill stays in _bmad/ (default behavior) + * 2. false → skill removed from _bmad/ after IDE install + * 3. No platform → no cleanup runs (cleanup lives in installVerbatimSkills) + * 4. Mixed flags → each skill evaluated independently + * + * Usage: node test/test-install-to-bmad.js + */ + +const path = require('node:path'); +const os = require('node:os'); +const fs = require('fs-extra'); +const { loadSkillManifest, getInstallToBmad } = require('../tools/cli/installers/lib/ide/shared/skill-manifest'); + +// ANSI colors +const colors = { + reset: '\u001B[0m', + green: '\u001B[32m', + red: '\u001B[31m', + yellow: '\u001B[33m', + cyan: '\u001B[36m', + dim: '\u001B[2m', +}; + +let passed = 0; +let failed = 0; + +function assert(condition, testName, errorMessage = '') { + if (condition) { + console.log(`${colors.green}✓${colors.reset} ${testName}`); + passed++; + } else { + console.log(`${colors.red}✗${colors.reset} ${testName}`); + if (errorMessage) { + console.log(` ${colors.dim}${errorMessage}${colors.reset}`); + } + failed++; + } +} + +async function runTests() { + console.log(`${colors.cyan}========================================`); + console.log('install_to_bmad — Design Contract Tests'); + console.log(`========================================${colors.reset}\n`); + + // ============================================================ + // 1. true/omitted → getInstallToBmad returns true (keep in _bmad/) + // ============================================================ + console.log(`${colors.yellow}Design decision 1: true or omitted → skill stays in _bmad/${colors.reset}\n`); + + // Null manifest (no bmad-skill-manifest.yaml) → true + assert(getInstallToBmad(null, 'workflow.md') === true, 'null manifest defaults to true'); + + // Single-entry, flag omitted → true + assert( + getInstallToBmad({ __single: { type: 'skill' } }, 'workflow.md') === true, + 'single-entry manifest with flag omitted defaults to true', + ); + + // Single-entry, explicit true → true + assert( + getInstallToBmad({ __single: { type: 'skill', install_to_bmad: true } }, 'workflow.md') === true, + 'single-entry manifest with explicit true returns true', + ); + + console.log(''); + + // ============================================================ + // 2. false → getInstallToBmad returns false (remove from _bmad/) + // ============================================================ + console.log(`${colors.yellow}Design decision 2: false → skill removed from _bmad/${colors.reset}\n`); + + // Single-entry, explicit false → false + assert( + getInstallToBmad({ __single: { type: 'skill', install_to_bmad: false } }, 'workflow.md') === false, + 'single-entry manifest with explicit false returns false', + ); + + // loadSkillManifest round-trip: YAML with false is preserved through load + { + const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'bmad-itb-')); + await fs.writeFile(path.join(tmpDir, 'bmad-skill-manifest.yaml'), 'type: skill\ninstall_to_bmad: false\n'); + const loaded = await loadSkillManifest(tmpDir); + assert(getInstallToBmad(loaded, 'workflow.md') === false, 'loadSkillManifest preserves install_to_bmad: false through round-trip'); + await fs.remove(tmpDir); + } + + console.log(''); + + // ============================================================ + // 3. No platform → cleanup only runs inside installVerbatimSkills + // (This is a design invariant: getInstallToBmad is only consulted + // during IDE install. Without a platform, the flag has no effect.) + // ============================================================ + console.log(`${colors.yellow}Design decision 3: flag is a per-skill property, not a pipeline gate${colors.reset}\n`); + + // The flag value is stored but doesn't trigger any side effects by itself. + // Cleanup is driven by reading the CSV column inside installVerbatimSkills. + // We verify the flag is just data — getInstallToBmad doesn't touch the filesystem. + { + const manifest = { __single: { type: 'skill', install_to_bmad: false } }; + const result = getInstallToBmad(manifest, 'workflow.md'); + assert(typeof result === 'boolean', 'getInstallToBmad returns a boolean (pure data, no side effects)'); + assert(result === false, 'false value is faithfully returned for consumer to act on'); + } + + console.log(''); + + // ============================================================ + // 4. Mixed flags → each skill evaluated independently + // ============================================================ + console.log(`${colors.yellow}Design decision 4: mixed flags — each skill independent${colors.reset}\n`); + + // Multi-entry manifest: different files can have different flags + { + const manifest = { + 'workflow.md': { type: 'skill', install_to_bmad: false }, + 'other.md': { type: 'skill', install_to_bmad: true }, + }; + assert(getInstallToBmad(manifest, 'workflow.md') === false, 'multi-entry: workflow.md with false returns false'); + assert(getInstallToBmad(manifest, 'other.md') === true, 'multi-entry: other.md with true returns true'); + assert(getInstallToBmad(manifest, 'unknown.md') === true, 'multi-entry: unknown file defaults to true'); + } + + console.log(''); + + // ============================================================ + // Summary + // ============================================================ + console.log(`${colors.cyan}========================================`); + console.log('Results:'); + console.log(` Passed: ${colors.green}${passed}${colors.reset}`); + console.log(` Failed: ${colors.red}${failed}${colors.reset}`); + console.log(`========================================${colors.reset}\n`); + + if (failed === 0) { + console.log(`${colors.green}All install_to_bmad contract tests passed!${colors.reset}\n`); + process.exit(0); + } else { + console.log(`${colors.red}Some install_to_bmad contract tests failed${colors.reset}\n`); + process.exit(1); + } +} + +runTests().catch((error) => { + console.error(`${colors.red}Test runner failed:${colors.reset}`, error.message); + console.error(error.stack); + process.exit(1); +}); diff --git a/tools/cli/installers/lib/core/manifest-generator.js b/tools/cli/installers/lib/core/manifest-generator.js index 0955a3d6f..34a8fbbb4 100644 --- a/tools/cli/installers/lib/core/manifest-generator.js +++ b/tools/cli/installers/lib/core/manifest-generator.js @@ -5,7 +5,12 @@ const crypto = require('node:crypto'); const csv = require('csv-parse/sync'); const { getSourcePath, getModulePath } = require('../../../lib/project-root'); const prompts = require('../../../lib/prompts'); -const { loadSkillManifest: loadSkillManifestShared, getCanonicalId: getCanonicalIdShared } = require('../ide/shared/skill-manifest'); +const { + loadSkillManifest: loadSkillManifestShared, + getCanonicalId: getCanonicalIdShared, + getArtifactType: getArtifactTypeShared, + getInstallToBmad: getInstallToBmadShared, +} = require('../ide/shared/skill-manifest'); // Load package.json for version info const packageJson = require('../../../../../package.json'); @@ -16,6 +21,7 @@ const packageJson = require('../../../../../package.json'); class ManifestGenerator { constructor() { this.workflows = []; + this.skills = []; this.agents = []; this.tasks = []; this.tools = []; @@ -34,6 +40,16 @@ class ManifestGenerator { return getCanonicalIdShared(manifest, filename); } + /** Delegate to shared skill-manifest module */ + getArtifactType(manifest, filename) { + return getArtifactTypeShared(manifest, filename); + } + + /** Delegate to shared skill-manifest module */ + getInstallToBmad(manifest, filename) { + return getInstallToBmadShared(manifest, filename); + } + /** * Clean text for CSV output by normalizing whitespace. * Note: Quote escaping is handled by escapeCsv() at write time. @@ -89,6 +105,9 @@ class ManifestGenerator { // Filter out any undefined/null values from IDE list this.selectedIdes = resolvedIdes.filter((ide) => ide && typeof ide === 'string'); + // Reset files list (defensive: prevent stale data if instance is reused) + this.files = []; + // Collect workflow data await this.collectWorkflows(selectedModules); @@ -105,6 +124,7 @@ class ManifestGenerator { const manifestFiles = [ await this.writeMainManifest(cfgDir), await this.writeWorkflowManifest(cfgDir), + await this.writeSkillManifest(cfgDir), await this.writeAgentManifest(cfgDir), await this.writeTaskManifest(cfgDir), await this.writeToolManifest(cfgDir), @@ -127,6 +147,7 @@ class ManifestGenerator { */ async collectWorkflows(selectedModules) { this.workflows = []; + this.skills = []; // Use updatedModules which already includes deduplicated 'core' + selectedModules for (const moduleName of this.updatedModules) { @@ -228,6 +249,25 @@ class ManifestGenerator { ? `${this.bmadFolderName}/core/workflows/${relativePath}/${entry.name}` : `${this.bmadFolderName}/${moduleName}/workflows/${relativePath}/${entry.name}`; + // Check if this is a type:skill entry — collect separately, skip workflow CSV + const artifactType = this.getArtifactType(skillManifest, entry.name); + if (artifactType === 'skill') { + const canonicalId = path.basename(dir); + this.skills.push({ + name: workflow.name, + description: this.cleanForCSV(workflow.description), + module: moduleName, + path: installPath, + canonicalId, + install_to_bmad: this.getInstallToBmad(skillManifest, entry.name), + }); + + if (debug) { + console.log(`[DEBUG] ✓ Added skill (skipped workflow CSV): ${workflow.name} as ${canonicalId}`); + } + continue; + } + // Workflows with standalone: false are filtered out above workflows.push({ name: workflow.name, @@ -793,6 +833,32 @@ class ManifestGenerator { return csvPath; } + /** + * Write skill manifest CSV + * @returns {string} Path to the manifest file + */ + async writeSkillManifest(cfgDir) { + const csvPath = path.join(cfgDir, 'skill-manifest.csv'); + const escapeCsv = (value) => `"${String(value ?? '').replaceAll('"', '""')}"`; + + let csvContent = 'canonicalId,name,description,module,path,install_to_bmad\n'; + + for (const skill of this.skills) { + const row = [ + escapeCsv(skill.canonicalId), + escapeCsv(skill.name), + escapeCsv(skill.description), + escapeCsv(skill.module), + escapeCsv(skill.path), + escapeCsv(skill.install_to_bmad), + ].join(','); + csvContent += row + '\n'; + } + + await fs.writeFile(csvPath, csvContent); + return csvPath; + } + /** * Write agent manifest CSV * @returns {string} Path to the manifest file diff --git a/tools/cli/installers/lib/ide/_config-driven.js b/tools/cli/installers/lib/ide/_config-driven.js index 0a311a68d..e72b61481 100644 --- a/tools/cli/installers/lib/ide/_config-driven.js +++ b/tools/cli/installers/lib/ide/_config-driven.js @@ -7,6 +7,7 @@ const prompts = require('../../../lib/prompts'); const { AgentCommandGenerator } = require('./shared/agent-command-generator'); const { WorkflowCommandGenerator } = require('./shared/workflow-command-generator'); const { TaskToolCommandGenerator } = require('./shared/task-tool-command-generator'); +const csv = require('csv-parse/sync'); /** * Config-driven IDE setup handler @@ -116,39 +117,48 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup { async installToTarget(projectDir, bmadDir, config, options) { const { target_dir, template_type, artifact_types } = config; - // Skip targets with explicitly empty artifact_types array + // Skip targets with explicitly empty artifact_types and no verbatim skills // This prevents creating empty directories when no artifacts will be written - if (Array.isArray(artifact_types) && artifact_types.length === 0) { - return { success: true, results: { agents: 0, workflows: 0, tasks: 0, tools: 0 } }; + const skipStandardArtifacts = Array.isArray(artifact_types) && artifact_types.length === 0; + if (skipStandardArtifacts && !config.skill_format) { + return { success: true, results: { agents: 0, workflows: 0, tasks: 0, tools: 0, skills: 0 } }; } const targetPath = path.join(projectDir, target_dir); await this.ensureDir(targetPath); const selectedModules = options.selectedModules || []; - const results = { agents: 0, workflows: 0, tasks: 0, tools: 0 }; + const results = { agents: 0, workflows: 0, tasks: 0, tools: 0, skills: 0 }; - // Install agents - if (!artifact_types || artifact_types.includes('agents')) { - const agentGen = new AgentCommandGenerator(this.bmadFolderName); - const { artifacts } = await agentGen.collectAgentArtifacts(bmadDir, selectedModules); - results.agents = await this.writeAgentArtifacts(targetPath, artifacts, template_type, config); + // Install standard artifacts (agents, workflows, tasks, tools) + if (!skipStandardArtifacts) { + // Install agents + if (!artifact_types || artifact_types.includes('agents')) { + const agentGen = new AgentCommandGenerator(this.bmadFolderName); + const { artifacts } = await agentGen.collectAgentArtifacts(bmadDir, selectedModules); + results.agents = await this.writeAgentArtifacts(targetPath, artifacts, template_type, config); + } + + // Install workflows + if (!artifact_types || artifact_types.includes('workflows')) { + const workflowGen = new WorkflowCommandGenerator(this.bmadFolderName); + const { artifacts } = await workflowGen.collectWorkflowArtifacts(bmadDir); + results.workflows = await this.writeWorkflowArtifacts(targetPath, artifacts, template_type, config); + } + + // Install tasks and tools using template system (supports TOML for Gemini, MD for others) + if (!artifact_types || artifact_types.includes('tasks') || artifact_types.includes('tools')) { + const taskToolGen = new TaskToolCommandGenerator(this.bmadFolderName); + const { artifacts } = await taskToolGen.collectTaskToolArtifacts(bmadDir); + const taskToolResult = await this.writeTaskToolArtifacts(targetPath, artifacts, template_type, config); + results.tasks = taskToolResult.tasks || 0; + results.tools = taskToolResult.tools || 0; + } } - // Install workflows - if (!artifact_types || artifact_types.includes('workflows')) { - const workflowGen = new WorkflowCommandGenerator(this.bmadFolderName); - const { artifacts } = await workflowGen.collectWorkflowArtifacts(bmadDir); - results.workflows = await this.writeWorkflowArtifacts(targetPath, artifacts, template_type, config); - } - - // Install tasks and tools using template system (supports TOML for Gemini, MD for others) - if (!artifact_types || artifact_types.includes('tasks') || artifact_types.includes('tools')) { - const taskToolGen = new TaskToolCommandGenerator(this.bmadFolderName); - const { artifacts } = await taskToolGen.collectTaskToolArtifacts(bmadDir); - const taskToolResult = await this.writeTaskToolArtifacts(targetPath, artifacts, template_type, config); - results.tasks = taskToolResult.tasks || 0; - results.tools = taskToolResult.tools || 0; + // Install verbatim skills (type: skill) + if (config.skill_format) { + results.skills = await this.installVerbatimSkills(projectDir, bmadDir, targetPath, config); } await this.printSummary(results, target_dir, options); @@ -164,7 +174,7 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup { * @returns {Promise} Installation result */ async installToMultipleTargets(projectDir, bmadDir, targets, options) { - const allResults = { agents: 0, workflows: 0, tasks: 0, tools: 0 }; + const allResults = { agents: 0, workflows: 0, tasks: 0, tools: 0, skills: 0 }; for (const target of targets) { const result = await this.installToTarget(projectDir, bmadDir, target, options); @@ -173,6 +183,7 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup { allResults.workflows += result.results.workflows || 0; allResults.tasks += result.results.tasks || 0; allResults.tools += result.results.tools || 0; + allResults.skills += result.results.skills || 0; } } @@ -622,6 +633,94 @@ LOAD and execute from: {project-root}/{{bmadFolderName}}/{{path}} return baseName.replace(/\.md$/, extension); } + /** + * Install verbatim skill directories (type: skill entries from skill-manifest.csv). + * Copies the entire source directory into the IDE skill directory, auto-generating SKILL.md. + * @param {string} projectDir - Project directory + * @param {string} bmadDir - BMAD installation directory + * @param {string} targetPath - Target skills directory + * @param {Object} config - Installation configuration + * @returns {Promise} Count of skills installed + */ + async installVerbatimSkills(projectDir, bmadDir, targetPath, config) { + const bmadFolderName = path.basename(bmadDir); + const csvPath = path.join(bmadDir, '_config', 'skill-manifest.csv'); + + if (!(await fs.pathExists(csvPath))) return 0; + + const csvContent = await fs.readFile(csvPath, 'utf8'); + const records = csv.parse(csvContent, { + columns: true, + skip_empty_lines: true, + }); + + let count = 0; + + for (const record of records) { + const canonicalId = record.canonicalId; + if (!canonicalId) continue; + + // Derive source directory from path column + // path is like "_bmad/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md" + // Strip bmadFolderName prefix and join with bmadDir, then get dirname + const relativePath = record.path.replace(new RegExp(`^${bmadFolderName}/`), ''); + const sourceFile = path.join(bmadDir, relativePath); + const sourceDir = path.dirname(sourceFile); + + if (!(await fs.pathExists(sourceDir))) continue; + + // Clean target before copy to prevent stale files + const skillDir = path.join(targetPath, canonicalId); + await fs.remove(skillDir); + await fs.ensureDir(skillDir); + + // Parse workflow.md frontmatter for description + let description = `${canonicalId} skill`; + try { + const workflowContent = await fs.readFile(sourceFile, 'utf8'); + const fmMatch = workflowContent.match(/^---\r?\n([\s\S]*?)\r?\n---/); + if (fmMatch) { + const frontmatter = yaml.parse(fmMatch[1]); + if (frontmatter?.description) { + description = frontmatter.description; + } + } + } catch (error) { + await prompts.log.warn(`Failed to parse frontmatter from ${sourceFile}: ${error.message}`); + } + + // Generate SKILL.md with YAML-safe frontmatter + const frontmatterYaml = yaml.stringify({ name: canonicalId, description: String(description) }, { lineWidth: 0 }).trimEnd(); + const skillMd = `---\n${frontmatterYaml}\n---\n\nIT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL workflow.md, READ its entire contents and follow its directions exactly!\n`; + await fs.writeFile(path.join(skillDir, 'SKILL.md'), skillMd); + + // Copy all files except bmad-skill-manifest.yaml + const entries = await fs.readdir(sourceDir, { withFileTypes: true }); + for (const entry of entries) { + if (entry.name === 'bmad-skill-manifest.yaml') continue; + const srcPath = path.join(sourceDir, entry.name); + const destPath = path.join(skillDir, entry.name); + await fs.copy(srcPath, destPath); + } + + count++; + } + + // Post-install cleanup: remove _bmad/ directories for skills with install_to_bmad === "false" + for (const record of records) { + if (record.install_to_bmad === 'false') { + const relativePath = record.path.replace(new RegExp(`^${bmadFolderName}/`), ''); + const sourceFile = path.join(bmadDir, relativePath); + const sourceDir = path.dirname(sourceFile); + if (await fs.pathExists(sourceDir)) { + await fs.remove(sourceDir); + } + } + } + + return count; + } + /** * Print installation summary * @param {Object} results - Installation results @@ -634,6 +733,7 @@ LOAD and execute from: {project-root}/{{bmadFolderName}}/{{path}} if (results.workflows > 0) parts.push(`${results.workflows} workflows`); if (results.tasks > 0) parts.push(`${results.tasks} tasks`); if (results.tools > 0) parts.push(`${results.tools} tools`); + if (results.skills > 0) parts.push(`${results.skills} skills`); await prompts.log.success(`${this.name} configured: ${parts.join(', ')} → ${targetDir}`); } diff --git a/tools/cli/installers/lib/ide/shared/skill-manifest.js b/tools/cli/installers/lib/ide/shared/skill-manifest.js index ff940242f..22a7cceef 100644 --- a/tools/cli/installers/lib/ide/shared/skill-manifest.js +++ b/tools/cli/installers/lib/ide/shared/skill-manifest.js @@ -16,7 +16,7 @@ async function loadSkillManifest(dirPath) { const content = await fs.readFile(manifestPath, 'utf8'); const parsed = yaml.parse(content); if (!parsed || typeof parsed !== 'object') return null; - if (parsed.canonicalId) return { __single: parsed }; + if (parsed.canonicalId || parsed.type) return { __single: parsed }; return parsed; } catch (error) { console.warn(`Warning: Failed to parse bmad-skill-manifest.yaml in ${dirPath}: ${error.message}`); @@ -45,4 +45,46 @@ function getCanonicalId(manifest, filename) { return ''; } -module.exports = { loadSkillManifest, getCanonicalId }; +/** + * Get the artifact type for a specific file from a loaded skill manifest. + * @param {Object|null} manifest - Loaded manifest (from loadSkillManifest) + * @param {string} filename - Source filename to look up + * @returns {string|null} type or null + */ +function getArtifactType(manifest, filename) { + if (!manifest) return null; + // Single-entry manifest applies to all files in the directory + if (manifest.__single) return manifest.__single.type || null; + // Multi-entry: look up by filename directly + if (manifest[filename]) return manifest[filename].type || null; + // Fallback: try alternate extensions for compiled files + const baseName = filename.replace(/\.(md|xml)$/i, ''); + const agentKey = `${baseName}.agent.yaml`; + if (manifest[agentKey]) return manifest[agentKey].type || null; + const xmlKey = `${baseName}.xml`; + if (manifest[xmlKey]) return manifest[xmlKey].type || null; + return null; +} + +/** + * Get the install_to_bmad flag for a specific file from a loaded skill manifest. + * @param {Object|null} manifest - Loaded manifest (from loadSkillManifest) + * @param {string} filename - Source filename to look up + * @returns {boolean} install_to_bmad value (defaults to true) + */ +function getInstallToBmad(manifest, filename) { + if (!manifest) return true; + // Single-entry manifest applies to all files in the directory + if (manifest.__single) return manifest.__single.install_to_bmad !== false; + // Multi-entry: look up by filename directly + if (manifest[filename]) return manifest[filename].install_to_bmad !== false; + // Fallback: try alternate extensions for compiled files + const baseName = filename.replace(/\.(md|xml)$/i, ''); + const agentKey = `${baseName}.agent.yaml`; + if (manifest[agentKey]) return manifest[agentKey].install_to_bmad !== false; + const xmlKey = `${baseName}.xml`; + if (manifest[xmlKey]) return manifest[xmlKey].install_to_bmad !== false; + return true; +} + +module.exports = { loadSkillManifest, getCanonicalId, getArtifactType, getInstallToBmad }; diff --git a/tools/validate-file-refs.js b/tools/validate-file-refs.js index bf92f31f8..a3b91f2fb 100644 --- a/tools/validate-file-refs.js +++ b/tools/validate-file-refs.js @@ -324,6 +324,8 @@ function extractCsvRefs(filePath, content) { const raw = record['workflow-file']; if (!raw || raw.trim() === '') continue; if (!isResolvable(raw)) continue; + // skill: prefixed references are resolved by the IDE/CLI, not as file paths + if (raw.startsWith('skill:')) continue; // Line = header (1) + data row index (0-based) + 1 const line = i + 2; From dc8293e5df46cba0c6adc70aff7d5d44a88a1a6c Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 04:51:50 -0600 Subject: [PATCH 04/12] chore(sprint-planning): convert workflow.yaml to unified workflow.md (#1856) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(sprint-planning): convert workflow.yaml + instructions.md to unified workflow.md Step 4 of 9 in the yaml-to-md conversion plan. Merges config and instructions into a single self-contained workflow.md, dropping engine scaffolding (critical tags, invoke-protocol). * fix(sprint-planning): address review findings from PR triage - Update stale workflow.yaml references to workflow.md in sm.agent.yaml and module-help.csv - Widen epics_pattern from epic*.md to *epic*.md to match documented input files - Fix placeholder mismatch: epics_in_progress_count → in_progress_count Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- src/bmm/agents/sm.agent.yaml | 2 +- src/bmm/module-help.csv | 2 +- .../{instructions.md => workflow.md} | 63 ++++++++++++++++--- .../sprint-planning/workflow.yaml | 47 -------------- 4 files changed, 55 insertions(+), 59 deletions(-) rename src/bmm/workflows/4-implementation/sprint-planning/{instructions.md => workflow.md} (80%) delete mode 100644 src/bmm/workflows/4-implementation/sprint-planning/workflow.yaml diff --git a/src/bmm/agents/sm.agent.yaml b/src/bmm/agents/sm.agent.yaml index 4244b12b6..48e407190 100644 --- a/src/bmm/agents/sm.agent.yaml +++ b/src/bmm/agents/sm.agent.yaml @@ -20,7 +20,7 @@ agent: menu: - trigger: SP or fuzzy match on sprint-planning - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml" + workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.md" description: "[SP] Sprint Planning: Generate or update the record that will sequence the tasks to complete the full project that the dev agent will follow" - trigger: CS or fuzzy match on create-story diff --git a/src/bmm/module-help.csv b/src/bmm/module-help.csv index 98da248dc..3981c6268 100644 --- a/src/bmm/module-help.csv +++ b/src/bmm/module-help.csv @@ -22,7 +22,7 @@ bmm,2-planning,Create UX,CU,30,_bmad/bmm/workflows/2-plan-workflows/create-ux-de bmm,3-solutioning,Create Architecture,CA,10,_bmad/bmm/workflows/3-solutioning/create-architecture/workflow.md,bmad-bmm-create-architecture,true,architect,Create Mode,"Guided Workflow to document technical decisions",planning_artifacts,architecture, bmm,3-solutioning,Create Epics and Stories,CE,30,_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/workflow.md,bmad-bmm-create-epics-and-stories,true,pm,Create Mode,"Create the Epics and Stories Listing",planning_artifacts,"epics and stories", bmm,3-solutioning,Check Implementation Readiness,IR,70,_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/workflow.md,bmad-bmm-check-implementation-readiness,true,architect,Validate Mode,"Ensure PRD UX Architecture and Epics Stories are aligned",planning_artifacts,"readiness report", -bmm,4-implementation,Sprint Planning,SP,10,_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml,bmad-bmm-sprint-planning,true,sm,Create Mode,"Generate sprint plan for development tasks - this kicks off the implementation phase by producing a plan the implementation agents will follow in sequence for every story in the plan.",implementation_artifacts,"sprint status", +bmm,4-implementation,Sprint Planning,SP,10,_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.md,bmad-bmm-sprint-planning,true,sm,Create Mode,"Generate sprint plan for development tasks - this kicks off the implementation phase by producing a plan the implementation agents will follow in sequence for every story in the plan.",implementation_artifacts,"sprint status", bmm,4-implementation,Sprint Status,SS,20,_bmad/bmm/workflows/4-implementation/sprint-status/workflow.md,bmad-bmm-sprint-status,false,sm,Create Mode,"Anytime: Summarize sprint status and route to next workflow",,, bmm,4-implementation,Validate Story,VS,35,_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml,bmad-bmm-create-story,false,sm,Validate Mode,"Validates story readiness and completeness before development work begins",implementation_artifacts,"story validation report", bmm,4-implementation,Create Story,CS,30,_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml,bmad-bmm-create-story,true,sm,Create Mode,"Story cycle start: Prepare first found story in the sprint plan that is next, or if the command is run with a specific epic and story designation with context. Once complete, then VS then DS then CR then back to DS if needed or next CS or ER",implementation_artifacts,story, diff --git a/src/bmm/workflows/4-implementation/sprint-planning/instructions.md b/src/bmm/workflows/4-implementation/sprint-planning/workflow.md similarity index 80% rename from src/bmm/workflows/4-implementation/sprint-planning/instructions.md rename to src/bmm/workflows/4-implementation/sprint-planning/workflow.md index 04492088b..aba449c01 100644 --- a/src/bmm/workflows/4-implementation/sprint-planning/instructions.md +++ b/src/bmm/workflows/4-implementation/sprint-planning/workflow.md @@ -1,9 +1,57 @@ -# Sprint Planning - Sprint Status Generator +--- +name: sprint-planning +description: 'Generate sprint status tracking from epics. Use when the user says "run sprint planning" or "generate sprint plan"' +--- -The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml -You MUST have already loaded and processed: {project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml +# Sprint Planning Workflow -## 📚 Document Discovery - Full Epic Loading +**Goal:** Generate sprint status tracking from epics, detecting current story statuses and building a complete sprint-status.yaml file. + +**Your Role:** You are a Scrum Master generating and maintaining sprint tracking. Parse epic files, detect story statuses, and produce a structured sprint-status.yaml. + +--- + +## INITIALIZATION + +### Configuration Loading + +Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: + +- `project_name`, `user_name` +- `communication_language`, `document_output_language` +- `implementation_artifacts` +- `planning_artifacts` +- `date` as system-generated current datetime +- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}` + +### Paths + +- `installed_path` = `{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning` +- `template` = `{installed_path}/sprint-status-template.yaml` +- `checklist` = `{installed_path}/checklist.md` +- `tracking_system` = `file-system` +- `project_key` = `NOKEY` +- `story_location` = `{implementation_artifacts}` +- `story_location_absolute` = `{implementation_artifacts}` +- `epics_location` = `{planning_artifacts}` +- `epics_pattern` = `*epic*.md` +- `status_file` = `{implementation_artifacts}/sprint-status.yaml` + +### Input Files + +| Input | Path | Load Strategy | +|-------|------|---------------| +| Epics | `{planning_artifacts}/*epic*.md` (whole) or `{planning_artifacts}/*epic*/*.md` (sharded) | FULL_LOAD | + +### Context + +- `project_context` = `**/project-context.md` (load if exists) + +--- + +## EXECUTION + +### Document Discovery - Full Epic Loading **Strategy**: Sprint planning needs ALL epics and stories to build complete status tracking. @@ -44,11 +92,6 @@ Build complete inventory of all epics and stories from all epic files - - - After discovery, these content variables are available: {epics_content} (all epics loaded - uses FULL_LOAD strategy) - - For each epic found, create entries in this order: @@ -170,7 +213,7 @@ development_status: - **File Location:** {status_file} - **Total Epics:** {{epic_count}} - **Total Stories:** {{story_count}} -- **Epics In Progress:** {{epics_in_progress_count}} +- **Epics In Progress:** {{in_progress_count}} - **Stories Completed:** {{done_count}} **Next Steps:** diff --git a/src/bmm/workflows/4-implementation/sprint-planning/workflow.yaml b/src/bmm/workflows/4-implementation/sprint-planning/workflow.yaml deleted file mode 100644 index 0f1b73789..000000000 --- a/src/bmm/workflows/4-implementation/sprint-planning/workflow.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: sprint-planning -description: 'Generate sprint status tracking from epics. Use when the user says "run sprint planning" or "generate sprint plan"' -author: "BMad" - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -date: system-generated -implementation_artifacts: "{config_source}:implementation_artifacts" -planning_artifacts: "{config_source}:planning_artifacts" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning" -instructions: "{installed_path}/instructions.md" -template: "{installed_path}/sprint-status-template.yaml" -validation: "{installed_path}/checklist.md" - -# Variables and inputs -project_context: "**/project-context.md" -project_name: "{config_source}:project_name" - -# Tracking system configuration -tracking_system: "file-system" # Options: file-system, Future will support other options from config of mcp such as jira, linear, trello -project_key: "NOKEY" # Placeholder for tracker integrations; file-system uses a no-op key -story_location: "{implementation_artifacts}" # Relative path for file-system, Future will support URL for Jira/Linear/Trello -story_location_absolute: "{implementation_artifacts}" # Absolute path for file operations - -# Source files (file-system only) -epics_location: "{planning_artifacts}" # Directory containing epic*.md files -epics_pattern: "epic*.md" # Pattern to find epic files - -# Output configuration -status_file: "{implementation_artifacts}/sprint-status.yaml" - -# Smart input file references - handles both whole docs and sharded docs -# Priority: Whole document first, then sharded version -# Strategy: FULL LOAD - sprint planning needs ALL epics to build complete status -input_file_patterns: - epics: - description: "All epics with user stories" - whole: "{planning_artifacts}/*epic*.md" - sharded: "{planning_artifacts}/*epic*/*.md" - load_strategy: "FULL_LOAD" - -# Output configuration -default_output_file: "{status_file}" From 835d6d85a53bca66598b3724401b713c5d9564a5 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 06:52:55 -0600 Subject: [PATCH 05/12] feat(tasks): convert review-adversarial-general XML task to native skill (#1857) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(tasks): convert review-adversarial-general from XML task to native skill Convert the simplest core task (review-adversarial-general.xml) from type:task XML format to type:skill markdown format. This establishes the pattern for converting remaining XML tasks to self-contained skills. - Convert XML task to workflow.md with frontmatter, role, execution steps - Add type:skill manifest for verbatim directory copying - Extend manifest-generator getTasksFromDir to recurse into subdirectories and detect type:skill entries (mirrors existing workflow skill detection) - Update cross-references in quick-dev-new-preview, quick-dev, quick-spec - Update module-help.csv to use skill: prefix * refactor: replace file path references with skill name invocations Consumers of review-adversarial-general now invoke by skill name instead of loading via _bmad/ file path. Removes the indirection variable from frontmatter and inlines the skill name directly. * refactor(installer): scan tasks/ for type:skill entries Teach collectWorkflows to also scan the tasks/ subdirectory for type:skill entries. Skills can live anywhere in the source tree — the workflow scanner just needs to look in more places. * fix: update stale task terminology to skill after format conversion Address review findings from PR #1857: replace remaining "task" references with "skill" in workflow steps and test documentation. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- .../steps/step-04-review.md | 5 +- .../bmad-quick-dev-new-preview/workflow.md | 3 -- .../steps/step-05-adversarial-review.md | 22 +++------ .../quick-spec/steps/step-04-review.md | 10 ++-- src/core/module-help.csv | 2 +- .../bmad-skill-manifest.yaml | 1 + .../workflow.md | 37 ++++++++++++++ src/core/tasks/bmad-skill-manifest.yaml | 5 -- src/core/tasks/review-adversarial-general.xml | 49 ------------------- test/adversarial-review-tests/README.md | 6 +-- test/adversarial-review-tests/test-cases.yaml | 4 +- .../installers/lib/core/manifest-generator.js | 12 +++-- 12 files changed, 66 insertions(+), 90 deletions(-) create mode 100644 src/core/tasks/bmad-review-adversarial-general/bmad-skill-manifest.yaml create mode 100644 src/core/tasks/bmad-review-adversarial-general/workflow.md delete mode 100644 src/core/tasks/review-adversarial-general.xml diff --git a/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md index e13e7652c..0693e7331 100644 --- a/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md +++ b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/steps/step-04-review.md @@ -2,7 +2,6 @@ name: 'step-04-review' description: 'Adversarial review, classify findings, optional spec loop' -adversarial_review_task: '{project-root}/_bmad/core/tasks/review-adversarial-general.xml' edge_case_hunter_task: '{project-root}/_bmad/core/tasks/review-edge-case-hunter.xml' deferred_work_file: '{implementation_artifacts}/deferred-work.md' specLoopIteration: 1 @@ -27,11 +26,11 @@ Do NOT `git add` anything — this is read-only inspection. ### Review -**One-shot:** Skip diff construction. Still invoke `{adversarial_review_task}` in a subagent with the changed files — inline review invites anchoring bias. +**One-shot:** Skip diff construction. Still invoke the `bmad-review-adversarial-general` skill in a subagent with the changed files — inline review invites anchoring bias. **Plan-code-review:** Launch three subagents without conversation context. If no sub-agents are available, generate three review prompt files in `{implementation_artifacts}` — one per reviewer role below — and HALT. Ask the human to run each in a separate session (ideally a different LLM) and paste back the findings. -- **Blind hunter** — receives `{diff_output}` only. No spec, no context docs, no project access. Invoke via `{adversarial_review_task}`. +- **Blind hunter** — receives `{diff_output}` only. No spec, no context docs, no project access. Invoke via the `bmad-review-adversarial-general` skill. - **Edge case hunter** — receives `{diff_output}` and read access to the project. Invoke via `{edge_case_hunter_task}`. - **Acceptance auditor** — receives `{diff_output}`, `{spec_file}`, and read access to the project. Must also read the docs listed in `{spec_file}` frontmatter `context`. Checks for violations of acceptance criteria, rules, and principles from the spec and context docs. diff --git a/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md index eae636173..0231240be 100644 --- a/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md +++ b/src/bmm/workflows/bmad-quick-flow/bmad-quick-dev-new-preview/workflow.md @@ -6,9 +6,6 @@ main_config: '{project-root}/_bmad/bmm/config.yaml' # Related workflows advanced_elicitation: '{project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md' party_mode_exec: '{project-root}/_bmad/core/workflows/party-mode/workflow.md' - -# Review building block -adversarial_review_task: '{project-root}/_bmad/core/tasks/review-adversarial-general.xml' --- # Quick Dev New Preview Workflow diff --git a/src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md b/src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md index 8bbd6761e..0c13c7d77 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md +++ b/src/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md @@ -1,13 +1,13 @@ --- name: 'step-05-adversarial-review' -description: 'Construct diff and invoke adversarial review task' +description: 'Construct diff and invoke adversarial review skill' nextStepFile: './step-06-resolve-findings.md' --- # Step 5: Adversarial Code Review -**Goal:** Construct diff of all changes, invoke adversarial review task, present findings. +**Goal:** Construct diff of all changes, invoke adversarial review skill, present findings. --- @@ -57,21 +57,15 @@ Merge all changes into `{diff_output}`. ### 2. Invoke Adversarial Review -With `{diff_output}` constructed, load and follow the review task. If possible, use information asymmetry: load this step, and only it, in a separate subagent or process with read access to the project, but no context except the `{diff_output}`. +With `{diff_output}` constructed, invoke the `bmad-review-adversarial-general` skill. If possible, use information asymmetry: invoke the skill in a separate subagent or process with read access to the project, but no context except the `{diff_output}`. -```xml -Review {diff_output} using {project-root}/_bmad/core/tasks/review-adversarial-general.xml -``` - -**Platform fallback:** If task invocation not available, load the task file and follow its instructions inline, passing `{diff_output}` as the content. - -The task should: review `{diff_output}` and return a list of findings. +Pass `{diff_output}` as the content to review. The skill should return a list of findings. --- ### 3. Process Findings -Capture the findings from the task output. +Capture the findings from the skill output. **If zero findings:** HALT - this is suspicious. Re-analyze or request user guidance. Evaluate severity (Critical, High, Medium, Low) and validity (real, noise, undecided). DO NOT exclude findings based on severity or validity unless explicitly asked to do so. @@ -91,7 +85,7 @@ With findings in hand, read fully and follow: `{project-root}/_bmad/bmm/workflow - Diff constructed from baseline_commit - New files included in diff -- Task invoked with diff as input +- Skill invoked with diff as input - Findings received - Findings processed into TODOs or table and presented to user @@ -99,6 +93,6 @@ With findings in hand, read fully and follow: `{project-root}/_bmad/bmm/workflow - Missing baseline_commit (can't construct accurate diff) - Not including new untracked files in diff -- Invoking task without providing diff input +- Invoking skill without providing diff input - Accepting zero findings without questioning -- Presenting fewer findings than the review task returned without explicit instruction to do so +- Presenting fewer findings than the review skill returned without explicit instruction to do so diff --git a/src/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md b/src/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md index 24c65d088..13bda4028 100644 --- a/src/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md +++ b/src/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md @@ -151,14 +151,12 @@ b) **HALT and wait for user selection.** #### Adversarial Review [R] Process: -1. **Invoke Adversarial Review Task**: - > With `{finalFile}` constructed, load and follow the review task. If possible, use information asymmetry: load this task, and only it, in a separate subagent or process with read access to the project, but no context except the `{finalFile}`. - Review {finalFile} using {project-root}/_bmad/core/tasks/review-adversarial-general.xml - > **Platform fallback:** If task invocation not available, load the task file and follow its instructions inline, passing `{finalFile}` as the content. - > The task should: review `{finalFile}` and return a list of findings. +1. **Invoke Adversarial Review Skill**: + > With `{finalFile}` constructed, invoke the `bmad-review-adversarial-general` skill. If possible, use information asymmetry: invoke the skill in a separate subagent or process with read access to the project, but no context except the `{finalFile}`. + > Pass `{finalFile}` as the content to review. The skill should return a list of findings. 2. **Process Findings**: - > Capture the findings from the task output. + > Capture the findings from the skill output. > **If zero findings:** HALT - this is suspicious. Re-analyze or request user guidance. > Evaluate severity (Critical, High, Medium, Low) and validity (real, noise, undecided). > DO NOT exclude findings based on severity or validity unless explicitly asked to do so. diff --git a/src/core/module-help.csv b/src/core/module-help.csv index 2e4419599..a56f33772 100644 --- a/src/core/module-help.csv +++ b/src/core/module-help.csv @@ -6,5 +6,5 @@ core,anytime,Index Docs,ID,,_bmad/core/tasks/index-docs.xml,bmad-index-docs,fals core,anytime,Shard Document,SD,,_bmad/core/tasks/shard-doc.xml,bmad-shard-doc,false,,,"Split large documents into smaller files by sections. Use when doc becomes too large (>500 lines) to manage effectively.",, core,anytime,Editorial Review - Prose,EP,,_bmad/core/tasks/editorial-review-prose.xml,bmad-editorial-review-prose,false,,,"Review prose for clarity, tone, and communication issues. Use after drafting to polish written content.",report located with target document,"three-column markdown table with suggested fixes", core,anytime,Editorial Review - Structure,ES,,_bmad/core/tasks/editorial-review-structure.xml,bmad-editorial-review-structure,false,,,"Propose cuts, reorganization, and simplification while preserving comprehension. Use when doc produced from multiple subprocesses or needs structural improvement.",report located with target document, -core,anytime,Adversarial Review (General),AR,,_bmad/core/tasks/review-adversarial-general.xml,bmad-review-adversarial-general,false,,,"Review content critically to find issues and weaknesses. Use for quality assurance or before finalizing deliverables. Code Review in other modules run this automatically, but its useful also for document reviews",, +core,anytime,Adversarial Review (General),AR,,skill:bmad-review-adversarial-general,bmad-review-adversarial-general,false,,,"Review content critically to find issues and weaknesses. Use for quality assurance or before finalizing deliverables. Code Review in other modules run this automatically, but its useful also for document reviews",, core,anytime,Edge Case Hunter Review,ECH,,_bmad/core/tasks/review-edge-case-hunter.xml,bmad-review-edge-case-hunter,false,,,"Walk every branching path and boundary condition in code, report only unhandled edge cases. Use alongside adversarial review for orthogonal coverage - method-driven not attitude-driven.",, diff --git a/src/core/tasks/bmad-review-adversarial-general/bmad-skill-manifest.yaml b/src/core/tasks/bmad-review-adversarial-general/bmad-skill-manifest.yaml new file mode 100644 index 000000000..d0f08abdb --- /dev/null +++ b/src/core/tasks/bmad-review-adversarial-general/bmad-skill-manifest.yaml @@ -0,0 +1 @@ +type: skill diff --git a/src/core/tasks/bmad-review-adversarial-general/workflow.md b/src/core/tasks/bmad-review-adversarial-general/workflow.md new file mode 100644 index 000000000..ae75b7caa --- /dev/null +++ b/src/core/tasks/bmad-review-adversarial-general/workflow.md @@ -0,0 +1,37 @@ +--- +name: bmad-review-adversarial-general +description: 'Perform a Cynical Review and produce a findings report. Use when the user requests a critical review of something' +--- + +# Adversarial Review (General) + +**Goal:** Cynically review content and produce findings. + +**Your Role:** You are a cynical, jaded reviewer with zero patience for sloppy work. The content was submitted by a clueless weasel and you expect to find problems. Be skeptical of everything. Look for what's missing, not just what's wrong. Use a precise, professional tone — no profanity or personal attacks. + +**Inputs:** +- **content** — Content to review: diff, spec, story, doc, or any artifact +- **also_consider** (optional) — Areas to keep in mind during review alongside normal adversarial analysis + + +## EXECUTION + +### Step 1: Receive Content + +- Load the content to review from provided input or context +- If content to review is empty, ask for clarification and abort +- Identify content type (diff, branch, uncommitted changes, document, etc.) + +### Step 2: Adversarial Analysis + +Review with extreme skepticism — assume problems exist. Find at least ten issues to fix or improve in the provided content. + +### Step 3: Present Findings + +Output findings as a Markdown list (descriptions only). + + +## HALT CONDITIONS + +- HALT if zero findings — this is suspicious, re-analyze or ask for guidance +- HALT if content is empty or unreadable diff --git a/src/core/tasks/bmad-skill-manifest.yaml b/src/core/tasks/bmad-skill-manifest.yaml index 4f7e6b40e..cfe67caa5 100644 --- a/src/core/tasks/bmad-skill-manifest.yaml +++ b/src/core/tasks/bmad-skill-manifest.yaml @@ -18,11 +18,6 @@ index-docs.xml: type: task description: "Generates or updates an index.md to reference all docs in the folder" -review-adversarial-general.xml: - canonicalId: bmad-review-adversarial-general - type: task - description: "Perform a Cynical Review and produce a findings report" - review-edge-case-hunter.xml: canonicalId: bmad-review-edge-case-hunter type: task diff --git a/src/core/tasks/review-adversarial-general.xml b/src/core/tasks/review-adversarial-general.xml deleted file mode 100644 index 58551aa60..000000000 --- a/src/core/tasks/review-adversarial-general.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - Cynically review content and produce findings - - - - - - - - MANDATORY: Execute ALL steps in the flow section IN EXACT ORDER - DO NOT skip steps or change the sequence - HALT immediately when halt-conditions are met - Each action xml tag within step xml tag is a REQUIRED action to complete that step - - You are a cynical, jaded reviewer with zero patience for sloppy work - The content was submitted by a clueless weasel and you expect to find problems - Be skeptical of everything - Look for what's missing, not just what's wrong - Use a precise, professional tone - no profanity or personal attacks - - - - - Load the content to review from provided input or context - If content to review is empty, ask for clarification and abort task - Identify content type (diff, branch, uncommitted changes, document, etc.) - - - - Review with extreme skepticism - assume problems exist - Find at least ten issues to fix or improve in the provided content - - - - Output findings as a Markdown list (descriptions only) - - - - - HALT if zero findings - this is suspicious, re-analyze or ask for guidance - HALT if content is empty or unreadable - - - \ No newline at end of file diff --git a/test/adversarial-review-tests/README.md b/test/adversarial-review-tests/README.md index 8d2af5079..364359b0a 100644 --- a/test/adversarial-review-tests/README.md +++ b/test/adversarial-review-tests/README.md @@ -1,6 +1,6 @@ # Adversarial Review Test Suite -Tests for the `also_consider` optional input in `review-adversarial-general.xml`. +Tests for the `also_consider` optional input in the `bmad-review-adversarial-general` skill. ## Purpose @@ -19,12 +19,12 @@ All tests use `sample-content.md` - a deliberately imperfect User Authentication ## Running Tests -For each test case in `test-cases.yaml`, invoke the adversarial review task. +For each test case in `test-cases.yaml`, invoke the adversarial review skill. ### Manual Test Invocation ``` -Review this content using the adversarial review task: +Review this content using the adversarial review skill: [paste sample-content.md] diff --git a/test/adversarial-review-tests/test-cases.yaml b/test/adversarial-review-tests/test-cases.yaml index 7f20e84ff..0f5deefa2 100644 --- a/test/adversarial-review-tests/test-cases.yaml +++ b/test/adversarial-review-tests/test-cases.yaml @@ -1,9 +1,9 @@ -# Test Cases for review-adversarial-general.xml with also_consider input +# Test Cases for bmad-review-adversarial-general skill with also_consider input # # Purpose: Evaluate how the optional also_consider input influences review findings # Content: All tests use sample-content.md (User Authentication API docs) # -# To run: Manually invoke the task with each configuration and compare outputs +# To run: Manually invoke the skill with each configuration and compare outputs test_cases: # BASELINE - No also_consider diff --git a/tools/cli/installers/lib/core/manifest-generator.js b/tools/cli/installers/lib/core/manifest-generator.js index 34a8fbbb4..db5fef7e6 100644 --- a/tools/cli/installers/lib/core/manifest-generator.js +++ b/tools/cli/installers/lib/core/manifest-generator.js @@ -156,6 +156,10 @@ class ManifestGenerator { if (await fs.pathExists(modulePath)) { const moduleWorkflows = await this.getWorkflowsFromPath(modulePath, moduleName); this.workflows.push(...moduleWorkflows); + + // Also scan tasks/ for type:skill entries (skills can live anywhere) + const tasksSkills = await this.getWorkflowsFromPath(modulePath, moduleName, 'tasks'); + this.workflows.push(...tasksSkills); } } } @@ -163,9 +167,9 @@ class ManifestGenerator { /** * Recursively find and parse workflow.yaml and workflow.md files */ - async getWorkflowsFromPath(basePath, moduleName) { + async getWorkflowsFromPath(basePath, moduleName, subDir = 'workflows') { const workflows = []; - const workflowsPath = path.join(basePath, 'workflows'); + const workflowsPath = path.join(basePath, subDir); const debug = process.env.BMAD_DEBUG_MANIFEST === 'true'; if (debug) { @@ -246,8 +250,8 @@ class ManifestGenerator { // Build relative path for installation const installPath = moduleName === 'core' - ? `${this.bmadFolderName}/core/workflows/${relativePath}/${entry.name}` - : `${this.bmadFolderName}/${moduleName}/workflows/${relativePath}/${entry.name}`; + ? `${this.bmadFolderName}/core/${subDir}/${relativePath}/${entry.name}` + : `${this.bmadFolderName}/${moduleName}/${subDir}/${relativePath}/${entry.name}`; // Check if this is a type:skill entry — collect separately, skip workflow CSV const artifactType = this.getArtifactType(skillManifest, entry.name); From c9ebe1b41737c72e49277ddb449fbf02448ac9e8 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 07:20:03 -0600 Subject: [PATCH 06/12] chore(correct-course): convert workflow.yaml to unified workflow.md (#1858) Step 5 of 9 in yaml-to-md conversion plan. Merges workflow.yaml config (6 input_file_patterns including INDEX_GUIDED) and instructions.md execution logic into a single self-contained workflow.md. Updates references in sm.agent.yaml, pm.agent.yaml, module-help.csv, and checklist.md. Deletes workflow.yaml and instructions.md. Co-authored-by: Claude Opus 4.6 --- src/bmm/agents/pm.agent.yaml | 2 +- src/bmm/agents/sm.agent.yaml | 2 +- src/bmm/module-help.csv | 2 +- .../correct-course/checklist.md | 2 +- .../{instructions.md => workflow.md} | 91 ++++++++++++++++--- .../correct-course/workflow.yaml | 53 ----------- 6 files changed, 83 insertions(+), 69 deletions(-) rename src/bmm/workflows/4-implementation/correct-course/{instructions.md => workflow.md} (64%) delete mode 100644 src/bmm/workflows/4-implementation/correct-course/workflow.yaml diff --git a/src/bmm/agents/pm.agent.yaml b/src/bmm/agents/pm.agent.yaml index 30377a682..267797053 100644 --- a/src/bmm/agents/pm.agent.yaml +++ b/src/bmm/agents/pm.agent.yaml @@ -40,5 +40,5 @@ agent: description: "[IR] Implementation Readiness: Ensure the PRD, UX, and Architecture and Epics and Stories List are all aligned" - trigger: CC or fuzzy match on correct-course - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml" + workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" description: "[CC] Course Correction: Use this so we can determine how to proceed if major need for change is discovered mid implementation" diff --git a/src/bmm/agents/sm.agent.yaml b/src/bmm/agents/sm.agent.yaml index 48e407190..26430f175 100644 --- a/src/bmm/agents/sm.agent.yaml +++ b/src/bmm/agents/sm.agent.yaml @@ -33,5 +33,5 @@ agent: description: "[ER] Epic Retrospective: Party Mode review of all work completed across an epic." - trigger: CC or fuzzy match on correct-course - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml" + workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" description: "[CC] Course Correction: Use this so we can determine how to proceed if major need for change is discovered mid implementation" diff --git a/src/bmm/module-help.csv b/src/bmm/module-help.csv index 3981c6268..7a04cfdbd 100644 --- a/src/bmm/module-help.csv +++ b/src/bmm/module-help.csv @@ -4,7 +4,7 @@ bmm,anytime,Generate Project Context,GPC,,_bmad/bmm/workflows/generate-project-c bmm,anytime,Quick Spec,QS,,_bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md,bmad-bmm-quick-spec,false,quick-flow-solo-dev,Create Mode,"Do not suggest for potentially very complex things unless requested or if the user complains that they do not want to follow the extensive planning of the bmad method. Quick one-off tasks small changes simple apps brownfield additions to well established patterns utilities without extensive planning",planning_artifacts,"tech spec", bmm,anytime,Quick Dev,QD,,_bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md,bmad-bmm-quick-dev,false,quick-flow-solo-dev,Create Mode,"Quick one-off tasks small changes simple apps utilities without extensive planning - Do not suggest for potentially very complex things unless requested or if the user complains that they do not want to follow the extensive planning of the bmad method, unless the user is already working through the implementation phase and just requests a 1 off things not already in the plan",,, bmm,anytime,Quick Dev New Preview,QQ,,skill:bmad-quick-dev-new-preview,bmad-bmm-quick-dev-new-preview,false,quick-flow-solo-dev,Create Mode,"Unified quick flow (experimental): clarify intent plan implement review and present in a single workflow",implementation_artifacts,"tech spec implementation", -bmm,anytime,Correct Course,CC,,_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml,bmad-bmm-correct-course,false,sm,Create Mode,"Anytime: Navigate significant changes. May recommend start over update PRD redo architecture sprint planning or correct epics and stories",planning_artifacts,"change proposal", +bmm,anytime,Correct Course,CC,,_bmad/bmm/workflows/4-implementation/correct-course/workflow.md,bmad-bmm-correct-course,false,sm,Create Mode,"Anytime: Navigate significant changes. May recommend start over update PRD redo architecture sprint planning or correct epics and stories",planning_artifacts,"change proposal", bmm,anytime,Write Document,WD,,_bmad/bmm/agents/tech-writer/tech-writer.agent.yaml,,false,tech-writer,,"Describe in detail what you want, and the agent will follow the documentation best practices defined in agent memory. Multi-turn conversation with subprocess for research/review.",project-knowledge,"document", bmm,anytime,Update Standards,US,,_bmad/bmm/agents/tech-writer/tech-writer.agent.yaml,,false,tech-writer,,"Update agent memory documentation-standards.md with your specific preferences if you discover missing document conventions.",_bmad/_memory/tech-writer-sidecar,"standards", bmm,anytime,Mermaid Generate,MG,,_bmad/bmm/agents/tech-writer/tech-writer.agent.yaml,,false,tech-writer,,"Create a Mermaid diagram based on user description. Will suggest diagram types if not specified.",planning_artifacts,"mermaid diagram", diff --git a/src/bmm/workflows/4-implementation/correct-course/checklist.md b/src/bmm/workflows/4-implementation/correct-course/checklist.md index f13ab9be0..1e630ccbb 100644 --- a/src/bmm/workflows/4-implementation/correct-course/checklist.md +++ b/src/bmm/workflows/4-implementation/correct-course/checklist.md @@ -1,6 +1,6 @@ # Change Navigation Checklist -This checklist is executed as part of: {project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml +This checklist is executed as part of: {project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md Work through each section systematically with the user, recording findings and impacts diff --git a/src/bmm/workflows/4-implementation/correct-course/instructions.md b/src/bmm/workflows/4-implementation/correct-course/workflow.md similarity index 64% rename from src/bmm/workflows/4-implementation/correct-course/instructions.md rename to src/bmm/workflows/4-implementation/correct-course/workflow.md index bbe2c21e0..e95ec8432 100644 --- a/src/bmm/workflows/4-implementation/correct-course/instructions.md +++ b/src/bmm/workflows/4-implementation/correct-course/workflow.md @@ -1,11 +1,83 @@ -# Correct Course - Sprint Change Management Instructions +--- +name: correct-course +description: 'Manage significant changes during sprint execution. Use when the user says "correct course" or "propose sprint change"' +--- -The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml -You MUST have already loaded and processed: {project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml -Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level} -Generate all documents in {document_output_language} +# Correct Course - Sprint Change Management Workflow -DOCUMENT OUTPUT: Updated epics, stories, or PRD sections. Clear, actionable changes. User skill level ({user_skill_level}) affects conversation style ONLY, not document updates. +**Goal:** Manage significant changes during sprint execution by analyzing impact across all project artifacts and producing a structured Sprint Change Proposal. + +**Your Role:** You are a Scrum Master navigating change management. Analyze the triggering issue, assess impact across PRD, epics, architecture, and UX artifacts, and produce an actionable Sprint Change Proposal with clear handoff. + +--- + +## INITIALIZATION + +### Configuration Loading + +Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: + +- `project_name`, `user_name` +- `communication_language`, `document_output_language` +- `user_skill_level` +- `implementation_artifacts` +- `planning_artifacts` +- `project_knowledge` +- `date` as system-generated current datetime +- YOU MUST ALWAYS SPEAK OUTPUT in your Agent communication style with the config `{communication_language}` +- Language MUST be tailored to `{user_skill_level}` +- Generate all documents in `{document_output_language}` +- DOCUMENT OUTPUT: Updated epics, stories, or PRD sections. Clear, actionable changes. User skill level (`{user_skill_level}`) affects conversation style ONLY, not document updates. + +### Paths + +- `installed_path` = `{project-root}/_bmad/bmm/workflows/4-implementation/correct-course` +- `checklist` = `{installed_path}/checklist.md` +- `default_output_file` = `{planning_artifacts}/sprint-change-proposal-{date}.md` + +### Input Files + +| Input | Path | Load Strategy | +|-------|------|---------------| +| PRD | `{planning_artifacts}/*prd*.md` (whole) or `{planning_artifacts}/*prd*/*.md` (sharded) | FULL_LOAD | +| Epics | `{planning_artifacts}/*epic*.md` (whole) or `{planning_artifacts}/*epic*/*.md` (sharded) | FULL_LOAD | +| Architecture | `{planning_artifacts}/*architecture*.md` (whole) or `{planning_artifacts}/*architecture*/*.md` (sharded) | FULL_LOAD | +| UX Design | `{planning_artifacts}/*ux*.md` (whole) or `{planning_artifacts}/*ux*/*.md` (sharded) | FULL_LOAD | +| Tech Spec | `{planning_artifacts}/*tech-spec*.md` (whole) | FULL_LOAD | +| Document Project | `{project_knowledge}/index.md` (sharded) | INDEX_GUIDED | + +### Context + +- `project_context` = `**/project-context.md` (load if exists) + +--- + +## EXECUTION + +### Document Discovery - Loading Project Artifacts + +**Strategy**: Course correction needs broad project context to assess change impact accurately. Load all available planning artifacts. + +**Discovery Process for FULL_LOAD documents (PRD, Epics, Architecture, UX Design, Tech Spec):** + +1. **Search for whole document first** - Look for files matching the whole-document pattern (e.g., `*prd*.md`, `*epic*.md`, `*architecture*.md`, `*ux*.md`, `*tech-spec*.md`) +2. **Check for sharded version** - If whole document not found, look for a directory with `index.md` (e.g., `prd/index.md`, `epics/index.md`) +3. **If sharded version found**: + - Read `index.md` to understand the document structure + - Read ALL section files listed in the index + - Process the combined content as a single document +4. **Priority**: If both whole and sharded versions exist, use the whole document + +**Discovery Process for INDEX_GUIDED documents (Document Project):** + +1. **Search for index file** - Look for `{project_knowledge}/index.md` +2. **If found**: Read the index to understand available documentation sections +3. **Selectively load sections** based on relevance to the change being analyzed — do NOT load everything, only sections that relate to the impacted areas +4. **This document is optional** — skip if `{project_knowledge}` does not exist (greenfield projects) + +**Fuzzy matching**: Be flexible with document names — users may use variations like `prd.md`, `bmm-prd.md`, `product-requirements.md`, etc. + +**Missing documents**: Not all documents may exist. PRD and Epics are essential; Architecture, UX Design, Tech Spec, and Document Project are loaded if available. HALT if PRD or Epics cannot be found. @@ -28,11 +100,6 @@ HALT: "Need access to project documents (PRD, Epics, Architecture, UI/UX) to assess change impact. Please ensure these documents are accessible." - - - After discovery, these content variables are available: {prd_content}, {epics_content}, {architecture_content}, {ux_design_content}, {tech_spec_content}, {document_project_content} - - Read fully and follow the systematic analysis from: {checklist} Work through each checklist section interactively with the user @@ -200,7 +267,7 @@ - Specific edit proposals with before/after - Implementation handoff plan -Report workflow completion to user with personalized message: "✅ Correct Course workflow complete, {user_name}!" +Report workflow completion to user with personalized message: "Correct Course workflow complete, {user_name}!" Remind user of success criteria and next steps for implementation team diff --git a/src/bmm/workflows/4-implementation/correct-course/workflow.yaml b/src/bmm/workflows/4-implementation/correct-course/workflow.yaml deleted file mode 100644 index f2211f7b3..000000000 --- a/src/bmm/workflows/4-implementation/correct-course/workflow.yaml +++ /dev/null @@ -1,53 +0,0 @@ -# Correct Course - Sprint Change Management Workflow -name: "correct-course" -description: 'Manage significant changes during sprint execution. Use when the user says "correct course" or "propose sprint change"' - -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -user_skill_level: "{config_source}:user_skill_level" -document_output_language: "{config_source}:document_output_language" -date: system-generated -implementation_artifacts: "{config_source}:implementation_artifacts" -planning_artifacts: "{config_source}:planning_artifacts" -project_knowledge: "{config_source}:project_knowledge" -project_context: "**/project-context.md" - -# Smart input file references - handles both whole docs and sharded docs -# Priority: Whole document first, then sharded version -# Strategy: Load project context for impact analysis -input_file_patterns: - prd: - description: "Product requirements for impact analysis" - whole: "{planning_artifacts}/*prd*.md" - sharded: "{planning_artifacts}/*prd*/*.md" - load_strategy: "FULL_LOAD" - epics: - description: "All epics to analyze change impact" - whole: "{planning_artifacts}/*epic*.md" - sharded: "{planning_artifacts}/*epic*/*.md" - load_strategy: "FULL_LOAD" - architecture: - description: "System architecture and decisions" - whole: "{planning_artifacts}/*architecture*.md" - sharded: "{planning_artifacts}/*architecture*/*.md" - load_strategy: "FULL_LOAD" - ux_design: - description: "UX design specification (if UI impacts)" - whole: "{planning_artifacts}/*ux*.md" - sharded: "{planning_artifacts}/*ux*/*.md" - load_strategy: "FULL_LOAD" - tech_spec: - description: "Technical specification" - whole: "{planning_artifacts}/*tech-spec*.md" - load_strategy: "FULL_LOAD" - document_project: - description: "Brownfield project documentation (optional)" - sharded: "{project_knowledge}/index.md" - load_strategy: "INDEX_GUIDED" - -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course" -template: false -instructions: "{installed_path}/instructions.md" -checklist: "{installed_path}/checklist.md" -default_output_file: "{planning_artifacts}/sprint-change-proposal-{date}.md" From 140ae57f2a575736cba3eed2f8472d361fb1b2e2 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 09:02:06 -0600 Subject: [PATCH 07/12] feat(manifest): unified skill scanner decoupled from legacy collectors (#1859) * feat(manifest): unified skill scanner decoupled from legacy collectors Add collectSkills() that recursively walks module trees to discover type:skill directories anywhere, replacing the band-aid detection inside collectWorkflows(). Legacy collectors now skip claimed dirs. scanInstalledModules recognizes skill-only modules. Co-Authored-By: Claude Opus 4.6 * fix(manifest): address PR review findings from triage - Add missing skillClaimedDirs guard to getAgentsFromDir (F1) - Add skills to this.files[] in collectSkills (F2) - Add test for type:skill inside workflows/ dir (F5) - Warn on malformed workflow.md parse in skill dirs (F6) - Add skills count to generateManifests return value (F9) - Remove redundant \r? from regex after line normalization (F10) - Normalize path.relative to forward slashes for cross-platform (F12) - Enforce directory name as skill canonicalId, warn if manifest overrides (F13) Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- test/test-installation-components.js | 109 +++++++++ .../installers/lib/core/manifest-generator.js | 220 ++++++++++++++++-- 2 files changed, 306 insertions(+), 23 deletions(-) diff --git a/test/test-installation-components.js b/test/test-installation-components.js index 2eff6e5ee..cf075bd67 100644 --- a/test/test-installation-components.js +++ b/test/test-installation-components.js @@ -1590,6 +1590,115 @@ async function runTests() { console.log(''); + // ============================================================ + // Suite 29: Unified Skill Scanner — collectSkills + // ============================================================ + console.log(`${colors.yellow}Test Suite 29: Unified Skill Scanner${colors.reset}\n`); + + let tempFixture29; + try { + tempFixture29 = await fs.mkdtemp(path.join(os.tmpdir(), 'bmad-skill-scanner-')); + + // Create _config dir (required by manifest generator) + await fs.ensureDir(path.join(tempFixture29, '_config')); + + // --- Skill at unusual path: core/custom-area/my-skill/ --- + const skillDir29 = path.join(tempFixture29, 'core', 'custom-area', 'my-skill'); + await fs.ensureDir(skillDir29); + await fs.writeFile(path.join(skillDir29, 'bmad-skill-manifest.yaml'), 'type: skill\n'); + await fs.writeFile( + path.join(skillDir29, 'workflow.md'), + '---\nname: My Custom Skill\ndescription: A skill at an unusual path\n---\n\nSkill body content\n', + ); + + // --- Regular workflow dir: core/workflows/regular-wf/ (type: workflow) --- + const wfDir29 = path.join(tempFixture29, 'core', 'workflows', 'regular-wf'); + await fs.ensureDir(wfDir29); + await fs.writeFile(path.join(wfDir29, 'bmad-skill-manifest.yaml'), 'type: workflow\ncanonicalId: regular-wf\n'); + await fs.writeFile( + path.join(wfDir29, 'workflow.md'), + '---\nname: Regular Workflow\ndescription: A regular workflow not a skill\n---\n\nWorkflow body\n', + ); + + // --- Skill inside workflows/ dir: core/workflows/wf-skill/ (exercises findWorkflows skip logic) --- + const wfSkillDir29 = path.join(tempFixture29, 'core', 'workflows', 'wf-skill'); + await fs.ensureDir(wfSkillDir29); + await fs.writeFile(path.join(wfSkillDir29, 'bmad-skill-manifest.yaml'), 'type: skill\n'); + await fs.writeFile( + path.join(wfSkillDir29, 'workflow.md'), + '---\nname: Workflow Skill\ndescription: A skill inside workflows dir\n---\n\nSkill in workflows\n', + ); + + // --- Skill inside tasks/ dir: core/tasks/task-skill/ --- + const taskSkillDir29 = path.join(tempFixture29, 'core', 'tasks', 'task-skill'); + await fs.ensureDir(taskSkillDir29); + await fs.writeFile(path.join(taskSkillDir29, 'bmad-skill-manifest.yaml'), 'type: skill\n'); + await fs.writeFile( + path.join(taskSkillDir29, 'workflow.md'), + '---\nname: Task Skill\ndescription: A skill inside tasks dir\n---\n\nSkill in tasks\n', + ); + + // Minimal agent so core module is detected + await fs.ensureDir(path.join(tempFixture29, 'core', 'agents')); + const minimalAgent29 = 'p'; + await fs.writeFile(path.join(tempFixture29, 'core', 'agents', 'test.md'), minimalAgent29); + + const generator29 = new ManifestGenerator(); + await generator29.generateManifests(tempFixture29, ['core'], [], { ides: [] }); + + // Skill at unusual path should be in skills + const skillEntry29 = generator29.skills.find((s) => s.canonicalId === 'my-skill'); + assert(skillEntry29 !== undefined, 'Skill at unusual path appears in skills[]'); + assert(skillEntry29 && skillEntry29.name === 'My Custom Skill', 'Skill has correct name from frontmatter'); + assert( + skillEntry29 && skillEntry29.path.includes('custom-area/my-skill/workflow.md'), + 'Skill path includes relative path from module root', + ); + + // Skill should NOT be in workflows + const inWorkflows29 = generator29.workflows.find((w) => w.name === 'My Custom Skill'); + assert(inWorkflows29 === undefined, 'Skill at unusual path does NOT appear in workflows[]'); + + // Skill in tasks/ dir should be in skills + const taskSkillEntry29 = generator29.skills.find((s) => s.canonicalId === 'task-skill'); + assert(taskSkillEntry29 !== undefined, 'Skill in tasks/ dir appears in skills[]'); + + // Skill in tasks/ should NOT appear in tasks[] + const inTasks29 = generator29.tasks.find((t) => t.name === 'Task Skill'); + assert(inTasks29 === undefined, 'Skill in tasks/ dir does NOT appear in tasks[]'); + + // Regular workflow should be in workflows, NOT in skills + const regularWf29 = generator29.workflows.find((w) => w.name === 'Regular Workflow'); + assert(regularWf29 !== undefined, 'Regular type:workflow appears in workflows[]'); + + const regularInSkills29 = generator29.skills.find((s) => s.canonicalId === 'regular-wf'); + assert(regularInSkills29 === undefined, 'Regular type:workflow does NOT appear in skills[]'); + + // Skill inside workflows/ should be in skills[], NOT in workflows[] (exercises findWorkflows skip at lines 311/322) + const wfSkill29 = generator29.skills.find((s) => s.canonicalId === 'wf-skill'); + assert(wfSkill29 !== undefined, 'Skill in workflows/ dir appears in skills[]'); + const wfSkillInWorkflows29 = generator29.workflows.find((w) => w.name === 'Workflow Skill'); + assert(wfSkillInWorkflows29 === undefined, 'Skill in workflows/ dir does NOT appear in workflows[]'); + + // Test scanInstalledModules recognizes skill-only modules + const skillOnlyModDir29 = path.join(tempFixture29, 'skill-only-mod'); + await fs.ensureDir(path.join(skillOnlyModDir29, 'deep', 'nested', 'my-skill')); + await fs.writeFile(path.join(skillOnlyModDir29, 'deep', 'nested', 'my-skill', 'bmad-skill-manifest.yaml'), 'type: skill\n'); + await fs.writeFile( + path.join(skillOnlyModDir29, 'deep', 'nested', 'my-skill', 'workflow.md'), + '---\nname: Nested Skill\ndescription: desc\n---\nbody\n', + ); + + const scannedModules29 = await generator29.scanInstalledModules(tempFixture29); + assert(scannedModules29.includes('skill-only-mod'), 'scanInstalledModules recognizes skill-only module'); + } catch (error) { + assert(false, 'Unified skill scanner test succeeds', error.message); + } finally { + if (tempFixture29) await fs.remove(tempFixture29).catch(() => {}); + } + + console.log(''); + // ============================================================ // Summary // ============================================================ diff --git a/tools/cli/installers/lib/core/manifest-generator.js b/tools/cli/installers/lib/core/manifest-generator.js index db5fef7e6..8562672b5 100644 --- a/tools/cli/installers/lib/core/manifest-generator.js +++ b/tools/cli/installers/lib/core/manifest-generator.js @@ -108,6 +108,9 @@ class ManifestGenerator { // Reset files list (defensive: prevent stale data if instance is reused) this.files = []; + // Collect skills first (populates skillClaimedDirs before legacy collectors run) + await this.collectSkills(); + // Collect workflow data await this.collectWorkflows(selectedModules); @@ -132,6 +135,7 @@ class ManifestGenerator { ]; return { + skills: this.skills.length, workflows: this.workflows.length, agents: this.agents.length, tasks: this.tasks.length, @@ -141,13 +145,152 @@ class ManifestGenerator { }; } + /** + * Recursively walk a module directory tree, collecting skill directories. + * A skill directory is one that contains both a bmad-skill-manifest.yaml with + * type: skill AND a workflow.md (or workflow.yaml) file. + * Populates this.skills[] and this.skillClaimedDirs (Set of absolute paths). + */ + async collectSkills() { + this.skills = []; + this.skillClaimedDirs = new Set(); + const debug = process.env.BMAD_DEBUG_MANIFEST === 'true'; + + for (const moduleName of this.updatedModules) { + const modulePath = path.join(this.bmadDir, moduleName); + if (!(await fs.pathExists(modulePath))) continue; + + // Recursive walk skipping . and _ prefixed dirs + const walk = async (dir) => { + let entries; + try { + entries = await fs.readdir(dir, { withFileTypes: true }); + } catch { + return; + } + + // Check this directory for skill manifest + workflow file + const manifest = await this.loadSkillManifest(dir); + + // Try both workflow.md and workflow.yaml + const workflowFilenames = ['workflow.md', 'workflow.yaml']; + for (const workflowFile of workflowFilenames) { + const workflowPath = path.join(dir, workflowFile); + if (!(await fs.pathExists(workflowPath))) continue; + + const artifactType = this.getArtifactType(manifest, workflowFile); + if (artifactType !== 'skill') continue; + + // Read and parse the workflow file + try { + const rawContent = await fs.readFile(workflowPath, 'utf8'); + const content = rawContent.replaceAll('\r\n', '\n').replaceAll('\r', '\n'); + + let workflow; + if (workflowFile === 'workflow.yaml') { + workflow = yaml.parse(content); + } else { + const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/); + if (!frontmatterMatch) { + if (debug) console.log(`[DEBUG] collectSkills: skipped (no frontmatter): ${workflowPath}`); + continue; + } + workflow = yaml.parse(frontmatterMatch[1]); + } + + if (!workflow || !workflow.name || !workflow.description) { + if (debug) console.log(`[DEBUG] collectSkills: skipped (missing name/description): ${workflowPath}`); + continue; + } + + // Build path relative from module root + const relativePath = path.relative(modulePath, dir).split(path.sep).join('/'); + const installPath = relativePath + ? `${this.bmadFolderName}/${moduleName}/${relativePath}/${workflowFile}` + : `${this.bmadFolderName}/${moduleName}/${workflowFile}`; + + // Skills derive canonicalId from directory name — never from manifest + if (manifest && manifest.__single && manifest.__single.canonicalId) { + console.warn( + `Warning: Skill manifest at ${dir}/bmad-skill-manifest.yaml contains canonicalId — this field is ignored for skills (directory name is the canonical ID)`, + ); + } + const canonicalId = path.basename(dir); + + this.skills.push({ + name: workflow.name, + description: this.cleanForCSV(workflow.description), + module: moduleName, + path: installPath, + canonicalId, + install_to_bmad: this.getInstallToBmad(manifest, workflowFile), + }); + + // Add to files list + this.files.push({ + type: 'skill', + name: workflow.name, + module: moduleName, + path: installPath, + }); + + this.skillClaimedDirs.add(dir); + + if (debug) { + console.log(`[DEBUG] collectSkills: claimed skill "${workflow.name}" as ${canonicalId} at ${dir}`); + } + break; // Successfully claimed — skip remaining workflow filenames + } catch (error) { + if (debug) console.log(`[DEBUG] collectSkills: failed to parse ${workflowPath}: ${error.message}`); + } + } + + // Warn if manifest says type:skill but no workflow file found + if (manifest && !this.skillClaimedDirs.has(dir)) { + // Check if any entry in the manifest is type:skill + let hasSkillType = false; + if (manifest.__single) { + hasSkillType = manifest.__single.type === 'skill'; + } else { + for (const key of Object.keys(manifest)) { + if (manifest[key]?.type === 'skill') { + hasSkillType = true; + break; + } + } + } + if (hasSkillType && debug) { + const hasWorkflow = workflowFilenames.some((f) => entries.some((e) => e.name === f)); + if (hasWorkflow) { + console.log(`[DEBUG] collectSkills: dir has type:skill manifest but workflow file failed to parse: ${dir}`); + } else { + console.log(`[DEBUG] collectSkills: dir has type:skill manifest but no workflow.md/workflow.yaml: ${dir}`); + } + } + } + + // Recurse into subdirectories + for (const entry of entries) { + if (!entry.isDirectory()) continue; + if (entry.name.startsWith('.') || entry.name.startsWith('_')) continue; + await walk(path.join(dir, entry.name)); + } + }; + + await walk(modulePath); + } + + if (debug) { + console.log(`[DEBUG] collectSkills: total skills found: ${this.skills.length}, claimed dirs: ${this.skillClaimedDirs.size}`); + } + } + /** * Collect all workflows from core and selected modules * Scans the INSTALLED bmad directory, not the source */ async collectWorkflows(selectedModules) { this.workflows = []; - this.skills = []; // Use updatedModules which already includes deduplicated 'core' + selectedModules for (const moduleName of this.updatedModules) { @@ -185,6 +328,9 @@ class ManifestGenerator { // Recursively find workflow.yaml files const findWorkflows = async (dir, relativePath = '') => { + // Skip directories already claimed as skills + if (this.skillClaimedDirs && this.skillClaimedDirs.has(dir)) return; + const entries = await fs.readdir(dir, { withFileTypes: true }); // Load skill manifest for this directory (if present) const skillManifest = await this.loadSkillManifest(dir); @@ -193,6 +339,8 @@ class ManifestGenerator { const fullPath = path.join(dir, entry.name); if (entry.isDirectory()) { + // Skip directories claimed by collectSkills + if (this.skillClaimedDirs && this.skillClaimedDirs.has(fullPath)) continue; // Recurse into subdirectories const newRelativePath = relativePath ? `${relativePath}/${entry.name}` : entry.name; await findWorkflows(fullPath, newRelativePath); @@ -216,7 +364,7 @@ class ManifestGenerator { workflow = yaml.parse(content); } else { // Parse MD workflow with YAML frontmatter - const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/); + const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/); if (!frontmatterMatch) { if (debug) { console.log(`[DEBUG] Skipped (no frontmatter): ${fullPath}`); @@ -253,25 +401,6 @@ class ManifestGenerator { ? `${this.bmadFolderName}/core/${subDir}/${relativePath}/${entry.name}` : `${this.bmadFolderName}/${moduleName}/${subDir}/${relativePath}/${entry.name}`; - // Check if this is a type:skill entry — collect separately, skip workflow CSV - const artifactType = this.getArtifactType(skillManifest, entry.name); - if (artifactType === 'skill') { - const canonicalId = path.basename(dir); - this.skills.push({ - name: workflow.name, - description: this.cleanForCSV(workflow.description), - module: moduleName, - path: installPath, - canonicalId, - install_to_bmad: this.getInstallToBmad(skillManifest, entry.name), - }); - - if (debug) { - console.log(`[DEBUG] ✓ Added skill (skipped workflow CSV): ${workflow.name} as ${canonicalId}`); - } - continue; - } - // Workflows with standalone: false are filtered out above workflows.push({ name: workflow.name, @@ -350,6 +479,8 @@ class ManifestGenerator { * Only includes compiled .md files (not .agent.yaml source files) */ async getAgentsFromDir(dirPath, moduleName, relativePath = '') { + // Skip directories claimed by collectSkills + if (this.skillClaimedDirs && this.skillClaimedDirs.has(dirPath)) return []; const agents = []; const entries = await fs.readdir(dirPath, { withFileTypes: true }); // Load skill manifest for this directory (if present) @@ -359,6 +490,8 @@ class ManifestGenerator { const fullPath = path.join(dirPath, entry.name); if (entry.isDirectory()) { + // Skip directories claimed by collectSkills + if (this.skillClaimedDirs && this.skillClaimedDirs.has(fullPath)) continue; // Recurse into subdirectories const newRelativePath = relativePath ? `${relativePath}/${entry.name}` : entry.name; const subDirAgents = await this.getAgentsFromDir(fullPath, moduleName, newRelativePath); @@ -447,6 +580,8 @@ class ManifestGenerator { * Get tasks from a directory */ async getTasksFromDir(dirPath, moduleName) { + // Skip directories claimed by collectSkills + if (this.skillClaimedDirs && this.skillClaimedDirs.has(dirPath)) return []; const tasks = []; const files = await fs.readdir(dirPath); // Load skill manifest for this directory (if present) @@ -548,6 +683,8 @@ class ManifestGenerator { * Get tools from a directory */ async getToolsFromDir(dirPath, moduleName) { + // Skip directories claimed by collectSkills + if (this.skillClaimedDirs && this.skillClaimedDirs.has(dirPath)) return []; const tools = []; const files = await fs.readdir(dirPath); // Load skill manifest for this directory (if present) @@ -1171,8 +1308,14 @@ class ManifestGenerator { const hasTasks = await fs.pathExists(path.join(modulePath, 'tasks')); const hasTools = await fs.pathExists(path.join(modulePath, 'tools')); - // If it has any of these directories, it's likely a module - if (hasAgents || hasWorkflows || hasTasks || hasTools) { + // Check for skill-only modules: recursive scan for bmad-skill-manifest.yaml with type: skill + let hasSkills = false; + if (!hasAgents && !hasWorkflows && !hasTasks && !hasTools) { + hasSkills = await this._hasSkillManifestRecursive(modulePath); + } + + // If it has any of these directories or skill manifests, it's likely a module + if (hasAgents || hasWorkflows || hasTasks || hasTools || hasSkills) { modules.push(entry.name); } } @@ -1182,6 +1325,37 @@ class ManifestGenerator { return modules; } + + /** + * Recursively check if a directory tree contains a bmad-skill-manifest.yaml with type: skill. + * Skips directories starting with . or _. + * @param {string} dir - Directory to search + * @returns {boolean} True if a skill manifest is found + */ + async _hasSkillManifestRecursive(dir) { + let entries; + try { + entries = await fs.readdir(dir, { withFileTypes: true }); + } catch { + return false; + } + + // Check for manifest in this directory + const manifest = await this.loadSkillManifest(dir); + if (manifest) { + const type = this.getArtifactType(manifest, 'workflow.md') || this.getArtifactType(manifest, 'workflow.yaml'); + if (type === 'skill') return true; + } + + // Recurse into subdirectories + for (const entry of entries) { + if (!entry.isDirectory()) continue; + if (entry.name.startsWith('.') || entry.name.startsWith('_')) continue; + if (await this._hasSkillManifestRecursive(path.join(dir, entry.name))) return true; + } + + return false; + } } module.exports = { ManifestGenerator }; From 350a1eaa47fcce7c45c8a4972793782f7daf71a1 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 11:19:17 -0600 Subject: [PATCH 08/12] chore: convert code-review workflow.yaml to workflow.md (#1860) * chore: convert code-review workflow.yaml to workflow.md Step 6 of 9 in yaml-to-md conversion plan. Merges workflow.yaml config and instructions.xml content into a single workflow.md following the established conversion pattern. Updates agent yaml and module-help.csv references. Co-Authored-By: Claude Opus 4.6 * fix: escape folder names with backticks to fix markdownlint MD037 Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- src/bmm/agents/dev.agent.yaml | 2 +- src/bmm/agents/quick-flow-solo-dev.agent.yaml | 2 +- src/bmm/module-help.csv | 2 +- .../code-review/instructions.xml | 229 --------------- .../4-implementation/code-review/workflow.md | 271 ++++++++++++++++++ .../code-review/workflow.yaml | 43 --- 6 files changed, 274 insertions(+), 275 deletions(-) delete mode 100644 src/bmm/workflows/4-implementation/code-review/instructions.xml create mode 100644 src/bmm/workflows/4-implementation/code-review/workflow.md delete mode 100644 src/bmm/workflows/4-implementation/code-review/workflow.yaml diff --git a/src/bmm/agents/dev.agent.yaml b/src/bmm/agents/dev.agent.yaml index c707124d0..27266e483 100644 --- a/src/bmm/agents/dev.agent.yaml +++ b/src/bmm/agents/dev.agent.yaml @@ -34,5 +34,5 @@ agent: description: "[DS] Dev Story: Write the next or specified stories tests and code." - trigger: CR or fuzzy match on code-review - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml" + workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" description: "[CR] Code Review: Initiate a comprehensive code review across multiple quality facets. For best results, use a fresh context and a different quality LLM if available" diff --git a/src/bmm/agents/quick-flow-solo-dev.agent.yaml b/src/bmm/agents/quick-flow-solo-dev.agent.yaml index 553cc9d4d..72f861e8e 100644 --- a/src/bmm/agents/quick-flow-solo-dev.agent.yaml +++ b/src/bmm/agents/quick-flow-solo-dev.agent.yaml @@ -32,5 +32,5 @@ agent: description: "[QQ] Quick Dev New (Preview): Unified quick flow — clarify intent, plan, implement, review, present (experimental)" - trigger: CR or fuzzy match on code-review - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml" + workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" description: "[CR] Code Review: Initiate a comprehensive code review across multiple quality facets. For best results, use a fresh context and a different quality LLM if available" diff --git a/src/bmm/module-help.csv b/src/bmm/module-help.csv index 7a04cfdbd..df43c84cb 100644 --- a/src/bmm/module-help.csv +++ b/src/bmm/module-help.csv @@ -27,6 +27,6 @@ bmm,4-implementation,Sprint Status,SS,20,_bmad/bmm/workflows/4-implementation/sp bmm,4-implementation,Validate Story,VS,35,_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml,bmad-bmm-create-story,false,sm,Validate Mode,"Validates story readiness and completeness before development work begins",implementation_artifacts,"story validation report", bmm,4-implementation,Create Story,CS,30,_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml,bmad-bmm-create-story,true,sm,Create Mode,"Story cycle start: Prepare first found story in the sprint plan that is next, or if the command is run with a specific epic and story designation with context. Once complete, then VS then DS then CR then back to DS if needed or next CS or ER",implementation_artifacts,story, bmm,4-implementation,Dev Story,DS,40,_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml,bmad-bmm-dev-story,true,dev,Create Mode,"Story cycle: Execute story implementation tasks and tests then CR then back to DS if fixes needed",,, -bmm,4-implementation,Code Review,CR,50,_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml,bmad-bmm-code-review,false,dev,Create Mode,"Story cycle: If issues back to DS if approved then next CS or ER if epic complete",,, +bmm,4-implementation,Code Review,CR,50,_bmad/bmm/workflows/4-implementation/code-review/workflow.md,bmad-bmm-code-review,false,dev,Create Mode,"Story cycle: If issues back to DS if approved then next CS or ER if epic complete",,, bmm,4-implementation,QA Automation Test,QA,45,_bmad/bmm/workflows/qa-generate-e2e-tests/workflow.md,bmad-bmm-qa-automate,false,qa,Create Mode,"Generate automated API and E2E tests for implemented code using the project's existing test framework (detects existing well known in use test frameworks). Use after implementation to add test coverage. NOT for code review or story validation - use CR for that.",implementation_artifacts,"test suite", bmm,4-implementation,Retrospective,ER,60,_bmad/bmm/workflows/4-implementation/retrospective/workflow.md,bmad-bmm-retrospective,false,sm,Create Mode,"Optional at epic end: Review completed work lessons learned and next epic or if major issues consider CC",implementation_artifacts,retrospective, diff --git a/src/bmm/workflows/4-implementation/code-review/instructions.xml b/src/bmm/workflows/4-implementation/code-review/instructions.xml deleted file mode 100644 index 37b3eb63f..000000000 --- a/src/bmm/workflows/4-implementation/code-review/instructions.xml +++ /dev/null @@ -1,229 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level} - Generate all documents in {document_output_language} - - 🔥 YOU ARE AN ADVERSARIAL CODE REVIEWER - Find what's wrong or missing! 🔥 - Your purpose: Validate story file claims against actual implementation - Challenge everything: Are tasks marked [x] actually done? Are ACs really implemented? - Find 3-10 specific issues in every review minimum - no lazy "looks good" reviews - YOU are so much better than the dev agent - that wrote this slop - Read EVERY file in the File List - verify implementation against story requirements - Tasks marked complete but not done = CRITICAL finding - Acceptance Criteria not implemented = HIGH severity finding - Do not review files that are not part of the application's source code. Always exclude the _bmad/ and _bmad-output/ folders from the review. Always exclude IDE and CLI configuration folders like .cursor/ and .windsurf/ and .claude/ - - - - Use provided {{story_path}} or ask user which story file to review - Read COMPLETE story file - Set {{story_key}} = extracted key from filename (e.g., "1-2-user-authentication.md" → "1-2-user-authentication") or story - metadata - Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Agent Record → File List, Change Log - - - Check if git repository detected in current directory - - Run `git status --porcelain` to find uncommitted changes - Run `git diff --name-only` to see modified files - Run `git diff --cached --name-only` to see staged files - Compile list of actually changed files from git output - - - - Compare story's Dev Agent Record → File List with actual git changes - Note discrepancies: - - Files in git but not in story File List - - Files in story File List but no git changes - - Missing documentation of what was actually changed - - - - Load {project_context} for coding standards (if exists) - - - - Extract ALL Acceptance Criteria from story - Extract ALL Tasks/Subtasks with completion status ([x] vs [ ]) - From Dev Agent Record → File List, compile list of claimed changes - - Create review plan: - 1. **AC Validation**: Verify each AC is actually implemented - 2. **Task Audit**: Verify each [x] task is really done - 3. **Code Quality**: Security, performance, maintainability - 4. **Test Quality**: Real tests vs placeholder bullshit - - - - - VALIDATE EVERY CLAIM - Check git reality vs story claims - - - Review git vs story File List discrepancies: - 1. **Files changed but not in story File List** → MEDIUM finding (incomplete documentation) - 2. **Story lists files but no git changes** → HIGH finding (false claims) - 3. **Uncommitted changes not documented** → MEDIUM finding (transparency issue) - - - - Create comprehensive review file list from story File List and git changes - - - For EACH Acceptance Criterion: - 1. Read the AC requirement - 2. Search implementation files for evidence - 3. Determine: IMPLEMENTED, PARTIAL, or MISSING - 4. If MISSING/PARTIAL → HIGH SEVERITY finding - - - - For EACH task marked [x]: - 1. Read the task description - 2. Search files for evidence it was actually done - 3. **CRITICAL**: If marked [x] but NOT DONE → CRITICAL finding - 4. Record specific proof (file:line) - - - - For EACH file in comprehensive review list: - 1. **Security**: Look for injection risks, missing validation, auth issues - 2. **Performance**: N+1 queries, inefficient loops, missing caching - 3. **Error Handling**: Missing try/catch, poor error messages - 4. **Code Quality**: Complex functions, magic numbers, poor naming - 5. **Test Quality**: Are tests real assertions or placeholders? - - - - NOT LOOKING HARD ENOUGH - Find more problems! - Re-examine code for: - - Edge cases and null handling - - Architecture violations - - Documentation gaps - - Integration issues - - Dependency problems - - Git commit message quality (if applicable) - - Find at least 3 more specific, actionable issues - - - - - Categorize findings: HIGH (must fix), MEDIUM (should fix), LOW (nice to fix) - Set {{fixed_count}} = 0 - Set {{action_count}} = 0 - - **🔥 CODE REVIEW FINDINGS, {user_name}!** - - **Story:** {{story_file}} - **Git vs Story Discrepancies:** {{git_discrepancy_count}} found - **Issues Found:** {{high_count}} High, {{medium_count}} Medium, {{low_count}} Low - - ## 🔴 CRITICAL ISSUES - - Tasks marked [x] but not actually implemented - - Acceptance Criteria not implemented - - Story claims files changed but no git evidence - - Security vulnerabilities - - ## 🟡 MEDIUM ISSUES - - Files changed but not documented in story File List - - Uncommitted changes not tracked - - Performance problems - - Poor test coverage/quality - - Code maintainability issues - - ## 🟢 LOW ISSUES - - Code style improvements - - Documentation gaps - - Git commit message quality - - - What should I do with these issues? - - 1. **Fix them automatically** - I'll update the code and tests - 2. **Create action items** - Add to story Tasks/Subtasks for later - 3. **Show me details** - Deep dive into specific issues - - Choose [1], [2], or specify which issue to examine: - - - Fix all HIGH and MEDIUM issues in the code - Add/update tests as needed - Update File List in story if files changed - Update story Dev Agent Record with fixes applied - Set {{fixed_count}} = number of HIGH and MEDIUM issues fixed - Set {{action_count}} = 0 - - - - Add "Review Follow-ups (AI)" subsection to Tasks/Subtasks - For each issue: `- [ ] [AI-Review][Severity] Description [file:line]` - Set {{action_count}} = number of action items created - Set {{fixed_count}} = 0 - - - - Show detailed explanation with code examples - Return to fix decision - - - - - - - Set {{new_status}} = "done" - Update story Status field to "done" - - - Set {{new_status}} = "in-progress" - Update story Status field to "in-progress" - - Save story file - - - - Set {{current_sprint_status}} = "enabled" - - - Set {{current_sprint_status}} = "no-sprint-tracking" - - - - - Load the FULL file: {sprint_status} - Find development_status key matching {{story_key}} - - - Update development_status[{{story_key}}] = "done" - Update last_updated field to current date - Save file, preserving ALL comments and structure - ✅ Sprint status synced: {{story_key}} → done - - - - Update development_status[{{story_key}}] = "in-progress" - Update last_updated field to current date - Save file, preserving ALL comments and structure - 🔄 Sprint status synced: {{story_key}} → in-progress - - - - ⚠️ Story file updated, but sprint-status sync failed: {{story_key}} not found in sprint-status.yaml - - - - - ℹ️ Story status updated (no sprint tracking configured) - - - **✅ Review Complete!** - - **Story Status:** {{new_status}} - **Issues Fixed:** {{fixed_count}} - **Action Items Created:** {{action_count}} - - {{#if new_status == "done"}}Code review complete!{{else}}Address the action items and continue development.{{/if}} - - - - \ No newline at end of file diff --git a/src/bmm/workflows/4-implementation/code-review/workflow.md b/src/bmm/workflows/4-implementation/code-review/workflow.md new file mode 100644 index 000000000..fbfdf4cb2 --- /dev/null +++ b/src/bmm/workflows/4-implementation/code-review/workflow.md @@ -0,0 +1,271 @@ +--- +name: code-review +description: 'Perform adversarial code review finding specific issues. Use when the user says "run code review" or "review this code"' +--- + +# Code Review Workflow + +**Goal:** Perform adversarial code review finding specific issues. + +**Your Role:** Adversarial Code Reviewer. +- YOU ARE AN ADVERSARIAL CODE REVIEWER - Find what's wrong or missing! +- Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level} +- Generate all documents in {document_output_language} +- Your purpose: Validate story file claims against actual implementation +- Challenge everything: Are tasks marked [x] actually done? Are ACs really implemented? +- Find 3-10 specific issues in every review minimum - no lazy "looks good" reviews - YOU are so much better than the dev agent that wrote this slop +- Read EVERY file in the File List - verify implementation against story requirements +- Tasks marked complete but not done = CRITICAL finding +- Acceptance Criteria not implemented = HIGH severity finding +- Do not review files that are not part of the application's source code. Always exclude the `_bmad/` and `_bmad-output/` folders from the review. Always exclude IDE and CLI configuration folders like `.cursor/` and `.windsurf/` and `.claude/` + +--- + +## INITIALIZATION + +### Configuration Loading + +Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: + +- `project_name`, `user_name` +- `communication_language`, `document_output_language` +- `user_skill_level` +- `planning_artifacts`, `implementation_artifacts` +- `date` as system-generated current datetime + +### Paths + +- `installed_path` = `{project-root}/_bmad/bmm/workflows/4-implementation/code-review` +- `sprint_status` = `{implementation_artifacts}/sprint-status.yaml` +- `validation` = `{installed_path}/checklist.md` + +### Input Files + +| Input | Description | Path Pattern(s) | Load Strategy | +|-------|-------------|------------------|---------------| +| architecture | System architecture for review context | whole: `{planning_artifacts}/*architecture*.md`, sharded: `{planning_artifacts}/*architecture*/*.md` | FULL_LOAD | +| ux_design | UX design specification (if UI review) | whole: `{planning_artifacts}/*ux*.md`, sharded: `{planning_artifacts}/*ux*/*.md` | FULL_LOAD | +| epics | Epic containing story being reviewed | whole: `{planning_artifacts}/*epic*.md`, sharded_index: `{planning_artifacts}/*epic*/index.md`, sharded_single: `{planning_artifacts}/*epic*/epic-{{epic_num}}.md` | SELECTIVE_LOAD | + +### Context + +- `project_context` = `**/project-context.md` (load if exists) + +--- + +## EXECUTION + + + + + Use provided {{story_path}} or ask user which story file to review + Read COMPLETE story file + Set {{story_key}} = extracted key from filename (e.g., "1-2-user-authentication.md" → "1-2-user-authentication") or story + metadata + Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Agent Record → File List, Change Log + + + Check if git repository detected in current directory + + Run `git status --porcelain` to find uncommitted changes + Run `git diff --name-only` to see modified files + Run `git diff --cached --name-only` to see staged files + Compile list of actually changed files from git output + + + + Compare story's Dev Agent Record → File List with actual git changes + Note discrepancies: + - Files in git but not in story File List + - Files in story File List but no git changes + - Missing documentation of what was actually changed + + + + Load {project_context} for coding standards (if exists) + + + + Extract ALL Acceptance Criteria from story + Extract ALL Tasks/Subtasks with completion status ([x] vs [ ]) + From Dev Agent Record → File List, compile list of claimed changes + + Create review plan: + 1. **AC Validation**: Verify each AC is actually implemented + 2. **Task Audit**: Verify each [x] task is really done + 3. **Code Quality**: Security, performance, maintainability + 4. **Test Quality**: Real tests vs placeholder bullshit + + + + + VALIDATE EVERY CLAIM - Check git reality vs story claims + + + Review git vs story File List discrepancies: + 1. **Files changed but not in story File List** → MEDIUM finding (incomplete documentation) + 2. **Story lists files but no git changes** → HIGH finding (false claims) + 3. **Uncommitted changes not documented** → MEDIUM finding (transparency issue) + + + + Create comprehensive review file list from story File List and git changes + + + For EACH Acceptance Criterion: + 1. Read the AC requirement + 2. Search implementation files for evidence + 3. Determine: IMPLEMENTED, PARTIAL, or MISSING + 4. If MISSING/PARTIAL → HIGH SEVERITY finding + + + + For EACH task marked [x]: + 1. Read the task description + 2. Search files for evidence it was actually done + 3. **CRITICAL**: If marked [x] but NOT DONE → CRITICAL finding + 4. Record specific proof (file:line) + + + + For EACH file in comprehensive review list: + 1. **Security**: Look for injection risks, missing validation, auth issues + 2. **Performance**: N+1 queries, inefficient loops, missing caching + 3. **Error Handling**: Missing try/catch, poor error messages + 4. **Code Quality**: Complex functions, magic numbers, poor naming + 5. **Test Quality**: Are tests real assertions or placeholders? + + + + NOT LOOKING HARD ENOUGH - Find more problems! + Re-examine code for: + - Edge cases and null handling + - Architecture violations + - Documentation gaps + - Integration issues + - Dependency problems + - Git commit message quality (if applicable) + + Find at least 3 more specific, actionable issues + + + + + Categorize findings: HIGH (must fix), MEDIUM (should fix), LOW (nice to fix) + Set {{fixed_count}} = 0 + Set {{action_count}} = 0 + + **🔥 CODE REVIEW FINDINGS, {user_name}!** + + **Story:** {{story_file}} + **Git vs Story Discrepancies:** {{git_discrepancy_count}} found + **Issues Found:** {{high_count}} High, {{medium_count}} Medium, {{low_count}} Low + + ## 🔴 CRITICAL ISSUES + - Tasks marked [x] but not actually implemented + - Acceptance Criteria not implemented + - Story claims files changed but no git evidence + - Security vulnerabilities + + ## 🟡 MEDIUM ISSUES + - Files changed but not documented in story File List + - Uncommitted changes not tracked + - Performance problems + - Poor test coverage/quality + - Code maintainability issues + + ## 🟢 LOW ISSUES + - Code style improvements + - Documentation gaps + - Git commit message quality + + + What should I do with these issues? + + 1. **Fix them automatically** - I'll update the code and tests + 2. **Create action items** - Add to story Tasks/Subtasks for later + 3. **Show me details** - Deep dive into specific issues + + Choose [1], [2], or specify which issue to examine: + + + Fix all HIGH and MEDIUM issues in the code + Add/update tests as needed + Update File List in story if files changed + Update story Dev Agent Record with fixes applied + Set {{fixed_count}} = number of HIGH and MEDIUM issues fixed + Set {{action_count}} = 0 + + + + Add "Review Follow-ups (AI)" subsection to Tasks/Subtasks + For each issue: `- [ ] [AI-Review][Severity] Description [file:line]` + Set {{action_count}} = number of action items created + Set {{fixed_count}} = 0 + + + + Show detailed explanation with code examples + Return to fix decision + + + + + + + Set {{new_status}} = "done" + Update story Status field to "done" + + + Set {{new_status}} = "in-progress" + Update story Status field to "in-progress" + + Save story file + + + + Set {{current_sprint_status}} = "enabled" + + + Set {{current_sprint_status}} = "no-sprint-tracking" + + + + + Load the FULL file: {sprint_status} + Find development_status key matching {{story_key}} + + + Update development_status[{{story_key}}] = "done" + Update last_updated field to current date + Save file, preserving ALL comments and structure + ✅ Sprint status synced: {{story_key}} → done + + + + Update development_status[{{story_key}}] = "in-progress" + Update last_updated field to current date + Save file, preserving ALL comments and structure + 🔄 Sprint status synced: {{story_key}} → in-progress + + + + ⚠️ Story file updated, but sprint-status sync failed: {{story_key}} not found in sprint-status.yaml + + + + + ℹ️ Story status updated (no sprint tracking configured) + + + **✅ Review Complete!** + + **Story Status:** {{new_status}} + **Issues Fixed:** {{fixed_count}} + **Action Items Created:** {{action_count}} + + {{#if new_status == "done"}}Code review complete!{{else}}Address the action items and continue development.{{/if}} + + + + diff --git a/src/bmm/workflows/4-implementation/code-review/workflow.yaml b/src/bmm/workflows/4-implementation/code-review/workflow.yaml deleted file mode 100644 index 7965af5ae..000000000 --- a/src/bmm/workflows/4-implementation/code-review/workflow.yaml +++ /dev/null @@ -1,43 +0,0 @@ -# Review Story Workflow -name: code-review -description: 'Perform adversarial code review finding specific issues. Use when the user says "run code review" or "review this code"' - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -user_skill_level: "{config_source}:user_skill_level" -document_output_language: "{config_source}:document_output_language" -date: system-generated -planning_artifacts: "{config_source}:planning_artifacts" -implementation_artifacts: "{config_source}:implementation_artifacts" -sprint_status: "{implementation_artifacts}/sprint-status.yaml" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review" -instructions: "{installed_path}/instructions.xml" -validation: "{installed_path}/checklist.md" -template: false - -project_context: "**/project-context.md" - -# Smart input file references - handles both whole docs and sharded docs -# Priority: Whole document first, then sharded version -# Strategy: SELECTIVE LOAD - only load the specific epic needed for this story review -input_file_patterns: - architecture: - description: "System architecture for review context" - whole: "{planning_artifacts}/*architecture*.md" - sharded: "{planning_artifacts}/*architecture*/*.md" - load_strategy: "FULL_LOAD" - ux_design: - description: "UX design specification (if UI review)" - whole: "{planning_artifacts}/*ux*.md" - sharded: "{planning_artifacts}/*ux*/*.md" - load_strategy: "FULL_LOAD" - epics: - description: "Epic containing story being reviewed" - whole: "{planning_artifacts}/*epic*.md" - sharded_index: "{planning_artifacts}/*epic*/index.md" - sharded_single: "{planning_artifacts}/*epic*/epic-{{epic_num}}.md" - load_strategy: "SELECTIVE_LOAD" From 5c9227340e365b784c01dca2cd136c22844da320 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 12:08:49 -0600 Subject: [PATCH 09/12] chore: convert dev-story workflow from yaml to markdown (#1861) * chore: convert dev-story workflow from yaml to markdown format Merge workflow.yaml config and instructions.xml content into a single workflow.md, following the established conversion pattern. Drop engine scaffolding directives, preserve all behavioral constraints verbatim. Co-Authored-By: Claude Opus 4.6 * fix: update dev-story workflow references from .yaml to .md Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- src/bmm/agents/dev.agent.yaml | 2 +- src/bmm/module-help.csv | 2 +- .../4-implementation/dev-story/workflow.md | 457 ++++++++++++++++++ .../4-implementation/dev-story/workflow.yaml | 20 - 4 files changed, 459 insertions(+), 22 deletions(-) create mode 100644 src/bmm/workflows/4-implementation/dev-story/workflow.md delete mode 100644 src/bmm/workflows/4-implementation/dev-story/workflow.yaml diff --git a/src/bmm/agents/dev.agent.yaml b/src/bmm/agents/dev.agent.yaml index 27266e483..6de3d2c97 100644 --- a/src/bmm/agents/dev.agent.yaml +++ b/src/bmm/agents/dev.agent.yaml @@ -30,7 +30,7 @@ agent: menu: - trigger: DS or fuzzy match on dev-story - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml" + workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.md" description: "[DS] Dev Story: Write the next or specified stories tests and code." - trigger: CR or fuzzy match on code-review diff --git a/src/bmm/module-help.csv b/src/bmm/module-help.csv index df43c84cb..7d997329c 100644 --- a/src/bmm/module-help.csv +++ b/src/bmm/module-help.csv @@ -26,7 +26,7 @@ bmm,4-implementation,Sprint Planning,SP,10,_bmad/bmm/workflows/4-implementation/ bmm,4-implementation,Sprint Status,SS,20,_bmad/bmm/workflows/4-implementation/sprint-status/workflow.md,bmad-bmm-sprint-status,false,sm,Create Mode,"Anytime: Summarize sprint status and route to next workflow",,, bmm,4-implementation,Validate Story,VS,35,_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml,bmad-bmm-create-story,false,sm,Validate Mode,"Validates story readiness and completeness before development work begins",implementation_artifacts,"story validation report", bmm,4-implementation,Create Story,CS,30,_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml,bmad-bmm-create-story,true,sm,Create Mode,"Story cycle start: Prepare first found story in the sprint plan that is next, or if the command is run with a specific epic and story designation with context. Once complete, then VS then DS then CR then back to DS if needed or next CS or ER",implementation_artifacts,story, -bmm,4-implementation,Dev Story,DS,40,_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml,bmad-bmm-dev-story,true,dev,Create Mode,"Story cycle: Execute story implementation tasks and tests then CR then back to DS if fixes needed",,, +bmm,4-implementation,Dev Story,DS,40,_bmad/bmm/workflows/4-implementation/dev-story/workflow.md,bmad-bmm-dev-story,true,dev,Create Mode,"Story cycle: Execute story implementation tasks and tests then CR then back to DS if fixes needed",,, bmm,4-implementation,Code Review,CR,50,_bmad/bmm/workflows/4-implementation/code-review/workflow.md,bmad-bmm-code-review,false,dev,Create Mode,"Story cycle: If issues back to DS if approved then next CS or ER if epic complete",,, bmm,4-implementation,QA Automation Test,QA,45,_bmad/bmm/workflows/qa-generate-e2e-tests/workflow.md,bmad-bmm-qa-automate,false,qa,Create Mode,"Generate automated API and E2E tests for implemented code using the project's existing test framework (detects existing well known in use test frameworks). Use after implementation to add test coverage. NOT for code review or story validation - use CR for that.",implementation_artifacts,"test suite", bmm,4-implementation,Retrospective,ER,60,_bmad/bmm/workflows/4-implementation/retrospective/workflow.md,bmad-bmm-retrospective,false,sm,Create Mode,"Optional at epic end: Review completed work lessons learned and next epic or if major issues consider CC",implementation_artifacts,retrospective, diff --git a/src/bmm/workflows/4-implementation/dev-story/workflow.md b/src/bmm/workflows/4-implementation/dev-story/workflow.md new file mode 100644 index 000000000..c2200d398 --- /dev/null +++ b/src/bmm/workflows/4-implementation/dev-story/workflow.md @@ -0,0 +1,457 @@ +--- +name: dev-story +description: 'Execute story implementation following a context filled story spec file. Use when the user says "dev this story [story file]" or "implement the next story in the sprint plan"' +--- + +# Dev Story Workflow + +**Goal:** Execute story implementation following a context filled story spec file. + +**Your Role:** Developer implementing the story. +- Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level} +- Generate all documents in {document_output_language} +- Only modify the story file in these areas: Tasks/Subtasks checkboxes, Dev Agent Record (Debug Log, Completion Notes), File List, Change Log, and Status +- Execute ALL steps in exact order; do NOT skip steps +- Absolutely DO NOT stop because of "milestones", "significant progress", or "session boundaries". Continue in a single execution until the story is COMPLETE (all ACs satisfied and all tasks/subtasks checked) UNLESS a HALT condition is triggered or the USER gives other instruction. +- Do NOT schedule a "next session" or request review pauses unless a HALT condition applies. Only Step 6 decides completion. +- User skill level ({user_skill_level}) affects conversation style ONLY, not code updates. + +--- + +## INITIALIZATION + +### Configuration Loading + +Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: + +- `project_name`, `user_name` +- `communication_language`, `document_output_language` +- `user_skill_level` +- `implementation_artifacts` +- `date` as system-generated current datetime + +### Paths + +- `installed_path` = `{project-root}/_bmad/bmm/workflows/4-implementation/dev-story` +- `validation` = `{installed_path}/checklist.md` +- `story_file` = `` (explicit story path; auto-discovered if empty) +- `sprint_status` = `{implementation_artifacts}/sprint-status.yaml` + +### Context + +- `project_context` = `**/project-context.md` (load if exists) + +--- + +## EXECUTION + + + Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level} + Generate all documents in {document_output_language} + Only modify the story file in these areas: Tasks/Subtasks checkboxes, Dev Agent Record (Debug Log, Completion Notes), File List, + Change Log, and Status + Execute ALL steps in exact order; do NOT skip steps + Absolutely DO NOT stop because of "milestones", "significant progress", or "session boundaries". Continue in a single execution + until the story is COMPLETE (all ACs satisfied and all tasks/subtasks checked) UNLESS a HALT condition is triggered or the USER gives + other instruction. + Do NOT schedule a "next session" or request review pauses unless a HALT condition applies. Only Step 6 decides completion. + User skill level ({user_skill_level}) affects conversation style ONLY, not code updates. + + + + Use {{story_path}} directly + Read COMPLETE story file + Extract story_key from filename or metadata + + + + + + MUST read COMPLETE sprint-status.yaml file from start to end to preserve order + Load the FULL file: {{sprint_status}} + Read ALL lines from beginning to end - do not skip any content + Parse the development_status section completely to understand story order + + Find the FIRST story (by reading in order from top to bottom) where: + - Key matches pattern: number-number-name (e.g., "1-2-user-auth") + - NOT an epic key (epic-X) or retrospective (epic-X-retrospective) + - Status value equals "ready-for-dev" + + + + 📋 No ready-for-dev stories found in sprint-status.yaml + + **Current Sprint Status:** {{sprint_status_summary}} + + **What would you like to do?** + 1. Run `create-story` to create next story from epics with comprehensive context + 2. Run `*validate-create-story` to improve existing stories before development (recommended quality check) + 3. Specify a particular story file to develop (provide full path) + 4. Check {{sprint_status}} file to see current sprint status + + 💡 **Tip:** Stories in `ready-for-dev` may not have been validated. Consider running `validate-create-story` first for a quality + check. + + Choose option [1], [2], [3], or [4], or specify story file path: + + + HALT - Run create-story to create next story + + + + HALT - Run validate-create-story to improve existing stories + + + + Provide the story file path to develop: + Store user-provided story path as {{story_path}} + + + + + Loading {{sprint_status}} for detailed status review... + Display detailed sprint status analysis + HALT - User can review sprint status and provide story path + + + + Store user-provided story path as {{story_path}} + + + + + + + + Search {implementation_artifacts} for stories directly + Find stories with "ready-for-dev" status in files + Look for story files matching pattern: *-*-*.md + Read each candidate story file to check Status section + + + 📋 No ready-for-dev stories found + + **Available Options:** + 1. Run `create-story` to create next story from epics with comprehensive context + 2. Run `*validate-create-story` to improve existing stories + 3. Specify which story to develop + + What would you like to do? Choose option [1], [2], or [3]: + + + HALT - Run create-story to create next story + + + + HALT - Run validate-create-story to improve existing stories + + + + It's unclear what story you want developed. Please provide the full path to the story file: + Store user-provided story path as {{story_path}} + Continue with provided story file + + + + + Use discovered story file and extract story_key + + + + Store the found story_key (e.g., "1-2-user-authentication") for later status updates + Find matching story file in {implementation_artifacts} using story_key pattern: {{story_key}}.md + Read COMPLETE story file from discovered path + + + + Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Dev Agent Record, File List, Change Log, Status + + Load comprehensive context from story file's Dev Notes section + Extract developer guidance from Dev Notes: architecture requirements, previous learnings, technical specifications + Use enhanced story context to inform implementation decisions and approaches + + Identify first incomplete task (unchecked [ ]) in Tasks/Subtasks + + + Completion sequence + + HALT: "Cannot develop story without access to story file" + ASK user to clarify or HALT + + + + Load all available context to inform implementation + + Load {project_context} for coding standards and project-wide patterns (if exists) + Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Dev Agent Record, File List, Change Log, Status + Load comprehensive context from story file's Dev Notes section + Extract developer guidance from Dev Notes: architecture requirements, previous learnings, technical specifications + Use enhanced story context to inform implementation decisions and approaches + ✅ **Context Loaded** + Story and project context available for implementation + + + + + Determine if this is a fresh start or continuation after code review + + Check if "Senior Developer Review (AI)" section exists in the story file + Check if "Review Follow-ups (AI)" subsection exists under Tasks/Subtasks + + + Set review_continuation = true + Extract from "Senior Developer Review (AI)" section: + - Review outcome (Approve/Changes Requested/Blocked) + - Review date + - Total action items with checkboxes (count checked vs unchecked) + - Severity breakdown (High/Med/Low counts) + + Count unchecked [ ] review follow-up tasks in "Review Follow-ups (AI)" subsection + Store list of unchecked review items as {{pending_review_items}} + + ⏯️ **Resuming Story After Code Review** ({{review_date}}) + + **Review Outcome:** {{review_outcome}} + **Action Items:** {{unchecked_review_count}} remaining to address + **Priorities:** {{high_count}} High, {{med_count}} Medium, {{low_count}} Low + + **Strategy:** Will prioritize review follow-up tasks (marked [AI-Review]) before continuing with regular tasks. + + + + + Set review_continuation = false + Set {{pending_review_items}} = empty + + 🚀 **Starting Fresh Implementation** + + Story: {{story_key}} + Story Status: {{current_status}} + First incomplete task: {{first_task_description}} + + + + + + + Load the FULL file: {{sprint_status}} + Read all development_status entries to find {{story_key}} + Get current status value for development_status[{{story_key}}] + + + Update the story in the sprint status report to = "in-progress" + Update last_updated field to current date + 🚀 Starting work on story {{story_key}} + Status updated: ready-for-dev → in-progress + + + + + ⏯️ Resuming work on story {{story_key}} + Story is already marked in-progress + + + + + ⚠️ Unexpected story status: {{current_status}} + Expected ready-for-dev or in-progress. Continuing anyway... + + + + Store {{current_sprint_status}} for later use + + + + ℹ️ No sprint status file exists - story progress will be tracked in story file only + Set {{current_sprint_status}} = "no-sprint-tracking" + + + + + FOLLOW THE STORY FILE TASKS/SUBTASKS SEQUENCE EXACTLY AS WRITTEN - NO DEVIATION + + 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 + + + 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 + + HALT: "Additional dependencies need user approval" + HALT and request guidance + HALT: "Cannot proceed without necessary configuration files" + + NEVER implement anything not mapped to a specific task/subtask in the story file + NEVER proceed to next task until current task/subtask is complete AND tests pass + Execute continuously without pausing until all tasks/subtasks are complete or explicit HALT condition + Do NOT propose to pause for review until Step 9 completion gates are satisfied + + + + Create unit tests for business logic and core functionality introduced/changed by the task + Add integration tests for component interactions specified in story requirements + Include end-to-end tests for critical user flows when story requirements demand them + Cover edge cases and error handling scenarios identified in story Dev Notes + + + + Determine how to run tests for this repo (infer test framework from project structure) + Run all existing tests to ensure no regressions + Run the new tests to verify implementation correctness + Run linting and code quality checks if configured in project + Validate implementation meets ALL story acceptance criteria; enforce quantitative thresholds explicitly + STOP and fix before continuing - identify breaking changes immediately + STOP and fix before continuing - ensure implementation correctness + + + + NEVER mark a task complete unless ALL conditions are met - NO LYING OR CHEATING + + + Verify ALL tests for this task/subtask ACTUALLY EXIST and PASS 100% + Confirm implementation matches EXACTLY what the task/subtask specifies - no extra features + Validate that ALL acceptance criteria related to this task are satisfied + Run full test suite to ensure NO regressions introduced + + + + Extract review item details (severity, description, related AC/file) + Add to resolution tracking list: {{resolved_review_items}} + + + Mark task checkbox [x] in "Tasks/Subtasks → Review Follow-ups (AI)" section + + + Find matching action item in "Senior Developer Review (AI) → Action Items" section by matching description + Mark that action item checkbox [x] as resolved + + Add to Dev Agent Record → Completion Notes: "✅ Resolved review finding [{{severity}}]: {{description}}" + + + + + ONLY THEN mark the task (and subtasks) checkbox with [x] + Update File List section with ALL new, modified, or deleted files (paths relative to repo root) + Add completion notes to Dev Agent Record summarizing what was ACTUALLY implemented and tested + + + + DO NOT mark task complete - fix issues first + HALT if unable to fix validation failures + + + + Count total resolved review items in this session + Add Change Log entry: "Addressed code review findings - {{resolved_count}} items resolved (Date: {{date}})" + + + Save the story file + Determine if more incomplete tasks remain + + Next task + + + Completion + + + + + Verify ALL tasks and subtasks are marked [x] (re-scan the story document now) + Run the full regression suite (do not skip) + Confirm File List includes every changed file + Execute enhanced definition-of-done validation + Update the story Status to: "review" + + + Validate definition-of-done checklist with essential requirements: + - All tasks/subtasks marked complete with [x] + - Implementation satisfies every Acceptance Criterion + - Unit tests for core functionality added/updated + - Integration tests for component interactions added when required + - End-to-end tests for critical flows added when story demands them + - All tests pass (no regressions, new tests successful) + - Code quality checks pass (linting, static analysis if configured) + - File List includes every new/modified/deleted file (relative paths) + - Dev Agent Record contains implementation notes + - Change Log includes summary of changes + - Only permitted story sections were modified + + + + + Load the FULL file: {sprint_status} + Find development_status key matching {{story_key}} + Verify current status is "in-progress" (expected previous state) + Update development_status[{{story_key}}] = "review" + Update last_updated field to current date + Save file, preserving ALL comments and structure including STATUS DEFINITIONS + ✅ Story status updated to "review" in sprint-status.yaml + + + + ℹ️ Story status updated to "review" in story file (no sprint tracking configured) + + + + ⚠️ Story file updated, but sprint-status update failed: {{story_key}} not found + + Story status is set to "review" in file, but sprint-status.yaml may be out of sync. + + + + + HALT - Complete remaining tasks before marking ready for review + HALT - Fix regression issues before completing + HALT - Update File List with all changed files + HALT - Address DoD failures before completing + + + + Execute the enhanced definition-of-done checklist using the validation framework + Prepare a concise summary in Dev Agent Record → Completion Notes + + Communicate to {user_name} that story implementation is complete and ready for review + Summarize key accomplishments: story ID, story key, title, key changes made, tests added, files modified + Provide the story file path and current status (now "review") + + Based on {user_skill_level}, ask if user needs any explanations about: + - What was implemented and how it works + - Why certain technical decisions were made + - How to test or verify the changes + - Any patterns, libraries, or approaches used + - Anything else they'd like clarified + + + + Provide clear, contextual explanations tailored to {user_skill_level} + Use examples and references to specific code when helpful + + + Once explanations are complete (or user indicates no questions), suggest logical next steps + Recommended next steps (flexible based on project setup): + - Review the implemented story and test the changes + - Verify all acceptance criteria are met + - Ensure deployment readiness if applicable + - Run `code-review` workflow for peer review + - Optional: If Test Architect module installed, run `/bmad:tea:automate` to expand guardrail tests + + + 💡 **Tip:** For best results, run `code-review` using a **different** LLM than the one that implemented this story. + + Suggest checking {sprint_status} to see project progress + + Remain flexible - allow user to choose their own path or ask for other assistance + + + diff --git a/src/bmm/workflows/4-implementation/dev-story/workflow.yaml b/src/bmm/workflows/4-implementation/dev-story/workflow.yaml deleted file mode 100644 index b5ee9308a..000000000 --- a/src/bmm/workflows/4-implementation/dev-story/workflow.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: dev-story -description: 'Execute story implementation following a context filled story spec file. Use when the user says "dev this story [story file]" or "implement the next story in the sprint plan"' - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -user_skill_level: "{config_source}:user_skill_level" -document_output_language: "{config_source}:document_output_language" -date: system-generated - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/dev-story" -instructions: "{installed_path}/instructions.xml" -validation: "{installed_path}/checklist.md" - -story_file: "" # Explicit story path; auto-discovered if empty -implementation_artifacts: "{config_source}:implementation_artifacts" -sprint_status: "{implementation_artifacts}/sprint-status.yaml" -project_context: "**/project-context.md" From 0782e291fd19257ce532d2b20ad0cd4b330ceb6c Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 12:15:27 -0600 Subject: [PATCH 10/12] refactor: convert create-story workflow.yaml to workflow.md (step 7) (#1862) * refactor: convert create-story workflow.yaml to workflow.md (step 7) Merge workflow.yaml config and instructions.xml execution logic into a single self-contained workflow.md. Drop engine scaffolding directives, preserve all behavioral constraints. Update checklist.md references. Co-Authored-By: Claude Opus 4.6 * fix: update remaining workflow.yaml refs to workflow.md Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- src/bmm/agents/sm.agent.yaml | 2 +- src/bmm/module-help.csv | 4 +- .../create-story/checklist.md | 8 +- .../create-story/instructions.xml | 347 ---------------- .../4-implementation/create-story/workflow.md | 389 ++++++++++++++++++ .../create-story/workflow.yaml | 52 --- 6 files changed, 396 insertions(+), 406 deletions(-) delete mode 100644 src/bmm/workflows/4-implementation/create-story/instructions.xml create mode 100644 src/bmm/workflows/4-implementation/create-story/workflow.md delete mode 100644 src/bmm/workflows/4-implementation/create-story/workflow.yaml diff --git a/src/bmm/agents/sm.agent.yaml b/src/bmm/agents/sm.agent.yaml index 26430f175..11716df24 100644 --- a/src/bmm/agents/sm.agent.yaml +++ b/src/bmm/agents/sm.agent.yaml @@ -24,7 +24,7 @@ agent: description: "[SP] Sprint Planning: Generate or update the record that will sequence the tasks to complete the full project that the dev agent will follow" - trigger: CS or fuzzy match on create-story - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml" + workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md" description: "[CS] Context Story: Prepare a story with all required context for implementation for the developer agent" - trigger: ER or fuzzy match on epic-retrospective diff --git a/src/bmm/module-help.csv b/src/bmm/module-help.csv index 7d997329c..5872c20dd 100644 --- a/src/bmm/module-help.csv +++ b/src/bmm/module-help.csv @@ -24,8 +24,8 @@ bmm,3-solutioning,Create Epics and Stories,CE,30,_bmad/bmm/workflows/3-solutioni bmm,3-solutioning,Check Implementation Readiness,IR,70,_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/workflow.md,bmad-bmm-check-implementation-readiness,true,architect,Validate Mode,"Ensure PRD UX Architecture and Epics Stories are aligned",planning_artifacts,"readiness report", bmm,4-implementation,Sprint Planning,SP,10,_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.md,bmad-bmm-sprint-planning,true,sm,Create Mode,"Generate sprint plan for development tasks - this kicks off the implementation phase by producing a plan the implementation agents will follow in sequence for every story in the plan.",implementation_artifacts,"sprint status", bmm,4-implementation,Sprint Status,SS,20,_bmad/bmm/workflows/4-implementation/sprint-status/workflow.md,bmad-bmm-sprint-status,false,sm,Create Mode,"Anytime: Summarize sprint status and route to next workflow",,, -bmm,4-implementation,Validate Story,VS,35,_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml,bmad-bmm-create-story,false,sm,Validate Mode,"Validates story readiness and completeness before development work begins",implementation_artifacts,"story validation report", -bmm,4-implementation,Create Story,CS,30,_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml,bmad-bmm-create-story,true,sm,Create Mode,"Story cycle start: Prepare first found story in the sprint plan that is next, or if the command is run with a specific epic and story designation with context. Once complete, then VS then DS then CR then back to DS if needed or next CS or ER",implementation_artifacts,story, +bmm,4-implementation,Validate Story,VS,35,_bmad/bmm/workflows/4-implementation/create-story/workflow.md,bmad-bmm-create-story,false,sm,Validate Mode,"Validates story readiness and completeness before development work begins",implementation_artifacts,"story validation report", +bmm,4-implementation,Create Story,CS,30,_bmad/bmm/workflows/4-implementation/create-story/workflow.md,bmad-bmm-create-story,true,sm,Create Mode,"Story cycle start: Prepare first found story in the sprint plan that is next, or if the command is run with a specific epic and story designation with context. Once complete, then VS then DS then CR then back to DS if needed or next CS or ER",implementation_artifacts,story, bmm,4-implementation,Dev Story,DS,40,_bmad/bmm/workflows/4-implementation/dev-story/workflow.md,bmad-bmm-dev-story,true,dev,Create Mode,"Story cycle: Execute story implementation tasks and tests then CR then back to DS if fixes needed",,, bmm,4-implementation,Code Review,CR,50,_bmad/bmm/workflows/4-implementation/code-review/workflow.md,bmad-bmm-code-review,false,dev,Create Mode,"Story cycle: If issues back to DS if approved then next CS or ER if epic complete",,, bmm,4-implementation,QA Automation Test,QA,45,_bmad/bmm/workflows/qa-generate-e2e-tests/workflow.md,bmad-bmm-qa-automate,false,qa,Create Mode,"Generate automated API and E2E tests for implemented code using the project's existing test framework (detects existing well known in use test frameworks). Use after implementation to add test coverage. NOT for code review or story validation - use CR for that.",implementation_artifacts,"test suite", diff --git a/src/bmm/workflows/4-implementation/create-story/checklist.md b/src/bmm/workflows/4-implementation/create-story/checklist.md index d9ed06375..7b8550e2d 100644 --- a/src/bmm/workflows/4-implementation/create-story/checklist.md +++ b/src/bmm/workflows/4-implementation/create-story/checklist.md @@ -36,20 +36,20 @@ This is a COMPETITION to create the **ULTIMATE story context** that makes LLM de - The `{project-root}/_bmad/core/tasks/workflow.xml` framework will automatically: - Load this checklist file - Load the newly created story file (`{story_file_path}`) - - Load workflow variables from `{installed_path}/workflow.yaml` + - Load workflow variables from `{installed_path}/workflow.md` - Execute the validation process ### **When Running in Fresh Context:** - User should provide the story file path being reviewed - Load the story file directly -- Load the corresponding workflow.yaml for variable context +- Load the corresponding workflow.md for variable context - Proceed with systematic analysis ### **Required Inputs:** - **Story file**: The story file to review and improve -- **Workflow variables**: From workflow.yaml (implementation_artifacts, epics_file, etc.) +- **Workflow variables**: From workflow.md (implementation_artifacts, epics_file, etc.) - **Source documents**: Epics, architecture, etc. (discovered or provided) - **Validation framework**: `validate-workflow.xml` (handles checklist execution) @@ -61,7 +61,7 @@ You will systematically re-do the entire story creation process, but with a crit ### **Step 1: Load and Understand the Target** -1. **Load the workflow configuration**: `{installed_path}/workflow.yaml` for variable inclusion +1. **Load the workflow configuration**: `{installed_path}/workflow.md` for variable inclusion 2. **Load the story file**: `{story_file_path}` (provided by user or discovered) 3. **Load validation framework**: `{project-root}/_bmad/core/tasks/workflow.xml` 4. **Extract metadata**: epic_num, story_num, story_key, story_title from story file diff --git a/src/bmm/workflows/4-implementation/create-story/instructions.xml b/src/bmm/workflows/4-implementation/create-story/instructions.xml deleted file mode 100644 index efdc87c0e..000000000 --- a/src/bmm/workflows/4-implementation/create-story/instructions.xml +++ /dev/null @@ -1,347 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - Communicate all responses in {communication_language} and generate all documents in {document_output_language} - - 🔥 CRITICAL MISSION: You are creating the ULTIMATE story context engine that prevents LLM developer mistakes, omissions or - disasters! 🔥 - Your purpose is NOT to copy from epics - it's to create a comprehensive, optimized story file that gives the DEV agent - EVERYTHING needed for flawless implementation - COMMON LLM MISTAKES TO PREVENT: reinventing wheels, wrong libraries, wrong file locations, breaking regressions, ignoring UX, - vague implementations, lying about completion, not learning from past work - 🚨 EXHAUSTIVE ANALYSIS REQUIRED: You must thoroughly analyze ALL artifacts to extract critical context - do NOT be lazy or skim! - This is the most important function in the entire development process! - 🔬 UTILIZE SUBPROCESSES AND SUBAGENTS: Use research subagents, subprocesses or parallel processing if available to thoroughly - analyze different artifacts simultaneously and thoroughly - ❓ SAVE QUESTIONS: If you think of questions or clarifications during analysis, save them for the end after the complete story is - written - 🎯 ZERO USER INTERVENTION: Process should be fully automated except for initial epic/story selection or missing documents - - - - Parse user-provided story path: extract epic_num, story_num, story_title from format like "1-2-user-auth" - Set {{epic_num}}, {{story_num}}, {{story_key}} from user input - GOTO step 2a - - - Check if {{sprint_status}} file exists for auto discover - - 🚫 No sprint status file found and no story specified - - **Required Options:** - 1. Run `sprint-planning` to initialize sprint tracking (recommended) - 2. Provide specific epic-story number to create (e.g., "1-2-user-auth") - 3. Provide path to story documents if sprint status doesn't exist yet - - Choose option [1], provide epic-story number, path to story docs, or [q] to quit: - - - HALT - No work needed - - - - Run sprint-planning workflow first to create sprint-status.yaml - HALT - User needs to run sprint-planning - - - - Parse user input: extract epic_num, story_num, story_title - Set {{epic_num}}, {{story_num}}, {{story_key}} from user input - GOTO step 2a - - - - Use user-provided path for story documents - GOTO step 2a - - - - - - MUST read COMPLETE {sprint_status} file from start to end to preserve order - Load the FULL file: {{sprint_status}} - Read ALL lines from beginning to end - do not skip any content - Parse the development_status section completely - - Find the FIRST story (by reading in order from top to bottom) where: - - Key matches pattern: number-number-name (e.g., "1-2-user-auth") - - NOT an epic key (epic-X) or retrospective (epic-X-retrospective) - - Status value equals "backlog" - - - - 📋 No backlog stories found in sprint-status.yaml - - All stories are either already created, in progress, or done. - - **Options:** - 1. Run sprint-planning to refresh story tracking - 2. Load PM agent and run correct-course to add more stories - 3. Check if current sprint is complete and run retrospective - - HALT - - - Extract from found story key (e.g., "1-2-user-authentication"): - - epic_num: first number before dash (e.g., "1") - - story_num: second number after first dash (e.g., "2") - - story_title: remainder after second dash (e.g., "user-authentication") - - Set {{story_id}} = "{{epic_num}}.{{story_num}}" - Store story_key for later use (e.g., "1-2-user-authentication") - - - Check if this is the first story in epic {{epic_num}} by looking for {{epic_num}}-1-* pattern - - Load {{sprint_status}} and check epic-{{epic_num}} status - If epic status is "backlog" → update to "in-progress" - If epic status is "contexted" (legacy status) → update to "in-progress" (backward compatibility) - If epic status is "in-progress" → no change needed - - 🚫 ERROR: Cannot create story in completed epic - Epic {{epic_num}} is marked as 'done'. All stories are complete. - If you need to add more work, either: - 1. Manually change epic status back to 'in-progress' in sprint-status.yaml - 2. Create a new epic for additional work - HALT - Cannot proceed - - - 🚫 ERROR: Invalid epic status '{{epic_status}}' - Epic {{epic_num}} has invalid status. Expected: backlog, in-progress, or done - Please fix sprint-status.yaml manually or run sprint-planning to regenerate - HALT - Cannot proceed - - 📊 Epic {{epic_num}} status updated to in-progress - - - GOTO step 2a - - Load the FULL file: {{sprint_status}} - Read ALL lines from beginning to end - do not skip any content - Parse the development_status section completely - - Find the FIRST story (by reading in order from top to bottom) where: - - Key matches pattern: number-number-name (e.g., "1-2-user-auth") - - NOT an epic key (epic-X) or retrospective (epic-X-retrospective) - - Status value equals "backlog" - - - - 📋 No backlog stories found in sprint-status.yaml - - All stories are either already created, in progress, or done. - - **Options:** - 1. Run sprint-planning to refresh story tracking - 2. Load PM agent and run correct-course to add more stories - 3. Check if current sprint is complete and run retrospective - - HALT - - - Extract from found story key (e.g., "1-2-user-authentication"): - - epic_num: first number before dash (e.g., "1") - - story_num: second number after first dash (e.g., "2") - - story_title: remainder after second dash (e.g., "user-authentication") - - Set {{story_id}} = "{{epic_num}}.{{story_num}}" - Store story_key for later use (e.g., "1-2-user-authentication") - - - Check if this is the first story in epic {{epic_num}} by looking for {{epic_num}}-1-* pattern - - Load {{sprint_status}} and check epic-{{epic_num}} status - If epic status is "backlog" → update to "in-progress" - If epic status is "contexted" (legacy status) → update to "in-progress" (backward compatibility) - If epic status is "in-progress" → no change needed - - 🚫 ERROR: Cannot create story in completed epic - Epic {{epic_num}} is marked as 'done'. All stories are complete. - If you need to add more work, either: - 1. Manually change epic status back to 'in-progress' in sprint-status.yaml - 2. Create a new epic for additional work - HALT - Cannot proceed - - - 🚫 ERROR: Invalid epic status '{{epic_status}}' - Epic {{epic_num}} has invalid status. Expected: backlog, in-progress, or done - Please fix sprint-status.yaml manually or run sprint-planning to regenerate - HALT - Cannot proceed - - 📊 Epic {{epic_num}} status updated to in-progress - - - GOTO step 2a - - - - 🔬 EXHAUSTIVE ARTIFACT ANALYSIS - This is where you prevent future developer fuckups! - - - - Available content: {epics_content}, {prd_content}, {architecture_content}, {ux_content}, - {project_context} - - - From {epics_content}, extract Epic {{epic_num}} complete context: **EPIC ANALYSIS:** - Epic - objectives and business value - ALL stories in this epic for cross-story context - Our specific story's requirements, user story - statement, acceptance criteria - Technical requirements and constraints - Dependencies on other stories/epics - Source hints pointing to - original documents - Extract our story ({{epic_num}}-{{story_num}}) details: **STORY FOUNDATION:** - User story statement - (As a, I want, so that) - Detailed acceptance criteria (already BDD formatted) - Technical requirements specific to this story - - Business context and value - Success criteria - - Find {{previous_story_num}}: scan {implementation_artifacts} for the story file in epic {{epic_num}} with the highest story number less than {{story_num}} - Load previous story file: {implementation_artifacts}/{{epic_num}}-{{previous_story_num}}-*.md **PREVIOUS STORY INTELLIGENCE:** - - Dev notes and learnings from previous story - Review feedback and corrections needed - Files that were created/modified and their - patterns - Testing approaches that worked/didn't work - Problems encountered and solutions found - Code patterns established Extract - all learnings that could impact current story implementation - - - - - Get last 5 commit titles to understand recent work patterns - Analyze 1-5 most recent commits for relevance to current story: - - Files created/modified - - Code patterns and conventions used - - Library dependencies added/changed - - Architecture decisions implemented - - Testing approaches used - - Extract actionable insights for current story implementation - - - - - 🏗️ ARCHITECTURE INTELLIGENCE - Extract everything the developer MUST follow! **ARCHITECTURE DOCUMENT ANALYSIS:** Systematically - analyze architecture content for story-relevant requirements: - - - - Load complete {architecture_content} - - - Load architecture index and scan all architecture files - **CRITICAL ARCHITECTURE EXTRACTION:** For - each architecture section, determine if relevant to this story: - **Technical Stack:** Languages, frameworks, libraries with - versions - **Code Structure:** Folder organization, naming conventions, file patterns - **API Patterns:** Service structure, endpoint - patterns, data contracts - **Database Schemas:** Tables, relationships, constraints relevant to story - **Security Requirements:** - Authentication patterns, authorization rules - **Performance Requirements:** Caching strategies, optimization patterns - **Testing - Standards:** Testing frameworks, coverage expectations, test patterns - **Deployment Patterns:** Environment configurations, build - processes - **Integration Patterns:** External service integrations, data flows Extract any story-specific requirements that the - developer MUST follow - Identify any architectural decisions that override previous patterns - - - - 🌐 ENSURE LATEST TECH KNOWLEDGE - Prevent outdated implementations! **WEB INTELLIGENCE:** Identify specific - technical areas that require latest version knowledge: - - - From architecture analysis, identify specific libraries, APIs, or - frameworks - For each critical technology, research latest stable version and key changes: - - Latest API documentation and breaking changes - - Security vulnerabilities or updates - - Performance improvements or deprecations - - Best practices for current version - - **EXTERNAL CONTEXT INCLUSION:** Include in story any critical latest information the developer needs: - - Specific library versions and why chosen - - API endpoints with parameters and authentication - - Recent security patches or considerations - - Performance optimization techniques - - Migration considerations if upgrading - - - - - 📝 CREATE ULTIMATE STORY FILE - The developer's master implementation guide! - - Initialize from template.md: - {default_output_file} - story_header - - - story_requirements - - - - developer_context_section **DEV AGENT GUARDRAILS:** - technical_requirements - architecture_compliance - library_framework_requirements - - file_structure_requirements - testing_requirements - - - - previous_story_intelligence - - - - - git_intelligence_summary - - - - - latest_tech_information - - - - project_context_reference - - - - story_completion_status - - - Set story Status to: "ready-for-dev" - Add completion note: "Ultimate - context engine analysis completed - comprehensive developer guide created" - - - - Validate the newly created story file {story_file} against {installed_path}/checklist.md and apply any required fixes before finalizing - Save story document unconditionally - - - - Update {{sprint_status}} - Load the FULL file and read all development_status entries - Find development_status key matching {{story_key}} - Verify current status is "backlog" (expected previous state) - Update development_status[{{story_key}}] = "ready-for-dev" - Update last_updated field to current date - Save file, preserving ALL comments and structure including STATUS DEFINITIONS - - - Report completion - **🎯 ULTIMATE BMad Method STORY CONTEXT CREATED, {user_name}!** - - **Story Details:** - - Story ID: {{story_id}} - - Story Key: {{story_key}} - - File: {{story_file}} - - Status: ready-for-dev - - **Next Steps:** - 1. Review the comprehensive story in {{story_file}} - 2. Run dev agents `dev-story` for optimized implementation - 3. Run `code-review` when complete (auto-marks done) - 4. Optional: If Test Architect module installed, run `/bmad:tea:automate` after `dev-story` to generate guardrail tests - - **The developer now has everything needed for flawless implementation!** - - - - diff --git a/src/bmm/workflows/4-implementation/create-story/workflow.md b/src/bmm/workflows/4-implementation/create-story/workflow.md new file mode 100644 index 000000000..55556adb6 --- /dev/null +++ b/src/bmm/workflows/4-implementation/create-story/workflow.md @@ -0,0 +1,389 @@ +--- +name: create-story +description: 'Creates a dedicated story file with all the context the agent will need to implement it later. Use when the user says "create the next story" or "create story [story identifier]"' +--- + +# Create Story Workflow + +**Goal:** Create a comprehensive story file that gives the dev agent everything needed for flawless implementation. + +**Your Role:** Story context engine that prevents LLM developer mistakes, omissions, or disasters. +- Communicate all responses in {communication_language} and generate all documents in {document_output_language} +- Your purpose is NOT to copy from epics - it's to create a comprehensive, optimized story file that gives the DEV agent EVERYTHING needed for flawless implementation +- COMMON LLM MISTAKES TO PREVENT: reinventing wheels, wrong libraries, wrong file locations, breaking regressions, ignoring UX, vague implementations, lying about completion, not learning from past work +- EXHAUSTIVE ANALYSIS REQUIRED: You must thoroughly analyze ALL artifacts to extract critical context - do NOT be lazy or skim! This is the most important function in the entire development process! +- UTILIZE SUBPROCESSES AND SUBAGENTS: Use research subagents, subprocesses or parallel processing if available to thoroughly analyze different artifacts simultaneously and thoroughly +- SAVE QUESTIONS: If you think of questions or clarifications during analysis, save them for the end after the complete story is written +- ZERO USER INTERVENTION: Process should be fully automated except for initial epic/story selection or missing documents + +--- + +## INITIALIZATION + +### Configuration Loading + +Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: + +- `project_name`, `user_name` +- `communication_language`, `document_output_language` +- `user_skill_level` +- `planning_artifacts`, `implementation_artifacts` +- `date` as system-generated current datetime + +### Paths + +- `installed_path` = `{project-root}/_bmad/bmm/workflows/4-implementation/create-story` +- `template` = `{installed_path}/template.md` +- `validation` = `{installed_path}/checklist.md` +- `sprint_status` = `{implementation_artifacts}/sprint-status.yaml` +- `epics_file` = `{planning_artifacts}/epics.md` +- `prd_file` = `{planning_artifacts}/prd.md` +- `architecture_file` = `{planning_artifacts}/architecture.md` +- `ux_file` = `{planning_artifacts}/*ux*.md` +- `story_title` = "" (will be elicited if not derivable) +- `project_context` = `**/project-context.md` (load if exists) +- `default_output_file` = `{implementation_artifacts}/{{story_key}}.md` + +### Input Files + +| Input | Description | Path Pattern(s) | Load Strategy | +|-------|-------------|------------------|---------------| +| prd | PRD (fallback - epics file should have most content) | whole: `{planning_artifacts}/*prd*.md`, sharded: `{planning_artifacts}/*prd*/*.md` | SELECTIVE_LOAD | +| architecture | Architecture (fallback - epics file should have relevant sections) | whole: `{planning_artifacts}/*architecture*.md`, sharded: `{planning_artifacts}/*architecture*/*.md` | SELECTIVE_LOAD | +| ux | UX design (fallback - epics file should have relevant sections) | whole: `{planning_artifacts}/*ux*.md`, sharded: `{planning_artifacts}/*ux*/*.md` | SELECTIVE_LOAD | +| epics | Enhanced epics+stories file with BDD and source hints | whole: `{planning_artifacts}/*epic*.md`, sharded: `{planning_artifacts}/*epic*/*.md` | SELECTIVE_LOAD | + +--- + +## EXECUTION + + + + + + Parse user-provided story path: extract epic_num, story_num, story_title from format like "1-2-user-auth" + Set {{epic_num}}, {{story_num}}, {{story_key}} from user input + GOTO step 2a + + + Check if {{sprint_status}} file exists for auto discover + + 🚫 No sprint status file found and no story specified + + **Required Options:** + 1. Run `sprint-planning` to initialize sprint tracking (recommended) + 2. Provide specific epic-story number to create (e.g., "1-2-user-auth") + 3. Provide path to story documents if sprint status doesn't exist yet + + Choose option [1], provide epic-story number, path to story docs, or [q] to quit: + + + HALT - No work needed + + + + Run sprint-planning workflow first to create sprint-status.yaml + HALT - User needs to run sprint-planning + + + + Parse user input: extract epic_num, story_num, story_title + Set {{epic_num}}, {{story_num}}, {{story_key}} from user input + GOTO step 2a + + + + Use user-provided path for story documents + GOTO step 2a + + + + + + MUST read COMPLETE {sprint_status} file from start to end to preserve order + Load the FULL file: {{sprint_status}} + Read ALL lines from beginning to end - do not skip any content + Parse the development_status section completely + + Find the FIRST story (by reading in order from top to bottom) where: + - Key matches pattern: number-number-name (e.g., "1-2-user-auth") + - NOT an epic key (epic-X) or retrospective (epic-X-retrospective) + - Status value equals "backlog" + + + + 📋 No backlog stories found in sprint-status.yaml + + All stories are either already created, in progress, or done. + + **Options:** + 1. Run sprint-planning to refresh story tracking + 2. Load PM agent and run correct-course to add more stories + 3. Check if current sprint is complete and run retrospective + + HALT + + + Extract from found story key (e.g., "1-2-user-authentication"): + - epic_num: first number before dash (e.g., "1") + - story_num: second number after first dash (e.g., "2") + - story_title: remainder after second dash (e.g., "user-authentication") + + Set {{story_id}} = "{{epic_num}}.{{story_num}}" + Store story_key for later use (e.g., "1-2-user-authentication") + + + Check if this is the first story in epic {{epic_num}} by looking for {{epic_num}}-1-* pattern + + Load {{sprint_status}} and check epic-{{epic_num}} status + If epic status is "backlog" → update to "in-progress" + If epic status is "contexted" (legacy status) → update to "in-progress" (backward compatibility) + If epic status is "in-progress" → no change needed + + 🚫 ERROR: Cannot create story in completed epic + Epic {{epic_num}} is marked as 'done'. All stories are complete. + If you need to add more work, either: + 1. Manually change epic status back to 'in-progress' in sprint-status.yaml + 2. Create a new epic for additional work + HALT - Cannot proceed + + + 🚫 ERROR: Invalid epic status '{{epic_status}}' + Epic {{epic_num}} has invalid status. Expected: backlog, in-progress, or done + Please fix sprint-status.yaml manually or run sprint-planning to regenerate + HALT - Cannot proceed + + 📊 Epic {{epic_num}} status updated to in-progress + + + GOTO step 2a + + Load the FULL file: {{sprint_status}} + Read ALL lines from beginning to end - do not skip any content + Parse the development_status section completely + + Find the FIRST story (by reading in order from top to bottom) where: + - Key matches pattern: number-number-name (e.g., "1-2-user-auth") + - NOT an epic key (epic-X) or retrospective (epic-X-retrospective) + - Status value equals "backlog" + + + + No backlog stories found in sprint-status.yaml + + All stories are either already created, in progress, or done. + + **Options:** + 1. Run sprint-planning to refresh story tracking + 2. Load PM agent and run correct-course to add more stories + 3. Check if current sprint is complete and run retrospective + + HALT + + + Extract from found story key (e.g., "1-2-user-authentication"): + - epic_num: first number before dash (e.g., "1") + - story_num: second number after first dash (e.g., "2") + - story_title: remainder after second dash (e.g., "user-authentication") + + Set {{story_id}} = "{{epic_num}}.{{story_num}}" + Store story_key for later use (e.g., "1-2-user-authentication") + + + Check if this is the first story in epic {{epic_num}} by looking for {{epic_num}}-1-* pattern + + Load {{sprint_status}} and check epic-{{epic_num}} status + If epic status is "backlog" → update to "in-progress" + If epic status is "contexted" (legacy status) → update to "in-progress" (backward compatibility) + If epic status is "in-progress" → no change needed + + ERROR: Cannot create story in completed epic + Epic {{epic_num}} is marked as 'done'. All stories are complete. + If you need to add more work, either: + 1. Manually change epic status back to 'in-progress' in sprint-status.yaml + 2. Create a new epic for additional work + HALT - Cannot proceed + + + ERROR: Invalid epic status '{{epic_status}}' + Epic {{epic_num}} has invalid status. Expected: backlog, in-progress, or done + Please fix sprint-status.yaml manually or run sprint-planning to regenerate + HALT - Cannot proceed + + Epic {{epic_num}} status updated to in-progress + + + GOTO step 2a + + + + 🔬 EXHAUSTIVE ARTIFACT ANALYSIS - This is where you prevent future developer fuckups! + + + + Available content: {epics_content}, {prd_content}, {architecture_content}, {ux_content}, + {project_context} + + + From {epics_content}, extract Epic {{epic_num}} complete context: **EPIC ANALYSIS:** - Epic + objectives and business value - ALL stories in this epic for cross-story context - Our specific story's requirements, user story + statement, acceptance criteria - Technical requirements and constraints - Dependencies on other stories/epics - Source hints pointing to + original documents + Extract our story ({{epic_num}}-{{story_num}}) details: **STORY FOUNDATION:** - User story statement + (As a, I want, so that) - Detailed acceptance criteria (already BDD formatted) - Technical requirements specific to this story - + Business context and value - Success criteria + + Find {{previous_story_num}}: scan {implementation_artifacts} for the story file in epic {{epic_num}} with the highest story number less than {{story_num}} + Load previous story file: {implementation_artifacts}/{{epic_num}}-{{previous_story_num}}-*.md **PREVIOUS STORY INTELLIGENCE:** - + Dev notes and learnings from previous story - Review feedback and corrections needed - Files that were created/modified and their + patterns - Testing approaches that worked/didn't work - Problems encountered and solutions found - Code patterns established Extract + all learnings that could impact current story implementation + + + + + Get last 5 commit titles to understand recent work patterns + Analyze 1-5 most recent commits for relevance to current story: + - Files created/modified + - Code patterns and conventions used + - Library dependencies added/changed + - Architecture decisions implemented + - Testing approaches used + + Extract actionable insights for current story implementation + + + + + 🏗️ ARCHITECTURE INTELLIGENCE - Extract everything the developer MUST follow! **ARCHITECTURE DOCUMENT ANALYSIS:** Systematically + analyze architecture content for story-relevant requirements: + + + + Load complete {architecture_content} + + + Load architecture index and scan all architecture files + **CRITICAL ARCHITECTURE EXTRACTION:** For + each architecture section, determine if relevant to this story: - **Technical Stack:** Languages, frameworks, libraries with + versions - **Code Structure:** Folder organization, naming conventions, file patterns - **API Patterns:** Service structure, endpoint + patterns, data contracts - **Database Schemas:** Tables, relationships, constraints relevant to story - **Security Requirements:** + Authentication patterns, authorization rules - **Performance Requirements:** Caching strategies, optimization patterns - **Testing + Standards:** Testing frameworks, coverage expectations, test patterns - **Deployment Patterns:** Environment configurations, build + processes - **Integration Patterns:** External service integrations, data flows Extract any story-specific requirements that the + developer MUST follow + Identify any architectural decisions that override previous patterns + + + + 🌐 ENSURE LATEST TECH KNOWLEDGE - Prevent outdated implementations! **WEB INTELLIGENCE:** Identify specific + technical areas that require latest version knowledge: + + + From architecture analysis, identify specific libraries, APIs, or + frameworks + For each critical technology, research latest stable version and key changes: + - Latest API documentation and breaking changes + - Security vulnerabilities or updates + - Performance improvements or deprecations + - Best practices for current version + + **EXTERNAL CONTEXT INCLUSION:** Include in story any critical latest information the developer needs: + - Specific library versions and why chosen + - API endpoints with parameters and authentication + - Recent security patches or considerations + - Performance optimization techniques + - Migration considerations if upgrading + + + + + 📝 CREATE ULTIMATE STORY FILE - The developer's master implementation guide! + + Initialize from template.md: + {default_output_file} + story_header + + + story_requirements + + + + developer_context_section **DEV AGENT GUARDRAILS:** + technical_requirements + architecture_compliance + library_framework_requirements + + file_structure_requirements + testing_requirements + + + + previous_story_intelligence + + + + + git_intelligence_summary + + + + + latest_tech_information + + + + project_context_reference + + + + story_completion_status + + + Set story Status to: "ready-for-dev" + Add completion note: "Ultimate + context engine analysis completed - comprehensive developer guide created" + + + + Validate the newly created story file {story_file} against {installed_path}/checklist.md and apply any required fixes before finalizing + Save story document unconditionally + + + + Update {{sprint_status}} + Load the FULL file and read all development_status entries + Find development_status key matching {{story_key}} + Verify current status is "backlog" (expected previous state) + Update development_status[{{story_key}}] = "ready-for-dev" + Update last_updated field to current date + Save file, preserving ALL comments and structure including STATUS DEFINITIONS + + + Report completion + **🎯 ULTIMATE BMad Method STORY CONTEXT CREATED, {user_name}!** + + **Story Details:** + - Story ID: {{story_id}} + - Story Key: {{story_key}} + - File: {{story_file}} + - Status: ready-for-dev + + **Next Steps:** + 1. Review the comprehensive story in {{story_file}} + 2. Run dev agents `dev-story` for optimized implementation + 3. Run `code-review` when complete (auto-marks done) + 4. Optional: If Test Architect module installed, run `/bmad:tea:automate` after `dev-story` to generate guardrail tests + + **The developer now has everything needed for flawless implementation!** + + + + diff --git a/src/bmm/workflows/4-implementation/create-story/workflow.yaml b/src/bmm/workflows/4-implementation/create-story/workflow.yaml deleted file mode 100644 index 972972aff..000000000 --- a/src/bmm/workflows/4-implementation/create-story/workflow.yaml +++ /dev/null @@ -1,52 +0,0 @@ -name: create-story -description: 'Creates a dedicated story file with all the context the agent will need to implement it later. Use when the user says "create the next story" or "create story [story identifier]"' - -# Critical variables from config -config_source: "{project-root}/_bmad/bmm/config.yaml" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -document_output_language: "{config_source}:document_output_language" -user_skill_level: "{config_source}:user_skill_level" -date: system-generated -planning_artifacts: "{config_source}:planning_artifacts" -implementation_artifacts: "{config_source}:implementation_artifacts" - -# Workflow components -installed_path: "{project-root}/_bmad/bmm/workflows/4-implementation/create-story" -template: "{installed_path}/template.md" -instructions: "{installed_path}/instructions.xml" -validation: "{installed_path}/checklist.md" - -# Variables and inputs -sprint_status: "{implementation_artifacts}/sprint-status.yaml" # Primary source for story tracking -epics_file: "{planning_artifacts}/epics.md" # Enhanced epics+stories with BDD and source hints -prd_file: "{planning_artifacts}/prd.md" # Fallback for requirements (if not in epics file) -architecture_file: "{planning_artifacts}/architecture.md" # Fallback for constraints (if not in epics file) -ux_file: "{planning_artifacts}/*ux*.md" # Fallback for UX requirements (if not in epics file) -story_title: "" # Will be elicited if not derivable -project_context: "**/project-context.md" -default_output_file: "{implementation_artifacts}/{{story_key}}.md" - -# Smart input file references - Simplified for enhanced approach -# The epics+stories file should contain everything needed with source hints -input_file_patterns: - prd: - description: "PRD (fallback - epics file should have most content)" - whole: "{planning_artifacts}/*prd*.md" - sharded: "{planning_artifacts}/*prd*/*.md" - load_strategy: "SELECTIVE_LOAD" # Only load if needed - architecture: - description: "Architecture (fallback - epics file should have relevant sections)" - whole: "{planning_artifacts}/*architecture*.md" - sharded: "{planning_artifacts}/*architecture*/*.md" - load_strategy: "SELECTIVE_LOAD" # Only load if needed - ux: - description: "UX design (fallback - epics file should have relevant sections)" - whole: "{planning_artifacts}/*ux*.md" - sharded: "{planning_artifacts}/*ux*/*.md" - load_strategy: "SELECTIVE_LOAD" # Only load if needed - epics: - description: "Enhanced epics+stories file with BDD and source hints" - whole: "{planning_artifacts}/*epic*.md" - sharded: "{planning_artifacts}/*epic*/*.md" - load_strategy: "SELECTIVE_LOAD" # Only load needed epic From 4c470d99482eb0453f02d6b469f02201ddca27e3 Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 12:30:12 -0600 Subject: [PATCH 11/12] refactor: convert document-project workflow.yaml to workflow.md (step 9) (#1863) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: convert document-project workflow.yaml to workflow.md (step 9) Convert main workflow and both sub-workflows (deep-dive, full-scan) from legacy .yaml entry point format to unified .md format. Update agent files and module-help.csv references. Clean engine-scaffolding blocks from instruction files. Co-Authored-By: Claude Opus 4.6 * fix: correct config path typo bmb→bmm in sub-workflow files Both deep-dive-workflow.md and full-scan-workflow.md referenced _bmad/bmb/config.yaml instead of _bmad/bmm/config.yaml, which would break config resolution at runtime. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- src/bmm/agents/analyst.agent.yaml | 2 +- .../agents/tech-writer/tech-writer.agent.yaml | 2 +- src/bmm/module-help.csv | 2 +- .../document-project/instructions.md | 12 +++--- .../workflows/document-project/workflow.md | 39 +++++++++++++++++ .../workflows/document-project/workflow.yaml | 22 ---------- .../workflows/deep-dive-instructions.md | 1 - .../workflows/deep-dive-workflow.md | 42 +++++++++++++++++++ .../document-project/workflows/deep-dive.yaml | 31 -------------- .../workflows/full-scan-instructions.md | 1 - .../workflows/full-scan-workflow.md | 42 +++++++++++++++++++ .../document-project/workflows/full-scan.yaml | 31 -------------- 12 files changed, 131 insertions(+), 96 deletions(-) create mode 100644 src/bmm/workflows/document-project/workflow.md delete mode 100644 src/bmm/workflows/document-project/workflow.yaml create mode 100644 src/bmm/workflows/document-project/workflows/deep-dive-workflow.md delete mode 100644 src/bmm/workflows/document-project/workflows/deep-dive.yaml create mode 100644 src/bmm/workflows/document-project/workflows/full-scan-workflow.md delete mode 100644 src/bmm/workflows/document-project/workflows/full-scan.yaml diff --git a/src/bmm/agents/analyst.agent.yaml b/src/bmm/agents/analyst.agent.yaml index 28120d098..7814ee609 100644 --- a/src/bmm/agents/analyst.agent.yaml +++ b/src/bmm/agents/analyst.agent.yaml @@ -39,5 +39,5 @@ agent: description: "[CB] Create Brief: A guided experience to nail down your product idea into an executive brief" - trigger: DP or fuzzy match on document-project - workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.yaml" + workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" description: "[DP] Document Project: Analyze an existing project to produce useful documentation for both human and LLM" diff --git a/src/bmm/agents/tech-writer/tech-writer.agent.yaml b/src/bmm/agents/tech-writer/tech-writer.agent.yaml index 555bd7981..da3fe9c91 100644 --- a/src/bmm/agents/tech-writer/tech-writer.agent.yaml +++ b/src/bmm/agents/tech-writer/tech-writer.agent.yaml @@ -22,7 +22,7 @@ agent: menu: - trigger: DP or fuzzy match on document-project - workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.yaml" + workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" description: "[DP] Document Project: Generate comprehensive project documentation (brownfield analysis, architecture scanning)" - trigger: WD or fuzzy match on write-document diff --git a/src/bmm/module-help.csv b/src/bmm/module-help.csv index 5872c20dd..73482ae56 100644 --- a/src/bmm/module-help.csv +++ b/src/bmm/module-help.csv @@ -1,5 +1,5 @@ module,phase,name,code,sequence,workflow-file,command,required,agent,options,description,output-location,outputs, -bmm,anytime,Document Project,DP,,_bmad/bmm/workflows/document-project/workflow.yaml,bmad-bmm-document-project,false,analyst,Create Mode,"Analyze an existing project to produce useful documentation",project-knowledge,*, +bmm,anytime,Document Project,DP,,_bmad/bmm/workflows/document-project/workflow.md,bmad-bmm-document-project,false,analyst,Create Mode,"Analyze an existing project to produce useful documentation",project-knowledge,*, bmm,anytime,Generate Project Context,GPC,,_bmad/bmm/workflows/generate-project-context/workflow.md,bmad-bmm-generate-project-context,false,analyst,Create Mode,"Scan existing codebase to generate a lean LLM-optimized project-context.md containing critical implementation rules patterns and conventions for AI agents. Essential for brownfield projects and quick-flow.",output_folder,"project context", bmm,anytime,Quick Spec,QS,,_bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md,bmad-bmm-quick-spec,false,quick-flow-solo-dev,Create Mode,"Do not suggest for potentially very complex things unless requested or if the user complains that they do not want to follow the extensive planning of the bmad method. Quick one-off tasks small changes simple apps brownfield additions to well established patterns utilities without extensive planning",planning_artifacts,"tech spec", bmm,anytime,Quick Dev,QD,,_bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md,bmad-bmm-quick-dev,false,quick-flow-solo-dev,Create Mode,"Quick one-off tasks small changes simple apps utilities without extensive planning - Do not suggest for potentially very complex things unless requested or if the user complains that they do not want to follow the extensive planning of the bmad method, unless the user is already working through the implementation phase and just requests a 1 off things not already in the plan",,, diff --git a/src/bmm/workflows/document-project/instructions.md b/src/bmm/workflows/document-project/instructions.md index 0354be610..64f652247 100644 --- a/src/bmm/workflows/document-project/instructions.md +++ b/src/bmm/workflows/document-project/instructions.md @@ -1,7 +1,5 @@ # Document Project Workflow Router -The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml -You MUST have already loaded and processed: {project-root}/_bmad/bmm/workflows/document-project/workflow.yaml Communicate all responses in {communication_language} @@ -49,11 +47,11 @@ Display: "Resuming {{workflow_mode}} from {{current_step}} with cached project type(s): {{cached_project_types}}" - Read fully and follow: {installed_path}/workflows/deep-dive-instructions.md with resume context + Read fully and follow: {installed_path}/workflows/deep-dive-workflow.md with resume context - Read fully and follow: {installed_path}/workflows/full-scan-instructions.md with resume context + Read fully and follow: {installed_path}/workflows/full-scan-workflow.md with resume context @@ -100,7 +98,7 @@ Your choice [1/2/3]: Set workflow_mode = "full_rescan" Display: "Starting full project rescan..." - Read fully and follow: {installed_path}/workflows/full-scan-instructions.md + Read fully and follow: {installed_path}/workflows/full-scan-workflow.md After sub-workflow completes, continue to Step 4 @@ -108,7 +106,7 @@ Your choice [1/2/3]: Set workflow_mode = "deep_dive" Set scan_level = "exhaustive" Display: "Starting deep-dive documentation mode..." - Read fully and follow: {installed_path}/workflows/deep-dive-instructions.md + Read fully and follow: {installed_path}/workflows/deep-dive-workflow.md After sub-workflow completes, continue to Step 4 @@ -121,7 +119,7 @@ Your choice [1/2/3]: Set workflow_mode = "initial_scan" Display: "No existing documentation found. Starting initial project scan..." - Read fully and follow: {installed_path}/workflows/full-scan-instructions.md + Read fully and follow: {installed_path}/workflows/full-scan-workflow.md After sub-workflow completes, continue to Step 4 diff --git a/src/bmm/workflows/document-project/workflow.md b/src/bmm/workflows/document-project/workflow.md new file mode 100644 index 000000000..cd7d9d33d --- /dev/null +++ b/src/bmm/workflows/document-project/workflow.md @@ -0,0 +1,39 @@ +--- +name: document-project +description: 'Document brownfield projects for AI context. Use when the user says "document this project" or "generate project docs"' +--- + +# Document Project Workflow + +**Goal:** Document brownfield projects for AI context. + +**Your Role:** Project documentation specialist. +- Communicate all responses in {communication_language} + +--- + +## INITIALIZATION + +### Configuration Loading + +Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: + +- `project_knowledge` +- `user_name` +- `communication_language` +- `document_output_language` +- `user_skill_level` +- `date` as system-generated current datetime + +### Paths + +- `installed_path` = `{project-root}/_bmad/bmm/workflows/document-project` +- `instructions` = `{installed_path}/instructions.md` +- `validation` = `{installed_path}/checklist.md` +- `documentation_requirements_csv` = `{installed_path}/documentation-requirements.csv` + +--- + +## EXECUTION + +Read fully and follow: `{installed_path}/instructions.md` diff --git a/src/bmm/workflows/document-project/workflow.yaml b/src/bmm/workflows/document-project/workflow.yaml deleted file mode 100644 index a47acf090..000000000 --- a/src/bmm/workflows/document-project/workflow.yaml +++ /dev/null @@ -1,22 +0,0 @@ -# Document Project Workflow Configuration -name: "document-project" -version: "1.2.0" -description: 'Document brownfield projects for AI context. Use when the user says "document this project" or "generate project docs"' -author: "BMad" - -# Critical variables -config_source: "{project-root}/_bmad/bmm/config.yaml" -project_knowledge: "{config_source}:project_knowledge" -user_name: "{config_source}:user_name" -communication_language: "{config_source}:communication_language" -document_output_language: "{config_source}:document_output_language" -user_skill_level: "{config_source}:user_skill_level" -date: system-generated - -# Module path and component files -installed_path: "{project-root}/_bmad/bmm/workflows/document-project" -instructions: "{installed_path}/instructions.md" -validation: "{installed_path}/checklist.md" - -# Required data files - CRITICAL for project type detection and documentation requirements -documentation_requirements_csv: "{installed_path}/documentation-requirements.csv" diff --git a/src/bmm/workflows/document-project/workflows/deep-dive-instructions.md b/src/bmm/workflows/document-project/workflows/deep-dive-instructions.md index 637621c4c..396a2e43a 100644 --- a/src/bmm/workflows/document-project/workflows/deep-dive-instructions.md +++ b/src/bmm/workflows/document-project/workflows/deep-dive-instructions.md @@ -3,7 +3,6 @@ This workflow performs exhaustive deep-dive documentation of specific areas -Called by: ../document-project/instructions.md router Handles: deep_dive mode only diff --git a/src/bmm/workflows/document-project/workflows/deep-dive-workflow.md b/src/bmm/workflows/document-project/workflows/deep-dive-workflow.md new file mode 100644 index 000000000..fea471e6d --- /dev/null +++ b/src/bmm/workflows/document-project/workflows/deep-dive-workflow.md @@ -0,0 +1,42 @@ +--- +name: document-project-deep-dive +description: 'Exhaustive deep-dive documentation of specific project areas' +--- + +# Deep-Dive Documentation Sub-Workflow + +**Goal:** Exhaustive deep-dive documentation of specific project areas. + +**Your Role:** Deep-dive documentation specialist. +- Deep-dive mode requires literal full-file review. Sampling, guessing, or relying solely on tooling output is FORBIDDEN. + +--- + +## INITIALIZATION + +### Configuration Loading + +Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: + +- `project_knowledge` +- `user_name` +- `date` as system-generated current datetime + +### Paths + +- `installed_path` = `{project-root}/_bmad/bmm/workflows/document-project/workflows` +- `instructions` = `{installed_path}/deep-dive-instructions.md` +- `validation` = `{project-root}/_bmad/bmm/workflows/document-project/checklist.md` +- `deep_dive_template` = `{project-root}/_bmad/bmm/workflows/document-project/templates/deep-dive-template.md` + +### Runtime Inputs + +- `workflow_mode` = `deep_dive` +- `scan_level` = `exhaustive` +- `autonomous` = `false` (requires user input to select target area) + +--- + +## EXECUTION + +Read fully and follow: `{installed_path}/deep-dive-instructions.md` diff --git a/src/bmm/workflows/document-project/workflows/deep-dive.yaml b/src/bmm/workflows/document-project/workflows/deep-dive.yaml deleted file mode 100644 index c7b85c031..000000000 --- a/src/bmm/workflows/document-project/workflows/deep-dive.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Deep-Dive Documentation Workflow Configuration -name: "document-project-deep-dive" -description: "Exhaustive deep-dive documentation of specific project areas" -author: "BMad" - -# This is a sub-workflow called by document-project/workflow.yaml -parent_workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.yaml" - -# Critical variables inherited from parent -config_source: "{project-root}/_bmad/bmb/config.yaml" -project_knowledge: "{config_source}:project_knowledge" -user_name: "{config_source}:user_name" -date: system-generated - -# Module path and component files -installed_path: "{project-root}/_bmad/bmm/workflows/document-project/workflows" -template: false # Action workflow -instructions: "{installed_path}/deep-dive-instructions.md" -validation: "{project-root}/_bmad/bmm/workflows/document-project/checklist.md" - -# Templates -deep_dive_template: "{project-root}/_bmad/bmm/workflows/document-project/templates/deep-dive-template.md" - -# Runtime inputs (passed from parent workflow) -workflow_mode: "deep_dive" -scan_level: "exhaustive" # Deep-dive always uses exhaustive scan -project_root_path: "" -existing_index_path: "" # Path to existing index.md - -# Configuration -autonomous: false # Requires user input to select target area diff --git a/src/bmm/workflows/document-project/workflows/full-scan-instructions.md b/src/bmm/workflows/document-project/workflows/full-scan-instructions.md index 8a3621d21..d2a8a1e79 100644 --- a/src/bmm/workflows/document-project/workflows/full-scan-instructions.md +++ b/src/bmm/workflows/document-project/workflows/full-scan-instructions.md @@ -3,7 +3,6 @@ This workflow performs complete project documentation (Steps 1-12) -Called by: document-project/instructions.md router Handles: initial_scan and full_rescan modes diff --git a/src/bmm/workflows/document-project/workflows/full-scan-workflow.md b/src/bmm/workflows/document-project/workflows/full-scan-workflow.md new file mode 100644 index 000000000..4c26fa1a7 --- /dev/null +++ b/src/bmm/workflows/document-project/workflows/full-scan-workflow.md @@ -0,0 +1,42 @@ +--- +name: document-project-full-scan +description: 'Complete project documentation workflow (initial scan or full rescan)' +--- + +# Full Project Scan Sub-Workflow + +**Goal:** Complete project documentation (initial scan or full rescan). + +**Your Role:** Full project scan documentation specialist. + +--- + +## INITIALIZATION + +### Configuration Loading + +Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: + +- `project_knowledge` +- `user_name` +- `date` as system-generated current datetime + +### Paths + +- `installed_path` = `{project-root}/_bmad/bmm/workflows/document-project/workflows` +- `instructions` = `{installed_path}/full-scan-instructions.md` +- `validation` = `{project-root}/_bmad/bmm/workflows/document-project/checklist.md` +- `documentation_requirements_csv` = `{project-root}/_bmad/bmm/workflows/document-project/documentation-requirements.csv` + +### Runtime Inputs + +- `workflow_mode` = `""` (set by parent: `initial_scan` or `full_rescan`) +- `scan_level` = `""` (set by parent: `quick`, `deep`, or `exhaustive`) +- `resume_mode` = `false` +- `autonomous` = `false` (requires user input at key decision points) + +--- + +## EXECUTION + +Read fully and follow: `{installed_path}/full-scan-instructions.md` diff --git a/src/bmm/workflows/document-project/workflows/full-scan.yaml b/src/bmm/workflows/document-project/workflows/full-scan.yaml deleted file mode 100644 index 272baedda..000000000 --- a/src/bmm/workflows/document-project/workflows/full-scan.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# Full Project Scan Workflow Configuration -name: "document-project-full-scan" -description: "Complete project documentation workflow (initial scan or full rescan)" -author: "BMad" - -# This is a sub-workflow called by document-project/workflow.yaml -parent_workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.yaml" - -# Critical variables inherited from parent -config_source: "{project-root}/_bmad/bmb/config.yaml" -project_knowledge: "{config_source}:project_knowledge" -user_name: "{config_source}:user_name" -date: system-generated - -# Data files -documentation_requirements_csv: "{project-root}/_bmad/bmm/workflows/document-project/documentation-requirements.csv" - -# Module path and component files -installed_path: "{project-root}/_bmad/bmm/workflows/document-project/workflows" -template: false # Action workflow -instructions: "{installed_path}/full-scan-instructions.md" -validation: "{project-root}/_bmad/bmm/workflows/document-project/checklist.md" - -# Runtime inputs (passed from parent workflow) -workflow_mode: "" # "initial_scan" or "full_rescan" -scan_level: "" # "quick", "deep", or "exhaustive" -resume_mode: false -project_root_path: "" - -# Configuration -autonomous: false # Requires user input at key decision points From ee25fcca6fa3f48acf0d625914cde129771e295f Mon Sep 17 00:00:00 2001 From: Alex Verkhovsky Date: Sun, 8 Mar 2026 18:02:57 -0600 Subject: [PATCH 12/12] refactor: remove legacy YAML/XML workflow engine plumbing (#1864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(augment): remove legacy YAML/XML workflow rules from code review guidelines All workflows have been converted to markdown. Remove workflow.yaml, workflow.xml, and config_source references from Augment review rules. Drop the entire xml_workflows section (5 rules) and the YAML-specific standard_workflow_instructions rule. * refactor: extract discover_inputs protocol from workflow.xml into co-located markdown Convert the discover_inputs XML protocol (FULL_LOAD, SELECTIVE_LOAD, INDEX_GUIDED strategies) into standalone markdown files placed alongside the two workflows that use it (create-story, code-review). Replace tags with explicit file references. This decouples the workflows from workflow.xml, enabling its deletion in a follow-up. Co-Authored-By: Claude Opus 4.6 * refactor: delete dead YAML/XML workflow engine files Remove 5 files made obsolete by the workflow.yaml → workflow.md migration: - workflow.xml (the YAML workflow interpreter engine) - dev-story/instructions.xml (superseded by workflow.md) - 3 installer templates for YAML workflow command generation References in CLI code will be cleaned up in follow-up commits. Co-Authored-By: Claude Opus 4.6 * refactor: delete obsolete workflow handler fragments Co-Authored-By: Claude Opus 4.6 * refactor: remove YAML workflow code paths from CLI installer pipeline Co-Authored-By: Claude Opus 4.6 * refactor: remove workflow.xml references from manifests and checklists Co-Authored-By: Claude Opus 4.6 * docs: remove workflow.xml references from English command docs Co-Authored-By: Claude Opus 4.6 * test: update fixtures to remove workflow.yaml references Co-Authored-By: Claude Opus 4.6 * fix: update workflow.yaml example path to workflow.md in handler-multi Co-Authored-By: Claude Opus 4.6 * refactor: stop tracking workflow/validate-workflow as handler attributes These handler fragments were deleted — the exec handler already covers loading .md workflow files directly. Co-Authored-By: Claude Opus 4.6 * refactor: rename workflow attribute to exec in agent menu items Co-Authored-By: Claude Opus 4.6 * fix: address PR review findings from triage - Fix regex capture group index in module manager workflow path parsing - Remove stale workflow handler references from handler-multi.txt - Replace workflow with multi in activation-steps dispatch contract - Remove dead validate-workflow emission from compiler and xml-builder - Align commands.md wording to remove engine references - Fix relativePath anchoring in _base-ide.js recursive directory scans - Remove dead code from workflow-command-generator (unused template, generateCommandContent, writeColonArtifacts, writeDashArtifacts) - Delete unused workflow-commander.md template - Add regression test for workflow path regex --------- Co-authored-by: Claude Opus 4.6 --- .augment/code_review_guidelines.yaml | 44 +- docs/reference/commands.md | 4 +- src/bmm/agents/analyst.agent.yaml | 2 +- src/bmm/agents/dev.agent.yaml | 4 +- src/bmm/agents/pm.agent.yaml | 2 +- src/bmm/agents/qa.agent.yaml | 2 +- src/bmm/agents/quick-flow-solo-dev.agent.yaml | 2 +- src/bmm/agents/sm.agent.yaml | 8 +- .../agents/tech-writer/tech-writer.agent.yaml | 2 +- .../code-review/discover-inputs.md | 88 ++++ .../4-implementation/code-review/workflow.md | 2 +- .../create-story/checklist.md | 11 +- .../create-story/discover-inputs.md | 88 ++++ .../4-implementation/create-story/workflow.md | 3 +- .../dev-story/instructions.xml | 412 ------------------ src/core/tasks/bmad-skill-manifest.yaml | 5 - src/core/tasks/workflow.xml | 235 ---------- .../agent-components/activation-steps.txt | 2 +- .../agent-components/handler-multi.txt | 3 +- .../handler-validate-workflow.txt | 7 - .../agent-components/handler-workflow.txt | 10 - .../all-command-types.agent.yaml | 2 +- .../multiple-commands.agent.yaml | 3 +- .../valid/menu/multiple-menu-items.agent.yaml | 2 +- .../file-refs-csv/valid/bmm-style.csv | 2 +- test/test-file-refs-csv.js | 2 +- test/test-workflow-path-regex.js | 88 ++++ .../installers/lib/core/manifest-generator.js | 156 +++---- tools/cli/installers/lib/ide/_base-ide.js | 39 +- .../cli/installers/lib/ide/_config-driven.js | 12 +- .../installers/lib/ide/shared/path-utils.js | 2 +- .../ide/shared/workflow-command-generator.js | 150 +------ .../combined/default-workflow-yaml.md | 14 - .../templates/combined/kiro-workflow-yaml.md | 15 - .../templates/workflow-command-template.md | 13 - .../lib/ide/templates/workflow-commander.md | 5 - tools/cli/installers/lib/modules/manager.js | 141 +----- tools/cli/lib/agent-analyzer.js | 16 +- tools/cli/lib/agent/compiler.js | 11 +- tools/cli/lib/yaml-xml-builder.js | 19 +- tools/schema/agent.js | 4 +- 41 files changed, 407 insertions(+), 1225 deletions(-) create mode 100644 src/bmm/workflows/4-implementation/code-review/discover-inputs.md create mode 100644 src/bmm/workflows/4-implementation/create-story/discover-inputs.md delete mode 100644 src/bmm/workflows/4-implementation/dev-story/instructions.xml delete mode 100644 src/core/tasks/workflow.xml delete mode 100644 src/utility/agent-components/handler-validate-workflow.txt delete mode 100644 src/utility/agent-components/handler-workflow.txt create mode 100644 test/test-workflow-path-regex.js delete mode 100644 tools/cli/installers/lib/ide/templates/combined/default-workflow-yaml.md delete mode 100644 tools/cli/installers/lib/ide/templates/combined/kiro-workflow-yaml.md delete mode 100644 tools/cli/installers/lib/ide/templates/workflow-command-template.md delete mode 100644 tools/cli/installers/lib/ide/templates/workflow-commander.md diff --git a/.augment/code_review_guidelines.yaml b/.augment/code_review_guidelines.yaml index 02e4f2b95..d2b33ef4d 100644 --- a/.augment/code_review_guidelines.yaml +++ b/.augment/code_review_guidelines.yaml @@ -56,17 +56,13 @@ areas: - "src/**/workflows/**" rules: - id: "workflow_entry_point_required" - description: "Every workflow folder must have workflow.yaml, workflow.md, or workflow.xml as entry point" + description: "Every workflow folder must have workflow.md as entry point" severity: "high" - id: "sharded_workflow_steps_folder" description: "Sharded workflows (using workflow.md) must have steps/ folder with numbered files (step-01-*.md, step-02-*.md)" severity: "high" - - id: "standard_workflow_instructions" - description: "Standard workflows using workflow.yaml must include instructions.md for execution guidance" - severity: "medium" - - id: "workflow_step_limit" description: "Workflows should have 5-10 steps maximum to prevent context loss in LLM execution" severity: "medium" @@ -75,11 +71,9 @@ areas: # WORKFLOW ENTRY FILE RULES # ============================================ workflow_definitions: - description: "Workflow entry files (workflow.yaml, workflow.md, workflow.xml)" + description: "Workflow entry files (workflow.md)" globs: - - "src/**/workflows/**/workflow.yaml" - "src/**/workflows/**/workflow.md" - - "src/**/workflows/**/workflow.xml" rules: - id: "workflow_name_required" description: "Workflow entry files must define 'name' field in frontmatter or root element" @@ -89,10 +83,6 @@ areas: description: "Workflow entry files must include 'description' explaining the workflow's purpose" severity: "high" - - id: "workflow_config_source" - description: "Workflows should reference config_source for variable resolution (e.g., {project-root}/_bmad/module/config.yaml)" - severity: "medium" - - id: "workflow_installed_path" description: "Workflows should define installed_path for relative file references within the workflow" severity: "medium" @@ -149,35 +139,6 @@ areas: description: "Steps presenting user menus ([C] Continue, [a] Advanced, etc.) must HALT and wait for response" severity: "high" - # ============================================ - # XML WORKFLOW/TASK RULES - # ============================================ - xml_workflows: - description: "XML-based workflows and tasks" - globs: - - "src/**/workflows/**/*.xml" - - "src/**/tasks/**/*.xml" - rules: - - id: "xml_task_id_required" - description: "XML tasks must have unique 'id' attribute on root task element" - severity: "high" - - - id: "xml_llm_instructions" - description: "XML workflows should include section with critical execution instructions for the agent" - severity: "medium" - - - id: "xml_step_numbering" - description: "XML steps should use n='X' attribute for sequential numbering" - severity: "medium" - - - id: "xml_action_tags" - description: "Use for required actions, for user input (must HALT), for jumps, for conditionals" - severity: "medium" - - - id: "xml_ask_must_halt" - description: " tags require agent to HALT and wait for user response before continuing" - severity: "high" - # ============================================ # WORKFLOW CONTENT QUALITY # ============================================ @@ -185,7 +146,6 @@ areas: description: "Content quality and consistency rules for all workflow files" globs: - "src/**/workflows/**/*.md" - - "src/**/workflows/**/*.yaml" rules: - id: "communication_language_variable" description: "Workflows should use {communication_language} variable for agent output language consistency" diff --git a/docs/reference/commands.md b/docs/reference/commands.md index c61b236a7..0de99157c 100644 --- a/docs/reference/commands.md +++ b/docs/reference/commands.md @@ -27,7 +27,7 @@ The installer uses templates for each skill type: | Skill type | What the generated file does | | --- | --- | | **Agent launcher** | Loads the agent persona file, activates its menu, and stays in character | -| **Workflow skill** | Loads the workflow engine (`workflow.xml`) and passes the workflow config | +| **Workflow skill** | Loads the workflow config and follows its steps | | **Task skill** | Loads a standalone task file and follows its instructions | | **Tool skill** | Loads a standalone tool file and follows its instructions | @@ -88,7 +88,7 @@ See [Agents](./agents.md) for the full list of default agents and their triggers ### Workflow Skills -Workflow skills run a structured, multi-step process without loading an agent persona first. They load the workflow engine and pass a specific workflow configuration. +Workflow skills run a structured, multi-step process without loading an agent persona first. They load a workflow configuration and follow its steps. | Example skill | Purpose | | --- | --- | diff --git a/src/bmm/agents/analyst.agent.yaml b/src/bmm/agents/analyst.agent.yaml index 7814ee609..4767dadfa 100644 --- a/src/bmm/agents/analyst.agent.yaml +++ b/src/bmm/agents/analyst.agent.yaml @@ -39,5 +39,5 @@ agent: description: "[CB] Create Brief: A guided experience to nail down your product idea into an executive brief" - trigger: DP or fuzzy match on document-project - workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" description: "[DP] Document Project: Analyze an existing project to produce useful documentation for both human and LLM" diff --git a/src/bmm/agents/dev.agent.yaml b/src/bmm/agents/dev.agent.yaml index 6de3d2c97..6818dc968 100644 --- a/src/bmm/agents/dev.agent.yaml +++ b/src/bmm/agents/dev.agent.yaml @@ -30,9 +30,9 @@ agent: menu: - trigger: DS or fuzzy match on dev-story - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/dev-story/workflow.md" description: "[DS] Dev Story: Write the next or specified stories tests and code." - trigger: CR or fuzzy match on code-review - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" description: "[CR] Code Review: Initiate a comprehensive code review across multiple quality facets. For best results, use a fresh context and a different quality LLM if available" diff --git a/src/bmm/agents/pm.agent.yaml b/src/bmm/agents/pm.agent.yaml index 267797053..bf104246a 100644 --- a/src/bmm/agents/pm.agent.yaml +++ b/src/bmm/agents/pm.agent.yaml @@ -40,5 +40,5 @@ agent: description: "[IR] Implementation Readiness: Ensure the PRD, UX, and Architecture and Epics and Stories List are all aligned" - trigger: CC or fuzzy match on correct-course - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" description: "[CC] Course Correction: Use this so we can determine how to proceed if major need for change is discovered mid implementation" diff --git a/src/bmm/agents/qa.agent.yaml b/src/bmm/agents/qa.agent.yaml index 71ff83930..65b0711b2 100644 --- a/src/bmm/agents/qa.agent.yaml +++ b/src/bmm/agents/qa.agent.yaml @@ -29,7 +29,7 @@ agent: menu: - trigger: QA or fuzzy match on qa-automate - workflow: "{project-root}/_bmad/bmm/workflows/qa-generate-e2e-tests/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/qa-generate-e2e-tests/workflow.md" description: "[QA] Automate - Generate tests for existing features (simplified)" prompts: diff --git a/src/bmm/agents/quick-flow-solo-dev.agent.yaml b/src/bmm/agents/quick-flow-solo-dev.agent.yaml index 72f861e8e..acaab975b 100644 --- a/src/bmm/agents/quick-flow-solo-dev.agent.yaml +++ b/src/bmm/agents/quick-flow-solo-dev.agent.yaml @@ -32,5 +32,5 @@ agent: description: "[QQ] Quick Dev New (Preview): Unified quick flow — clarify intent, plan, implement, review, present (experimental)" - trigger: CR or fuzzy match on code-review - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/code-review/workflow.md" description: "[CR] Code Review: Initiate a comprehensive code review across multiple quality facets. For best results, use a fresh context and a different quality LLM if available" diff --git a/src/bmm/agents/sm.agent.yaml b/src/bmm/agents/sm.agent.yaml index 11716df24..19506fae1 100644 --- a/src/bmm/agents/sm.agent.yaml +++ b/src/bmm/agents/sm.agent.yaml @@ -20,18 +20,18 @@ agent: menu: - trigger: SP or fuzzy match on sprint-planning - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.md" description: "[SP] Sprint Planning: Generate or update the record that will sequence the tasks to complete the full project that the dev agent will follow" - trigger: CS or fuzzy match on create-story - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md" description: "[CS] Context Story: Prepare a story with all required context for implementation for the developer agent" - trigger: ER or fuzzy match on epic-retrospective - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/retrospective/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/retrospective/workflow.md" data: "{project-root}/_bmad/_config/agent-manifest.csv" description: "[ER] Epic Retrospective: Party Mode review of all work completed across an epic." - trigger: CC or fuzzy match on correct-course - workflow: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/4-implementation/correct-course/workflow.md" description: "[CC] Course Correction: Use this so we can determine how to proceed if major need for change is discovered mid implementation" diff --git a/src/bmm/agents/tech-writer/tech-writer.agent.yaml b/src/bmm/agents/tech-writer/tech-writer.agent.yaml index da3fe9c91..25f0aca06 100644 --- a/src/bmm/agents/tech-writer/tech-writer.agent.yaml +++ b/src/bmm/agents/tech-writer/tech-writer.agent.yaml @@ -22,7 +22,7 @@ agent: menu: - trigger: DP or fuzzy match on document-project - workflow: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" + exec: "{project-root}/_bmad/bmm/workflows/document-project/workflow.md" description: "[DP] Document Project: Generate comprehensive project documentation (brownfield analysis, architecture scanning)" - trigger: WD or fuzzy match on write-document diff --git a/src/bmm/workflows/4-implementation/code-review/discover-inputs.md b/src/bmm/workflows/4-implementation/code-review/discover-inputs.md new file mode 100644 index 000000000..2c313db3d --- /dev/null +++ b/src/bmm/workflows/4-implementation/code-review/discover-inputs.md @@ -0,0 +1,88 @@ +# Discover Inputs Protocol + +**Objective:** Intelligently load project files (whole or sharded) based on the workflow's Input Files configuration. + +**Prerequisite:** Only execute this protocol if the workflow defines an Input Files section. If no input file patterns are configured, skip this entirely. + +--- + +## Step 1: Parse Input File Patterns + +- Read the Input Files table from the workflow configuration. +- For each input group (prd, architecture, epics, ux, etc.), note the **load strategy** if specified. + +## Step 2: Load Files Using Smart Strategies + +For each pattern in the Input Files table, work through the following substeps in order: + +### 2a: Try Sharded Documents First + +If a sharded pattern exists for this input, determine the load strategy (defaults to **FULL_LOAD** if not specified), then apply the matching strategy: + +#### FULL_LOAD Strategy + +Load ALL files in the sharded directory. Use this for PRD, Architecture, UX, brownfield docs, or whenever the full picture is needed. + +1. Use the glob pattern to find ALL `.md` files (e.g., `{planning_artifacts}/*architecture*/*.md`). +2. Load EVERY matching file completely. +3. Concatenate content in logical order: `index.md` first if it exists, then alphabetical. +4. Store the combined result in a variable named `{pattern_name_content}` (e.g., `{architecture_content}`). + +#### SELECTIVE_LOAD Strategy + +Load a specific shard using a template variable. Example: used for epics with `{{epic_num}}`. + +1. Check for template variables in the sharded pattern (e.g., `{{epic_num}}`). +2. If the variable is undefined, ask the user for the value OR infer it from context. +3. Resolve the template to a specific file path. +4. Load that specific file. +5. Store in variable: `{pattern_name_content}`. + +#### INDEX_GUIDED Strategy + +Load index.md, analyze the structure and description of each doc in the index, then intelligently load relevant docs. + +**DO NOT BE LAZY** -- use best judgment to load documents that might have relevant information, even if there is only a 5% chance of relevance. + +1. Load `index.md` from the sharded directory. +2. Parse the table of contents, links, and section headers. +3. Analyze the workflow's purpose and objective. +4. Identify which linked/referenced documents are likely relevant. + - *Example:* If the workflow is about authentication and the index shows "Auth Overview", "Payment Setup", "Deployment" -- load the auth docs, consider deployment docs, skip payment. +5. Load all identified relevant documents. +6. Store combined content in variable: `{pattern_name_content}`. + +**When in doubt, LOAD IT** -- context is valuable, and being thorough is better than missing critical info. + +--- + +After applying the matching strategy, mark the pattern as **RESOLVED** and move to the next pattern. + +### 2b: Try Whole Document if No Sharded Found + +If no sharded matches were found OR no sharded pattern exists for this input: + +1. Attempt a glob match on the "whole" pattern (e.g., `{planning_artifacts}/*prd*.md`). +2. If matches are found, load ALL matching files completely (no offset/limit). +3. Store content in variable: `{pattern_name_content}` (e.g., `{prd_content}`). +4. Mark pattern as **RESOLVED** and move to the next pattern. + +### 2c: Handle Not Found + +If no matches were found for either sharded or whole patterns: + +1. Set `{pattern_name_content}` to empty string. +2. Note in session: "No {pattern_name} files found" -- this is not an error, just unavailable. Offer the user a chance to provide the file. + +## Step 3: Report Discovery Results + +List all loaded content variables with file counts. Example: + +``` +OK Loaded {prd_content} from 5 sharded files: prd/index.md, prd/requirements.md, ... +OK Loaded {architecture_content} from 1 file: Architecture.md +OK Loaded {epics_content} from selective load: epics/epic-3.md +-- No ux_design files found +``` + +This gives the workflow transparency into what context is available. diff --git a/src/bmm/workflows/4-implementation/code-review/workflow.md b/src/bmm/workflows/4-implementation/code-review/workflow.md index fbfdf4cb2..f4dd8188b 100644 --- a/src/bmm/workflows/4-implementation/code-review/workflow.md +++ b/src/bmm/workflows/4-implementation/code-review/workflow.md @@ -81,7 +81,7 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: - Missing documentation of what was actually changed - + Read fully and follow `{installed_path}/discover-inputs.md` to load all input files Load {project_context} for coding standards (if exists) diff --git a/src/bmm/workflows/4-implementation/create-story/checklist.md b/src/bmm/workflows/4-implementation/create-story/checklist.md index 7b8550e2d..06ad346ba 100644 --- a/src/bmm/workflows/4-implementation/create-story/checklist.md +++ b/src/bmm/workflows/4-implementation/create-story/checklist.md @@ -33,7 +33,7 @@ This is a COMPETITION to create the **ULTIMATE story context** that makes LLM de ### **When Running from Create-Story Workflow:** -- The `{project-root}/_bmad/core/tasks/workflow.xml` framework will automatically: +- The workflow framework will automatically: - Load this checklist file - Load the newly created story file (`{story_file_path}`) - Load workflow variables from `{installed_path}/workflow.md` @@ -51,7 +51,7 @@ This is a COMPETITION to create the **ULTIMATE story context** that makes LLM de - **Story file**: The story file to review and improve - **Workflow variables**: From workflow.md (implementation_artifacts, epics_file, etc.) - **Source documents**: Epics, architecture, etc. (discovered or provided) -- **Validation framework**: `validate-workflow.xml` (handles checklist execution) +- **Validation framework**: The workflow's checklist execution system --- @@ -63,10 +63,9 @@ You will systematically re-do the entire story creation process, but with a crit 1. **Load the workflow configuration**: `{installed_path}/workflow.md` for variable inclusion 2. **Load the story file**: `{story_file_path}` (provided by user or discovered) -3. **Load validation framework**: `{project-root}/_bmad/core/tasks/workflow.xml` -4. **Extract metadata**: epic_num, story_num, story_key, story_title from story file -5. **Resolve all workflow variables**: implementation_artifacts, epics_file, architecture_file, etc. -6. **Understand current status**: What story implementation guidance is currently provided? +3. **Extract metadata**: epic_num, story_num, story_key, story_title from story file +4. **Resolve all workflow variables**: implementation_artifacts, epics_file, architecture_file, etc. +5. **Understand current status**: What story implementation guidance is currently provided? **Note:** If running in fresh context, user should provide the story file path being reviewed. If running from create-story workflow, the validation framework will automatically discover the checklist and story file. diff --git a/src/bmm/workflows/4-implementation/create-story/discover-inputs.md b/src/bmm/workflows/4-implementation/create-story/discover-inputs.md new file mode 100644 index 000000000..2c313db3d --- /dev/null +++ b/src/bmm/workflows/4-implementation/create-story/discover-inputs.md @@ -0,0 +1,88 @@ +# Discover Inputs Protocol + +**Objective:** Intelligently load project files (whole or sharded) based on the workflow's Input Files configuration. + +**Prerequisite:** Only execute this protocol if the workflow defines an Input Files section. If no input file patterns are configured, skip this entirely. + +--- + +## Step 1: Parse Input File Patterns + +- Read the Input Files table from the workflow configuration. +- For each input group (prd, architecture, epics, ux, etc.), note the **load strategy** if specified. + +## Step 2: Load Files Using Smart Strategies + +For each pattern in the Input Files table, work through the following substeps in order: + +### 2a: Try Sharded Documents First + +If a sharded pattern exists for this input, determine the load strategy (defaults to **FULL_LOAD** if not specified), then apply the matching strategy: + +#### FULL_LOAD Strategy + +Load ALL files in the sharded directory. Use this for PRD, Architecture, UX, brownfield docs, or whenever the full picture is needed. + +1. Use the glob pattern to find ALL `.md` files (e.g., `{planning_artifacts}/*architecture*/*.md`). +2. Load EVERY matching file completely. +3. Concatenate content in logical order: `index.md` first if it exists, then alphabetical. +4. Store the combined result in a variable named `{pattern_name_content}` (e.g., `{architecture_content}`). + +#### SELECTIVE_LOAD Strategy + +Load a specific shard using a template variable. Example: used for epics with `{{epic_num}}`. + +1. Check for template variables in the sharded pattern (e.g., `{{epic_num}}`). +2. If the variable is undefined, ask the user for the value OR infer it from context. +3. Resolve the template to a specific file path. +4. Load that specific file. +5. Store in variable: `{pattern_name_content}`. + +#### INDEX_GUIDED Strategy + +Load index.md, analyze the structure and description of each doc in the index, then intelligently load relevant docs. + +**DO NOT BE LAZY** -- use best judgment to load documents that might have relevant information, even if there is only a 5% chance of relevance. + +1. Load `index.md` from the sharded directory. +2. Parse the table of contents, links, and section headers. +3. Analyze the workflow's purpose and objective. +4. Identify which linked/referenced documents are likely relevant. + - *Example:* If the workflow is about authentication and the index shows "Auth Overview", "Payment Setup", "Deployment" -- load the auth docs, consider deployment docs, skip payment. +5. Load all identified relevant documents. +6. Store combined content in variable: `{pattern_name_content}`. + +**When in doubt, LOAD IT** -- context is valuable, and being thorough is better than missing critical info. + +--- + +After applying the matching strategy, mark the pattern as **RESOLVED** and move to the next pattern. + +### 2b: Try Whole Document if No Sharded Found + +If no sharded matches were found OR no sharded pattern exists for this input: + +1. Attempt a glob match on the "whole" pattern (e.g., `{planning_artifacts}/*prd*.md`). +2. If matches are found, load ALL matching files completely (no offset/limit). +3. Store content in variable: `{pattern_name_content}` (e.g., `{prd_content}`). +4. Mark pattern as **RESOLVED** and move to the next pattern. + +### 2c: Handle Not Found + +If no matches were found for either sharded or whole patterns: + +1. Set `{pattern_name_content}` to empty string. +2. Note in session: "No {pattern_name} files found" -- this is not an error, just unavailable. Offer the user a chance to provide the file. + +## Step 3: Report Discovery Results + +List all loaded content variables with file counts. Example: + +``` +OK Loaded {prd_content} from 5 sharded files: prd/index.md, prd/requirements.md, ... +OK Loaded {architecture_content} from 1 file: Architecture.md +OK Loaded {epics_content} from selective load: epics/epic-3.md +-- No ux_design files found +``` + +This gives the workflow transparency into what context is available. diff --git a/src/bmm/workflows/4-implementation/create-story/workflow.md b/src/bmm/workflows/4-implementation/create-story/workflow.md index 55556adb6..bd99a448f 100644 --- a/src/bmm/workflows/4-implementation/create-story/workflow.md +++ b/src/bmm/workflows/4-implementation/create-story/workflow.md @@ -220,8 +220,7 @@ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve: 🔬 EXHAUSTIVE ARTIFACT ANALYSIS - This is where you prevent future developer fuckups! - + Read fully and follow `{installed_path}/discover-inputs.md` to load all input files Available content: {epics_content}, {prd_content}, {architecture_content}, {ux_content}, {project_context} diff --git a/src/bmm/workflows/4-implementation/dev-story/instructions.xml b/src/bmm/workflows/4-implementation/dev-story/instructions.xml deleted file mode 100644 index c39c35f2e..000000000 --- a/src/bmm/workflows/4-implementation/dev-story/instructions.xml +++ /dev/null @@ -1,412 +0,0 @@ - - The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - You MUST have already loaded and processed: {installed_path}/workflow.yaml - Communicate all responses in {communication_language} and language MUST be tailored to {user_skill_level} - Generate all documents in {document_output_language} - Only modify the story file in these areas: Tasks/Subtasks checkboxes, Dev Agent Record (Debug Log, Completion Notes), File List, - Change Log, and Status - Execute ALL steps in exact order; do NOT skip steps - Absolutely DO NOT stop because of "milestones", "significant progress", or "session boundaries". Continue in a single execution - until the story is COMPLETE (all ACs satisfied and all tasks/subtasks checked) UNLESS a HALT condition is triggered or the USER gives - other instruction. - Do NOT schedule a "next session" or request review pauses unless a HALT condition applies. Only Step 6 decides completion. - User skill level ({user_skill_level}) affects conversation style ONLY, not code updates. - - - - Use {{story_path}} directly - Read COMPLETE story file - Extract story_key from filename or metadata - - - - - - MUST read COMPLETE sprint-status.yaml file from start to end to preserve order - Load the FULL file: {{sprint_status}} - Read ALL lines from beginning to end - do not skip any content - Parse the development_status section completely to understand story order - - Find the FIRST story (by reading in order from top to bottom) where: - - Key matches pattern: number-number-name (e.g., "1-2-user-auth") - - NOT an epic key (epic-X) or retrospective (epic-X-retrospective) - - Status value equals "ready-for-dev" - - - - 📋 No ready-for-dev stories found in sprint-status.yaml - - **Current Sprint Status:** {{sprint_status_summary}} - - **What would you like to do?** - 1. Run `create-story` to create next story from epics with comprehensive context - 2. Run `*validate-create-story` to improve existing stories before development (recommended quality check) - 3. Specify a particular story file to develop (provide full path) - 4. Check {{sprint_status}} file to see current sprint status - - 💡 **Tip:** Stories in `ready-for-dev` may not have been validated. Consider running `validate-create-story` first for a quality - check. - - Choose option [1], [2], [3], or [4], or specify story file path: - - - HALT - Run create-story to create next story - - - - HALT - Run validate-create-story to improve existing stories - - - - Provide the story file path to develop: - Store user-provided story path as {{story_path}} - - - - - Loading {{sprint_status}} for detailed status review... - Display detailed sprint status analysis - HALT - User can review sprint status and provide story path - - - - Store user-provided story path as {{story_path}} - - - - - - - - Search {implementation_artifacts} for stories directly - Find stories with "ready-for-dev" status in files - Look for story files matching pattern: *-*-*.md - Read each candidate story file to check Status section - - - 📋 No ready-for-dev stories found - - **Available Options:** - 1. Run `create-story` to create next story from epics with comprehensive context - 2. Run `*validate-create-story` to improve existing stories - 3. Specify which story to develop - - What would you like to do? Choose option [1], [2], or [3]: - - - HALT - Run create-story to create next story - - - - HALT - Run validate-create-story to improve existing stories - - - - It's unclear what story you want developed. Please provide the full path to the story file: - Store user-provided story path as {{story_path}} - Continue with provided story file - - - - - Use discovered story file and extract story_key - - - - Store the found story_key (e.g., "1-2-user-authentication") for later status updates - Find matching story file in {implementation_artifacts} using story_key pattern: {{story_key}}.md - Read COMPLETE story file from discovered path - - - - Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Dev Agent Record, File List, Change Log, Status - - Load comprehensive context from story file's Dev Notes section - Extract developer guidance from Dev Notes: architecture requirements, previous learnings, technical specifications - Use enhanced story context to inform implementation decisions and approaches - - Identify first incomplete task (unchecked [ ]) in Tasks/Subtasks - - - Completion sequence - - HALT: "Cannot develop story without access to story file" - ASK user to clarify or HALT - - - - Load all available context to inform implementation - - Load {project_context} for coding standards and project-wide patterns (if exists) - Parse sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Dev Agent Record, File List, Change Log, Status - Load comprehensive context from story file's Dev Notes section - Extract developer guidance from Dev Notes: architecture requirements, previous learnings, technical specifications - Use enhanced story context to inform implementation decisions and approaches - ✅ **Context Loaded** - Story and project context available for implementation - - - - - Determine if this is a fresh start or continuation after code review - - Check if "Senior Developer Review (AI)" section exists in the story file - Check if "Review Follow-ups (AI)" subsection exists under Tasks/Subtasks - - - Set review_continuation = true - Extract from "Senior Developer Review (AI)" section: - - Review outcome (Approve/Changes Requested/Blocked) - - Review date - - Total action items with checkboxes (count checked vs unchecked) - - Severity breakdown (High/Med/Low counts) - - Count unchecked [ ] review follow-up tasks in "Review Follow-ups (AI)" subsection - Store list of unchecked review items as {{pending_review_items}} - - ⏯️ **Resuming Story After Code Review** ({{review_date}}) - - **Review Outcome:** {{review_outcome}} - **Action Items:** {{unchecked_review_count}} remaining to address - **Priorities:** {{high_count}} High, {{med_count}} Medium, {{low_count}} Low - - **Strategy:** Will prioritize review follow-up tasks (marked [AI-Review]) before continuing with regular tasks. - - - - - Set review_continuation = false - Set {{pending_review_items}} = empty - - 🚀 **Starting Fresh Implementation** - - Story: {{story_key}} - Story Status: {{current_status}} - First incomplete task: {{first_task_description}} - - - - - - - Load the FULL file: {{sprint_status}} - Read all development_status entries to find {{story_key}} - Get current status value for development_status[{{story_key}}] - - - Update the story in the sprint status report to = "in-progress" - Update last_updated field to current date - 🚀 Starting work on story {{story_key}} - Status updated: ready-for-dev → in-progress - - - - - ⏯️ Resuming work on story {{story_key}} - Story is already marked in-progress - - - - - ⚠️ Unexpected story status: {{current_status}} - Expected ready-for-dev or in-progress. Continuing anyway... - - - - Store {{current_sprint_status}} for later use - - - - ℹ️ No sprint status file exists - story progress will be tracked in story file only - Set {{current_sprint_status}} = "no-sprint-tracking" - - - - - FOLLOW THE STORY FILE TASKS/SUBTASKS SEQUENCE EXACTLY AS WRITTEN - NO DEVIATION - - 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 - - - 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 - - HALT: "Additional dependencies need user approval" - HALT and request guidance - HALT: "Cannot proceed without necessary configuration files" - - NEVER implement anything not mapped to a specific task/subtask in the story file - NEVER proceed to next task until current task/subtask is complete AND tests pass - Execute continuously without pausing until all tasks/subtasks are complete or explicit HALT condition - Do NOT propose to pause for review until Step 9 completion gates are satisfied - - - - Create unit tests for business logic and core functionality introduced/changed by the task - Add integration tests for component interactions specified in story requirements - Include end-to-end tests for critical user flows when story requirements demand them - Cover edge cases and error handling scenarios identified in story Dev Notes - - - - Determine how to run tests for this repo (infer test framework from project structure) - Run all existing tests to ensure no regressions - Run the new tests to verify implementation correctness - Run linting and code quality checks if configured in project - Validate implementation meets ALL story acceptance criteria; enforce quantitative thresholds explicitly - STOP and fix before continuing - identify breaking changes immediately - STOP and fix before continuing - ensure implementation correctness - - - - NEVER mark a task complete unless ALL conditions are met - NO LYING OR CHEATING - - - Verify ALL tests for this task/subtask ACTUALLY EXIST and PASS 100% - Confirm implementation matches EXACTLY what the task/subtask specifies - no extra features - Validate that ALL acceptance criteria related to this task are satisfied - Run full test suite to ensure NO regressions introduced - - - - Extract review item details (severity, description, related AC/file) - Add to resolution tracking list: {{resolved_review_items}} - - - Mark task checkbox [x] in "Tasks/Subtasks → Review Follow-ups (AI)" section - - - Find matching action item in "Senior Developer Review (AI) → Action Items" section by matching description - Mark that action item checkbox [x] as resolved - - Add to Dev Agent Record → Completion Notes: "✅ Resolved review finding [{{severity}}]: {{description}}" - - - - - ONLY THEN mark the task (and subtasks) checkbox with [x] - Update File List section with ALL new, modified, or deleted files (paths relative to repo root) - Add completion notes to Dev Agent Record summarizing what was ACTUALLY implemented and tested - - - - DO NOT mark task complete - fix issues first - HALT if unable to fix validation failures - - - - Count total resolved review items in this session - Add Change Log entry: "Addressed code review findings - {{resolved_count}} items resolved (Date: {{date}})" - - - Save the story file - Determine if more incomplete tasks remain - - Next task - - - Completion - - - - - Verify ALL tasks and subtasks are marked [x] (re-scan the story document now) - Run the full regression suite (do not skip) - Confirm File List includes every changed file - Execute enhanced definition-of-done validation - Update the story Status to: "review" - - - Validate definition-of-done checklist with essential requirements: - - All tasks/subtasks marked complete with [x] - - Implementation satisfies every Acceptance Criterion - - Unit tests for core functionality added/updated - - Integration tests for component interactions added when required - - End-to-end tests for critical flows added when story demands them - - All tests pass (no regressions, new tests successful) - - Code quality checks pass (linting, static analysis if configured) - - File List includes every new/modified/deleted file (relative paths) - - Dev Agent Record contains implementation notes - - Change Log includes summary of changes - - Only permitted story sections were modified - - - - - Load the FULL file: {sprint_status} - Find development_status key matching {{story_key}} - Verify current status is "in-progress" (expected previous state) - Update development_status[{{story_key}}] = "review" - Update last_updated field to current date - Save file, preserving ALL comments and structure including STATUS DEFINITIONS - ✅ Story status updated to "review" in sprint-status.yaml - - - - ℹ️ Story status updated to "review" in story file (no sprint tracking configured) - - - - ⚠️ Story file updated, but sprint-status update failed: {{story_key}} not found - - Story status is set to "review" in file, but sprint-status.yaml may be out of sync. - - - - - HALT - Complete remaining tasks before marking ready for review - HALT - Fix regression issues before completing - HALT - Update File List with all changed files - HALT - Address DoD failures before completing - - - - Execute the enhanced definition-of-done checklist using the validation framework - Prepare a concise summary in Dev Agent Record → Completion Notes - - Communicate to {user_name} that story implementation is complete and ready for review - Summarize key accomplishments: story ID, story key, title, key changes made, tests added, files modified - Provide the story file path and current status (now "review") - - Based on {user_skill_level}, ask if user needs any explanations about: - - What was implemented and how it works - - Why certain technical decisions were made - - How to test or verify the changes - - Any patterns, libraries, or approaches used - - Anything else they'd like clarified - - - - Provide clear, contextual explanations tailored to {user_skill_level} - Use examples and references to specific code when helpful - - - Once explanations are complete (or user indicates no questions), suggest logical next steps - Recommended next steps (flexible based on project setup): - - Review the implemented story and test the changes - - Verify all acceptance criteria are met - - Ensure deployment readiness if applicable - - Run `code-review` workflow for peer review - - Optional: If Test Architect module installed, run `/bmad:tea:automate` to expand guardrail tests - - - 💡 **Tip:** For best results, run `code-review` using a **different** LLM than the one that implemented this story. - - Suggest checking {sprint_status} to see project progress - - Remain flexible - allow user to choose their own path or ask for other assistance - - - diff --git a/src/core/tasks/bmad-skill-manifest.yaml b/src/core/tasks/bmad-skill-manifest.yaml index cfe67caa5..ea8fdbcf1 100644 --- a/src/core/tasks/bmad-skill-manifest.yaml +++ b/src/core/tasks/bmad-skill-manifest.yaml @@ -27,8 +27,3 @@ shard-doc.xml: canonicalId: bmad-shard-doc type: task description: "Splits large markdown documents into smaller, organized files based on sections" - -workflow.xml: - canonicalId: bmad-workflow - type: task - description: "Execute given workflow by loading its configuration and following instructions" diff --git a/src/core/tasks/workflow.xml b/src/core/tasks/workflow.xml deleted file mode 100644 index 351872ac8..000000000 --- a/src/core/tasks/workflow.xml +++ /dev/null @@ -1,235 +0,0 @@ - - Execute given workflow by loading its configuration, following instructions, and producing output - - - Always read COMPLETE files - NEVER use offset/limit when reading any workflow related files - Instructions are MANDATORY - either as file path, steps or embedded list in YAML, XML or markdown - Execute ALL steps in instructions IN EXACT ORDER - Save to template output file after EVERY "template-output" tag - NEVER skip a step - YOU are responsible for every steps execution without fail or excuse - - - - Steps execute in exact numerical order (1, 2, 3...) - Optional steps: Ask user unless #yolo mode active - Template-output tags: Save content, discuss with the user the section completed, and NEVER proceed until the users indicates - to proceed (unless YOLO mode has been activated) - - - - - - Read workflow.yaml from provided path - Load config_source (REQUIRED for all modules) - Load external config from config_source path - Resolve all {config_source}: references with values from config - Resolve system variables (date:system-generated) and paths ({project-root}, {installed_path}) - Ask user for input of any variables that are still unknown - - - - Instructions: Read COMPLETE file from path OR embedded list (REQUIRED) - If template path → Read COMPLETE template file - If validation path → Note path for later loading when needed - If template: false → Mark as action-workflow (else template-workflow) - Data files (csv, json) → Store paths only, load on-demand when instructions reference them - - - - Resolve default_output_file path with all variables and {{date}} - Create output directory if doesn't exist - If template-workflow → Write template to output file with placeholders - If action-workflow → Skip file creation - - - - - For each step in instructions: - - - If optional="true" and NOT #yolo → Ask user to include - If if="condition" → Evaluate condition - If for-each="item" → Repeat step for each item - If repeat="n" → Repeat step n times - - - - Process step instructions (markdown or XML tags) - Replace {{variables}} with values (ask user if unknown) - - action xml tag → Perform the action - check if="condition" xml tag → Conditional block wrapping actions (requires closing </check>) - ask xml tag → Prompt user and WAIT for response - invoke-workflow xml tag → Execute another workflow with given inputs and the workflow.xml runner - invoke-task xml tag → Execute specified task - invoke-protocol name="protocol_name" xml tag → Execute reusable protocol from protocols section - goto step="x" → Jump to specified step - - - - - - Generate content for this section - Save to file (Write first time, Edit subsequent) - Display generated content - [a] Advanced Elicitation, [c] Continue, [p] Party-Mode, [y] YOLO the rest of this document only. WAIT for response. - Start the advanced elicitation workflow {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.md - - - Continue to next step - - - Start the party-mode workflow {project-root}/_bmad/core/workflows/party-mode/workflow.md - - - Enter #yolo mode for the rest of the workflow - - - - - - - If no special tags and NOT #yolo: - Continue to next step? (y/n/edit) - - - - - Confirm document saved to output path - Report workflow completion - - - - - Full user interaction and confirmation of EVERY step at EVERY template output - NO EXCEPTIONS except yolo MODE - Skip all confirmations and elicitation, minimize prompts and try to produce all of the workflow automatically by - simulating the remaining discussions with an simulated expert user - - - - - step n="X" goal="..." - Define step with number and goal - optional="true" - Step can be skipped - if="condition" - Conditional execution - for-each="collection" - Iterate over items - repeat="n" - Repeat n times - - - action - Required action to perform - action if="condition" - Single conditional action (inline, no closing tag needed) - check if="condition">...</check> - Conditional block wrapping multiple items (closing tag required) - ask - Get user input (ALWAYS wait for response before continuing) - goto - Jump to another step - invoke-workflow - Call another workflow - invoke-task - Call a task - invoke-protocol - Execute a reusable protocol (e.g., discover_inputs) - - - template-output - Save content checkpoint - critical - Cannot be skipped - example - Show example output - - - - - - Intelligently load project files (whole or sharded) based on workflow's input_file_patterns configuration - - Only execute if workflow.yaml contains input_file_patterns section - - - - Read input_file_patterns from loaded workflow.yaml - For each pattern group (prd, architecture, epics, etc.), note the load_strategy if present - - - - For each pattern in input_file_patterns: - - - - Determine load_strategy from pattern config (defaults to FULL_LOAD if not specified) - - - Load ALL files in sharded directory - used for PRD, Architecture, UX, brownfield docs - Use glob pattern to find ALL .md files (e.g., "{output_folder}/*architecture*/*.md") - Load EVERY matching file completely - Concatenate content in logical order (index.md first if exists, then alphabetical) - Store in variable: {pattern_name_content} - - - - Load specific shard using template variable - example: used for epics with {{epic_num}} - Check for template variables in sharded_single pattern (e.g., {{epic_num}}) - If variable undefined, ask user for value OR infer from context - Resolve template to specific file path - Load that specific file - Store in variable: {pattern_name_content} - - - - Load index.md, analyze structure and description of each doc in the index, then intelligently load relevant docs - DO NOT BE LAZY - use best judgment to load documents that might have relevant information, even if only a 5% chance - Load index.md from sharded directory - Parse table of contents, links, section headers - Analyze workflow's purpose and objective - Identify which linked/referenced documents are likely relevant - If workflow is about authentication and index shows "Auth Overview", "Payment Setup", "Deployment" → Load auth - docs, consider deployment docs, skip payment - Load all identified relevant documents - Store combined content in variable: {pattern_name_content} - When in doubt, LOAD IT - context is valuable, being thorough is better than missing critical info - - Mark pattern as RESOLVED, skip to next pattern - - - - - - Attempt glob match on 'whole' pattern (e.g., "{output_folder}/*prd*.md") - - Load ALL matching files completely (no offset/limit) - Store content in variable: {pattern_name_content} (e.g., {prd_content}) - Mark pattern as RESOLVED, skip to next pattern - - - - - - - Set {pattern_name_content} to empty string - Note in session: "No {pattern_name} files found" (not an error, just unavailable, offer use change to provide) - - - - - - List all loaded content variables with file counts - - ✓ Loaded {prd_content} from 5 sharded files: prd/index.md, prd/requirements.md, ... - ✓ Loaded {architecture_content} from 1 file: Architecture.md - ✓ Loaded {epics_content} from selective load: epics/epic-3.md - ○ No ux_design files found - - This gives workflow transparency into what context is available - - - - - - - - - • This is the complete workflow execution engine - • You MUST Follow instructions exactly as written - • The workflow execution engine is governed by: {project-root}/_bmad/core/tasks/workflow.xml - • You MUST have already loaded and processed: {installed_path}/workflow.yaml - • This workflow uses INTENT-DRIVEN PLANNING - adapt organically to product type and context - • YOU ARE FACILITATING A CONVERSATION With a user to produce a final document step by step. The whole process is meant to be - collaborative helping the user flesh out their ideas. Do not rush or optimize and skip any section. - - - \ No newline at end of file diff --git a/src/utility/agent-components/activation-steps.txt b/src/utility/agent-components/activation-steps.txt index 9ead0e01c..abcc0e6fa 100644 --- a/src/utility/agent-components/activation-steps.txt +++ b/src/utility/agent-components/activation-steps.txt @@ -11,4 +11,4 @@ Let {user_name} know they can type command `/bmad-help` at any time to get advice on what to do next, and that they can combine that with what they need help with `/bmad-help where should I start with an idea I have that does XYZ` STOP and WAIT for user input - do NOT execute menu items automatically - accept number or cmd trigger or fuzzy command match On user input: Number → process menu item[n] | Text → case-insensitive substring match | Multiple matches → ask user to clarify | No match → show "Not recognized" - When processing a menu item: Check menu-handlers section below - extract any attributes from the selected menu item (workflow, exec, tmpl, data, action, validate-workflow) and follow the corresponding handler instructions \ No newline at end of file + When processing a menu item: Check menu-handlers section below - extract any attributes from the selected menu item (exec, tmpl, data, action, multi) and follow the corresponding handler instructions \ No newline at end of file diff --git a/src/utility/agent-components/handler-multi.txt b/src/utility/agent-components/handler-multi.txt index f33a73fe5..e05be2390 100644 --- a/src/utility/agent-components/handler-multi.txt +++ b/src/utility/agent-components/handler-multi.txt @@ -4,10 +4,9 @@ 2. Parse all nested handlers within the multi item 3. For each nested handler: - Use the 'match' attribute for fuzzy matching user input (or Exact Match of character code in brackets []) - - Process based on handler attributes (exec, workflow, action) + - Process based on handler attributes (exec, action) 4. When user input matches a handler's 'match' pattern: - For exec="path/to/file.md": follow the `handler type="exec"` instructions - - For workflow="path/to/workflow.yaml": follow the `handler type="workflow"` instructions - For action="...": Perform the specified action directly 5. Support both exact matches and fuzzy matching based on the match attribute 6. If no handler matches, prompt user to choose from available options diff --git a/src/utility/agent-components/handler-validate-workflow.txt b/src/utility/agent-components/handler-validate-workflow.txt deleted file mode 100644 index aca040550..000000000 --- a/src/utility/agent-components/handler-validate-workflow.txt +++ /dev/null @@ -1,7 +0,0 @@ - - When command has: validate-workflow="path/to/workflow.yaml" - 1. You MUST LOAD the file at: {project-root}/_bmad/core/tasks/validate-workflow.xml - 2. READ its entire contents and EXECUTE all instructions in that file - 3. Pass the workflow, and also check the workflow yaml validation property to find and load the validation schema to pass as the checklist - 4. The workflow should try to identify the file to validate based on checklist context or else you will ask the user to specify - \ No newline at end of file diff --git a/src/utility/agent-components/handler-workflow.txt b/src/utility/agent-components/handler-workflow.txt deleted file mode 100644 index 1be1dcbe5..000000000 --- a/src/utility/agent-components/handler-workflow.txt +++ /dev/null @@ -1,10 +0,0 @@ - - When menu item has: workflow="path/to/workflow.yaml": - - 1. CRITICAL: Always LOAD {project-root}/_bmad/core/tasks/workflow.xml - 2. Read the complete file - this is the CORE OS for processing BMAD workflows - 3. Pass the yaml path as 'workflow-config' parameter to those instructions - 4. Follow workflow.xml instructions precisely following all steps - 5. Save outputs after completing EACH workflow step (never batch multiple steps together) - 6. If workflow.yaml path is "todo", inform user the workflow hasn't been implemented yet - \ No newline at end of file diff --git a/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml b/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml index 959085cb7..22ae9886d 100644 --- a/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml +++ b/test/fixtures/agent-schema/valid/menu-commands/all-command-types.agent.yaml @@ -19,7 +19,7 @@ agent: menu: - trigger: workflow-test description: Test workflow command - workflow: path/to/workflow + exec: path/to/workflow - trigger: validate-test description: Test validate-workflow command validate-workflow: path/to/validation diff --git a/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml b/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml index 945722b5b..9133b02de 100644 --- a/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml +++ b/test/fixtures/agent-schema/valid/menu-commands/multiple-commands.agent.yaml @@ -19,6 +19,5 @@ agent: menu: - trigger: multi-command description: Menu item with multiple command targets - workflow: path/to/workflow - exec: npm test + exec: path/to/workflow action: perform_action diff --git a/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml b/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml index c8a23a9d5..c95025025 100644 --- a/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml +++ b/test/fixtures/agent-schema/valid/menu/multiple-menu-items.agent.yaml @@ -22,7 +22,7 @@ agent: action: display_help - trigger: start-workflow description: Start a workflow - workflow: path/to/workflow + exec: path/to/workflow - trigger: execute description: Execute command exec: npm test diff --git a/test/fixtures/file-refs-csv/valid/bmm-style.csv b/test/fixtures/file-refs-csv/valid/bmm-style.csv index ab870ab01..c803064ba 100644 --- a/test/fixtures/file-refs-csv/valid/bmm-style.csv +++ b/test/fixtures/file-refs-csv/valid/bmm-style.csv @@ -1,3 +1,3 @@ module,phase,name,code,sequence,workflow-file,command,required,agent,options,description,output-location,outputs, -bmm,anytime,Document Project,DP,,_bmad/bmm/workflows/document-project/workflow.yaml,bmad-bmm-document-project,false,analyst,Create Mode,"Analyze project",project-knowledge,*, +bmm,anytime,Document Project,DP,,_bmad/bmm/workflows/document-project/workflow.md,bmad-bmm-document-project,false,analyst,Create Mode,"Analyze project",project-knowledge,*, bmm,1-analysis,Brainstorm Project,BP,10,_bmad/core/workflows/brainstorming/workflow.md,bmad-brainstorming,false,analyst,data=template.md,"Brainstorming",planning_artifacts,"session", diff --git a/test/test-file-refs-csv.js b/test/test-file-refs-csv.js index d068bd75d..c6a8e4623 100644 --- a/test/test-file-refs-csv.js +++ b/test/test-file-refs-csv.js @@ -58,7 +58,7 @@ test('bmm-style.csv: extracts workflow-file refs with trailing commas', () => { const { fullPath, content } = loadFixture('valid/bmm-style.csv'); const refs = extractCsvRefs(fullPath, content); assert(refs.length === 2, `Expected 2 refs, got ${refs.length}`); - assert(refs[0].raw === '_bmad/bmm/workflows/document-project/workflow.yaml', `Wrong raw[0]: ${refs[0].raw}`); + assert(refs[0].raw === '_bmad/bmm/workflows/document-project/workflow.md', `Wrong raw[0]: ${refs[0].raw}`); assert(refs[1].raw === '_bmad/core/workflows/brainstorming/workflow.md', `Wrong raw[1]: ${refs[1].raw}`); assert(refs[0].type === 'project-root', `Wrong type: ${refs[0].type}`); assert(refs[0].line === 2, `Wrong line for row 0: ${refs[0].line}`); diff --git a/test/test-workflow-path-regex.js b/test/test-workflow-path-regex.js new file mode 100644 index 000000000..488d69b76 --- /dev/null +++ b/test/test-workflow-path-regex.js @@ -0,0 +1,88 @@ +/** + * Workflow Path Regex Tests + * + * Tests that the source and install workflow path regexes in ModuleManager + * extract the correct capture groups (module name and workflow sub-path). + * + * Usage: node test/test-workflow-path-regex.js + */ + +// ANSI colors +const colors = { + reset: '\u001B[0m', + green: '\u001B[32m', + red: '\u001B[31m', + cyan: '\u001B[36m', + dim: '\u001B[2m', +}; + +let passed = 0; +let failed = 0; + +function assert(condition, testName, errorMessage = '') { + if (condition) { + console.log(`${colors.green}✓${colors.reset} ${testName}`); + passed++; + } else { + console.log(`${colors.red}✗${colors.reset} ${testName}`); + if (errorMessage) { + console.log(` ${colors.dim}${errorMessage}${colors.reset}`); + } + failed++; + } +} + +// --------------------------------------------------------------------------- +// These regexes are extracted from ModuleManager.vendorWorkflowDependencies() +// in tools/cli/installers/lib/modules/manager.js +// --------------------------------------------------------------------------- + +// Source regex (line ~1081) — uses non-capturing group for _bmad +const SOURCE_REGEX = /\{project-root\}\/(?:_bmad)\/([^/]+)\/workflows\/(.+)/; + +// Install regex (line ~1091) — uses non-capturing group for _bmad, +// consistent with source regex +const INSTALL_REGEX = /\{project-root\}\/(?:_bmad)\/([^/]+)\/workflows\/(.+)/; + +// --------------------------------------------------------------------------- +// Test data +// --------------------------------------------------------------------------- +const sourcePath = '{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md'; +const installPath = '{project-root}/_bmad/bmgd/workflows/4-production/create-story/workflow.md'; + +console.log(`\n${colors.cyan}Workflow Path Regex Tests${colors.reset}\n`); + +// --- Source regex tests (these should pass — source regex is correct) --- + +const sourceMatch = sourcePath.match(SOURCE_REGEX); + +assert(sourceMatch !== null, 'Source regex matches source path'); +assert( + sourceMatch && sourceMatch[1] === 'bmm', + 'Source regex group [1] is the module name', + `Expected "bmm", got "${sourceMatch && sourceMatch[1]}"`, +); +assert( + sourceMatch && sourceMatch[2] === '4-implementation/create-story/workflow.md', + 'Source regex group [2] is the workflow sub-path', + `Expected "4-implementation/create-story/workflow.md", got "${sourceMatch && sourceMatch[2]}"`, +); + +// --- Install regex tests (group [2] returns module name, not sub-path) --- + +const installMatch = installPath.match(INSTALL_REGEX); + +assert(installMatch !== null, 'Install regex matches install path'); + +// This is the critical test: installMatch[2] should be the workflow sub-path, +// because the code uses it as `installWorkflowSubPath`. +// With the bug, installMatch[2] is "bmgd" (module name) instead of the sub-path. +assert( + installMatch && installMatch[2] === '4-production/create-story/workflow.md', + 'Install regex group [2] is the workflow sub-path (used as installWorkflowSubPath)', + `Expected "4-production/create-story/workflow.md", got "${installMatch && installMatch[2]}"`, +); + +// --- Summary --- +console.log(`\n${passed} passed, ${failed} failed\n`); +process.exit(failed > 0 ? 1 : 0); diff --git a/tools/cli/installers/lib/core/manifest-generator.js b/tools/cli/installers/lib/core/manifest-generator.js index 8562672b5..b02ccde9e 100644 --- a/tools/cli/installers/lib/core/manifest-generator.js +++ b/tools/cli/installers/lib/core/manifest-generator.js @@ -148,7 +148,7 @@ class ManifestGenerator { /** * Recursively walk a module directory tree, collecting skill directories. * A skill directory is one that contains both a bmad-skill-manifest.yaml with - * type: skill AND a workflow.md (or workflow.yaml) file. + * type: skill AND a workflow.md file. * Populates this.skills[] and this.skillClaimedDirs (Set of absolute paths). */ async collectSkills() { @@ -172,76 +172,66 @@ class ManifestGenerator { // Check this directory for skill manifest + workflow file const manifest = await this.loadSkillManifest(dir); - // Try both workflow.md and workflow.yaml - const workflowFilenames = ['workflow.md', 'workflow.yaml']; - for (const workflowFile of workflowFilenames) { - const workflowPath = path.join(dir, workflowFile); - if (!(await fs.pathExists(workflowPath))) continue; - + const workflowFile = 'workflow.md'; + const workflowPath = path.join(dir, workflowFile); + if (await fs.pathExists(workflowPath)) { const artifactType = this.getArtifactType(manifest, workflowFile); - if (artifactType !== 'skill') continue; + if (artifactType === 'skill') { + // Read and parse the workflow file + try { + const rawContent = await fs.readFile(workflowPath, 'utf8'); + const content = rawContent.replaceAll('\r\n', '\n').replaceAll('\r', '\n'); - // Read and parse the workflow file - try { - const rawContent = await fs.readFile(workflowPath, 'utf8'); - const content = rawContent.replaceAll('\r\n', '\n').replaceAll('\r', '\n'); - - let workflow; - if (workflowFile === 'workflow.yaml') { - workflow = yaml.parse(content); - } else { const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/); - if (!frontmatterMatch) { + if (frontmatterMatch) { + const workflow = yaml.parse(frontmatterMatch[1]); + + if (!workflow || !workflow.name || !workflow.description) { + if (debug) console.log(`[DEBUG] collectSkills: skipped (missing name/description): ${workflowPath}`); + } else { + // Build path relative from module root + const relativePath = path.relative(modulePath, dir).split(path.sep).join('/'); + const installPath = relativePath + ? `${this.bmadFolderName}/${moduleName}/${relativePath}/${workflowFile}` + : `${this.bmadFolderName}/${moduleName}/${workflowFile}`; + + // Skills derive canonicalId from directory name — never from manifest + if (manifest && manifest.__single && manifest.__single.canonicalId) { + console.warn( + `Warning: Skill manifest at ${dir}/bmad-skill-manifest.yaml contains canonicalId — this field is ignored for skills (directory name is the canonical ID)`, + ); + } + const canonicalId = path.basename(dir); + + this.skills.push({ + name: workflow.name, + description: this.cleanForCSV(workflow.description), + module: moduleName, + path: installPath, + canonicalId, + install_to_bmad: this.getInstallToBmad(manifest, workflowFile), + }); + + // Add to files list + this.files.push({ + type: 'skill', + name: workflow.name, + module: moduleName, + path: installPath, + }); + + this.skillClaimedDirs.add(dir); + + if (debug) { + console.log(`[DEBUG] collectSkills: claimed skill "${workflow.name}" as ${canonicalId} at ${dir}`); + } + } + } else { if (debug) console.log(`[DEBUG] collectSkills: skipped (no frontmatter): ${workflowPath}`); - continue; } - workflow = yaml.parse(frontmatterMatch[1]); + } catch (error) { + if (debug) console.log(`[DEBUG] collectSkills: failed to parse ${workflowPath}: ${error.message}`); } - - if (!workflow || !workflow.name || !workflow.description) { - if (debug) console.log(`[DEBUG] collectSkills: skipped (missing name/description): ${workflowPath}`); - continue; - } - - // Build path relative from module root - const relativePath = path.relative(modulePath, dir).split(path.sep).join('/'); - const installPath = relativePath - ? `${this.bmadFolderName}/${moduleName}/${relativePath}/${workflowFile}` - : `${this.bmadFolderName}/${moduleName}/${workflowFile}`; - - // Skills derive canonicalId from directory name — never from manifest - if (manifest && manifest.__single && manifest.__single.canonicalId) { - console.warn( - `Warning: Skill manifest at ${dir}/bmad-skill-manifest.yaml contains canonicalId — this field is ignored for skills (directory name is the canonical ID)`, - ); - } - const canonicalId = path.basename(dir); - - this.skills.push({ - name: workflow.name, - description: this.cleanForCSV(workflow.description), - module: moduleName, - path: installPath, - canonicalId, - install_to_bmad: this.getInstallToBmad(manifest, workflowFile), - }); - - // Add to files list - this.files.push({ - type: 'skill', - name: workflow.name, - module: moduleName, - path: installPath, - }); - - this.skillClaimedDirs.add(dir); - - if (debug) { - console.log(`[DEBUG] collectSkills: claimed skill "${workflow.name}" as ${canonicalId} at ${dir}`); - } - break; // Successfully claimed — skip remaining workflow filenames - } catch (error) { - if (debug) console.log(`[DEBUG] collectSkills: failed to parse ${workflowPath}: ${error.message}`); } } @@ -260,11 +250,11 @@ class ManifestGenerator { } } if (hasSkillType && debug) { - const hasWorkflow = workflowFilenames.some((f) => entries.some((e) => e.name === f)); + const hasWorkflow = entries.some((e) => e.name === workflowFile); if (hasWorkflow) { console.log(`[DEBUG] collectSkills: dir has type:skill manifest but workflow file failed to parse: ${dir}`); } else { - console.log(`[DEBUG] collectSkills: dir has type:skill manifest but no workflow.md/workflow.yaml: ${dir}`); + console.log(`[DEBUG] collectSkills: dir has type:skill manifest but no workflow.md: ${dir}`); } } } @@ -308,7 +298,7 @@ class ManifestGenerator { } /** - * Recursively find and parse workflow.yaml and workflow.md files + * Recursively find and parse workflow.md files */ async getWorkflowsFromPath(basePath, moduleName, subDir = 'workflows') { const workflows = []; @@ -326,7 +316,7 @@ class ManifestGenerator { return workflows; } - // Recursively find workflow.yaml files + // Recursively find workflow.md files const findWorkflows = async (dir, relativePath = '') => { // Skip directories already claimed as skills if (this.skillClaimedDirs && this.skillClaimedDirs.has(dir)) return; @@ -344,11 +334,7 @@ class ManifestGenerator { // Recurse into subdirectories const newRelativePath = relativePath ? `${relativePath}/${entry.name}` : entry.name; await findWorkflows(fullPath, newRelativePath); - } else if ( - entry.name === 'workflow.yaml' || - entry.name === 'workflow.md' || - (entry.name.startsWith('workflow-') && entry.name.endsWith('.md')) - ) { + } else if (entry.name === 'workflow.md' || (entry.name.startsWith('workflow-') && entry.name.endsWith('.md'))) { // Parse workflow file (both YAML and MD formats) if (debug) { console.log(`[DEBUG] Found workflow file: ${fullPath}`); @@ -358,21 +344,15 @@ class ManifestGenerator { const rawContent = await fs.readFile(fullPath, 'utf8'); const content = rawContent.replaceAll('\r\n', '\n').replaceAll('\r', '\n'); - let workflow; - if (entry.name === 'workflow.yaml') { - // Parse YAML workflow - workflow = yaml.parse(content); - } else { - // Parse MD workflow with YAML frontmatter - const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/); - if (!frontmatterMatch) { - if (debug) { - console.log(`[DEBUG] Skipped (no frontmatter): ${fullPath}`); - } - continue; // Skip MD files without frontmatter + // Parse MD workflow with YAML frontmatter + const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/); + if (!frontmatterMatch) { + if (debug) { + console.log(`[DEBUG] Skipped (no frontmatter): ${fullPath}`); } - workflow = yaml.parse(frontmatterMatch[1]); + continue; // Skip MD files without frontmatter } + const workflow = yaml.parse(frontmatterMatch[1]); if (debug) { console.log(`[DEBUG] Parsed: name="${workflow.name}", description=${workflow.description ? 'OK' : 'MISSING'}`); @@ -1343,7 +1323,7 @@ class ManifestGenerator { // Check for manifest in this directory const manifest = await this.loadSkillManifest(dir); if (manifest) { - const type = this.getArtifactType(manifest, 'workflow.md') || this.getArtifactType(manifest, 'workflow.yaml'); + const type = this.getArtifactType(manifest, 'workflow.md'); if (type === 'skill') return true; } diff --git a/tools/cli/installers/lib/ide/_base-ide.js b/tools/cli/installers/lib/ide/_base-ide.js index 9bfbdcf30..a09222868 100644 --- a/tools/cli/installers/lib/ide/_base-ide.js +++ b/tools/cli/installers/lib/ide/_base-ide.js @@ -289,7 +289,7 @@ class BaseIdeSetup { // Get core workflows const coreWorkflowsPath = path.join(bmadDir, 'core', 'workflows'); if (await fs.pathExists(coreWorkflowsPath)) { - const coreWorkflows = await this.findWorkflowYamlFiles(coreWorkflowsPath); + const coreWorkflows = await this.findWorkflowFiles(coreWorkflowsPath); workflows.push( ...coreWorkflows.map((w) => ({ ...w, @@ -304,7 +304,7 @@ class BaseIdeSetup { if (entry.isDirectory() && entry.name !== 'core' && entry.name !== '_config' && entry.name !== 'agents') { const moduleWorkflowsPath = path.join(bmadDir, entry.name, 'workflows'); if (await fs.pathExists(moduleWorkflowsPath)) { - const moduleWorkflows = await this.findWorkflowYamlFiles(moduleWorkflowsPath); + const moduleWorkflows = await this.findWorkflowFiles(moduleWorkflowsPath); workflows.push( ...moduleWorkflows.map((w) => ({ ...w, @@ -324,11 +324,13 @@ class BaseIdeSetup { } /** - * Recursively find workflow.yaml files + * Recursively find workflow.md files * @param {string} dir - Directory to search + * @param {string} [rootDir] - Original root directory (used internally for recursion) * @returns {Array} List of workflow file info objects */ - async findWorkflowYamlFiles(dir) { + async findWorkflowFiles(dir, rootDir = null) { + rootDir = rootDir || dir; const workflows = []; if (!(await fs.pathExists(dir))) { @@ -342,14 +344,17 @@ class BaseIdeSetup { if (entry.isDirectory()) { // Recursively search subdirectories - const subWorkflows = await this.findWorkflowYamlFiles(fullPath); + const subWorkflows = await this.findWorkflowFiles(fullPath, rootDir); workflows.push(...subWorkflows); - } else if (entry.isFile() && entry.name === 'workflow.yaml') { - // Read workflow.yaml to get name and standalone property + } else if (entry.isFile() && entry.name === 'workflow.md') { + // Read workflow.md frontmatter to get name and standalone property try { const yaml = require('yaml'); const content = await fs.readFile(fullPath, 'utf8'); - const workflowData = yaml.parse(content); + const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/); + if (!frontmatterMatch) continue; + + const workflowData = yaml.parse(frontmatterMatch[1]); if (workflowData && workflowData.name) { // Workflows are standalone by default unless explicitly false @@ -357,7 +362,7 @@ class BaseIdeSetup { workflows.push({ name: workflowData.name, path: fullPath, - relativePath: path.relative(dir, fullPath), + relativePath: path.relative(rootDir, fullPath), filename: entry.name, description: workflowData.description || '', standalone: standalone, @@ -376,9 +381,11 @@ class BaseIdeSetup { * Scan a directory for files with specific extension(s) * @param {string} dir - Directory to scan * @param {string|Array} ext - File extension(s) to match (e.g., '.md' or ['.md', '.xml']) + * @param {string} [rootDir] - Original root directory (used internally for recursion) * @returns {Array} List of file info objects */ - async scanDirectory(dir, ext) { + async scanDirectory(dir, ext, rootDir = null) { + rootDir = rootDir || dir; const files = []; if (!(await fs.pathExists(dir))) { @@ -395,7 +402,7 @@ class BaseIdeSetup { if (entry.isDirectory()) { // Recursively scan subdirectories - const subFiles = await this.scanDirectory(fullPath, ext); + const subFiles = await this.scanDirectory(fullPath, ext, rootDir); files.push(...subFiles); } else if (entry.isFile()) { // Check if file matches any of the extensions @@ -404,7 +411,7 @@ class BaseIdeSetup { files.push({ name: path.basename(entry.name, matchedExt), path: fullPath, - relativePath: path.relative(dir, fullPath), + relativePath: path.relative(rootDir, fullPath), filename: entry.name, }); } @@ -418,9 +425,11 @@ class BaseIdeSetup { * Scan a directory for files with specific extension(s) and check standalone attribute * @param {string} dir - Directory to scan * @param {string|Array} ext - File extension(s) to match (e.g., '.md' or ['.md', '.xml']) + * @param {string} [rootDir] - Original root directory (used internally for recursion) * @returns {Array} List of file info objects with standalone property */ - async scanDirectoryWithStandalone(dir, ext) { + async scanDirectoryWithStandalone(dir, ext, rootDir = null) { + rootDir = rootDir || dir; const files = []; if (!(await fs.pathExists(dir))) { @@ -437,7 +446,7 @@ class BaseIdeSetup { if (entry.isDirectory()) { // Recursively scan subdirectories - const subFiles = await this.scanDirectoryWithStandalone(fullPath, ext); + const subFiles = await this.scanDirectoryWithStandalone(fullPath, ext, rootDir); files.push(...subFiles); } else if (entry.isFile()) { // Check if file matches any of the extensions @@ -481,7 +490,7 @@ class BaseIdeSetup { files.push({ name: path.basename(entry.name, matchedExt), path: fullPath, - relativePath: path.relative(dir, fullPath), + relativePath: path.relative(rootDir, fullPath), filename: entry.name, standalone: standalone, }); diff --git a/tools/cli/installers/lib/ide/_config-driven.js b/tools/cli/installers/lib/ide/_config-driven.js index e72b61481..610913dd7 100644 --- a/tools/cli/installers/lib/ide/_config-driven.js +++ b/tools/cli/installers/lib/ide/_config-driven.js @@ -232,16 +232,8 @@ class ConfigDrivenIdeSetup extends BaseIdeSetup { for (const artifact of artifacts) { if (artifact.type === 'workflow-command') { - // Use different template based on workflow type (YAML vs MD) - // Default to 'default' template type, but allow override via config - const workflowTemplateType = artifact.isYamlWorkflow - ? config.yaml_workflow_template || `${templateType}-workflow-yaml` - : config.md_workflow_template || `${templateType}-workflow`; - - // Fall back to default templates if specific ones don't exist - const finalTemplateType = artifact.isYamlWorkflow ? 'default-workflow-yaml' : 'default-workflow'; - // workflowTemplateType already contains full name (e.g., 'gemini-workflow-yaml'), so pass empty artifactType - const { content: template, extension } = await this.loadTemplate(workflowTemplateType, '', config, finalTemplateType); + const workflowTemplateType = config.md_workflow_template || `${templateType}-workflow`; + const { content: template, extension } = await this.loadTemplate(workflowTemplateType, '', config, 'default-workflow'); const content = this.renderTemplate(template, artifact); const filename = this.generateFilename(artifact, 'workflow', extension); diff --git a/tools/cli/installers/lib/ide/shared/path-utils.js b/tools/cli/installers/lib/ide/shared/path-utils.js index 45efd2ec1..4ab033f17 100644 --- a/tools/cli/installers/lib/ide/shared/path-utils.js +++ b/tools/cli/installers/lib/ide/shared/path-utils.js @@ -63,7 +63,7 @@ function toDashPath(relativePath) { } // Strip common file extensions to avoid double extensions in generated filenames - // e.g., 'create-story.xml' → 'create-story', 'workflow.yaml' → 'workflow' + // e.g., 'create-story.xml' → 'create-story', 'workflow.md' → 'workflow' const withoutExt = relativePath.replace(/\.(md|yaml|yml|json|xml|toml)$/i, ''); const parts = withoutExt.split(/[/\\]/); diff --git a/tools/cli/installers/lib/ide/shared/workflow-command-generator.js b/tools/cli/installers/lib/ide/shared/workflow-command-generator.js index 793252bac..ed8c3e508 100644 --- a/tools/cli/installers/lib/ide/shared/workflow-command-generator.js +++ b/tools/cli/installers/lib/ide/shared/workflow-command-generator.js @@ -1,58 +1,16 @@ const path = require('node:path'); const fs = require('fs-extra'); const csv = require('csv-parse/sync'); -const prompts = require('../../../../lib/prompts'); -const { toColonPath, toDashPath, customAgentColonName, customAgentDashName, BMAD_FOLDER_NAME } = require('./path-utils'); +const { BMAD_FOLDER_NAME } = require('./path-utils'); /** * Generates command files for each workflow in the manifest */ class WorkflowCommandGenerator { constructor(bmadFolderName = BMAD_FOLDER_NAME) { - this.templatePath = path.join(__dirname, '../templates/workflow-command-template.md'); this.bmadFolderName = bmadFolderName; } - /** - * Generate workflow commands from the manifest CSV - * @param {string} projectDir - Project directory - * @param {string} bmadDir - BMAD installation directory - */ - async generateWorkflowCommands(projectDir, bmadDir) { - const workflows = await this.loadWorkflowManifest(bmadDir); - - if (!workflows) { - await prompts.log.warn('Workflow manifest not found. Skipping command generation.'); - return { generated: 0 }; - } - - // ALL workflows now generate commands - no standalone filtering - const allWorkflows = workflows; - - // Base commands directory - const baseCommandsDir = path.join(projectDir, '.claude', 'commands', 'bmad'); - - let generatedCount = 0; - - // Generate a command file for each workflow, organized by module - for (const workflow of allWorkflows) { - const moduleWorkflowsDir = path.join(baseCommandsDir, workflow.module, 'workflows'); - await fs.ensureDir(moduleWorkflowsDir); - - const commandContent = await this.generateCommandContent(workflow, bmadDir); - const commandPath = path.join(moduleWorkflowsDir, `${workflow.name}.md`); - - await fs.writeFile(commandPath, commandContent); - generatedCount++; - } - - // Also create a workflow launcher README in each module - const groupedWorkflows = this.groupWorkflowsByModule(allWorkflows); - await this.createModuleWorkflowLaunchers(baseCommandsDir, groupedWorkflows); - - return { generated: generatedCount }; - } - async collectWorkflowArtifacts(bmadDir) { const workflows = await this.loadWorkflowManifest(bmadDir); @@ -66,8 +24,7 @@ class WorkflowCommandGenerator { const artifacts = []; for (const workflow of allWorkflows) { - const commandContent = await this.generateCommandContent(workflow, bmadDir); - // Calculate the relative workflow path (e.g., bmm/workflows/4-implementation/sprint-planning/workflow.yaml) + // Calculate the relative workflow path (e.g., bmm/workflows/4-implementation/sprint-planning/workflow.md) let workflowRelPath = workflow.path || ''; // Normalize path separators for cross-platform compatibility workflowRelPath = workflowRelPath.replaceAll('\\', '/'); @@ -85,18 +42,14 @@ class WorkflowCommandGenerator { workflowRelPath = `${match[1]}/${match[2]}`; } } - // Determine if this is a YAML workflow (use normalized path which is guaranteed to be a string) - const isYamlWorkflow = workflowRelPath.endsWith('.yaml') || workflowRelPath.endsWith('.yml'); artifacts.push({ type: 'workflow-command', - isYamlWorkflow: isYamlWorkflow, // For template selection name: workflow.name, description: workflow.description || `${workflow.name} workflow`, module: workflow.module, canonicalId: workflow.canonicalId || '', relativePath: path.join(workflow.module, 'workflows', `${workflow.name}.md`), workflowPath: workflowRelPath, // Relative path to actual workflow file - content: commandContent, sourcePath: workflow.path, }); } @@ -121,46 +74,6 @@ class WorkflowCommandGenerator { }; } - /** - * Generate command content for a workflow - */ - async generateCommandContent(workflow, bmadDir) { - // Determine template based on workflow file type - const isMarkdownWorkflow = workflow.path.endsWith('workflow.md'); - const templateName = isMarkdownWorkflow ? 'workflow-commander.md' : 'workflow-command-template.md'; - const templatePath = path.join(path.dirname(this.templatePath), templateName); - - // Load the appropriate template - const template = await fs.readFile(templatePath, 'utf8'); - - // Convert source path to installed path - // From: /Users/.../src/bmm/workflows/.../workflow.yaml - // To: {project-root}/_bmad/bmm/workflows/.../workflow.yaml - let workflowPath = workflow.path; - - // Extract the relative path from source - if (workflowPath.includes('/src/bmm/')) { - // bmm is directly under src/ - const match = workflowPath.match(/\/src\/bmm\/(.+)/); - if (match) { - workflowPath = `${this.bmadFolderName}/bmm/${match[1]}`; - } - } else if (workflowPath.includes('/src/core/')) { - const match = workflowPath.match(/\/src\/core\/(.+)/); - if (match) { - workflowPath = `${this.bmadFolderName}/core/${match[1]}`; - } - } - - // Replace template variables - return template - .replaceAll('{{name}}', workflow.name) - .replaceAll('{{module}}', workflow.module) - .replaceAll('{{description}}', workflow.description) - .replaceAll('{{workflow_path}}', workflowPath) - .replaceAll('_bmad', this.bmadFolderName); - } - /** * Create workflow launcher files for each module */ @@ -218,10 +131,9 @@ class WorkflowCommandGenerator { ## Execution When running any workflow: -1. LOAD {project-root}/${this.bmadFolderName}/core/tasks/workflow.xml -2. Pass the workflow path as 'workflow-config' parameter -3. Follow workflow.xml instructions EXACTLY -4. Save outputs after EACH section +1. LOAD the workflow.md file at the path shown above +2. READ its entire contents and follow its directions exactly +3. Save outputs after EACH section ## Modes - Normal: Full interaction @@ -262,58 +174,6 @@ When running any workflow: skip_empty_lines: true, }); } - - /** - * Write workflow command artifacts using underscore format (Windows-compatible) - * Creates flat files like: bmad_bmm_correct-course.md - * - * @param {string} baseCommandsDir - Base commands directory for the IDE - * @param {Array} artifacts - Workflow artifacts - * @returns {number} Count of commands written - */ - async writeColonArtifacts(baseCommandsDir, artifacts) { - let writtenCount = 0; - - for (const artifact of artifacts) { - if (artifact.type === 'workflow-command') { - // Convert relativePath to underscore format: bmm/workflows/correct-course.md → bmad_bmm_correct-course.md - const flatName = toColonPath(artifact.relativePath); - const commandPath = path.join(baseCommandsDir, flatName); - await fs.ensureDir(path.dirname(commandPath)); - await fs.writeFile(commandPath, artifact.content); - writtenCount++; - } - } - - return writtenCount; - } - - /** - * Write workflow command artifacts using dash format (NEW STANDARD) - * Creates flat files like: bmad-bmm-correct-course.md - * - * Note: Workflows do NOT have bmad-agent- prefix - only agents do. - * - * @param {string} baseCommandsDir - Base commands directory for the IDE - * @param {Array} artifacts - Workflow artifacts - * @returns {number} Count of commands written - */ - async writeDashArtifacts(baseCommandsDir, artifacts) { - let writtenCount = 0; - - for (const artifact of artifacts) { - if (artifact.type === 'workflow-command') { - // Convert relativePath to dash format: bmm/workflows/correct-course.md → bmad-bmm-correct-course.md - const flatName = toDashPath(artifact.relativePath); - const commandPath = path.join(baseCommandsDir, flatName); - await fs.ensureDir(path.dirname(commandPath)); - await fs.writeFile(commandPath, artifact.content); - writtenCount++; - } - } - - return writtenCount; - } } module.exports = { WorkflowCommandGenerator }; diff --git a/tools/cli/installers/lib/ide/templates/combined/default-workflow-yaml.md b/tools/cli/installers/lib/ide/templates/combined/default-workflow-yaml.md deleted file mode 100644 index 4a8da26e7..000000000 --- a/tools/cli/installers/lib/ide/templates/combined/default-workflow-yaml.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: '{{name}}' -description: '{{description}}' ---- - -IT IS CRITICAL THAT YOU FOLLOW THESE STEPS - while staying in character as the current agent persona you may have loaded: - - -1. Always LOAD the FULL {project-root}/{{bmadFolderName}}/core/tasks/workflow.xml -2. READ its entire contents - this is the CORE OS for EXECUTING the specific workflow-config {project-root}/{{bmadFolderName}}/{{path}} -3. Pass the yaml path {project-root}/{{bmadFolderName}}/{{path}} as 'workflow-config' parameter to the workflow.xml instructions -4. Follow workflow.xml instructions EXACTLY as written to process and follow the specific workflow config and its instructions -5. Save outputs after EACH section when generating any documents from templates - diff --git a/tools/cli/installers/lib/ide/templates/combined/kiro-workflow-yaml.md b/tools/cli/installers/lib/ide/templates/combined/kiro-workflow-yaml.md deleted file mode 100644 index 4ee4e0824..000000000 --- a/tools/cli/installers/lib/ide/templates/combined/kiro-workflow-yaml.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -inclusion: manual ---- - -# {{name}} - -IT IS CRITICAL THAT YOU FOLLOW THESE STEPS - while staying in character as the current agent persona you may have loaded: - - -1. Always LOAD the FULL #[[file:{{bmadFolderName}}/core/tasks/workflow.xml]] -2. READ its entire contents - this is the CORE OS for EXECUTING the specific workflow-config #[[file:{{bmadFolderName}}/{{path}}]] -3. Pass the yaml path {{bmadFolderName}}/{{path}} as 'workflow-config' parameter to the workflow.xml instructions -4. Follow workflow.xml instructions EXACTLY as written to process and follow the specific workflow config and its instructions -5. Save outputs after EACH section when generating any documents from templates - diff --git a/tools/cli/installers/lib/ide/templates/workflow-command-template.md b/tools/cli/installers/lib/ide/templates/workflow-command-template.md deleted file mode 100644 index 328983c9e..000000000 --- a/tools/cli/installers/lib/ide/templates/workflow-command-template.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -description: '{{description}}' ---- - -IT IS CRITICAL THAT YOU FOLLOW THESE STEPS - while staying in character as the current agent persona you may have loaded: - - -1. Always LOAD the FULL {project-root}/_bmad/core/tasks/workflow.xml -2. READ its entire contents - this is the CORE OS for EXECUTING the specific workflow-config {project-root}/{{workflow_path}} -3. Pass the yaml path {{workflow_path}} as 'workflow-config' parameter to the workflow.xml instructions -4. Follow workflow.xml instructions EXACTLY as written to process and follow the specific workflow config and its instructions -5. Save outputs after EACH section when generating any documents from templates - diff --git a/tools/cli/installers/lib/ide/templates/workflow-commander.md b/tools/cli/installers/lib/ide/templates/workflow-commander.md deleted file mode 100644 index 66eee15d1..000000000 --- a/tools/cli/installers/lib/ide/templates/workflow-commander.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -description: '{{description}}' ---- - -IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL {project-root}/{{workflow_path}}, READ its entire contents and follow its directions exactly! diff --git a/tools/cli/installers/lib/modules/manager.js b/tools/cli/installers/lib/modules/manager.js index f162593b7..7ac85678b 100644 --- a/tools/cli/installers/lib/modules/manager.js +++ b/tools/cli/installers/lib/modules/manager.js @@ -762,14 +762,8 @@ class ModuleManager { } } - // Check if this is a workflow.yaml file - if (file.endsWith('workflow.yaml')) { - await fs.ensureDir(path.dirname(targetFile)); - await this.copyWorkflowYamlStripped(sourceFile, targetFile); - } else { - // Copy the file with placeholder replacement - await this.copyFileWithPlaceholderReplacement(sourceFile, targetFile); - } + // Copy the file with placeholder replacement + await this.copyFileWithPlaceholderReplacement(sourceFile, targetFile); // Track the file if callback provided if (fileTrackingCallback) { @@ -778,92 +772,6 @@ class ModuleManager { } } - /** - * Copy workflow.yaml file with web_bundle section stripped - * Preserves comments, formatting, and line breaks - * @param {string} sourceFile - Source workflow.yaml file path - * @param {string} targetFile - Target workflow.yaml file path - */ - async copyWorkflowYamlStripped(sourceFile, targetFile) { - // Read the source YAML file - let yamlContent = await fs.readFile(sourceFile, 'utf8'); - - // IMPORTANT: Replace escape sequence and placeholder BEFORE parsing YAML - // Otherwise parsing will fail on the placeholder - yamlContent = yamlContent.replaceAll('_bmad', this.bmadFolderName); - - try { - // First check if web_bundle exists by parsing - const workflowConfig = yaml.parse(yamlContent); - - if (workflowConfig.web_bundle === undefined) { - // No web_bundle section, just write (placeholders already replaced above) - await fs.writeFile(targetFile, yamlContent, 'utf8'); - return; - } - - // Find the line that starts web_bundle - const lines = yamlContent.split('\n'); - let startIdx = -1; - let endIdx = -1; - let baseIndent = 0; - - // Find the start of web_bundle section - for (const [i, line] of lines.entries()) { - const match = line.match(/^(\s*)web_bundle:/); - if (match) { - startIdx = i; - baseIndent = match[1].length; - break; - } - } - - if (startIdx === -1) { - // web_bundle not found in text (shouldn't happen), copy as-is - await fs.writeFile(targetFile, yamlContent, 'utf8'); - return; - } - - // Find the end of web_bundle section - // It ends when we find a line with same or less indentation that's not empty/comment - endIdx = startIdx; - for (let i = startIdx + 1; i < lines.length; i++) { - const line = lines[i]; - - // Skip empty lines and comments - if (line.trim() === '' || line.trim().startsWith('#')) { - continue; - } - - // Check indentation - const indent = line.match(/^(\s*)/)[1].length; - if (indent <= baseIndent) { - // Found next section at same or lower indentation - endIdx = i - 1; - break; - } - } - - // If we didn't find an end, it goes to end of file - if (endIdx === startIdx) { - endIdx = lines.length - 1; - } - - // Remove the web_bundle section (including the line before if it's just a blank line) - const newLines = [...lines.slice(0, startIdx), ...lines.slice(endIdx + 1)]; - - // Clean up any double blank lines that might result - const strippedYaml = newLines.join('\n').replaceAll(/\n\n\n+/g, '\n\n'); - - // Placeholders already replaced at the beginning of this function - await fs.writeFile(targetFile, strippedYaml, 'utf8'); - } catch { - // If anything fails, just copy the file as-is - await prompts.log.warn(` Could not process ${path.basename(sourceFile)}, copying as-is`); - await fs.copy(sourceFile, targetFile, { overwrite: true }); - } - } - /** * Compile .agent.yaml files to .md format in modules * @param {string} sourcePath - Source module path @@ -1165,13 +1073,11 @@ class ModuleManager { await prompts.log.message(` Processing: ${agentFile}`); for (const item of workflowInstallItems) { - const sourceWorkflowPath = item.workflow; // Where to copy FROM + const sourceWorkflowPath = item.exec; // Where to copy FROM const installWorkflowPath = item['workflow-install']; // Where to copy TO // Parse SOURCE workflow path - // Handle both _bmad placeholder and hardcoded 'bmad' - // Example: {project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml - // Or: {project-root}/bmad/bmm/workflows/4-implementation/create-story/workflow.yaml + // Example: {project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md const sourceMatch = sourceWorkflowPath.match(/\{project-root\}\/(?:_bmad)\/([^/]+)\/workflows\/(.+)/); if (!sourceMatch) { await prompts.log.warn(` Could not parse workflow path: ${sourceWorkflowPath}`); @@ -1181,9 +1087,8 @@ class ModuleManager { const [, sourceModule, sourceWorkflowSubPath] = sourceMatch; // Parse INSTALL workflow path - // Handle_bmad - // Example: {project-root}/_bmad/bmgd/workflows/4-production/create-story/workflow.yaml - const installMatch = installWorkflowPath.match(/\{project-root\}\/(_bmad)\/([^/]+)\/workflows\/(.+)/); + // Example: {project-root}/_bmad/bmgd/workflows/4-production/create-story/workflow.md + const installMatch = installWorkflowPath.match(/\{project-root\}\/(?:_bmad)\/([^/]+)\/workflows\/(.+)/); if (!installMatch) { await prompts.log.warn(` Could not parse workflow-install path: ${installWorkflowPath}`); continue; @@ -1192,9 +1097,9 @@ class ModuleManager { const installWorkflowSubPath = installMatch[2]; const sourceModulePath = getModulePath(sourceModule); - const actualSourceWorkflowPath = path.join(sourceModulePath, 'workflows', sourceWorkflowSubPath.replace(/\/workflow\.yaml$/, '')); + const actualSourceWorkflowPath = path.join(sourceModulePath, 'workflows', sourceWorkflowSubPath.replace(/\/workflow\.md$/, '')); - const actualDestWorkflowPath = path.join(targetPath, 'workflows', installWorkflowSubPath.replace(/\/workflow\.yaml$/, '')); + const actualDestWorkflowPath = path.join(targetPath, 'workflows', installWorkflowSubPath.replace(/\/workflow\.md$/, '')); // Check if source workflow exists if (!(await fs.pathExists(actualSourceWorkflowPath))) { @@ -1204,18 +1109,12 @@ class ModuleManager { // Copy the entire workflow folder await prompts.log.message( - ` Vendoring: ${sourceModule}/workflows/${sourceWorkflowSubPath.replace(/\/workflow\.yaml$/, '')} → ${moduleName}/workflows/${installWorkflowSubPath.replace(/\/workflow\.yaml$/, '')}`, + ` Vendoring: ${sourceModule}/workflows/${sourceWorkflowSubPath.replace(/\/workflow\.md$/, '')} → ${moduleName}/workflows/${installWorkflowSubPath.replace(/\/workflow\.md$/, '')}`, ); await fs.ensureDir(path.dirname(actualDestWorkflowPath)); // Copy the workflow directory recursively with placeholder replacement await this.copyDirectoryWithPlaceholderReplacement(actualSourceWorkflowPath, actualDestWorkflowPath); - - // Update the workflow.yaml config_source reference - const workflowYamlPath = path.join(actualDestWorkflowPath, 'workflow.yaml'); - if (await fs.pathExists(workflowYamlPath)) { - await this.updateWorkflowConfigSource(workflowYamlPath, moduleName); - } } } @@ -1224,28 +1123,6 @@ class ModuleManager { } } - /** - * Update workflow.yaml config_source to point to new module - * @param {string} workflowYamlPath - Path to workflow.yaml file - * @param {string} newModuleName - New module name to reference - */ - async updateWorkflowConfigSource(workflowYamlPath, newModuleName) { - let yamlContent = await fs.readFile(workflowYamlPath, 'utf8'); - - // Replace config_source: "{project-root}/_bmad/OLD_MODULE/config.yaml" - // with config_source: "{project-root}/_bmad/NEW_MODULE/config.yaml" - // Note: At this point _bmad has already been replaced with actual folder name - const configSourcePattern = /config_source:\s*["']?\{project-root\}\/[^/]+\/[^/]+\/config\.yaml["']?/g; - const newConfigSource = `config_source: "{project-root}/${this.bmadFolderName}/${newModuleName}/config.yaml"`; - - const updatedYaml = yamlContent.replaceAll(configSourcePattern, newConfigSource); - - if (updatedYaml !== yamlContent) { - await fs.writeFile(workflowYamlPath, updatedYaml, 'utf8'); - await prompts.log.message(` Updated config_source to: ${this.bmadFolderName}/${newModuleName}/config.yaml`); - } - } - /** * Create directories declared in module.yaml's `directories` key * This replaces the security-risky module installer pattern with declarative config diff --git a/tools/cli/lib/agent-analyzer.js b/tools/cli/lib/agent-analyzer.js index ae834a098..a62bdd7cf 100644 --- a/tools/cli/lib/agent-analyzer.js +++ b/tools/cli/lib/agent-analyzer.js @@ -39,16 +39,10 @@ class AgentAnalyzer { if (Array.isArray(execArray)) { for (const exec of execArray) { if (exec.route) { - // Check if route is a workflow or exec - if (exec.route.endsWith('.yaml') || exec.route.endsWith('.yml')) { - profile.usedAttributes.add('workflow'); - } else { - profile.usedAttributes.add('exec'); - } + profile.usedAttributes.add('exec'); } - if (exec.workflow) profile.usedAttributes.add('workflow'); if (exec.action) profile.usedAttributes.add('action'); - if (exec.type && ['exec', 'action', 'workflow'].includes(exec.type)) { + if (exec.type && ['exec', 'action'].includes(exec.type)) { profile.usedAttributes.add(exec.type); } } @@ -57,12 +51,6 @@ class AgentAnalyzer { } } else { // Check for each possible attribute in legacy items - if (item.workflow) { - profile.usedAttributes.add('workflow'); - } - if (item['validate-workflow']) { - profile.usedAttributes.add('validate-workflow'); - } if (item.exec) { profile.usedAttributes.add('exec'); } diff --git a/tools/cli/lib/agent/compiler.js b/tools/cli/lib/agent/compiler.js index f9f71baab..cc91f9bd6 100644 --- a/tools/cli/lib/agent/compiler.js +++ b/tools/cli/lib/agent/compiler.js @@ -147,7 +147,6 @@ function buildMenuXml(menuItems) { const attrs = [`cmd="${trigger}"`]; // Add handler attributes - if (item.workflow) attrs.push(`workflow="${item.workflow}"`); if (item.exec) attrs.push(`exec="${item.exec}"`); if (item.tmpl) attrs.push(`tmpl="${item.tmpl}"`); if (item.data) attrs.push(`data="${item.data}"`); @@ -187,8 +186,6 @@ function buildNestedHandlers(triggers) { // Add handler attributes based on exec data if (execData.route) attrs.push(`exec="${execData.route}"`); - if (execData.workflow) attrs.push(`workflow="${execData.workflow}"`); - if (execData['validate-workflow']) attrs.push(`validate-workflow="${execData['validate-workflow']}"`); if (execData.action) attrs.push(`action="${execData.action}"`); if (execData.data) attrs.push(`data="${execData.data}"`); if (execData.tmpl) attrs.push(`tmpl="${execData.tmpl}"`); @@ -212,7 +209,6 @@ function processExecArray(execArray) { const result = { description: '', route: null, - workflow: null, data: null, action: null, type: null, @@ -229,12 +225,7 @@ function processExecArray(execArray) { } if (exec.route) { - // Determine if it's a workflow or exec based on file extension or context - if (exec.route.endsWith('.yaml') || exec.route.endsWith('.yml')) { - result.workflow = exec.route; - } else { - result.route = exec.route; - } + result.route = exec.route; } if (exec.data !== null && exec.data !== undefined) { diff --git a/tools/cli/lib/yaml-xml-builder.js b/tools/cli/lib/yaml-xml-builder.js index ac140814f..f4f8e2f5a 100644 --- a/tools/cli/lib/yaml-xml-builder.js +++ b/tools/cli/lib/yaml-xml-builder.js @@ -367,15 +367,6 @@ class YamlXmlBuilder { const attrs = [`cmd="${trigger}"`]; // Add handler attributes - // If workflow-install exists, use its value for workflow attribute (vendoring) - // workflow-install is build-time metadata - tells installer where to copy workflows - // The final XML should only have workflow pointing to the install location - if (item['workflow-install']) { - attrs.push(`workflow="${item['workflow-install']}"`); - } else if (item.workflow) { - attrs.push(`workflow="${item.workflow}"`); - } - if (item['validate-workflow']) attrs.push(`validate-workflow="${item['validate-workflow']}"`); if (item.exec) attrs.push(`exec="${item.exec}"`); if (item.tmpl) attrs.push(`tmpl="${item.tmpl}"`); @@ -417,8 +408,6 @@ class YamlXmlBuilder { // Add handler attributes based on exec data if (execData.route) attrs.push(`exec="${execData.route}"`); - if (execData.workflow) attrs.push(`workflow="${execData.workflow}"`); - if (execData['validate-workflow']) attrs.push(`validate-workflow="${execData['validate-workflow']}"`); if (execData.action) attrs.push(`action="${execData.action}"`); if (execData.data) attrs.push(`data="${execData.data}"`); if (execData.tmpl) attrs.push(`tmpl="${execData.tmpl}"`); @@ -442,7 +431,6 @@ class YamlXmlBuilder { const result = { description: '', route: null, - workflow: null, data: null, action: null, type: null, @@ -459,12 +447,7 @@ class YamlXmlBuilder { } if (exec.route) { - // Determine if it's a workflow or exec based on file extension or context - if (exec.route.endsWith('.yaml') || exec.route.endsWith('.yml')) { - result.workflow = exec.route; - } else { - result.route = exec.route; - } + result.route = exec.route; } if (exec.data !== null && exec.data !== undefined) { diff --git a/tools/schema/agent.js b/tools/schema/agent.js index 93ced7c6e..dfec1322f 100644 --- a/tools/schema/agent.js +++ b/tools/schema/agent.js @@ -2,7 +2,7 @@ const assert = require('node:assert'); const { z } = require('zod'); -const COMMAND_TARGET_KEYS = ['workflow', 'validate-workflow', 'exec', 'action', 'tmpl', 'data']; +const COMMAND_TARGET_KEYS = ['validate-workflow', 'exec', 'action', 'tmpl', 'data']; const TRIGGER_PATTERN = /^[a-z0-9]+(?:-[a-z0-9]+)*$/; const COMPOUND_TRIGGER_PATTERN = /^([A-Z]{1,3}) or fuzzy match on ([a-z0-9]+(?:-[a-z0-9]+)*)$/; @@ -273,8 +273,6 @@ function buildMenuItemSchema() { .object({ trigger: createNonEmptyString('agent.menu[].trigger'), description: createNonEmptyString('agent.menu[].description'), - workflow: createNonEmptyString('agent.menu[].workflow').optional(), - 'workflow-install': createNonEmptyString('agent.menu[].workflow-install').optional(), 'validate-workflow': createNonEmptyString('agent.menu[].validate-workflow').optional(), exec: createNonEmptyString('agent.menu[].exec').optional(), action: createNonEmptyString('agent.menu[].action').optional(),