--- name: 'step-04-present-and-resolve' description: 'Present findings and either apply fixes or create follow-up action items' nextStepFile: './step-05-update-status.md' reviewFindingsFile: '{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 **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 ## Next - Read fully and follow: `./step-05-update-status.md`.