diff --git a/AGENTS.md b/AGENTS.md index 3e00443f..89f645bb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -26,7 +26,7 @@ - Analyze app only: `flutter analyze lib` - Analyze all (includes widgetbook): `flutter analyze .` - Run tests: `flutter test --reporter=expanded` -- Run app: `flutter run` +- Run app: `flutter run` only when no suitable Flutter process is already running ## Code conventions - Prefer `package:spark/...` imports; avoid deep cross-feature relative imports @@ -46,6 +46,12 @@ - Reuse existing shared seams and canonical helpers before adding feature-local variants; for repeated UI/loading/motion behavior, check shared templates, design-system components, and Widgetbook patterns first - Watch file and widget growth; if a change pushes a file toward 1k lines or mixes responsibilities, split a focused helper/subcomponent before adding more flow logic +## Review guidance +- Prioritize structural regressions over style nits: duplicated owners, scattered special cases, wrong-layer logic, and abstractions that only move complexity around +- Push for simpler designs that delete branches, helpers, state, or concepts instead of polishing a messy shape +- Treat unnecessary casts, nullable modes, silent fallbacks, and pass-through wrappers as review findings when they obscure the real contract +- Flag file growth, feature logic leaking into shared paths, and bespoke helpers where an existing shared seam should be reused + ## Localization (l10n) - All user-facing strings must go through `intl_en.arb` (`lib/src/core/l10n/intl_en.arb`), never hardcoded in widgets - Access: `AppLocalizations.of(context).someKey` @@ -65,8 +71,10 @@ 3. Format touched code (`dart format .`) 4. Analyze (`flutter analyze lib`, or `flutter analyze .` for wider impact) 5. Run targeted tests first, then broader tests (`flutter test`) -6. Keep comments minimal and only when needed -7. Only add tests for logic that actually needs verification; avoid trivial or redundant test coverage +6. If you want to run the app, first check whether a Flutter process is already running; if it is, use the Dart MCP to hot reload instead of starting a new `flutter run` process +7. If you want to test with a simulator, use `serve-sim` for simulator control and inspection +8. Keep comments minimal and only when needed +9. Only add tests for logic that actually needs verification; avoid trivial or redundant test coverage ## References - `analysis_options.yaml` (strict-casts, strict-raw-types; excludes `**/*.g.dart`)