Confidence Scoring

Confidence scoring allows IntentCSS to determine how certain it is about a prompt before generating output.

Overview

Not every prompt is equally clear.

IntentCSS evaluates prompts and assigns a confidence score before generation occurs.

This helps prevent incorrect output and ensures predictable results.

The confidence system answers a simple question:

How sure is IntentCSS that it understands the user's intent?


Confidence Levels

IntentCSS currently uses three confidence levels.

LevelMeaning
HighIntentCSS clearly understands the prompt
MediumIntentCSS likely understands the prompt
LowIntentCSS cannot safely determine the intent

High Confidence

A prompt receives high confidence when:

  • The component is clearly identified
  • Known modifiers are detected
  • The prompt closely matches supported intents

Example:

BASH
intentcss generate --prompt "large red button"

Detected:

TEXT
Component: button
Color: red
Modifier: large

Output:

TEXT
rounded-lg bg-red-600 px-6 py-3 text-lg text-white hover:bg-red-700

Confidence:

TEXT
High

Medium Confidence

A prompt receives medium confidence when IntentCSS can identify a likely intent but some ambiguity remains.

Example:

BASH
intentcss generate --prompt "login thing"

Output:

TEXT
Detected intent: button
Confidence: 70%

IntentCSS generates output but informs the user that interpretation was not completely certain.


Low Confidence

A prompt receives low confidence when IntentCSS cannot confidently match the prompt to a supported intent.

Example:

BASH
intentcss generate --prompt "glorp wazzoo"

Output:

TEXT
Could not confidently understand that prompt.
Try words like: button, card, navbar, blue, responsive.

No output is generated.


Confidence Flow

Confidence scoring occurs after parsing and intent matching.

TEXT
Prompt

Typo Correction

Prompt Parsing

Intent Matching

Confidence Scoring

Generation

Only prompts that pass confidence checks proceed to generation.


Intent Matching Scores

Each intent contributes to the final confidence score.

Example:

Prompt:

TEXT
purple button

Matches:

TEXT
button

with a strong score because:

  • "button" is a registered intent
  • "purple" is a recognized modifier

Result:

TEXT
Confidence: High

Example Comparison

High Confidence

BASH
intentcss generate --prompt "glass login form"

Result:

TEXT
Confidence: High

Medium Confidence

BASH
intentcss generate --prompt "login thing"

Result:

TEXT
Confidence: Medium

Low Confidence

BASH
intentcss generate --prompt "wazzoo glorp"

Result:

TEXT
Confidence: Low

Why Confidence Matters

Confidence scoring helps IntentCSS:

  • Avoid incorrect generation
  • Improve developer trust
  • Provide useful feedback
  • Handle ambiguous prompts safely

Without confidence scoring, IntentCSS would generate output even when it was unsure.


User Experience

The confidence system is designed to be predictable.

High Confidence

Generate immediately.

TEXT
rounded-lg bg-blue-600 px-4 py-2 text-white hover:bg-blue-700

Medium Confidence

Generate with additional context.

TEXT
Detected intent: button
Confidence: 70%

Low Confidence

Stop and request a better prompt.

TEXT
Could not confidently understand that prompt.

Future Improvements

Future releases may include:

  • Numeric confidence reporting
  • Explainable intent matching
  • Prompt suggestions
  • Interactive clarification prompts

These features will improve transparency and help users understand how IntentCSS interprets requests.


Next Steps

Continue with:

  • Tailwind Output
  • CSS Output
  • Supported Intents
  • Modifiers