dart-memory
Manage memory efficiently in Dart and Flutter apps to prevent leaks and reduce GC pressure. Use when disposing resources, handling large assets, optimizing image caching, or profiling allocation patterns.
Works with
--- name: dart-memory description: Manage memory efficiently in Dart and Flutter apps to prevent leaks and reduce GC pressure. Use when disposing resources, handling large assets, optimizing image caching, or profiling allocation patterns. license: MIT --- # Memory Management Mobile devices have limited RAM. Efficient memory management is critical to prevent crashes and ensure a smooth user experience. ## Resource Lifecycle - **Explicit Disposal**: Always close `StreamController`, `Timer`, `FocusNode`, and `ChangeNotifier` in the `dispose()` method. - **Late Initialization**: Use `late` to delay object creation until it's actually needed, reducing initial memory footprint. ## Garbage Collection (GC) Pressure - **Generational GC**: Dart's GC is optimized for short-lived objects. However, creating thousands of objects in a single frame can still cause jank. - **Object Re-use**: Avoid creating new objects in `build()` or high-frequency loops. Reuse data structures where possible. - **Large Collections**: Clearing a large list (`list.clear()`) is better than re-assigning it to a new list if the list itself is long-lived. ## Mobile Specifics - **Isolates**: Use `Isolate.run()` for heavy computations (JSON parsing > 1MB, image processing). This keeps the main thread free and prevents UI freezes. - **Image Memory**: Use `cacheWidth` and `cacheHeight` in `Image.network` or `Image.asset` to avoid loading high-resolution images into memory at full size. - **Memory Leaks**: Use the DevTools Memory View to identify "leaking" objects that stay in the heap after their context (like a screen) is closed. ## Large Data Handling - **Pagination**: Never load entire datasets into memory. Use server-side or local database pagination (Isar, SQLite). - **Streaming**: For large files or real-time data, use `Stream` to process data in chunks rather than buffering the entire content in memory.
More Performance skills
seo-audit
coreyhaines31/marketingskills
When the user wants to audit, review, or diagnose SEO issues on their site. Also use when the user mentions "SEO audit," "technical SEO," "why am I not ranking," "SEO issues," "on-page SEO," "meta tags review," "SEO health check," "my traffic dropped," "lost rankings," "not showing up in Google," "site isn't ranking," "Google update hit me," "page speed," "core web vitals," "crawl errors," or "indexing issues." Use this even if the user just says something vague like "my SEO is bad" or "help with SEO" — start with an audit. For building pages at scale to target keywords, see programmatic-seo. For adding structured data, see schema. For AI search optimization, see ai-seo.
competitor-profiling
coreyhaines31/marketingskills
When the user wants to research, profile, or analyze competitors from their URLs. Also use when the user mentions 'competitor profile,' 'competitor research,' 'competitor analysis,' 'profile this competitor,' 'analyze competitor,' 'competitive intelligence,' 'competitor deep dive,' 'who are my competitors,' 'competitor landscape,' 'competitor dossier,' 'competitive audit,' or 'research these competitors.' Input is a list of competitor URLs. Output is structured competitor profile markdown files. For creating comparison/alternative pages from profiles, see competitors. For sales-specific battle cards, see sales-enablement.
vercel-optimize
vercel-labs/agent-skills
Use for Vercel cost and performance optimization on deployed projects, especially Next.js, SvelteKit, Nuxt, and limited Astro apps. Collect Vercel metrics, usage, project config, and code scan results first; investigate only metric-backed candidates; produce ranked recommendations grounded in verified files and version-aware Vercel/framework docs. Trigger for Vercel bill reduction, slow or expensive routes, caching opportunities, Function Invocations, Build Minutes, Fast Data Transfer, Core Web Vitals, Bot Management, Fluid compute, or cost breakdown requests.

