AI SummaryThis Cursor rules file enforces production-readiness standards for a trading simulation app, including console removal, input validation, transaction safety, and UI/UX best practices. It benefits TypeScript/React developers building reliable financial applications.
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "trading-simulation-app — Cursor Rules" prompt rules to my project. Repository: https://github.com/DustinDoan315/trading-simulation-app Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
Trading Simulation App - Production Readiness Rules
🚀 PRODUCTION READINESS RULES
• All console.log, console.warn, and console.error calls must be removed. • Use centralized constants (e.g. TRADING_CONFIG) for default values like 100000. • Avoid hardcoded color strings; use theme.colors.* instead. • Input validation is required on all user entry points (text input, trade actions, etc.). • Ensure that all portfolio operations are transactional and avoid race conditions. • All critical async operations should have loading indicators and error fallback UIs. • Add confirmation modals for destructive actions (e.g., portfolio reset, trade sell). • Trading components must memoize expensive calculations using useMemo and useCallback. • Components triggering network or state changes must wrap critical flows in try/catch. • Ensure cleanup in components using useEffect to prevent memory leaks (especially with WebView, Chart, or Socket). ---
🧱 ARCHITECTURE & STATE
• Balance logic, calculations, and sync functions should be moved to a shared service (e.g. BalanceCalculator). • No duplication of portfolio sync logic — use a single source of truth (UserSyncService). • Always use useSelector with memoized selectors when accessing Redux state. • Redux actions that affect multiple entities (balance, portfolio) should dispatch atomic updates. ---
🔐 SECURITY & AUTH
• Do not perform any Supabase update without validating uuid/session token first. • RLS (Row Level Security) must be enforced via Supabase policies. • Use Expo SecureStore for all token or sensitive value storage. • No sensitive values (API keys, tokens) should be hardcoded in source files. ---
📦 CONFIG & METADATA
• app.json must have: • "privacy": "public" • valid description, keywords, and proper permission usage descriptions. • Ensure Info.plist and AndroidManifest.xml declare necessary permissions with justifications. • Remove unused dependencies: react-dom, dotenv, @expo/config-plugins, reflect-metadata, etc. • Add missing dependencies like redux, lint-staged. ---
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts