Home/
Part XII — Building Real Products (End-to-End Projects)/34. Project 3: "Vibe Coder" Assistant for Your Own Repo/34.3 Change proposal workflow (plan → diff → tests)
34.3 Change proposal workflow (plan → diff → tests)
Overview and links for this section of the guide.
On this page
The Three-Step Flow
Never ask the model to "just do it." It leads to spaghetti code. Force this flow:
- PLAN: "Read `src/utils.ts`. Explain what needs to change to support the new date format. List the steps."
- DIFF: "Based on the plan, generate a Unified Diff for the file."
- TEST: "Generate a test case that verifies this change."
Generating Clean Diffs
LLMs are notoriously bad at row numbers in standard diffs. A better format is Search/Replace Blocks:
<<<<<<< SEARCH
function oldCode() {
return true;
}
=======
function newCode() {
return false;
}
>>>>>>> REPLACE
This is robust against minor line number shifts. Your script parses this block, finds the `SEARCH` text in the file, and swaps it for `REPLACE`.