Extract from config and pass in lib/src/flutter_gemma_model.dart (_executeGeneration)
Update FakeInferenceModel.createChat() in test/src/fake_runtime.dart — add parameter, store in last* 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 FakeInferenceChat or FakeInferenceModel in test/src/fake_runtime.dart
Changed model capabilities
Update supports map in lib/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-pr for 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
Update CHANGELOG.md — add new version section at the top with:
Breaking changes (prefixed with **Breaking**:)
New features
Bug fixes
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:
dart analyze
flutter test
dart pub publish --dry-run
All must pass cleanly.
Commit on a feature branch (e.g. feature/flutter-gemma-X.Y.Z)
1---2name: upgrade-flutter-gemma3description: Upgrade flutter_gemma dependency — discover API changes, fix compilation, support new features, update tests, bump version4---56# Upgrade flutter_gemma dependency78Follow these 5 phases sequentially. Do not skip phases. Ask the user before making decisions about new features (Phase 3).910## Phase 1: Reconnaissance11121. Run `dart pub outdated` to identify the available flutter_gemma version132. Update `flutter_gemma` version in both:14 - `pubspec.yaml`15 - `example/pubspec.yaml`163. Run `flutter pub get`174. Read the new version's CHANGELOG from pub cache:18 ```19 find ~/.pub-cache/hosted/pub.dev -maxdepth 1 -name "flutter_gemma-*" | sort20 ```21 Then read the CHANGELOG.md from the latest version directory.225. Summarize for the user:23 - **Breaking changes** (removed/renamed APIs, changed signatures)24 - **New APIs** (new parameters, methods, enums, classes)25 - **Bug fixes**26 - **Deprecations**2728## Phase 2: Fix Compilation29301. Run `dart analyze`312. Fix all compilation errors. These typically appear in:3233 **Checklist of files that depend on flutter_gemma API:**34 - [ ] `lib/src/flutter_gemma_runtime.dart` — `FlutterGemma.getActiveModel()`, `FlutterGemma.getActiveEmbedder()` signatures35 - [ ] `lib/src/flutter_gemma_model.dart` — `InferenceModel.createChat()` signature, `ModelResponse` pattern matching, `InferenceChat` methods36 - [ ] `lib/src/flutter_gemma_embedder.dart` — `EmbeddingModel.generateEmbeddings()` signature, `PreferredBackend` enum37 - [ ] `lib/src/converters/request_converter.dart` — `Message` constructors (`.withImage`, `.withAudio`, `.toolCall`, `.toolResponse`)38 - [ ] `lib/src/converters/response_converter.dart` — `ModelResponse` subtypes (`TextResponse`, `FunctionCallResponse`, `ParallelFunctionCallResponse`, `ThinkingResponse`)39 - [ ] `lib/src/converters/tool_converter.dart` — `Tool` constructor40 - [ ] `lib/src/flutter_gemma_plugin.dart` — `ModelType`, `ModelFileType` enums41 - [ ] `test/src/fake_runtime.dart` — `FakeInferenceModel`, `FakeInferenceChat`, `FakeEmbeddingModel` must match upstream abstract class signatures42433. Repeat `dart analyze` until clean (0 issues)4445## Phase 3: Support New Features4647Based on the CHANGELOG from Phase 1, decide with the user which new APIs to support.4849For each new feature, the typical integration points are:5051### New parameter in `createChat()` or `createSession()`521. Add field to `$FlutterGemmaModelOptions` in `lib/src/flutter_gemma_options.dart`532. **Manually** update `lib/src/flutter_gemma_options.g.dart`:54 - Constructor parameter55 - Field declaration with `@override`56 - `fromJson` parsing57 - `toJson` serialization58 - `jsonSchema()` property entry593. Extract from config and pass in `lib/src/flutter_gemma_model.dart` (`_executeGeneration`)604. Update `FakeInferenceModel.createChat()` in `test/src/fake_runtime.dart` — add parameter, store in `last*` field for test assertions6162### New enum value (e.g. `ModelFileType`)631. Update comments in `lib/src/flutter_gemma_plugin.dart` (`FlutterGemmaModelConfig.fileType`)6465### New method on `InferenceChat` or `InferenceModel`661. Add override in `FakeInferenceChat` or `FakeInferenceModel` in `test/src/fake_runtime.dart`6768### Changed model capabilities691. Update `supports` map in `lib/src/flutter_gemma_plugin.dart` (`list()` method, ~line 123)7071### Changed message handling721. Update converters in `lib/src/converters/`732. Update `extractSystemInstruction()` if system message handling changed7475**IMPORTANT:** The `.g.dart` file is manually maintained (build_runner is broken). Always update it by hand when changing the schema.7677## Phase 4: Tests and Review78791. **Update existing tests** that verify old behavior which has changed802. **Add new tests** for each new feature integrated in Phase 3813. Run `flutter test` — all tests must pass824. Run `/pr-review-toolkit:review-pr` for comprehensive review835. Fix any issues found by the review agents8485## Phase 5: Finalize86871. **Bump version** in `pubspec.yaml`:88 - Minor bump (e.g. `0.1.1` → `0.2.0`) if there are breaking behavioral changes89 - Patch bump (e.g. `0.1.1` → `0.1.2`) if only bug fixes / non-breaking additions902. **Update `CHANGELOG.md`** — add new version section at the top with:91 - Breaking changes (prefixed with `**Breaking**:`)92 - New features93 - Bug fixes943. **Update `README.md`**:95 - Options table if new config fields were added96 - Known Limitations section if capabilities changed97 - Quick Start / examples if API usage changed984. **Verify everything:**99 ```bash100 dart analyze101 flutter test102 dart pub publish --dry-run103 ```104 All must pass cleanly.1055. **Commit** on a feature branch (e.g. `feature/flutter-gemma-X.Y.Z`)
Run npx skillmds@latest add denisovav/upgrade-flutter-gemma in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Upgrade flutter_gemma dependency — discover API changes, fix compilation, support new features, update tests, bump version It is listed under Integrations & APIs on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Capability flags: docs only. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
denisovav (@denisovav) published this skill. Their other Agent Skills are listed on their SkillMD profile.