flutter-clean-architecture-audit
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-05-26
- Stars
- ★ 0
- Forks
- 0
03 SKILL.md 正文
flutter-clean-architecture-audit
Purpose
Audit a Flutter feature or app for Clean Architecture compliance, dependency direction, and boundary clarity.
Use when
- A feature mixes widget code with repository or API logic
- A module has unclear ownership between presentation, state, domain, and data
- You need an architecture review before or after a refactor
Do NOT use when
- You only need a quick UI copy edit
- The request is purely about visual polish with no boundary change
- The codebase intentionally uses a simple single-layer pattern
Inputs required
- Feature name or app area
- Current folder tree or diff
- State management choice
- External dependencies involved
Constraints
- Do not recommend moving logic into widgets
- Do not flatten layers just to reduce file count
- Do not introduce new dependencies without stating why
- Keep Firebase, routing, and storage behind adapters when possible
Step-by-step workflow
- Inspect the current folder tree for layer separation.
- Identify imports that cross boundaries in the wrong direction.
- Map presentation, state, domain, and data responsibilities.
- List architecture violations with file paths and severity.
- Propose the smallest refactor that restores the boundary.
- Confirm tests, routing, and docs that need updates.
Output contract
- An audit summary
- A ranked list of violations
- A remediation plan with exact file paths
- A verification checklist
Validation checklist
- Presentation does not call SDKs directly
- Domain does not depend on presentation
- Data adapters own SDK interaction
- The proposed fix is smaller than a rewrite
Related skills
flutter-feature-folder-scaffoldflutter-feature-contract-scaffoldflutter-riverpod-state-skeletonflutter-firestore-repositoryflutter-go-router-route-map
References
../../../templates/feature-module-template.md../../../examples/full-feature-implementation.md../../../policies/architecture/README.md
Real example
Example finding: lib/features/profile/presentation/pages/profile_page.dart imports firebase_auth directly. The fix is to move auth calls into lib/features/profile/data/datasources/profile_remote_data_source.dart and expose them through a repository contract.
Real file output sample
docs/audits/profile-architecture-audit.md
lib/features/profile/domain/repositories/profile_repository.dart
lib/features/profile/data/repositories/profile_repository_impl.dart
04 同仓库更多 Skills
toolkit-i18n-operator
Use the toolkit-i18n CLI for repeated Flutter localization workflows with compact outputs, CSV validation, key coverage reporting, generated JSON exports, and safe non-mutating behavior.
toolkit-design-operator
Use the toolkit-design CLI for repeated repository workflows.
toolkit-ci-operator
Use the toolkit-ci CLI for repeated repository workflows.
toolkit-arch-operator
Use the toolkit-arch CLI for repeated repository workflows, including Flutter i18n usage scans, layer checks, and localization coverage.
web-testing
暂无简介
web-state
暂无简介