Prompt Optimization Framework: 5 Steps to Perfect AI Outputs

I used to think prompt engineering was just about being clever with words. Then I realized it's actually about having a system.
After months of testing, failing, and refining, I've developed a 5-step framework that works for any AI model—ChatGPT, Claude, Gemini, you name it. It's not sexy, but it's effective.
The CRAFT Framework
I call it CRAFT because good prompts are crafted, not thrown together:
┌─────────────────────────────────────────────────────────┐ │ THE CRAFT FRAMEWORK │ ├─────────────────────────────────────────────────────────┤ │ │ │ C ─── CLARIFY your goal │ │ │ │ │ ▼ │ │ R ─── ROLE assignment │ │ │ │ │ ▼ │ │ A ─── ADD context & constraints │ │ │ │ │ ▼ │ │ F ─── FORMAT specification │ │ │ │ │ ▼ │ │ T ─── TEST and iterate │ │ │ └─────────────────────────────────────────────────────────┘
Let me walk you through each step with a real example. Let's say you want to create a meal plan.
Step 1: CLARIFY Your Goal
Before you type anything, pause. What do you actually want?
Most people start typing immediately. That's a mistake. Spend 30 seconds asking yourself:
For our meal plan example:
❌ Unclear goal: "Give me a meal plan"
✅ Clear goal: "I need 7 dinner recipes that are healthy, take under 30 minutes, and use ingredients I can find at a regular grocery store"
Step 2: Assign a ROLE
Telling the AI who to be is like giving an actor a character. It changes everything.
Good roles for meal planning:
✅ Our prompt so far: "Act as a practical home cook who creates simple, healthy recipes for busy people. I need 7 dinner recipes..."
Step 3: ADD Context & Constraints
This is where most prompts fall short. The AI doesn't know:
Think of constraints as guardrails:
┌─────────────────────┐
│ YOUR REQUEST │
├─────────────────────┤
┌──────┤ "Make me dinner" ├──────┐
│ └─────────────────────┘ │
│ │
▼ ▼
┌────────────┐ ┌────────────┐
│ Constraint │ │ Constraint │
│ No dairy │ │ Under $50 │
└────────────┘ └────────────┘
│ │
│ ┌─────────────────────┐ │
└─────▶│ FOCUSED OUTPUT │◀─────┘
└─────────────────────┘✅ Our prompt so far: "Act as a practical home cook who creates simple, healthy recipes for busy people. I need 7 dinner recipes that take under 30 minutes, serve 2 people, avoid dairy, and use no more than 8 ingredients each. I have basic kitchen equipment—no instant pot or air fryer."
Step 4: Specify the FORMAT
Don't leave the output structure to chance. Tell the AI exactly how to present the information.
Format options:
✅ Our complete prompt: "Act as a practical home cook who creates simple, healthy recipes for busy people. I need 7 dinner recipes that take under 30 minutes, serve 2 people, avoid dairy, and use no more than 8 ingredients each. I have basic kitchen equipment—no instant pot or air fryer.
For each recipe, provide:
Organize by day (Monday through Sunday). Start with the easiest recipe on Monday."
Step 5: TEST and Iterate
Here's the truth: your first prompt probably won't be perfect. That's okay. That's expected.
The iteration cycle:
┌────────────────┐
│ Run Prompt │
└───────┬────────┘
│
▼
┌────────────────┐
│ Review Output │───── Is it good? ──── Yes ───▶ Done!
└───────┬────────┘ │
│ No
▼ │
┌────────────────┐ │
│ Identify Gap │◀──────────┘
│ What's wrong? │
└───────┬────────┘
│
▼
┌────────────────┐
│ Refine Prompt │
│ Add specificity│
└───────┬────────┘
│
└──────────────────▶ (Back to Run Prompt)Common fixes during iteration:
Real Talk: This Takes Practice
The CRAFT framework isn't a magic wand. It's a thinking tool. The more you use it, the faster it becomes.
Eventually, you'll do these 5 steps automatically in your head. But when you're starting out, or when you're working on something important, walk through each step consciously.
Quick Template to Copy
[ROLE]: Act as a [specific expert/persona]... [CONTEXT]: I am [your situation]. I need [goal] because [reason]. [CONSTRAINTS]: Must include [X]. Must avoid [Y]. Limited to [Z]. [FORMAT]: Structure your response as [format]. Include [specific elements]. [EXAMPLE]: Here's an example of what I'm looking for: [example]
Save this. Use it. Watch your AI outputs transform.