# AI Agent Instructions for Fox CARLA SIM **MANDATORY FIRST STEP:** Always read `d:\CARLA\CARLA_0.9.16\PythonAPI\Fox\gemini.md` in the root folder before starting any task to understand current project status, architecture, and best practices. ## Core Rules 1. **Simulation Logic**: All scenario-specific code belongs in `scenarios/`. Use `src/` for scenario-agnostic orchestrators. 2. **Environment**: Use PowerShell as the shell. Always activate `carla312` conda environment (automatic via `run.bat`). 3. **Determinism**: Use manual coordinate-based control and `set_target_velocity` for repeatable scenarios. 4. **Safety Defaults**: Mandatory +0.5m Z-offset for actor spawning to avoid ground collisions. 5. **Asynchronous I/O**: Use `ThreadPoolExecutor` for disk writes (images/data) to maintain simulation FPS.