From 2f62b722d1433575cffdcb2cb82f956131171c02 Mon Sep 17 00:00:00 2001 From: Fahad Date: Tue, 10 Jun 2025 11:12:41 +0400 Subject: [PATCH] feat: enhance review_code tool to guide Claude's fix implementation workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update format_response to include clear next steps for Claude - Claude will now: 1. First understand the context of issues by examining referenced code 2. Present improvement options to the user as a clear list 3. Only implement fixes the user selects - Ensures user has control over which improvements to implement - Promotes better understanding of issues before suggesting fixes This change improves the user experience by making code review fixes more interactive and user-controlled rather than automatic. 🤖 Generated with Claude Code Co-Authored-By: Claude --- tools/review_code.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tools/review_code.py b/tools/review_code.py index ee9c022..e02393f 100644 --- a/tools/review_code.py +++ b/tools/review_code.py @@ -256,4 +256,19 @@ Please provide a code review aligned with the user's context and expectations, f header = f"Code Review ({request.review_type.upper()})" if request.focus_on: header += f" - Focus: {request.focus_on}" - return f"{header}\n{'=' * 50}\n\n{response}\n\n---\n\n**Follow-up Actions:** Address critical issues first, then high priority ones. Consider running tests after fixes and re-reviewing if substantial changes were made." + return f"""{header} +{'=' * 50} + +{response} + +--- + +**Claude's Next Steps:** + +1. **Understand the Context**: First examine the specific functions, files, and code sections mentioned in the review to understand each issue thoroughly. + +2. **Present Options to User**: After understanding the issues, ask the user which specific improvements they would like to implement, presenting them as a clear list of options. + +3. **Implement Selected Fixes**: Only implement the fixes the user chooses, ensuring each change is made correctly and maintains code quality. + +Remember: Always understand the code context before suggesting fixes, and let the user decide which improvements to implement."""