Skip to content

chore(sprint-planning): convert workflow.yaml to unified workflow.md#1856

Merged
alexeyv merged 2 commits intobmad-code-org:mainfrom
alexeyv:convert-sprint-planning-yaml-to-md
Mar 8, 2026
Merged

chore(sprint-planning): convert workflow.yaml to unified workflow.md#1856
alexeyv merged 2 commits intobmad-code-org:mainfrom
alexeyv:convert-sprint-planning-yaml-to-md

Conversation

@alexeyv
Copy link
Copy Markdown
Collaborator

@alexeyv alexeyv commented Mar 8, 2026

Summary

  • Merge workflow.yaml config and instructions.md into a single self-contained workflow.md for the sprint-planning workflow
  • Drop engine scaffolding (<critical> tags, step 0.5 invoke-protocol) — behavioral instructions fully preserved
  • Step 4 of 9 in the yaml-to-md conversion plan

Test plan

  • All 197 pre-commit tests pass (agent schemas, installation components, file refs, linting, formatting)
  • Ran OLD vs NEW format comparison across 5 test fixtures (happy path, multiple epic files, status preservation, story file detection, empty epic) — 0 conversion bugs, 5/5 match
  • One pre-existing spec ambiguity identified (epic auto-activation on story file detection) — not caused by this change
  • Review that no behavioral instructions were lost from instructions.md
  • Review that all config variables from workflow.yaml are present in INITIALIZATION section

…ified 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).
@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 8, 2026

🤖 Augment PR Summary

Summary: Converts the Sprint Planning workflow from a split workflow.yaml + instructions.md setup into a single unified workflow.md.

Changes:

  • Renames instructions.mdworkflow.md and adds frontmatter (name, description).
  • Moves prior YAML configuration (config keys, paths, input patterns, context) into an INITIALIZATION section.
  • Removes legacy engine scaffolding (critical tags / protocol step) and deletes the standalone workflow.yaml.

Technical Notes: Workflow still FULL_LOADs epics from planning artifacts and generates sprint-status.yaml under implementation artifacts.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 8, 2026

📝 Walkthrough

Walkthrough

The sprint-planning workflow is being restructured by consolidating its configuration from a separate YAML file into the markdown documentation. The workflow.yaml is removed entirely, and the workflow.md is expanded with explicit initialization, configuration sections, path definitions, and a clearer Scrum Master role orientation, reorganizing the execution flow.

Changes

Cohort / File(s) Summary
Sprint Planning Workflow Documentation
src/bmm/workflows/4-implementation/sprint-planning/workflow.md
Restructured and expanded with comprehensive initialization, explicit path definitions, derived fields, Epic loading strategies, Goals/Role clarification, and reorganized execution flow with Document Discovery section. Removed implicit setup in favor of explicit configuration.
Sprint Planning Workflow Configuration
src/bmm/workflows/4-implementation/sprint-planning/workflow.yaml
Removed YAML configuration file previously containing workflow variables, components, paths, input/output definitions, and Epic loading strategies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • BMAD-METHOD#1608: Modifies sprint-planning workflow configuration including paths, inputs, and reorganization of top-level variables for output folder and Epic locations.
  • BMAD-METHOD#1358: Updates sprint-status.yaml generation and synchronization across sprint-planning and correct-course workflows.
  • BMAD-METHOD#1107: Modifies sprint-planning workflow documentation and status/loading behavior alongside state and workflow status updates.

Suggested reviewers

  • pbean
  • cecil-the-coder
  • bmadcode
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: converting workflow.yaml to unified workflow.md for sprint-planning, which aligns with the changeset.
Description check ✅ Passed The description is well-related to the changeset, explaining the merge of workflow.yaml and instructions.md, removal of engine scaffolding, test results, and pending reviews.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (8)
src/bmm/workflows/4-implementation/sprint-planning/workflow.md (8)

117-120: ⚠️ Potential issue | 🟠 Major

This lookup only works for a flat stories directory.

Checking {story_location_absolute}/{story-key}.md assumes every story file sits directly under {implementation_artifacts}. The dev-story workflow searches by story-key pattern within {implementation_artifacts}, so nested story folders are already a supported shape elsewhere. Sprint planning will under-detect ready stories in those repos.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md` around lines
117 - 120, The sprint-planning story file lookup currently only checks a single
path pattern `{story_location_absolute}/{story-key}.md`, which misses nested
story files; update the detection logic to mirror the dev-story workflow by
performing a recursive/glob search for files matching `**/{story-key}.md` under
`{implementation_artifacts}` (or otherwise use the same search routine used by
dev-story), so `story-key` matches are discovered in nested folders and statuses
are correctly upgraded to at least `ready-for-dev`.

122-126: ⚠️ Potential issue | 🟠 Major

Status preservation cannot work without reading the current {status_file} first.

The workflow promises to preserve more advanced existing statuses, but there is no step that loads and parses the current sprint-status file before recomputing entries. As written, reruns rebuild from epics and filesystem only.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md` around lines
122 - 126, The preservation rule refers to an existing {status_file} but the
workflow never reads it; add a step to load and parse the current {status_file}
into an in-memory map (e.g., existingStatuses) before recomputing sprint
entries, then merge new statuses with existingStatuses so that any existing
"more advanced" state is kept and downgrades are prevented (ensure merge logic
enforces "never downgrade" semantics when combining computedStatus ->
existingStatuses); update the recompute step (where entries are built from
epics/filesystem) to consult this map and write the merged result back to
{status_file}.

187-200: ⚠️ Potential issue | 🟠 Major

Validate before replacing the existing sprint-status file.

Line 187 writes {status_file} first, and only Lines 193-200 validate it. If the YAML is malformed or the status map is inconsistent, the workflow has already clobbered the previous good file. Generate in memory or a temp file, validate, then replace atomically.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md` around lines
187 - 200, The workflow currently writes to {status_file} before performing the
validation in step n="5", risking loss of the previous good file; instead, write
the complete sprint status YAML to a temporary buffer or temp file, perform the
validation checks listed in step n="5" (presence of all epics and stories,
retrospectives, no extraneous items, legal status values, and valid YAML syntax,
and ordering: epic → its stories → its retrospective → next epic), and only
after all validations pass atomically replace {status_file} (e.g., write
adjacent temp file and fs.rename/atomic move) so the original file is never
clobbered on validation failure.

202-217: ⚠️ Potential issue | 🟡 Minor

Use one placeholder name for the "epics in progress" count.

Line 206 defines {{in_progress_count}}, but Line 216 renders {{epics_in_progress_count}}. One of those values will be unset, so the completion summary is wrong or empty.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md` around lines
202 - 217, The template uses two different placeholders for the same metric:
{{in_progress_count}} (defined) and {{epics_in_progress_count}} (rendered); pick
one name and make both occurrences consistent—either change the header/count
definition to {{epics_in_progress_count}} or update the summary to use
{{in_progress_count}} so the "Epics in Progress" value is populated (locate the
placeholders in the sprint-planning workflow.md and make them identical).

58-77: ⚠️ Potential issue | 🟠 Major

The sharded discovery branch is documented, but not actually executed.

Lines 61-65 describe reading epics/index.md and then every listed shard, but Line 76 only performs a flat scan for {epics_pattern} under {epics_location}. A project that only has the sharded layout will never be fully loaded.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md` around lines
58 - 77, The workflow currently only performs a flat scan using
`{epics_pattern}` under `{epics_location}` and never follows the sharded-index
branch; update the implementation for the "Epic Discovery Process" and the
`<step n="1" goal="Parse epic files and extract all work items">` actions so
that if an `epics/index.md` (or any detected index file) is present you parse
that index (read `index.md`) and then explicitly iterate and load each shard
listed (e.g., `epic-1.md`, `epic-2.md`), merging their content before falling
back to the flat `{epics_pattern}` scan; ensure the code checks for both
whole-document and sharded layouts and respects the stated priority ("If both
whole and sharded versions exist, use the whole document") using the existing
`{epics_location}` and `{epics_pattern}` variables.

79-92: ⚠️ Potential issue | 🟠 Major

Add collision detection for generated story keys.

After slugging titles into kebab-case, two distinct headers can collapse to the same key. The same thing happens if both a whole epic document and its shards are loaded. YAML will keep only the last value, so one story disappears silently unless you validate uniqueness before writing development_status.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md` around lines
79 - 92, When generating kebab-case story keys (from epic/story headers) before
writing the development_status mapping, add collision detection: maintain a
global set/map of generated keys (include source identifier like filename and
header text), and on each new key check for existence; if a duplicate is found,
either fail with a clear error/log mentioning the conflicting key and both
sources or generate a deterministic disambiguator (e.g., append -2, -3) and
record the mapping so YAML won't silently overwrite an earlier story; ensure
this check runs in the epic/story extraction routine that converts `### Story
1.1: ...` to `1-1-...` and before writing the `development_status` output.

192-200: ⚠️ Potential issue | 🟠 Major

The validator is stricter than the official sprint-status reader.

sprint-status/workflow.md still accepts legacy story status drafted and epic status contexted, but this workflow's legality check excludes them. Rerunning sprint planning on an older project can now fail even though the downstream reader still supports those values.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md` around lines
192 - 200, The sprint-planning validator in the "Validate and report" step is
stricter than the official sprint-status reader because it disallows legacy
statuses 'drafted' (story) and 'contexted' (epic); update the legality check so
it aligns with sprint-status/workflow.md — either by adding 'drafted' and
'contexted' to the allowed status set used by the check (referenced in the
Validate and report step and any function performing "All status values are
legal") or by loading the canonical allowed-status list from the sprint-status
reader/state-machine definitions so the validator accepts the same legacy
values.

114-131: ⚠️ Potential issue | 🟠 Major

File existence is not enough to detect the current story status.

This logic can infer ready-for-dev, but it cannot recover in-progress, review, or done from story files. If {status_file} is missing or stale, stories already in flight get flattened back to ready-for-dev even though the story documents themselves carry richer state.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md` around lines
114 - 131, The current step n="3" logic only checks existence of
`{story_location_absolute}/{story-key}.md` and upgrades to `ready-for-dev`,
which incorrectly flattens stories already `in-progress`, `review`, or `done`;
update the detection to parse the story document and other sources for richer
state before deciding: inspect the story file for frontmatter/status fields or
in-body markers (e.g., "status:", badges, or explicit
`in-progress`/`review`/`done` tokens), check associated `{status_file}` and
preserve any more advanced status, and optionally consult VCS/PR metadata
(branch names or open PRs) to infer `in-progress`/`review`; ensure the code that
computes finalStatus never downgrades an existing more-advanced status and apply
this in the routine currently using `story_location_absolute`, `{story-key}.md`,
and `{status_file}`.
🧹 Nitpick comments (1)
src/bmm/workflows/4-implementation/sprint-planning/workflow.md (1)

18-25: document_output_language is loaded, but the workflow never applies it.

The chat response is tied to {communication_language}, but the generated YAML comments and notes are hardcoded in English. If this conversion is supposed to preserve both config channels, the document-generation path is still ignoring one of them.

Also applies to: 209-225

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md` around lines
18 - 25, The workflow loads document_output_language but never uses it when
emitting generated YAML comments/notes (they remain hardcoded English); update
the document-generation path so functions that render output (e.g., the code
that produces YAML comments/notes—look for routines named
generate_documentation, render_yaml_comments, build_notes, or similar) accept
and apply document_output_language in addition to communication_language, then
use that locale to format/translate all YAML comments and notes (either by
passing document_output_language into the templating/translation layer or
invoking the translator with that variable) so generated documents are emitted
in the configured document_output_language while agent messages continue using
communication_language.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md`:
- Around line 36-44: The epics glob is too narrow: update the configuration so
epics_pattern (and optionally epics_location) matches filenames like
bmm-epics.md and user-stories.md as described in the docs; for example replace
the current epics_pattern = `epic*.md` with a broader pattern (e.g., `*epic*.md`
or `*epics*.md`), or change epics_pattern to accept a list of patterns including
`*epic*.md` and `user-stories.md`; ensure related references to
`planning_artifacts` and `status_file` remain unchanged and that the new pattern
is consistent with the "Input Files" examples on lines referencing epics in the
workflow.
- Around line 1-4: Search the repository for the literal string "workflow.yaml"
and replace it with "workflow.md" where referenced (notably in sm.agent.yaml and
module-help.csv), ensuring the agent configuration key that loads the workflow
and the help registry entry point now point to "workflow.md" instead of
"workflow.yaml"; run a quick grep to confirm no remaining "workflow.yaml"
occurrences and update any tests or docs that reference the old filename.

---

Outside diff comments:
In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md`:
- Around line 117-120: The sprint-planning story file lookup currently only
checks a single path pattern `{story_location_absolute}/{story-key}.md`, which
misses nested story files; update the detection logic to mirror the dev-story
workflow by performing a recursive/glob search for files matching
`**/{story-key}.md` under `{implementation_artifacts}` (or otherwise use the
same search routine used by dev-story), so `story-key` matches are discovered in
nested folders and statuses are correctly upgraded to at least `ready-for-dev`.
- Around line 122-126: The preservation rule refers to an existing {status_file}
but the workflow never reads it; add a step to load and parse the current
{status_file} into an in-memory map (e.g., existingStatuses) before recomputing
sprint entries, then merge new statuses with existingStatuses so that any
existing "more advanced" state is kept and downgrades are prevented (ensure
merge logic enforces "never downgrade" semantics when combining computedStatus
-> existingStatuses); update the recompute step (where entries are built from
epics/filesystem) to consult this map and write the merged result back to
{status_file}.
- Around line 187-200: The workflow currently writes to {status_file} before
performing the validation in step n="5", risking loss of the previous good file;
instead, write the complete sprint status YAML to a temporary buffer or temp
file, perform the validation checks listed in step n="5" (presence of all epics
and stories, retrospectives, no extraneous items, legal status values, and valid
YAML syntax, and ordering: epic → its stories → its retrospective → next epic),
and only after all validations pass atomically replace {status_file} (e.g.,
write adjacent temp file and fs.rename/atomic move) so the original file is
never clobbered on validation failure.
- Around line 202-217: The template uses two different placeholders for the same
metric: {{in_progress_count}} (defined) and {{epics_in_progress_count}}
(rendered); pick one name and make both occurrences consistent—either change the
header/count definition to {{epics_in_progress_count}} or update the summary to
use {{in_progress_count}} so the "Epics in Progress" value is populated (locate
the placeholders in the sprint-planning workflow.md and make them identical).
- Around line 58-77: The workflow currently only performs a flat scan using
`{epics_pattern}` under `{epics_location}` and never follows the sharded-index
branch; update the implementation for the "Epic Discovery Process" and the
`<step n="1" goal="Parse epic files and extract all work items">` actions so
that if an `epics/index.md` (or any detected index file) is present you parse
that index (read `index.md`) and then explicitly iterate and load each shard
listed (e.g., `epic-1.md`, `epic-2.md`), merging their content before falling
back to the flat `{epics_pattern}` scan; ensure the code checks for both
whole-document and sharded layouts and respects the stated priority ("If both
whole and sharded versions exist, use the whole document") using the existing
`{epics_location}` and `{epics_pattern}` variables.
- Around line 79-92: When generating kebab-case story keys (from epic/story
headers) before writing the development_status mapping, add collision detection:
maintain a global set/map of generated keys (include source identifier like
filename and header text), and on each new key check for existence; if a
duplicate is found, either fail with a clear error/log mentioning the
conflicting key and both sources or generate a deterministic disambiguator
(e.g., append -2, -3) and record the mapping so YAML won't silently overwrite an
earlier story; ensure this check runs in the epic/story extraction routine that
converts `### Story 1.1: ...` to `1-1-...` and before writing the
`development_status` output.
- Around line 192-200: The sprint-planning validator in the "Validate and
report" step is stricter than the official sprint-status reader because it
disallows legacy statuses 'drafted' (story) and 'contexted' (epic); update the
legality check so it aligns with sprint-status/workflow.md — either by adding
'drafted' and 'contexted' to the allowed status set used by the check
(referenced in the Validate and report step and any function performing "All
status values are legal") or by loading the canonical allowed-status list from
the sprint-status reader/state-machine definitions so the validator accepts the
same legacy values.
- Around line 114-131: The current step n="3" logic only checks existence of
`{story_location_absolute}/{story-key}.md` and upgrades to `ready-for-dev`,
which incorrectly flattens stories already `in-progress`, `review`, or `done`;
update the detection to parse the story document and other sources for richer
state before deciding: inspect the story file for frontmatter/status fields or
in-body markers (e.g., "status:", badges, or explicit
`in-progress`/`review`/`done` tokens), check associated `{status_file}` and
preserve any more advanced status, and optionally consult VCS/PR metadata
(branch names or open PRs) to infer `in-progress`/`review`; ensure the code that
computes finalStatus never downgrades an existing more-advanced status and apply
this in the routine currently using `story_location_absolute`, `{story-key}.md`,
and `{status_file}`.

---

Nitpick comments:
In `@src/bmm/workflows/4-implementation/sprint-planning/workflow.md`:
- Around line 18-25: The workflow loads document_output_language but never uses
it when emitting generated YAML comments/notes (they remain hardcoded English);
update the document-generation path so functions that render output (e.g., the
code that produces YAML comments/notes—look for routines named
generate_documentation, render_yaml_comments, build_notes, or similar) accept
and apply document_output_language in addition to communication_language, then
use that locale to format/translate all YAML comments and notes (either by
passing document_output_language into the templating/translation layer or
invoking the translator with that variable) so generated documents are emitted
in the configured document_output_language while agent messages continue using
communication_language.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b178910a-4469-49a1-a782-43179004c761

📥 Commits

Reviewing files that changed from the base of the PR and between 7f1a55c and 94f9012.

📒 Files selected for processing (2)
  • src/bmm/workflows/4-implementation/sprint-planning/workflow.md
  • src/bmm/workflows/4-implementation/sprint-planning/workflow.yaml
💤 Files with no reviewable changes (1)
  • src/bmm/workflows/4-implementation/sprint-planning/workflow.yaml

@alexeyv
Copy link
Copy Markdown
Collaborator Author

alexeyv commented Mar 8, 2026

Triage of Review Findings

All 4 inline review threads have been replied to and resolved. Here is the triage summary for the "outside diff range" findings from CodeRabbit's review body:

# Severity Finding Decision
F3 Major Flat story lookup misses nested dirs REJECT — all workflows consistently use flat layout; premise is incorrect
F4 Major Status preservation never reads status_file DEFER — valid finding, deferred to follow-up
F5 Major Writes status_file before validation DISMISS — low practical risk in LLM agent context
F6 Minor Placeholder mismatch in_progress_count vs epics_in_progress_count FIX — applied
F7 Major Sharded discovery not executed DISMISS — prose instructions ARE the logic for agent workflows
F8 Major No story key collision detection DISMISS — keys include unique epic.story prefixes; structurally impossible
F9 Major Validator stricter than sprint-status reader DISMISS — theoretical; dependent on F4 which gates legacy value entry
F10 Major File existence can't detect richer states DISMISS — by design; real risk covered by F4
F11 Low document_output_language unused DISMISS — consistent with other workflows; appropriate for machine-consumed YAML

- 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 <noreply@anthropic.com>
@alexeyv alexeyv merged commit dc8293e into bmad-code-org:main Mar 8, 2026
5 checks passed
@alexeyv alexeyv deleted the convert-sprint-planning-yaml-to-md branch March 8, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant