Before you read a line

Ask what the generated block is supposed to do, where its boundaries are, and what would count as failure. If those answers are vague, the review will be vague too.

  • Which files were generated, and which were edited by hand?
  • What does the feature promise the user?
  • Which external services does it touch?
  • What test would fail if the error path were wrong?

The checklist

1. Error paths

Read every catch, fallback and default return. Does the user learn that something failed? Does the caller get a usable signal? Is a retry safe? An empty catch is a decision to hide information; make sure that decision was intentional.

2. Boundaries and permissions

Who can call this function or endpoint? Is authorization enforced where the data lives, or only in the UI? Generated code often assumes the caller is allowed because the screen only shows the feature to allowed users.

3. Input validation

Where does untrusted data enter? Is it validated at the boundary? Does a missing field produce a clear error or a confusing downstream failure? Check the type at the edge — any there is a promise the code cannot keep.

4. External calls

Timeouts, retries, idempotency and rate limits. A generated request often has none of these. Ask what happens on a slow network, a duplicate submission or a provider outage.

5. Data consistency

If two writes must succeed together, are they in a transaction? If a retry can repeat a side effect, is there an idempotency key? This is where plausible code becomes expensive.

6. Secrets and configuration

Search for keys, tokens, localhost URLs, test domains and placeholder values. Check whether environment fallbacks quietly use a committed default.

7. Dependencies

Did the generated code introduce a package? Is it maintained, pinned and actually necessary? A small helper can be cheaper than a new transitive tree.

8. Logging and privacy

What is logged? Does an error message include a token, an email address or a full request body? Debug output is useful in development and a liability in production.

Read the failure path first.

Happy paths are usually reviewed by using the product. Failure paths are reviewed by reading the code.

Questions to ask the person — or the model — who wrote it

  • What happens if this call times out?
  • Can this operation run twice?
  • Where is authorization enforced?
  • Which values are trusted, and why?
  • What did you copy from the surrounding code that may not apply here?

When to slow down

Slow down at money, identity, permissions and deletion. Those four areas turn small misunderstandings into incidents. A generated settings page can be reviewed quickly. A generated checkout, password reset or admin action deserves the full checklist.

The slop-code smell detector can point you at suspicious lines, but the checklist above is the actual review.

Want this read for you?

Appmint reviews shipped apps, code and AI-generated features. Tell us what you're building and we'll suggest the smallest useful next step.

Start a review
← All notes Try the free tools →