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.
| Level | Meaning |
|---|---|
| High | IntentCSS clearly understands the prompt |
| Medium | IntentCSS likely understands the prompt |
| Low | IntentCSS 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:
intentcss generate --prompt "large red button"
intentcss generate --prompt "large red button"
Detected:
Component: button
Color: red
Modifier: large
Component: button
Color: red
Modifier: large
Output:
rounded-lg bg-red-600 px-6 py-3 text-lg text-white hover:bg-red-700
rounded-lg bg-red-600 px-6 py-3 text-lg text-white hover:bg-red-700
Confidence:
High
High
Medium Confidence
A prompt receives medium confidence when IntentCSS can identify a likely intent but some ambiguity remains.
Example:
intentcss generate --prompt "login thing"
intentcss generate --prompt "login thing"
Output:
Detected intent: button
Confidence: 70%
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:
intentcss generate --prompt "glorp wazzoo"
intentcss generate --prompt "glorp wazzoo"
Output:
Could not confidently understand that prompt.
Try words like: button, card, navbar, blue, responsive.
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.
Prompt
↓
Typo Correction
↓
Prompt Parsing
↓
Intent Matching
↓
Confidence Scoring
↓
Generation
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:
purple button
purple button
Matches:
button
button
with a strong score because:
- "button" is a registered intent
- "purple" is a recognized modifier
Result:
Confidence: High
Confidence: High
Example Comparison
High Confidence
intentcss generate --prompt "glass login form"
intentcss generate --prompt "glass login form"
Result:
Confidence: High
Confidence: High
Medium Confidence
intentcss generate --prompt "login thing"
intentcss generate --prompt "login thing"
Result:
Confidence: Medium
Confidence: Medium
Low Confidence
intentcss generate --prompt "wazzoo glorp"
intentcss generate --prompt "wazzoo glorp"
Result:
Confidence: Low
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.
rounded-lg bg-blue-600 px-4 py-2 text-white hover:bg-blue-700
rounded-lg bg-blue-600 px-4 py-2 text-white hover:bg-blue-700
Medium Confidence
Generate with additional context.
Detected intent: button
Confidence: 70%
Detected intent: button
Confidence: 70%
Low Confidence
Stop and request a better prompt.
Could not confidently understand that prompt.
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