upgrade-flutter-gemma
Upgrade flutter_gemma dependency — discover API changes, fix compilation, support new features, update tests, bump version
Install
mkdir -p .claude/skills/upgrade-flutter-gemma && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14749" && unzip -o skill.zip -d .claude/skills/upgrade-flutter-gemma && rm skill.zipInstalls to .claude/skills/upgrade-flutter-gemma
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Upgrade flutter_gemma dependency — discover API changes, fix compilation, support new features, update tests, bump versionAbout this skill
Upgrade flutter_gemma dependency
Follow these 5 phases sequentially. Do not skip phases. Ask the user before making decisions about new features (Phase 3).
Phase 1: Reconnaissance
- Run
dart pub outdatedto identify the available flutter_gemma version - Update
flutter_gemmaversion in both:pubspec.yamlexample/pubspec.yaml
- Run
flutter pub get - Read the new version's CHANGELOG from pub cache:
Then read the CHANGELOG.md from the latest version directory.find ~/.pub-cache/hosted/pub.dev -maxdepth 1 -name "flutter_gemma-*" | sort - Summarize for the user:
- Breaking changes (removed/renamed APIs, changed signatures)
- New APIs (new parameters, methods, enums, classes)
- Bug fixes
- Deprecations
Phase 2: Fix Compilation
-
Run
dart analyze -
Fix all compilation errors. These typically appear in:
Checklist of files that depend on flutter_gemma API:
-
lib/src/flutter_gemma_runtime.dart—FlutterGemma.getActiveModel(),FlutterGemma.getActiveEmbedder()signatures -
lib/src/flutter_gemma_model.dart—InferenceModel.createChat()signature,ModelResponsepattern matching,InferenceChatmethods -
lib/src/flutter_gemma_embedder.dart—EmbeddingModel.generateEmbeddings()signature,PreferredBackendenum -
lib/src/converters/request_converter.dart—Messageconstructors (.withImage,.withAudio,.toolCall,.toolResponse) -
lib/src/converters/response_converter.dart—ModelResponsesubtypes (TextResponse,FunctionCallResponse,ParallelFunctionCallResponse,ThinkingResponse) -
lib/src/converters/tool_converter.dart—Toolconstructor -
lib/src/flutter_gemma_plugin.dart—ModelType,ModelFileTypeenums -
test/src/fake_runtime.dart—FakeInferenceModel,FakeInferenceChat,FakeEmbeddingModelmust match upstream abstract class signatures
-
-
Repeat
dart analyzeuntil clean (0 issues)
Phase 3: Support New Features
Based on the CHANGELOG from Phase 1, decide with the user which new APIs to support.
For each new feature, the typical integration points are:
New parameter in createChat() or createSession()
- Add field to
$FlutterGemmaModelOptionsinlib/src/flutter_gemma_options.dart - Manually update
lib/src/flutter_gemma_options.g.dart:- Constructor parameter
- Field declaration with
@override fromJsonparsingtoJsonserializationjsonSchema()property entry
- Extract from config and pass in
lib/src/flutter_gemma_model.dart(_executeGeneration) - Update
FakeInferenceModel.createChat()intest/src/fake_runtime.dart— add parameter, store inlast*field for test assertions
New enum value (e.g. ModelFileType)
- Update comments in
lib/src/flutter_gemma_plugin.dart(FlutterGemmaModelConfig.fileType)
New method on InferenceChat or InferenceModel
- Add override in
FakeInferenceChatorFakeInferenceModelintest/src/fake_runtime.dart
Changed model capabilities
- Update
supportsmap inlib/src/flutter_gemma_plugin.dart(list()method, ~line 123)
Changed message handling
- Update converters in
lib/src/converters/ - Update
extractSystemInstruction()if system message handling changed
IMPORTANT: The .g.dart file is manually maintained (build_runner is broken). Always update it by hand when changing the schema.
Phase 4: Tests and Review
- Update existing tests that verify old behavior which has changed
- Add new tests for each new feature integrated in Phase 3
- Run
flutter test— all tests must pass - Run
/pr-review-toolkit:review-prfor comprehensive review - Fix any issues found by the review agents
Phase 5: Finalize
- Bump version in
pubspec.yaml:- Minor bump (e.g.
0.1.1→0.2.0) if there are breaking behavioral changes - Patch bump (e.g.
0.1.1→0.1.2) if only bug fixes / non-breaking additions
- Minor bump (e.g.
- Update
CHANGELOG.md— add new version section at the top with:- Breaking changes (prefixed with
**Breaking**:) - New features
- Bug fixes
- Breaking changes (prefixed with
- Update
README.md:- Options table if new config fields were added
- Known Limitations section if capabilities changed
- Quick Start / examples if API usage changed
- Verify everything:
All must pass cleanly.dart analyze flutter test dart pub publish --dry-run - Commit on a feature branch (e.g.
feature/flutter-gemma-X.Y.Z)