Skip to main content

Overview

Quick Actions provide instant transformations for selected text or code. With a single click, apply expert-level operations like code explanation, optimization, translation, summarization, and more.

Available Actions

Explain Code

Get detailed explanations with examples and step-by-step breakdowns

Optimize

Performance and efficiency improvements with benchmarking

Debug

Systematic bug analysis with solutions and fixes

Add Comments

Comprehensive documentation and inline comments

Translate

Multi-language translation with cultural context

Summarize

Concise summaries with key points extraction

Review

Expert review with constructive feedback

Improve

Quality improvements for clarity and impact

Simplify

Make complex text accessible to all audiences

Expand

Elaborate and add depth to ideas

Code Actions

1. Explain Code 💡

What it does: Provides clear, educational explanations of code
// From: src/data/templates.ts - Quick Actions

SystemPrompt: `
  Programming educator with expertise in multiple languages.
  Explain code covering:
  
  1. What it does (function/purpose)
  2. How it works (step-by-step breakdown)
  3. Why it's written this way (design decisions)
  4. Key concepts (patterns, algorithms, features)
  5. Potential improvements or alternatives
  
  Use analogies and provide practical examples.
`
Example Usage:
// Select this code and click "Explain Code"
const fibonacci = (n) => {
  if (n <= 1) return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
};
Recommended Models: GPT-4, Claude-3, CodeLlama

2. Optimize Code ⚡

What it does: Analyzes and improves code performance Analysis Areas:
  • Time complexity: Algorithmic efficiency (Big O)
  • Space complexity: Memory usage optimization
  • Readability: Code clarity and maintainability
  • Best practices: Modern conventions and patterns
  • Language-specific: Idioms and optimizations
Example Output:
// Original code performance issues identified:
// 1. O(n²) nested loops - use hash map instead
// 2. Repeated array allocations - use single buffer
// 3. Missing index optimization - add early exit

// Optimized version provided with:
// - O(n) time complexity (was O(n²))
// - 50% memory reduction
// - Early exit conditions
// - Benchmark: 10x faster on 1000+ items

3. Debug Code 🐛

What it does: Systematic bug detection and resolution Checks For:
  1. Syntax and compilation errors
  2. Logical errors and incorrect assumptions
  3. Runtime exceptions and edge cases
  4. Performance bottlenecks
  5. Security vulnerabilities
For Each Issue:
  • Clear problem description
  • Why it occurs (root cause)
  • Specific solution with code
  • Prevention recommendations

4. Add Comments 📝

What it does: Generates comprehensive code documentation Documentation Types:
/**
 * Calculates the total price including tax
 * @param {number} price - Base price before tax
 * @param {number} taxRate - Tax rate as decimal (e.g., 0.08 for 8%)
 * @returns {number} Total price with tax applied
 * @throws {Error} If price is negative or taxRate is invalid
 * @example
 * calculateTotal(100, 0.08) // Returns 108
 */
function calculateTotal(price: number, taxRate: number): number {
  // Validate inputs to prevent calculation errors
  if (price < 0) throw new Error('Price cannot be negative');
  if (taxRate < 0 || taxRate > 1) throw new Error('Invalid tax rate');
  
  // Calculate tax amount and add to base price
  const tax = price * taxRate;
  return price + tax;
}

Text Actions

5. Translate 🌐

What it does: Professional translation with cultural context Features:
  • Preserves original meaning and intent
  • Adapts idioms and cultural references
  • Maintains appropriate tone and formality
  • Handles technical terminology correctly
  • Considers regional variations
Usage Example:
Original (English):
"Let's touch base next week to circle back on this."

Translation (French - Professional):
"Reprenons contact la semaine prochaine pour faire le point."

Note: Avoided literal translation of "touch base" and "circle back"
which don't translate well. Used professional equivalents.

6. Summarize 📋

What it does: Creates concise summaries with key points Output Structure:
## Key Points
- Main idea 1 (most important)
- Main idea 2 
- Main idea 3

## Supporting Details
- Critical detail 1
- Critical detail 2

## Conclusions
- Primary conclusion
- Action items (if applicable)
Adapts Length Based On:
  • Original content length
  • Complexity of topics
  • Purpose (quick overview vs detailed brief)

7. Review ✅

What it does: Expert content review with constructive feedback Evaluation Criteria:
  1. Effectiveness: Does it achieve its purpose?
  2. Structure: Logical flow and organization
  3. Clarity: Easy to understand and follow
  4. Accuracy: Factual correctness and completeness
  5. Impact: Engagement and persuasiveness
Feedback Format:
  • Strengths: What works well
  • ⚠️ Issues: Specific problems identified
  • 💡 Suggestions: Actionable improvements
  • 📊 Overall: Summary assessment and rating

8. Improve Writing ✍️

What it does: Enhances clarity, style, and impact Improvements Include:
  • Remove ambiguous phrasing
  • Simplify complex sentences
  • Eliminate redundancy
  • Strengthen topic sentences
  • Consistent voice and tone
  • Better word choice
  • Varied sentence structure
  • Active voice preference
  • Fix grammatical errors
  • Correct punctuation
  • Proper tense consistency
  • Subject-verb agreement
  • Stronger opening and closing
  • More persuasive language
  • Better flow and transitions
  • Enhanced readability
Example:
- Original:
  "The thing that we want to do is make our product better 
  so that people will want to use it more."

+ Improved:
  "We aim to enhance our product to increase user engagement 
  and satisfaction."
  
  Changes:
  - Removed filler ("the thing that")
  - Used stronger verbs ("enhance" vs "make better")
  - More professional tone
  - Clearer, more direct statement

9. Simplify 🔍

What it does: Makes complex text accessible Techniques:
  • Replace jargon with plain language
  • Break down complex concepts
  • Use active voice
  • Shorten sentences (aim for 15-20 words)
  • Add examples and analogies
Before/After Example:
The implementation of a comprehensive algorithmic approach to data 
processing necessitates the utilization of advanced computational 
methodologies that facilitate the optimization of resource allocation 
while simultaneously minimizing latency-induced performance degradation.

10. Expand Ideas 📈

What it does: Adds depth and detail to concepts Expansion Methods:
  1. Deeper explanation: More detailed breakdown
  2. Examples: Real-world cases and scenarios
  3. Evidence: Supporting data and research
  4. Connections: Related concepts and implications
  5. Applications: How to use the ideas practically
Example:
Original:
"Regular exercise improves health."

Expanded:
"Regular exercise improves health through multiple mechanisms:

1. Cardiovascular Benefits
   - Strengthens heart muscle (40% reduction in heart disease risk)
   - Improves circulation and oxygen delivery
   - Reduces blood pressure (average 5-10 mmHg decrease)
   - Example: 30 minutes of brisk walking daily

2. Metabolic Effects
   - Increases insulin sensitivity by 20-30%
   - Boosts metabolism for 24-48 hours post-exercise
   - Helps maintain healthy weight
   - Example: Resistance training 2-3x per week

3. Mental Health
   - Reduces depression symptoms (as effective as medication in studies)
   - Decreases anxiety through endorphin release
   - Improves sleep quality
   - Example: Any exercise you enjoy for consistency

Recommendations:
- Start with 150 minutes/week moderate activity (WHO guidelines)
- Include both cardio and strength training
- Find activities you enjoy for long-term adherence

How to Use Quick Actions

1

Select Text or Code

Highlight the content you want to transform
2

Choose Action

Click the appropriate quick action button in the interface
3

Review Result

The AI processes your selection with optimized prompts
4

Iterate if Needed

Apply multiple actions sequentially (e.g., Optimize → Add Comments)

Technical Implementation

Quick Action Structure

// From: src/data/templates.ts

interface QuickAction {
  id: string;                    // Unique identifier
  name: string;                  // Display name
  icon: string;                  // Icon emoji
  action: string;                // Action type
  description: string;           // What it does
  requiresSelection: boolean;    // Must select text first
  modelSpecific?: string[];      // Recommended models
  systemPrompt: string;          // Expert instructions
  userMessageTemplate: string;   // Template with {selectedText}
}

Example Quick Action Definition

// Explain Code quick action
{
  id: 'explain-code',
  name: 'Explain Code',
  icon: '💡',
  action: 'explain',
  description: 'Get a clear explanation of the selected code with examples',
  requiresSelection: true,
  modelSpecific: ['gpt-4', 'claude-3', 'codellama'],
  systemPrompt: `You are a programming educator...`,
  userMessageTemplate: `Please explain this code in detail:

\`\`\`
{selectedText}
\`\`\`

Include:
- Overall purpose and functionality
- Step-by-step execution flow
- Important constructs
- Best practices used
- Potential limitations`
}

Best Practices

Select Appropriately

Select complete functions, paragraphs, or logical units - not fragments

Chain Actions

Apply multiple actions: Debug → Optimize → Add Comments for complete improvement

Context Matters

Provide surrounding context when selecting complex code or technical text

Review Results

Always review AI suggestions - they’re helpers, not replacements for judgment
Quick Actions work with all models, but some excel at specific tasks:
ActionBest ModelsWhy
Code ActionsGPT-4, Claude 4.5, CodeLlamaSuperior code understanding
TranslateGPT-4, Claude-3, Gemini ProStrong multilingual capabilities
SummarizeClaude 4.5, GPT-5.2Excellent comprehension
Improve WritingClaude 4.5, GPT-4Natural language expertise
SimplifyGPT-4, Claude-3Clear explanation abilities
ExpandGPT-5.2, Claude 4.5, Gemini 3Creative and comprehensive
All 10 quick actions are available in src/data/templates.ts as part of the QUICK_ACTIONS array.

Next: Image Generation

Learn about AI-powered image generation with automatic retry

Build docs developers (and LLMs) love