@hyperdrive.bot/bmad-workflow 1.0.21 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -730,6 +730,13 @@ export declare class WorkflowOrchestrator {
730
730
  * @private
731
731
  */
732
732
  private sleep;
733
+ /**
734
+ * Parse the `### Dev Context` section from a story file's content.
735
+ *
736
+ * Returns sidecar reference paths and an optional deploy target string.
737
+ * If the section is missing or empty, returns empty arrays / undefined (backward compatible).
738
+ */
739
+ private parseDevContext;
733
740
  /**
734
741
  * Update story status in file
735
742
  *
@@ -632,8 +632,10 @@ Write output to: ${outputPath}`;
632
632
  prompt += `Working directory: ${config.cwd}\n\n`;
633
633
  }
634
634
  prompt += `*develop-story ${storyFilePath}\n\n`;
635
- // Combine auto-detected references with user-provided references
636
- const allReferences = [...autoReferences, ...(config.references || [])];
635
+ // Parse Dev Context section for sidecars and deploy target
636
+ const devContext = this.parseDevContext(storyContent);
637
+ // Combine auto-detected references with user-provided references and sidecars
638
+ const allReferences = [...autoReferences, ...(config.references || []), ...devContext.sidecarRefs];
637
639
  if (allReferences.length > 0) {
638
640
  prompt += 'References:\n';
639
641
  for (const ref of allReferences) {
@@ -641,6 +643,10 @@ Write output to: ${outputPath}`;
641
643
  }
642
644
  prompt += '\n';
643
645
  }
646
+ // Add deploy target context if specified in story
647
+ if (devContext.deployTarget) {
648
+ prompt += `Deploy target: ${devContext.deployTarget}\n\n`;
649
+ }
644
650
  prompt += '*yolo mode*\n';
645
651
  // Generate unique spawn ID
646
652
  const spawnId = `dev-${story.fullNumber}-${storyStartTime}`;
@@ -907,8 +913,10 @@ Write output to: ${outputPath}`;
907
913
  prompt += `Working directory: ${config.cwd}\n\n`;
908
914
  }
909
915
  prompt += `Implement story: ${storyFilePath}\n\n`;
910
- // Combine auto-detected references with user-provided references
911
- const allReferences = [...autoReferences, ...(config.references || [])];
916
+ // Parse Dev Context section for sidecars and deploy target
917
+ const devContext = this.parseDevContext(storyContent);
918
+ // Combine auto-detected references with user-provided references and sidecars
919
+ const allReferences = [...autoReferences, ...(config.references || []), ...devContext.sidecarRefs];
912
920
  if (allReferences.length > 0) {
913
921
  prompt += 'References:\n';
914
922
  for (const ref of allReferences) {
@@ -916,6 +924,10 @@ Write output to: ${outputPath}`;
916
924
  }
917
925
  prompt += '\n';
918
926
  }
927
+ // Add deploy target context if specified in story
928
+ if (devContext.deployTarget) {
929
+ prompt += `Deploy target: ${devContext.deployTarget}\n\n`;
930
+ }
919
931
  prompt += '*yolo mode*\n';
920
932
  // Generate unique spawn ID and timestamp
921
933
  const spawnStartTime = Date.now();
@@ -3085,6 +3097,49 @@ Write output to: ${outputPath}`;
3085
3097
  async sleep(ms) {
3086
3098
  await new Promise((resolve) => setTimeout(resolve, ms));
3087
3099
  }
3100
+ /**
3101
+ * Parse the `### Dev Context` section from a story file's content.
3102
+ *
3103
+ * Returns sidecar reference paths and an optional deploy target string.
3104
+ * If the section is missing or empty, returns empty arrays / undefined (backward compatible).
3105
+ */
3106
+ parseDevContext(storyContent) {
3107
+ const sidecarRefs = [];
3108
+ let deployTarget;
3109
+ // Find the ### Dev Context section
3110
+ const devCtxMatch = storyContent.match(/^### Dev Context\s*$/m);
3111
+ if (!devCtxMatch || devCtxMatch.index === undefined) {
3112
+ return { deployTarget, sidecarRefs };
3113
+ }
3114
+ // Extract section content up to the next heading or end of file
3115
+ const sectionStart = devCtxMatch.index + devCtxMatch[0].length;
3116
+ const nextHeadingMatch = storyContent.slice(sectionStart).match(/^#{1,3} /m);
3117
+ const sectionEnd = nextHeadingMatch?.index !== undefined ? sectionStart + nextHeadingMatch.index : storyContent.length;
3118
+ const sectionContent = storyContent.slice(sectionStart, sectionEnd);
3119
+ // Parse Sidecars line — supports "- **Sidecars:**" or "- Sidecars:" (flexible)
3120
+ const sidecarsMatch = sectionContent.match(/^-\s+\*{0,2}Sidecars:?\*{0,2}\s*(.+)$/im);
3121
+ if (sidecarsMatch?.[1]) {
3122
+ const raw = sidecarsMatch[1].trim();
3123
+ for (const part of raw.split(',')) {
3124
+ const name = part.trim();
3125
+ if (name.length === 0)
3126
+ continue;
3127
+ // If already a path, use as-is; otherwise prefix with _bmad/bmm/agents/
3128
+ if (name.includes('/')) {
3129
+ sidecarRefs.push(name);
3130
+ }
3131
+ else {
3132
+ sidecarRefs.push(`_bmad/bmm/agents/${name}`);
3133
+ }
3134
+ }
3135
+ }
3136
+ // Parse Deploy target line
3137
+ const deployMatch = sectionContent.match(/^-\s+\*{0,2}Deploy target:?\*{0,2}\s*(.+)$/im);
3138
+ if (deployMatch?.[1]) {
3139
+ deployTarget = deployMatch[1].trim();
3140
+ }
3141
+ return { deployTarget, sidecarRefs };
3142
+ }
3088
3143
  /**
3089
3144
  * Update story status in file
3090
3145
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hyperdrive.bot/bmad-workflow",
3
3
  "description": "AI-driven development workflow orchestration CLI for BMAD projects",
4
- "version": "1.0.21",
4
+ "version": "1.0.22",
5
5
  "author": {
6
6
  "name": "DevSquad",
7
7
  "email": "marcelo@devsquad.email",