一键导入
dart-code-quality
Core code quality rules for Dart/Flutter. Use when formatting, handling async/null safety, organizing classes, or following Dart best practices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Core code quality rules for Dart/Flutter. Use when formatting, handling async/null safety, organizing classes, or following Dart best practices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
MCP server usage for Dart MCP, Firecrawl, Hugging Face. Tool priorities, commands, workflows.
Development process rules. Use when planning complex tasks, implementing incrementally, managing packages, or following communication guidelines.
Dart 3 patterns including switch/if-case, pattern matching, sealed classes, and records. Use when writing exhaustive switches, destructuring, pattern matching on types, or returning multiple values with records.
Code review checklist for PRs/MRs. Use when reviewing pull requests, examining code changes, or when the user asks for a code review.
Data handling patterns for Dart/Flutter. Use when implementing serialization, caching, layer separation, DTOs, repositories, offline-first, or data validation.
Dependency injection patterns for Dart/Flutter applications. Use when configuring get_it, registering dependencies, using constructor injection, setting up composition root, and testing with mocks.
| name | dart-code-quality |
| description | Core code quality rules for Dart/Flutter. Use when formatting, handling async/null safety, organizing classes, or following Dart best practices. |
print/debugPrint in production; preserve existing log() callsdart:developer log() for structured loggingTODO in English; no trailing commentsasync/await, never .then()Future<T> method() => other();await in return: return future; not return await future;unawaited() for fire-and-forget; never silently discard futuresFuture<void> for async methods without return value! — extract nullable to local variable, then use it?., ??, ??= over explicit null checksbool?: use == true to distinguish from null$var over +; alt quotes to avoid escapesif (state is! Loaded) return; to reduce nesting== true/== false on booleans (exception: bool?).isEven not % 2 == 0return value = compute(); — join return with assignmenttypedef F<T> = R Function(T); for complex signaturesfinal for immutable values; final in for-in loopsfinal for function parameters (avoid_final_parameters: true)final val = cond ? y : x;Type? v; not Type? v = null;dynamic — explicit type annotations; always declare return typessealed, base, final, interface, abstract, mixin.runtimeType.toString()void not Null; avoid type names as parameter names[], {} not constructors.isEmpty/.isNotEmpty over .length == 0.whereType<T>() for type filtering; .contains() over .indexOf() != -1StringBuffer for loops.. when appropriate; enum.values.byName() for string-to-enumthis (except builder)this.field over body assignments; super.field for super paramslate for non-null vars initialized after constructionAppConstantssrcon SpecificException catch (e) — never generic catchError; use rethrow not throw efinally/// doc comments; first sentence = concise summary; blank line afterdart format, dart fix, build_runner build --delete-conflicting-outputsgroup() per class; "should ..." namingpackage:checks for assertions; fakes/stubs over mocks