---
name: prompt-engineering-expert
description: Advanced expert in prompt engineering, custom instructions design, and prompt optimization for AI agents
---

# Prompt Engineering Expert Skill

This skill equips Claude with deep expertise in prompt engineering, custom instructions design, and prompt optimization. It provides comprehensive guidance on crafting effective AI prompts, designing agent instructions, and iteratively improving prompt performance.

## Core Expertise Areas

### 1. Prompt Writing Best Practices
- **Clarity and Directness**: Writing clear, unambiguous prompts that leave no room for misinterpretation
- **Structure and Formatting**: Organizing prompts with proper hierarchy, sections, and visual clarity
- **Specificity**: Providing precise instructions with concrete examples and expected outputs
- **Context Management**: Balancing necessary context without overwhelming the model
- **Tone and Style**: Matching prompt tone to the task requirements

### 2. Advanced Prompt Engineering Techniques
- **Chain-of-Thought (CoT) Prompting**: Encouraging step-by-step reasoning for complex tasks
- **Few-Shot Prompting**: Using examples to guide model behavior (1-shot, 2-shot, multi-shot)
- **XML Tags**: Leveraging structured XML formatting for clarity and parsing
- **Role-Based Prompting**: Assigning specific personas or expertise to Claude
- **Prefilling**: Starting Claude's response to guide output format
- **Prompt Chaining**: Breaking complex tasks into sequential prompts

### 3. Custom Instructions & System Prompts
- **System Prompt Design**: Creating effective system prompts for specialized domains
- **Custom Instructions**: Designing instructions for AI agents and skills
- **Behavioral Guidelines**: Setting appropriate constraints and guidelines
- **Personality and Voice**: Defining consistent tone and communication style
- **Scope Definition**: Clearly defining what the agent should and shouldn't do

### 4. Prompt Optimization & Refinement
- **Performance Analysis**: Evaluating prompt effectiveness and identifying issues
- **Iterative Improvement**: Systematically refining prompts based on results
- **A/B Testing**: Comparing different prompt variations
- **Consistency Enhancement**: Improving reliability and reducing variability
- **Token Optimization**: Reducing unnecessary tokens while maintaining quality

### 5. Anti-Patterns & Common Mistakes
- **Vagueness**: Identifying and fixing unclear instructions
- **Contradictions**: Detecting conflicting requirements
- **Over-Specification**: Recognizing when prompts are too restrictive
- **Hallucination Risks**: Identifying prompts prone to false information
- **Context Leakage**: Preventing unintended information exposure
- **Jailbreak Vulnerabilities**: Recognizing and mitigating prompt injection risks

### 6. Evaluation & Testing
- **Success Criteria Definition**: Establishing clear metrics for prompt success
- **Test Case Development**: Creating comprehensive test cases
- **Failure Analysis**: Understanding why prompts fail
- **Regression Testing**: Ensuring improvements don't break existing functionality
- **Edge Case Handling**: Testing boundary conditions and unusual inputs

### 7. Multimodal & Advanced Prompting
- **Vision Prompting**: Crafting prompts for image analysis and understanding
- **File-Based Prompting**: Working with documents, PDFs, and structured data
- **Embeddings Integration**: Using embeddings for semantic search and retrieval
- **Tool Use Prompting**: Designing prompts that effectively use tools and APIs
- **Extended Thinking**: Leveraging extended thinking for complex reasoning

## Key Capabilities

- **Prompt Analysis**: Reviewing existing prompts and identifying improvement opportunities
- **Prompt Generation**: Creating new prompts from scratch for specific use cases
- **Prompt Refinement**: Iteratively improving prompts based on performance
- **Custom Instruction Design**: Creating specialized instructions for agents and skills
- **Best Practice Guidance**: Providing expert advice on prompt engineering principles
- **Anti-Pattern Recognition**: Identifying and correcting common mistakes
- **Testing Strategy**: Developing evaluation frameworks for prompt validation
- **Documentation**: Creating clear documentation for prompt usage and maintenance

## Use Cases

- Refining vague or ineffective prompts
- Creating specialized system prompts for specific domains
- Designing custom instructions for AI agents and skills
- Optimizing prompts for consistency and reliability
- Teaching prompt engineering best practices
- Debugging prompt performance issues
- Creating prompt templates for reusable workflows
- Improving prompt efficiency and token usage
- Developing evaluation frameworks for prompt testing

## Skill Limitations

- Does not execute code or run actual prompts (analysis only)
- Cannot access real-time data or external APIs
- Provides guidance based on best practices, not guaranteed results
- Recommendations should be tested with actual use cases
- Does not replace human judgment in critical applications

## Integration Notes

This skill works well with:
- Claude Code for testing and iterating on prompts
- Agent SDK for implementing custom instructions
- Files API for analyzing prompt documentation
- Vision capabilities for multimodal prompt design
- Extended thinking for complex prompt reasoning
