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: Use when optimizing prompt performance, reducing token costs, improving response speed, and enhancing prompt clarity without sacrificing output quality. This skill provides systematic optimization procedures for prompt efficiency.4---56# Clarity - Prompt Optimization & Performance Analytics78## Overview9Clarity 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.1011## When to Use12- When a prompt is too expensive (high token usage, excessive API costs)13- When a prompt is too slow (long response times, excessive reasoning)14- When a prompt produces verbose or unfocused outputs15- When optimizing prompts for production scale16- When balancing quality vs. cost trade-offs17- **Don't use when:** Designing new prompts from scratch (use blueprint-promptforge-template-designer)1819## Core Procedures2021### Step 1: Profile Current Performance22Measure the prompt's current state:23- **Token Usage:** Input tokens, output tokens, total tokens24- **Cost:** API cost per invocation, cost per month at current volume25- **Latency:** Average response time, p95, p9926- **Quality:** Current quality score (from analyzer metrics)27- **Verbosity:** Output length vs. information density2829### Step 2: Identify Optimization Opportunities30Common optimization targets:31- **Redundant Instructions:** Repeated or overlapping instructions32- **Unnecessary Context:** Information the model already knows33- **Verbose Examples:** Examples that are longer than needed34- **Over-Specification:** Constraints that don't improve output quality35- **Inefficient Structure:** Instructions ordered suboptimally3637### Step 3: Apply Optimizations38Optimization techniques:39- **Trim:** Remove words, sentences, sections that don't affect output quality40- **Consolidate:** Merge overlapping instructions41- **Prioritize:** Put most important instructions first (model attention decays)42- **Structure:** Use clear headings, bullet points, numbered lists43- **Constrain:** Add output length limits where appropriate4445### Step 4: Validate Optimization46After each optimization:47- [ ] Output quality is maintained or improved (compare to baseline)48- [ ] Token usage decreased (measure the improvement)49- [ ] No regression on edge cases50- [ ] Cost savings calculated and documented5152### Step 5: Document Optimization53```54OPTIMIZATION REPORT55===================56Prompt: [name and version]57Before: [tokens, cost, latency, quality]58After: [tokens, cost, latency, quality]59Changes Made: [specific optimizations applied]60Savings: [token reduction %, cost reduction %]61Quality Impact: [maintained/improved/degraded]62Recommendation: [deploy/revert/further optimize]63```6465## Success Metrics66- Token reduction: >=20% average reduction without quality loss67- Cost savings: >=15% average cost reduction per prompt68- Optimization cycle time: <2 hours per prompt optimization69- Quality maintenance: 0% quality regression after optimization7071## Error Handling72- **Error:** Optimization degrades output quality73 **Response:** Revert the specific change, investigate why it caused degradation, try alternative optimization74- **Error:** Optimization saves tokens but increases latency75 **Response:** Measure net impact, if latency increase is significant, reconsider the optimization76- **Error:** Prompt is already well-optimized (<5% further savings possible)77 **Response:** Document as optimized, focus effort on higher-impact prompts7879## Cross-Team Integration80**Related Skills:** analyzer-promptforge-prompt-analytics, tuner-promptforge-ab-testing, quantifier-promptforge-benchmarking, cost-optimization81**Used By:** Analyzer, Tuner, Quantifier, Sage, ALL agents creating production prompts