Source profileQuality 94/100

evanca/flutter-ai-rules/skills/flutter-app-architecture/SKILL.md

flutter-app-architecture

Use when scaffolding a project, refactoring into layers, creating view models/repositories, configuring dependency injection, or implementing unidirectional data flow (MVVM).

Source repository stars
620
Declared platforms
0
Static risk flags
1
Last source update
2026-08-27
Source checked
2026-08-28

Decision brief

What it does: where it fits

This skill defines how to structure Flutter applications using layered architecture, proper data flow, and MVVM patterns for maintainability and testability.

Best for

  • Scaffolding a new Flutter project with layered architecture.
  • Creating or refactoring View Models, Repositories, or Services.
  • Wiring dependency injection between architectural components.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/evanca/flutter-ai-rules --skill "skills/flutter-app-architecture"
Safe inspection promptEditorial

Inspect the Agent Skill "flutter-app-architecture" from https://github.com/evanca/flutter-ai-rules/blob/713576e02b6a17de4cc5a95ad55bdcca3a0827a6/skills/flutter-app-architecture/SKILL.md at commit 713576e02b6a17de4cc5a95ad55bdcca3a0827a6. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    5. Workflow: Scaffold a New Feature

    1. Create the Service — implement the API wrapper with typed response parsing. 2. Create the Repository — inject the Service, implement caching and error-handling logic. 3. Create the ViewModel — inject the Repository, expose UI state and commands. 4. Create the View — bind to t…

    Create the Service — implement the API wrapper with typed response parsing.Create the Repository — inject the Service, implement caching and error-handling logic.Create the ViewModel — inject the Repository, expose UI state and commands.
  2. 02

    When to Use

    Scaffolding a new Flutter project with layered architecture. Creating or refactoring View Models, Repositories, or Services. Wiring dependency injection between architectural components. Implementing unidirectional data flow across layers. Adding a Domain (Logic) Layer for compl…

    Scaffolding a new Flutter project with layered architecture.Creating or refactoring View Models, Repositories, or Services.Wiring dependency injection between architectural components.
  3. 03

    1. Layer Structure

    Separate every app into a UI Layer and a Data Layer. Add a Logic (Domain) Layer only for complex apps.

    Only adjacent layers may communicate. The UI layer must never access a Service directly.Data changes always happen in the Data layer (SSOT = Repository). No mutation in UI or Logic layers.Follow unidirectional data flow: state flows down (Data → UI), events flow up (UI → Data).
  4. 04

    2. Component Responsibilities

    Describes how to present data; keep logic minimal and UI-related only.

    Describes how to present data; keep logic minimal and UI-related only.Passes events to the ViewModel in response to user interactions.Converts app data into UI state and maintains the current state needed by the View.
  5. 05

    View

    Describes how to present data; keep logic minimal and UI-related only.

    Describes how to present data; keep logic minimal and UI-related only.Passes events to the ViewModel in response to user interactions.- Describes how to present data; keep logic minimal and UI-related only. - Passes events to the ViewModel in response to user interactions.

Permission review

Static risk signals and limitations

Writes files

medium · line 183

The documentation asks the agent to create, modify, or delete local files.

**Create the Repository** — inject the Service, implement caching and error-handling logic.

Writes files

medium · line 184

The documentation asks the agent to create, modify, or delete local files.

**Create the ViewModel** — inject the Repository, expose UI state and commands.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score94/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars620SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
evanca/flutter-ai-rules
Skill path
skills/flutter-app-architecture/SKILL.md
Commit
713576e02b6a17de4cc5a95ad55bdcca3a0827a6
License
MIT
Collected
2026-08-28
Default branch
main
View the original SKILL.md

Flutter App Architecture Skill

This skill defines how to structure Flutter applications using layered architecture, proper data flow, and MVVM patterns for maintainability and testability.

When to Use

Use this skill when:

  • Scaffolding a new Flutter project with layered architecture.
  • Creating or refactoring View Models, Repositories, or Services.
  • Wiring dependency injection between architectural components.
  • Implementing unidirectional data flow across layers.
  • Adding a Domain (Logic) Layer for complex business logic or shared use cases.

1. Layer Structure

Separate every app into a UI Layer and a Data Layer. Add a Logic (Domain) Layer only for complex apps.

┌──────────────────────────────────────────────────────────────┐
│   UI Layer    │  Views + ViewModels                           │
├──────────────────────────────────────────────────────────────┤
│  Logic Layer  │  Use Cases / Interactors  (optional)         │
├──────────────────────────────────────────────────────────────┤
│   Data Layer  │  Repositories + Services                     │
└──────────────────────────────────────────────────────────────┘

Rules:

  • Only adjacent layers may communicate. The UI layer must never access a Service directly.
  • Data changes always happen in the Data layer (SSOT = Repository). No mutation in UI or Logic layers.
  • Follow unidirectional data flow: state flows down (Data → UI), events flow up (UI → Data).

2. Component Responsibilities

View

  • Describes how to present data; keep logic minimal and UI-related only.
  • Passes events to the ViewModel in response to user interactions.

ViewModel

  • Converts app data into UI state and maintains the current state needed by the View.
  • Exposes callbacks (commands) to the View and retrieves/transforms data from Repositories.
class BookingViewModel extends ChangeNotifier {
  final BookingRepository _repo;

  BookingViewModel(this._repo);

  List<Booking> _bookings = [];
  List<Booking> get bookings => List.unmodifiable(_bookings);

  bool _isLoading = false;
  bool get isLoading => _isLoading;

  Future<void> loadBookings() async {
    _isLoading = true;
    notifyListeners();

    _bookings = await _repo.getBookings();
    _isLoading = false;
    notifyListeners();
  }

  Future<void> cancelBooking(String id) async {
    await _repo.cancelBooking(id);
    _bookings = await _repo.getBookings();
    notifyListeners();
  }
}

Repository (Single Source of Truth)

  • The only class that may mutate its data; all other classes read from it.
  • Handles caching, error handling, and data refresh logic.
  • Transforms raw data from Services into domain models.
class BookingRepository {
  final BookingApiService _apiService;
  final BookingLocalService _localService;

  BookingRepository(this._apiService, this._localService);

  Future<List<Booking>> getBookings() async {
    try {
      final remote = await _apiService.fetchBookings();
      await _localService.cacheBookings(remote);
      return remote;
    } catch (_) {
      return _localService.getCachedBookings();
    }
  }

  Future<void> cancelBooking(String id) async {
    await _apiService.cancelBooking(id);
    await _localService.removeCachedBooking(id);
  }
}

Service

  • Wraps API endpoints and exposes asynchronous response objects.
  • Isolates data-loading and holds no state.
class BookingApiService {
  final http.Client _client;
  BookingApiService(this._client);

  Future<List<Booking>> fetchBookings() async {
    final response = await _client.get(Uri.parse('/api/bookings'));
    if (response.statusCode != 200) {
      throw HttpException('Failed to load bookings');
    }
    final data = jsonDecode(response.body) as List;
    return data.map((json) => Booking.fromJson(json)).toList();
  }
}

3. Dependency Injection

Supply dependencies via constructors. Define abstract interfaces so implementations can be swapped for testing.

// Abstract interface for the repository
abstract class BookingRepository {
  Future<List<Booking>> getBookings();
  Future<void> cancelBooking(String id);
}

// Concrete implementation
class BookingRepositoryImpl implements BookingRepository {
  final BookingApiService _api;
  BookingRepositoryImpl(this._api);

  @override
  Future<List<Booking>> getBookings() => _api.fetchBookings();

  @override
  Future<void> cancelBooking(String id) => _api.cancelBooking(id);
}

4. Use Cases (Domain Layer)

Introduce use cases only when:

  • Logic is complex or does not fit cleanly in the UI or Data layers.
  • Logic is reused across multiple ViewModels or merges data from multiple Repositories.
class GetUpcomingBookingsUseCase {
  final BookingRepository _bookingRepo;
  final UserRepository _userRepo;

  GetUpcomingBookingsUseCase(this._bookingRepo, this._userRepo);

  Future<List<Booking>> call() async {
    final user = await _userRepo.getCurrentUser();
    final bookings = await _bookingRepo.getBookings();
    return bookings
        .where((b) => b.userId == user.id && b.date.isAfter(DateTime.now()))
        .toList();
  }
}

5. Workflow: Scaffold a New Feature

  1. Create the Service — implement the API wrapper with typed response parsing.
  2. Create the Repository — inject the Service, implement caching and error-handling logic.
  3. Create the ViewModel — inject the Repository, expose UI state and commands.
  4. Create the View — bind to the ViewModel, render state, dispatch events.
  5. Wire DI — register all components in the dependency injection container.
  6. Verify — confirm the View never accesses the Service directly and data flows unidirectionally.

6. Data Storage

  • Use key-value storage (e.g., shared_preferences) for configuration and preferences.
  • Use SQL storage (e.g., drift, sqflite) for complex relational data.
  • Implement optimistic updates to improve perceived responsiveness by updating UI before server confirms.
  • Support offline-first by combining local and remote data sources in Repositories.

7. Coding Conventions

  • Use StatelessWidget when possible; avoid unnecessary StatefulWidgets.
  • Keep build methods simple and focused on rendering.
  • Prefer final for fields and top-level variables. Prefer const constructors when the class supports it.
  • Prefer explicit typing on public APIs (e.g., Command0<void> over dynamic signatures).
  • Use descriptive constant names (e.g., _todoTableName over _kTableTodo).

References

Frequently asked questions

What to verify before installation and use

What does the flutter-app-architecture source document cover?

This skill defines how to structure Flutter applications using layered architecture, proper data flow, and MVVM patterns for maintainability and testability.

How do I install flutter-app-architecture?

The source record exposes this install command: npx skills add https://github.com/evanca/flutter-ai-rules --skill "skills/flutter-app-architecture". Inspect the command and pinned source before running it.

Which permission-related actions were detected?

Static rules flagged write-files in the source; the page lists the matching lines and excerpts.

Alternatives

Compare before choosing

Computed 10029,236

garrytan/gbrain

bulk-ingestion

End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.

Computed 10025,136

alirezarezvani/claude-skills

app-store-optimization

App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist

Computed 1005,277

dotnet/skills

migrate-vstest-to-mtp

Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing

Computed 100147

oaustegard/claude-skills

featuring

Generate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tre