Agent skill
Dart Best Practices
General purity standards for Dart development.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/best-practices-hoangnguyen0403-agent-skills-standar-3
Metadata
Additional technical details for this skill
- labels
-
dart clean-code
- triggers
-
{ "files": [ "**/*.dart" ], "keywords": [ "import", "final", "const", "var", "global" ] }
SKILL.md
Dart Best Practices
Priority: P1 (OPERATIONAL)
Best practices for writing clean, maintainable Dart code.
- Scoping:
- No global variables.
- Private globals (if required) must start with
_.
- Immutability: Use
const>final>var. - Config: Use
--dart-definefor secrets. Never hardcode API keys. - Naming: Follow effective-dart (PascalCase classes, camelCase members).
- Strings: Prefer single quotes; use double quotes only for interpolation needs.
- Trailing Commas: Always use trailing commas for multi-line literals/params.
- Expression Bodies: Prefer
=>for single-expression functions/getters. - Collections:
- Use
.map,.where,.fold,.anyover manual loops when clarity improves. - Type empty collections (
<String>[],<String, User>{}) to avoiddynamic. - Use collection
if/forand spread operators for composable lists/maps.
- Use
- Async: Always
awaitfutures unless intentionally fire-and-forget.
import 'models/user.dart'; // Good
import 'package:app/models/user.dart'; // Avoid local absolute
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?