> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Teeflo/PolyChat-AI/llms.txt
> Use this file to discover all available pages before exploring further.

# Conversation Templates

> 27 professionally crafted templates across 7 categories for common tasks

## Overview

PolyChat-AI includes 27 pre-built conversation templates designed by experts to help you get the most out of AI interactions. Each template includes optimized system prompts, user message structures, and suggested models.

## Template Categories

Templates are organized into 7 main categories:

<CardGroup cols={2}>
  <Card title="Programming" icon="code" color="#3B82F6">
    **4 templates** - Code review, debugging, optimization, documentation
  </Card>

  <Card title="Writing" icon="pen" color="#10B981">
    **3 templates** - Content creation, grammar review, email writing
  </Card>

  <Card title="Analysis" icon="chart-bar" color="#F59E0B">
    **2 templates** - Data analysis, market research
  </Card>

  <Card title="Creative" icon="palette" color="#8B5CF6">
    **2 templates** - Brainstorming, story writing
  </Card>

  <Card title="Learning" icon="graduation-cap" color="#EF4444">
    **2 templates** - Concept explanation, study planning
  </Card>

  <Card title="Business" icon="briefcase" color="#06B6D4">
    **2 templates** - Business strategy, presentation prep
  </Card>

  <Card title="Personal" icon="star" color="#EC4899">
    **2 templates** - Goal setting, decision making
  </Card>
</CardGroup>

## Programming Templates

### 1. Advanced Code Review

**Purpose**: Deep code analysis focusing on security, performance, and best practices

```typescript theme={null}
// Template ID: code-review-advanced
// Recommended Models: GPT-4, Claude-3-Opus

SystemPrompt: `
  Senior software expert with 15+ years experience.
  Analyze code with focus on:
  
  1. Security (OWASP Top 10, vulnerabilities)
  2. Performance (Big O, memory management)
  3. Code Quality (SOLID, design patterns)
  4. Testing (coverage, edge cases)
  
  Classify issues by criticality:
  - Critical: Security flaws, crashes
  - Major: Performance issues, functional bugs  
  - Minor: Style, readability
`
```

**What You Get**:

* OWASP Top 10 security analysis
* Performance optimization suggestions
* SOLID principles compliance review
* Test coverage recommendations

### 2. Advanced Debugging

**Purpose**: Systematic troubleshooting for complex bugs

**Key Features**:

* Root cause analysis using 5 Whys method
* Race condition and concurrency issue detection
* Step-by-step diagnostic methodology
* Prevention recommendations

### 3. Performance Optimization

**Purpose**: Optimize code for maximum performance

**Analysis Areas**:

* Algorithmic complexity (time & space)
* Memory management and GC pressure
* Concurrency and parallelization
* Language-specific optimizations

### 4. Complete Documentation

**Purpose**: Generate comprehensive technical documentation

**Includes**:

* JSDoc/TypeDoc/Python docstrings
* API reference with examples
* README with badges and setup
* Architecture diagrams and guides

## Writing Templates

### 1. Professional Content Creation

```typescript theme={null}
// Template ID: creation-contenu-pro
// Focus: SEO-optimized, engaging content

Features:
- SEO keyword optimization (1-2% density)
- Attention-grabbing hooks
- Structured with H1/H2/H3 headings
- Clear calls-to-action
- Social proof and statistics integration
```

**Best For**:

* Blog articles (1000-2000 words)
* LinkedIn posts with engagement
* Landing pages with conversion focus
* Email newsletters

### 2. Grammar & Style Review

**Expert editor** analyzing:

* Grammar and mechanics
* Style and tone consistency
* Clarity and flow
* Content impact

### 3. Professional Email Writing

**Features**:

* Context-appropriate formality
* Clear subject lines
* Action-oriented language
* Cultural sensitivity

## Analysis Templates

### 1. Comprehensive Data Analysis

```python theme={null}
# Template provides structured data analysis:

1. Data Understanding
   - Quality assessment (completeness, accuracy)
   - Statistical summaries
   - Outlier detection

2. Exploratory Analysis  
   - Descriptive statistics
   - Correlation analysis
   - Trend identification

3. Advanced Analytics
   - Predictive modeling
   - Statistical significance testing
   - Cluster analysis

4. Business Insights
   - Actionable recommendations
   - Risk/opportunity identification
   - Performance benchmarking
```

### 2. Market Research & Competitive Analysis

**Research Framework**:

* Market size and growth projections
* Competitive landscape mapping
* Customer analysis and personas
* SWOT analysis
* Strategic recommendations

## Creative Templates

### 1. Structured Brainstorming

**Techniques Used**:

* SCAMPER (Substitute, Combine, Adapt, Modify, Put to another use, Eliminate, Reverse)
* Mind mapping and lateral thinking
* Cross-industry analogies
* Reverse brainstorming

**Evaluation Framework**:

* Feasibility, desirability, viability
* Resource requirements
* Risk assessment

### 2. Professional Story Writing

**Story Elements**:

* Compelling plot structure
* Character development arcs
* Vivid setting and world-building
* Consistent narrative voice
* Universal themes

**Supports**: Fantasy, sci-fi, mystery, romance, thriller, literary fiction

## Learning Templates

### 1. Clear Concept Explanation

```javascript theme={null}
// Pedagogical approach:
{
  assessment: "Evaluate learner's current level",
  structure: "Big picture → Components → Details",
  tools: [
    "Analogies and metaphors",
    "Real-world examples",
    "Visual descriptions",
    "Step-by-step processes"
  ],
  reinforcement: "Questions, practice, multiple perspectives"
}
```

### 2. Personalized Study Plan

**Includes**:

* SMART learning objectives
* Spaced repetition schedule
* Resource selection (text, video, interactive)
* Progress tracking and milestones
* Evidence-based techniques (active recall, interleaving)

## Business Templates

### 1. Comprehensive Business Strategy

**Strategic Framework**:

<Steps>
  <Step title="Situation Analysis">
    Internal/external assessment, stakeholder mapping, SWOT
  </Step>

  <Step title="Strategic Direction">
    Vision, objectives, KPIs, competitive advantage
  </Step>

  <Step title="Strategy Formulation">
    Growth strategies, innovation, partnerships
  </Step>

  <Step title="Implementation Planning">
    Resource allocation, initiatives, timeline, budget
  </Step>

  <Step title="Risk Management">
    Risk identification, scenario planning, controls
  </Step>
</Steps>

### 2. Compelling Presentation Preparation

**Design Principles**:

* Audience analysis and tailoring
* Clear single overarching message
* Visual design best practices
* Delivery strategy and timing
* Q\&A preparation

## Personal Templates

### 1. SMART Goal Setting

**Goal Framework**:

* **S**pecific: Clear, well-defined outcomes
* **M**easurable: Quantifiable progress indicators
* **A**chievable: Realistic given resources
* **R**elevant: Aligned with broader objectives
* **T**ime-bound: Clear deadlines and milestones

### 2. Structured Decision Making

**Process**:

1. Problem Definition (clarify needs, values)
2. Option Generation (creative alternatives)
3. Evaluation Framework (weighted criteria)
4. Analysis & Validation (data, advisors)
5. Implementation Planning (action steps, risks)

## Using Templates

### How to Apply

<Steps>
  <Step title="Access Templates">
    Click the template icon in the chat input area
  </Step>

  <Step title="Browse or Search">
    Browse by category or search for specific templates
  </Step>

  <Step title="Select Template">
    Click on a template to preview its system prompt and structure
  </Step>

  <Step title="Customize">
    Fill in placeholders (marked with \[brackets]) with your specific information
  </Step>

  <Step title="Send">
    Send the message - the template's system prompt is automatically applied
  </Step>
</Steps>

### Template Structure

Each template includes:

```typescript theme={null}
interface ConversationTemplate {
  id: string;                    // Unique identifier
  name: string;                  // Display name
  category: string;              // One of 7 categories
  description: string;           // What the template does
  systemPrompt: string;          // Expert system instructions
  userMessage: string;           // User message template with placeholders
  tags: string[];                // Searchable tags
  modelSpecific?: string[];      // Recommended models
  icon: string;                  // Display icon
  color: string;                 // Category color
  examples?: string[];           // Usage examples
}
```

## Template Examples

<Tabs>
  <Tab title="Code Review">
    ```typescript theme={null}
    // Example usage of Advanced Code Review template

    // System Prompt (auto-applied):
    // "You are a senior software expert..."

    // User fills in:
    const userMessage = `
    Code to analyze:

    \`\`\`typescript
    async function fetchUserData(userId: string) {
      const response = await fetch('/api/users/' + userId);
      return response.json();
    }
    \`\`\`

    Context:
    - Objective: Fetch user data from API
    - Domain: E-commerce platform
    - Constraints: Security critical, high traffic

    Priority checks:
    - Security vulnerabilities (SQL injection, XSS)
    - Error handling
    - Performance for 10k+ requests/sec
    `;
    ```
  </Tab>

  <Tab title="Content Creation">
    ```markdown theme={null}
    # Example: Professional Content Creation template

    Subject: "Benefits of Remote Work for SMBs"

    Format: Blog article
    Objective: Inform and convince
    Keywords: remote work, SMB productivity, cost savings
    Tone: Professional but accessible

    Target Audience:
    - Demographics: SMB owners, 30-55 years old
    - Interest: Business efficiency, cost optimization
    - Knowledge: Intermediate business knowledge

    Length: 1500 words

    Constraints:
    - Include 3-5 statistics
    - Add real-world examples
    - SEO optimized for "remote work SMB benefits"
    ```
  </Tab>

  <Tab title="Study Plan">
    ```yaml theme={null}
    # Example: Personalized Study Plan template

    Subject: Machine Learning Fundamentals

    Current Level: Beginner (know Python basics)
    Background: Software developer, 3 years experience
    Learning Style: Hands-on with projects
    Available Time: 10 hours/week

    Goals:
    - Primary: Build ML models from scratch
    - Timeline: 3 months
    - Outcomes: Deploy a real ML project
    - Priority: Understanding math foundations

    Resources Available:
    - Books: "Hands-On Machine Learning"
    - Online: Coursera, YouTube
    - Practice: Kaggle datasets

    Success Metrics:
    - Complete 5 ML projects
    - Pass Kaggle beginner competitions
    ```
  </Tab>
</Tabs>

## Customization

### Creating Custom Templates

While PolyChat-AI includes 27 pre-built templates, you can create custom workflows:

1. **Save successful prompts**: Export conversations that worked well
2. **Reuse system prompts**: Copy effective system instructions
3. **Build template library**: Maintain personal collection
4. **Share with team**: Export and share template JSON

<Note>
  Future versions will support custom template creation and saving directly in the UI (see Roadmap).
</Note>

## Best Practices

<AccordionGroup>
  <Accordion title="Choosing the Right Template">
    * **Match task type**: Use programming templates for code, writing for content
    * **Check examples**: Review template examples to ensure fit
    * **Read system prompt**: Understand what expertise is activated
    * **Try recommended models**: Templates suggest optimal models
  </Accordion>

  <Accordion title="Customizing Templates">
    * **Fill all placeholders**: Replace \[bracketed] text with specifics
    * **Add context**: More context = better results
    * **Be specific**: Detailed requirements yield detailed answers
    * **Iterate**: Refine prompts based on initial results
  </Accordion>

  <Accordion title="Template Performance">
    * **Use recommended models**: Templates are optimized for specific models
    * **Adjust system prompts**: Modify if results don't match needs
    * **Combine templates**: Use insights from multiple templates
    * **Track what works**: Note which templates perform best for your needs
  </Accordion>
</AccordionGroup>

## Template Source Code

All templates are defined in:

```typescript theme={null}
// Location: src/data/templates.ts
export const PRE_BUILT_TEMPLATES: ConversationTemplate[] = [
  // 27 templates with complete system prompts
];

export const TEMPLATE_CATEGORIES: TemplateCategoryInfo[] = [
  // 7 category definitions
];
```

<Card title="Next: Quick Actions" icon="zap" href="/features/quick-actions">
  Discover 10+ instant text and code transformations
</Card>
