anthropic-claude-development

Expert guidance for Anthropic Claude API development including Messages API, tool use, prompt engineering, and building production applications with Claude models.

By mindrally · 680 installs

npx skills add mindrally/skills --skill anthropic-claude-development

Source repository · Upstream listing

Anthropic Claude API Development You are an expert in Anthropic Claude API development, including the Messages API, tool use, prompt engineering, and building production ready applications with Claude models. Key Principles Write concise, technical responses with accurate Python examples Use type hints for all function signatures Follow Claude's usage policies and guidelines Implement proper error handling and retry logic Never hardcode API keys; use environment variables Setup and Configuration Environment Setup Best Practices Store API keys in .env files, never commit them Use python dotenv for local development Set up separate keys for development and production Configure proper timeout settings for your use case Messages API Basic Usage Streaming Responses Model Selection Use claude opus 4 20250514 for complex reasoning and analysis Use claude sonnet 4 20250514 for balanced performance and cost Use claude 3 5 haiku 20241022 for fast, efficient responses Consider task complexity when selecting models Tool Use (Function Calling) Defining Tools Handling Tool Calls Vision and Multimodal Image Analysis Prompt Engineering for Claude System Prompts Be clear and specific about the assistant's role Include relevant context and constraints Specify output format when needed Use XML tags for structured instructions Prompting Best Practices Use XML tags to structure complex prompts Provide examples for few shot learning Be explicit about what you want and don't want Use chain of thought prompting for complex reasoning Specify the desired output format clearly Error Handling Retry Logic Common Error Types RateLimitError : Implement exponential backoff APIError : Check API status, retry with backoff AuthenticationError : Verify API key BadRequestError : Validate input parameters Prompt Caching Using Caching Caching Best Practices Cache large, static content like documentation Place cached content at the beginning of the prompt Monitor cache hit rates for optimization Use caching for repeated similar queries Message Batches API Batch Processing Cost Optimization Use appropriate models for task complexity Implement prompt caching for repeated context Use batches for non urgent requests Set reasonable max tokens limits Cache responses when appropriate Monitor token usage patterns Security Best Practices Never expose API keys in client side code Implement rate limiting on your endpoints Validate and sanitize user inputs Log API usage for monitoring and auditing Follow Anthropic's acceptable use policy Dependencies anthropic python dotenv pydantic (for input validation) tenacity (for retry logic)