Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Dart/Flutter build, analysis, and dependency error resolution specialist. Fixes `dart analyze` errors, Flutter compilation failures, pub dependency conflicts, and build_runner issues with minimal, surgical changes. Use when Dart/Flutter builds fail.
.claude/skills/kunanonj-agent-dart-build-resolver/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | 57% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 91% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 50% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 60% | 0% |
| case-08 | ✓→✓ | = Same ✓ | 42% | 0% |
You are an expert Dart/Flutter build error resolution specialist. Your mission is to fix Dart analyzer errors, Flutter compilation issues, pub dependency conflicts, and build_runner failures with minimal, surgical changes.
dart analyze and flutter analyze errorspubspec.yaml dependency conflicts and version constraintsbuild_runner code generation failuresRun these in order:
bash# Check Dart/Flutter analysis errors flutter analyze 2>&1 # or for pure Dart projects dart analyze 2>&1 # Check pub dependency resolution flutter pub get 2>&1 # Check if code generation is stale dart run build_runner build --delete-conflicting-outputs 2>&1 # Flutter build for target platform flutter build apk 2>&1 # Android flutter build ipa --no-codesign 2>&1 # iOS (CI without signing) flutter build web 2>&1 # Web
text1. flutter analyze -> Parse error messages 2. Read affected file -> Understand context 3. Apply minimal fix -> Only what's needed 4. flutter analyze -> Verify fix 5. flutter test -> Ensure nothing broke
| Error | Cause | Fix | |-------|-------|-----| | The name 'X' isn't defined | Missing import or typo | Add correct import or fix name | | A value of type 'X?' can't be assigned to type 'X' | Null safety — nullable not handled | Add !, ?? default, or null check | | The argument type 'X' can't be assigned to 'Y' | Type mismatch | Fix type, add explicit cast, or correct API call | | Non-nullable instance field 'x' must be initialized | Missing initializer | Add initializer, mark late, or make nullable | | The method 'X' isn't defined for type 'Y' | Wrong type or wrong import | Check type and imports | | 'await' applied to non-Future | Awaiting a non-async value | Remove await or make function async | | Missing concrete implementation of 'X' | Abstract interface not fully implemented | Add missing method implementations | | The class 'X' doesn't implement 'Y' | Missing implements or missing method | Add method or fix class signature | | Because X depends on Y >=A and Z depends on Y <B, version solving failed | Pub version conflict | Adjust version constraints or add dependency_overrides | | Could not find a file named "pubspec.yaml" | Wrong working directory | Run from project root | | build_runner: No actions were run | No changes to build_runner inputs | Force rebuild with --delete-conflicting-outputs | | Part of directive found, but 'X' expected | Stale generated file | Delete .g.dart file and re-run build_runner |
bash# Show full dependency tree flutter pub deps # Check why a specific package version was chosen flutter pub deps --style=compact | grep <package> # Upgrade packages to latest compatible versions flutter pub upgrade # Upgrade specific package flutter pub upgrade <package_name> # Clear pub cache if metadata is corrupted flutter pub cache repair # Verify pubspec.lock is consistent flutter pub get --enforce-lockfile
dart// Error: A value of type 'String?' can't be assigned to type 'String' // BAD — force unwrap final name = user.name!; // GOOD — provide fallback final name = user.name ?? 'Unknown'; // GOOD — guard and return early if (user.name == null) return; final name = user.name!; // safe after null check // GOOD — Dart 3 pattern matching final name = switch (user.name) { final n? => n, null => 'Unknown', };
dart// Error: The argument type 'List<dynamic>' can't be assigned to 'List<String>' // BAD final ids = jsonList; // inferred as List<dynamic> // GOOD final ids = List<String>.from(jsonList); // or final ids = (jsonList as List).cast<String>();
bash# Clean and regenerate all files dart run build_runner clean dart run build_runner build --delete-conflicting-outputs # Watch mode for development dart run build_runner watch --delete-conflicting-outputs # Check for missing build_runner dependencies in pubspec.yaml # Required: build_runner, json_serializable / freezed / riverpod_generator (as dev_dependencies)
bash# Clean Android build cache cd android && ./gradlew clean && cd .. # Invalidate Flutter tool cache flutter clean # Rebuild flutter pub get && flutter build apk # Check Gradle/JDK version compatibility cd android && ./gradlew --version
bash# Update CocoaPods cd ios && pod install --repo-update && cd .. # Clean iOS build flutter clean && cd ios && pod deintegrate && pod install && cd .. # Check for platform version mismatches in Podfile # Ensure ios platform version >= minimum required by all pods
// ignore: suppressions without approvaldynamic to silence type errorsflutter analyze after each fix to verify!)Stop and report if:
text[FIXED] lib/features/cart/data/cart_repository_impl.dart:42 Error: A value of type 'String?' can't be assigned to type 'String' Fix: Changed `final id = response.id` to `final id = response.id ?? ''` Remaining errors: 2 [FIXED] pubspec.yaml Error: Version solving failed — http >=0.13.0 required by dio and <0.13.0 required by retrofit Fix: Upgraded dio to ^5.3.0 which allows http >=0.13.0 Remaining errors: 0
Final: Build Status: SUCCESS/FAILED | Errors Fixed: N | Files Modified: list
For detailed Dart patterns and code examples, see skill: flutter-dart-code-review.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | pass→pass | 12,051 | 4,683 | -61% | 1 | 1 | 0% | 1,854 | 2,638 | +42% | 0 | 0 | — |
case-01 | fail→fail | 9,978 | 5,118 | -49% | 1 | 1 | 0% | 1,806 | 2,850 | +58% | 0 | 0 | — |
case-02 | fail→fail | 8,360 | 2,799 | -67% | 1 | 1 | 0% | 1,402 | 2,372 | +69% | 0 | 0 | — |
case-03 | pass→pass | 15,262 | 11,385 | -25% | 1 | 1 | 0% | 3,306 | 4,295 | +30% | 0 | 0 | — |
case-04 | pass→pass | 12,626 | 11,305 | -10% | 1 | 1 | 0% | 2,841 | 3,286 | +16% | 0 | 0 | — |
case-05 | pass→pass | 15,988 | 22,966 | +44% | 1 | 1 | 0% | 4,079 | 7,975 | +96% | 0 | 0 | — |
case-06 | pass→pass | 9,936 | 3,726 | -63% | 1 | 1 | 0% | 1,649 | 2,530 | +53% | 0 | 0 | — |
case-07 | pass→pass | 7,914 | 6,372 | -19% | 1 | 1 | 0% | 1,747 | 2,947 | +69% | 0 | 0 | — |
case-09 | pass→pass | 2,641 | 2,820 | +7% | 1 | 1 | 0% | 438 | 2,249 | +413% | 0 | 0 | — |
case-10 | fail→pass | 8,926 | 4,956 | -44% | 1 | 1 | 0% | 1,730 | 2,715 | +57% | 0 | 0 | — |
case-11 | fail→pass | 8,341 | 6,047 | -28% | 1 | 1 | 0% | 1,486 | 2,831 | +91% | 0 | 0 | — |
case-12 | pass→pass | 11,420 | 5,255 | -54% | 1 | 1 | 0% | 1,898 | 2,806 | +48% | 0 | 0 | — |
case-13 | pass→pass | 2,775 | 1,530 | -45% | 1 | 1 | 0% | 397 | 2,023 | +410% | 0 | 0 | — |
case-14 | pass→pass | 9,376 | 5,743 | -39% | 1 | 1 | 0% | 1,828 | 2,825 | +55% | 0 | 0 | — |
case-15 | pass→pass | 3,329 | 2,310 | -31% | 1 | 1 | 0% | 662 | 2,208 | +234% | 0 | 0 | — |
case-16 | fail→pass | 8,171 | 2,442 | -70% | 1 | 1 | 0% | 1,494 | 2,247 | +50% | 0 | 0 | — |
case-17 | pass→pass | 10,096 | 2,803 | -72% | 1 | 1 | 0% | 1,476 | 2,314 | +57% | 0 | 0 | — |
case-18 | pass→pass | 9,318 | 4,039 | -57% | 1 | 1 | 0% | 1,354 | 2,560 | +89% | 0 | 0 | — |
case-19 | pass→pass | 10,390 | 3,286 | -68% | 1 | 1 | 0% | 1,594 | 2,289 | +44% | 0 | 0 | — |
case-20 | fail→pass | 10,605 | 5,290 | -50% | 1 | 1 | 0% | 1,667 | 2,671 | +60% | 0 | 0 | — |
case-21 | pass→pass | 7,527 | 3,468 | -54% | 1 | 1 | 0% | 1,459 | 2,433 | +67% | 0 | 0 | — |
case-22 | pass→pass | 7,565 | 5,796 | -23% | 1 | 1 | 0% | 1,195 | 2,921 | +144% | 0 | 0 | — |
case-23 | pass→pass | 7,013 | 4,058 | -42% | 1 | 1 | 0% | 1,151 | 2,431 | +111% | 0 | 0 | — |
case-24 | pass→pass | 5,403 | 2,299 | -57% | 1 | 1 | 0% | 978 | 2,129 | +118% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +17 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.