|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Commands |
| 6 | + |
| 7 | +### Development |
| 8 | +- `npm start` - Run the app in development mode with GPU sandbox disabled |
| 9 | +- `npm run watch` - Watch for changes and restart automatically |
| 10 | +- `npm run css` - Compile SCSS styles |
| 11 | + |
| 12 | +### Testing |
| 13 | +- `npm test` - Run Playwright tests |
| 14 | +- `npm run lint` - Run ESLint on all source files |
| 15 | +- `npm run lint:src` - Lint only source directory |
| 16 | +- `npm run depcheck` - Check for unused dependencies and circular dependencies |
| 17 | + |
| 18 | +### Building |
| 19 | +- `npm run build` - Build for current platform |
| 20 | +- `npm run build:all` - Build for Windows and Linux (32-bit and 64-bit) |
| 21 | +- `npm run build:mac` - Build for macOS (arm64 and x64) |
| 22 | +- `npm run build:win` - Build for Windows (32-bit and 64-bit) |
| 23 | +- `npm run build:linux` - Build for Linux (32-bit and 64-bit) |
| 24 | + |
| 25 | +### Release |
| 26 | +- `npm run release` - Create a new release (on release branch) |
| 27 | + |
| 28 | +## Architecture |
| 29 | + |
| 30 | +### Technology Stack |
| 31 | +- **Electron 14** - Cross-platform desktop framework |
| 32 | +- **Node.js 18.18.2+** - JavaScript runtime |
| 33 | +- **SCSS** - Stylesheet preprocessing |
| 34 | +- **Playwright** - End-to-end testing |
| 35 | +- **electron-builder** - Build and distribution |
| 36 | + |
| 37 | +### Core Structure |
| 38 | +- **Main Process** (`src/main/`) - Electron backend handling window management, IPC, system integration |
| 39 | + - `main.js` - Entry point and app initialization |
| 40 | + - `crossover.js` - Core crosshair window logic |
| 41 | + - `windows.js` - Window creation and management |
| 42 | + - `preferences.js` - Settings management via electron-preferences |
| 43 | + - `keyboard.js` - Global hotkey handling |
| 44 | + - `iohook.js` - Mouse/keyboard hook integration |
| 45 | + |
| 46 | +- **Renderer Process** (`src/renderer/`) - UI and frontend logic |
| 47 | + - `renderer.js` - Main window renderer |
| 48 | + - `chooser.js` - Crosshair selection interface |
| 49 | + - `preload.js` - Preload script for context isolation |
| 50 | + |
| 51 | +- **Configuration** (`src/config/`) - App constants and utilities |
| 52 | + - `config.js` - Core configuration values (window sizes, defaults) |
| 53 | + |
| 54 | +### Key Features Implementation |
| 55 | +- **Crosshair Overlay** - Transparent, click-through window positioned above other apps |
| 56 | +- **Global Hotkeys** - Default: Ctrl+Alt+Shift+[Key] combinations for all actions |
| 57 | +- **Multiple Monitors** - Support for moving crosshair between displays |
| 58 | +- **Shadow Windows** - Up to 14 duplicate crosshair windows |
| 59 | +- **Mouse Following** - Optional crosshair tracking of mouse cursor |
| 60 | +- **Hide Triggers** - Hide crosshair on specific mouse/keyboard events |
| 61 | + |
| 62 | +## Code Style |
| 63 | +- **ESLint** configured with XO style guide |
| 64 | +- **Indentation**: Tabs |
| 65 | +- **Semicolons**: None (enforced by ESLint) |
| 66 | +- **Spacing**: Always use spaces in arrays, objects, and parentheses |
| 67 | +- **Imports**: Sorted alphabetically |
| 68 | + |
| 69 | +## Testing Approach |
| 70 | +- Tests located in `test/` directory |
| 71 | +- Uses Playwright for Electron app testing |
| 72 | +- Test files named `*.spec.js` |
| 73 | +- Run with `npm test` |
| 74 | + |
| 75 | +## Important Notes |
| 76 | +- Application uses Electron 14 (not latest) for stability |
| 77 | +- GPU sandbox is disabled in development (`--disable-gpu-sandbox`) |
| 78 | +- Supports Windows 7+, macOS 10.10+, Linux |
| 79 | +- Uses `electron-preferences` for settings management |
| 80 | +- Global hotkeys implemented via `uiohook-napi` |
0 commit comments