4.8 KiB
4.8 KiB
| name | description |
|---|---|
| step-06-resolve-and-update | Present findings, fix or create action items, update story and sprint status |
Step 6: Resolve Findings and Update Status
Goal: Present findings to user, handle resolution (fix or action items), update story file and sprint status.
AVAILABLE STATE
From previous steps:
{story_path},{story_key}{consolidated_findings}- Merged findings from step 5sprint_status={implementation_artifacts}/sprint-status.yaml
STATE VARIABLES (capture now)
{fixed_count}- Number of issues fixed{action_count}- Number of action items created{new_status}- Final story status
EXECUTION SEQUENCE
1. Present Resolution Options
**Code Review Findings for {user_name}**
**Story:** {story_key}
**Total Issues:** {consolidated_findings.count}
{consolidated_findings_table}
---
**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] Walk through** - Discuss each finding individually
**[4] Show details** - Deep dive into specific issues
Choose [1], [2], [3], [4], or specify which issue (e.g., "CF-3"):
2. Handle User Choice
Option [1]: Fix Automatically
- For each CRITICAL and HIGH finding:
- Apply the fix in the code
- Add/update tests if needed
- Record what was fixed
- Update story Dev Agent Record → File List if files changed
- Add "Code Review Fixes Applied" entry to Change Log
- Set
{fixed_count}= number of issues fixed - Set
{action_count}= 0 (LOW findings can become action items)
Option [2]: Create Action Items
- Add "Review Follow-ups (AI)" subsection to Tasks/Subtasks
- For each finding:
- [ ] [AI-Review][{severity}] {description} [{location}] - Set
{action_count}= number of action items created - Set
{fixed_count}= 0
Option [3]: Walk Through
For each finding in order:
- Present finding with full context and code snippet
- Ask: [f]ix now / [s]kip / [d]iscuss more
- If fix: Apply fix immediately, increment
{fixed_count} - If skip: Note as acknowledged, optionally create action item
- If discuss: Provide more detail, repeat choice
- Continue to next finding
After all processed, summarize what was fixed/skipped.
Option [4]: Show Details
- Present expanded details for specific finding(s)
- Return to resolution choice
3. Determine Final Status
Evaluate completion:
If ALL conditions met:
- All CRITICAL issues fixed
- All HIGH issues fixed or have action items
- All ACs verified as implemented
Set {new_status} = "done"
Otherwise:
Set {new_status} = "in-progress"
4. Update Story File
- Update story Status field to
{new_status} - Add review notes to Dev Agent Record:
## Senior Developer Review (AI)
**Date:** {date}
**Reviewer:** AI Code Review
**Findings Summary:**
- CRITICAL: {count} ({fixed}/{action_items})
- HIGH: {count} ({fixed}/{action_items})
- MEDIUM: {count}
- LOW: {count}
**Resolution:** {approach_taken}
**Files Modified:** {list if fixes applied}
- Update Change Log:
- [{date}] Code review completed - {outcome_summary}
- Save story file
5. Sync Sprint Status
Check if {sprint_status} file exists:
If exists:
- Load
{sprint_status} - Find
{story_key}in development_status - Update status to
{new_status} - Save file, preserving ALL comments and structure
Sprint status synced: {story_key} {new_status}
If not exists or key not found:
Sprint status sync skipped (no sprint tracking or key not found)
6. Completion Output
** Code Review Complete!**
**Story:** {story_key}
**Final Status:** {new_status}
**Issues Fixed:** {fixed_count}
**Action Items Created:** {action_count}
{if new_status == "done"}
Code review passed! Story is ready for final verification.
{else}
Address the action items and run another review cycle.
{endif}
---
**Next Steps:**
- Commit changes (if fixes applied)
- Run tests to verify fixes
- Address remaining action items (if any)
- Mark story complete when all items resolved
WORKFLOW COMPLETE
This is the final step. The Code Review workflow is now complete.
SUCCESS METRICS
- Resolution options presented clearly
- User choice handled correctly
- Fixes applied cleanly (if chosen)
- Action items created correctly (if chosen)
- Story status determined correctly
- Story file updated with review notes
- Sprint status synced (if applicable)
- Completion summary provided
FAILURE MODES
- Not presenting resolution options
- Fixing without user consent
- Not updating story file
- Wrong status determination (done when issues remain)
- Not syncing sprint status when it exists
- Missing completion summary