# Flutter Optimize Codebase

> Optimizes a Flutter codebase for performance, maintainability, architecture quality, and release readiness using a prioritized, evidence-driven improvement plan.

- **Type:** Skill
- **Install:** `agentstack add skill-mdazadhossain95-flutter-agent-skills-flutter-optimize-codebase`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [mdazadhossain95](https://agentstack.voostack.com/s/mdazadhossain95)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [mdazadhossain95](https://github.com/mdazadhossain95)
- **Source:** https://github.com/mdazadhossain95/flutter-agent-skills/tree/main/skills/flutter-optimize-codebase

## Install

```sh
agentstack add skill-mdazadhossain95-flutter-agent-skills-flutter-optimize-codebase
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Optimize Flutter Codebase

## Purpose
Use this skill to audit and improve an existing Flutter codebase with practical, high-impact optimizations.

## Activation
Activate when user asks to optimize, improve, harden, refactor, or speed up a Flutter app or a specific module.

## Input Collection
Capture minimum context first:
- Scope: whole app, feature folder, or specific files.
- Target: performance, architecture, code quality, app size, stability, testability, or all.
- Optimization mode: quick, standard, deep.
- Risk tolerance: low-risk only or allow medium refactors.

If scope is missing, default to project-level scan.

## Optimization Modes
- Quick mode: fast audit + top 5 improvements.
- Standard mode: prioritized plan + key code changes.
- Deep mode: broader refactor roadmap with staged implementation plan.

## Optimization Workflow
Follow this order:

1) Baseline and hotspots
- Map project structure and critical execution paths.
- Identify hotspots in startup path, navigation, rendering-heavy screens,
  network/data pipeline, and state updates.

2) Architecture and boundaries
- Check separation of presentation, logic, and data layers.
- Detect coupling, duplicated logic, and module boundary leaks.
- Recommend consolidation where appropriate.

3) State management efficiency
- Identify excessive rebuild patterns and state over-scoping.
- Ensure state ownership is close to consumers where possible.
- Recommend selector/listener granularity improvements.

4) Rendering and UI performance
- Look for expensive build methods and unnecessary widget rebuilds.
- Prefer const constructors where safe.
- Suggest list virtualization patterns and image handling improvements.

5) Network, caching, and persistence
- Evaluate API call strategy, retry behavior, and error handling.
- Recommend caching and offline-first patterns where relevant.
- Validate model parsing path and background processing suitability.

6) Reliability and error handling
- Identify weak async error handling and null-safety risks.
- Ensure domain-level error mapping and user-safe fallbacks.

7) App size and release readiness
- Recommend app-size analysis and dependency pruning.
- Flag large assets, redundant packages, and avoidable transitive bloat.

8) Testing and maintainability
- Detect missing tests in critical modules.
- Recommend minimum unit/widget/integration coverage targets by risk.

## Output Format
Return in this structure:

1. Optimization Scope and Mode
2. Findings (ordered by impact)
3. Recommended Changes (ordered by effort and risk)
4. Quick Wins (can do now)
5. Medium Refactors (next)
6. Validation Checklist (how to verify improvements)
7. Optional Next Iteration Plan

## Behavior Rules
- Prioritize evidence-backed findings from actual code.
- Avoid vague suggestions not tied to observed patterns.
- For each recommendation, include expected impact and risk level.
- Prefer incremental changes before large rewrites.
- Keep business behavior unchanged unless user explicitly asks otherwise.

## Risk Labels
Use these labels for each recommendation:
- Low: safe local changes, minimal regression risk.
- Medium: structural changes with moderate validation required.
- High: broad refactors requiring staged rollout and tests.

## Validation Checklist
Before final response, ensure:
- Findings are prioritized by impact.
- Each recommendation has risk label and expected result.
- Suggested changes are scoped to user-selected area.
- A practical verify plan is included (tests, profiling, runtime checks).

## Completion Template
Use this response layout:
1. Scope: 
2. Mode: 
3. Top Findings: 
4. Recommended Changes: 
5. Verification Steps: 
6. Next Iteration:

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [mdazadhossain95](https://github.com/mdazadhossain95)
- **Source:** [mdazadhossain95/flutter-agent-skills](https://github.com/mdazadhossain95/flutter-agent-skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-mdazadhossain95-flutter-agent-skills-flutter-optimize-codebase
- Seller: https://agentstack.voostack.com/s/mdazadhossain95
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
