An AI agent coding skill (compatible with Gemini, Codex, Claude, OpenCode, and other developer agents) for designing, implementing, refactoring, and reviewing Flutter applications built with feature-based vertical slices, handwritten Riverpod 3 providers, and componentized UI.
The skill favors architecture that is easy to navigate and maintain without relying on code generation.
The diagram below shows how app composition, shared infrastructure, feature slices, and Riverpod state flow fit together—and why the boundaries give coding agents predictable, low-context work units.
The orders/ example shows the exact feature-local nesting from data to UI, plus the event, state, repository, and shared-client boundaries. It also highlights the handwritten Riverpod, mutation, and pagination patterns the skill can implement.
- Feature-first organization under
lib/features/ - Shared cross-feature code under
lib/core/ - Handwritten Riverpod 3
Provider,Notifier, andAsyncNotifierpatterns - Handwritten immutable models, serialization,
copyWith, and value equality - Thin
ConsumerWidgetpages composed from namedStatelessWidgetcomponents - Repository and provider dependency boundaries
- Async loading, error, mutation, refresh, and pagination behavior
- Architecture consistency reviews
The skill applies these defaults to new code while preserving coherent local project conventions:
- Target Riverpod 3.x.
- Keep providers handwritten and apply
.autoDisposeon provider declarations. - Avoid legacy
StateProvider,StateNotifierProvider, andChangeNotifierProviderin new code. - Do not introduce
riverpod_annotation,freezed,json_serializable,build_runner, generatedpartdeclarations,.g.dart, or.freezed.dartfiles. - Keep each feature independent from sibling features.
- Move code to
core/only when it is genuinely app-wide or shared by multiple features. - Keep business logic and async orchestration outside widgets.
- Replace private widget-returning helpers such as
_buildHeader()with named widget classes. - Preserve loaded data during mutations through optimistic updates or explicit mutation state.
Copy the skill directory into your agent's customization root (either global or workspace-scoped).
Copy the skill directory to your global agent configurations root. Depending on your agent, the target path may vary:
- Gemini / Antigravity:
mkdir -p ~/.gemini/config/skills cp -R flutter-feature-based-architecture ~/.gemini/config/skills/
- Codex:
mkdir -p ~/.codex/skills cp -R flutter-feature-based-architecture ~/.codex/skills/
- Claude / OpenCode / Others:
mkdir -p ~/.agents/skills cp -R flutter-feature-based-architecture ~/.agents/skills/
Copy the skill directory to your workspace's local .agents directory to make it active for that repository:
mkdir -p .agents/skills
cp -R flutter-feature-based-architecture .agents/skills/The installed path should contain the skill files directly (e.g. .agents/skills/flutter-feature-based-architecture/SKILL.md).
This skill is automatically discovered and loaded by agent platforms supporting customizations (such as Gemini, Codex, Claude, OpenCode, etc.). Once installed:
- The agent will automatically trigger the skill when answering questions or performing tasks involving feature-based Flutter organization, Riverpod architecture, handwritten providers, shared
core/code, or removal of private UI build helpers. - You can also explicitly instruct the agent to use it in your prompt, for example:
"Use the
flutter-feature-based-architectureskill to review this Flutter project..."
lib/
├── app/
├── core/
│ ├── components/
│ ├── providers/
│ ├── repositories/
│ ├── routes/
│ └── theme/
├── features/
│ └── orders/
│ ├── data/
│ │ ├── models/
│ │ └── repositories/
│ ├── providers/
│ └── views/
│ └── components/
└── main.dart
This is a default for new work, not a requirement to rename an existing project that already follows a coherent equivalent structure.
flutter-feature-based-architecture/
├── SKILL.md
└── references/
├── handwritten-feature-example.md
└── pagination-async-notifier-example.md
The documentation visuals are available at docs/images/feature-first-architecture-agent-hierarchy.png and docs/images/sample-feature-capabilities.png.
SKILL.mdcontains the architecture rules, workflow, naming conventions, and review checklist.handwritten-feature-example.mdprovides a complete model, repository, provider, page, and component example.pagination-async-notifier-example.mdprovides handwritten Riverpod 3 pagination with initial loading, load-more state, refresh, and stale-request protection.
The examples target flutter_riverpod 3.0.0 or later within the 3.x release line. They use the public handwritten provider APIs and do not require annotations or generated source files.
Existing projects may still contain legacy providers or generated code. The skill preserves compatible existing architecture when necessary but does not expand that surface in unrelated new work.
The skill package passes the skill-creator structural validator. Its Riverpod examples were also assembled in a temporary Flutter package pinned to flutter_riverpod 3.0.0 and checked with:
fvm dart analyzeThe analyzer completed with no issues.
When changing the examples, validate them against Riverpod 3.0 before publishing so the minimum supported API remains accurate.

