Refactor Away from an Anti-Pattern
2 fill-in slots · from The AI Prompt Handbook for Mobile App Development
Your details
0/2 filledRefactor Away from an Anti-Pattern
Background: Native [platform] app, [SwiftUI+Combine / Compose]. I think this code has slid into an anti-pattern. Here it is: [paste the offending file(s)—e.g., a massive view model, a god singleton, callback nesting, or a view stuffed with business logic] Use case: Confirm what's wrong and walk me out of it incrementally, without a risky big-bang rewrite. Implementation details: Identify the specific anti-pattern (massive view model / god object, singleton overuse, callback hell, logic in the view, feature envy). Explain the concrete harm it causes on mobile (testability, leaks, recomposition/redraw cost). Then propose a target design using the right pattern from this chapter. Layer & dependencies: Keep each refactor step shippable—the app must compile and pass tests after every step. Deliverable: The diagnosis, the target design, and a numbered, small-step refactor plan (each step independently safe), with the before/after of the first step shown in full.
Highlighted [slots] are still empty. Downloads are plain .txt — paste into any AI assistant.