[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BXS1CZJ3Z1MR86Y6SERZYP":3,"skill-same:01M6BXS1CZJ3Z1MR86Y6SERZYP":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":45,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":47,"updatedAt":48,"install":49,"resources":61},"01M6BXS1CZJ3Z1MR86Y6SERZYP","review-pr",null,"Comprehensive PR review for flutter_edge_ai. Runs 10 specialized reviewers in parallel (4 platform-specific + 6 general). Use when reviewing PRs or before merging.","DenisovAV\u002Fflutter_edge_ai","DenisovAV","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F9622910?v=4","01M6BXRH02KTWK364FYEH4AECE","Sasha Denisov","01M6BXRH45KJKJ712H82EV47AS",662,"MIT","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-pr\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"review","review pr","pr","pr review","edge","parallel","flutter","specialized","use","general","platform","true","for","prs","when","2026-11-10 10:12:30",false,"---\nname: review-pr\ndescription: Comprehensive PR review for flutter_edge_ai. Runs 10 specialized reviewers in parallel (4 platform-specific + 6 general). Use when reviewing PRs or before merging.\nuser_invocable: true\n---\n\n# Flutter Edge AI PR Review\n\nRun comprehensive PR review with 10 parallel agents — 4 platform-specific + 6 general-purpose.\n\n## Usage\n\n```\n\u002Freview-pr 198        # Review PR by number\n\u002Freview-pr            # Review current branch vs main\n```\n\n## Process\n\n### Step 1: Get the diff\n\n**If PR number provided:**\n```bash\ngh pr view {number} --json title,body,files --jq '.title'\ngh pr diff {number} > \u002Ftmp\u002Fpr-{number}.diff\n```\n\n**If no PR number:**\n```bash\nBRANCH=$(git branch --show-current)\nPR_NUMBER=$(gh pr list --head \"$BRANCH\" --json number -q '.[0].number')\nif [ -n \"$PR_NUMBER\" ]; then\n  gh pr diff \"$PR_NUMBER\" > \u002Ftmp\u002Fpr-branch.diff\nelse\n  git diff main...HEAD > \u002Ftmp\u002Fpr-branch.diff\nfi\n```\n\n### Step 2: Identify changed areas\n\nThis is a **Dart pub workspace monorepo** — all code lives under `packages\u002F\u003Cpkg>\u002F`.\nFrom the diff, detect which package(s)\u002Farea(s) are affected:\n\n**Packages (`packages\u002F\u003Cpkg>\u002F`):**\n- `flutter_edge_ai\u002F` — core: registry, contracts, shells, ModelSource, slim native plugin (its `android\u002F` `ios\u002F` host only the bundled channel)\n- `flutter_edge_ai_litertlm\u002F` — `.litertlm` FFI engine; `native\u002Flitert_lm\u002F` build scripts, `lib\u002Fsrc\u002Fffi\u002F`, `hook\u002Fbuild.dart`\n- `flutter_edge_ai_embeddings\u002F` — embedding tokenizers (pure Dart; the app registers them)\n- `flutter_edge_ai_mediapipe\u002F` — `.task` MediaPipe; owns pigeon (`lib\u002Fpigeon.g.dart`) + Kotlin\u002FSwift + web JS\n- `flutter_edge_ai_rag\u002F` — instance-scoped RAG orchestration and contracts.\n  It may depend on core for the default active-embedder adapter; it must not\n  depend on either storage provider.\n- `flutter_edge_ai_qdrant\u002F` — native RAG over the official `qdrant_edge`\n  UniFFI SDK. Since 1.4.0 the package owns NO native code and NO hook: the\n  engine and its Native Assets hook live in the SDK. It depends on\n  `flutter_edge_ai_rag`, never directly on core. `lib\u002Fsrc\u002F` only.\n- `flutter_edge_ai_sqlite\u002F` — sqlite-vec `vec0` KNN on all six platforms; native via `package:sqlite3` FFI, web via `package:sqlite3\u002Fwasm.dart` (wa-sqlite was dropped in flutter_gemma_rag_sqlite 1.1.0)\n  It depends on `flutter_edge_ai_rag`, never directly on core in its published\n  dependency graph.\n- `flutter_edge_ai_speech\u002F` — opt-in STT (moonshine \u002F Whisper \u002F Parakeet) + TTS (Matcha \u002F Qwen3 \u002F Inflect) over the LiteRT C API; shares the litertlm bundle\n- `flutter_edge_ai_agent\u002F` — opt-in SKILL.md agent skills over the function-calling loop (no Web)\n- `flutter_edge_ai_builtin_ai\u002F` — OS models: Gemini Nano (Android), Apple Foundation Models (iOS\u002FmacOS), Windows AI Foundry, Chrome Prompt API (Web). Pure Dart since 0.3.0: no native sources and no pigeon of its own — it adapts the `flutter_local_ai` plugin, which owns every backend.\n- `flutter_edge_ai_diagnostics\u002F` — memory diagnostics (`MemorySnapshot`) read from the OS on Android, iOS, macOS, Linux and Windows through `dart:io`\u002F`dart:ffi`. No native sources, no dependency on core. A failed read must throw `MemoryReadException`; null is reserved for a value the platform does not have.\n- `genkit_flutter_edge_ai\u002F`, `genkit_hybrid\u002F` — Genkit integration packages (Dart; no native)\n- `flutter_edge_ai\u002Fexample\u002F` — example app + `integration_test\u002F` E2E\n\n**Native (per package):** `packages\u002F\u003Cpkg>\u002Fandroid\u002F`, `ios\u002F`, `windows\u002F`, `native\u002F`, `hook\u002Fbuild.dart`\n**Web:** `packages\u002F*\u002Flib\u002Fsrc\u002Fweb\u002F`, `packages\u002F*\u002Fweb\u002F` (JS interop, WASM)\n**Desktop:** `packages\u002Fflutter_edge_ai\u002Flib\u002Fsrc\u002Fdesktop\u002F` + FFI in `flutter_edge_ai_litertlm`\n**Site:** `website\u002F` — Jaspr landing + docs (deployed to flutteredge.ai; CI `.github\u002Fworkflows\u002Ffirebase-hosting-merge.yml`)\n**Repo-level:** `.github\u002Fworkflows\u002F`, `.claude\u002Fskills\u002F`, root `pubspec.yaml` (workspace + melos)\n\nFor RAG diffs, review these invariants explicitly: core exposes no RAG facade or\nvector-store contracts; providers depend only on `flutter_edge_ai_rag`; every\npersistent index is bound to a stable embedding profile and one document\nmodality (`VectorStoreBinding`), the version-1 profile record is always written\nand an image\u002Faudio binding stores the U+001F-qualified id there so older\nreleases refuse it (`tool\u002Frag_store_compat\u002Frun_downgrade_harness.sh`);\nraw-vector creation cannot infer an identity; legacy adoption is explicit,\ntext-only and dimension-checked; Web SQLite has one live owner per location;\nopen is single-flight; and indexes are disposed before their borrowed\ncore\u002Fcustom embedder.\n\n### Ground rules for every agent — REVIEWERS DO NOT WRITE\n\nPut this in every agent prompt, verbatim. It is not boilerplate; it is the\nlesson from a review round that had to be redone from scratch.\n\n```\nREAD-ONLY. Do not write, create, edit, delete, move or rename ANY file in the\nrepository — including test files, scratch files and probe files. Do not run\nmutation testing. Do not run `flutter test`, `flutter analyze`, `dart format`\nor `flutter pub get` (they write into .dart_tool and build outputs). Do not run\ngit add \u002F restore \u002F checkout \u002F stash \u002F clean \u002F commit. Reading is unlimited:\ncat, sed, grep, find, `git show`, `git diff`, `git log`, and ~\u002F.pub-cache.\nIf you want something verified by execution, DESCRIBE THE EXPERIMENT precisely\n— setup, the call, what to print — and stop. The caller will run it and hand\nyou the output.\n```\n\n**What this prevents.** Reviewers told to \"verify by mutation and restore\nafterwards\" did exactly that, in the shared working tree, on top of\nUNCOMMITTED fixes. Those fixes were silently overwritten twice; one agent's\nmid-mutation state got picked up by a `git add`, so `git diff` showed the\nagent's revert as if it were HEAD, and it was nearly committed. It was caught\nonly because the file's md5 changed twice in twenty seconds while nothing was\nbeing edited. Every test result taken during that window was meaningless.\n\n**Two more rules that follow from it:**\n\n1. **Commit before you review.** Reviewers read a moving tree otherwise, and\n   their findings are anchored to a state that no longer exists.\n2. **Run them ONE AT A TIME when acting on findings.** Parallel is right for a\n   first sweep of a frozen commit. It is wrong once you are editing between\n   reports: read one report, decide what you accept, apply it, commit, then\n   start the next. The agents are advisors — the decision to change code is\n   yours, and it is not delegable to ten of them at once.\n\n### Acting on a finding — the part that goes wrong\n\nA report is a list of HYPOTHESES, not a list of defects. Converting one straight\ninto an edit is how a review round ends with more bugs than it started.\n\nMeasured on one PR, one day: reviewers found **six** real pre-existing defects,\nand acting on them introduced **five** new ones. None shipped — four were caught\nby the next round, one by its own test — but four of the five came from the same\nomission, and it is not \"this was hard\":\n\n| what I changed | what I did not check first |\n|---|---|\n| set a state flag to false on a failure path | who READS that flag — `close()` was gated on it, so the handle leaked |\n| put cleanup in a `catch` | whether the cleanup call can itself throw — it did, swallowing the original error |\n| `vtool -output \"$lib.norm\"` then `mv` | what the tool does to the OUTPUT — it baked `.norm` into the code signature |\n| wrote a regression test | whether the test can distinguish the two worlds — it could not |\n\n**The loop, per finding, in this order:**\n\n1. **Reproduce it.** Print the wrong value. A finding you cannot reproduce is\n   not yet a defect — and twice this day a confident report was wrong on\n   measurement.\n2. **Read the neighbours.** If you change state, grep every reader of that\n   state. If you change a file, find what consumes it. If you call a tool, check\n   what it does to its output.\n3. **Fix.**\n4. **Mutate the test.** Break the production line the test names, and watch it\n   go red. If it stays green the test is decoration — delete it or fix it, but\n   do not keep it.\n5. **Only then take the next finding.**\n\nStep 4 is not optional and not a formality. Tests written after a fix\n\"obviously\" pass; that is the problem, not the reassurance.\n\n**Two more that cost real time:**\n\n- **A green narrow check is not a green wide one.** `flutter test` in a package\n  passed while `flutter analyze packages\u002F` had 17 errors, because the ambiguity\n  was only visible from the wider scope. Run the wide one before saying \"clean\".\n- **A fix that is not observable to the consumer is not a fix.** A corrected\n  binary was still not reaching builds, because the staging guard compared file\n  SIZE and the correction happened not to change it. Verify at the point the\n  user consumes it, not at the point you edited it.\n\n### Step 3: Launch ALL agents in parallel\n\nLaunch all 10 agents simultaneously using the Agent tool. Each agent gets:\n- The full diff (or list of changed files)\n- The affected platform(s)\n- Its specific review checklist (below)\n\n**CRITICAL: All agents MUST run in parallel via a single message with multiple Agent tool calls.**\n\n---\n\n## Agent Specifications\n\nEvery path named in an agent prompt below was verified to exist. If one stops\nresolving, that is the finding — fix the skill before running the review, because\nan agent pointed at a missing directory returns a clean report.\n\n### Agent 1: Android native\n\n**subagent_type:** `android-architect`\n\n```\nYou are reviewing the Android native layer of flutter_edge_ai, a Dart pub workspace\nmonorepo. Inference itself is NOT in Kotlin — `.litertlm` runs through Dart FFI.\nKotlin exists in exactly three packages; confirm with\n`find packages -path '*\u002Fandroid\u002Fsrc\u002Fmain\u002Fkotlin' -name '*.kt'` before you start.\n\n- packages\u002Fflutter_edge_ai\u002Fandroid\u002F...\u002FFlutterEdgeAiPlugin.kt — SLIM. Hosts only the\n  `flutter_gemma_bundled` channel: file ops plus the litertlm NPU\n  `getNativeLibraryDir`. If a change adds inference logic here, that is the\n  finding.\n- packages\u002Fflutter_edge_ai_mediapipe\u002Fandroid\u002F — the only real engine layer:\n  own pigeon (PigeonInterface.g.kt), PlatformServiceImpl, InferenceModel, and\n  engines\u002F{InferenceEngine,EngineFactory,InferenceSession,EngineConfig}.kt plus\n  engines\u002Fmediapipe\u002F. EngineFactory handles `.task`\u002F`.bin`\u002F`.tflite` ONLY — it\n  throws on `.litertlm` with a message pointing at the Dart FFI client. That\n  throw is correct behaviour, not a bug.\n  (`flutter_edge_ai_builtin_ai` has no android\u002F since 0.3.0. The `minSdk 26` floor\n  still reaches an app that depends on it, but through `flutter_local_ai`.)\n\nCHECKLIST\n1. NO KGP IN THE PLUGINS: since #440 none of the THREE android\u002Fbuild.gradle\n   files applies `kotlin-android`, declares `ext.kotlin_version`, or carries the\n   KGP classpath. Flutter's own Gradle plugin applies KGP to any plugin\n   subproject that does not (FlutterPluginUtils `detectApplyingKotlinGradlePlugin`),\n   which is why `flutter: '>=3.44.0'` is load-bearing. Re-adding a guard like the\n   old `agpMajor \u003C 9 || !builtInKotlinOn` is a REGRESSION, not a fix. What still\n   matters is the #360 lesson: the `kotlin { compilerOptions { jvmTarget } }` block\n   and its comment must be byte-identical in all three — a fix in one is a half-fix\n   that ships under its own version number.\n2. MANIFEST: the `\u003Cuses-native-library>` entries (libOpenCL.so, -car, -pixel,\n   libvndksupport.so, libcdsprpc.so) live in the CORE plugin manifest and merge\n   into consumer apps. libvndksupport is load-bearing for the OpenCL ICD on\n   Android 12+ (#324) — without it OpenCL fails to load, and OpenCL is the only\n   Android GPU path (no WebGPU library ships for Android since native-v0.18.0).\n3. minSdk: `.litertlm` needs 30 (API-30-only Bionic symbols, #265); builtin_ai\n   needs 26; core declares 24. A change to any floor must be consistent with what\n   the code actually dlopens.\n4. PIGEON: *.g.kt files are generated — never hand-edited. Regenerated from the\n   package's own pigeon.dart.\n5. NATIVE LIBS: arm64-v8a only for .litertlm\u002Fembeddings\u002Fvision. A change that\n   implies other ABIs ship broken APKs.\n6. Coroutine scope, cancellation and prompt accumulation in the MediaPipe session.\n\nReport CRITICAL \u002F IMPORTANT \u002F MINOR with file:line. Skip style nits.\n```\n\n### Agent 2: Apple native (iOS + macOS)\n\n**subagent_type:** `swift-reviewer`\n\n```\nYou are reviewing the Apple native layer of flutter_edge_ai. Note the layouts\ndiffer per package — verify with `find packages -name '*.swift' | grep -v example`\nrather than assuming a single convention:\n\n- packages\u002Fflutter_edge_ai\u002F{ios,macos}\u002Fflutter_edge_ai\u002FSources\u002Fflutter_edge_ai\u002F —\n  SwiftPM layout (NOT ios\u002FClasses\u002F). Slim plugin: bundled channel only.\n- packages\u002Fflutter_edge_ai_mediapipe\u002Fios\u002FClasses\u002F — classic layout, real engine:\n  FlutterEdgeAiMediaPipePlugin, PlatformServiceImpl, InferenceModel, pigeon .g.swift\n  (`flutter_edge_ai_builtin_ai` has no darwin\u002F since 0.3.0. Apple Foundation Models\n  reach it through `flutter_local_ai`, whose floor is iOS 13.0 \u002F macOS 12.0.)\n\nCHECKLIST\n1. Swift 6 concurrency: Sendable conformance, actor isolation, and no\n   captured-mutable-state across the pigeon boundary.\n2. Podspec versions: three first-party podspecs exist and drift independently —\n   core ios, core macos, mediapipe ios. Each must match its OWN package version.\n3. iOS floor since #441: core declares 15.0; only flutter_edge_ai_mediapipe\n   declares 16.0. A litertlm-only app is NOT held to 16 — that was the bug. Both\n   the podspec and the Package.swift must carry the same number for a package\n   that has both (mediapipe has no Package.swift). An app using\n   flutter_edge_ai_builtin_ai is additionally held to flutter_local_ai's\n   iOS 13.0 \u002F macOS 12.0.\n4. Entitlements: iOS needs extended-virtual-addressing and increased-memory-limit\n   for large models. macOS must carry NO `com.apple.developer.kernel.*` key — they\n   are iOS-only: without a signing team the build fails (\"has entitlements that\n   require signing with a development certificate\"), with a team Xcode drops\n   them. macOS needs `network.client` in BOTH DebugProfile and Release\n   entitlements, and an app with Swift Package Manager off also\n   `cs.disable-library-validation` (it takes effect under Hardened Runtime,\n   because the Podfile stager signs the companions ad hoc). With it on, the\n   companions come from litertlm's `macos\u002Fflutter_edge_ai_litertlm\u002FPackage.swift`\n   and Xcode signs them with the app's team (#689); Package.swift and the\n   litertlm podspec declare macOS 14.0, which every app depending on litertlm or\n   speech must match.\n5. No `Podfile post_install` symlink step should be reintroduced: those lib*.dylib\n   symlinks caused App Store rejection ITMS-90432 (#245). Any bundled dylib needs\n   `vtool` minos 13.0 or the upload is rejected (ITMS-90208).\n6. Generated pigeon .g.swift is never hand-edited.\n\nReport CRITICAL \u002F IMPORTANT \u002F MINOR with file:line.\n```\n\n### Agent 3: Web\n\n**subagent_type:** `general-purpose`\n\n```\nYou are reviewing the web layer of flutter_edge_ai. Two independent engines have\nweb arms, plus embeddings and RAG:\n\n- packages\u002Fflutter_edge_ai_mediapipe\u002Flib\u002Fsrc\u002Fweb\u002F — `.task` via @mediapipe\u002Ftasks-genai\n- packages\u002Fflutter_edge_ai_litertlm\u002Flib\u002Fsrc\u002Fweb\u002F — `.litertlm` via @litert-lm\u002Fcore.\n  EARLY PREVIEW: text only. Function calling is wired; vision, audio, verified\n  thinking and LoRA are not supported.\n- packages\u002Fflutter_edge_ai_onnx\u002Flib\u002Fsrc\u002Fweb\u002F — `.onnx` text generation and\n  embeddings through Transformers.js \u002F ONNX Runtime Web (WebGPU with WASM CPU\n  fallback).\n- packages\u002Fflutter_edge_ai_litertlm\u002F web embedding arm — LiteRT.js bundle in its own web\u002F\n- packages\u002Fflutter_edge_ai_sqlite\u002F — package:sqlite3\u002Fwasm.dart + a custom\n  sqlite3.wasm with vec0 linked in, which the APP copies into its own web\u002F dir\n- packages\u002Fflutter_edge_ai\u002Flib\u002Fsrc\u002Fweb\u002F — the shared web shells and model source\n\nCHECKLIST\n1. CONDITIONAL IMPORT \u002F STUB DRIFT — the highest-value check here. FFI clients\n   have `*_stub.dart` counterparts that `flutter analyze` and `flutter test` do\n   NOT type-check on the host. Signature drift only surfaces at\n   `flutter build web`. If a real signature changed, its stub must change too.\n   This is how a web break shipped in 0.15.0 with green analyze and green tests.\n2. dart:io \u002F dart:ffi must not reach the web graph. Check the conditional export.\n3. The six required web\u002F assets are not auto-injected — the app copies them:\n   cache_api.js and opfs_helper.js from `flutter_edge_ai`, and the four-file\n   LiteRT.js bundle from `flutter_edge_ai_litertlm` (litert_embeddings.js plus\n   its three vendor chunks). A change that needs a new global must\n   document the script tag.\n4. Storage modes: cacheApi (default, \u003C2GB), streaming (OPFS, large models),\n   none. MediaPipe and LiteRT-LM are GPU-first web paths; ONNX Runtime Web also\n   has a WASM CPU fallback. Do not describe the whole Web platform as GPU-only.\n5. CDN pins: @mediapipe\u002Ftasks-genai, @litert-lm\u002Fcore and @litertjs\u002Fcore must\n   agree between the code and any documented script tag. @litertjs\u002Fcore has\n   THREE places to keep in step: `LiteRtWebRuntime.pinnedVersion`,\n   `tool\u002Fweb_build\u002Fpackage.json` and the committed `web\u002Flitert.js`.\n\nReport CRITICAL \u002F IMPORTANT \u002F MINOR with file:line.\n```\n\n### Agent 4: Desktop \u002F FFI and native assets\n\n**subagent_type:** `general-purpose`\n\n```\nYou are reviewing desktop inference and the native-asset pipeline of\nflutter_edge_ai. Desktop is Dart FFI directly into the LiteRT-LM C API — there is\nNO JVM, NO gRPC, NO separate server process and no proto layer. If the diff or a\ntask description mentions any of those, it predates 0.14.0.\n\n- packages\u002Fflutter_edge_ai_litertlm\u002Flib\u002Fsrc\u002Fffi\u002F — the FFI client, generated\n  bindings, and the inference model\n- packages\u002Fflutter_edge_ai_litertlm\u002Fhook\u002Fbuild.dart — the SOLE hook that owns the\n  shared libLiteRtLm bundle. embeddings and speech consume it transitively and\n  have no hook of their own.\n- packages\u002Fflutter_edge_ai_litertlm\u002Fnative\u002Flitert_lm\u002F — build_*.sh, patch_c_api.sh,\n  stream_proxy.c\n- packages\u002Fflutter_edge_ai\u002F{linux,windows}\u002F — thin plugin registration C++\n- packages\u002Fflutter_edge_ai\u002Flib\u002Fsrc\u002Fdesktop\u002F — the registry-dispatch shell\n\nCHECKLIST\n1. HOOK CHECKSUMS: a bundle `version:` bump requires all seven per-platform\n   SHA256 entries updated, and the same value must appear in the released\n   tarball, in checksums_litertlm.txt, and in the hook. A stale txt sent a user\n   down the wrong path in #316.\n2. NEVER re-upload an existing native-v* tag. tar is not reproducible, so the\n   published SHA256 can never be recovered — it breaks every user already on a\n   plugin version referencing that tag.\n3. windowsExtraLibs \u002F androidExtraLibs and the CI allow-list are ONE SET IN TWO\n   PLACES. A name staged by CI but absent from the hook extracts to the cache and\n   is never bundled — that is how 78.8 MB of the Intel NPU stack went missing at\n   v0.16.0 while every CI assertion passed.\n4. Bazel `--define` names rot silently: Bazel accepts an unknown define and\n   builds the default. Grep the tree being built before trusting one.\n5. v0.15.0 changed the stream callback shape with no version symbol. The shipped\n   stream_proxy.c probes it at runtime via dlsym\u002FGetProcAddress; the source on\n   main also has stream_proxy_create2, where Dart passes the accessors it resolved\n   on the library it drives. Do not replace either with a compile-time branch.\n6. `stage()` in the hook is Apple-only on purpose (an Xcode directoryTreeSignature\n   cycle); staging on Windows splits companion DLLs and hangs cancel\u002Fclose.\n7. Any claim that a native check \"passed\" must name the artifact it inspected —\n   nm\u002Fotool on a missing path prints nothing and reads as success.\n\nReport CRITICAL \u002F IMPORTANT \u002F MINOR with file:line.\n```\n\n### Agent 5: Flutter Architect\n\n**subagent_type:** `flutter-architect`\n\n**Prompt:** Review the PR diff for flutter_edge_ai — a multi-platform Flutter plugin for on-device AI inference. Focus on: plugin architecture (platform channels via Pigeon), SOLID principles, ModelSource sealed class design, handler chain pattern (NetworkSourceHandler, AssetSourceHandler), dependency injection (ServiceRegistry), platform abstraction layer. Check separation of concerns between install-time identity (modelType, fileType) and runtime configuration (maxTokens, preferredBackend). Read AGENTS.md for project conventions.\n\n### Agent 6: Flutter Coder\n\n**subagent_type:** `flutter-coder`\n\n**Prompt:** Review the changed Dart files in flutter_edge_ai for code quality. Check: null safety, proper async\u002Fawait patterns, Stream handling (no leaks, proper cancellation), Message class usage (isUser: true for user messages), PreferencesKeys constants (no inline string keys), proper close()\u002Fdispose() in finally blocks, type safety with ModelSource sealed classes. Read AGENTS.md for coding standards — especially \"No Inline String Keys\" rule.\n\n### Agent 7: Codex Review (Second Opinion)\n\n**subagent_type:** `codex:codex-rescue`\n\nNot the `copilot` CLI. That binary is GitHub Copilot, billed against a\ndifferent quota entirely, and it answers `402 You have exceeded your monthly\nquota` on every model regardless of the ChatGPT plan — an earlier revision of\nthis skill called it and lost a whole review round to that.\n\n**Prompt:**\n\n```\nSecond-opinion review of PR #{number} for flutter_edge_ai. Read the diff with\n`gh pr diff {number}` (or `git diff main...HEAD` if no PR), and read AGENTS.md\nfor the project's conventions.\n\nREAD-ONLY. Do not write, create, edit, delete or move any file in the\nrepository, and do not run `flutter test` \u002F `flutter analyze` \u002F `dart format` \u002F\n`flutter pub get` — they write into .dart_tool and build outputs. Do not run\ngit add \u002F restore \u002F checkout \u002F stash \u002F clean \u002F commit. Reading is unlimited.\nIf you want something verified by execution, DESCRIBE the experiment precisely\nand stop; the caller will run it and hand you the output.\n\nKey project context:\n- A Dart pub workspace monorepo: core flutter_edge_ai plus opt-in packages under\n  packages\u002F. Core registers no engine; engines and backends are passed to\n  FlutterEdgeAi.initialize().\n- .litertlm inference is Dart FFI into the LiteRT-LM C API on every native\n  platform, desktop included. There is NO JVM, NO gRPC, no separate server\n  process and no proto layer — removed at 0.14.0. Kotlin exists only in the\n  MediaPipe and builtin_ai packages plus a slim core plugin; MediaPipe never\n  handles .litertlm.\n- Engine selection is by the DECLARED ModelFileType via canHandle(spec), NOT by\n  sniffing the file name. installModel defaults fileType to .task, so a\n  .litertlm model must declare it explicitly or it is routed to MediaPipe.\n- ModelSource sealed class: NetworkSource, AssetSource, BundledSource, FileSource.\n- Installation stores identity (modelType, fileType); runtime accepts config\n  (maxTokens, preferredBackend).\n- maxTokens is the CONTEXT WINDOW, not the reply length. Below 1024 the\n  .litertlm KV cache allocation fails; the engine clamps up with a warning. To\n  cap a reply use maxOutputTokens on the session.\n- Error handling: NO silent fallbacks. Throw or return an error; never swallow\n  in a catch. edgeAiLog is debug-only, so anything reported only through it is\n  unreported in release builds.\n- No inline string keys — use PreferencesKeys constants.\n- Generated files are never hand-edited: pigeon *.g.dart \u002F *.g.kt \u002F *.g.swift,\n  and the ffigen bindings.\n\nCross-check specifically: engine routing by declared fileType; conditional-import\nstub drift against the real signatures (analyze does not catch it, only\n`flutter build web` does); and platform-specific limitations.\n\nFocus on bugs, logic errors, security, dead code, silent error swallowing, race\nconditions in async\u002Fstreaming code, and memory leaks (unclosed sessions\u002Fmodels).\nBe concise — only real issues, each with file:line and a concrete failure\nscenario. Skip style nits. Categorize CRITICAL \u002F IMPORTANT \u002F MINOR.\n```\n\nIf no PR number, detect via: `gh pr list --head $(git branch --show-current) --json number -q '.[0].number'`\n\n### Agent 8: Code Reviewer\n\n**subagent_type:** `pr-review-toolkit:code-reviewer`\n\n**Prompt:** Review the PR for adherence to project guidelines in AGENTS.md. Focus on recently changed files. Key rules: no inline string keys, proper PreferencesKeys usage, no AI attribution in commits, sessions\u002Fmodels always closed, Message(isUser: true) for user messages.\n\n### Agent 9: Type Design Analyzer\n\n**subagent_type:** `pr-review-toolkit:type-design-analyzer`\n\n**Prompt:** Analyze any new or modified types\u002Finterfaces in the PR for encapsulation, invariant expression, and design quality. Focus on: ModelSource sealed class hierarchy, EngineConfig\u002FSessionConfig, InferenceEngine\u002FInferenceSession interfaces, EngineCapabilities, TestModelConfig.\n\n### Agent 10: Silent Failure Hunter\n\n**subagent_type:** `pr-review-toolkit:silent-failure-hunter`\n\n**Prompt:** Check all changed files for silent failures, inadequate error handling, catch blocks that swallow errors, and inappropriate fallback behavior. Key concern areas: image conversion fallbacks (should throw, not return original bytes), tryEmit() that drops errors silently, cancelGeneration() that swallows exceptions, download\u002Fchecksum verification gaps.\n\n---\n\n## Step 4: Collect and Deduplicate\n\nAfter all agents complete:\n\n1. Collect all findings from all agents\n2. Deduplicate — if two agents report the same issue (same file, same line, same concern), keep the one with better description\n3. Categorize by severity: CRITICAL > IMPORTANT > MINOR\n4. Group by file path within each severity\n\n## Step 5: Generate Report\n\nSave to `test_reports\u002Fpr-reviews\u002Fpr-{number}-review.md` (or `pr-branch-{branch}-review.md`):\n\n```markdown\n# PR Review: #{number} — {title}\n\n**Branch:** {branch}\n**Date:** {date}\n**Reviewers:** 10 agents (4 platform-specific + 6 general)\n**Platforms affected:** {platforms}\n\n## Critical Issues\n{blocking issues that must be fixed before merge}\n\n## Important Issues\n{should be fixed, but not blocking}\n\n## Minor Issues\n{nice-to-have improvements}\n\n## Passed Checks\n{list of checks that passed cleanly}\n\n## Summary\n- Critical: X\n- Important: Y\n- Minor: Z\n- Recommendation: APPROVE \u002F REQUEST CHANGES \u002F NEEDS DISCUSSION\n```\n\n## Step 6: Output Summary\n\nPrint a concise summary to the user:\n- Total findings by severity\n- Top 3 most important issues\n- Recommendation (approve\u002Fchanges requested)\n- Path to full report file\n","# Flutter Edge AI PR Review\n\nRun comprehensive PR review with 10 parallel agents — 4 platform-specific + 6 general-purpose.\n\n## Usage\n\n```\n\u002Freview-pr 198        # Review PR by number\n\u002Freview-pr            # Review current branch vs main\n```\n\n## Process\n\n### Step 1: Get the diff\n\n**If PR number provided:**\n```bash\ngh pr view {number} --json title,body,files --jq '.title'\ngh pr diff {number} > \u002Ftmp\u002Fpr-{number}.diff\n```\n\n**If no PR number:**\n```bash\nBRANCH=$(git branch --show-current)\nPR_NUMBER=$(gh pr list --head \"$BRANCH\" --json number -q '.[0].number')\nif [ -n \"$PR_NUMBER\" ]; then\n  gh pr diff \"$PR_NUMBER\" > \u002Ftmp\u002Fpr-branch.diff\nelse\n  git diff main...HEAD > \u002Ftmp\u002Fpr-branch.diff\nfi\n```\n\n### Step 2: Identify changed areas\n\nThis is a **Dart pub workspace monorepo** — all code lives under `packages\u002F\u003Cpkg>\u002F`.\nFrom the diff, detect which package(s)\u002Farea(s) are affected:\n\n**Packages (`packages\u002F\u003Cpkg>\u002F`):**\n- `flutter_edge_ai\u002F` — core: registry, contracts, shells, ModelSource, slim native plugin (its `android\u002F` `ios\u002F` host only the bundled channel)\n- `flutter_edge_ai_litertlm\u002F` — `.litertlm` FFI engine; `native\u002Flitert_lm\u002F` build scripts, `lib\u002Fsrc\u002Fffi\u002F`, `hook\u002Fbuild.dart`\n- `flutter_edge_ai_embeddings\u002F` — embedding tokenizers (pure Dart; the app registers them)\n- `flutter_edge_ai_mediapipe\u002F` — `.task` MediaPipe; owns pigeon (`lib\u002Fpigeon.g.dart`) + Kotlin\u002FSwift + web JS\n- `flutter_edge_ai_rag\u002F` — instance-scoped RAG orchestration and contracts.\n  It may depend on core for the default active-embedder adapter; it must not\n  depend on either storage provider.\n- `flutter_edge_ai_qdrant\u002F` — native RAG over the official `qdrant_edge`\n  UniFFI SDK. Since 1.4.0 the package owns NO native code and NO hook: the\n  engine and its Native Assets hook live in the SDK. It depends on\n  `flutter_edge_ai_rag`, never directly on core. `lib\u002Fsrc\u002F` only.\n- `flutter_edge_ai_sqlite\u002F` — sqlite-vec `vec0` KNN on all six platforms; native via `package:sqlite3` FFI, web via `package:sqlite3\u002Fwasm.dart` (wa-sqlite was dropped in flutter_gemma_rag_sqlite 1.1.0)\n  It depends on `flutter_edge_ai_rag`, never directly on core in its published\n  dependency graph.\n- `flutter_edge_ai_speech\u002F` — opt-in STT (moonshine \u002F Whisper \u002F Parakeet) + TTS (Matcha \u002F Qwen3 \u002F Inflect) over the LiteRT C API; shares the litertlm bundle\n- `flutter_edge_ai_agent\u002F` — opt-in SKILL.md agent skills over the function-calling loop (no Web)\n- `flutter_edge_ai_builtin_ai\u002F` — OS models: Gemini Nano (Android), Apple Foundation Models (iOS\u002FmacOS), Windows AI Foundry, Chrome Prompt API (Web). Pure Dart since 0.3.0: no native sources and no pigeon of its own — it adapts the `flutter_local_ai` plugin, which owns every backend.\n- `flutter_edge_ai_diagnostics\u002F` — memory diagnostics (`MemorySnapshot`) read from the OS on Android, iOS, macOS, Linux and Windows through `dart:io`\u002F`dart:ffi`. No native sources, no dependency on core. A failed read must throw `MemoryReadException`; null is reserved for a value the platform does not have.\n- `genkit_flutter_edge_ai\u002F`, `genkit_hybrid\u002F` — Genkit integration packages (Dart; no native)\n- `flutter_edge_ai\u002Fexample\u002F` — example app + `integration_test\u002F` E2E\n\n**Native (per package):** `packages\u002F\u003Cpkg>\u002Fandroid\u002F`, `ios\u002F`, `windows\u002F`, `native\u002F`, `hook\u002Fbuild.dart`\n**Web:** `packages\u002F*\u002Flib\u002Fsrc\u002Fweb\u002F`, `packages\u002F*\u002Fweb\u002F` (JS interop, WASM)\n**Desktop:** `packages\u002Fflutter_edge_ai\u002Flib\u002Fsrc\u002Fdesktop\u002F` + FFI in `flutter_edge_ai_litertlm`\n**Site:** `website\u002F` — Jaspr landing + docs (deployed to flutteredge.ai; CI `.github\u002Fworkflows\u002Ffirebase-hosting-merge.yml`)\n**Repo-level:** `.github\u002Fworkflows\u002F`, `.claude\u002Fskills\u002F`, root `pubspec.yaml` (workspace + melos)\n\nFor RAG diffs, review these invariants explicitly: core exposes no RAG facade or\nvector-store contracts; providers depend only on `flutter_edge_ai_rag`; every\npersistent index is bound to a stable embedding profile and one document\nmodality (`VectorStoreBinding`), the version-1 profile record is always written\nand an image\u002Faudio binding stores the U+001F-qualified id there so older\nreleases refuse it (`tool\u002Frag_store_compat\u002Frun_downgrade_harness.sh`);\nraw-vector creation cannot infer an identity; legacy adoption is explicit,\ntext-only and dimension-checked; Web SQLite has one live owner per location;\nopen is single-flight; and indexes are disposed before their borrowed\ncore\u002Fcustom embedder.\n\n### Ground rules for every agent — REVIEWERS DO NOT WRITE\n\nPut this in every agent prompt, verbatim. It is not boilerplate; it is the\nlesson from a review round that had to be redone from scratch.\n\n```\nREAD-ONLY. Do not write, create, edit, delete, move or rename ANY file in the\nrepository — including test files, scratch files and probe files. Do not run\nmutation testing. Do not run `flutter test`, `flutter analyze`, `dart format`\nor `flutter pub get` (they write into .dart_tool and build outputs). Do not run\ngit add \u002F restore \u002F checkout \u002F stash \u002F clean \u002F commit. Reading is unlimited:\ncat, sed, grep, find, `git show`, `git diff`, `git log`, and ~\u002F.pub-cache.\nIf you want something verified by execution, DESCRIBE THE EXPERIMENT precisely\n— setup, the call, what to print — and stop. The caller will run it and hand\nyou the output.\n```\n\n**What this prevents.** Reviewers told to \"verify by mutation and restore\nafterwards\" did exactly that, in the shared working tree, on top of\nUNCOMMITTED fixes. Those fixes were silently overwritten twice; one agent's\nmid-mutation state got picked up by a `git add`, so `git diff` showed the\nagent's revert as if it were HEAD, and it was nearly committed. It was caught\nonly because the file's md5 changed twice in twenty seconds while nothing was\nbeing edited. Every test result taken during that window was meaningless.\n\n**Two more rules that follow from it:**\n\n1. **Commit before you review.** Reviewers read a moving tree otherwise, and\n   their findings are anchored to a state that no longer exists.\n2. **Run them ONE AT A TIME when acting on findings.** Parallel is right for a\n   first sweep of a frozen commit. It is wrong once you are editing between\n   reports: read one report, decide what you accept, apply it, commit, then\n   start the next. The agents are advisors — the decision to change code is\n   yours, and it is not delegable to ten of them at once.\n\n### Acting on a finding — the part that goes wrong\n\nA report is a list of HYPOTHESES, not a list of defects. Converting one straight\ninto an edit is how a review round ends with more bugs than it started.\n\nMeasured on one PR, one day: reviewers found **six** real pre-existing defects,\nand acting on them introduced **five** new ones. None shipped — four were caught\nby the next round, one by its own test — but four of the five came from the same\nomission, and it is not \"this was hard\":\n\n| what I changed | what I did not check first |\n|---|---|\n| set a state flag to false on a failure path | who READS that flag — `close()` was gated on it, so the handle leaked |\n| put cleanup in a `catch` | whether the cleanup call can itself throw — it did, swallowing the original error |\n| `vtool -output \"$lib.norm\"` then `mv` | what the tool does to the OUTPUT — it baked `.norm` into the code signature |\n| wrote a regression test | whether the test can distinguish the two worlds — it could not |\n\n**The loop, per finding, in this order:**\n\n1. **Reproduce it.** Print the wrong value. A finding you cannot reproduce is\n   not yet a defect — and twice this day a confident report was wrong on\n   measurement.\n2. **Read the neighbours.** If you change state, grep every reader of that\n   state. If you change a file, find what consumes it. If you call a tool, check\n   what it does to its output.\n3. **Fix.**\n4. **Mutate the test.** Break the production line the test names, and watch it\n   go red. If it stays green the test is decoration — delete it or fix it, but\n   do not keep it.\n5. **Only then take the next finding.**\n\nStep 4 is not optional and not a formality. Tests written after a fix\n\"obviously\" pass; that is the problem, not the reassurance.\n\n**Two more that cost real time:**\n\n- **A green narrow check is not a green wide one.** `flutter test` in a package\n  passed while `flutter analyze packages\u002F` had 17 errors, because the ambiguity\n  was only visible from the wider scope. Run the wide one before saying \"clean\".\n- **A fix that is not observable to the consumer is not a fix.** A corrected\n  binary was still not reaching builds, because the staging guard compared file\n  SIZE and the correction happened not to change it. Verify at the point the\n  user consumes it, not at the point you edited it.\n\n### Step 3: Launch ALL agents in parallel\n\nLaunch all 10 agents simultaneously using the Agent tool. Each agent gets:\n- The full diff (or list of changed files)\n- The affected platform(s)\n- Its specific review checklist (below)\n\n**CRITICAL: All agents MUST run in parallel via a single message with multiple Agent tool calls.**\n\n---\n\n## Agent Specifications\n\nEvery path named in an agent prompt below was verified to exist. If one stops\nresolving, that is the finding — fix the skill before running the review, because\nan agent pointed at a missing directory returns a clean report.\n\n### Agent 1: Android native\n\n**subagent_type:** `android-architect`\n\n```\nYou are reviewing the Android native layer of flutter_edge_ai, a Dart pub workspace\nmonorepo. Inference itself is NOT in Kotlin — `.litertlm` runs through Dart FFI.\nKotlin exists in exactly three packages; confirm with\n`find packages -path '*\u002Fandroid\u002Fsrc\u002Fmain\u002Fkotlin' -name '*.kt'` before you start.\n\n- packages\u002Fflutter_edge_ai\u002Fandroid\u002F...\u002FFlutterEdgeAiPlugin.kt — SLIM. Hosts only the\n  `flutter_gemma_bundled` channel: file ops plus the litertlm NPU\n  `getNativeLibraryDir`. If a change adds inference logic here, that is the\n  finding.\n- packages\u002Fflutter_edge_ai_mediapipe\u002Fandroid\u002F — the only real engine layer:\n  own pigeon (PigeonInterface.g.kt), PlatformServiceImpl, InferenceModel, and\n  engines\u002F{InferenceEngine,EngineFactory,InferenceSession,EngineConfig}.kt plus\n  engines\u002Fmediapipe\u002F. EngineFactory handles `.task`\u002F`.bin`\u002F`.tflite` ONLY — it\n  throws on `.litertlm` with a message pointing at the Dart FFI client. That\n  throw is correct behaviour, not a bug.\n  (`flutter_edge_ai_builtin_ai` has no android\u002F since 0.3.0. The `minSdk 26` floor\n  still reaches an app that depends on it, but through `flutter_local_ai`.)\n\nCHECKLIST\n1. NO KGP IN THE PLUGINS: since #440 none of the THREE android\u002Fbuild.gradle\n   files applies `kotlin-android`, declares `ext.kotlin_version`, or carries the\n   KGP classpath. Flutter's own Gradle plugin applies KGP to any plugin\n   subproject that does not (FlutterPluginUtils `detectApplyingKotlinGradlePlugin`),\n   which is why `flutter: '>=3.44.0'` is load-bearing. Re-adding a guard like the\n   old `agpMajor \u003C 9 || !builtInKotlinOn` is a REGRESSION, not a fix. What still\n   matters is the #360 lesson: the `kotlin { compilerOptions { jvmTarget } }` block\n   and its comment must be byte-identical in all three — a fix in one is a half-fix\n   that ships under its own version number.\n2. MANIFEST: the `\u003Cuses-native-library>` entries (libOpenCL.so, -car, -pixel,\n   libvndksupport.so, libcdsprpc.so) live in the CORE plugin manifest and merge\n   into consumer apps. libvndksupport is load-bearing for the OpenCL ICD on\n   Android 12+ (#324) — without it OpenCL fails to load, and OpenCL is the only\n   Android GPU path (no WebGPU library ships for Android since native-v0.18.0).\n3. minSdk: `.litertlm` needs 30 (API-30-only Bionic symbols, #265); builtin_ai\n   needs 26; core declares 24. A change to any floor must be consistent with what\n   the code actually dlopens.\n4. PIGEON: *.g.kt files are generated — never hand-edited. Regenerated from the\n   package's own pigeon.dart.\n5. NATIVE LIBS: arm64-v8a only for .litertlm\u002Fembeddings\u002Fvision. A change that\n   implies other ABIs ship broken APKs.\n6. Coroutine scope, cancellation and prompt accumulation in the MediaPipe session.\n\nReport CRITICAL \u002F IMPORTANT \u002F MINOR with file:line. Skip style nits.\n```\n\n### Agent 2: Apple native (iOS + macOS)\n\n**subagent_type:** `swift-reviewer`\n\n```\nYou are reviewing the Apple native layer of flutter_edge_ai. Note the layouts\ndiffer per package — verify with `find packages -name '*.swift' | grep -v example`\nrather than assuming a single convention:\n\n- packages\u002Fflutter_edge_ai\u002F{ios,macos}\u002Fflutter_edge_ai\u002FSources\u002Fflutter_edge_ai\u002F —\n  SwiftPM layout (NOT ios\u002FClasses\u002F). Slim plugin: bundled channel only.\n- packages\u002Fflutter_edge_ai_mediapipe\u002Fios\u002FClasses\u002F — classic layout, real engine:\n  FlutterEdgeAiMediaPipePlugin, PlatformServiceImpl, InferenceModel, pigeon .g.swift\n  (`flutter_edge_ai_builtin_ai` has no darwin\u002F since 0.3.0. Apple Foundation Models\n  reach it through `flutter_local_ai`, whose floor is iOS 13.0 \u002F macOS 12.0.)\n\nCHECKLIST\n1. Swift 6 concurrency: Sendable conformance, actor isolation, and no\n   captured-mutable-state across the pigeon boundary.\n2. Podspec versions: three first-party podspecs exist and drift independently —\n   core ios, core macos, mediapipe ios. Each must match its OWN package version.\n3. iOS floor since #441: core declares 15.0; only flutter_edge_ai_mediapipe\n   declares 16.0. A litertlm-only app is NOT held to 16 — that was the bug. Both\n   the podspec and the Package.swift must carry the same number for a package\n   that has both (mediapipe has no Package.swift). An app using\n   flutter_edge_ai_builtin_ai is additionally held to flutter_local_ai's\n   iOS 13.0 \u002F macOS 12.0.\n4. Entitlements: iOS needs extended-virtual-addressing and increased-memory-limit\n   for large models. macOS must carry NO `com.apple.developer.kernel.*` key — they\n   are iOS-only: without a signing team the build fails (\"has entitlements that\n   require signing with a development certificate\"), with a team Xcode drops\n   them. macOS needs `network.client` in BOTH DebugProfile and Release\n   entitlements, and an app with Swift Package Manager off also\n   `cs.disable-library-validation` (it takes effect under Hardened Runtime,\n   because the Podfile stager signs the companions ad hoc). With it on, the\n   companions come from litertlm's `macos\u002Fflutter_edge_ai_litertlm\u002FPackage.swift`\n   and Xcode signs them with the app's team (#689); Package.swift and the\n   litertlm podspec declare macOS 14.0, which every app depending on litertlm or\n   speech must match.\n5. No `Podfile post_install` symlink step should be reintroduced: those lib*.dylib\n   symlinks caused App Store rejection ITMS-90432 (#245). Any bundled dylib needs\n   `vtool` minos 13.0 or the upload is rejected (ITMS-90208).\n6. Generated pigeon .g.swift is never hand-edited.\n\nReport CRITICAL \u002F IMPORTANT \u002F MINOR with file:line.\n```\n\n### Agent 3: Web\n\n**subagent_type:** `general-purpose`\n\n```\nYou are reviewing the web layer of flutter_edge_ai. Two independent engines have\nweb arms, plus embeddings and RAG:\n\n- packages\u002Fflutter_edge_ai_mediapipe\u002Flib\u002Fsrc\u002Fweb\u002F — `.task` via @mediapipe\u002Ftasks-genai\n- packages\u002Fflutter_edge_ai_litertlm\u002Flib\u002Fsrc\u002Fweb\u002F — `.litertlm` via @litert-lm\u002Fcore.\n  EARLY PREVIEW: text only. Function calling is wired; vision, audio, verified\n  thinking and LoRA are not supported.\n- packages\u002Fflutter_edge_ai_onnx\u002Flib\u002Fsrc\u002Fweb\u002F — `.onnx` text generation and\n  embeddings through Transformers.js \u002F ONNX Runtime Web (WebGPU with WASM CPU\n  fallback).\n- packages\u002Fflutter_edge_ai_litertlm\u002F web embedding arm — LiteRT.js bundle in its own web\u002F\n- packages\u002Fflutter_edge_ai_sqlite\u002F — package:sqlite3\u002Fwasm.dart + a custom\n  sqlite3.wasm with vec0 linked in, which the APP copies into its own web\u002F dir\n- packages\u002Fflutter_edge_ai\u002Flib\u002Fsrc\u002Fweb\u002F — the shared web shells and model source\n\nCHECKLIST\n1. CONDITIONAL IMPORT \u002F STUB DRIFT — the highest-value check here. FFI clients\n   have `*_stub.dart` counterparts that `flutter analyze` and `flutter test` do\n   NOT type-check on the host. Signature drift only surfaces at\n   `flutter build web`. If a real signature changed, its stub must change too.\n   This is how a web break shipped in 0.15.0 with green analyze and green tests.\n2. dart:io \u002F dart:ffi must not reach the web graph. Check the conditional export.\n3. The six required web\u002F assets are not auto-injected — the app copies them:\n   cache_api.js and opfs_helper.js from `flutter_edge_ai`, and the four-file\n   LiteRT.js bundle from `flutter_edge_ai_litertlm` (litert_embeddings.js plus\n   its three vendor chunks). A change that needs a new global must\n   document the script tag.\n4. Storage modes: cacheApi (default, \u003C2GB), streaming (OPFS, large models),\n   none. MediaPipe and LiteRT-LM are GPU-first web paths; ONNX Runtime Web also\n   has a WASM CPU fallback. Do not describe the whole Web platform as GPU-only.\n5. CDN pins: @mediapipe\u002Ftasks-genai, @litert-lm\u002Fcore and @litertjs\u002Fcore must\n   agree between the code and any documented script tag. @litertjs\u002Fcore has\n   THREE places to keep in step: `LiteRtWebRuntime.pinnedVersion`,\n   `tool\u002Fweb_build\u002Fpackage.json` and the committed `web\u002Flitert.js`.\n\nReport CRITICAL \u002F IMPORTANT \u002F MINOR with file:line.\n```\n\n### Agent 4: Desktop \u002F FFI and native assets\n\n**subagent_type:** `general-purpose`\n\n```\nYou are reviewing desktop inference and the native-asset pipeline of\nflutter_edge_ai. Desktop is Dart FFI directly into the LiteRT-LM C API — there is\nNO JVM, NO gRPC, NO separate server process and no proto layer. If the diff or a\ntask description mentions any of those, it predates 0.14.0.\n\n- packages\u002Fflutter_edge_ai_litertlm\u002Flib\u002Fsrc\u002Fffi\u002F — the FFI client, generated\n  bindings, and the inference model\n- packages\u002Fflutter_edge_ai_litertlm\u002Fhook\u002Fbuild.dart — the SOLE hook that owns the\n  shared libLiteRtLm bundle. embeddings and speech consume it transitively and\n  have no hook of their own.\n- packages\u002Fflutter_edge_ai_litertlm\u002Fnative\u002Flitert_lm\u002F — build_*.sh, patch_c_api.sh,\n  stream_proxy.c\n- packages\u002Fflutter_edge_ai\u002F{linux,windows}\u002F — thin plugin registration C++\n- packages\u002Fflutter_edge_ai\u002Flib\u002Fsrc\u002Fdesktop\u002F — the registry-dispatch shell\n\nCHECKLIST\n1. HOOK CHECKSUMS: a bundle `version:` bump requires all seven per-platform\n   SHA256 entries updated, and the same value must appear in the released\n   tarball, in checksums_litertlm.txt, and in the hook. A stale txt sent a user\n   down the wrong path in #316.\n2. NEVER re-upload an existing native-v* tag. tar is not reproducible, so the\n   published SHA256 can never be recovered — it breaks every user already on a\n   plugin version referencing that tag.\n3. windowsExtraLibs \u002F androidExtraLibs and the CI allow-list are ONE SET IN TWO\n   PLACES. A name staged by CI but absent from the hook extracts to the cache and\n   is never bundled — that is how 78.8 MB of the Intel NPU stack went missing at\n   v0.16.0 while every CI assertion passed.\n4. Bazel `--define` names rot silently: Bazel accepts an unknown define and\n   builds the default. Grep the tree being built before trusting one.\n5. v0.15.0 changed the stream callback shape with no version symbol. The shipped\n   stream_proxy.c probes it at runtime via dlsym\u002FGetProcAddress; the source on\n   main also has stream_proxy_create2, where Dart passes the accessors it resolved\n   on the library it drives. Do not replace either with a compile-time branch.\n6. `stage()` in the hook is Apple-only on purpose (an Xcode directoryTreeSignature\n   cycle); staging on Windows splits companion DLLs and hangs cancel\u002Fclose.\n7. Any claim that a native check \"passed\" must name the artifact it inspected —\n   nm\u002Fotool on a missing path prints nothing and reads as success.\n\nReport CRITICAL \u002F IMPORTANT \u002F MINOR with file:line.\n```\n\n### Agent 5: Flutter Architect\n\n**subagent_type:** `flutter-architect`\n\n**Prompt:** Review the PR diff for flutter_edge_ai — a multi-platform Flutter plugin for on-device AI inference. Focus on: plugin architecture (platform channels via Pigeon), SOLID principles, ModelSource sealed class design, handler chain pattern (NetworkSourceHandler, AssetSourceHandler), dependency injection (ServiceRegistry), platform abstraction layer. Check separation of concerns between install-time identity (modelType, fileType) and runtime configuration (maxTokens, preferredBackend). Read AGENTS.md for project conventions.\n\n### Agent 6: Flutter Coder\n\n**subagent_type:** `flutter-coder`\n\n**Prompt:** Review the changed Dart files in flutter_edge_ai for code quality. Check: null safety, proper async\u002Fawait patterns, Stream handling (no leaks, proper cancellation), Message class usage (isUser: true for user messages), PreferencesKeys constants (no inline string keys), proper close()\u002Fdispose() in finally blocks, type safety with ModelSource sealed classes. Read AGENTS.md for coding standards — especially \"No Inline String Keys\" rule.\n\n### Agent 7: Codex Review (Second Opinion)\n\n**subagent_type:** `codex:codex-rescue`\n\nNot the `copilot` CLI. That binary is GitHub Copilot, billed against a\ndifferent quota entirely, and it answers `402 You have exceeded your monthly\nquota` on every model regardless of the ChatGPT plan — an earlier revision of\nthis skill called it and lost a whole review round to that.\n\n**Prompt:**\n\n```\nSecond-opinion review of PR #{number} for flutter_edge_ai. Read the diff with\n`gh pr diff {number}` (or `git diff main...HEAD` if no PR), and read AGENTS.md\nfor the project's conventions.\n\nREAD-ONLY. Do not write, create, edit, delete or move any file in the\nrepository, and do not run `flutter test` \u002F `flutter analyze` \u002F `dart format` \u002F\n`flutter pub get` — they write into .dart_tool and build outputs. Do not run\ngit add \u002F restore \u002F checkout \u002F stash \u002F clean \u002F commit. Reading is unlimited.\nIf you want something verified by execution, DESCRIBE the experiment precisely\nand stop; the caller will run it and hand you the output.\n\nKey project context:\n- A Dart pub workspace monorepo: core flutter_edge_ai plus opt-in packages under\n  packages\u002F. Core registers no engine; engines and backends are passed to\n  FlutterEdgeAi.initialize().\n- .litertlm inference is Dart FFI into the LiteRT-LM C API on every native\n  platform, desktop included. There is NO JVM, NO gRPC, no separate server\n  process and no proto layer — removed at 0.14.0. Kotlin exists only in the\n  MediaPipe and builtin_ai packages plus a slim core plugin; MediaPipe never\n  handles .litertlm.\n- Engine selection is by the DECLARED ModelFileType via canHandle(spec), NOT by\n  sniffing the file name. installModel defaults fileType to .task, so a\n  .litertlm model must declare it explicitly or it is routed to MediaPipe.\n- ModelSource sealed class: NetworkSource, AssetSource, BundledSource, FileSource.\n- Installation stores identity (modelType, fileType); runtime accepts config\n  (maxTokens, preferredBackend).\n- maxTokens is the CONTEXT WINDOW, not the reply length. Below 1024 the\n  .litertlm KV cache allocation fails; the engine clamps up with a warning. To\n  cap a reply use maxOutputTokens on the session.\n- Error handling: NO silent fallbacks. Throw or return an error; never swallow\n  in a catch. edgeAiLog is debug-only, so anything reported only through it is\n  unreported in release builds.\n- No inline string keys — use PreferencesKeys constants.\n- Generated files are never hand-edited: pigeon *.g.dart \u002F *.g.kt \u002F *.g.swift,\n  and the ffigen bindings.\n\nCross-check specifically: engine routing by declared fileType; conditional-import\nstub drift against the real signatures (analyze does not catch it, only\n`flutter build web` does); and platform-specific limitations.\n\nFocus on bugs, logic errors, security, dead code, silent error swallowing, race\nconditions in async\u002Fstreaming code, and memory leaks (unclosed sessions\u002Fmodels).\nBe concise — only real issues, each with file:line and a concrete failure\nscenario. Skip style nits. Categorize CRITICAL \u002F IMPORTANT \u002F MINOR.\n```\n\nIf no PR number, detect via: `gh pr list --head $(git branch --show-current) --json number -q '.[0].number'`\n\n### Agent 8: Code Reviewer\n\n**subagent_type:** `pr-review-toolkit:code-reviewer`\n\n**Prompt:** Review the PR for adherence to project guidelines in AGENTS.md. Focus on recently changed files. Key rules: no inline string keys, proper PreferencesKeys usage, no AI attribution in commits, sessions\u002Fmodels always closed, Message(isUser: true) for user messages.\n\n### Agent 9: Type Design Analyzer\n\n**subagent_type:** `pr-review-toolkit:type-design-analyzer`\n\n**Prompt:** Analyze any new or modified types\u002Finterfaces in the PR for encapsulation, invariant expression, and design quality. Focus on: ModelSource sealed class hierarchy, EngineConfig\u002FSessionConfig, InferenceEngine\u002FInferenceSession interfaces, EngineCapabilities, TestModelConfig.\n\n### Agent 10: Silent Failure Hunter\n\n**subagent_type:** `pr-review-toolkit:silent-failure-hunter`\n\n**Prompt:** Check all changed files for silent failures, inadequate error handling, catch blocks that swallow errors, and inappropriate fallback behavior. Key concern areas: image conversion fallbacks (should throw, not return original bytes), tryEmit() that drops errors silently, cancelGeneration() that swallows exceptions, download\u002Fchecksum verification gaps.\n\n---\n\n## Step 4: Collect and Deduplicate\n\nAfter all agents complete:\n\n1. Collect all findings from all agents\n2. Deduplicate — if two agents report the same issue (same file, same line, same concern), keep the one with better description\n3. Categorize by severity: CRITICAL > IMPORTANT > MINOR\n4. Group by file path within each severity\n\n## Step 5: Generate Report\n\nSave to `test_reports\u002Fpr-reviews\u002Fpr-{number}-review.md` (or `pr-branch-{branch}-review.md`):\n\n```markdown\n# PR Review: #{number} — {title}\n\n**Branch:** {branch}\n**Date:** {date}\n**Reviewers:** 10 agents (4 platform-specific + 6 general)\n**Platforms affected:** {platforms}\n\n## Critical Issues\n{blocking issues that must be fixed before merge}\n\n## Important Issues\n{should be fixed, but not blocking}\n\n## Minor Issues\n{nice-to-have improvements}\n\n## Passed Checks\n{list of checks that passed cleanly}\n\n## Summary\n- Critical: X\n- Important: Y\n- Minor: Z\n- Recommendation: APPROVE \u002F REQUEST CHANGES \u002F NEEDS DISCUSSION\n```\n\n## Step 6: Output Summary\n\nPrint a concise summary to the user:\n- Total findings by severity\n- Top 3 most important issues\n- Recommendation (approve\u002Fchanges requested)\n- Path to full report file\n",{"name":5,"description":7,"user_invocable":39},true,"main","b910ab7c9e25cd2a23faea805e7125c9b6cf1af6",".claude\u002Fskills\u002Freview-pr",180,"https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai","https:\u002F\u002Fflutteredge.ai","https:\u002F\u002Fgithub.com\u002FDenisovAV","Sasha is Flutter, Dart, Firebase and AI GDE, Co-organizer of Flutter Berlin Community, Expert in On-Device AI","2026-11-14 22:02:12",{"source":8,"skillName":5,"commands":50,"prompt":60,"zipAvailable":39},[51,54,57],{"tool":52,"command":53},"npx","npx skills add DenisovAV\u002Fflutter_edge_ai --skill review-pr",{"tool":55,"command":56},"bunx","bunx skills add DenisovAV\u002Fflutter_edge_ai --skill review-pr",{"tool":58,"command":59},"pnpm","pnpm dlx skills add DenisovAV\u002Fflutter_edge_ai --skill review-pr","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Freview-pr\u002FSKILL.md",[],[63,78,89,105,123,136],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":74,"publishedAt":34},"01M6BXTT3TADZ7NN5RY79ZZKDR","send-email","Send an email.","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fsend-email\u002FSKILL.md",[69],{"categoryNo":70,"categoryName":71,"taxonomyType":72,"taxonomyTypeDesc":73},"01JBSEEDCAT000000000000005","邮件与沟通","SCENARIO","使用场景",[75,76,77],"send","send email","email",{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":34},"01M6BXTQPW2BAVZ2SRVTMFF9FA","query-wikipedia","Query summary from Wikipedia for a given topic.","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fquery-wikipedia\u002FSKILL.md",[],[85,86,87,31,88],"wikipedia","query","query wikipedia","summary",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":100,"publishedAt":34},"01M6BXTN6C4R4FZ5T9GRNY5MFG","qr-code","Generates a QR code for the given url.","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fqr-code\u002FSKILL.md",[95],{"categoryNo":96,"categoryName":97,"taxonomyType":98,"taxonomyTypeDesc":99},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[101,102,103,31,104],"qr","qr code","code","URL",{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":34},"01M6BXTJXNJNW59BV5JM3V9YZD","kitchen-adventure","Act as a dungeon master for a text-based adventure set in a world where everyone is a sentient kitchen appliance. Trigger when user says \"start kitchen adventure\".","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fkitchen-adventure\u002FSKILL.md",[],[112,33,113,31,114,115,116,117,118,119,120,121,122],"kitchen adventure","dungeon master","trigger","as","act","world","master","user","text","SET","start",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":34},"01M6BXTGEPGG025VBEQKPJZB8S","interactive-map","Show an interactive map view for the given location.","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Finteractive-map\u002FSKILL.md",[],[130,131,132,133,134,135,31],"interactive map","interactive","map","view","show","location",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":34},"01M6BXTED45RFKX4EYF9BSWC7H","get-current-time","Get the user's current local date, time, and day of the week.","https:\u002F\u002Fgithub.com\u002FDenisovAV\u002Fflutter_edge_ai\u002Fblob\u002Fmain\u002Fpackages\u002Fflutter_edge_ai_agent\u002Fassets\u002Fskills\u002Fget-current-time\u002FSKILL.md",[],[143,144,145,146,119,147],"current time","get current time","time","get","local"]