diff --git a/AGENTS.md b/AGENTS.md index 929d2b53..90e3133c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,26 +1,5 @@ # AGENTS.md ---- - -# Author Preferences - -## Code Opinions - -- Extract related/grouped logic (state, reactions, actions) into dedicated stores when it improves readability — keep widgets focused on rendering -- Default to writing tests: new or changed logic (stores, API clients, parsing, utils) ships with tests; when touching existing tested code, update or extend its tests. Pure UI/rendering or config changes may skip. - -## Infrastructure Checklist - -When creating new infrastructure (screens, API clients, stores), use exploration findings as a **checklist** — systematically verify each convention is followed before writing code. - -## Never - -- Never edit `.g.dart` files directly — always regenerate with `dart run build_runner build` - ---- - -# Project - Flutter mobile app for browsing Twitch on iOS and Android. Uses MobX for state management with code generation. ## Commands @@ -28,7 +7,7 @@ Flutter mobile app for browsing Twitch on iOS and Android. Uses MobX for state m ```bash flutter pub get # Install dependencies flutter run --dart-define=CLIENT_ID=ID --dart-define=SECRET=SECRET # Run with Twitch credentials -flutter analyze # Static analysis (run after changes) +flutter analyze # Static analysis flutter test # Run tests dart run build_runner build # Regenerate .g.dart files (MobX/JSON models) dart run build_runner build --delete-conflicting-outputs # Same, but clears stale outputs @@ -50,6 +29,11 @@ dart run build_runner build --delete-conflicting-outputs # Same, but - All API services extend `BaseApiClient` (`lib/apis/base_api_client.dart`) — don't create standalone API classes - MobX stores use a generated mixin pattern — see `lib/screens/settings/stores/auth_store.dart` for the canonical example +## Code Opinions + +- Extract related/grouped logic (state, reactions, actions) into dedicated stores when it improves readability — keep widgets focused on rendering +- Default to writing tests: new or changed logic (stores, API clients, parsing, utils) ships with tests; when touching existing tested code, update or extend its tests. Pure UI/rendering or config changes may skip. + ## Gotchas - After changing MobX stores or `@JsonSerializable` models, regenerate with `dart run build_runner build`. Never edit `.g.dart` files directly. Commit `.g.dart` files to source control.