BMAD-METHOD/src/bmm/workflows/4-implementation/code-review/steps/step-04-present-and-resolve.md

3.4 KiB

name description nextStepFile reviewFindingsFile
step-04-present-and-resolve Present findings and either apply fixes or create follow-up action items ./step-05-update-status.md {story_dir}/review-findings.json
Resolve findings artifact input: - Use {{review_findings_file}} from step 3 when present - Otherwise fallback to {reviewFindingsFile} - Set {{review_findings_schema}} = "id,severity,type,summary,detail,file_line,proof,suggested_fix,reviewer,timestamp" if not already set Load structured findings JSON array from {{review_findings_file}} Validate findings schema for each entry: id, severity, type, summary, detail, file_line, proof, suggested_fix, reviewer, timestamp Validation contract: - `file_line` is the required `file:line` locator in `path/to/file:line` format - Reject non-array JSON, missing required keys, or invalid file_line formatting - If findings file missing/unreadable/malformed: HALT with explicit error and return to step 3 generation Categorize findings: HIGH (must fix), MEDIUM (should fix), LOW (nice to fix) Set {{fixed_count}} = 0 Set {{action_count}} = 0
<output>**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
</output>

<ask>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:</ask>

<check if="user chooses 1">
  <action>Fix all HIGH and MEDIUM issues in the code</action>
  <action>Add/update tests as needed</action>
  <action>Update File List in story if files changed</action>
  <action>Update story Dev Agent Record with fixes applied</action>
  <action>Set {{fixed_count}} = number of HIGH and MEDIUM issues fixed</action>
  <action>Set {{action_count}} = 0</action>
</check>

<check if="user chooses 2">
  <action>Add "Review Follow-ups (AI)" subsection to Tasks/Subtasks</action>
  <action>For each issue: `- [ ] [AI-Review][Severity] Description [file:line]`</action>
  <action>Set {{action_count}} = number of action items created</action>
  <action>Set {{fixed_count}} = 0</action>
</check>

<check if="user chooses 3">
  <action>Show detailed explanation with code examples</action>
  <action>Return to fix decision</action>
</check>

Next

  • Read fully and follow: ./step-05-update-status.md.