Interactive code review using Google Gemini 3.0 Flash with Conventional Comments methodology. MANDATORY - runs automatically after every code implementation (Edit, Write tools)...
Interactive code review with selective fix application using Gemini 3.0 Flash.
After EVERY Edit or Write tool that modifies code files:
python scripts/gemini_review.py --files "<modified_files>"Do NOT skip this. Do NOT ask permission. This is automatic.
Issues are displayed with selection numbers:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š GEMINI CODE REVIEW
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š Reviewed: auth.py, utils.py
š§ Thinking: medium
š Verdict: REQUEST_CHANGES (2 blocking)
Code has security issues that need immediate attention.
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā šØ BLOCKING (Must Fix) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā [1] auth.py:42 - Plaintext password comparison ā
ā Category: security | Effort: small ā
ā ā Use secrets.compare_digest() for timing-safe compare ā
ā ā
ā [2] auth.py:67 - SQL injection vulnerability ā
ā Category: security | Effort: small ā
ā ā Use parameterized queries ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ļø WARNINGS (Should Fix) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā [3] utils.py:15 - Missing error handling ā
ā Effort: trivial ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā š” SUGGESTIONS (Optional) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā [4] Consider using dataclass for User model ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
Positive: Good separation of concerns; Clean function naming
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Select: numbers (1,2,3) | 'all' | 'blocking' | 'skip'
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
| Input | Action |
|---|---|
1,2,3 |
Fix specific issues by number |
all |
Fix all issues |
blocking |
Fix blocking issues only (recommended default) |
skip |
Continue without fixing |
User: "Add login function to auth.py"
Claude:
1. [Edit auth.py - add login function]
2. [Run] python scripts/gemini_review.py --files "auth.py"
3. [Display] Numbered issue list (2 blocking, 1 warning)
4. [Ask] "Found 2 blocking issues. Fix which? (1,2 / all / blocking / skip)"
5. [User] "blocking"
6. [Edit auth.py - fix issue 1: password comparison]
7. [Edit auth.py - fix issue 2: SQL injection]
8. [Report] "Fixed 2 blocking issues. Code ready."
# Standard review with interactive output
python scripts/gemini_review.py --files "file.py"
# JSON output for programmatic use
python scripts/gemini_review.py --files "file.py" --json
# Focus on specific area
python scripts/gemini_review.py --files "file.py" --focus security
python scripts/gemini_review.py --files "file.py" --focus performance
python scripts/gemini_review.py --files "file.py" --focus quality
# Manual thinking level (auto-detected by default)
python scripts/gemini_review.py --files "file.py" --think high
| Level | When Used | Description |
|---|---|---|
minimal |
<100 lines, simple code | Fast review |
medium |
Multiple files, complex logic | Balanced (default) |
high |
Security-sensitive, >500 lines | Deep analysis |
Thinking level is auto-detected based on:
| Code | Meaning | Claude Action |
|---|---|---|
| 0 | Success / No issues | Show results, continue |
| 1 | API or general error | Log error, continue work |
| 2 | No API key | Prompt for key setup |
| 3 | Has blocking issues | Prompt for fix selection |
Uses Conventional Comments standard:
| Label | Severity | Meaning |
|---|---|---|
issue(blocking) |
critical | Must fix (security, bugs) |
issue(non-blocking) |
high | Should fix |
suggestion |
medium | Optional improvement |
nitpick |
low | Style/preference |
praise |
- | What's done well |
If exit code 2 (NO_API_KEY):
python scripts/setup_api_key.py --key "<user_key>"Include: .py, .ts, .tsx, .js, .jsx, .go, .rs, .java, .kt, .swift, .c, .cpp, .rb, .php
Skip: .json, .yaml, .md, .txt, .lock, .log, .env
Never block user's work due to review errors. If API fails:
For comprehensive review criteria, see references/review-criteria.md.