51 lines
1.7 KiB
Markdown
51 lines
1.7 KiB
Markdown
|
|
# pgLabII AI Assistant Guidelines
|
||
|
|
|
||
|
|
## Project Context
|
||
|
|
This is a .NET 8/C# 13 Avalonia cross-platform application for document management.
|
||
|
|
|
||
|
|
### Architecture Overview
|
||
|
|
- **Main Project**: pgLabII (Avalonia UI)
|
||
|
|
- **Platform Projects**: pgLabII.Desktop
|
||
|
|
- **Utility Project**: pgLabII.PgUtils
|
||
|
|
- **Core Components**: DocumentSession, DocumentSessionFactory, LocalDb
|
||
|
|
|
||
|
|
## Coding Standards
|
||
|
|
|
||
|
|
### C# Guidelines
|
||
|
|
- Use C# 13 features and modern .NET patterns
|
||
|
|
- 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
|
||
|
|
|
||
|
|
### Avalonia-Specific
|
||
|
|
- Follow MVVM pattern strictly
|
||
|
|
- 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
|