38.2 The "diff generation" agent pattern

Overview and links for this section of the guide.

Generating Diffs

Once the Proposal is approved, the next agent takes the Proposal + Code and generates the Diff.

Use the `SEARCH/REPLACE` block format (as seen in Project 3). It is the most reliable way to apply patches programmatically.

Context Management

Pass the Approved Plan in the system prompt. "You are implementing the plan below. Follow it exactly. Do not deviate."

This "grounding" keeps the coder agent from getting creative and introducing bugs.

Where to go next