2025-08-30 19:41:10 +02:00
|
|
|
# pgLabII AI Assistant Guidelines
|
|
|
|
|
|
|
|
|
|
## Project Context
|
2025-10-25 15:48:19 +02:00
|
|
|
This is a .NET 9/C# 14 Avalonia cross-platform application for querying and inspecting
|
|
|
|
|
postgresql databases. It should also be a good editor for SQL files.
|
2025-08-30 19:41:10 +02:00
|
|
|
|
|
|
|
|
### Architecture Overview
|
|
|
|
|
- **Main Project**: pgLabII (Avalonia UI)
|
|
|
|
|
- **Platform Projects**: pgLabII.Desktop
|
|
|
|
|
- **Utility Project**: pgLabII.PgUtils
|
|
|
|
|
- **Core Components**: DocumentSession, DocumentSessionFactory, LocalDb
|
|
|
|
|
|
|
|
|
|
## Coding Standards
|
|
|
|
|
|
|
|
|
|
### C# Guidelines
|
2025-10-25 15:48:19 +02:00
|
|
|
- Use C# 14 features and modern .NET patterns
|
2025-08-30 19:41:10 +02:00
|
|
|
- Prefer primary constructors for dependency injection
|
|
|
|
|
- Use `var` for obvious types, explicit types for clarity
|
|
|
|
|
- Implement proper async/await patterns for I/O operations
|
|
|
|
|
- Use nullable reference types consistently
|
|
|
|
|
- Prefer "target-typed new"
|
|
|
|
|
- Prefer "list initializer" over new
|
2025-10-25 15:48:19 +02:00
|
|
|
- Package versions are managed centrally in Directory.Packages.props
|
2025-08-30 19:41:10 +02:00
|
|
|
|
|
|
|
|
### Avalonia-Specific
|
|
|
|
|
- Follow MVVM pattern strictly
|
2025-10-25 15:48:19 +02:00
|
|
|
- x:Name does work for making components accessible in code-behind
|
2025-08-30 19:41:10 +02:00
|
|
|
- ViewModels should inherit from appropriate base classes
|
|
|
|
|
- Use ReactiveUI patterns where applicable
|
|
|
|
|
- Make use of annotations to generate bindable properties
|
|
|
|
|
- Implement proper data binding
|
|
|
|
|
- Consider cross-platform UI constraints
|
|
|
|
|
|
|
|
|
|
### Project Patterns
|
|
|
|
|
- Services should use dependency injection
|
|
|
|
|
- Use the DocumentSession pattern for data operations
|
|
|
|
|
- Integrate with LocalDb for persistence
|
|
|
|
|
- Implement proper error handling and logging
|
|
|
|
|
- Consider performance for document operations
|
|
|
|
|
- Use FluentResults.Result for expected errors
|
|
|
|
|
|
|
|
|
|
### Architecture Rules
|
|
|
|
|
- Keep platform-specific code in respective platform projects
|
|
|
|
|
- Shared business logic in main pgLabII project
|
|
|
|
|
- Utilities in pgLabII.PgUtils
|
|
|
|
|
- Follow clean architecture principles
|
|
|
|
|
|
|
|
|
|
## Code Review Focus Areas
|
|
|
|
|
1. Memory management for document operations
|
|
|
|
|
2. Cross-platform compatibility
|
|
|
|
|
3. Proper async patterns
|
|
|
|
|
4. Error handling and user feedback
|
|
|
|
|
5. Performance considerations for large documents
|
|
|
|
|
6. UI responsiveness
|