clean-code
Installation
SKILL.md
Dart Coding Guidelines
- Write concise, technical Dart code with accurate examples
- Use functional and declarative programming patterns
- Choose descriptive variable names with auxiliary verbs (e.g.,
isLoading,hasError) - Keep functions and classes short (< 200 lines, < 10 public methods)
- Always use English for code and documentation
- Use PascalCase for classes, camelCase for variables and functions, snake_case for files, UPPERCASE for constants
- Use arrow syntax for simple methods and expression bodies for one-line getters/setters
- Avoid nesting blocks; prefer early checks and returns
- Pass and return parameters using RO-RO (Receive Object, Return Object)
- Avoid magic numbers; use well-named constants
- Follow an 100-character line limit and use trailing commas for better formatting
- Follow the lint rules set for this project (
all_lint_rules.yamlandanalysis_options.yaml) - Strong Typing: Strictly prohibit
dynamic. UseObject?or explicit types. - Cascade Pattern: Use cascade notation (
..) for cleaner initialization of complex objects where appropriate. - Null Safety: Avoid
!null assertion operator unless value is guaranteed non-null by control flow. Prefer pattern matching. - Switch Expressions: Prefer exhaustive
switchexpressions (nobreakneeded in Dart 3).