flutter-bloc-clean-architecture
Skill1 starsChanged 27 days agoBSD-3-ClauseView on GitHub
Apply BLoC or Cubit with Clean Architecture layers, Very Good Ventures conventions and separate packages per feature layer. Use when scaffolding Flutter features or reviewing PRs that drift from this architecture.
In this repository52 other files it gives its agents.
- academic-research-assistantSkill
- answer-sheetSkill
- app-graphicsSkill
- app-landing-pageSkill
- app-screenshotsSkill
- break-uiSkill
- consumer-app-from-behaviorSkill
- cross-language-safetySkill
- dart-tool-scriptsSkill
- decision-sweepSkill
- engineering-diarySkill
- figma-review-loopSkill
- flutter-app-size-auditSkill
- flutter-async-at-the-edgeSkill
- flutter-async-cubit-safetySkill
- flutter-clean-architecture-tddSkill
- flutter-cubit-smart-cachingSkill
- flutter-error-logging-conventionsSkill
- flutter-observability-instrumentationSkill
- flutter-paywall-and-review-timingSkill
- flutter-precommit-cleanupSkill
- flutter-router-decisionSkill
- flutter-runtime-safetySkill
- flutter-shorebird-otaSkill
- flutter-stream-architectureSkill
- flutter-strict-analysisSkill
- flutter-web-first-paintSkill
- forced-pivot-15-daySkill
- gplay-consoleSkill
- ios-distribution-feature-flagsSkill
- launch-readinessSkill
- launch-watchSkill
- locale-expert-reviewSkill
- market-pulseSkill
- mobile-ui-referenceSkill
- moscow-prioritizationSkill
- orchestrate-agentic-engineeringSkill
- parallel-agent-inboxSkill
- paywall-conversion-flowSkill
- paywall-transparencySkill
- proactive-crash-repair-loopSkill
- promise-auditSkill
- pr-preview-shippingSkill
- ship-first-dollar-appSkill
- slim-ios-simulator-fleetSkill
- spec-sql-harnessSkill
- store-launch-mastermindSkill
- sync-contextSkill
- task-blitzSkill
- techdebtSkill
- vendor-decisionSkill
- web-interface-reviewSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 26
Use Very Good Ventures' Feature-First Clean Architecture (FFCA): each feature is split into <feature>_domain, <feature>_data and …
- Very specific: line 27
Follow the ffca-* skills from VGV's vgv-ffca-plugin for the conventions: ffca-architecture for where code lives, ffca-feature, ffca-routing …
- Very specific: line 60
Use context.read and context.watch only inside that route's subtree.
- Distinctive: line 63
Add a widget test per route that builds the page through the real router and its real providers, so a missing provider fails in CI instead …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter — BLoC + Clean Architecture
Stack
- BLoC/Cubit: primary state management
- Clean Architecture: data → domain → presentation
- Very Good Ventures tooling: CLI, analysis_options, coverage gate
- Riverpod: acceptable alternative
- Provider: legacy
Layout (feature packages)
Use Very Good Ventures' Feature-First Clean Architecture (FFCA): each feature is split into <feature>_domain, <feature>_data and <feature>_presentation packages in one pub workspace, and the app only composes them.
Follow the ffca-* skills from VGV's vgv-ffca-plugin for the conventions: ffca-architecture for where code lives, ffca-feature, ffca-routing and ffca-cross-feature for building, and ffca-audit for checking.
To move a single-package app, follow references/migrate-to-ffca.md.
apps/<name>_app/ # routing, dependency wiring, flavors
features/<feature>/
<feature>_domain/ # models, repository interfaces
<feature>_data/ # data sources, DTOs, repository implementations
<feature>_presentation/ # cubit/bloc + views + screen modules
shared/ # UI kit, database, localizationsRequired conventions
isClosedguard after everyawaitin cubits (see flutter-async-cubit-safety)- Catch blocks log to Sentry (see flutter-error-logging-conventions)
- Time-based smart caching (see flutter-cubit-smart-caching)
- bloc_test + mocktail
- very_good_cli coverage gate
State-mgmt decision tree
- Stream of values, no event fan-out → Cubit
- Multiple discrete user events → Bloc
- Cross-feature shared state → Cubit + another feature's domain repository, wired by the app (get_it only in the app, NOT Provider)
- Many-input derived UI → consider Riverpod (greenfield only)
Provider lookups fail at runtime
BlocProvider, context.read and context.watch come from the provider package, which flutter_bloc depends on.
A lookup with no matching provider above it compiles and then throws ProviderNotFoundException at runtime, when the lookup runs.
- Provide each cubit at the route boundary, in the screen module that the route builder creates, for example in a go_router
builder. - Use
context.readandcontext.watchonly inside that route's subtree. - Dialogs, bottom sheets and pushed pages build in a new route outside that subtree.
Pass them the cubit through the constructor, or wrap their content in
BlocProvider.value. - Add a widget test per route that builds the page through the real router and its real providers, so a missing provider fails in CI instead of in production.
When NOT to use
- Native (non-Flutter) apps
- Prototypes <2 weeks (use setState)
Sources
Distilled from LinkedIn posts by Sebastian Röhl, Ethiel A., Dinko Marinac, Krisztián Kemenes, Very Good Ventures, Stanislav Sydorenko, Vladimír Čimbora, Taha Tesser, Cagatay Ulusoy, and Antonio Cappiello.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

