cost-optimization
Strategies and patterns for optimizing cloud costs across AWS, Azure, and GCP.
About this skill
This skill equips an AI agent with the knowledge base and methodology to analyze, recommend, and guide users through systematic cloud cost optimization. It covers best practices and proven patterns across major cloud providers like Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). The agent leverages this skill to clarify user goals, apply relevant cost-saving strategies, validate outcomes, and provide actionable steps to reduce cloud expenses while maintaining performance and reliability.
Best use case
Identifying cost-saving opportunities within existing cloud infrastructure. Developing a systematic cloud cost optimization plan for new or current deployments. Analyzing current cloud spending for inefficiencies and potential waste. Recommending specific cost-saving patterns, such as rightsizing resources, leveraging reserved instances, or optimizing data transfer costs. Providing guidance on multi-cloud cost management strategies.
Strategies and patterns for optimizing cloud costs across AWS, Azure, and GCP.
The AI agent will provide clear, actionable recommendations and a structured plan for reducing cloud spending. This includes identifying specific areas for improvement, outlining relevant best practices, and suggesting verification steps to confirm cost savings. The output aims to be a practical guide for implementing systematic cost optimization across multi-cloud environments.
Practical example
Example input
Help me reduce my monthly AWS bill. We use EC2, S3, and RDS primarily. What are the best strategies to cut costs?
Example output
To provide you with the most effective cost-optimization strategies, let's first clarify your specific goals and constraints. Are you aiming for a percentage reduction, or focusing on specific services? Based on your usage of EC2, S3, and RDS, I can outline actionable steps using best practices such as: 1. **Rightsizing EC2 instances**: Analyze usage metrics to ensure instances match workload requirements. 2. **S3 Lifecycle Policies**: Implement rules for infrequent access and archival storage to move data to cheaper tiers. 3. **RDS Reserved Instances**: Consider purchasing reserved instances for stable database workloads to achieve significant discounts. 4. **Identifying idle/underutilized resources**: Scan for resources that can be terminated or scaled down. After applying these, we can verify the impact on your bill. Would you like me to elaborate on any of these strategies or suggest tools for analysis?
When to use this skill
- When cloud spending is increasing or exceeding budget expectations.
- When a user explicitly requests ways to reduce their cloud bills across AWS, Azure, or GCP.
- When planning new cloud deployments and needing to ensure cost-efficiency from the outset.
- When seeking actionable insights to improve financial governance of cloud resources.
When not to use this skill
- When the task is unrelated to cloud cost optimization.
- When the user requires a different domain or tool outside the scope of cloud infrastructure (e.g., on-premise cost analysis, software licensing optimization).
- When direct programmatic access or control over cloud provider APIs is required without further agent interaction.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/cost-optimization/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How cost-optimization Compares
| Feature / Agent | cost-optimization | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | easy | N/A |
Frequently Asked Questions
What does this skill do?
Strategies and patterns for optimizing cloud costs across AWS, Azure, and GCP.
Which AI agents support this skill?
This skill is designed for Claude.
How difficult is it to install?
The installation complexity is rated as easy. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
# Cloud Cost Optimization
Strategies and patterns for optimizing cloud costs across AWS, Azure, and GCP.
## Do not use this skill when
- The task is unrelated to cloud cost optimization
- You need a different domain or tool outside this scope
## Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open `resources/implementation-playbook.md`.
## Purpose
Implement systematic cost optimization strategies to reduce cloud spending while maintaining performance and reliability.
## Use this skill when
- Reduce cloud spending
- Right-size resources
- Implement cost governance
- Optimize multi-cloud costs
- Meet budget constraints
## Cost Optimization Framework
### 1. Visibility
- Implement cost allocation tags
- Use cloud cost management tools
- Set up budget alerts
- Create cost dashboards
### 2. Right-Sizing
- Analyze resource utilization
- Downsize over-provisioned resources
- Use auto-scaling
- Remove idle resources
### 3. Pricing Models
- Use reserved capacity
- Leverage spot/preemptible instances
- Implement savings plans
- Use committed use discounts
### 4. Architecture Optimization
- Use managed services
- Implement caching
- Optimize data transfer
- Use lifecycle policies
## AWS Cost Optimization
### Reserved Instances
```
Savings: 30-72% vs On-Demand
Term: 1 or 3 years
Payment: All/Partial/No upfront
Flexibility: Standard or Convertible
```
### Savings Plans
```
Compute Savings Plans: 66% savings
EC2 Instance Savings Plans: 72% savings
Applies to: EC2, Fargate, Lambda
Flexible across: Instance families, regions, OS
```
### Spot Instances
```
Savings: Up to 90% vs On-Demand
Best for: Batch jobs, CI/CD, stateless workloads
Risk: 2-minute interruption notice
Strategy: Mix with On-Demand for resilience
```
### S3 Cost Optimization
```hcl
resource "aws_s3_bucket_lifecycle_configuration" "example" {
bucket = aws_s3_bucket.example.id
rule {
id = "transition-to-ia"
status = "Enabled"
transition {
days = 30
storage_class = "STANDARD_IA"
}
transition {
days = 90
storage_class = "GLACIER"
}
expiration {
days = 365
}
}
}
```
## Azure Cost Optimization
### Reserved VM Instances
- 1 or 3 year terms
- Up to 72% savings
- Flexible sizing
- Exchangeable
### Azure Hybrid Benefit
- Use existing Windows Server licenses
- Up to 80% savings with RI
- Available for Windows and SQL Server
### Azure Advisor Recommendations
- Right-size VMs
- Delete unused resources
- Use reserved capacity
- Optimize storage
## GCP Cost Optimization
### Committed Use Discounts
- 1 or 3 year commitment
- Up to 57% savings
- Applies to vCPUs and memory
- Resource-based or spend-based
### Sustained Use Discounts
- Automatic discounts
- Up to 30% for running instances
- No commitment required
- Applies to Compute Engine, GKE
### Preemptible VMs
- Up to 80% savings
- 24-hour maximum runtime
- Best for batch workloads
## Tagging Strategy
### AWS Tagging
```hcl
locals {
common_tags = {
Environment = "production"
Project = "my-project"
CostCenter = "engineering"
Owner = "team@example.com"
ManagedBy = "terraform"
}
}
resource "aws_instance" "example" {
ami = "ami-12345678"
instance_type = "t3.medium"
tags = merge(
local.common_tags,
{
Name = "web-server"
}
)
}
```
**Reference:** See `references/tagging-standards.md`
## Cost Monitoring
### Budget Alerts
```hcl
# AWS Budget
resource "aws_budgets_budget" "monthly" {
name = "monthly-budget"
budget_type = "COST"
limit_amount = "1000"
limit_unit = "USD"
time_period_start = "2024-01-01_00:00"
time_unit = "MONTHLY"
notification {
comparison_operator = "GREATER_THAN"
threshold = 80
threshold_type = "PERCENTAGE"
notification_type = "ACTUAL"
subscriber_email_addresses = ["team@example.com"]
}
}
```
### Cost Anomaly Detection
- AWS Cost Anomaly Detection
- Azure Cost Management alerts
- GCP Budget alerts
## Architecture Patterns
### Pattern 1: Serverless First
- Use Lambda/Functions for event-driven
- Pay only for execution time
- Auto-scaling included
- No idle costs
### Pattern 2: Right-Sized Databases
```
Development: t3.small RDS
Staging: t3.large RDS
Production: r6g.2xlarge RDS with read replicas
```
### Pattern 3: Multi-Tier Storage
```
Hot data: S3 Standard
Warm data: S3 Standard-IA (30 days)
Cold data: S3 Glacier (90 days)
Archive: S3 Deep Archive (365 days)
```
### Pattern 4: Auto-Scaling
```hcl
resource "aws_autoscaling_policy" "scale_up" {
name = "scale-up"
scaling_adjustment = 2
adjustment_type = "ChangeInCapacity"
cooldown = 300
autoscaling_group_name = aws_autoscaling_group.main.name
}
resource "aws_cloudwatch_metric_alarm" "cpu_high" {
alarm_name = "cpu-high"
comparison_operator = "GreaterThanThreshold"
evaluation_periods = "2"
metric_name = "CPUUtilization"
namespace = "AWS/EC2"
period = "60"
statistic = "Average"
threshold = "80"
alarm_actions = [aws_autoscaling_policy.scale_up.arn]
}
```
## Cost Optimization Checklist
- [ ] Implement cost allocation tags
- [ ] Delete unused resources (EBS, EIPs, snapshots)
- [ ] Right-size instances based on utilization
- [ ] Use reserved capacity for steady workloads
- [ ] Implement auto-scaling
- [ ] Optimize storage classes
- [ ] Use lifecycle policies
- [ ] Enable cost anomaly detection
- [ ] Set budget alerts
- [ ] Review costs weekly
- [ ] Use spot/preemptible instances
- [ ] Optimize data transfer costs
- [ ] Implement caching layers
- [ ] Use managed services
- [ ] Monitor and optimize continuously
## Tools
- **AWS:** Cost Explorer, Cost Anomaly Detection, Compute Optimizer
- **Azure:** Cost Management, Advisor
- **GCP:** Cost Management, Recommender
- **Multi-cloud:** CloudHealth, Cloudability, Kubecost
## Reference Files
- `references/tagging-standards.md` - Tagging conventions
- `assets/cost-analysis-template.xlsx` - Cost analysis spreadsheet
## Related Skills
- `terraform-module-library` - For resource provisioning
- `multi-cloud-architecture` - For cloud selectionRelated Skills
azure-resource-manager-sql-dotnet
Azure Resource Manager SDK for Azure SQL in .NET.
azure-resource-manager-redis-dotnet
Azure Resource Manager SDK for Redis in .NET.
azure-resource-manager-postgresql-dotnet
Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments.
azure-resource-manager-mysql-dotnet
Azure MySQL Flexible Server SDK for .NET. Database management for MySQL Flexible Server deployments.
azure-resource-manager-cosmosdb-dotnet
Azure Resource Manager SDK for Cosmos DB in .NET.
azure-monitor-query-py
Azure Monitor Query SDK for Python. Use for querying Log Analytics workspaces and Azure Monitor metrics.
azure-mgmt-weightsandbiases-dotnet
Azure Weights & Biases SDK for .NET. ML experiment tracking and model management via Azure Marketplace. Use for creating W&B instances, managing SSO, marketplace integration, and ML observability.
azure-mgmt-botservice-py
Azure Bot Service Management SDK for Python. Use for creating, managing, and configuring Azure Bot Service resources.
azure-mgmt-botservice-dotnet
Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings.
azure-mgmt-apicenter-py
Azure API Center Management SDK for Python. Use for managing API inventory, metadata, and governance across your organization.
azure-containerregistry-py
Azure Container Registry SDK for Python. Use for managing container images, artifacts, and repositories.
azure-keyvault-certificates-rust
Azure Key Vault Certificates SDK for Rust. Use for creating, importing, and managing certificates.