RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Diff/sethrobinson-ugtlive-agents ↔ sethrobinson-ugtlive-cursor-rules-ugtlive-project-guide

Comparison

A · AGENTS.md · SethRobinson/UGTLiveB · Cursor rules · SethRobinson/UGTLive
What each file covers, counted
DimensionSharedOnly in AOnly in BOverlap
Sections07270%
Commands0300%
Section tags14411%

What each file covers

Sections

0 shared · 7 only in A · 27 only in B
  • − AGENTS.md
  • − Shared Project Memory
  • − Testing
  • − Cloud LLM Model Maintenance
  • − Feature Index
  • − Security
  • − Git
  • + Universal Game Translator Live - Project Guide
  • + Overview
  • + Project Structure
  • + Core Application Files
  • + UI Components
  • + Dialog Windows
  • + OCR Services
  • + Translation Services
  • + Audio Services
  • + Utilities and Managers
  • + Python Services
  • + Key Architectural Patterns
  • + Singleton Pattern
  • + Window Management
  • + Translation Flow
  • + Development Guidelines
  • + Code Style
  • + Project Configuration
  • + Key Features
  • + Common Development Tasks
  • + Adding a New Translation Service
  • + Adding New Settings
  • + Adding a New Python OCR Service
  • + Debugging OCR Issues
  • + Version Management
  • + Version Increment Rules
  • + Important Notes

Commands

0 shared · 3 only in A · 0 only in B
  • − dotnet build .\UGTLive.sln --configuration Release
  • − git commit
  • − git push

Section tags

1 shared · 4 only in A · 4 only in B
  • − test
  • − git-pr
  • − security
  • − performance
  • + code-style
  • + architecture
  • + ui
  • + deployment
  •   do-not

Line diff

+194 added−38 removed17 unchanged8.1% identical
SethRobinson/UGTLive · AGENTS.md
@@ −1 @@
1# AGENTS.md
 
 
 
 
2 
3Project operating instructions for AI assistants working in this repository.
4 
5## Shared Project Memory
 
6 
7- At the start of each new task or thread involving this repository, read this file before inspecting files, running commands, making a plan, or taking any other project action.
8- Treat follow-up replies in the same continuous task as part of that task. Do not reread this file unless the repository or working directory changes, this file is modified, or its instructions are no longer available in context.
9- Treat this file as the shared project memory for AI assistants.
10- Do not rely on vendor-specific, proprietary, or hidden memory systems for project facts, preferences, or operating instructions. (except to remember to ALWAYS read this file first before doing anything. Remember that.)
11- Update this file with important repo-specific information learned during work, including build commands, test commands, conventions, decisions, pitfalls, and current project preferences.
12- Keep this file accurate and current. Remove or correct stale, misleading, or incorrect information when discovered.
13- If information is temporary or uncertain, label it clearly rather than presenting it as permanent fact.
14 
15Scope policy: this file holds cross-cutting rules, workflows, and gotchas that most sessions need, plus a feature index. Keep it around 30 KB. Feature deep-dives live in `docs/<topic>.md`: before working on a feature listed in the index, read its doc; when finishing feature work, update that doc and keep the index entry here to one or two lines (where it lives + the non-obvious constraint). Cross-cutting rules and new gotchas still land here directly. When a change makes anything stale, here or in a linked doc, update it in the same change.
 
 
 
 
16 
17## Testing
 
 
 
 
 
 
18 
19- When possible, design automated tests for new features and bug fixes.
20- Run relevant automated tests after finishing changes to guard against regressions.
21- If tests cannot be run or do not exist, state that clearly in the handoff and describe any manual verification performed.
22- Always finish project changes by building the Release configuration: `dotnet build .\UGTLive.sln --configuration Release`.
23- If a running UGTLive process prevents the Release build, capture its executable/command line, stop it, complete the build, and restart it afterward. Do not start UGTLive if it was not running before the build.
 
 
 
 
 
24 
25Always add automation/test harnesses to test options/buttons/features as needed. Document them.
 
 
 
 
 
26 
27## Cloud LLM Model Maintenance
 
 
 
 
 
 
 
28 
29- Cloud and CLI model picker presets live in `src/SettingsWindow.xaml`; their fallback/default values live in `src/ConfigManager.cs`, `src/ConfigManager.Translation.cs`, and `src/SettingsWindow.TranslationSettings.cs`.
30- Subscription-backed CLI providers display as `Anthropic Sub`, `OpenAI Sub`, and `Gemini CLI (Enterprise)`, but their stable internal IDs remain `ClaudeCli`, `CodexCli`, and `GeminiCli`; use `ComboBoxItem.Tag` for the internal ID. Google ended personal/free/AI Pro/AI Ultra access through Gemini CLI on June 18, 2026; do not replace it with Antigravity CLI until `agy -p` reliably exposes captured stdout to Windows parent processes (see `docs/settings-connection-tests.md`).
31- Keep provider-specific capability handling in the matching translation service. In particular, Anthropic model generations use different manual/adaptive thinking request shapes.
32- Verify model IDs and request compatibility against current official provider documentation. Verify OpenRouter-prefixed slugs against its `/api/v1/models` catalog before adding presets.
 
 
33 
34## Feature Index
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35 
36- Settings API/model/voice tests: see `docs/settings-connection-tests.md`. UI buttons and `--test-settings-connection` must continue to call the shared `SettingsConnectionTester` implementation.
37- OpenAI All In One Snap translation: see `docs/openai-all-in-one.md`. It is a Snap-only, visual-only `gpt-image-2` Image Edits path; Auto and realtime processing must remain on the standard OCR pipeline.
 
 
 
 
 
38 
 
 
 
 
 
 
 
39 
40## Security
41 
42- Never commit sensitive data, including credentials, tokens, passwords, private keys, cookies, customer data, personal data, or machine-specific authentication material.
43- If an AI assistant needs authentication data or other secrets for local work, use `agents_secret.md` for those notes.
44- `agents_secret.md` must stay ignored by git and must not be committed.
45- Do not put secrets in commit messages, logs, issue text, pull request descriptions, generated docs, or other tracked files.
46- Configuration logging must pass key names through `ConfigManager.IsSensitiveConfigKey`; never print raw secret values in startup or harness output.
47- Before committing, review staged changes for accidental secrets.
 
 
 
 
 
48 
49## Git
 
 
 
 
50 
51- Never add OpenAI/Codex/Claude etc as a co-author on git commits.
52- NEVER `git commit` unless explicitly told to commit.
53- NEVER `git push` unless explicitly told to push. "Commit" means commit
54 locally only; committing is not permission to push.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55 
SethRobinson/UGTLive · .cursor/rules/ugtlive-project-guide.mdc
@@ +1 @@
1---
2description: Universal Game Translator Live project overview and structure
3globs: ["**/*.cs", "**/*.xaml"]
4alwaysApply: false
5---
6 
7# Universal Game Translator Live - Project Guide
8 
9## Overview
10Universal Game Translator Live (UGTLive) is a Windows WPF application that provides real-time screen translation using OCR and Large Language Models (LLMs). The application captures screen regions, performs OCR, and translates text using services like Gemini, ChatGPT, Ollama, Google Translate, or llama.cpp.
11 
12## Project Structure
 
 
 
 
 
 
13 
14### Core Application Files
15- [src/App.xaml](mdc:src/App.xaml) - WPF application entry point
16- [src/MainWindow.xaml.cs](mdc:src/MainWindow.xaml.cs) - Main application window and control logic
17- [src/Logic.cs](mdc:src/Logic.cs) - Core translation and OCR processing logic
18- [src/ConfigManager.cs](mdc:src/ConfigManager.cs) - Settings and configuration management
19 
20### UI Components
21- [src/MonitorWindow.xaml.cs](mdc:src/MonitorWindow.xaml.cs) - Screen capture preview window
22- [src/ChatBoxWindow.xaml.cs](mdc:src/ChatBoxWindow.xaml.cs) - Translation overlay/chat display
23- [src/SettingsWindow.xaml.cs](mdc:src/SettingsWindow.xaml.cs) - Application settings interface
24- [src/ChatBoxOptionsWindow.xaml.cs](mdc:src/ChatBoxOptionsWindow.xaml.cs) - ChatBox customization options
25- [src/ChatBoxSelectorWindow.xaml.cs](mdc:src/ChatBoxSelectorWindow.xaml.cs) - ChatBox region selector
26- [src/LogWindow.xaml.cs](mdc:src/LogWindow.xaml.cs) - Log viewer window
27 
28### Dialog Windows
29- [src/UpdateAvailableDialog.xaml.cs](mdc:src/UpdateAvailableDialog.xaml.cs) - Version update notification
30- [src/TtsVoiceSelectorDialog.xaml.cs](mdc:src/TtsVoiceSelectorDialog.xaml.cs) - TTS voice selection
31- [src/ServiceInstallDialog.xaml.cs](mdc:src/ServiceInstallDialog.xaml.cs) - Python service installation
32- [src/ServiceDiagnosticDialog.xaml.cs](mdc:src/ServiceDiagnosticDialog.xaml.cs) - Service diagnostics
33- [src/ServerSetupDialog.xaml.cs](mdc:src/ServerSetupDialog.xaml.cs) - Server setup wizard
34- [src/OllamaModelSelectorWindow.xaml.cs](mdc:src/OllamaModelSelectorWindow.xaml.cs) - Ollama model selection
35- [src/GoogleVisionSetupDialog.xaml.cs](mdc:src/GoogleVisionSetupDialog.xaml.cs) - Google Vision setup
36- [src/ShutdownDialog.xaml.cs](mdc:src/ShutdownDialog.xaml.cs) - Shutdown confirmation
37- [src/NoTextInfoDialog.xaml.cs](mdc:src/NoTextInfoDialog.xaml.cs) - No text detected notification
38 
39### OCR Services
40- [src/WindowsOCRManager.cs](mdc:src/WindowsOCRManager.cs) - Windows built-in OCR integration
41- [src/GoogleVisionOCRService.cs](mdc:src/GoogleVisionOCRService.cs) - Google Cloud Vision OCR
42- [src/UniversalBlockDetector.cs](mdc:src/UniversalBlockDetector.cs) - Advanced text block detection and grouping
43- [src/PythonServicesManager.cs](mdc:src/PythonServicesManager.cs) - Manages Python OCR services (EasyOCR, MangaOCR, PaddleOCR, DocTR)
44- [src/PythonService.cs](mdc:src/PythonService.cs) - Individual Python service wrapper
45 
46### Translation Services
47- [src/ITranslationService.cs](mdc:src/ITranslationService.cs) - Translation service interface
48- [src/GeminiTranslationService.cs](mdc:src/GeminiTranslationService.cs) - Google Gemini API integration
49- [src/ChatGptTranslationService.cs](mdc:src/ChatGptTranslationService.cs) - OpenAI ChatGPT integration
50- [src/OllamaTranslationService.cs](mdc:src/OllamaTranslationService.cs) - Local Ollama LLM integration
51- [src/GoogleTranslateService.cs](mdc:src/GoogleTranslateService.cs) - Google Translate integration
52- [src/LlamaCppTranslationService.cs](mdc:src/LlamaCppTranslationService.cs) - llama.cpp local translation
53- [src/TranslationServiceFactory.cs](mdc:src/TranslationServiceFactory.cs) - Factory for creating translation services
54 
55### Audio Services
56- [src/GoogleTTSService.cs](mdc:src/GoogleTTSService.cs) - Google Text-to-Speech
57- [src/ElevenLabsService.cs](mdc:src/ElevenLabsService.cs) - ElevenLabs TTS integration
58- [src/OpenAIRealtimeAudioService.cs](mdc:src/OpenAIRealtimeAudioService.cs) - OpenAI real-time audio transcription
59- [src/AudioPlaybackManager.cs](mdc:src/AudioPlaybackManager.cs) - Audio playback management
60- [src/AudioPreloadService.cs](mdc:src/AudioPreloadService.cs) - TTS audio preloading
61 
62### Utilities and Managers
63- [src/HotkeyManager.cs](mdc:src/HotkeyManager.cs) - Global keyboard shortcuts management
64- [src/MouseManager.cs](mdc:src/MouseManager.cs) - Mouse input handling
65- [src/LogManager.cs](mdc:src/LogManager.cs) - Application logging
66- [src/SplashManager.cs](mdc:src/SplashManager.cs) - Splash screen management
67- [src/TextObject.cs](mdc:src/TextObject.cs) - Text region data structure
68- [src/ErrorPopupManager.cs](mdc:src/ErrorPopupManager.cs) - Error popup management
69- [src/GamepadManager.cs](mdc:src/GamepadManager.cs) - Gamepad input management
70- [src/WebViewEnvironmentManager.cs](mdc:src/WebViewEnvironmentManager.cs) - WebView2 environment management
71- [src/WebViewPool.cs](mdc:src/WebViewPool.cs) - WebView2 instance pooling
72- [src/OverlayProfiler.cs](mdc:src/OverlayProfiler.cs) - Overlay performance profiling
73- [src/CondaHelper.cs](mdc:src/CondaHelper.cs) - Conda environment management
74- [src/ServiceConfigParser.cs](mdc:src/ServiceConfigParser.cs) - Python service config parsing
75- [src/ServiceItemViewModel.cs](mdc:src/ServiceItemViewModel.cs) - Service UI view model
76- [src/OllamaModelDownloader.cs](mdc:src/OllamaModelDownloader.cs) - Ollama model download management
77- [src/HotkeyEntry.cs](mdc:src/HotkeyEntry.cs) - Hotkey entry data structure
78- [src/TranslationEventArgs.cs](mdc:src/TranslationEventArgs.cs) - Translation event arguments
79 
80### Python Services
81- `app/services/EasyOCR/` - EasyOCR Python service
82- `app/services/MangaOCR/` - MangaOCR Python service
83- `app/services/PaddleOCR/` - PaddleOCR Python service
84- `app/services/DocTR/` - DocTR Python service
85- `app/services/shared/` - Shared Python utilities
86- `app/services/util/` - Python installation utilities
87 
88Each Python service directory contains:
89- `server.py` - FastAPI server implementation
90- `service_config.txt` - Service configuration
91- `Install.bat` - Installation script
92- `RunServer.bat` - Server launch script
93- `DiagnosticTest.bat` - Diagnostic test script
94- `Uninstall.bat` - Uninstallation script
95 
96## Key Architectural Patterns
97 
98### Singleton Pattern
99The application uses singleton pattern for core managers:
100- `Logic.Instance` - Main application logic
101- `ConfigManager.Instance` - Configuration management
102- `UniversalBlockDetector.Instance` - Text block detection (replaces BlockDetectionManager)
103- `LogManager.Instance` - Logging
104- `HotkeyManager.Instance` - Keyboard shortcuts (replaces KeyboardShortcuts)
105- `PythonServicesManager.Instance` - Python OCR service management
106- `AudioPlaybackManager.Instance` - Audio playback
107- `AudioPreloadService.Instance` - Audio preloading
108- `GamepadManager.Instance` - Gamepad input
109 
110### Window Management
111Each window inherits from WPF Window class and follows these patterns:
112- Windows are typically created once and shown/hidden as needed
113- Settings are persisted through ConfigManager
114- Windows communicate through events and direct method calls on Logic.Instance
115 
116### Translation Flow
1171. Screen capture → OCR (Windows OCR, EasyOCR, MangaOCR, PaddleOCR, DocTR, or Google Vision) → Universal Block Detection → Translation Service → Display
1182. Text blocks are grouped by UniversalBlockDetector
1193. Translation includes context from previous translations
1204. Results are displayed in ChatBox or as overlay
121 
122## Development Guidelines
123 
124### Code Style
125- **Naming**: PascalCase for public members, camelCase for private, underscore prefix for fields
126- **Layout**: 4-space indentation, Allman braces, System namespaces first
127- **Properties**: Use GetVariableName/SetVariableName pattern in ConfigManager
128- **UI Properties**: Direct Get/Set to GUI elements when possible
129- **Error Handling**: Avoid try/catch blocks, check for null, log errors via LogManager
130 
131### Project Configuration
132- **Framework**: .NET 8.0 Windows
133- **Output**: `app/` directory
134- **Assembly**: `ugtlive.exe` (or `ugtlive_debug.exe` in Debug)
135- **Dependencies**: NAudio, Microsoft.Windows.CsWinRT, WebView2
136 
137### Key Features
138- Multiple OCR backends (Windows OCR, EasyOCR, MangaOCR, PaddleOCR, DocTR, Google Vision)
139- Multiple translation services (Gemini, ChatGPT, Ollama, Google Translate, llama.cpp)
140- Real-time screen capture and translation
141- Customizable overlay windows
142- Audio transcription and TTS
143- Context-aware translations
144- Global keyboard shortcuts (via HotkeyManager)
145- Gamepad support
146- Python service management UI
147 
148## Common Development Tasks
149 
150### Adding a New Translation Service
1511. Create a new class implementing `ITranslationService`
1522. Add service configuration to `ConfigManager`
1533. Update `TranslationServiceFactory` to create instances
1544. Add UI controls in `SettingsWindow.xaml`
155 
156### Adding New Settings
1571. Add property to `ConfigManager` with getter/setter
1582. Add UI controls to `SettingsWindow.xaml`
1593. Wire up events in `SettingsWindow.xaml.cs`
1604. Settings are automatically persisted
161 
162### Adding a New Python OCR Service
1631. Create service directory in `app/services/` (e.g., `app/services/NewOCR/`)
1642. Create `service_config.txt` with required fields
1653. Create `server.py` implementing FastAPI endpoints
1664. Create batch scripts: `Install.bat`, `RunServer.bat`, `DiagnosticTest.bat`, `Uninstall.bat`
1675. Service will be automatically discovered by `PythonServicesManager`
168 
169### Debugging OCR Issues
1701. Check `LogManager` output for errors
1712. Use Monitor window to preview capture area
1723. Verify Python server is running (for Python OCR services)
1734. Check service diagnostics dialog
1745. Review UniversalBlockDetector settings
175 
176## Version Management
177 
178When incrementing the version number, you must update it in **THREE places**:
179 
1801. **[src/SplashManager.cs](mdc:src/SplashManager.cs)** - `CurrentVersion` constant
181 ```csharp
182 public const double CurrentVersion = 0.60; // Update this value
183 ```
184 
1852. **[media/latest_version_checker.json](mdc:media/latest_version_checker.json)** - `latest_version` field
186 ```json
187 {
188 "name":"Universal Game Translator Live",
189 "latest_version":0.60, // Update this value
190 "message":"Download V{VERSION_STRING} now from rtsoft.com?\n\nV0.60: " // Update version in message
191 }
192 ```
193 
1943. **[README.md](mdc:README.md)** - Version badge and history entry
195 - Update the version badge: `[![Version](https://img.shields.io/badge/version-0.60-blue.svg)]`
196 - Add a new history entry at the top: `**V0.60** - [description]`
197 
198### Version Increment Rules
199- Default increment: **0.01** (e.g., 0.25 → 0.26)
200- Major features: **0.10** (e.g., 0.25 → 0.35)
201- Complete rewrites: **1.00** (e.g., 0.99 → 1.00)
202- **ALWAYS update all three files** to keep them in sync
203- Version format is a double/float (e.g., 0.60, not "0.60")
204 
205## Important Notes
206- Application is Windows-only due to WPF and Windows OCR dependencies
207- Python OCR services run locally on configurable ports
208- First run downloads OCR language models
209- Settings stored in `app/` directory (config.txt, service configs)
210- All web calls are for version checking and API services only
211 
@@ −1 +1 @@
1−# AGENTS.md
1+---
2+description: Universal Game Translator Live project overview and structure
3+globs: ["**/*.cs", "**/*.xaml"]
4+alwaysApply: false
5+---
26  
3−Project operating instructions for AI assistants working in this repository.
7+# Universal Game Translator Live - Project Guide
48  
5−## Shared Project Memory
9+## Overview
10+Universal Game Translator Live (UGTLive) is a Windows WPF application that provides real-time screen translation using OCR and Large Language Models (LLMs). The application captures screen regions, performs OCR, and translates text using services like Gemini, ChatGPT, Ollama, Google Translate, or llama.cpp.
611  
7−- At the start of each new task or thread involving this repository, read this file before inspecting files, running commands, making a plan, or taking any other project action.
8−- Treat follow-up replies in the same continuous task as part of that task. Do not reread this file unless the repository or working directory changes, this file is modified, or its instructions are no longer available in context.
9−- Treat this file as the shared project memory for AI assistants.
10−- Do not rely on vendor-specific, proprietary, or hidden memory systems for project facts, preferences, or operating instructions. (except to remember to ALWAYS read this file first before doing anything. Remember that.)
11−- Update this file with important repo-specific information learned during work, including build commands, test commands, conventions, decisions, pitfalls, and current project preferences.
12−- Keep this file accurate and current. Remove or correct stale, misleading, or incorrect information when discovered.
13−- If information is temporary or uncertain, label it clearly rather than presenting it as permanent fact.
12+## Project Structure
1413  
15−Scope policy: this file holds cross-cutting rules, workflows, and gotchas that most sessions need, plus a feature index. Keep it around 30 KB. Feature deep-dives live in `docs/<topic>.md`: before working on a feature listed in the index, read its doc; when finishing feature work, update that doc and keep the index entry here to one or two lines (where it lives + the non-obvious constraint). Cross-cutting rules and new gotchas still land here directly. When a change makes anything stale, here or in a linked doc, update it in the same change.
14+### Core Application Files
15+- [src/App.xaml](mdc:src/App.xaml) - WPF application entry point
16+- [src/MainWindow.xaml.cs](mdc:src/MainWindow.xaml.cs) - Main application window and control logic
17+- [src/Logic.cs](mdc:src/Logic.cs) - Core translation and OCR processing logic
18+- [src/ConfigManager.cs](mdc:src/ConfigManager.cs) - Settings and configuration management
1619  
17−## Testing
20+### UI Components
21+- [src/MonitorWindow.xaml.cs](mdc:src/MonitorWindow.xaml.cs) - Screen capture preview window
22+- [src/ChatBoxWindow.xaml.cs](mdc:src/ChatBoxWindow.xaml.cs) - Translation overlay/chat display
23+- [src/SettingsWindow.xaml.cs](mdc:src/SettingsWindow.xaml.cs) - Application settings interface
24+- [src/ChatBoxOptionsWindow.xaml.cs](mdc:src/ChatBoxOptionsWindow.xaml.cs) - ChatBox customization options
25+- [src/ChatBoxSelectorWindow.xaml.cs](mdc:src/ChatBoxSelectorWindow.xaml.cs) - ChatBox region selector
26+- [src/LogWindow.xaml.cs](mdc:src/LogWindow.xaml.cs) - Log viewer window
1827  
19−- When possible, design automated tests for new features and bug fixes.
20−- Run relevant automated tests after finishing changes to guard against regressions.
21−- If tests cannot be run or do not exist, state that clearly in the handoff and describe any manual verification performed.
22−- Always finish project changes by building the Release configuration: `dotnet build .\UGTLive.sln --configuration Release`.
23−- If a running UGTLive process prevents the Release build, capture its executable/command line, stop it, complete the build, and restart it afterward. Do not start UGTLive if it was not running before the build.
28+### Dialog Windows
29+- [src/UpdateAvailableDialog.xaml.cs](mdc:src/UpdateAvailableDialog.xaml.cs) - Version update notification
30+- [src/TtsVoiceSelectorDialog.xaml.cs](mdc:src/TtsVoiceSelectorDialog.xaml.cs) - TTS voice selection
31+- [src/ServiceInstallDialog.xaml.cs](mdc:src/ServiceInstallDialog.xaml.cs) - Python service installation
32+- [src/ServiceDiagnosticDialog.xaml.cs](mdc:src/ServiceDiagnosticDialog.xaml.cs) - Service diagnostics
33+- [src/ServerSetupDialog.xaml.cs](mdc:src/ServerSetupDialog.xaml.cs) - Server setup wizard
34+- [src/OllamaModelSelectorWindow.xaml.cs](mdc:src/OllamaModelSelectorWindow.xaml.cs) - Ollama model selection
35+- [src/GoogleVisionSetupDialog.xaml.cs](mdc:src/GoogleVisionSetupDialog.xaml.cs) - Google Vision setup
36+- [src/ShutdownDialog.xaml.cs](mdc:src/ShutdownDialog.xaml.cs) - Shutdown confirmation
37+- [src/NoTextInfoDialog.xaml.cs](mdc:src/NoTextInfoDialog.xaml.cs) - No text detected notification
2438  
25−Always add automation/test harnesses to test options/buttons/features as needed. Document them.
39+### OCR Services
40+- [src/WindowsOCRManager.cs](mdc:src/WindowsOCRManager.cs) - Windows built-in OCR integration
41+- [src/GoogleVisionOCRService.cs](mdc:src/GoogleVisionOCRService.cs) - Google Cloud Vision OCR
42+- [src/UniversalBlockDetector.cs](mdc:src/UniversalBlockDetector.cs) - Advanced text block detection and grouping
43+- [src/PythonServicesManager.cs](mdc:src/PythonServicesManager.cs) - Manages Python OCR services (EasyOCR, MangaOCR, PaddleOCR, DocTR)
44+- [src/PythonService.cs](mdc:src/PythonService.cs) - Individual Python service wrapper
2645  
27−## Cloud LLM Model Maintenance
46+### Translation Services
47+- [src/ITranslationService.cs](mdc:src/ITranslationService.cs) - Translation service interface
48+- [src/GeminiTranslationService.cs](mdc:src/GeminiTranslationService.cs) - Google Gemini API integration
49+- [src/ChatGptTranslationService.cs](mdc:src/ChatGptTranslationService.cs) - OpenAI ChatGPT integration
50+- [src/OllamaTranslationService.cs](mdc:src/OllamaTranslationService.cs) - Local Ollama LLM integration
51+- [src/GoogleTranslateService.cs](mdc:src/GoogleTranslateService.cs) - Google Translate integration
52+- [src/LlamaCppTranslationService.cs](mdc:src/LlamaCppTranslationService.cs) - llama.cpp local translation
53+- [src/TranslationServiceFactory.cs](mdc:src/TranslationServiceFactory.cs) - Factory for creating translation services
2854  
29−- Cloud and CLI model picker presets live in `src/SettingsWindow.xaml`; their fallback/default values live in `src/ConfigManager.cs`, `src/ConfigManager.Translation.cs`, and `src/SettingsWindow.TranslationSettings.cs`.
30−- Subscription-backed CLI providers display as `Anthropic Sub`, `OpenAI Sub`, and `Gemini CLI (Enterprise)`, but their stable internal IDs remain `ClaudeCli`, `CodexCli`, and `GeminiCli`; use `ComboBoxItem.Tag` for the internal ID. Google ended personal/free/AI Pro/AI Ultra access through Gemini CLI on June 18, 2026; do not replace it with Antigravity CLI until `agy -p` reliably exposes captured stdout to Windows parent processes (see `docs/settings-connection-tests.md`).
31−- Keep provider-specific capability handling in the matching translation service. In particular, Anthropic model generations use different manual/adaptive thinking request shapes.
32−- Verify model IDs and request compatibility against current official provider documentation. Verify OpenRouter-prefixed slugs against its `/api/v1/models` catalog before adding presets.
55+### Audio Services
56+- [src/GoogleTTSService.cs](mdc:src/GoogleTTSService.cs) - Google Text-to-Speech
57+- [src/ElevenLabsService.cs](mdc:src/ElevenLabsService.cs) - ElevenLabs TTS integration
58+- [src/OpenAIRealtimeAudioService.cs](mdc:src/OpenAIRealtimeAudioService.cs) - OpenAI real-time audio transcription
59+- [src/AudioPlaybackManager.cs](mdc:src/AudioPlaybackManager.cs) - Audio playback management
60+- [src/AudioPreloadService.cs](mdc:src/AudioPreloadService.cs) - TTS audio preloading
3361  
34−## Feature Index
62+### Utilities and Managers
63+- [src/HotkeyManager.cs](mdc:src/HotkeyManager.cs) - Global keyboard shortcuts management
64+- [src/MouseManager.cs](mdc:src/MouseManager.cs) - Mouse input handling
65+- [src/LogManager.cs](mdc:src/LogManager.cs) - Application logging
66+- [src/SplashManager.cs](mdc:src/SplashManager.cs) - Splash screen management
67+- [src/TextObject.cs](mdc:src/TextObject.cs) - Text region data structure
68+- [src/ErrorPopupManager.cs](mdc:src/ErrorPopupManager.cs) - Error popup management
69+- [src/GamepadManager.cs](mdc:src/GamepadManager.cs) - Gamepad input management
70+- [src/WebViewEnvironmentManager.cs](mdc:src/WebViewEnvironmentManager.cs) - WebView2 environment management
71+- [src/WebViewPool.cs](mdc:src/WebViewPool.cs) - WebView2 instance pooling
72+- [src/OverlayProfiler.cs](mdc:src/OverlayProfiler.cs) - Overlay performance profiling
73+- [src/CondaHelper.cs](mdc:src/CondaHelper.cs) - Conda environment management
74+- [src/ServiceConfigParser.cs](mdc:src/ServiceConfigParser.cs) - Python service config parsing
75+- [src/ServiceItemViewModel.cs](mdc:src/ServiceItemViewModel.cs) - Service UI view model
76+- [src/OllamaModelDownloader.cs](mdc:src/OllamaModelDownloader.cs) - Ollama model download management
77+- [src/HotkeyEntry.cs](mdc:src/HotkeyEntry.cs) - Hotkey entry data structure
78+- [src/TranslationEventArgs.cs](mdc:src/TranslationEventArgs.cs) - Translation event arguments
3579  
36−- Settings API/model/voice tests: see `docs/settings-connection-tests.md`. UI buttons and `--test-settings-connection` must continue to call the shared `SettingsConnectionTester` implementation.
37−- OpenAI All In One Snap translation: see `docs/openai-all-in-one.md`. It is a Snap-only, visual-only `gpt-image-2` Image Edits path; Auto and realtime processing must remain on the standard OCR pipeline.
80+### Python Services
81+- `app/services/EasyOCR/` - EasyOCR Python service
82+- `app/services/MangaOCR/` - MangaOCR Python service
83+- `app/services/PaddleOCR/` - PaddleOCR Python service
84+- `app/services/DocTR/` - DocTR Python service
85+- `app/services/shared/` - Shared Python utilities
86+- `app/services/util/` - Python installation utilities
3887  
88+Each Python service directory contains:
89+- `server.py` - FastAPI server implementation
90+- `service_config.txt` - Service configuration
91+- `Install.bat` - Installation script
92+- `RunServer.bat` - Server launch script
93+- `DiagnosticTest.bat` - Diagnostic test script
94+- `Uninstall.bat` - Uninstallation script
3995  
40−## Security
96+## Key Architectural Patterns
4197  
42−- Never commit sensitive data, including credentials, tokens, passwords, private keys, cookies, customer data, personal data, or machine-specific authentication material.
43−- If an AI assistant needs authentication data or other secrets for local work, use `agents_secret.md` for those notes.
44−- `agents_secret.md` must stay ignored by git and must not be committed.
45−- Do not put secrets in commit messages, logs, issue text, pull request descriptions, generated docs, or other tracked files.
46−- Configuration logging must pass key names through `ConfigManager.IsSensitiveConfigKey`; never print raw secret values in startup or harness output.
47−- Before committing, review staged changes for accidental secrets.
98+### Singleton Pattern
99+The application uses singleton pattern for core managers:
100+- `Logic.Instance` - Main application logic
101+- `ConfigManager.Instance` - Configuration management
102+- `UniversalBlockDetector.Instance` - Text block detection (replaces BlockDetectionManager)
103+- `LogManager.Instance` - Logging
104+- `HotkeyManager.Instance` - Keyboard shortcuts (replaces KeyboardShortcuts)
105+- `PythonServicesManager.Instance` - Python OCR service management
106+- `AudioPlaybackManager.Instance` - Audio playback
107+- `AudioPreloadService.Instance` - Audio preloading
108+- `GamepadManager.Instance` - Gamepad input
48109  
49−## Git
110+### Window Management
111+Each window inherits from WPF Window class and follows these patterns:
112+- Windows are typically created once and shown/hidden as needed
113+- Settings are persisted through ConfigManager
114+- Windows communicate through events and direct method calls on Logic.Instance
50115  
51−- Never add OpenAI/Codex/Claude etc as a co-author on git commits.
52−- NEVER `git commit` unless explicitly told to commit.
53−- NEVER `git push` unless explicitly told to push. "Commit" means commit
54− locally only; committing is not permission to push.
116+### Translation Flow
117+1. Screen capture → OCR (Windows OCR, EasyOCR, MangaOCR, PaddleOCR, DocTR, or Google Vision) → Universal Block Detection → Translation Service → Display
118+2. Text blocks are grouped by UniversalBlockDetector
119+3. Translation includes context from previous translations
120+4. Results are displayed in ChatBox or as overlay
121+ 
122+## Development Guidelines
123+ 
124+### Code Style
125+- **Naming**: PascalCase for public members, camelCase for private, underscore prefix for fields
126+- **Layout**: 4-space indentation, Allman braces, System namespaces first
127+- **Properties**: Use GetVariableName/SetVariableName pattern in ConfigManager
128+- **UI Properties**: Direct Get/Set to GUI elements when possible
129+- **Error Handling**: Avoid try/catch blocks, check for null, log errors via LogManager
130+ 
131+### Project Configuration
132+- **Framework**: .NET 8.0 Windows
133+- **Output**: `app/` directory
134+- **Assembly**: `ugtlive.exe` (or `ugtlive_debug.exe` in Debug)
135+- **Dependencies**: NAudio, Microsoft.Windows.CsWinRT, WebView2
136+ 
137+### Key Features
138+- Multiple OCR backends (Windows OCR, EasyOCR, MangaOCR, PaddleOCR, DocTR, Google Vision)
139+- Multiple translation services (Gemini, ChatGPT, Ollama, Google Translate, llama.cpp)
140+- Real-time screen capture and translation
141+- Customizable overlay windows
142+- Audio transcription and TTS
143+- Context-aware translations
144+- Global keyboard shortcuts (via HotkeyManager)
145+- Gamepad support
146+- Python service management UI
147+ 
148+## Common Development Tasks
149+ 
150+### Adding a New Translation Service
151+1. Create a new class implementing `ITranslationService`
152+2. Add service configuration to `ConfigManager`
153+3. Update `TranslationServiceFactory` to create instances
154+4. Add UI controls in `SettingsWindow.xaml`
155+ 
156+### Adding New Settings
157+1. Add property to `ConfigManager` with getter/setter
158+2. Add UI controls to `SettingsWindow.xaml`
159+3. Wire up events in `SettingsWindow.xaml.cs`
160+4. Settings are automatically persisted
161+ 
162+### Adding a New Python OCR Service
163+1. Create service directory in `app/services/` (e.g., `app/services/NewOCR/`)
164+2. Create `service_config.txt` with required fields
165+3. Create `server.py` implementing FastAPI endpoints
166+4. Create batch scripts: `Install.bat`, `RunServer.bat`, `DiagnosticTest.bat`, `Uninstall.bat`
167+5. Service will be automatically discovered by `PythonServicesManager`
168+ 
169+### Debugging OCR Issues
170+1. Check `LogManager` output for errors
171+2. Use Monitor window to preview capture area
172+3. Verify Python server is running (for Python OCR services)
173+4. Check service diagnostics dialog
174+5. Review UniversalBlockDetector settings
175+ 
176+## Version Management
177+ 
178+When incrementing the version number, you must update it in **THREE places**:
179+ 
180+1. **[src/SplashManager.cs](mdc:src/SplashManager.cs)** - `CurrentVersion` constant
181+ ```csharp
182+ public const double CurrentVersion = 0.60; // Update this value
183+ ```
184+ 
185+2. **[media/latest_version_checker.json](mdc:media/latest_version_checker.json)** - `latest_version` field
186+ ```json
187+ {
188+ "name":"Universal Game Translator Live",
189+ "latest_version":0.60, // Update this value
190+ "message":"Download V{VERSION_STRING} now from rtsoft.com?\n\nV0.60: " // Update version in message
191+ }
192+ ```
193+ 
194+3. **[README.md](mdc:README.md)** - Version badge and history entry
195+ - Update the version badge: `[![Version](https://img.shields.io/badge/version-0.60-blue.svg)]`
196+ - Add a new history entry at the top: `**V0.60** - [description]`
197+ 
198+### Version Increment Rules
199+- Default increment: **0.01** (e.g., 0.25 → 0.26)
200+- Major features: **0.10** (e.g., 0.25 → 0.35)
201+- Complete rewrites: **1.00** (e.g., 0.99 → 1.00)
202+- **ALWAYS update all three files** to keep them in sync
203+- Version format is a double/float (e.g., 0.60, not "0.60")
204+ 
205+## Important Notes
206+- Application is Windows-only due to WPF and Windows OCR dependencies
207+- Python OCR services run locally on configurable ports
208+- First run downloads OCR language models
209+- Settings stored in `app/` directory (config.txt, service configs)
210+- All web calls are for version checking and API services only
55211  
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack