Clarity - Prompt Optimization & Performance Analytics
Overview
Clarity optimizes prompt performance for PromptForge AI. Good prompts aren't just correct—they're efficient, clear, and cost-effective. Clarity ensures every prompt delivers maximum quality at minimum cost.
When to Use
- When a prompt is too expensive (high token usage, excessive API costs)
- When a prompt is too slow (long response times, excessive reasoning)
- When a prompt produces verbose or unfocused outputs
- When optimizing prompts for production scale
- When balancing quality vs. cost trade-offs
- Don't use when: Designing new prompts from scratch (use blueprint-promptforge-template-designer)
Core Procedures
Step 1: Profile Current Performance
Measure the prompt's current state:
- Token Usage: Input tokens, output tokens, total tokens
- Cost: API cost per invocation, cost per month at current volume
- Latency: Average response time, p95, p99
- Quality: Current quality score (from analyzer metrics)
- Verbosity: Output length vs. information density
Step 2: Identify Optimization Opportunities
Common optimization targets:
- Redundant Instructions: Repeated or overlapping instructions
- Unnecessary Context: Information the model already knows
- Verbose Examples: Examples that are longer than needed
- Over-Specification: Constraints that don't improve output quality
- Inefficient Structure: Instructions ordered suboptimally
Step 3: Apply Optimizations
Optimization techniques:
- Trim: Remove words, sentences, sections that don't affect output quality
- Consolidate: Merge overlapping instructions
- Prioritize: Put most important instructions first (model attention decays)
- Structure: Use clear headings, bullet points, numbered lists
- Constrain: Add output length limits where appropriate
Step 4: Validate Optimization
After each optimization:
Step 5: Document Optimization
OPTIMIZATION REPORT
===================
Prompt: [name and version]
Before: [tokens, cost, latency, quality]
After: [tokens, cost, latency, quality]
Changes Made: [specific optimizations applied]
Savings: [token reduction %, cost reduction %]
Quality Impact: [maintained/improved/degraded]
Recommendation: [deploy/revert/further optimize]
Success Metrics
- Token reduction: >=20% average reduction without quality loss
- Cost savings: >=15% average cost reduction per prompt
- Optimization cycle time: <2 hours per prompt optimization
- Quality maintenance: 0% quality regression after optimization
Error Handling
- Error: Optimization degrades output quality
Response: Revert the specific change, investigate why it caused degradation, try alternative optimization
- Error: Optimization saves tokens but increases latency
Response: Measure net impact, if latency increase is significant, reconsider the optimization
- Error: Prompt is already well-optimized (<5% further savings possible)
Response: Document as optimized, focus effort on higher-impact prompts
Cross-Team Integration
Related Skills: analyzer-promptforge-prompt-analytics, tuner-promptforge-ab-testing, quantifier-promptforge-benchmarking, cost-optimization
Used By: Analyzer, Tuner, Quantifier, Sage, ALL agents creating production prompts
1---2name: clarity-promptforge-performance-optimization3description: >4 Use when optimizing prompt performance, reducing token costs, improving response5 speed, and enhancing prompt clarity without sacrificing output quality. This skill6 provides systematic optimization procedures for prompt efficiency.7metadata:8 source: https://skillmd.com/skills/construct-ai-primary/clarity-promptforge-performance-optimization9---1011# Clarity - Prompt Optimization & Performance Analytics1213## Overview14Clarity optimizes prompt performance for PromptForge AI. Good prompts aren't just correct—they're efficient, clear, and cost-effective. Clarity ensures every prompt delivers maximum quality at minimum cost.1516## When to Use17- When a prompt is too expensive (high token usage, excessive API costs)18- When a prompt is too slow (long response times, excessive reasoning)19- When a prompt produces verbose or unfocused outputs20- When optimizing prompts for production scale21- When balancing quality vs. cost trade-offs22- **Don't use when:** Designing new prompts from scratch (use blueprint-promptforge-template-designer)2324## Core Procedures2526### Step 1: Profile Current Performance27Measure the prompt's current state:28- **Token Usage:** Input tokens, output tokens, total tokens29- **Cost:** API cost per invocation, cost per month at current volume30- **Latency:** Average response time, p95, p9931- **Quality:** Current quality score (from analyzer metrics)32- **Verbosity:** Output length vs. information density3334### Step 2: Identify Optimization Opportunities35Common optimization targets:36- **Redundant Instructions:** Repeated or overlapping instructions37- **Unnecessary Context:** Information the model already knows38- **Verbose Examples:** Examples that are longer than needed39- **Over-Specification:** Constraints that don't improve output quality40- **Inefficient Structure:** Instructions ordered suboptimally4142### Step 3: Apply Optimizations43Optimization techniques:44- **Trim:** Remove words, sentences, sections that don't affect output quality45- **Consolidate:** Merge overlapping instructions46- **Prioritize:** Put most important instructions first (model attention decays)47- **Structure:** Use clear headings, bullet points, numbered lists48- **Constrain:** Add output length limits where appropriate4950### Step 4: Validate Optimization51After each optimization:52- [ ] Output quality is maintained or improved (compare to baseline)53- [ ] Token usage decreased (measure the improvement)54- [ ] No regression on edge cases55- [ ] Cost savings calculated and documented5657### Step 5: Document Optimization58```59OPTIMIZATION REPORT60===================61Prompt: [name and version]62Before: [tokens, cost, latency, quality]63After: [tokens, cost, latency, quality]64Changes Made: [specific optimizations applied]65Savings: [token reduction %, cost reduction %]66Quality Impact: [maintained/improved/degraded]67Recommendation: [deploy/revert/further optimize]68```6970## Success Metrics71- Token reduction: >=20% average reduction without quality loss72- Cost savings: >=15% average cost reduction per prompt73- Optimization cycle time: <2 hours per prompt optimization74- Quality maintenance: 0% quality regression after optimization7576## Error Handling77- **Error:** Optimization degrades output quality78 **Response:** Revert the specific change, investigate why it caused degradation, try alternative optimization79- **Error:** Optimization saves tokens but increases latency80 **Response:** Measure net impact, if latency increase is significant, reconsider the optimization81- **Error:** Prompt is already well-optimized (<5% further savings possible)82 **Response:** Document as optimized, focus effort on higher-impact prompts8384## Cross-Team Integration85**Related Skills:** analyzer-promptforge-prompt-analytics, tuner-promptforge-ab-testing, quantifier-promptforge-benchmarking, cost-optimization86**Used By:** Analyzer, Tuner, Quantifier, Sage, ALL agents creating production prompts