DevHealth Focus is a productivity extension for Visual Studio Code that connects to the FlowState website to track and analyze your coding habits. It monitors focus time, detects breaks, and calculates weekly sleep debt based on your coding end times, helping you stay productive and maintain healthy rest patterns. Features Focus Sessions Start and stop dedicated coding sessions to track uninterrupted work intervals. Break Detection Automatically detect short, frequent breaks (e.g., when you switch to your phone) and log them as interruptions. Usage Tracking Record how long you actively code in VS Code and send usage data securely to your FlowState account. Sleep Debt Analysis Calculate cumulative sleep debt by analyzing when you finish coding each night. Finishing after your configured cutoff hour contributes toward weekly debt. Dashboard View Display a real-time dashboard in VS Code showing focus statistics, break counts, and current sleep debt. Account Connectivity Connect or disconnect your FlowState account to sync data between VS Code and the FlowState web platform. Requirements Visual Studio Code ≥ 1.85.0 Node.js ≥ 14.0.0 A FlowState account with API access Installation Download the latest .vsix package from the Marketplace or build your own using: bash vsce package Install locally: bash code --install-extension devhealth-focus-0.0.1.vsix Reload VS Code. Usage Connect Your Account Open the command palette (Ctrl+Shift+P or Cmd+Shift+P) and run: text DevHealth: Connect Account Enter your FlowState API token to authorize data syncing. Start a Focus Session Run: text DevHealth: Start Focus Session The extension begins tracking your coding time. Skip or Stop Skip phase (e.g., break): text DevHealth: Skip Current Pomodoro Phase Stop session: text DevHealth: Stop Focus Session View Dashboard Show your current focus metrics and sleep debt: text DevHealth: Show Focus Dashboard Disconnect Account If you wish to stop syncing data: text DevHealth: Disconnect Account Configuration Open Settings and search for DevHealth Focus to customize: devhealth.sleep.idealHours (number, default 8) devhealth.sleep.warningThresholdHours (number, default 6) devhealth.sleep.eveningCutoffHour (number, default 22) devhealth.sleep.morningCutoffHour (number, default 10) These settings control how sleep debt is calculated and when nightly coding counts toward your rest deficit. License This project is licensed under the MIT License. Feel free to use, modify, and distribute. |