Orientation

When a pull request’s diff was largely produced by an LLM-assisted coding tool, the merge review shifts from “does this solve the ticket?” to “is this code safe, compilable, and maintainable by a human team?” This checklist exists because AI-generated code often passes superficial review—it type-checks, follows the prompt’s style, and looks functionally plausible—while harboring subtle issues: missing edge-case guards, hallucinated imports, or conventions that diverge from the team’s established patterns. It matters whenever an AI tool is used to generate, complete, or refactor code that enters a shared branch, and it is especially critical when the AI output constitutes more than half the diff. The following sections are organized around the reader’s concrete goals during a merge review, using only real, shipping tools and generic patterns that map to any CI or version-control system.

Confirm the diff scope and intent

Before diving into the code, verify that the PR’s shape is intentional and tractable. Run the following git commands to inspect the commit history and raw diff:

git log --oneline -5
git diff --stat main..feature-ai

If git diff --stat returns hundreds of files or thousands of lines changed, pause: AI tools frequently generate boilerplate or repetitive patterns that inflate the diff without adding logic. A useful rule of thumb is that an AI-assisted PR should not exceed the team’s typical size for a single feature; if it does, consider splitting the change or rejecting the PR until the scope is trimmed.

Check the most recent commit message and the git show output for that commit to confirm the AI was asked to implement a specific, bounded task rather than “build the whole feature at once.” Unfocused prompts produce unfocused diffs, and those are the ones most likely to hide regressions.

Verify compilation and test suite

The next goal is to determine whether the code actually builds and whether the existing test suite accepts it. The exact commands depend on the language, but the pattern is always the same: invoke the project’s defined build and test entry points.

For a Go project:

go build ./...
go test ./... -count=1

For a Rust project:

cargo build
cargo test --workspace -count=1

For a Node.js project:

npm run build
npm test

If the build fails, inspect the error text carefully. AI-generated code often imports packages that don’t exist at the expected version, or it writes syntax that the linter flags but the compiler accepts (or vice versa). A common silent failure mode is a missing go mod tidy or cargo update step: the AI suggests a crate that exists in a registry, but the version constraint in go.mod or Cargo.toml is incompatible, causing a failure that only appears after the merge when the CI runs with the full dependency graph.

If the build succeeds but tests fail, examine the failure output. AI models sometimes generate test stubs or example usage that reference types or functions deleted in a recent refactor. The error text will name the missing identifier; compare it against the current codebase to decide whether the AI output is outdated or the branch is out of sync with main.

Scan for AI-typical failure patterns

Even when compilation and tests pass, certain patterns reliably indicate that an LLM produced the code. Review the diff with these checks in mind:

  • Hallucinated imports or module paths. Search the diff for import or use statements that reference names not defined anywhere in the repository. AI tools occasionally suggest packages that sound plausible but are fictitious or deprecated.
  • Hardcoded constants in place of configuration. Look for values that should be environment variables or flags but are baked into the source. For example, a database URL or API endpoint hardcoded as postgres://user:pass@localhost:5432/db instead of being read from .env.
  • Overly generic function names. AI prompts that don’t specify naming conventions often produce process_data, handle_request, or calculate_value. Verify that the team’s naming standards (e.g., fetchUserOrders, validateToken) are reflected.
  • Missing error handling. In languages where errors are explicit (Go, Rust, Java checked exceptions), scan for if err != nil { return err } patterns that the AI omitted. In dynamically typed languages, look for try/except blocks that catch broad exceptions and swallow them.
  • Comment-quality mismatches. AI-generated comments often read like “This function does X” without explaining *why* or *what* invariants are maintained. Compare the comment style against pre-existing code in the same file.

If any of these patterns appear, the PR should be sent back to the author with specific notes before merging.

Align with team conventions

Beyond correctness, the code must read like it was written by a member of the team. Run the project’s linter or formatter if one exists:

gofmt -w .
black my_project/
pylint --errors-only .

If the project uses a custom style checklist (e.g., “no more than two levels of nesting,” “all public functions must have doc comments”), enforce it manually or via a pre-commit hook. AI tools tend to default to the most common internet patterns, which may not match your team’s specific preferences for error variable names, return statement styles, or comment formatting.

Pay special attention to the file’s opening and closing sections. AI often truncates the last function or class in a file, leaving an incomplete closing brace or a missing return nil at the end of a Go function. A quick git diff view of the file’s first and last 20 lines frequently reveals these truncation artifacts.

Final merge gate and CI integration

Once the above checks pass, the PR is ready for the final merge decision. If the team uses a protected branch workflow, ensure that:

  • The CI pipeline ran to completion on the PR branch.
  • No new warnings were introduced (CI often lints, types, and tests; a single new warning can block merge).
  • The git merge --no-ff feature-ai command (or the equivalent UI merge) will preserve the feature branch’s commit history, making it clear which changes were AI-assisted and which were human-written.

If the merge is performed via a web UI, verify that the “Squash and merge” option is not selected unless the team’s policy requires a single commit per feature. Squashing an AI-assisted PR erases the incremental commit trail that documents how the code evolved under the model’s guidance.

Sharp edges

What silently fails is the most dangerous category. AI-generated code can compile and all tests can pass while containing a logic error that only manifests under a specific workload or data pattern. For example, an AI might write a loop that assumes input is sorted, or a regex that matches the happy path but fails on edge-case strings. These failures do not produce compile errors or test failures because the types are correct and the unit tests use representative data; the bug surfaces in production logs weeks later.

Another quiet failure mode is configuration drift. An AI tool may suggest adding a new dependency or a new environment variable, and the human reviewer may approve it without updating the CI configuration or the deployment manifests. The code merges, but the CI pipeline subsequently fails because the new variable is undefined, or the deployment script does not pass it to the container. This is especially prevalent when the AI output includes a .env.example file or a Dockerfile snippet that the reviewer copies verbatim without checking whether the surrounding infrastructure already defines those variables.

A third edge is the “context window truncation” effect. When a prompt is long, the model’s attention spans the beginning and end of the file, leaving the middle functions stubbed or generated with placeholder names. The diff may look complete, but the last three functions in the file are empty shells that the AI gave up on. Merging such a PR introduces compile-time errors or runtime null dereferences that are not apparent from the PR description.

Finally, license and attribution risks are easy to overlook. Some AI suggestions include verbatim snippets from public code repositories with copyleft licenses. A diff check for large blocks of code that look identical to online sources should be part of the pre-merge review, even though no automated tool currently catches all instances reliably. If the team’s policy requires license compliance, this check is non-negotiable before any merge.

This page was rewritten on 11 October 2026. It replaced a templated version that was not specific to its own title. How these pages are written and checked. If anything here is wrong, tell us at [email protected] and we will correct it.

The rest of the wiki

Vibe Code Wiki is an open reference on AI-assisted development — concepts, techniques, and tool notes. No sequel to this page is coming; it is the whole deliverable.

Browse the concepts