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!
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
- β¨ 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
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
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
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
- Python 3.8 or higher
- Anthropic API key (get one here)
- Jupyter Notebook or JupyterLab
- 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!
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
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
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
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.
- 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
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")# 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.
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 |
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.
- Automated quarterly reports
- Budget variance analysis
- Investment performance dashboards
- Excel-based analytics with complex formulas
- Pivot table generation
- Statistical analysis and visualization
- Branded presentation generation
- Report compilation from multiple sources
- Cross-format document conversion
- 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
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
- π Claude API Documentation
- π§ Skills Documentation
- π 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
- π¬ Claude Support
- π GitHub Issues
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This cookbook is provided under the MIT License. See LICENSE for details.
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! π