Implement Review Feedback
Reads code review documents from .reviews/ and implements the suggested fixes and improvements.
Workflow
Step 1: Find Current Review
Identify the review for the current branch:
git branch --show-current # Get branch name
ls .reviews/ # Find matching review
Look for: .reviews/{branch-name}-review.md
Step 2: Parse Review Findings
Read the review document and extract findings by severity:
| Priority | Icon | Action |
|---|---|---|
| 1st | π΄ Critical | Must fix - security, breaking bugs |
| 2nd | π Major | Should fix - significant issues |
| 3rd | π‘ Minor | Consider fixing - quality improvements |
| 4th | π‘ Suggestion | Optional - nice to have |
Step 3: Verify Documentation
Before implementing, check for relevant context:
search_nodes β Find patterns in memory
query-docs β Get current best practices if needed
Step 4: Implement Fixes by Priority
Work through findings in priority order:
For Each Finding:
- Locate the code - Find file and line mentioned
- Understand the issue - Read the finding description
- Implement fix - Apply the appropriate change
- Add/update tests - Ensure fix is tested
- Mark as addressed - Track progress
Step 5: Update Review Document
Add implementation notes to the review:
---
## Implementation Response
**Addressed by**: AI Assistant
**Date**: {date}
### π΄ Critical - Addressed
1. **Token stored in localStorage** (src/dev/auth/storage.ts:23)
- β
Fixed: Migrated to httpOnly cookies
- Commit: abc123
### π Major - Addressed
1. **No token expiration check** (src/dev/auth/validate.ts:45)
- β
Fixed: Added expiration validation
- Commit: def456
### π‘ Minor - Addressed
1. **Magic number for timeout** (src/dev/auth/session.ts:12)
- β
Fixed: Extracted to SESSION_TIMEOUT constant
### π‘ Suggestion - Deferred
1. **Refresh token rotation**
- β³ Deferred: Created issue #XX for future work
Step 6: Commit Changes
Commit fixes with reference to review:
git add .
git commit -m "fix: address code review feedback
- Fixed critical: token storage vulnerability
- Fixed major: token expiration validation
- Fixed minor: extracted magic numbers
Review: .reviews/{branch}-review.md"
Step 7: Report Status
Summarize what was addressed:
- Count of fixes by severity
- Any deferred items
- New issues created
Handling Deferred Items
If a finding is too complex or out of scope:
-
Create a GitHub issue:
issue_write: title: "Review feedback: {description}" body: "From code review of {branch}\n\n{details}" labels: ["MAINT"] or appropriate label -
Note in review document as "Deferred"
-
Include issue link in response
Example
User: "Implement the review feedback"
Response:
Found review: .reviews/feat-user-auth-review.md
Implementing fixes by priority...
π΄ Critical (1 item):
β
Token storage - Migrated to httpOnly cookies
π Major (1 item):
β
Token expiration - Added validation check
π‘ Minor (1 item):
β
Magic number - Extracted to constant
π‘ Suggestion (1 item):
β³ Refresh token rotation - Deferred to issue #52
Committed: fix: address code review feedback
All critical and major issues resolved.
Notes
- Always fix Critical and Major items
- Minor items should be addressed unless time-constrained
- Suggestions can be deferred with a tracking issue
- Update tests for all fixes
- Keep commits focused and atomic
