Vibe Coding Prompt Patterns That Make AI Fix the Right Thing

Plants.work · · upskilling
Vibe Coding Prompt Patterns That Make AI Fix the Right Thing

8 reusable prompt patterns that make AI change exactly what you asked without breaking what already works, with a before-and-after HR example.

"Make the button green" sounds like a simple instruction. Then you get green buttons across the whole app, a recoloured table header, and a login page that was fine now shifted out of place. Anyone who has vibe coded for a while sees this often. The AI is not being stubborn; it simply read the instruction too broadly. This article collects prompt patterns that help the AI fix exactly the right spot without tearing down what already works.

What is a prompt pattern?

A prompt pattern is a reusable way of giving instructions, like a template you fill in. In vibe coding the AI needs to know three things every time: where to change, what to change, and what must not be touched. Miss any one and the AI guesses, and guessing in a multi-file project often affects other parts. For general prompting basics first, read What is Prompt Engineering.

8 patterns you can use right away

1. Scope Lock

Name the page, the section or the on-screen text you want changed, then state what must not change. For example: "On the order summary page, change only the 'Confirm' button to green. Do not change colours or layout anywhere else."

2. One prompt, one change

Asking for five things in one message makes the AI edit many files at once, and if something breaks the cause is hard to find. Do one thing, test, then move on.

3. Explain First

When you are unsure about a problem, say: "Explain how this part works and propose 2 ways to fix it. Do not change anything yet." You get to choose an approach you understand instead of letting the AI trial-and-error in real code.

4. What I did, what I expected, what happened

When reporting a problem, use the structure "I clicked... I expected to see... but I saw...". This gives the AI both reproducible steps and the correct goal. More on reading errors in Debugging apps written by AI.

5. Reference what exists

"Make the customer list page look and filter like the product list page." The AI reuses existing components and styles, so the app looks consistent.

6. Define "done"

End the prompt with a checkable criterion, for example: "Done when an invalid email shows a red warning under the field and the form cannot be submitted."

7. Ask the AI to summarise its changes

Add "Summarise which files you changed and why" to every important instruction. You will immediately notice if the AI touched something you did not ask for.

8. Know when to stop and restart

If you have asked for the same fix three times and it is still looping, do not send a fourth prompt with the same words. Roll back to the last good version and write a clearer prompt, or open a new conversation with a short summary of what the app does and what the problem is. A very long conversation carries old context that confuses the AI.

Example: an HR officer at a logistics company builds a leave request page

An HR officer builds a page for staff to submit leave with vibe coding and finds that past dates can be selected. Her first prompt is "fix the date thing". The AI changes the date format across the entire app. She rolls back and writes:

"In the leave request form, the 'Leave start date' field currently allows past dates. It should allow only today or later. Do not change how dates are displayed on other pages. Done when past dates cannot be selected. Also summarise which files you changed."

This time the AI changes only that spot and says which file it edited. She checks it in a few minutes.

AI fixes things as precisely as you describe them.

Things to watch out for

How to get started

  1. Open one note and save all 8 patterns as fill-in templates
  2. In your next task, use Scope Lock and a "done" criterion every time
  3. Notice which prompts make you repeat yourself, and adjust your templates
  4. Share the templates with teammates who also vibe code

Communicating clearly with AI is a skill that applies to almost every field. To practise in a structured way, browse related courses on the Plants.work courses page, or start with Vibe Coding: build a full web app with Claude Code.