Framework9 min read Read

Prompt Optimization Framework: 5 Steps to Perfect AI Outputs

Author
PIEVOT Team2025-12-21

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:

What's the end result I need?
What would a 'perfect' output look like?
What will I do with this output?

For our meal plan example:

End result: A week of healthy dinners
Perfect output: Recipes that are quick, use simple ingredients, and taste good
Usage: I'll actually cook these meals

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:

A nutritionist who specializes in busy professionals
A home cook who values simplicity over fancy techniques
A meal prep expert who thinks about leftovers

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:

Your dietary restrictions
Your skill level
Your kitchen equipment
Your preferences

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:

Bullet points vs. paragraphs
Tables vs. lists
Include totals, summaries, or categories

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:

1.Recipe name
2.Total time (prep + cook)
3.Ingredient list with quantities
4.Step-by-step instructions (numbered)
5.One tip to make it even easier

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:

Output too long? Add "Be concise" or word limits
Wrong tone? Specify "casual" or "formal"
Missing details? Ask follow-up questions
Too generic? Add more specific examples

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.

Share this article