Skills · Claude Code · Agent Skills

在生产环境不出问题的 Dart/Flutter,没有商量余地。

面向移动客户端的语言与框架规范:分析器拦截合并,禁止使用感叹号,应用层底线(IAM、离线、应用商店)仍归 schematize-mobile。

v0.4.0Linguagem · Dart/Fluttergithub.com/schematizeme/skill-dart

维护者 Lucas Andrade

schematize-dart · v0.4.0bash
$ schematize install dart
GitHub →下载技能 (.zip)/dart-help · github.com/schematizeme/schematize-cli

不可协商的底线

绝不为了“更快”而关闭。完整清单见技能本体。

生产环境禁止使用感叹号 (!)

它会关掉迁移到空安全时换来的检查;late 和 dynamic 同样不是修复手段。

每个 Future 都要等待

或者显式使用 unawaited(...);遗漏会产生没人写过的执行顺序和未处理的全局错误。

生命周期受控

Stream、Timer 和 AnimationController 在 dispose() 中取消;await 之后使用 BuildContext 必须检查 mounted。

重计算移出 UI 线程

使用 compute 或 Isolate;忽略它的症状是卡顿而不是报错,所以容易被忽视。

错误必须带堆栈

始终使用 on X catch (e, s);空的 catch (e) {} 和用 print 当处理都被禁止。

密钥不进包

连 --dart-define 也不行;shared_preferences 不是保险库,凭据应放在 flutter_secure_storage、Keychain 或 Keystore。

可复现构建与显式 lint

应用中提交 pubspec.lock,CI 中固定 SDK,并在 analysis_options.yaml 中显式开启底线要求的 lint;flutter analyze 拦截合并。

命令

安装在 .claude/commands/。随时可运行 /dart-help。

/dart-cc上下文压缩:将交接写入 archive 并运行 /compact。
/dart-claude在仓库根目录创建或合并常驻的 CLAUDE.md,不覆盖其他技能的区块。
/dart-handoff在 archive 中生成交接文件(context.md + checklist.md),不压缩。
/dart-help列出所有命令。
/dart-load强制加载全部规范内容,并在本次会话中执行。
/dart-review对 .dart 文件和项目按底线评审:先运行 check-dart.sh 门禁,再审阅机器读不出的部分(异步、生命周期、与 mobile 的边界)。

面向 AI 代理

无需人工干预即可安装。元数据见 llms.txt。

  • 运行:git clone https://github.com/schematizeme/skill-dart.git && ./skill-dart/install.sh
  • 或下载 https://github.com/schematizeme/skill-dart/releases/latest/download/skill-dart.zip 并解压到 .claude/skills/
  • 将 assets/CLAUDE.md 复制到仓库根目录(常驻规则)。
  • 用 /dart-help 确认。

不想安装?

阅读完整规范并直接复制到你的项目——或安装该技能,让智能体自动执行。