From ee7f5a8969153ce63e116c242793f7b8513b62a9 Mon Sep 17 00:00:00 2001 From: Dicky Moore Date: Sun, 8 Feb 2026 19:43:46 +0000 Subject: [PATCH] fix: harden document workflow choices and config path handling --- .../workflows/4-implementation/dev-story/workflow.md | 2 +- src/bmm/workflows/document-project/instructions.md | 10 ++++++++++ tools/cli/installers/lib/modules/manager.js | 5 ++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/bmm/workflows/4-implementation/dev-story/workflow.md b/src/bmm/workflows/4-implementation/dev-story/workflow.md index 1d338fbe8..0a1a2f210 100644 --- a/src/bmm/workflows/4-implementation/dev-story/workflow.md +++ b/src/bmm/workflows/4-implementation/dev-story/workflow.md @@ -2,7 +2,7 @@ name: dev-story description: "Execute a story by implementing tasks/subtasks, writing tests, validating, and updating the story file per acceptance criteria" projectRoot: '{project-root}' -main_config: '{projectRoot}/_bmad/bmm/config.yaml' +main_config: '{project-root}/_bmad/bmm/config.yaml' web_bundle: false --- diff --git a/src/bmm/workflows/document-project/instructions.md b/src/bmm/workflows/document-project/instructions.md index 44caa6e45..8b2269913 100644 --- a/src/bmm/workflows/document-project/instructions.md +++ b/src/bmm/workflows/document-project/instructions.md @@ -163,6 +163,11 @@ Your choice [1/2/3]: Exit workflow + + Invalid selection. Expected 1, 2, or 3. Exiting workflow without changes. + Exit workflow + + @@ -220,6 +225,11 @@ Your choice [1/2/3]: Display message: "Keeping existing documentation. Exiting workflow." Exit workflow + + + Invalid selection. Expected 1, 2, or 3. Exiting workflow without changes. + Exit workflow + diff --git a/tools/cli/installers/lib/modules/manager.js b/tools/cli/installers/lib/modules/manager.js index 508cdcf98..05109dbca 100644 --- a/tools/cli/installers/lib/modules/manager.js +++ b/tools/cli/installers/lib/modules/manager.js @@ -810,6 +810,8 @@ class ModuleManager { return content; } + const newline = frontmatterMatch[0].includes('\r\n') ? '\r\n' : '\n'; + try { const yaml = require('yaml'); const parsed = yaml.parse(frontmatterMatch[1]); @@ -827,7 +829,8 @@ class ModuleManager { }) .trimEnd(); - return content.replace(frontmatterMatch[0], `---\n${serialized}\n---`); + const normalized = newline === '\r\n' ? serialized.replaceAll('\n', '\r\n') : serialized; + return content.replace(frontmatterMatch[0], `---${newline}${normalized}${newline}---`); } catch (error) { console.warn(`Warning: Failed to parse workflow frontmatter for web_bundle removal: ${error.message}`); return content;