plugins/languages/flutter/skills/core/SKILL.md
Flutter/Dart 核心开发规范 — Dart 3.6+ 特性 (Records/Patterns/Sealed/Class modifiers/Extension types)、Flutter 3.27+ 工具链、命名约定、Clean Architecture 项目结构、dart analyze/format/fix。Use when 创建 Flutter 项目、编写 Dart 代码、审查/重构 Dart 代码、配置 pubspec.yaml/analysis_options.yaml、讨论项目分层。Also triggers on "Dart 代码风格"、"Flutter 项目结构"、"analysis_options"、"pubspec 配置"、"Clean Architecture flutter"。
npx skillsauth add lazygophers/ccplugin flutter-coreInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Flutter 开发追求 Dart 3 类型安全 + 平台自适应 UI + 可测试 Clean Architecture。
@riverpod 代码生成、AsyncNotifierpresentation / domain / datago_router 14+Theme/ColorScheme 取)AnimationController / StreamSubscription / Timer)Navigator.push 命令式路由 (用 go_router).dart 文件 > 600 行 (推荐 200~400)very_good_analysis 或 flutter_lints// 1. Records
(String, int) getInfo() => ('Alice', 30);
final (name, age) = getInfo();
// 2. Patterns + switch expression
String describe(Object o) => switch (o) {
int n when n > 0 => 'positive',
int() => 'non-positive',
String s => 'string: $s',
_ => 'unknown',
};
// 3. Sealed classes
sealed class Result<T> { const Result(); }
final class Success<T> extends Result<T> {
const Success(this.data);
final T data;
}
final class Failure<T> extends Result<T> {
const Failure(this.error);
final Object error;
}
// 4. Class modifiers
final class AppConfig {} // 不可继承
interface class Serializable {} // 仅可 implement
base class BaseRepo {} // 仅可 extend
// 5. Extension types (零成本抽象)
extension type UserId(String value) implements String {}
class UserProfileCard {} // 类型 PascalCase
final userName = 'John'; // 变量/函数 camelCase
const defaultPadding = 16.0; // 常量 camelCase (Dart 风格)
class _InternalWidget {} // 私有 _ 前缀
// 文件: snake_case.dart
final userProvider = ...; // Provider: 驼峰 + Provider 后缀
lib/
core/ # 基础设施
theme/ router/ constants/ extensions/ utils/
features/ # 按功能划分
auth/
data/ # Repository 实现 / DataSource / DTO
domain/ # Entity / UseCase / Repository 接口
presentation/ # Widget / Controller (ViewModel)
home/
shared/ # 共享 widget/model
test/ # 镜像 lib/features
integration_test/ # 端到端
flutter create --org com.example --platforms android,ios,web my_app
flutter pub add flutter_riverpod riverpod_annotation go_router
flutter pub add dev:riverpod_generator dev:build_runner dev:riverpod_lint dev:custom_lint dev:very_good_analysis
dart run build_runner build --delete-conflicting-outputs
dart analyze && dart format . && dart fix --apply
| AI 借口 | 实际检查 | 严重度 | | --- | --- | --- | | "if-else 就够了" | 是否用 sealed + switch expression? | 中 | | "Provider 够用" | Provider 已停维,迁 Riverpod | 高 | | "GetX 开发快" | GetX 技术债,迁 Riverpod/Bloc | 高 | | "直接写颜色值" | 是否从 Theme/ColorScheme 取? | 高 | | "Navigator.push 更直接" | 是否用 go_router? | 中 | | "不需要 class modifier" | 是否用 final/sealed/base? | 中 |
useMaterial3: true) 或 Cupertino 一致使用@riverpod 代码生成go_router 14+ 声明式路由const Widget 最大化dart analyze 零警告 / very_good_analysis 通过Skills(flutter:state) — Riverpod 3 / Bloc 8Skills(flutter:ui) — Material 3 / Cupertino / ImpellerSkills(flutter:android) / Skills(flutter:ios) / Skills(flutter:web)tools
--- name: trellisx-workspace description: 维护 `.trellis/task.md` 任务看板 —— trellis 缺的跨任务总览。**一个表格, 一行一个任务**, 列为 id/名称/描述/状态/阶段/进度/worktree (状态/阶段中文显示)。在 task create/start/阶段切换/archive 后**及时更新**对应行; 并**自动清理超 7 天的已完成行**防膨胀。保持看板与 task.json 实时一致。 when_to_use: 维护 / 创建 / 更新 `.trellis/task.md` 任务看板时; task 生命周期任一节点 (create/start/阶段推进/archive) 之后同步看板时; 用户问"当前有哪些任务 / 任务进度 / 任务看板"时。被 trellisx-flow 与 trellisx-apply 注入的流程引用。 user-invocable: true argument-hint: [show|update|sync|cleanup ...] [task id] arguments:
testing
强制以 Trellis task 闭环处理用户指定的请求 (自判新建/并入 → plan→exec→check→finish 全程不跳步)。**仅用户显式主动调用** (/trellisx-flow 或明确要求"强制走 task 处理这个"); **禁止自动 / 被动 / 推断式调用** —— 不要因为某个请求"看起来该建 task"就自动触发本 skill, 那是 apply 注入的 no_task 倾向的职责。
testing
把 强推task + subtask拆分 + worktree隔离 + 闭环收尾 四维度增量注入当前项目 .trellis/ (workflow.md 的 no_task/planning/in_progress 块 + spec 背书文档 + trellis 生命周期 hook worktree 自动化)。强推 task 与闭环为纯 prompt 软约束 (非平台 hook 硬拦截)。**纯增量追加, 绝不替换 trellis 原生文本** (no_task 分类+征同意/check/finish/前缀全保留)。幂等 (marker 包裹)。
development
Claude Code 会话历史整理 — 扫 ~/.claude/projects/**/*.jsonl 全部 session transcripts, 提取学习增量 (用户校正/决策/踩坑/L0 规则) → 全局记忆库 ~/.cortex/.wiki/memory/. 默认 --apply 落盘 (--dry-run opt-in 仅出 JSON plan 预览). 与 cortex-extract (L4-inbox 内部) 互补.