Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Optimize cloud infrastructure costs through FinOps practices, commitment discounts, right-sizing, and automated cost management. Use when reducing cloud spend, implementing budget controls, or establishing cost visibility across AWS, Azure, GCP, and Kubernetes environments.
.claude/skills/ancoleman-optimizing-costs/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 253% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 173% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 206% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 221% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 153% | 0% |
Cloud cost optimization transforms uncontrolled spending into strategic resource allocation through the FinOps lifecycle: Inform, Optimize, and Operate. This skill provides decision frameworks for commitment-based discounts (Reserved Instances, Savings Plans), right-sizing strategies, Kubernetes cost management, and automated cost governance across multi-cloud environments.
Invoke cost-optimization when:
┌─────────────────────────────────────────────────────┐
│ INFORM → OPTIMIZE → OPERATE (continuous loop) │
│ ↓ ↓ ↓ │
│ Visibility Action Automation │
└─────────────────────────────────────────────────────┘Inform Phase: Establish cost visibility
Optimize Phase: Take action on cost drivers
Operate Phase: Automate and govern
For detailed FinOps maturity models and organizational structures, see references/finops-foundations.md.
Reserved Instances (RIs): 40-72% discount for 1-3 year commitments
Savings Plans: Flexible compute commitments
GCP Committed Use Discounts (CUDs): 25-70% discount
Decision Framework:
Reserve when:
├─ Workload is production-critical (24/7 uptime required)
├─ Usage is predictable (stable baseline over 6+ months)
├─ Architecture is stable (unlikely to change instance types)
└─ Financial commitment acceptable (1-3 year lock-in)
Use On-Demand when:
├─ Development/testing environments
├─ Unpredictable spiky workloads
├─ Short-term projects (<6 months)
└─ Evaluating new instance typesFor detailed commitment strategies and RI coverage analysis, see references/commitment-strategies.md.
Discount: 70-90% off on-demand pricing (interruptible with 2-minute warning)
Use Spot For: CI/CD workers, batch jobs, ML training (with checkpointing), Kubernetes workers, data analytics Avoid Spot For: Stateful databases, real-time services, long-running jobs without checkpointing
Best Practices:
Target Utilization: 60-80% average (leave headroom for spikes)
Compute Right-Sizing:
Database Right-Sizing:
Kubernetes Right-Sizing:
Storage Right-Sizing:
Right-Sizing Tools:
Resource Requests and Limits:
yaml# Set requests = average usage (enables efficient bin-packing) resources: requests: cpu: 500m # 0.5 CPU cores (average usage) memory: 1Gi # 1 GiB memory (average usage) limits: cpu: 1500m # 1.5 CPU cores (3x requests, allows bursting) memory: 3Gi # 3 GiB memory (3x requests)
Namespace Quotas: Prevent runaway resource consumption
Cluster Autoscaling:
Cost Visibility:
For detailed Kubernetes cost optimization patterns, see references/kubernetes-cost-optimization.md.
Required Tags:
Owner or Team - Responsible team/departmentProject or Application - Business unit or application nameEnvironment - prod, staging, dev, testCostCenter - Finance cost center codeEnable Cost Allocation Tags:
For comprehensive tagging strategies, see references/tagging-for-cost-allocation.md.
Native Cloud Tools:
Third-Party Platforms:
Key Metrics to Track:
Cascading Budget Alerts:
50% of budget → Email to team lead (informational)
75% of budget → Email + Slack to team (warning)
90% of budget → Email + Slack + PagerDuty (urgent)
100% of budget → Automated shutdown (non-prod only) or escalationAnomaly Detection: Alert on unexpected cost spikes
Budget Granularity:
Should we purchase Reserved Instances / Savings Plans?
STEP 1: Analyze Historical Usage (6-12 months)
├─ Identify steady-state baseline (minimum usage)
├─ Exclude spiky/seasonal workloads
└─ Calculate: (baseline usage) / (total usage) = commitment %
STEP 2: Choose Commitment Type
├─ RESERVED INSTANCES
│ ├─ Pros: Highest discount (up to 72%)
│ ├─ Cons: Instance type locked (unless convertible)
│ └─ Use for: Databases, stable production workloads
│
├─ SAVINGS PLANS
│ ├─ Pros: Flexible (across instance types, regions)
│ ├─ Cons: Slightly lower discount than RI
│ └─ Use for: Compute workloads, Lambda, Fargate
│
└─ COMMITTED USE DISCOUNTS (GCP)
├─ Resource-based: vCPU/memory commitments
└─ Spend-based: Dollar amount commitments
STEP 3: Determine Commitment Period
├─ 1-year commitment
│ ├─ Lower discount (40-50%)
│ └─ Less risk if architecture changes
│
└─ 3-year commitment
├─ Higher discount (60-72%)
└─ Only for mature, stable workloads
STEP 4: Monitor and Optimize
├─ Target >95% RI/Savings Plan utilization
├─ Sell unused RIs on AWS Reserved Instance Marketplace
└─ Adjust commitments quarterly based on usage trendsCost Impact vs. Effort:
High Impact, Low Effort (DO FIRST):
High Impact, Medium Effort (DO SECOND):
Low Impact, High Effort (DO LAST):
Weekly Optimization Routine:
Should this workload use Spot/Preemptible instances?
├─ Is the workload fault-tolerant?
│ ├─ NO → Use On-Demand
│ └─ YES → Continue
│
├─ Is the workload stateless (or has checkpointing)?
│ ├─ NO → Use On-Demand (data loss risk)
│ └─ YES → Continue
│
├─ Can the workload handle interruptions gracefully?
│ ├─ NO → Use On-Demand
│ └─ YES → Continue
│
└─ Workload Type Assessment:
├─ Batch Jobs / CI/CD → ✅ Use Spot (70-90% savings)
├─ ML Training → ✅ Use Spot (with checkpointing)
├─ Kubernetes Workers → ✅ Use Spot (mixed with on-demand)
├─ Production API Servers → ⚠️ Mixed fleet (70% spot, 30% on-demand)
├─ Databases → ❌ Use On-Demand (or Reserved)
└─ Real-time Services → ❌ Use On-Demand (or Reserved)| Platform | Cost Visibility | Right-Sizing | Automation | |----------|----------------|--------------|------------| | AWS | Cost Explorer, CUR | Compute Optimizer | AWS Budgets, Lambda cleanup | | Azure | Cost Management | Azure Advisor | Azure Policy, Automation | | GCP | Cloud Billing | Recommender | Budget Alerts, Cloud Functions | | Kubernetes | Kubecost, OpenCost | VPA | Cluster Autoscaler | | Multi-Cloud | CloudZero, CloudHealth | Densify | ParkMyCloud |
| Use Case | Recommended Tool | Key Feature | |----------|------------------|-------------| | K8s cost visibility | Kubecost | Real-time namespace cost allocation | | Terraform cost estimation | Infracost | PR comments with cost diffs | | Multi-cloud aggregation | CloudHealth | Unified cost view across AWS/Azure/GCP | | Automated optimization | nOps (AWS), CAST AI (K8s) | ML-based automation | | Unit cost economics | CloudZero | Cost per customer/transaction tracking | | Spot instance management | Spot.io | Automated spot orchestration |
For detailed tool comparisons and selection criteria, see references/tools-comparison.md.
For cloud-specific deep dives, see references/cloud-specific-tactics.md.
❌ Problem: Finance team sees cloud bill at end of month, surprises everywhere ✅ Solution: Deploy real-time cost dashboards, daily Slack reports to engineering teams
❌ Problem: Purchased 100 RIs, only using 60 (40% wasted commitment) ✅ Solution: Monitor RI utilization weekly (target >95%), sell unused RIs on marketplace
❌ Problem: Pods with no requests set → inefficient bin-packing → wasted nodes ✅ Solution: Use VPA to auto-generate recommendations, enforce via admission control
❌ Problem: 50 stopped EC2 instances (still paying for EBS), 200 unattached volumes ✅ Solution: Weekly automated cleanup of idle resources >7 days old
❌ Problem: Accidentally left test cluster running, $10K bill surprise ✅ Solution: Budget alerts at 50%, 75%, 90%, 100% with Slack/PagerDuty notifications
See examples/ directory for:
See scripts/ directory for:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 20,982 | 23,300 | +11% | 1 | 1 | 0% | 3,170 | 8,580 | +171% | 0 | 0 | — |
case-06 | pass→pass | 16,855 | 16,534 | -2% | 1 | 1 | 0% | 2,716 | 7,972 | +194% | 0 | 0 | — |
case-01 | fail→fail | 23,352 | 19,333 | -17% | 1 | 1 | 0% | 3,719 | 8,392 | +126% | 0 | 0 | — |
case-02 | fail→fail | 48,180 | 22,828 | -53% | 1 | 1 | 0% | 4,137 | 8,966 | +117% | 0 | 0 | — |
case-03 | pass→pass | 14,945 | 11,809 | -21% | 1 | 1 | 0% | 2,503 | 6,981 | +179% | 0 | 0 | — |
case-04 | pass→pass | 18,284 | 14,944 | -18% | 1 | 1 | 0% | 3,188 | 7,485 | +135% | 0 | 0 | — |
case-07 | fail→pass | 10,909 | 13,454 | +23% | 1 | 1 | 0% | 1,975 | 6,968 | +253% | 0 | 0 | — |
case-08 | pass→pass | 13,982 | 5,803 | -58% | 1 | 1 | 0% | 2,175 | 5,913 | +172% | 0 | 0 | — |
case-09 | fail→pass | 14,679 | 8,280 | -44% | 1 | 1 | 0% | 2,353 | 6,421 | +173% | 0 | 0 | — |
case-10 | pass→pass | 7,678 | 6,431 | -16% | 1 | 1 | 0% | 1,328 | 6,078 | +358% | 0 | 0 | — |
case-11 | pass→pass | 14,474 | 7,844 | -46% | 1 | 1 | 0% | 1,685 | 6,314 | +275% | 0 | 0 | — |
case-12 | pass→pass | 19,712 | 11,219 | -43% | 1 | 1 | 0% | 2,436 | 6,820 | +180% | 0 | 0 | — |
case-13 | fail→pass | 12,339 | 7,056 | -43% | 1 | 1 | 0% | 1,872 | 5,720 | +206% | 0 | 0 | — |
case-14 | pass→pass | 8,490 | 9,025 | +6% | 1 | 1 | 0% | 1,355 | 6,726 | +396% | 0 | 0 | — |
case-15 | pass→pass | 10,487 | 9,733 | -7% | 1 | 1 | 0% | 1,689 | 6,748 | +300% | 0 | 0 | — |
case-16 | pass→pass | 3,632 | 3,088 | -15% | 1 | 1 | 0% | 540 | 5,508 | +920% | 0 | 0 | — |
case-17 | fail→pass | 11,071 | 4,008 | -64% | 1 | 1 | 0% | 1,764 | 5,657 | +221% | 0 | 0 | — |
case-18 | pass→pass | 5,650 | 5,447 | -4% | 1 | 1 | 0% | 828 | 5,889 | +611% | 0 | 0 | — |
case-19 | pass→pass | 5,876 | 5,939 | +1% | 1 | 1 | 0% | 931 | 5,992 | +544% | 0 | 0 | — |
case-20 | pass→pass | 4,977 | 4,950 | -1% | 1 | 1 | 0% | 669 | 5,837 | +772% | 0 | 0 | — |
case-21 | pass→pass | 4,072 | 3,232 | -21% | 1 | 1 | 0% | 657 | 5,470 | +733% | 0 | 0 | — |
case-22 | fail→pass | 14,160 | 5,380 | -62% | 1 | 1 | 0% | 2,298 | 5,811 | +153% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.