Claude cookbooks

From aiskillstore/marketplace · View interactive version

Claude cookbooks is an AI agent skill from the GitHub repository aiskillstore/marketplace. Claude AI cookbooks - code examples, tutorials, and best practices for using Claude API. Use when learning Claude API integration, building Claude-powered applications, or exploring Claude capabilities.

How to use this skill

Skill file

Claude Cookbooks Skill

Comprehensive code examples and guides for building with Claude AI, sourced from the official Anthropic cookbooks repository.

When to Use This Skill

This skill should be triggered when:

Quick Reference

Basic API Usage

import anthropic

client = anthropic.Anthropic(api_key="your-api-key")

# Simple message
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": "Hello, Claude!"
    }]
)

Tool Use (Function Calling)

# Define a tool
tools = [{
    "name": "get_weather",
    "description": "Get current weather for a location",
    "input_schema": {
        "type": "object",
        "properties": {
            "location": {"type": "string", "description": "City name"}
        },
        "required": ["location"]
    }
}]

# Use the tool
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    tools=tools,
    messages=[{"role": "user", "content": "What's the weather in San Francisco?"}]
)

Vision (Image Analysis)

# Analyze an image
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "image",
                "source": {
                    "type": "base64",
                    "media_type": "image/jpeg",
                    "data": base64_image
                }
            },
            {"type": "text", "text": "Describe this image"}
        ]
    }]
)

Prompt Caching

# Use prompt caching for efficiency
response = client.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=1024,
    system=[{
        "type": "text",
        "text": "Large system prompt here...",
        "cache_control": {"type": "ephemeral"}
    }],
    messages=[{"role": "user", "content": "Your question"}]
)

Key Capabilities Covered

1. Classification

2. Retrieval Augmented Generation (RAG)

3. Summarization

4. Text-to-SQL

5. Tool Use & Function Calling

6. Multimodal

7. Advanced Patterns

Repository Structure

The cookbooks are organized into these main categories:

Reference Files

This skill includes comprehensive documentation in references/:

Common Use Cases

Building a Customer Service Agent

  1. Define tools for CRM access, ticket creation, knowledge base search
  2. Use tool use API to handle function calls
  3. Implement conversation memory
  4. Add fallback mechanisms

See: references/tool_use.md#customer-service

Implementing RAG

  1. Create embeddings of your documents
  2. Store in vector database (Pinecone, etc.)
  3. Retrieve relevant context on query
  4. Augment Claude's response with context

See: references/capabilities.md#rag

Processing Documents with Vision

  1. Convert document to images or PDF
  2. Use vision API to extract content
  3. Structure the extracted data
  4. Validate and post-process

See: references/multimodal.md#vision

Building Multi-Agent Systems

  1. Define specialized agents for different tasks
  2. Implement routing logic
  3. Use sub-agents for delegation
  4. Aggregate results

See: references/patterns.md#agents

Best Practices

API Usage

Prompt Engineering

Tool Use

Multimodal

Performance Optimization

Prompt Caching

Cost Optimization

Latency Optimization

Resources

Official Documentation

Community

Learning Resources

Working with This Skill

For Beginners

Start with references/main_readme.md and explore basic examples in references/capabilities.md

For Specific Features

For Code Examples

Each reference file contains practical, copy-pasteable code examples

Examples Available

The cookbook includes 50+ practical examples including:

Notes

Skill Source

This skill was created from the official Anthropic Claude Cookbooks repository:

https://github.com/anthropics/claude-cookbooks

Repository cloned and processed on: 2025-10-29

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.