IntermediateCoding AgentsFree prompt

Plan-Then-Execute Mode for a Coding Agent

Force a coding agent to produce and confirm an implementation plan before it edits a single file.

Prevent expensive wrong turns by separating planning from execution and getting a checkpoint before changes land.

plan modecoding agentrefactorcheckpointworkflow

At a glance

Access

Free prompt

Open to copy — no account or payment needed.

Prompt objective

Prevent expensive wrong turns by separating planning from execution and getting a checkpoint before changes land.

Real use case

On a large refactor, a coding agent dives straight into edits and gets the architecture wrong halfway through. The team wants a reviewable plan first.

Customize these fields first

DESCRIBE THE CHANGESTACK, RELEVANT MODULES, CONSTRAINTS

Replace the placeholders with your own context before you run the prompt. That usually improves the first output more than adding more instructions later.

Prompt

Act as a senior engineer pairing with an autonomous coding agent. We are using a plan-then-execute workflow.

Task: [DESCRIBE THE CHANGE]
Codebase context: [STACK, RELEVANT MODULES, CONSTRAINTS]

PHASE 1 — PLAN ONLY (do not write code yet):
1. Restate the goal and list the assumptions you are making.
2. Identify the files/functions you expect to change and why.
3. Outline the step-by-step implementation order.
4. List risks, edge cases, and anything that could break existing behavior.
5. State how you will verify the change (tests, manual checks).
6. Ask any blocking questions. Then STOP and wait for approval.

PHASE 2 — EXECUTE (only after I reply "approved"):
- Implement exactly the approved plan, one step at a time.
- After each step, briefly note what changed.
- If reality diverges from the plan, pause and flag it instead of improvising.
- At the end, summarize changes, run the verification steps, and report results.

Begin with PHASE 1 now.

Open directly in an AI — the text is pre-filled:

How to use this prompt

  1. 1Replace the key placeholders first: DESCRIBE THE CHANGE, STACK, RELEVANT MODULES, CONSTRAINTS.
  2. 2Replace any bracketed placeholders like [this] with your own context.
  3. 3Add extra background information when you want more tailored results.
  4. 4Combine multiple prompts in one conversation when you need a richer output.
  5. 5Save your best-performing prompts so they are easy to reuse later.

Next best step

Open the guide first, then branch only if you still need more.

A guide for technical builders choosing between prompts, coding workflows, and agent-based implementation.

If this prompt is close but not quite right, generate variants next. If the job is recurring, move into the course library after the guide.

Related prompts

View all

Explore other prompt categories

Move sideways into adjacent libraries when the current category is not the full answer.

Every prompt here is free. The course teaches the thinking behind them.

Copy as many prompts as you like. When you want to move from single prompts to a repeatable AI workflow, Learn AI in 30 Days walks through it, one day at a time.

Get the courseSee the 30-day curriculum first

Buy the course once ($15/$20 by length), or go all-access for $10/mo with a verifiable certificate.