provider-architecture

Standardize Riverpod provider architecture for dependency injection and testability.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/tarrragon/ccsession --skill provider-architecture-tarrragon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: provider-architecture
Source: https://github.com/tarrragon/ccsession/tree/main/.claude/skills/provider-architecture
Command: npx skills add https://github.com/tarrragon/ccsession --skill provider-architecture-tarrragon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Riverpod architecture guidelines solve the challenge of ensuring correct dependency injection, interface isolation, and testability across Flutter apps.

Core Features & Use Cases

  • Interface Isolation Principle: separate external widget-facing interfaces from internal logic and state management for clearer contracts.
  • Semantic Operations: encourage meaningful method names instead of direct state mutations to improve readability and testability.
  • Dependency Injection via Providers: promote injecting services through providers to enable easy testing and replacement, avoiding hard-coded implementations.

Quick Start

Query the Provider Architecture guide by entering '/provider-architecture'.

Frequently Asked Questions about provider-architecture

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

FAQPage Schema
How do I structure Riverpod providers for dependency injection in Flutter?

Structure Riverpod providers by injecting services through provider overrides, separating external widget-facing interfaces from internal logic to ensure correct dependency injection and clear contracts.

What is the best way to separate widget interfaces from internal logic using Riverpod?

Separate widget interfaces from internal logic using Riverpod by enforcing the Interface Isolation Principle, which isolates external widget-facing contracts from internal state management and Notifier-based viewmodels.

How do I make Riverpod Notifier state management testable in Flutter?

Make Riverpod Notifier state management testable by designing semantic methods instead of direct state mutations, enabling easy testing and replacement through provider overrides and mocks.

When do I need provider overrides for testing Flutter Riverpod architectures?

You need provider overrides for testing Flutter Riverpod architectures when replacing hard-coded service implementations with mocks to validate safe state management and dependency provisioning.

Why should I use semantic operations instead of direct state mutations in Riverpod?

Use semantic operations instead of direct state mutations in Riverpod to improve code readability and testability, ensuring meaningful method names define clear interactions with Notifier-based viewmodels.

Can I avoid hard-coded service implementations when building Riverpod viewmodels?

Avoid hard-coded service implementations in Riverpod viewmodels by promoting dependency injection via providers, which enables easy testing and replacement of internal logic without altering widget-facing interfaces.