No slash command · from dart-foundation
Manages Dart/Flutter project tooling: pubspec.yaml dependencies, pub/lock workflow, monorepos with pub workspaces or melos, analysis_options.yaml, dart format/analyze/fix, and build_runner code generation.
Ships in dart-foundation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
pubspec.yaml has flutter: under dependencies (sdk: flutter) → Flutter project: use flutter pub ..., flutter analyze, flutter test. dart format and dart fix still work.dart pub ..., dart analyze, dart test..fvmrc or .fvm/), prefix commands with fvm (fvm flutter test). Never switch the pinned version.Add with the CLI so the constraint and lockfile stay consistent:
dart pub add http # runtime dependency, caret constraint
dart pub add dev:mocktail # dev_dependencies
dart pub add 'dev:build_runner' # generators are dev-only
flutter pub add flutter_secure_storage
^1.4.0) for normal deps. Never any. Pin exactly only to work around a known regression, with a comment saying which.dependency_overrides is a temporary debugging tool — never ship it in a library; in an app, leave a comment with the upstream issue.git: and path: dependencies only for packages inside the same repo or ones not on pub.dev; a git dep must pin ref:.dart pub deps --style=compact) and prefer packages with the "Dart 3 compatible" and verified-publisher signals on pub.dev. Do not add a dependency for a few lines of code.dart pub outdated before bumping; bump in a separate change from feature work unless the feature needs it.pubspec.lock.pubspec.yaml has workspace: listing packages; each member has resolution: workspace. Run dart pub get from the root — one shared lockfile.melos.yaml (or melos: in the root pubspec for melos 7). Use the repo's scripts: melos bootstrap, melos run analyze, melos run test. Do not run pub get per package by hand if melos manages linking.analysis_options.yaml is the source of truth. Typical shapes:
include: package:flutter_lints/flutter.yaml # or package:lints/recommended.yaml / package:very_good_analysis/analysis_options.yaml
analyzer:
language:
strict-casts: true
strict-raw-types: true
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
linter:
rules:
- unawaited_futures
- prefer_final_locals
analysis_options.yaml (removing rules, adding ignore: to analyzer.errors) to make a change pass. Fix the code. The sdlc config-protection hook blocks edits to this file during a run.// ignore: rule_name only for a genuine false positive, on the single line, with a reason in the same comment. Never // ignore_for_file: in hand-written code.--fatal-infos) before reporting done.dart format . # formats in place; CI usually runs: dart format --output=none --set-exit-if-changed .
dart fix --dry-run # preview automated fixes for lint and deprecations
dart fix --apply # apply them
formatter: page_width: from analysis_options.yaml — do not pass --line-length by hand when the file sets it.Detect: build_runner in dev_dependencies plus annotations like @freezed, @JsonSerializable, @riverpod, @GenerateMocks, or part 'x.g.dart'; directives.
dart run build_runner build --delete-conflicting-outputs
# Flutter projects: same command (or flutter pub run build_runner build ...)
user.dart), regenerate, never edit user.g.dart / user.freezed.dart by hand.git ls-files '*.g.dart' and .gitignore, then follow it.build.yaml configures generators (e.g. json_serializable field_rename: snake). Read it before writing models so field names match the wire format.dart run # bin/<package>.dart
dart run my_package:tool # bin/tool.dart
dart compile exe bin/server.dart -o build/server # AOT binary for deployment
For servers, dart compile exe (or the project's Dockerfile) is the release artefact; dart run is for development only (JIT, slower startup).
Platform.environment; fail fast with a clear message when a required variable is missing.--define=KEY=value (Dart) / --dart-define or --dart-define-from-file (Flutter), read with const String.fromEnvironment('KEY'). These are baked into the binary — never put real secrets there..env files are never committed; commit .env.example.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aratkruglik/claude-sdlc --plugin dart-foundation3 skills in this plugin
/dart-conventionsModern Dart idioms for any Dart project (Dart 3+): sound null safety, records, patterns and switch expressions, sealed/final/base/interface class modifiers, extension types, Future/Stream discipline, immutability, Effective Dart naming, library layout. Apply when the project is a Dart 3 project (pure Dart or Flutter). Stack-agnostic — referenced by every Dart plugin in the marketplace.
Use this skill to:
- Write null-safe code without `!` sprinkled over every access.
- Model closed type hierarchies with sealed classes and exhaustive switch expressions.
- Return multiple values with records instead of ad-hoc wrapper classes.
- Write correct async code (no unawaited futures, no leaked stream subscriptions).
- Lay out a package the way the Dart tooling expects (lib/, lib/src/, bin/, test/).
Do NOT use this skill for:
- Flutter widgets, state management or navigation — see flutter-plugin skills.
- pubspec, lints and code generation — see dart-foundation:dart-tooling.
- Testing patterns — see dart-foundation:dart-testing.
/dart-testingTesting pure Dart code with package:test: file layout, group/test/setUp structure, matchers, async and stream expectations, mocktail mocks and fakes (mockito when the project already uses it), test tags and platforms, coverage. Stack-agnostic — referenced by every Dart plugin in the marketplace. Flutter widget, golden and integration tests live in flutter-plugin:flutter-testing.
Use this skill to:
- Write fast, isolated unit tests for Dart classes and functions.
- Mock collaborators at boundaries without over-mocking.
- Test Futures, Streams, timers and errors correctly.
- Run the suite and collect coverage the way CI does.
Do NOT use this skill for:
- Widget tests, goldens, integration_test — see flutter-plugin:flutter-testing.
- Language idioms — see dart-foundation:dart-conventions.
Other plugins' skills for the same job