| name | personal-bump-dart |
| description | Bump the minimum Dart SDK version constraint across the flutter/flutter repository, update dependency checksums, and run verification. |
Bumping the Dart SDK Version Constraint
Use this skill when the user asks to bump, upgrade, or change the minimum Dart SDK version constraint in the Flutter repository.
Important Rules
- Never Update Dependencies to 'any': The skill must never change or update any dependency version constraint to
any in order to resolve version conflicts.
- Pause and Ask on Issues: If you run into any issues executing the task (e.g., version resolution failures, checksum mismatches, test failures, or analyzer errors), do not attempt to fix them by modifying other dependencies. Pause immediately, report the exact error details, and ask the user for instructions.
- Handle Language Feature Version Discrepancies: If static analysis fails because a package uses language features from a newer SDK version than the requested target (e.g.,
private-named-parameters in widget_preview_scaffold requiring 3.12.0), ask the user if that specific package should be targeted at the higher SDK version while the rest of the repository remains at the requested target.
Step-by-Step Workflow
Follow these steps carefully to perform the bump, resolve dependencies, and verify the changes.
Step 1: Pre-flight Checks
- Verify target version suffix:
Ensure the version constraint specified by the user includes the
-0 pre-release suffix (e.g., ^3.13.0-0 instead of ^3.13.0).
- Why: Standard caret constraints like
^3.13.0 exclude pre-release versions of that major/minor release. Since active development and CI run on pre-releases, omitting the -0 suffix will cause package resolution to fail. If the user provided a version without -0, append it or ask the user for confirmation.
- Ensure SDK is already rolled:
The target Dart SDK version must already have rolled into the repository (e.g. the local Dart SDK from the Engine stamp is at least that version). Otherwise, package resolution and analysis will fail.
Step 2: Update pubspec.yaml Files
Run the repository's Dart tool script to update matching pubspec.yaml files cross-platform:
dart dev/tools/bin/bump_version_constraints.dart <OLD_VERSION_CONSTRAINT> <NEW_VERSION_CONSTRAINT>
Example: dart dev/tools/bin/bump_version_constraints.dart ^3.10.0-0 ^3.11.0-0
- Note: The script only updates packages whose current SDK constraint matches
<OLD_VERSION_CONSTRAINT>. If it encounters packages with deviating constraints (e.g. higher SDK versions like ^3.12.0 or custom ranges), it will leave them untouched and print a message flagging them to the user.
Step 3: Update Dependency Checksums and Hashes
Flutter enforces dependency integrity via checksums. Run the update-packages tool to re-solve the package workspace, generate updated pubspec.lock files, and update the checksums:
flutter update-packages --force-upgrade --update-hashes
Step 4: Run Static Analysis
Verify the new constraints solve correctly and do not introduce any analyzer errors, deprecations, or formatting issues.
Run static analysis:
flutter analyze --flutter-repo
Step 5: Report Status and Prepare Pull Request
- If static analysis fails, report the failures to the user and ask for guidance or attempt to resolve them if they are simple formatting/lint fixes.
- In your status report, explicitly highlight any skipped/flagged deviating packages reported by the bump script in Step 2.
- If static analysis passes, show a summary of modified files (
git status), prompt the user to commit the changes, and suggest opening a pull request.