|
| 1 | +# GitHub Copilot Code Review Instructions |
| 2 | + |
| 3 | +When performing a code review, respond in English. |
| 4 | + |
| 5 | +## Architecture & Patterns |
| 6 | + |
| 7 | +When performing a code review, ensure ViewModels are never injected as dependencies into services or repositories. Only Android activities and composable functions should use ViewModels. |
| 8 | + |
| 9 | +When performing a code review, verify that all async operations use `viewModelScope.launch` instead of `GlobalScope.launch` in ViewModels. |
| 10 | + |
| 11 | +When performing a code review, ensure Repository pattern is followed with proper data source abstraction. |
| 12 | + |
| 13 | +When performing a code review, verify StateFlow is used for reactive state management in ViewModels with proper `_uiState` and `uiState` pattern. |
| 14 | + |
| 15 | +## Error Handling & Safety |
| 16 | + |
| 17 | +When performing a code review, flag any use of the not-null assertion operator (`!!`) and suggest safe calls (`?.`) with proper null handling. |
| 18 | + |
| 19 | +When performing a code review, ensure all coroutine operations use proper error handling with `runCatching` |
| 20 | + |
| 21 | +When performing a code review, verify that all Logger calls include the TAG as context parameter, e.g., `Logger.warn("message", e = e, context = TAG)`. |
| 22 | + |
| 23 | +When performing a code review, check that methods exist before they are called, especially after refactoring. |
| 24 | + |
| 25 | +## UI & Compose Best Practices |
| 26 | + |
| 27 | +When performing a code review, ensure all user-facing strings use `stringResource(R.string.*)` instead of hardcoded strings. |
| 28 | + |
| 29 | +When performing a code review, verify that expensive Compose computations are wrapped in `remember` blocks. |
| 30 | + |
| 31 | +When performing a code review, check that Material3 design guidelines are followed for UI components. |
| 32 | + |
| 33 | +When performing a code review, ensure proper state management patterns with `MutableStateFlow` and `StateFlow`. |
| 34 | + |
| 35 | +## Code Quality & Readability |
| 36 | + |
| 37 | +When performing a code review, focus on readability and avoid nested ternary operators. |
| 38 | + |
| 39 | +When performing a code review, ensure unused code is removed after refactoring. |
| 40 | + |
| 41 | +When performing a code review, verify that existing extensions and utilities are used rather than creating duplicate functionality. |
| 42 | + |
| 43 | +## Dependency Injection & Services |
| 44 | + |
| 45 | +When performing a code review, verify proper Hilt dependency injection patterns are followed. |
| 46 | + |
| 47 | +When performing a code review, ensure services contain business logic and don't directly depend on ViewModels. |
| 48 | + |
| 49 | +## Build & Testing |
| 50 | + |
| 51 | +When performing a code review, ensure proper build variant usage (dev for regtest, tnet for testnet). |
| 52 | + |
| 53 | +When performing a code review, verify that unit tests follow the pattern `./gradlew testDevDebugUnitTest --tests ClassName`. |
| 54 | + |
| 55 | +When performing a code review, suggest Unit Test com composable components and business logic covering the most important cases |
| 56 | + |
| 57 | +## Lightning & Bitcoin Specific |
| 58 | + |
| 59 | +When performing a code review, ensure proper usage of LDK Node and bitkitcore library patterns. |
| 60 | + |
| 61 | +When performing a code review, verify that Bitcoin/Lightning operations are properly handled in the service layer. |
| 62 | + |
| 63 | +When performing a code review, verify that propper Bitcoin and Lightning technical terms are used when naming code components |
| 64 | + |
| 65 | +## Performance & Memory |
| 66 | + |
| 67 | +When performing a code review, check for potential memory leaks in coroutines and ensure proper scope usage. |
| 68 | + |
| 69 | +When performing a code review, verify that database operations use Room patterns correctly. |
| 70 | + |
| 71 | +When performing a code review, ensure network operations use Ktor patterns and proper error handling. |
| 72 | + |
| 73 | +## Documentation & Maintenance |
| 74 | + |
| 75 | +When performing a code review, ensure code follows the established patterns from the existing codebase. |
| 76 | + |
| 77 | +When performing a code review, verify that complex business logic is properly documented. |
| 78 | + |
| 79 | +When performing a code review, check that new features integrate well with the existing MVVM architecture. |
0 commit comments