The CLEAR Framework

Master the CLEAR framework for writing effective prompts: Context, Length, Examples, Audience, and Role.

Level 101basicclear frameworkprompt structurecontextexamplesaudiencerole
5 mins

The CLEAR framework is a systematic approach to writing effective prompts for modern AI models like GPT-5, Claude 4, and Gemini 2.5. It ensures your prompts are comprehensive, well-structured, and produce the desired results consistently.


What You'll Learn

By the end of this lesson, you'll be able to:

  • āœ… Understand each component of the CLEAR framework
  • āœ… Apply the framework to write effective prompts
  • āœ… Avoid common mistakes in prompt engineering
  • āœ… Create structured prompts for different use cases

What is the CLEAR Framework?

CLEAR stands for:

  • Context: Provide background information
  • Length: Specify desired response length
  • Examples: Include relevant examples
  • Audience: Consider who will read the response
  • Role: Define the AI's role or perspective

C - Context

Context provides the background information the AI needs to understand your request and generate appropriate responses.

Why Context Matters

  • Helps the AI understand the situation
  • Provides necessary background information
  • Ensures responses are relevant and appropriate
  • Reduces misunderstandings and irrelevant outputs

How to Provide Context

Include relevant information such as:

  • What you're trying to accomplish
  • Relevant background details
  • Constraints or limitations
  • Previous attempts or failures
  • Industry or domain-specific information

Examples

Poor Context
Write a marketing email

Too vague, no background information

Good Context
I'm launching a new SaaS product for small businesses that helps with inventory management. The target audience is retail store owners aged 25-45. The product costs $29/month and offers a 14-day free trial. I need a marketing email to announce the launch.

Specific details, clear purpose, target audience defined

Poor Context
Help me with this code

No technical details, unclear problem

Good Context
I'm building a React application for a restaurant ordering system. I'm using TypeScript and need to create a component that displays menu items. The data comes from an API and includes item name, price, description, and image URL. I'm having trouble with the state management when users add items to their cart.

Technology stack, specific problem, data structure defined


L - Length

Length specifies how detailed or concise you want the response to be.

Why Length Matters

  • Controls response verbosity
  • Manages token usage and costs
  • Ensures responses fit your needs
  • Prevents overly long or short responses

How to Specify Length

Use specific measurements:

  • Word count: "Write a 200-word summary"
  • Character count: "Keep under 500 characters"
  • Paragraphs: "Provide 3-4 paragraphs"
  • Bullet points: "List 5 key points"
  • Sentences: "Answer in 2-3 sentences"

Examples

Poor Length
Write a blog post

No length specified, unclear expectations

Good Length
Write a 500-word blog post about remote work productivity tips

Specific word count and topic defined

Poor Length
Give me a summary

Vague length requirement

Good Length
Provide a 3-sentence summary of the main points

Specific sentence count and focus area


E - Examples

Examples show the AI exactly what you're looking for in terms of format, style, and content.

Why Examples Matter

  • Demonstrates desired format and style
  • Reduces ambiguity
  • Ensures consistency
  • Saves time on revisions

How to Provide Examples

Include examples that show:

  • Desired format and structure
  • Appropriate tone and style
  • Level of detail expected
  • Specific patterns or conventions

Examples

Poor Examples
Write a product description

No example provided, unclear expectations

Good Examples
Write a product description for a coffee maker. Example: Product: Premium Coffee Maker Description: Experience barista-quality coffee at home with our premium coffee maker. Features include programmable brewing, 10-cup capacity, and auto-shutoff for safety. Perfect for coffee enthusiasts who demand quality and convenience. Now write a description for a wireless headphones:

Clear example shows format, style, and structure

Poor Examples
Create a meeting agenda

No format example provided

Good Examples
Create a meeting agenda for our weekly team meeting. Example: Weekly Team Meeting Agenda Date: August 15, 2025 Time: 10:00 AM - 11:00 AM 1. Welcome and Updates (5 min) 2. Project Status Review (20 min) - Project A: On track, completion expected August 30 - Project B: Behind schedule, need additional resources 3. New Business (15 min) 4. Action Items and Next Steps (10 min) 5. Open Discussion (10 min) Now create an agenda for a client presentation meeting:

Detailed example shows structure and timing


A - Audience

Audience considers who will read or use the AI's response.

Why Audience Matters

  • Determines appropriate language and tone
  • Influences level of technical detail
  • Affects format and structure
  • Ensures accessibility and understanding

How to Consider Audience

Think about:

  • Who will read this response?
  • What is their technical level?
  • What is their role or position?
  • What do they already know?
  • What do they need to know?

Examples

Poor Audience
Explain machine learning

No audience specified, unclear level

Good Audience
Explain machine learning to a high school student who has no technical background

Clear audience with defined knowledge level

Poor Audience
Write a technical report

No audience context provided

Good Audience
Write a technical report for senior executives who need to understand the business impact of our new AI implementation. Focus on ROI, risks, and strategic recommendations rather than technical details.

Specific audience with clear focus areas


R - Role

Role defines the AI's perspective, expertise, or persona.

Why Role Matters

  • Sets the AI's expertise level
  • Determines the approach and methodology
  • Influences tone and style
  • Ensures appropriate domain knowledge

How to Define Role

Specify:

  • Professional role or expertise
  • Experience level
  • Domain knowledge
  • Perspective or approach

Examples

Poor Role
Help me write code

No role specified, unclear expertise

Good Role
You are a senior software engineer with 10 years of experience in Python development. You specialize in web applications and have worked extensively with Django and React. Help me write clean, maintainable code following best practices.

Specific role with experience and expertise defined

Poor Role
Give me business advice

No role context provided

Good Role
You are a business consultant with expertise in startup growth and digital marketing. You've helped 50+ companies scale from $1M to $10M+ in revenue. Provide strategic advice based on proven methodologies.

Specific expertise with proven track record


Real-World Examples

Example 1: Technical Documentation

CLEAR Framework Applied:

Context: I'm developing a React component library for a fintech application. The components need to handle financial data securely and provide a consistent user experience.

Length: Write a 300-word documentation section

Examples:

Example Documentation Style
Example documentation style: # Button Component A customizable button component with built-in loading states and accessibility features. ## Props - `variant`: 'primary' | 'secondary' | 'danger' - `size`: 'small' | 'medium' | 'large' - `loading`: boolean

Audience: Frontend developers with React experience who will integrate these components

Role: You are a senior frontend architect specializing in React and design systems

Complete Prompt:

Complete CLEAR Prompt
You are a senior frontend architect specializing in React and design systems. I'm developing a React component library for a fintech application that needs to handle financial data securely and provide a consistent user experience. Write a 300-word documentation section for a DataTable component that displays financial transactions. The component should include sorting, filtering, and pagination features. Example documentation style: # Button Component A customizable button component with built-in loading states and accessibility features. ## Props - `variant`: 'primary' | 'secondary' | 'danger' - `size`: 'small' | 'medium' | 'large' - `loading`: boolean Write this for frontend developers with React experience who will integrate these components.

Example 2: Marketing Content

CLEAR Framework Applied:

Context: We're launching a new AI-powered customer service chatbot for e-commerce businesses. It reduces support tickets by 60% and improves customer satisfaction.

Length: Create a 150-word social media post

Examples:

Example Post Style
Example post style: šŸš€ Exciting news! Our new [Product] is here to revolutionize [industry]. āœ… [Key benefit 1] āœ… [Key benefit 2] āœ… [Key benefit 3] Ready to transform your [business area]? Learn more: [link]

Audience: E-commerce business owners and marketing managers on LinkedIn

Role: You are a digital marketing expert specializing in B2B SaaS marketing

Complete Prompt:

Complete CLEAR Prompt
You are a digital marketing expert specializing in B2B SaaS marketing. We're launching a new AI-powered customer service chatbot for e-commerce businesses that reduces support tickets by 60% and improves customer satisfaction. Create a 150-word social media post announcing this launch. Example post style: šŸš€ Exciting news! Our new [Product] is here to revolutionize [industry]. āœ… [Key benefit 1] āœ… [Key benefit 2] āœ… [Key benefit 3] Ready to transform your [business area]? Learn more: [link] Write this for e-commerce business owners and marketing managers on LinkedIn.

CLEAR Framework Checklist

Before sending any prompt, ask yourself:

  • [ ] Context: Have I provided enough background information?
  • [ ] Length: Have I specified the desired response length?
  • [ ] Examples: Have I included relevant examples if needed?
  • [ ] Audience: Have I considered who will read this response?
  • [ ] Role: Have I defined the AI's role or expertise?

Common CLEAR Framework Mistakes

  1. Missing Context: Not providing enough background information
  2. Vague Length: Not specifying desired response length
  3. No Examples: Not showing the desired format or style
  4. Ignoring Audience: Not considering who will use the response
  5. Unclear Role: Not defining the AI's expertise or perspective

Practice Exercise

Try rewriting these poor prompts using the CLEAR framework:

Original: "Write a resume"

CLEAR Version:

CLEAR Framework Applied
You are a professional resume writer with 15 years of experience helping job seekers land positions in competitive industries. I'm applying for a senior marketing manager position at a tech startup. I have 8 years of experience in digital marketing, with expertise in growth hacking and customer acquisition. The company focuses on B2C SaaS products. Write a 1-page resume that highlights my achievements and quantifiable results. Example format: [Name] [Title] | [Location] | [Contact] PROFESSIONAL SUMMARY [2-3 sentences about career focus and key strengths] EXPERIENCE [Company Name] | [Title] | [Dates] - [Achievement with metrics] - [Achievement with metrics] Write this for hiring managers and recruiters in the tech industry.

Self-Check

Test your understanding of the CLEAR framework:

  1. What does each letter in CLEAR stand for?
  2. Why is context important when writing prompts?
  3. How can you specify length in a prompt?
  4. When should you provide examples in your prompts?
  5. How does audience consideration affect prompt writing?

Summary

The CLEAR framework provides a systematic approach to writing effective prompts:

  • Context ensures the AI understands your situation
  • Length controls response verbosity and costs
  • Examples demonstrate desired format and style
  • Audience determines appropriate language and detail level
  • Role sets the AI's expertise and perspective

By following this framework, you'll create more effective prompts that produce better results consistently.


Next Steps

In the next lesson, you'll learn about Practical Applications and how to apply these techniques to real-world scenarios.


Practice Time! Try applying the CLEAR framework to your own prompts. Start with one element at a time, then gradually incorporate all five components.

Complete This Lesson

You've successfully completed the CLEAR framework lesson! Click the button below to mark this lesson as complete and track your progress.
Loading...

Explore More Learning

Continue your AI learning journey with our comprehensive courses and resources.

The CLEAR Framework - AI Course | HowAIWorks.ai