A smart tool that transforms critical code feedback into constructive, educational guidance.
This project uses Generative AI to act as an ideal senior developer, fostering a healthier and more productive learning environment by making code reviews supportive instead of stressful.
- 🧠 Contextual Awareness: Intelligently adapts its tone based on the feedback's severity—from a relaxed suggestion for a style issue to a more formal tone for performance concerns.
- 📚 Resource Linking: Provides links to official documentation or style guides for deeper, self-paced learning.
- ✍️ Empathetic Rephrasing: Rewrites blunt critiques in a positive and encouraging tone.
- 🎓 Educational Explanations: Clearly explains the "why" behind each suggestion, referencing core software engineering principles.
- ✅ Actionable Suggestions: Provides concrete, corrected code examples for each piece of feedback.
- 👍 Holistic Summary: Generates a final, encouraging summary of all the feedback, leaving the developer on a positive note.
Follow these steps to get the project running locally.
- Python 3.x installed on your system.
- A Google Gemini API key.
-
Clone the Repository
git clone [Your Repository URL Here] cd [Your Repository Name] -
Install Dependencies
pip install -r requirements.txt
-
Configure API Key Open
main.pyand replace the placeholder with your Gemini API key:my_api_key = "YOUR_API_KEY_HERE"
-
Add Your Input: Edit the
input.jsonfile with the code snippet and review comments you want to analyze.{ "code_snippet": "...", "review_comments": [ { "comment": "...", "severity": "low" } ] } -
Execute the Script: Run the following command in your terminal:
python main.py
-
View the Output Report: The script will generate a
review_report.mdfile containing the complete, AI-powered feedback.Check the Sample Report: A sample of the complete, AI-powered feedback has been generated and saved in the review_report.md file for your review..
Here's a sample of the report generated by the Empathetic Code Reviewer:
