AI Coding Tip 042 - Reject Any Vibe-coded Diff That Goes Beyond the Spec
Reject any vibe-coded diff that goes beyond the spec, and move the extras to their own case.

Signup Write New Story AI Coding Tip 042 - Reject Any Vibe-coded Diff That Goes Beyond the Spec by Maxi Contieri by Maxi Contieri | @ mcsee Software Engineer Manager and Book Author at O'Reilly I’m a sr software engineer specialized in Clean Code, Design and TDD Book "Clean Code Cookbook" 500+ articles written
I’m a sr software engineer specialized in Clean Code, Design and TDD Book "Clean Code Cookbook" 500+ articles written
The spec asked for one change, and the AI shipped fourteen.
TL;DR: Reject any vibe-coded diff that goes beyond the spec, and move the extras to their own case.
You ask the AI to fix one validation rule.
It fixes the rule, renames three variables, reformats the file, changes two unrelated rules, and rewrites a class nobody mentioned.
The tests pass and the vibes are good, so you send the pull request.
Your reviewer now reads a diff full of changes nobody asked for, and the real change hides inside it.
It's also cowboy coding, and the AI finally made it affordable for everyone.
Another AI can do the same to the first one's work, with the same confidence.
Cowboy coding took effort once, and effort was a natural brake.
Now the AI sprawls in seconds, for anyone, human or agent.
Vibe coding means describing the goal and accepting the result with little close review.
Without a scope check, that's cowboy coding at machine speed.
The AI is a multiplier of the good and bad things.
Bertrand Meyer's modular continuity says a small change in the specification should trigger a small change in the code.
The bijection says it from the other side: the real world is the source of truth, and each thing in it has one object in the code.
Google's review guide says refactorings usually belong in a separate change from feature changes or fixes.
Scope creep is the same failure at project size.
You need a check in your harness that compares the diff with the spec.
Fix the discount validation in OrderService. (Two prompts after) While you're in there, clean up whatever looks messy. (One prompt after) Also refactor the Merchant Processor (One prompt after) Change the order number validator (just because I want it) (One prompt after) Rename unclear variables and update the old class. (One prompt after) Make the whole module better. Good prompt 👉 You are an adversarial scope reviewer. You didn't write this code, and you don't trust it.
Read the spec in SPEC.md. Read the diff against main. Map every changed hunk to one numbered spec requirement.
Mark each hunk you can't map as OUT OF SCOPE. Find the tests the diff edits, deletes, or breaks. A test change with no spec requirement is OUT OF SCOPE too.
These are out of scope unless the spec asks for them. Renames and reformatting. Refactoring and new dependencies.
Edits to files the change doesn't need. Don't suggest fixes. Don't praise the code.
Reply REJECT if any hunk is out of scope. Reply APPROVE only when every hunk maps to a requirement. List the out-of-scope hunks, one per line.
I'll cherry-pick them into a separate case. Considerations ⚠️ Vibe coding a throwaway prototype is fine.
A tiny cleanup, like renaming a local variable, can stay in the change.
Your team decides where that line sits, and you should write it in the spec.
A vague spec makes every hunk arguable. You need to write accurate specs.
A signature change forces its callers to change, so those hunks map to the requirement.
It can miss a hunk or invent one, so you still read the ones it flags.
The check needs a written spec, and it can't judge a change nobody described.
A hunk can map to a requirement and still hide an extra behavior inside it.
The tests only show the reach of a change where coverage exists.
The AI will go beyond the spec every time you let it.
A check that reads the diff works better, and so does a rule that rejects it and sends the extras to their own case.
I am a human who writes as best as possible for other humans.
I use AI proofreading tools to improve some texts.
Most AI detectors will flag this article as AI-generated. That's expected. It's a technical article. It has a rigid format and clear steps to follow.
That's exactly the pattern those tools are trained to catch. I've apparently been "writing like an AI" for decades, long before AI existed. This is a technical article, not a novel.
I welcome constructive criticism and dialogue.
I shape these insights through 30 years in the software industry, 25 years of teaching, and writing over 500 articles and a book.
This article is part of the AI Coding Tip series.
AI in Leadership: Managing People, Not Just Work