
anthropic-claude-development
Expert guidance for Anthropic Claude API development including Messages API, tool use, prompt engineering, and building production applications with Claude models.
- Installs
- 731
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/mindrally/skills --skill anthropic-claude-development- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads anthropic-claude-development automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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
import os
from anthropic import Anthropic
# Always use environment variables for API keys
client = Anthropic(api_key=os.environ.get("ANTHROPIC_API_KEY"))
Best Practices
- Store API keys in
.envfiles, never commit them - Use
python-dotenvfor local development - Set up separate keys for development and production
- Configure proper timeout settings for your use case
Messages API
Basic Usage
from anthropic import Anthropic
client = Anthropic()
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
system="You are a helpful assistant.",
messages=[
{"role": "user", "content": "Hello, Claude!"}
]
)
print(message.content[0].text)
Streaming Responses
with client.messages.stream(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "Write a story"}]
) as stream:
for text in stream.text_stream:
print(text, end="", flush=True)
Model Selection
- Use
claude-opus-4-20250514for complex reasoning and analysis - Use
claude-sonnet-4-20250514for balanced performance and cost - Use
claude-3-5-haiku-20241022for fast, efficient responses - Consider task complexity when selecting models
Tool Use (Function Calling)
Defining Tools
tools = [
{
"name": "get_weather",
"description": "Get the current weather in a given location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g., San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"],
"description": "The unit of temperature"
}
},
"required": ["location"]
}
}
]
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
tools=tools,
messages=[{"role": "user", "content": "What's the weather in London?"}]
)
Handling Tool Calls
import json
def process_tool_use(response, messages, tools):
# Check if Claude wants to use a tool
if response.stop_reason == "tool_use":
tool_use_block = next(
block for block in response.content
if block.type == "tool_use"
)
tool_name = tool_use_block.name
tool_input = tool_use_block.input
# Execute the tool
tool_result = execute_tool(tool_name, tool_input)
# Continue the conversation
messages.append({"role": "assistant", "content": response.content})
messages.append({
"role": "user",
"content": [{
"type": "tool_result",
"tool_use_id": tool_use_block.id,
"content": json.dumps(tool_result)
}]
})
# Get final response
return client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
tools=tools,
messages=messages
)
return response
Vision and Multimodal
Image Analysis
import base64
# From URL
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{
"role": "user",
"content": [
{
"type": "image",
"source": {
"type": "url",
"url": "https://example.com/image.jpg"
}
},
{
"type": "text",
"text": "Describe this image in detail."
}
]
}]
)
# From base64
with open("image.png", "rb") as f:
image_data = base64.standard_b64encode(f.read()).decode("utf-8")
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{
"role": "user",
"content": [
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png",
"data": image_data
}
},
{
"type": "text",
"text": "What do you see?"
}
]
}]
)
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
system_prompt = """You are a technical documentation writer.
<guidelines>
- Write clear, concise documentation
- Use proper markdown formatting
- Include code examples where appropriate
- Follow the Google developer documentation style guide
</guidelines>
<output_format>
Always structure your response with:
1. Overview
2. Prerequisites
3. Step-by-step instructions
4. Examples
5. Troubleshooting
</output_format>
"""
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
from anthropic import RateLimitError, APIError
import time
def call_with_retry(func, max_retries=3, base_delay=1):
for attempt in range(max_retries):
try:
return func()
except RateLimitError:
delay = base_delay * (2 ** attempt)
print(f"Rate limited. Retrying in {delay}s...")
time.sleep(delay)
except APIError as e:
if attempt == max_retries - 1:
raise
time.sleep(base_delay)
raise Exception("Max retries exceeded")
Common Error Types
RateLimitError: Implement exponential backoffAPIError: Check API status, retry with backoffAuthenticationError: Verify API keyBadRequestError: Validate input parameters
Prompt Caching
Using Caching
# Enable caching for frequently used context
response = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
system=[{
"type": "text",
"text": "Large context that should be cached...",
"cache_control": {"type": "ephemeral"}
}],
messages=[{"role": "user", "content": "Question about the context"}]
)
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
# Create a batch for non-time-sensitive requests
batch = client.messages.batches.create(
requests=[
{
"custom_id": "request-1",
"params": {
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Question 1"}]
}
},
{
"custom_id": "request-2",
"params": {
"model": "claude-sonnet-4-20250514",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Question 2"}]
}
}
]
)
Cost Optimization
- Use appropriate models for task complexity
- Implement prompt caching for repeated context
- Use batches for non-urgent requests
- Set reasonable
max_tokenslimits - 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)
FAQ
What does the anthropic-claude-development skill do?
Expert guidance for Anthropic Claude API development including Messages API, tool use, prompt engineering, and building production applications with Claude models.
How do I install anthropic-claude-development?
Run npx skills add https://github.com/mindrally/skills --skill anthropic-claude-development in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/anthropic-claude-development/ (personal) or .claude/skills/anthropic-claude-development/ (project).
Which AI agents can use anthropic-claude-development?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is anthropic-claude-development safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains anthropic-claude-development?
It is published by mindrally in mindrally/skills. It has 731 recorded installs.
More from mindrally/skills
fastapi-python
mindrally/skills
Expert in FastAPI Python development with best practices for APIs and async operations
nextjs-react-typescript
mindrally/skills
Expert in TypeScript, Node.js, Next.js App Router, React, Shadcn UI, Radix UI and Tailwind
web-scraping
mindrally/skills
Expert in web scraping and data extraction with Python tools
computer-vision-opencv
mindrally/skills
Expert guidance for computer vision development using OpenCV, PyTorch, and modern deep learning techniques for image and video processing.
framer-motion
mindrally/skills
Expert guidelines for building performant animations with Framer Motion/Motion library in React applications
chrome-extension-development
mindrally/skills
Expert guidelines for Chrome extension development with Manifest V3, covering security, performance, and best practices. Use when building browser extensions, creating popup UIs, implementing content scripts, working with Chrome APIs, managing extension permissions, or publishing to Chrome Web Store.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available