Eidetic

AI Prompt Quality Meter

AI
Authoring
Tuner

Real-time prompt quality analysis with breakdown by clarity, specificity, context, structure, and length. Provides actionable suggestions to improve prompt effectiveness.

Preview - Low Quality Prompt

Analysis of a brief, vague prompt

Prompt Quality

Needs improvement

37
Clarity
70%

Clear and understandable

Specificity
30%

Could use more detail

Context
20%

More context would help

Structure
30%

Could be better organized

Length
35%

Too short

Tips to improve

High Quality Prompt

Well-structured prompt with good scores

Prompt Quality

Excellent prompt!

81
Clarity
96%

Clear and understandable

Specificity
60%

Could use more detail

Context
50%

More context would help

Structure
100%

Well-organized

Length
100%

Good length

Tips to improve

Compact Mode

Minimal display without breakdown

81%
2 tips

Without Suggestions

Show scores only, no improvement tips

Prompt Quality

Needs improvement

37
Clarity
70%

Clear and understandable

Specificity
30%

Could use more detail

Context
20%

More context would help

Structure
30%

Could be better organized

Length
35%

Too short

Props

AIPromptQualityMeter component API reference

PropTypeDefaultDescription
prompt*stringThe prompt text to analyze
scoresQualityScore[]Pre-computed quality scores (optional - will estimate if not provided)
goodThresholdnumber70Overall quality threshold for "good" (0-100)
showBreakdownbooleantrueShow individual factor breakdowns
showSuggestionsbooleantrueShow improvement suggestions
compactbooleanfalseCompact display mode
livebooleantrueLive update as user types
onSuggestionClick(factor: QualityFactor, suggestion: string) => voidCallback when user clicks a suggestion
classNamestringAdditional CSS classes

QualityScore Type

PropTypeDefaultDescription
factor*'clarity' | 'specificity' | 'context' | 'structure' | 'length'Quality factor being measured
score*numberScore from 0-100
feedbackstringFeedback for this factor
suggestionstringSuggestion for improvement

Usage

Import and implementation example

import { AIPromptQualityMeter } from '@/blocks/ai-transparency/ai-prompt-quality-meter'
import { useState } from 'react'
export default function Example() {
const [prompt, setPrompt] = useState('')
return (
<div>
<textarea
value={prompt}
onChange={(e) => setPrompt(e.target.value)}
placeholder="Enter your prompt..."
className="w-full p-3 border rounded-lg"
/>
<AIPromptQualityMeter
prompt={prompt}
showBreakdown={true}
showSuggestions={true}
onSuggestionClick={(factor, suggestion) => {
console.log(`Improve ${factor}: ${suggestion}`)
}}
/>
</div>
)
}
This block is self-contained (no UI component dependencies)

Features

Built-in functionality

  • Five quality factors: Clarity, specificity, context, structure, and length
  • Real-time analysis: Updates as user types (optional)
  • Overall score: Aggregate score with color-coded status
  • Factor breakdown: Individual progress bars for each factor
  • Actionable suggestions: Specific tips to improve each low-scoring factor
  • Heuristic analysis: Built-in prompt analysis algorithm
  • Custom scoring: Override with your own quality scores
  • Compact mode: Minimal progress bar for tight spaces
  • Dark mode support: Full dark mode with proper contrast

Quality Factors Explained

What each factor measures

Clarity

How clear and understandable is the request. Good clarity means starting with question words or clear action verbs.

Specificity

How specific and detailed is the request. Includes concrete requirements, constraints, or examples.

Context

How much relevant context is provided. Background information helps the AI understand the situation.

Structure

How well-organized is the prompt. Using bullet points, numbering, or clear sections improves structure.

Length

Is the prompt length appropriate. Optimal range is 10-100 words (too short lacks detail, too long may be unfocused).

Accessibility

ARIA support and keyboard navigation

ARIA Attributes

Progress bars have implicit progress roleScores are displayed both as numbers and visual barsColor is not the only indicator (icons and text are used)

Keyboard Navigation

KeyAction
TabNavigate between suggestion buttons
EnterActivate suggestion to learn more

Notes

  • Consider adding aria-label to describe overall quality
  • Ensure sufficient contrast for all score colors
  • Suggestions should be keyboard accessible
  • Screen readers should announce score changes
  • Live regions could announce quality updates as user types