opensite-ai/opensite-skills / aws-billing-and-cost-management
aws-billing-and-cost-management
VerifiedAnalyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer, look up service pricing, query CUR with Athena, detect cost anomalies, scope costs to billing views, and monitor Free Tier usage. Triggers on: AWS bill, cost analysis, reduce spend, savings plan, reserved instance, right-size, budget alert, cost optimization, pricing, free tier, cost anomaly, CUR, cost audit, billing view, billing view ARN.
| File | Kind | Size |
|---|---|---|
| .aws-skill-metadata | other | 18 B |
| SKILL.md | skill md | 8.9 KB |
| references/budgets.md | markdown | 2.4 KB |
| references/cost-audit.md | markdown | 3.2 KB |
| references/cost-explorer.md | markdown | 7.3 KB |
| references/cost-optimization-hub.md | markdown | 7.2 KB |
| references/cur-athena.md | markdown | 7.0 KB |
| references/deterministic-calculations.md | markdown | 2.5 KB |
| references/ebs-optimization.md | markdown | 2.7 KB |
| references/ec2-rightsizing.md | markdown | 3.3 KB |
| references/free-tier.md | markdown | 1.6 KB |
| references/lambda-optimization.md | markdown | 2.2 KB |
| references/pricing-lookup.md | markdown | 3.8 KB |
| references/rds-optimization.md | markdown | 1.8 KB |
| references/reserved-instances.md | markdown | 2.3 KB |
| references/savings-plans.md | markdown | 3.3 KB |
| references/service-optimization.md | markdown | 3.0 KB |
references/deterministic-calculations.md
View on GitHub# Deterministic Calculations
**You MUST NEVER perform arithmetic by reasoning in your response.** This includes sums, averages, percentages, percent changes, counts, min/max, or any math on data from API calls. LLM arithmetic is unreliable and produces wrong cost figures.
**You MUST ALWAYS write a script** to perform calculations and print the result.
## Pattern: Python script for Cost Explorer data
After calling `aws ce get-cost-and-usage`, extract the numbers and calculate with a script:
```python
# Example: Calculate total cost and percent change from CE response data
import json
# Data extracted from API responses (replace with actual values)
current_month = [("EC2", 1500.42), ("S3", 823.17), ("RDS", 612.90)]
previous_month = [("EC2", 1200.00), ("S3", 750.00), ("RDS", 580.00)]
current_total = sum(cost for _, cost in current_month)
previous_total = sum(cost for _, cost in previous_month)
pct_change = ((current_total - previous_total) / previous_total) * 100
print(f"Current total: ${current_total:,.2f}")
print(f"Previous total: ${previous_total:,.2f}")
print(f"Change: {pct_change:+.1f}%")
for service, cost in current_month:
pct_of_total = (cost / current_total) * 100
print(f" {service}: ${cost:,.2f} ({pct_of_total:.1f}%)")
```
## Pattern: Count and aggregate
```python
# Example: Count exceeded budgets from Budgets API response
budgets = [("Monthly-Total", "EXCEEDED"), ("Dev-Budget", "OK"), ("Prod-Budget", "EXCEEDED")]
exceeded = [name for name, status in budgets if status == "EXCEEDED"]
print(f"Exceeded budgets: {len(exceeded)} — {', '.join(exceeded)}")
```
## Pattern: Savings calculation
```python
# Example: Calculate savings from right-sizing recommendations
recs = [
{"instance": "i-abc123", "current_cost": 121.03, "recommended_cost": 16.64},
{"instance": "i-def456", "current_cost": 350.00, "recommended_cost": 175.00},
]
total_current = sum(r["current_cost"] for r in recs)
total_recommended = sum(r["recommended_cost"] for r in recs)
total_savings = total_current - total_recommended
pct_savings = (total_savings / total_current) * 100
print(f"Total monthly savings: ${total_savings:,.2f} ({pct_savings:.1f}%)")
print(f"Annual savings: ${total_savings * 12:,.2f}")
```
## Why this matters
- LLMs frequently make arithmetic errors on multi-digit numbers, especially with percentages and aggregations
- Cost data involves currency — wrong numbers erode customer trust immediately
- Scripts produce verifiable, reproducible results
- The AWS MCP server's `run_script` tool runs Python in a sandbox — use it when available
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |