
Effective Dart
Use when writing Dart code, reviewing for style, refactoring naming, adding doc...
Install
npx skills add evanca/flutter-ai-rules --skill effective-dart -g -a claude-code -y- Repository
- evanca/flutter-ai-rules668
- Category
- Writing
- Updated
- 5d ago
- License
- MIT
- Context cost
- Mediumabout 1,970 tokens
- Runs scripts
- No, instructions only
What it does
Use when writing Dart code, reviewing for style, refactoring naming, adding doc comments, structuring imports, or enforcing type annotations.
Effective Dart Skill
This skill defines how to write idiomatic, high-quality Dart and Flutter code following Effective Dart guidelines.
1. Naming Conventions
| Kind | Convention | Example |
|---|---|---|
| Classes, enums, typedefs, type parameters, extensions | UpperCamelCase | MyWidget, UserState |
| Packages, directories, source files | lowercase_with_underscores | user_profile.dart |
| Import prefixes | lowercase_with_underscores | import '...' as my_prefix; |
| Variables, parameters, named parameters, functions | lowerCamelCase | userName, fetchData() |
- Capitalize acronyms and abbreviations longer than two letters like words:
HttpRequest, notHTTPRequest. - Avoid abbreviations unless the abbreviation is more common than the full term.
- Prefer putting the most descriptive noun last in names.
- Use terms consistently throughout your code.
- Follow mnemonic conventions for type parameters:
E(element),K/V(key/value),T/S/U(generic types). - Consider making code read like a sentence when designing APIs.
- Prefer a noun phrase for non-boolean properties or variables.
- Prefer a non-imperative verb phrase for boolean properties or variables; prefer the positive form.
- Consider omitting the verb for named boolean parameters.
- Avoid starting a function or method name with
get; prefer removinggetand using a getter when the API conceptually exposes a property.
