Claude Skills Cookbook š
A comprehensive guide to using Claude's Skills feature for document generation, data analysis, and business automation. This cookbook demonstrates how to leverage Claude's built-in skills for Excel, PowerPoint, and PDF creation, as well as how to build custom skills for specialized workflows.
Overview
Claude Skills Cookbook š
A comprehensive guide to using Claude's Skills feature for document generation, data analysis, and business automation. This cookbook demonstrates how to leverage Claude's built-in skills for Excel, PowerPoint, and PDF creation, as well as how to build custom skills for specialized workflows.
šÆ See Skills in Action: Check out Claude Creates Files to see how these Skills power Claude's ability to create and edit documents directly in Claude.ai and the desktop app!
What are Skills?
Skills are organized packages of instructions, executable code, and resources that give Claude specialized capabilities for specific tasks. Think of them as "expertise packages" that Claude can discover and load dynamically to:
- Create professional documents (Excel, PowerPoint, PDF, Word)
- Perform complex data analysis and visualization
- Apply company-specific workflows and branding
- Automate business processes with domain expertise
š Read our engineering blog post on Equipping agents for the real world with Skills
Key Features
- ⨠Progressive Disclosure Architecture - Skills load only when needed, optimizing token usage
- š Financial Focus - Real-world examples for finance and business analytics
- š§ Custom Skills Development - Learn to build and deploy your own skills
- šÆ Production-Ready Examples - Code you can adapt for immediate use
Cookbook Structure
š Notebook 1: Introduction to Skills
Learn the fundamentals of Claude's Skills feature with quick-start examples.
- Understanding Skills architecture
- Setting up the API with beta headers
- Creating your first Excel spreadsheet
- Generating PowerPoint presentations
- Exporting to PDF format
š¼ Notebook 2: Financial Applications
Explore powerful business use cases with real financial data.
- Building financial dashboards with charts and pivot tables
- Portfolio analysis and investment reporting
- Cross-format workflows: CSV ā Excel ā PowerPoint ā PDF
- Token optimization strategies
š§ Notebook 3: Custom Skills Development
Master the art of creating your own specialized skills.
- Building a financial ratio calculator
- Creating company brand guidelines skill
- Advanced: Financial modeling suite
- Best practices and security considerations
Quick Start
Prerequisites
- Python 3.8 or higher
- Anthropic API key (get one here)
- Jupyter Notebook or JupyterLab
Installation
- Clone the repository
git clone https://github.com/anthropics/claude-cookbooks.git
cd claude-cookbooks/skills
- Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\\Scripts\\activate
- Install dependencies
pip install -r requirements.txt
- Configure API key
cp .env.example .env
# Edit .env and add your ANTHROPIC_API_KEY
- Launch Jupyter
jupyter notebook
- Start with Notebook 1
Open
notebooks/01_skills_introduction.ipynband follow along!
Sample Data
The cookbook includes realistic financial datasets in sample_data/:
- š financial_statements.csv - Quarterly P&L, balance sheet, and cash flow data
- š° portfolio_holdings.json - Investment portfolio with performance metrics
- š budget_template.csv - Department budget with variance analysis
- š quarterly_metrics.json - KPIs and operational metrics
Project Structure
skills/
āāā notebooks/ # Jupyter notebooks
ā āāā 01_skills_introduction.ipynb
ā āāā 02_skills_financial_applications.ipynb
ā āāā 03_skills_custom_development.ipynb
āāā sample_data/ # Financial datasets
ā āāā financial_statements.csv
ā āāā portfolio_holdings.json
ā āāā budget_template.csv
ā āāā quarterly_metrics.json
āāā custom_skills/ # Your custom skills
ā āāā financial_analyzer/
ā āāā brand_guidelines/
ā āāā report_generator/
āāā outputs/ # Generated files
āāā docs/ # Documentation
āāā requirements.txt # Python dependencies
āāā .env.example # Environment template
āāā README.md # This file
API Configuration
Skills require specific beta headers. The notebooks handle this automatically, but here's what's happening behind the scenes:
from anthropic import Anthropic
client = Anthropic(
api_key="your-api-key",
default_headers={
"anthropic-beta": "code-execution-2025-08-25,files-api-2025-04-14,skills-2025-10-02"
}
)
Required Beta Headers:
code-execution-2025-08-25- Enables code execution for Skillsfiles-api-2025-04-14- Required for downloading generated filesskills-2025-10-02- Enables Skills feature
Working with Generated Files
When Skills create documents (Excel, PowerPoint, PDF, etc.), they return file_id attributes in the response. You must use the Files API to download these files.
How It Works
- Skills create files during code execution
- Response includes file_ids for each created file
- Use Files API to download the actual file content
- Save locally or process as needed
Example: Creating and Downloading an Excel File
from anthropic import Anthropic
client = Anthropic(api_key="your-api-key")
# Step 1: Use a skill to create a file
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=4096,
container={
"skills": [
{"type": "anthropic", "skill_id": "xlsx", "version": "latest"}
]
},
tools=[{"type": "code_execution_20250825", "name": "code_execution"}],
messages=[{
"role": "user",
"content": "Create an Excel file with a simple budget spreadsheet"
}]
)
# Step 2: Extract file_id from the response
file_id = None
for block in response.content:
if block.type == "tool_result" and hasattr(block, 'output'):
# Look for file_id in the tool output
if 'file_id' in str(block.output):
file_id = extract_file_id(block.output) # Parse the file_id
break
# Step 3: Download the file using Files API
if file_id:
file_content = client.beta.files.download(file_id=file_id)
# Step 4: Save to disk
with open("outputs/budget.xlsx", "wb") as f:
f.write(file_content.read())
print(f"ā
File downloaded: budget.xlsx")
Files API Methods
# Download file content (binary)
content = client.beta.files.download(file_id="file_abc123...")
with open("output.xlsx", "wb") as f:
f.write(content.read()) # Use .read() not .content
# Get file metadata
info = client.beta.files.retrieve_metadata(file_id="file_abc123...")
print(f"Filename: {info.filename}, Size: {info.size_bytes} bytes") # Use size_bytes not size
# List all files
files = client.beta.files.list()
for file in files.data:
print(f"{file.filename} - {file.created_at}")
# Delete a file
client.beta.files.delete(file_id="file_abc123...")
Important Notes:
- Files are stored temporarily on Anthropic's servers
- Downloaded files should be saved to your local
outputs/directory - The Files API uses the same API key as the Messages API
- All notebooks include helper functions for file download
- Files are overwritten by default - rerunning cells will replace existing files (you'll see
[overwritten]in the output)
See the Files API documentation for complete details.
Built-in Skills Reference
Claude comes with these pre-built skills:
| Skill | ID | Description |
|---|---|---|
| Excel | xlsx | Create and manipulate Excel workbooks with formulas, charts, and formatting |
| PowerPoint | pptx | Generate professional presentations with slides, charts, and transitions |
pdf | Create formatted PDF documents with text, tables, and images | |
| Word | docx | Generate Word documents with rich formatting and structure |
Creating Custom Skills
Custom skills follow this structure:
my_skill/
āāā SKILL.md # Required: Instructions for Claude
āāā scripts/ # Optional: Python/JS code
ā āāā processor.py
āāā resources/ # Optional: Templates, data
āāā template.xlsx
Learn more in Notebook 3.
Common Use Cases
Financial Reporting
- Automated quarterly reports
- Budget variance analysis
- Investment performance dashboards
Data Analysis
- Excel-based analytics with complex formulas
- Pivot table generation
- Statistical analysis and visualization
Document Automation
- Branded presentation generation
- Report compilation from multiple sources
- Cross-format document conversion
Performance Tips
- Use Progressive Disclosure: Skills load in stages to minimize token usage
- Batch Operations: Process multiple files in a single conversation
- Skill Composition: Combine multiple skills for complex workflows
- Cache Reuse: Use container IDs to reuse loaded skills
Troubleshooting
Common Issues
API Key Not Found
ValueError: ANTHROPIC_API_KEY not found
ā Make sure you've copied .env.example to .env and added your key
Skills Beta Header Missing
Error: Skills feature requires beta header
ā Ensure you're using the correct beta headers as shown in the notebooks
Token Limit Exceeded
Error: Request exceeds token limit
ā Break large operations into smaller chunks or use progressive disclosure
Resources
Documentation
- š Claude API Documentation
- š§ Skills Documentation
Support Articles
- š Teach Claude your way of working using Skills - User guide for working with Skills
- š ļø How to create a skill with Claude through conversation - Interactive skill creation guide
Community & Support
- š¬ Claude Support
- š GitHub Issues
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
License
This cookbook is provided under the MIT License. See LICENSE for details.
Acknowledgments
Special thanks to the Anthropic team for developing the Skills feature and providing the SDK.
Questions? Check the FAQ or open an issue.
Ready to start? Open Notebook 1 and let's build something amazing! š