| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 0 | 7 | 29 | 0% |
| Commands | 0 | 3 | 0 | 0% |
| Section tags | 0 | 5 | 4 | 0% |
What each file covers
Sections
0 shared · 7 only in A · 29 only in B- − AGENTS.md
- − Shared Project Memory
- − Testing
- − Cloud LLM Model Maintenance
- − Feature Index
- − Security
- − Git
- + Code Style and Conventions
- + Naming Conventions
- + Classes and Methods
- + Properties
- + Code Layout
- + Indentation and Braces
- + Using Statements
- + Example Structure
- + Singleton Pattern
- + Implementation
- + Error Handling
- + General Principles
- + Error Handling Pattern
- + Comments
- + When to Comment
- + Comment Style
- + File Organization
- + File Structure
- + One Class Per File
- + Nullable Reference Types
- + Null Handling
- + Constants
- + Configuration Keys
- + Async/Await Patterns
- + Method Naming
- + LINQ Usage
- + When to Use LINQ
- + String Handling
- + String Operations
Commands
0 shared · 3 only in A · 0 only in B- − dotnet build .\UGTLive.sln --configuration Release
- − git commit
- − git push
Section tags
0 shared · 5 only in A · 4 only in B- − test
- − git-pr
- − security
- − performance
- − do-not
- + code-style
- + architecture
- + types
- + docs
Line diff
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/code-style-conventions.mdc
@@ +1 @@
1---
2description: Code style and naming conventions for UGTLive
3globs: ["**/*.cs"]
4alwaysApply: true
5---
6
7# Code Style and Conventions
8
9## Naming Conventions
10
11### Classes and Methods
12- **Classes**: PascalCase (e.g., `ConfigManager`, `TranslationService`)
13- **Public Methods**: PascalCase (e.g., `GetValue()`, `TranslateAsync()`)
14- **Private Methods**: camelCase (e.g., `loadConfig()`, `processImage()`)
15- **Private Fields**: Underscore prefix + camelCase (e.g., `_instance`, `_configValues`)
16- **Constants**: UPPER_SNAKE_CASE (e.g., `GEMINI_API_KEY`, `TRANSLATION_SERVICE`)
17
18### Properties
19- Use PascalCase for public properties
20- Prefer explicit getters/setters over auto-properties when logic is needed
21- Pattern: `GetVariableName()` / `SetVariableName()` for ConfigManager
22- Direct property access for simple UI bindings
23
24## Code Layout
25
26### Indentation and Braces
27- **Indentation**: 4 spaces (no tabs)
28- **Braces**: Allman style (opening brace on new line)
29- **Line Length**: Prefer < 120 characters, wrap if needed
30
31### Using Statements
32- System namespaces first
33- Third-party namespaces second
34- Application namespaces last
35- Group related usings together
36
37### Example Structure
38```csharp
39using System;
40using System.Collections.Generic;
41using System.IO;
42using System.Threading.Tasks;
43using System.Windows;
44using UGTLive;
45
46namespace UGTLive
47{
48 public class ExampleClass
49 {
50 private static ExampleClass? _instance;
51 private readonly Dictionary<string, string> _configValues;
52
53 public static ExampleClass Instance
54 {
55 get
56 {
57 if (_instance == null)
58 {
59 _instance = new ExampleClass();
60 }
61 return _instance;
62 }
63 }
64
65 private ExampleClass()
66 {
67 _configValues = new Dictionary<string, string>();
68 }
69
70 public string GetValue(string key)
71 {
72 return _configValues.TryGetValue(key, out var value) ? value : "";
73 }
74 }
75}
76```
77
78## Singleton Pattern
79
80### Implementation
81- Use lazy initialization with null check
82- Private constructor
83- Static Instance property
84- Thread-safe initialization (simple null check is sufficient for this app)
85
86```csharp
87private static ConfigManager? _instance;
88
89public static ConfigManager Instance
90{
91 get
92 {
93 if (_instance == null)
94 {
95 _instance = new ConfigManager();
96 }
97 return _instance;
98 }
99}
100
101private ConfigManager()
102{
103 // Initialization
104}
105```
106
107## Error Handling
108
109### General Principles
110- **Avoid try/catch blocks** unless absolutely necessary
111- **Check for null** before using objects
112- **Log errors** using `LogManager.Instance.LogError()`
113- **Console.WriteLine** for debug output
114- **MessageBox.Show** for user-facing errors (on UI thread)
115
116### Error Handling Pattern
117```csharp
118// Prefer null checks over try/catch
119if (response == null)
120{
121 Console.WriteLine("Response is null");
122 return null;
123}
124
125// Log errors
126LogManager.Instance.LogError("Error description", exception);
127
128// User-facing errors on UI thread
129Application.Current.Dispatcher.Invoke(() =>
130{
131 MessageBox.Show($"Error: {message}", "Error Title",
132 MessageBoxButton.OK, MessageBoxImage.Error);
133});
134```
135
136## Comments
137
138### When to Comment
139- Complex algorithms or business logic
140- Non-obvious code decisions
141- API integration details
142- TODO items for future improvements
143
144### Comment Style
145- Use `//` for single-line comments
146- Use `///` for XML documentation on public APIs
147- Keep comments concise and up-to-date
148
149## File Organization
150
151### File Structure
1521. Using statements
1532. Namespace declaration
1543. Class declaration
1554. Private fields
1565. Public properties
1576. Constructor
1587. Public methods
1598. Private methods
160
161### One Class Per File
162- Each class should be in its own file
163- File name matches class name
164- Exception: Small helper classes can be in same file
165
166## Nullable Reference Types
167
168### Null Handling
169- Use nullable reference types (`string?`, `object?`)
170- Check for null before dereferencing
171- Use null-coalescing operator (`??`) when appropriate
172- Use null-conditional operator (`?.`) for safe access
173
174```csharp
175private string? _optionalValue;
176
177public string GetValue()
178{
179 return _optionalValue ?? "default";
180}
181
182if (_optionalValue != null)
183{
184 // Use _optionalValue safely
185}
186```
187
188## Constants
189
190### Configuration Keys
191- Define as `public const string` in ConfigManager
192- Use descriptive UPPER_SNAKE_CASE names
193- Group related constants together
194
195```csharp
196public const string GEMINI_API_KEY = "gemini_api_key";
197public const string GEMINI_MODEL = "gemini_model";
198```
199
200## Async/Await Patterns
201
202### Method Naming
203- Async methods end with `Async` suffix
204- Return `Task` or `Task<T>`
205- Use `await` for async calls
206
207```csharp
208public async Task<string> TranslateAsync(string text)
209{
210 var result = await httpClient.GetStringAsync(url);
211 return result;
212}
213```
214
215## LINQ Usage
216
217### When to Use LINQ
218- Prefer LINQ for collection operations
219- Use method syntax for complex queries
220- Keep queries readable
221
222```csharp
223var filtered = items.Where(x => x.IsValid)
224 .OrderBy(x => x.Name)
225 .ToList();
226```
227
228## String Handling
229
230### String Operations
231- Use `string.IsNullOrWhiteSpace()` for null/empty checks
232- Prefer string interpolation (`$"text {variable}"`) over concatenation
233- Use `StringBuilder` for multiple concatenations
234
235```csharp
236if (string.IsNullOrWhiteSpace(value))
237{
238 return defaultValue;
239}
240
241var message = $"Processing {count} items";
242```
243
@@ −1 +1 @@
1−# AGENTS.md
1+---
2+description: Code style and naming conventions for UGTLive
3+globs: ["**/*.cs"]
4+alwaysApply: true
5+---
26
3−Project operating instructions for AI assistants working in this repository.
7+# Code Style and Conventions
48
5−## Shared Project Memory
9+## Naming Conventions
610
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.
11+### Classes and Methods
12+- **Classes**: PascalCase (e.g., `ConfigManager`, `TranslationService`)
13+- **Public Methods**: PascalCase (e.g., `GetValue()`, `TranslateAsync()`)
14+- **Private Methods**: camelCase (e.g., `loadConfig()`, `processImage()`)
15+- **Private Fields**: Underscore prefix + camelCase (e.g., `_instance`, `_configValues`)
16+- **Constants**: UPPER_SNAKE_CASE (e.g., `GEMINI_API_KEY`, `TRANSLATION_SERVICE`)
1417
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.
18+### Properties
19+- Use PascalCase for public properties
20+- Prefer explicit getters/setters over auto-properties when logic is needed
21+- Pattern: `GetVariableName()` / `SetVariableName()` for ConfigManager
22+- Direct property access for simple UI bindings
1623
17−## Testing
24+## Code Layout
1825
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.
26+### Indentation and Braces
27+- **Indentation**: 4 spaces (no tabs)
28+- **Braces**: Allman style (opening brace on new line)
29+- **Line Length**: Prefer < 120 characters, wrap if needed
2430
25−Always add automation/test harnesses to test options/buttons/features as needed. Document them.
31+### Using Statements
32+- System namespaces first
33+- Third-party namespaces second
34+- Application namespaces last
35+- Group related usings together
2636
27−## Cloud LLM Model Maintenance
37+### Example Structure
38+```csharp
39+using System;
40+using System.Collections.Generic;
41+using System.IO;
42+using System.Threading.Tasks;
43+using System.Windows;
44+using UGTLive;
2845
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.
46+namespace UGTLive
47+{
48+ public class ExampleClass
49+ {
50+ private static ExampleClass? _instance;
51+ private readonly Dictionary<string, string> _configValues;
3352
34−## Feature Index
53+ public static ExampleClass Instance
54+ {
55+ get
56+ {
57+ if (_instance == null)
58+ {
59+ _instance = new ExampleClass();
60+ }
61+ return _instance;
62+ }
63+ }
3564
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.
65+ private ExampleClass()
66+ {
67+ _configValues = new Dictionary<string, string>();
68+ }
3869
70+ public string GetValue(string key)
71+ {
72+ return _configValues.TryGetValue(key, out var value) ? value : "";
73+ }
74+ }
75+}
76+```
3977
40−## Security
78+## Singleton Pattern
4179
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.
80+### Implementation
81+- Use lazy initialization with null check
82+- Private constructor
83+- Static Instance property
84+- Thread-safe initialization (simple null check is sufficient for this app)
4885
49−## Git
86+```csharp
87+private static ConfigManager? _instance;
5088
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.
89+public static ConfigManager Instance
90+{
91+ get
92+ {
93+ if (_instance == null)
94+ {
95+ _instance = new ConfigManager();
96+ }
97+ return _instance;
98+ }
99+}
100+
101+private ConfigManager()
102+{
103+ // Initialization
104+}
105+```
106+
107+## Error Handling
108+
109+### General Principles
110+- **Avoid try/catch blocks** unless absolutely necessary
111+- **Check for null** before using objects
112+- **Log errors** using `LogManager.Instance.LogError()`
113+- **Console.WriteLine** for debug output
114+- **MessageBox.Show** for user-facing errors (on UI thread)
115+
116+### Error Handling Pattern
117+```csharp
118+// Prefer null checks over try/catch
119+if (response == null)
120+{
121+ Console.WriteLine("Response is null");
122+ return null;
123+}
124+
125+// Log errors
126+LogManager.Instance.LogError("Error description", exception);
127+
128+// User-facing errors on UI thread
129+Application.Current.Dispatcher.Invoke(() =>
130+{
131+ MessageBox.Show($"Error: {message}", "Error Title",
132+ MessageBoxButton.OK, MessageBoxImage.Error);
133+});
134+```
135+
136+## Comments
137+
138+### When to Comment
139+- Complex algorithms or business logic
140+- Non-obvious code decisions
141+- API integration details
142+- TODO items for future improvements
143+
144+### Comment Style
145+- Use `//` for single-line comments
146+- Use `///` for XML documentation on public APIs
147+- Keep comments concise and up-to-date
148+
149+## File Organization
150+
151+### File Structure
152+1. Using statements
153+2. Namespace declaration
154+3. Class declaration
155+4. Private fields
156+5. Public properties
157+6. Constructor
158+7. Public methods
159+8. Private methods
160+
161+### One Class Per File
162+- Each class should be in its own file
163+- File name matches class name
164+- Exception: Small helper classes can be in same file
165+
166+## Nullable Reference Types
167+
168+### Null Handling
169+- Use nullable reference types (`string?`, `object?`)
170+- Check for null before dereferencing
171+- Use null-coalescing operator (`??`) when appropriate
172+- Use null-conditional operator (`?.`) for safe access
173+
174+```csharp
175+private string? _optionalValue;
176+
177+public string GetValue()
178+{
179+ return _optionalValue ?? "default";
180+}
181+
182+if (_optionalValue != null)
183+{
184+ // Use _optionalValue safely
185+}
186+```
187+
188+## Constants
189+
190+### Configuration Keys
191+- Define as `public const string` in ConfigManager
192+- Use descriptive UPPER_SNAKE_CASE names
193+- Group related constants together
194+
195+```csharp
196+public const string GEMINI_API_KEY = "gemini_api_key";
197+public const string GEMINI_MODEL = "gemini_model";
198+```
199+
200+## Async/Await Patterns
201+
202+### Method Naming
203+- Async methods end with `Async` suffix
204+- Return `Task` or `Task<T>`
205+- Use `await` for async calls
206+
207+```csharp
208+public async Task<string> TranslateAsync(string text)
209+{
210+ var result = await httpClient.GetStringAsync(url);
211+ return result;
212+}
213+```
214+
215+## LINQ Usage
216+
217+### When to Use LINQ
218+- Prefer LINQ for collection operations
219+- Use method syntax for complex queries
220+- Keep queries readable
221+
222+```csharp
223+var filtered = items.Where(x => x.IsValid)
224+ .OrderBy(x => x.Name)
225+ .ToList();
226+```
227+
228+## String Handling
229+
230+### String Operations
231+- Use `string.IsNullOrWhiteSpace()` for null/empty checks
232+- Prefer string interpolation (`$"text {variable}"`) over concatenation
233+- Use `StringBuilder` for multiple concatenations
234+
235+```csharp
236+if (string.IsNullOrWhiteSpace(value))
237+{
238+ return defaultValue;
239+}
240+
241+var message = $"Processing {count} items";
242+```
55243
