47.2 The "plan first" prompt

Overview and links for this section of the guide.

The Prompt

Before writing any code, create a plan.

## Planning Phase
First, output a plan in this format:

### Goal
One sentence describing what we're building.

### Approach
3-5 bullet points explaining the approach.

### Files to Create/Modify
- file1.ts: reason
- file2.ts: reason

### Risks
Any concerns or tradeoffs.

---

## Implementation Phase
After the plan, implement it step by step.
For each file, show the complete code.

## Confirmation
End with: "Plan complete. Ready to implement? [Y/n]"

Wait for user confirmation before writing code.
If user says no, revise the plan based on feedback.

Where to go next