AI-powered code review using Google's Gemini to analyze Python (and other) codebases.
GEMINI_API_KEY=your_key_hereReviews: Full project or single files — catches bugs, security issues, performance problems, race conditions
Fixes: Generates specific code fixes for critical issues found
Debug: Analyzes error descriptions + code to identify likely causes
text
review /path/to/project → Review all Python files in directory
review /path/to/file.py → Review single file
review <code_snippet> → Review inline code
.py files in pathFileFocusTrading botsRace conditions, risk calculation errors, order logicAPIsAuth handling, retry logic, timeout behaviorState/DBAtomicity, corruption risk, concurrent accessML/AILookahead bias, overfitting, data leakage
text
📊 Code Review: trading-bot/
🔴 CRITICAL
• scanner.py: Race condition in flip logic (close→entry not atomic)
• risk_manager.py: Stale order logic wrong for LIMIT orders
🟡 IMPORTANT
• oanda_api.py: No retry on 429/5xx errors
• state.py: Non-atomic JSON writes
🟢 SUGGESTIONS
• Centralize API calls to reduce rate limit risk
• Add file locking for concurrent state access
filelock package (for state files): pip install filelock