flutter-riverpod-architecture

Enforces Riverpod 2 architecture rules and ARB localization consistency for Flutter apps.

4|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/NEETROF/cymbra --skill flutter-riverpod-architecture-neetrof
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: flutter-riverpod-architecture
Source: https://github.com/NEETROF/cymbra/tree/main/.claude/skills/flutter-riverpod-architecture
Command: npx skills add https://github.com/NEETROF/cymbra --skill flutter-riverpod-architecture-neetrof

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Flutter codebases using Riverpod often drift into tangled architectures where widgets call services directly, providers imperatively invalidate each other, and UI code awaits notifier actions to branch on results. It also prevents translation drift, where non-English ARB locale files silently fall back to English because flutter gen-l10n does not fail on missing keys. ## Core Features & Use Cases - Four architecture rules: UI never calls services directly (only notifiers do), providers never imperatively invalidate siblings (dependents listen and invalidateSelf), UI never awaits notifier action returns (reacts to AsyncValue state via listeners), and side effects like navigation and snackbars are isolated in a dedicated listener widget. - No-translation-drift rule: every key added, renamed, or removed in the app_en.arb template must be mirrored in the same change across all other locales with matching placeholders, verified with a key-set comparison script. - Testing guidance: notifiers are the unit under test with fakes injected via ProviderScope/ProviderContainer overrides, asserting on AsyncValue state rather than caught exceptions. - Use Case: When adding a favorite-toggle feature to a music catalog screen, place the mutation in the catalog notifier, have the list provider listen and refresh itself, and wire error snackbars in a dedicated listener widget instead of awaiting the call in the widget. ## Quick Start Review my new Flutter screen and Riverpod providers against the architecture rules and check that my ARB locale files have no missing translation keys.

Frequently Asked Questions about flutter-riverpod-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Flutter app with Riverpod 2 and Freezed?▼

Place mutations in notifiers under state/, keep services in services/, and let widgets only read notifiers and call their methods. Model action state as AsyncValue so loading, data, and error states are explicit, and wire side effects through ref.listen in a dedicated listener widget.

How should Riverpod providers react to changes in other providers?▼

A dependent provider should use ref.listen on the source provider and call ref.invalidateSelf to refresh itself. A provider must never imperatively call ref.invalidate or ref.refresh on a sibling provider, since that couples them imperatively.

Should I await a Riverpod notifier method in the UI?▼

No, fire the action without awaiting and react to the resulting AsyncValue state transition via ref.listen. Awaiting and branching on the return value in the UI bypasses the reactive state model and scatters navigation and error handling across build code.

Why do Flutter ARB translations silently fall back to English?▼

flutter gen-l10n does not fail when a key is missing from a non-template locale, so missing keys silently render in English. Prevent drift by mirroring every key added or renamed in app_en.arb across all app_*.arb locales with the same placeholders in the same change.

How do I test Riverpod notifiers in Flutter?▼

Test notifiers as the unit under test with fakes injected via ProviderScope or ProviderContainer overrides, never constructor injection. Assert on the resulting state, where a failed action surfaces as an AsyncError rather than a thrown exception.