fluttermtl/scaffolding-skills/app-architecture-scaffold

Claude Code and agent skill by fluttermtl/scaffolding-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Lay down a feature-first, layered Flutter folder structure (presentation/domain/data) with get_it+injectable DI, auto_route wiring, abstract-interface repositories/datasources, domain error enums, and fpdart TaskEither at the usecase layer. Use this whenever setting up the architecture/folder structure of a Flutter app, organizing lib/ into layers or features, applying Clean Architecture, or right after `flutter create` and before adding Firebase services — so every feature and service lands in…

Install

npx vskill@latest install fluttermtl/scaffolding-skills/app-architecture-scaffold

SKILL.md

The same SKILL.md was published earlier as fluttermtl/scaffolding-skills/app-architecture-scaffold.

App Architecture Scaffold

Directory skeleton + conventions rest of series writes into. Feature-first outside, layered inside.

When to use

  • Right after flutter create.
  • Refactoring flat lib/ into layers.

Target structure

lib/
main.dart
app.dart # MaterialApp.router + theme
core/
di/ # dependency injection setup
error/ # domain error enums
router/ # auto_route config (app_router.dart, generated)
config/ # env / flavor config (flavors-env-setup fills this)
features/
<feature>/
data/ # datasources, dtos, repository impls
domain/ # entities, error enums, repo interfaces, usecases
presentation/ # widgets, pages (@RoutePage), blocs
shared/
widgets/ # reusable UI
extensions/

Steps

  1. Make tree:

``bash mkdir -p lib/core/{di,error,router,config} lib/shared/{widgets,extensions} mkdir -p lib/features/auth/{data,domain,presentation} ``

  1. Core primitives (see examples/):
  • features/<f>/domain/*_error.dart — domain error enum (e.g. enum AuthError { wrongPassword, network, unknown }).
  • core/di/injector.dart — DI (get_it + injectable).
  1. Wire app.dart → core/router/app_router.dart (auto_route). Presentation state = bloc/flutter_bloc.
  2. Contracts = abstract interface class. Repo interface in domain, impl in data; datasource interface + impl in data.

Rules

  • One feature = one features/ folder.
  • Domain errors = enums. No message strings in domain — enum cases only.
  • Repos + datasources: no fpdart. Plain Future<T>; throw on failure.
  • TaskEither<ErrorEnum, T> only at usecase layer — usecase wraps repo call, maps throws → Left(ErrorEnum.case).
  • Presentation translates the error enum → user text via localization (AppLocalizations). No hardcoded error strings in UI. e.g. switch (err) { AuthError.wrongPassword => l10n.errWrongPassword, ... }.
  • Interfaces: abstract interface class (repos, datasources).

Examples

Full auth vertical slice in examples/feature_auth/ — copy the shape per feature:

  • domain/auth_error.dart — domain error enum (no strings).
  • domain/app_user.dart — framework-free entity.
  • domain/auth_repository.dart — abstract interface class, plain Future, throws.
  • domain/sign_in_usecase.dart — the only fpdart layer; TaskEither<AuthError, AppUser>.
  • data/firebase_auth_repository.dart — impl; Firebase types stay here, maps SDK → enum.
  • presentation/auth_error_l10n.dart — enum → localized text (only place error strings live).

Related

  • Prereq: flutter create done
  • Next: flavors-env-setup, firebase-emulators-setup
  • Overlaps: flutter-apply-architecture-best-practices, reactive-repository-generator
  • Localization (error translation): flutter-setup-localization

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/fluttermtl/scaffolding-skills/app-architecture-scaffold/badge)](https://verified-skill.com/skills/fluttermtl/scaffolding-skills/app-architecture-scaffold)

Something wrong with this skill or its page? Tell us.