optimizing-cloud-costs

Execute use when you need to work with cloud cost optimization. This skill provides cost analysis and optimization with comprehensive guidance and automation. Trigger with phrases like "optimize costs", "analyze spending", or "reduce costs".

1,868 stars

Best use case

optimizing-cloud-costs is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Execute use when you need to work with cloud cost optimization. This skill provides cost analysis and optimization with comprehensive guidance and automation. Trigger with phrases like "optimize costs", "analyze spending", or "reduce costs".

Teams using optimizing-cloud-costs should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/optimizing-cloud-costs/SKILL.md --create-dirs "https://raw.githubusercontent.com/jeremylongshore/claude-code-plugins-plus-skills/main/plugins/devops/cloud-cost-optimizer/skills/optimizing-cloud-costs/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/optimizing-cloud-costs/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How optimizing-cloud-costs Compares

Feature / Agentoptimizing-cloud-costsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Execute use when you need to work with cloud cost optimization. This skill provides cost analysis and optimization with comprehensive guidance and automation. Trigger with phrases like "optimize costs", "analyze spending", or "reduce costs".

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

SKILL.md Source

# Optimizing Cloud Costs

## Overview

Analyze cloud spending across AWS, GCP, and Azure to identify waste, recommend rightsizing, and generate cost-saving configurations. Covers reserved instances, spot/preemptible workloads, storage tiering, idle resource cleanup, and budget alerting using cloud-native cost management APIs.

## Prerequisites

- Cloud provider CLI authenticated with billing/cost-explorer read access
- AWS: `ce:GetCostAndUsage`, `ec2:DescribeInstances`, `cloudwatch:GetMetricData` permissions
- GCP: Billing Account Viewer and Compute Viewer roles
- Azure: Cost Management Reader role
- Access to current infrastructure-as-code (Terraform, CloudFormation) for rightsizing changes
- At least 30 days of billing data for meaningful analysis

## Instructions

1. Pull current cost data using cloud cost APIs (`aws ce get-cost-and-usage`, `gcloud billing budgets list`)
2. Identify the top 10 cost drivers by service, region, and resource tag
3. Detect idle resources: instances with < 5% average CPU over 14 days, unattached EBS volumes, unused Elastic IPs, orphaned snapshots
4. Recommend rightsizing: compare instance utilization against available instance types and suggest downsizing
5. Evaluate reserved instance or savings plan coverage against on-demand spend; recommend commitments for steady-state workloads
6. Identify spot/preemptible candidates: stateless, fault-tolerant workloads (batch jobs, CI runners, dev environments)
7. Review storage costs: recommend S3 Intelligent-Tiering, lifecycle policies for infrequent access, or Glacier for archives
8. Generate Terraform/IaC changes to implement approved optimizations
9. Set up budget alerts with thresholds at 50%, 80%, and 100% of monthly budget
10. Create a cost optimization report summarizing findings, savings estimates, and implementation priority

## Output

- Cost analysis report with per-service breakdown and savings recommendations
- Terraform/CloudFormation changes for rightsizing and reserved instance purchases
- S3 lifecycle policy configurations for storage tiering
- Budget alert configurations (CloudWatch, GCP Budget, Azure Cost Alerts)
- Cleanup scripts for idle resources (with dry-run mode for safety)

## Error Handling

| Error | Cause | Solution |
|-------|-------|---------|
| `Access Denied on Cost Explorer API` | Missing `ce:*` IAM permissions | Attach the `AWSBillingReadOnlyAccess` managed policy to the IAM user/role |
| `No billing data available` | Account is too new or cost export not enabled | Enable Cost Explorer (takes 24h to populate) or set up CUR (Cost and Usage Report) |
| `Rightsizing recommendation breaks workload` | Instance too small for peak load | Base sizing on P95 utilization, not average; keep a 20% headroom buffer |
| `Spot instance terminated mid-job` | Spot capacity reclaimed by provider | Use spot fleet with diversified instance types and implement checkpointing |
| `Budget alert not firing` | SNS topic or notification channel misconfigured | Verify SNS subscription is confirmed and test with a low threshold |

## Examples

- "Analyze AWS costs for the last 3 months, identify the top waste areas, and generate a cleanup script for unattached EBS volumes and unused Elastic IPs."
- "Compare on-demand EC2 spend against Savings Plans pricing and recommend 1-year commitments for steady-state workloads."
- "Create S3 lifecycle policies to move objects older than 90 days to Glacier and delete after 365 days across all buckets tagged `env:production`."

## Resources

- AWS Cost Explorer: https://docs.aws.amazon.com/cost-management/latest/userguide/ce-what-is.html
- GCP Cost Management: https://cloud.google.com/billing/docs/how-to/budgets
- Azure Cost Management: https://learn.microsoft.com/en-us/azure/cost-management-billing/
- FinOps Foundation: https://www.finops.org/framework/

Related Skills

oraclecloud-webhooks-events

1868
from jeremylongshore/claude-code-plugins-plus-skills

Wire up event-driven workflows with OCI Events, Notifications, and Functions. Use when building serverless event processing, subscribing to instance lifecycle changes, or routing audit events to alerting systems. Trigger with "oraclecloud webhooks events", "oci events rules", "oci notifications", "oci ons topics".

oraclecloud-upgrade-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Safely upgrade OCI Python SDK and Terraform provider — version pinning, breaking change detection, and rollback. Use when upgrading oci pip packages, updating the Terraform OCI provider, or debugging post-upgrade failures. Trigger with "oraclecloud upgrade", "oci sdk upgrade", "oci terraform provider update", "oci version migration".

oraclecloud-security-basics

1868
from jeremylongshore/claude-code-plugins-plus-skills

Master OCI IAM policy syntax, common policy patterns, and API key management. Use when writing IAM policies, granting access to compartments, or managing API keys. Trigger with "oraclecloud security basics", "oci iam policy", "oci policy syntax", "oci api key setup".

oraclecloud-sdk-patterns

1868
from jeremylongshore/claude-code-plugins-plus-skills

Production-grade OCI SDK patterns for client lifecycle, retry logic, and memory leak avoidance. Use when building long-running OCI services, fixing memory leaks with Instance Principal auth, or implementing retry/backoff. Trigger with "oci sdk patterns", "oci retry", "oci memory leak", "oraclecloud client lifecycle".

oraclecloud-schema-migration

1868
from jeremylongshore/claude-code-plugins-plus-skills

Migrate to OCI Autonomous Database — wallet setup, mTLS, Data Pump, and python-oracledb. Use when provisioning Autonomous DB, downloading wallets, or migrating data with Data Pump. Trigger with "autonomous database", "oci adb", "wallet download", "data pump oci", "mtls oracle".

oraclecloud-reference-architecture

1868
from jeremylongshore/claude-code-plugins-plus-skills

Standard 3-tier OCI reference architecture with VCN, subnets, gateways, load balancer, compute, and Autonomous DB. Use when designing a new OCI deployment, translating AWS/Azure patterns, or creating Terraform for OCI infrastructure. Trigger with "oraclecloud architecture", "oci reference design", "oci 3 tier", "oci vpc design".

oraclecloud-rate-limits

1868
from jeremylongshore/claude-code-plugins-plus-skills

Handle OCI API rate limits with defensive retry patterns and known limits by service. Use when automating bulk OCI operations, hitting 429 TooManyRequests errors, or building resilient API clients. Trigger with "oraclecloud rate limits", "oci 429 error", "oci throttling", "oci backoff".

oraclecloud-query-transform

1868
from jeremylongshore/claude-code-plugins-plus-skills

Query OCI metrics with MQL and create monitoring alarms via the Python SDK. Use when building dashboards, querying CPU/memory/network metrics, or creating alarms. Trigger with "oci monitoring", "mql query", "oci metrics", "oci alarm", "cpu utilization oci".

oraclecloud-prod-checklist

1868
from jeremylongshore/claude-code-plugins-plus-skills

Pre-production readiness checklist for OCI — backup policies, security audit, key rotation, encryption, and Cloud Guard. Use when preparing an OCI environment for production workloads or auditing an existing deployment. Trigger with "oraclecloud prod checklist", "oci production ready", "oci security audit", "oci well-architected".

oraclecloud-performance-tuning

1868
from jeremylongshore/claude-code-plugins-plus-skills

Optimize OCI compute shapes, block volume tiers, and network throughput. Use when choosing instance shapes, configuring block volume performance, or benchmarking OCI infrastructure. Trigger with "oraclecloud performance", "oci shape comparison", "oci block volume iops", "oracle cloud performance tuning".

oraclecloud-observability

1868
from jeremylongshore/claude-code-plugins-plus-skills

Set up programmatic monitoring, logging, and alarms for OCI resources. Use when configuring OCI Monitoring metrics, creating alarm rules, publishing custom metrics, or searching logs via the Logging service. Trigger with "oraclecloud observability", "oci monitoring", "oci alarms", "oci logging", "oracle cloud observability".

oraclecloud-multi-env-setup

1868
from jeremylongshore/claude-code-plugins-plus-skills

Configure multi-environment OCI workflows with config profiles and compartment-per-environment patterns. Use when setting up dev/staging/prod separation, switching between OCI profiles, or preventing accidental production deployments. Trigger with "oraclecloud multi env setup", "oci profiles", "oci environments", "oci config profiles".