This document defines how an AI Agent should write code for the UnFilter project. We prioritize technical integrity, architectural purity, and UI/UX excellence.
- Prefer
finalandconsteverywhere. - Use Riverpod for all state management. Avoid
setStateunless the state is purely local to a single widget (e.g., a toggle). - Data models must extend
Equatablefor efficient rebuilds.
- When using the
replacetool, provide enough context to ensure the edit is unambiguous. - Do not perform "cleanup" or refactoring of unrelated code unless explicitly requested.
- Always check for existing patterns in
lib/common/widgetsorlib/core/servicesbefore implementing a new utility.
- NEVER use emojis or icons in
debugPrintor production logs. - Follow the format:
[FeatureName] LEVEL: Message. - Use the
LoggingServicemethods:info(),debug(),error().
- Check
DESIGN.mdbefore creating any UI. - Use UncutSans for everything. Ensure the font is explicitly applied in component themes.
- Respect the Tamil Typography Scaling logic in
AppTheme.getTheme().
- Selection Mode: If implementing a list, support multi-select with a long-press (see
ViewLogsPage). - Empty States: Every list must have a
_buildEmptyStatewidget with a relevant icon and descriptive text. - Platform Native: Use
SystemNavigator.pop()orBackButton()where appropriate to feel native to Android.
- Any operation involving file I/O, network, or Native Channels must be wrapped in
try-catchwith a fallback state. - Use
AsyncValue.guardin Riverpod Notifiers to catch errors automatically.
- Do not modify
main.dart'srunZonedGuardedlogic unless you are specifically improving the crash recovery system. - Ensure the
CrashRecoveryScreenremains "provider-independent" so it can render even if the app's state providers are broken.
A task is only complete when:
- The logic is verified (tests or successful repository runs).
- The UI is pixel-perfect and follows
DESIGN.md. - The code is documented and committed in logical groups.
- Emojis/icons are removed from all technical outputs.