# Cursor AI Coding Rules for gogo2 Trading Dashboard Project ## Environment - we are on windows 11 machine ## Unicode and Encoding Rules - **NEVER use Unicode characters that may not be supported by Windows console (cp1252)** - **ABSOLUTELY NO EMOJIS** in any code, logs, or console output (e.g., ✅, ✓, ❌, ⚠️, 🚀, 📊, 💾, 🔄, ⏳, 🎯, 📈, 📉, 🔍, ⚡, 💡, 🛠️, 🔧, 🎉, ⭐, 📁, 📋) - Use plain ASCII text for all log messages, print statements, and console output - Replace emojis with descriptive text (e.g., "OK", "ERROR", "WARNING", "SUCCESS") ## Code Structure and Versioning Rules - **NEVER create multiple versions of the same functionality** (e.g., _fixed, _enhanced, _v2) - **ALWAYS work with existing code structure** and modify in place - **ASK FOR EXPLICIT APPROVAL** before creating new implementations of existing features - When fixing issues, modify the original file rather than creating copies - Use descriptive commit messages but avoid creating parallel implementations - If major refactoring is needed, discuss the approach first ## Dashboard Development Rules - Focus on the main clean dashboard (`web/clean_dashboard.py`) - Do not create alternative dashboard implementations unless explicitly requested - Fix issues in the existing codebase rather than creating workarounds - Ensure all callback registrations are properly handled - Test callback functionality thoroughly before deployment ## Logging Best Practices - Use structured logging with clear, ASCII-only messages - **NEVER use emojis or Unicode symbols in log messages** - Include relevant context in log messages without Unicode characters - Use logger.info(), logger.error(), etc. with plain text only - Use descriptive prefixes instead of emojis (e.g., "SUCCESS:", "ERROR:", "WARNING:") - Example: `logger.info("TRADING: Starting Live Scalping Dashboard at http://127.0.0.1:8051")` - Example: `logger.info("SUCCESS: Model checkpoint loaded successfully")` ## Error Handling - Always include proper exception handling - Log errors with ASCII-only characters - **NO EMOJIS** - Provide meaningful error messages using plain text descriptors - Use text prefixes like "ERROR:", "FAILED:", "WARNING:" instead of emoji symbols - Include stack traces for debugging when appropriate ## File Naming Conventions - Use descriptive names without version suffixes - Avoid creating multiple files for the same purpose - Use clear, concise names that indicate the file's purpose ## Testing Guidelines - Create focused test files for specific functionality - Use temporary test files that can be easily cleaned up - Name test files clearly (e.g., `test_callback_registration.py`) - Remove or archive test files after issues are resolved ## Windows Compatibility - Ensure all code works properly on Windows systems - Handle Windows-specific path separators correctly - Use appropriate encoding for file operations - Test console output compatibility with Windows Command Prompt and PowerShell ## Dashboard Callback Rules - Ensure all Dash callbacks are properly registered - Use consistent callback patterns across the application - Handle callback errors gracefully with fallback values - Test callback functionality with direct HTTP requests when debugging ## Code Review Checklist Before submitting code changes, verify: - [ ] **ABSOLUTELY NO EMOJIS OR UNICODE SYMBOLS** in any code, logs, or output - [ ] All log messages use plain ASCII text only (logger.info, logger.error, print, etc.) - [ ] No duplicate implementations of existing functionality - [ ] Proper error handling with ASCII-only messages - [ ] Windows compatibility maintained (PowerShell console safe) - [ ] Existing code structure preserved and enhanced rather than replaced - [ ] Use descriptive text instead of symbols: "OK" not "✓", "ERROR" not "❌", "SUCCESS" not "✅"