| name | upgrade_dependencies |
| description | Automates the process of upgrading the Flutter SDK, Minimal package (minimal_mvn) to a new version, and upgrading all other stable dependencies in this repository. |
Upgrade Dependencies Skill
This skill automates upgrading Flutter SDK, Minimal, and all other stable dependencies in this repository with clean atomic commits and PR creation.
Prerequisites
fvm is installed and available.
gh CLI is installed and authenticated.
- You are on the
develop branch of the flutter_arch_comp_mm repository.
Steps
Step 1 — Parse parameters and prepare branch
- Parse
{FLUTTER_VERSION} (e.g. 3.44.4) and {MINIMAL_VERSION} (e.g. 3.0.0) from the user's request.
- Check if the working tree is clean:
git status --porcelain
If there are uncommitted changes, STOP and ask the user to commit or stash them first.
- Switch to the
develop branch and pull latest changes:
git checkout develop
git pull origin develop
- Create and checkout the upgrade branch:
git checkout -b update-flutter-{FLUTTER_VERSION}-minimal-{MINIMAL_VERSION}
Step 2 — Upgrade Flutter SDK
- Update the Flutter SDK version in
.fvmrc:
{
"flutter": "{FLUTTER_VERSION}"
}
- Install the new Flutter SDK version:
fvm install
- Update the VS Code workspace setting in
.vscode/settings.json:
- Set
"dart.flutterSdkPath" to ".fvm/versions/{FLUTTER_VERSION}".
- Stage the FVM-related changes and commit:
git add .fvmrc .vscode/settings.json pubspec.lock
git commit -m "chore: update Flutter dependency to {FLUTTER_VERSION}"
Step 3 — Upgrade packages & generate models
- Upgrade dependencies in
pubspec.yaml:
- Set
minimal_mvn constraint to ^{MINIMAL_VERSION}.
- Update the
environment.sdk constraint if needed (e.g., set to ">=3.10.0 <4.0.0" or higher as required by newer Flutter/Dart/dependencies versions).
- Run
fvm flutter pub upgrade --major-versions to resolve and upgrade dependencies constraints.
- Update all other upgraded dependency constraints in
pubspec.yaml to match their latest resolved stable versions.
- Run
fvm flutter pub get to lock all dependencies in pubspec.lock.
- Run the localization generator:
fvm flutter gen-l10n
Note: In Flutter 3.44.4+, synthetic packages are deprecated/removed. Ensure lib/src/core/app.dart imports from package:flutter_arch_comp/src/localization/app_localizations.dart.
- Run the model generation script:
./scripts/generate_models.sh
- Run the unit and widget tests to verify correctness:
fvm flutter test
- Build the application for macos once to ensure the native configurations (e.g.
macos/) resolve and migrate correctly:
fvm flutter build macos
- Check git status. Staged changes should include:
- modified
pubspec.yaml and pubspec.lock
- localizations files
lib/src/localization/app_localizations.dart and lib/src/localization/app_localizations_en.dart
- modified Xcode/macOS build configuration files in
macos/
- generated model files (
.g.dart, .mapper.dart)
- Stage and commit:
git add pubspec.yaml pubspec.lock lib/src/core/app.dart lib/src/localization/app_localizations.dart lib/src/localization/app_localizations_en.dart lib/src/pokemon/models/data/pokemon_api_model.g.dart lib/src/pokemon/views/ui_states/pokemon_details_ui_state.mapper.dart lib/src/pokemon/views/ui_states/pokemon_ui_state.mapper.dart macos/
git commit -m "chore: update Minimal to {MINIMAL_VERSION} and upgrade other dependencies to latest stable"
Step 4 — Request user manual testing
- Inform the user that the automated upgrades, code generation, localizations, Xcode migration, and tests have finished.
- Ask the user to run the application and perform any manual testing.
- STOP and wait for the user to confirm that manual testing is complete and they are ready to proceed with creating the Pull Request.
Step 5 — Create Pull Request
- Push the branch to origin:
git push origin update-flutter-{FLUTTER_VERSION}-minimal-{MINIMAL_VERSION}
- Talk to the user before executing the PR creation. Explain that you can create the PR using the
gh CLI and ask for confirmation to proceed.
- Once the user approves, run:
gh pr create --base develop --head update-flutter-{FLUTTER_VERSION}-minimal-{MINIMAL_VERSION} --title "chore: upgrade to Flutter {FLUTTER_VERSION} and Minimal {MINIMAL_VERSION}" --body "Automated dependency upgrade to Flutter {FLUTTER_VERSION} and Minimal {MINIMAL_VERSION}."
Important Rules
- Use atomic commits at each step as outlined.
- Never push directly to
develop; always use the update-flutter-* branch and open a PR.
- Always confirm with the user before running the
gh pr create command.
- Always use
fvm flutter and fvm dart instead of bare flutter and dart commands.