系统审查 Flutter 与 Dart 代码质量,覆盖架构、性能、可访问性与安全实践
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "flutter-dart-code-review" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/flutter-dart-code-review/SKILL.md 2. 保存为 ~/.claude/skills/flutter-dart-code-review/SKILL.md 3. 装好后重载技能,告诉我可以用了
请按照 Flutter/Dart 代码审查清单,评审下面这个页面组件实现。重点检查 widget 拆分、状态管理方式、build 方法性能、可访问性、命名规范和潜在 bug,并按“问题-原因-修改建议”输出。代码如下:<粘贴代码>
一份结构化审查报告,列出代码问题、风险原因及可执行修改建议
我在 Flutter 项目中使用 Riverpod/BLoC/Provider/GetX/MobX/Signals 之一管理状态。请根据最佳实践审查以下代码,判断是否存在职责混乱、状态泄漏、重复监听、可测试性差等问题,并给出优化后的结构建议。代码如下:<粘贴代码>
针对状态管理实现的优缺点分析,以及更合理的分层与重构建议
请对这段 Flutter/Dart 代码做发布前审查,重点关注异常处理、输入校验、敏感信息暴露、网络请求安全、性能热点、无障碍支持以及是否符合 clean architecture 原则。请按高/中/低优先级整理结果。代码如下:<粘贴代码>
一份按优先级排序的发布前审查清单,帮助团队快速修复关键问题
Comprehensive, library-agnostic checklist for reviewing Flutter/Dart applications. These principles apply regardless of which state management solution, routing library, or DI framework is used.
pubspec.yaml is clean — no unused dependencies, versions pinned appropriatelyanalysis_options.yaml includes a strict lint set with strict analyzer settings enabledprint() statements in production code — use dart:developer log() or a logging package.g.dart, .freezed.dart, .gr.dart) are up-to-date or in .gitignoredynamic — enable strict-casts, strict-inference, strict-raw-types! (bang operator) instead of proper null checks or Dart 3 pattern matching (if (value case var v?))this.field where local variable promotion would workcatch (e) without on clause; always specify exception typesError: Error subtypes indicate bugs and should not be caughtasync: Functions marked async that never await — unnecessary overheadlate overuse: late used where nullable or constructor initialization would be safer; defers errors to runtimeStringBuffer instead of + for iterative string buildingconst contexts: Fields in const constructor classes should not be mutableFuture return values: Use await or explicitly call unawaited() to signal intentvar where final works: Prefer final for locals and const for compile-time constantspackage: imports for consistencyList/Mapif-case over verbose is checks and manual casting(String, int) instead of single-use DTOsprint() in production code: Use dart:developer log() or the project's logging package; print() has no log levels and cannot be filteredbuild() method exceeding ~80-100 lines_build*() helper methods that return widgets are extracted to separate widget classes (enables element reuse, const propagation, and framework optimizations)const constructors used wherever possible — prevents unnecessary rebuildsconst literals for collections that don't change (const [], const {})const when all fields are finalValueKey used in lists/grids to preserve state across reordersGlobalKey used sparingly — only when accessing state across the tree is truly neededUniqueKey avoided in build() — it forces rebuild every frameObjectKey used when identity is based on a data object rather than a single valueTheme.of(context).colorScheme — no hardcoded Colors.red or hex values…
为 Quarkus 项目执行发布前验证闭环,涵盖构建、测试、扫描与差异审查。
用于代码与分支审查,综合检查正确性、兼容性、架构、测试、性能与安全问题。