flutter-ui-performance-engineering
Skill8 starsChanged 48 days agoMITView on GitHub
Diagnose, optimize, review, and validate Flutter UI smoothness across Android, iOS, Web, and desktop. Use when a task involves dropped or slow frames, bad frame pacing, input latency, scrolling or list lag, route or animation hitching, excessive rebuild/layout/paint/raster work, CustomPainter, blur/clipping/opacity/shadows, platform-view composition, oversized UI images, keyboard or resize jank, low-end device tuning, 90/120/144 Hz readiness, or a Flutter UI performance audit. Prefer this skill for end-to-end frame-pipeline and rendering work. Do not use for a memory leak with no UI symptom, image handling with no measured frame impact, isolate architecture with no UI bottleneck, or package-specific tuning when a dedicated skill covers it.
In this repository70 other files it gives its agents.
- camerawesome-flutterSkill
- dart-args-production-cliSkill
- dart-flutter-equatable-engineeringSkill
- dart-flutter-ffi-systems-engineeringSkill
- dart-metaSkill
- document-camera-frameSkill
- document-scan-flutterSkill
- figma-to-flutter-expertSkill
- flutter-animations-production-engineeringSkill
- flutter-app-hardening-reverse-engineeringSkill
- flutter-app-icon-engineeringSkill
- flutter-application-security-engineeringSkill
- flutter-app-links-deep-link-engineeringSkill
- flutter-cachingSkill
- flutter-concurrency-memory-performanceSkill
- flutter-confetti-engineeringSkill
- flutter-dart-package-engineeringSkill
- flutter-design-system-from-design-mdSkill
- flutter-dio-cache-interceptor-engineeringSkill
- flutter-dio-engineeringSkill
- flutter-doc-scannerSkill
- flutter-drift-persistence-engineeringSkill
- flutter-expert-tipsSkill
- flutter-firebase-analyticsSkill
- flutter-firebase-core-engineeringSkill
- flutter-firebase-messagingSkill
- flutter-get-it-injectable-dependency-injectionSkill
- flutter-go-router-engineeringSkill
- flutter-hive-persistence-engineeringSkill
- flutter-image-performanceSkill
- flutter-image-picker-production-engineeringSkill
- flutter-lints-static-analysis-engineeringSkill
- flutter-local-notifications-production-engineeringSkill
- flutter-memory-leak-engineeringSkill
- flutter-mobile-developmentSkill
- flutter-motion-engineeringSkill
- flutter-multi-environmentSkill
- flutter-native-splash-engineeringSkill
- flutter-package-plugin-selectionSkill
- flutter-path-provider-production-storageSkill
- flutter-performance-jank-optimizationSkill
- flutter-permission-handler-engineeringSkill
- flutter-pinputSkill
- flutter-production-build-releaseSkill
- flutter-production-engineeringSkill
- flutter-production-loggingSkill
- flutter-pro-image-editor-engineeringSkill
- flutter-secure-storage-security-engineeringSkill
- flutter-sentry-engineeringSkill
- flutter-share-plus-engineeringSkill
- flutter-skeletonizer-engineeringSkill
- flutter-squadron-concurrency-engineeringSkill
- flutter-supabase-engineeringSkill
- flutter-svg-engineeringSkill
- flutter-url-launcher-engineeringSkill
- flutter-video-player-production-engineeringSkill
- flutter-webview-production-engineeringSkill
- freezed-production-engineeringSkill
- html-to-flutterSkill
- hydrated-blocSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 11 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Before advising or editing, inspect:
- Distinctive: line 44
Run native targets in profile mode on physical hardware.
- Very specific: line 53
Use build/layout/paint tracing, repaint rainbow, layer disabling, CPU profiling, or memory tooling only to test a specific hypothesis.
- Distinctive: line 57
Keep the change only when the target metric materially improves without a correctness, accessibility, memory, thermal, or maintenance …
- Distinctive: line 60
Never use debug-mode timing, average FPS, one lucky run, an emulator alone, or rebuild count alone as production evidence.
- Very specific: line 75
Use 1000 / refreshRateHz as the approximate cadence interval.
- Very specific: line 80
Keep network, database, parsing, sorting, and other significant work out of build() and frame-critical callbacks.
- Very specific: line 85
Use lazy builders for large collections.
- Distinctive: line 87
Use known item extents only when they are actually correct.
- Very specific: line 90
Add RepaintBoundary only after repaint evidence and verify raster/memory impact.
- Distinctive: line 94
Prefer transform- or paint-driven motion over repeated layout when the visual result and semantics allow it.
- Distinctive: line 96
Stop or mute invisible continuous animations and respect reduced motion.
- Distinctive: line 101
Do not recommend obsolete SkSL bundling or assume Impeller fixes arbitrary build, layout, paint, image, or composition work.
- Distinctive: line 103
Never disable semantics, text scaling, reduced-motion handling, hit testing, or correctness as a performance shortcut.
- Very specific: line 108
Read only the sections needed from references/production-guide.md.
- Distinctive: line 149
If no trace or reproducible artifact exists, label the diagnosis as a hypothesis and request or define the smallest measurement that can …
- Distinctive: line 154
Run the narrowest relevant formatting, analysis, and tests, then repeat the representative performance scenario.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter UI Performance Engineering
Optimize the dominant measured work, not performance folklore. Preserve correctness, accessibility, visual intent, bounded memory, battery life, and maintainability.
Establish the runtime
Before advising or editing, inspect:
flutter --version
dart --version
pubspec.yaml and pubspec.lock
target platforms and minimum OS/browser versions
renderer/backend and platform views
target device tiers and refresh rates
existing performance tests, traces, and telemetryThe bundled guide was validated on 2026-08-11 against Flutter documentation in the Flutter 3.44.7 line and Dart 3.12.x. Treat scroll APIs, text scaling, Impeller, Web renderers/concurrency, platform views, DevTools, and image-cache defaults as version-sensitive. Prefer the installed SDK and package source when they differ.
Use the evidence loop
Follow this order:
reproduce → define metric → profile representative hardware
→ classify slow stage → identify dominant mechanism
→ make one bounded change → repeat identical trace
→ validate sustained load and release behavior- Translate the complaint into a repeatable scenario and target metric.
- Run native targets in profile mode on physical hardware; use a profile Web build plus browser performance tooling for Web.
- Record the device, OS/browser, build mode, renderer, refresh cadence, data size, cache/network state, and interaction path.
- Capture a baseline with p90, p99, worst frames, and slow-frame count. Include memory or input-to-display latency only when relevant.
- Select slow frames and separate UI/build/layout/CPU time from raster/GPU
time. Inspect
FrameTiming.totalSpanwhen both bars look healthy but input still feels late. - Use build/layout/paint tracing, repaint rainbow, layer disabling, CPU profiling, or memory tooling only to test a specific hypothesis; disable extra instrumentation for the final comparison.
- Change the largest contributor first, then repeat the same trace.
- Keep the change only when the target metric materially improves without a correctness, accessibility, memory, thermal, or maintenance regression.
Never use debug-mode timing, average FPS, one lucky run, an emulator alone, or rebuild count alone as production evidence.
Classify before changing code
| Evidence | Investigate first |
| UI time over budget | synchronous Dart, broad invalidation, expensive build, intrinsic/repeated layout, collection work, text layout, allocation/GC |
| Raster time over budget | oversized images, blur/filter/saveLayer, opacity, clipping, shadows, paths, overdraw, large repaint regions, platform views |
| Both over budget | the larger stage first, unless one mechanism clearly feeds both |
| Both within budget but input is late | totalSpan, event-loop stalls, native/plugin calls, event batching |
| Hitch as new rows appear | lazy construction, row layout, decode/upload, cache policy |
| Degrades during a long session | retained resources, image cache, allocation rate, GC, hidden animations |
| 60 Hz passes but 120 Hz fails | the actual ~8.33 ms cadence and target hardware |
Use 1000 / refreshRateHz as the approximate cadence interval. Do not treat
16 ms as universal, and do not simply add pipelined UI and raster durations.
Preserve these invariants
- Keep network, database, parsing, sorting, and other significant work out of
build()and frame-critical callbacks. - Remember that
async/awaitdoes not move CPU work off the main isolate. - Scope state invalidation to the state that changed, but do not contort code to eliminate cheap rebuilds.
- Use lazy builders for large collections; review large
shrinkWrapscrollables, intrinsic layout, nested scrolling, eager children, and unbounded keep-alive. - Use known item extents only when they are actually correct.
- Decode images near their rendered size where supported; keep precache and cache growth bounded.
- Add
RepaintBoundaryonly after repaint evidence and verify raster/memory impact; never blanket-wrap the tree. - Bound blur, clipping, shadows, alpha layers, complex paths, and animated paint area by their measured visual value.
- Prefer transform- or paint-driven motion over repeated layout when the visual result and semantics allow it.
- Stop or mute invisible continuous animations and respect reduced motion.
- Dispose controllers, listeners, subscriptions, overlays, and other owned UI resources at the correct lifecycle boundary.
- Move genuinely heavy CPU work to an isolate only when saved main-isolate time exceeds spawn, transfer, and coordination cost. Revalidate Web support.
- Do not recommend obsolete SkSL bundling or assume Impeller fixes arbitrary build, layout, paint, image, or composition work.
- Never disable semantics, text scaling, reduced-motion handling, hit testing, or correctness as a performance shortcut.
Route to the production guide
Read only the sections needed from references/production-guide.md. Locate
them before loading long ranges:
rg -n '^#{1,3} (SEARCH HEADING)$' references/production-guide.md| Task | Search headings | ||||||||||
| Establish frame model and budgets | `Flutter Frame Pipeline | Frame Budgets | Refresh Rate | Frame-Time Targets | Frame Pacing vs FPS | Production Frame Metrics | Jank Classification` | ||||
| Profile and instrument | `Required Performance Decision Tree | Profiling Workflow — HIGH PRIORITY | Performance Instrumentation | FrameTiming` | |||||||
| Reduce build/state work | `Build Optimization | setState | State Management | Selectors / Granular Subscriptions | const | Widgets vs Helper Functions | Keys | MediaQuery Granularity` | |||
| Reduce layout and scrolling work | `Layout Optimization | Intrinsic Layout | shrinkWrap | Nested Scroll Anti-Pattern | Scrolling — HIGH PRIORITY | Lazy Lists | itemExtent | scrollCacheExtent | KeepAlive | Slivers | Pagination` |
| Reduce paint/raster work | `Paint Optimization | RepaintBoundary | saveLayer | Opacity | Clipping | Blur — HIGH PRIORITY | Shadows and Elevation | CustomPainter | Canvas Hot Paths | GPU Overdraw` | |
| Tune animation and routes | `Animation Performance | AnimationController Lifecycle | TickerMode | Transform vs Layout Animation | AnimatedBuilder / ListenableBuilder | Infinite Animations | Route Transitions | Hero` | |||
| Diagnose images, text, or CPU | `Images — HIGH PRIORITY | Oversized Image Problem | Image Cache Tuning | Text Performance | CPU Work on the Main Isolate | Isolates | Garbage Collection and Allocation` | ||||
| Diagnose lifecycle/input/native composition | `Memory and Long-Session Jank | Resource Lifecycle | Input and Gesture Performance | Keyboard Opening | Platform Channels | Platform Views — HIGH PRIORITY` | |||||
| Handle a specific platform/runtime | `Impeller | Web Performance | Android Performance | iOS Performance | Desktop Performance | High Refresh Rate | Low-End Device Strategy | Adaptive Quality` | |||
| Audit, review, or verify a release | `Performance Rules — HIGH PRIORITY | Anti-Patterns | Optimization Priority Ladder | 120 Hz Readiness Checklist | UI Performance Audit Checklist | Code Review Checklist | Production Readiness Checklist | Version-Sensitive Areas` |
For a broad audit, read the guide's principles, decision tree, profiling workflow, optimization priority ladder, relevant platform section, audit checklist, and version-sensitive areas. Read the entire guide only when the request genuinely spans the whole UI pipeline.
Fix the shared cause
Trace every caller and owner of the expensive path before editing. Prefer one fix at the lifecycle, state, data, layout, or paint boundary shared by all affected callers over guards in individual widgets. Reuse the project's state, rendering, image, and lifecycle patterns. Do not switch state-management packages, add a global performance abstraction, or introduce a dependency without measured necessity.
Report each recommendation as:
evidence → bottleneck stage → mechanism → smallest change
→ expected metric → verification scenario → tradeoffIf no trace or reproducible artifact exists, label the diagnosis as a hypothesis and request or define the smallest measurement that can confirm it.
Validate the result
Run the narrowest relevant formatting, analysis, and tests, then repeat the representative performance scenario. Cover the affected paths:
- first and repeated interactions;
- sustained scrolling/animation and route cycles;
- keyboard, resize, rotation, background/resume, or platform views when used;
- realistic data and images;
- lowest supported hardware tier;
- target 90/120/144 Hz hardware where promised;
- reduced motion and text scaling;
- memory stability and idle frame scheduling for long-lived UI;
- release build behavior after profile-mode diagnosis.
State which devices, browsers, build modes, and traces were not validated. Do not claim a performance improvement from static analysis or code shape alone.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

