Skip to content
New — orchestrate a team of Mel agents from your terminal. Learn more about orchestrating Mel agents
Mel
← All articles

Mel – the agentic terminal
The agentic team for coding.

From prompt to production-ready code: a checklist before you merge AI-written code

November 24, 2026 · Updated November 23, 2026 · 9 min read

Share
Safety & control: Check before you merge
In short
  • Code an agent wrote is production-ready when a person can explain it and the checks ran after the last edit.
  • Ten checks: seven a tool can help with, three only a person can sign.
  • The test result that counts is the one taken after the agent's final change.
  • Mel – the agentic terminal plans, builds, tests and ships your work with you in control.

Before you merge code an AI agent wrote, check that the tests ran after its last edit, that the diff only touches what you asked for, and that a person on your team can explain every line. Mel – the agentic terminal (openmel.dev) plans, builds, tests and ships your work with you in control, and this checklist is what "production-ready" should mean before you press merge.

A retro test bench showing a green check mark on its screen, next to the words "Check before you merge"

What does "production-ready" mean for code an AI agent wrote?

It means the same thing it means for code a person wrote. The code does what the task asked, nothing more. It passes the same tests and the same review. Someone on the team understands it well enough to fix it at 2 AM.

The difference is speed. An agent can write in ten minutes what used to take a day, so the pull requests arrive faster and bigger. Review habits built for a human pace start to slip. The checklist exists to stop that slip, not to slow the agent down.

What should you check before you merge AI-written code?

Ten checks, in the order a reviewer usually meets them.

  1. The tests ran after the last edit. Agents often run the tests, then make "one small fix", then report success. Look for a test run that comes after the final change, in the log or in CI.
  2. The diff matches the task. Count the files. A task about one endpoint that touches twelve files needs a reason for each one.
  3. No test was weakened. Look for deleted assertions, skipped tests, loosened checks and new try/except blocks around failing code. Making the test pass is not the same as fixing the bug.
  4. No secrets in the diff. API keys, tokens, .env contents, real customer data in fixtures. Run your secret scanner on the branch, not just on main.
  5. New dependencies are real and wanted. Check every new package name on its registry. Agents sometimes add a package that does the job of one you already have, or one with a name close to a real one.
  6. Migrations and data changes are reversible. A schema change needs a way back. A script that rewrites data needs a dry run first.
  7. Errors are handled, not hidden. Agent code tends to catch everything and log nothing. Make sure a failure shows up somewhere a person will see it.
  8. A person can explain it. The reviewer reads the change and can say what it does and why, without asking the agent. If nobody can, it is not ready.
  9. The behavior was seen working. Someone ran the app, hit the endpoint or clicked the screen. Passing tests prove the tests; a quick manual look proves the feature.
  10. Someone owns it after merge. A name in the pull request: who gets paged if this breaks.

Why check 5 matters more with agents

Check 5 is not only about taste. Researchers who tested code-writing models found that they sometimes name packages that do not exist. In one large study, package hallucinations appeared in a measurable share of the code samples the models produced, across both commercial and open models. An attacker who registers one of those made-up names can get their code installed by anyone who trusts the suggestion. The defence is simple: every new name in the lockfile gets looked up on its registry by a person before merge.

Red flags in an AI-written diff

Some patterns show up in agent diffs more often than in human ones. None of them proves the change is wrong. Each one is a reason to slow down and read that part twice.

Red flagWhat it often meansWhat to ask
A test's expected value changedThe test was bent to fit the codeWas the old value wrong, or the code?
skip, xfail, .only or a commented-out testA failing test was silencedWhich test failed, and why?
A new broad catch or except ExceptionAn error is being swallowedWhere does the failure go now?
A new helper that copies an existing oneThe agent did not find the old oneCan it call the existing helper?
Edits to config, CI or lockfiles in a feature taskScope creptWas this needed for the task?
A big file rewritten for a small changeFormatting or reordering hid the real editCan the diff be redone smaller?
New environment variables or secrets readA new dependency on configIs it documented, and set in every environment?

If you see two or more of these in one pull request, send it back with the question rather than fixing it yourself. The agent can usually make a cleaner version in a minute, and you keep your review time for the next one.

Which checks can a tool do, and which need a person?

CheckWhoHow
1. Tests after last editTool, read by a personCI on the final commit; look at the order of runs in the agent's log
2. Diff matches the taskPersonRead the file list first, then the diff
3. No weakened testsPerson, helped by a toolSearch the diff for removed asserts and skips
4. No secretsToolSecret scanner on the branch
5. DependenciesTool, then a personLockfile diff, registry check, a yes from the owner
6. Reversible migrationsPersonRead the down step; dry run on a copy
7. Errors not hiddenPersonSearch for broad catches and empty handlers
8. Someone can explain itPersonThe reviewer writes two lines in the PR
9. Seen workingPersonRun it locally or on a preview
10. An ownerPersonName in the PR

Checks 2, 8 and 10 are the ones no tool can sign for you. They are also the ones that get skipped first when pull requests arrive fast.

Put the checklist in your pull request template

A checklist that lives in a blog post gets forgotten. One that appears in every pull request gets used. GitHub, GitLab and most other hosts can fill a new pull request's description from a template file in your repository; GitHub's version is a file named pull_request_template.md, described in its guide to creating a pull request template. Here is a version you can copy:

## AI-written code checklist
- [ ] Tests ran after the last edit (link the CI run)
- [ ] Every changed file is needed for this task
- [ ] No test was skipped, deleted or loosened
- [ ] Secret scan is clean on this branch
- [ ] New dependencies checked on the registry: (list them, or "none")
- [ ] Migrations have a way back, or "no migrations"
- [ ] Failures are logged or shown, not swallowed
- [ ] What this change does, in two lines, by the reviewer:
- [ ] Seen working: (how)
- [ ] Owner after merge: @name

Two lines from the reviewer, in their own words, are the most useful part. They prove someone read the change, and they help the next person who opens the file.

For check 4, turn on the scanner your host offers. GitHub's secret scanning can block a push that contains a known kind of key before it reaches the server.

How do you make an AI agent show its work?

Ask for it in the task, and set your tool so you see the steps that matter.

In the prompt. End every task with: "Run the tests after your last change and paste the result. List every file you changed and why." An agent that is told the bar up front tends to meet it more often, and when it does not, the gap is easy to see.

In your approvals. Keep a card on the steps where you want to see the work happen: edits outside the task's folder, new dependencies, anything that leaves your machine. Let reads and test runs go without one, or you will stop reading the cards.

In the diff. Read the change before it becomes a commit, not after it becomes a pull request. A diff is cheapest to fix while the task is still open.

How does Mel help you get from prompt to production-ready code?

Mel is a multi-agent, multi-model agentic terminal for Mac, Windows, Linux and VS Code. A team of agents works on files, commands, code and diff review, and configurable approvals keep you in control of commands and edits. When an edit asks for your yes, the card shows the change as a diff, so a yes can be a real read.

Mel works with Claude, GPT, Gemini, DeepSeek and Qwen. That helps with check 8: a reviewer can ask a second model to explain a change the first one wrote, then compare the answer with their own reading.

Before a result reaches a model, Mel masks the secrets it recognises, so a key that sits in a file the agent reads is not sent along with it. That helps with check 4 on the way in. Your secret scanner still covers the way out.

The code review panel is where checks 2, 3 and 7 happen. It shows every changed file with its diff. Hover a line and click 💬 to leave a comment, then send your comments back to the agent to fix. Undo takes back one change, Discard reverts one file, and Commit N files stages everything and commits it with your message. You read the change before it ever becomes a pull request.

None of this replaces the checklist. Mel helps you do the work and see it. The merge is still your team's decision, and checks 2, 8 and 10 are still a person's job.

Frequently asked questions

Is AI-generated code production-ready? It can be, once it passes the same bar as human code: tests after the last change, a diff that matches the task, and a person who can explain it. Treat "done" from an agent as a claim to check, not a result.

Who should review code an AI agent wrote? Someone who knows the part of the system it touches, and who did not write the prompt if possible. They should be able to explain the change without asking the agent.

How do I know the agent's tests really ran? Look for a test run after the final edit, in the agent's log or in CI on the last commit. A pass reported before the last change says nothing about the code you are merging.

Should AI-written pull requests be smaller? Yes. Ask for one task per pull request. A small diff is read; a big one is skimmed.

What is the most common problem in AI-written pull requests? Scope. The agent changes more than the task needed, often to make a test pass. Read the file list first, and ask why for every file that surprises you.

Can an AI review code another AI wrote? It can help, by explaining the change or pointing out risky lines. It cannot sign for check 8, because the point of that check is that a person on your team understands the code.

Should we use a pull request template for AI code? Yes. Put the ten checks in your repository's pull request template so they appear on every pull request, not only when someone remembers.

What does Mel cost? Mel is free with your own API key on Mac, Windows and Linux, plus a VS Code extension. Pro is $20 a month and Max is $200 a month. Business is $50 a seat (2 seats minimum) with shared credits and one invoice.

Put the checklist to work

Copy the ten checks into your pull request template today. Then download Mel and try it on one task with the checklist in the prompt. To set this up with your team on your own code, book a demo.

Mel – the agentic terminal · openmel.dev. The agentic team for coding.

Found this useful? Share it with your team.
Share

Get started

Try the agentic terminal for teams.

The Mel terminal is free to download, no account needed. The AI agent is free on your own provider key — 1,500 hosted-AI credits a month on Pro.