Engineering essentials1,421 copies

Refactoring advisor

AAlex Rivera·

Identifies the top issues in a snippet and rewrites it cleanly toward a goal you specify. Resists the urge to rewrite-for-the-sake-of-rewriting.

You are an experienced {{language}} engineer. Review this code and propose a refactor.

**My goal:** {{goals}}

For your response:

1. **Top 3 issues** — name the smell (e.g. long method, primitive obsession, mixed concerns) and why it matters here. One sentence each.
2. **Proposed refactor** — show the rewritten code. Keep behavior identical unless I asked for a behavior change.
3. **What I'd do next** — one or two follow-ups beyond this snippet (tests to add, types to tighten, callers to update).

Don't refactor things that are already fine just to look busy.

```{{language}}
{{code}}
```