{
  "schema": "https://ai-atoms.com/schemas/skill-v1.json",
  "type": "skill",
  "id": "skill/aws-cost-optimizer",
  "version": "1.0.0",
  "name": "Aws Cost Optimizer",
  "description": "Comprehensive AWS cost analysis and optimization recommendations using AWS CLI and Cost Explorer",
  "system_prompt_fragment": "# AWS Cost Optimizer\n\nAnalyze AWS spending patterns, identify waste, and provide actionable cost reduction strategies.\n\n## When to Use This Skill\n\nUse this skill when you need to analyze AWS spending, identify cost optimization opportunities, or reduce cloud waste.\n\n## Core Capabilities\n\n**Cost Analysis**\n- Parse AWS Cost Explorer data for trends and anomalies\n- Break down costs by service, region, and resource tags\n- Identify month-over-month spending increases\n\n**Resource Optimization**\n- Detect idle EC2 instances (low CPU utilization)\n- Find unattached EBS volumes and old snapshots\n- Identify unused Elastic IPs\n- Locate underutilized RDS instances\n- Find old S3 objects eligible for lifecycle policies\n\n**Savings Recommendations**\n- Suggest Reserved Instance/Savings Plans opportunities\n- Recommend instance rightsizing based on CloudWatch metrics\n- Identify resources in expensive regions\n- Calculate potential savings with specific actions\n\n## AWS CLI Commands\n\n### Get Cost and Usage\n```bash\n# Last 30 days cost by service\naws ce get-cost-and-usage \\\n  --time-period Start=$(date -d '30 days ago' +%Y-%m-%d),End=$(date +%Y-%m-%d) \\\n  --granularity MONTHLY \\\n  --metrics BlendedCost \\\n  --group-by Type=DIMENSION,Key=SERVICE\n\n# Daily costs for current month\naws ce get-cost-and-usage \\\n  --time-period Start=$(date +%Y-%m-01),End=$(date +%Y-%m-%d) \\\n  --granularity DAILY \\\n  --metrics UnblendedCost\n```\n\n### Find Unused Resources\n```bash\n# Unattached EBS volumes\naws ec2 describe-volumes \\\n  --filters Name=status,Values=available \\\n  --query 'Volumes[*].[VolumeId,Size,VolumeType,CreateTime]' \\\n  --output table\n\n# Unused Elastic IPs\naws ec2 describe-addresses \\\n  --query 'Addresses[?AssociationId==null].[PublicIp,AllocationId]' \\\n  --output table\n\n# Idle EC2 instances (requires CloudWatch)\naws cloudwatch get-metric-statistics \\\n  --namespace AWS/EC2 \\\n  --metric-name CPUUtilization \\\n  --dimensions Name=InstanceId,Value=i-xxxxx \\\n  --start-time $(date -u -d '7 days ago' +%Y-%m-%dT%H:%M:%S) \\\n  --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \\\n  --period 86400 \\\n  --statistics Average\n\n# Old EBS snapshots (>90 days)\naws ec2 describe-snapshots \\\n  --owner-ids self \\\n  --query 'Snapshots[?StartTime<=`'$(date -d '90 days ago' --iso-8601)'`].[SnapshotId,StartTime,VolumeSize]' \\\n  --output table\n```\n\n### Rightsizing Analysis\n```bash\n# List EC2 instances with their types\naws ec2 describe-instances \\\n  --query 'Reservations[*].Instances[*].[InstanceId,InstanceType,State.Name,Tags[?Key==`Name`].Value|[0]]' \\\n  --output table\n\n# Get RDS instance utilization\naws cloudwatch get-metric-statistics \\\n  --namespace AWS/RDS \\\n  --metric-name CPUUtilization \\\n  --dimensions Name=DBInstanceIdentifier,Value=mydb \\\n  --start-time $(date -u -d '30 days ago' +%Y-%m-%dT%H:%M:%S) \\\n  --end-time $(date -u +%Y-%m-%dT%H:%M:%S) \\\n  --period 86400 \\\n  --statistics Average,Maximum\n```\n\n## Optimization Workflow\n\n1. **Baseline Assessment**\n   - Pull 3-6 months of cost data\n   - Identify top 5 spending services\n   - Calculate growth rate\n\n2. **Quick Wins**\n   - Delete unattached EBS volumes\n   - Release unused Elastic IPs\n   - Stop/terminate idle EC2 instances\n   - Delete old snapshots\n\n3. **Strategic Optimization**\n   - Analyze Reserved Instance coverage\n   - Review instance types vs. workload\n   - Implement S3 lifecycle policies\n   - Consider Spot instances for non-critical workloads\n\n4. **Ongoing Monitoring**\n   - Set up AWS Budgets with alerts\n   - Enable Cost Anomaly Detection\n   - Tag resources for cost allocation\n   - Monthly cost review meetings\n\n## Cost Optimization Checklist\n\n- [ ] Enable AWS Cost Explorer\n- [ ] Set up cost allocation tags\n- [ ] Create AWS Budget with alerts\n- [ ] Review and delete unused resources\n- [ ] Analyze Reserved Instance opportunities\n- [ ] Implement S3 Intelligent-Tiering\n- [ ] Review data transfer costs\n- [ ] Optimize Lambda memory allocation\n- [ ] Use CloudWatch Logs retention policies\n- [ ] Consider multi-region cost differences\n\n## Example Prompts\n\n**Analysis**\n- \"Show me AWS costs for the last 3 months broken down by service\"\n- \"What are my top 10 most expensive resources?\"\n- \"Compare this month's spending to last month\"\n\n**Optimization**\n- \"Find all unattached EBS volumes and calculate savings\"\n- \"Identify EC2 instances with <5% CPU utilization\"\n- \"Suggest Reserved Instance purchases based on usage\"\n- \"Calculate savings from deleting snapshots older than 90 days\"\n\n**Implementation**\n- \"Create a script to delete unattached volumes\"\n- \"Set up a budget alert for $1000/month\"\n- \"Generate a cost optimization report for leadership\"\n\n## Best Practices\n\n- Always test in non-production first\n- Verify resources are truly unused before deletion\n- Document all cost optimization actions\n- Calculate ROI for optimization efforts\n- Automate recurring optimization tasks\n- Use AWS Trusted Advisor recommendations\n- Enable AWS Cost Anomaly Detection\n\n## Integration with Kiro CLI\n\nThis skill works seamlessly with Kiro CLI's AWS integration:\n\n```bash\n# Use Kiro to analyze costs\nkiro-cli chat \"Use aws-cost-optimizer to analyze my spending\"\n\n# Generate optimization report\nkiro-cli chat \"Create a cost optimization plan using aws-cost-optimizer\"\n```\n\n## Safety Notes\n\n- **Risk Level: Low** - Read-only analysis is safe\n- **Deletion Actions: Medium Risk** - Always verify before deleting resources\n- **Production Changes: High Risk** - Test rightsizing in dev/staging first\n- Maintain backups before any deletion\n- Use `--dry-run` flag when available\n\n## Additional Resources\n\n- [AWS Cost Optimization Best Practices](https://aws.amazon.com/pricing/cost-optimization/)\n- [AWS Well-Architected Framework - Cost Optimization](https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/welcome.html)\n- [AWS Cost Explorer API](https://docs.aws.amazon.com/cost-management/latest/APIReference/Welcome.html)",
  "applicable_domains": [
    "devops"
  ],
  "category": "devops",
  "invocation": [
    "/aws-cost-optimizer"
  ],
  "authored_by": "claudeskills.in community",
  "source_url": "https://claudeskills.in/skill/aws-cost-optimizer",
  "provenance": {
    "source": "claudeskills.in",
    "source_url": "https://claudeskills.in/skill/aws-cost-optimizer",
    "license": "unknown",
    "imported_at": "2026-09-03",
    "notes": "Aggregated by claudeskills.in from community GitHub lists."
  },
  "tags": [
    "claudeskills",
    "devops",
    "risk-reviewed"
  ],
  "lifecycle": "draft"
}