flutter-design-architecture
Skill4 starsChanged 3 months agoMITView on GitHub
Use when scaffolding a new Flutter feature, setting up the data/domain/view folder structure, creating datasources, DTOs, repositories, or state management classes, or when the user asks how to organize a Flutter project.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-annotationsSkill
- android-accessibility-validatorSkill
- android-compose-architecture-reviewSkill
- android-kotlin-api-design-reviewerSkill
- android-performance-profilerSkill
- flutter-accessibility-validatorSkill
- flutter-bug-investigationSkill
- flutter-code-reviewSkill
- flutter-feature-analysisSkill
- flutter-feature-implementationSkill
- flutter-performance-optimizerSkill
- ios-accessibility-validatorSkill
- ios-performance-profilerSkill
- ios-swift-api-design-reviewerSkill
- ios-swiftui-architecture-reviewSkill
- shared-bug-investigationSkill
- shared-perf-comparison-videoSkill
- shared-product-motion-videoSkill
- shared-task-workflowSkill
The file
Files
Design Architecture Skill
Feature Structure (Mandatory)
lib/<features|feature>/<feature>/
data/datasources/<feature>_remote_datasource.dart # @RestApi
dtos/<feature>_dto.dart # @JsonSerializable
repositories/<feature>_repository_impl.dart # @Injectable
domain/models/<feature>.dart # Equatable
repositories/<feature>_repository.dart # Abstract
view/<state_mgmt>/ # bloc/, provider/, getx/, riverpod/
widgets/<feature>_card.dart
<feature>_page.dartCore Structure
lib/core/
utils/extensions/, helpers/, validators/
widgets/buttons/, cards/, dialogs/
constants/app_constants.dart
enums/app_enums.dart
test/<feature>/data/, domain/, view/
fixtures/<feature>_fixtures.dartQuick Templates
// Datasource (@RestApi)
abstract class <Feature>RemoteDatasource {
factory <Feature>RemoteDatasource(Dio dio) = _<Feature>RemoteDatasource;
@GET('/api/<endpoint>') Future<<Feature>Dto> fetch();
}
// DTO (@JsonSerializable)
class <Feature>Dto {
final String id;
factory <Feature>Dto.fromJson(Map<String, dynamic> json) => _$<Feature>DtoFromJson(json);
}
// Model (Equatable)
class <Feature> extends Equatable {
final String id;
const <Feature>({required this.id});
@override List<Object?> get props => [id];
}
// Repository
abstract class <Feature>Repository { Future<<Feature>> fetch(); }
@Injectable(as: <Feature>Repository)
class <Feature>RepositoryImpl implements <Feature>Repository {
final <Feature>RemoteDatasource _remote;
@override Future<<Feature>> fetch() async => (await _remote.fetch()).toModel();
}
// State Management (Bloc|ChangeNotifier|GetxController|StateNotifier)
class <Feature>StateManager {
final <Feature>Repository _repository;
// Implement based on chosen state management
}Error Handling
abstract class AppException implements Exception { final String message; }
// In repository
try { return await _remote.fetch(); }
on DioException catch (e) {
if (e.response?.statusCode == 404) throw NotFoundException();
throw NetworkException();
}After Scaffolding
flutter pub run build_runner build # Generate *.g.dart
flutter analyze # Must pass (0 errors)
flutter test # Create & run testsDoes 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.

