The agent starts from the reported symptom, such as slow first render, scrolling jank, excess recomposition, input lag, animation stutter, memory churn or battery and CPU pressure, and inspects the smallest relevant surface first: a screen composable, state holder, list item, animation or custom layout. It keeps measured problems apart from theoretical risks and prefers evidence from traces, compiler reports, the layout inspector, recomposition counts, macrobenchmarks or profiler captures. Fixes should be minimal, keep behavior and fit the project's architecture, and the answer ends with commands or manual checks that prove the improvement.
The workflow locates the hot path, looking for state reads that invalidate wide parts of the tree and expensive work in composition, layout, draw or effects. It then audits recomposition scope, moving volatile reads lower and using `derivedStateOf` only where it really reduces work, and checks stability: mutable collections, unstable data classes, changing lambdas and premature `@Stable` or `@Immutable` annotations that can leave the UI stale. For lazy layouts it looks at stable keys, `contentType` and per-item allocations. The excerpt ends partway through that section.