All skills
simota avatar

/ledger

@e307415
by shingo imotasimota/agent-skills85 stars
15

Optimizing FinOps and cloud cost: IaC-based estimation, right-sizing, RI/SP recommendations, anomaly detection, budget alerts, AI/GPU workload economics. Use to forecast or cut cloud spend.

Use this Skill: https://skilld.dev/gh/simota/agent-skills/ledger

This session only. Nothing lands on disk.

referenceiac-cost-estimation.md

≈1.1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

IaC Cost Estimation

Purpose: Methods for estimating cloud costs from IaC code and a tool integration guide. Read when: Assessing the cost impact of Terraform/CloudFormation/Pulumi changes.


Infracost Integration

Basic Workflow

# Estimate cost from a Terraform plan
infracost breakdown --path .

# Compare cost across a PR diff
infracost diff --path . --compare-to infracost-base.json

# CI/CD pipeline integration (GitHub Actions)
infracost comment --path . --format github-comment --behavior update

CI/CD Cost Gate

# GitHub Actions example
- name: Infracost
  run: |
    infracost diff --path . --compare-to /tmp/infracost-base.json --format json --out-file /tmp/infracost.json
    DIFF=$(jq -r '.diffTotalMonthlyCost' /tmp/infracost.json)
    if (( $(echo "$DIFF > 100" | bc -l) )); then
      echo "::warning::Monthly cost increase exceeds $100 threshold"
    fi

Threshold Configuration

Environment Monthly Increase Threshold Action
dev > $50 Warning comment
staging > $100 Warning + approval required
production > $500 Block + mandatory review

Pricing API Reference

AWS Pricing

Method Use Case Accuracy
AWS Pricing API Programmatic lookup High
AWS Cost Calculator Interactive planning High
Infracost Terraform-native High (90%+ resources)
Cost Explorer forecast Historical projection Medium

GCP Pricing

Method Use Case Accuracy
GCP Pricing Calculator Interactive planning High
Cloud Billing API Programmatic lookup High
Infracost Terraform-native High
Billing Export to BigQuery Historical analysis High

Azure Pricing

Method Use Case Accuracy
Azure Pricing Calculator Interactive planning High
Azure Cost Management API Programmatic lookup High
Infracost Terraform-native High
Cost Analysis + Advisor Historical + recommendations Medium-High

High-Cost Resource Flags

The following resources have a large cost impact, so always flag them at creation time:

Resource Typical Monthly Cost Warning
NAT Gateway (AWS) $32+ per gateway + data processing 1 per AZ × number of AZs
Transit Gateway $36+ per attachment Scales with number of VPCs
HA Database (non-prod) 2× single instance Often unnecessary in dev environments
GPU Instance $500-$30,000+ Consider scheduling based on usage hours
Interface VPC Endpoint $7+ per endpoint per AZ Many services × number of AZs
Cross-region data transfer $0.02/GB Easy to end up costing more than expected
AlloyDB / Spanner (GCP) $500+/month Overkill for small-scale use
Premium SSD (Azure) 2-3× Standard SSD Check IOPS requirements

Cost Estimation Report Template

## Cost Estimation Report

### Summary
- **Estimated monthly cost (before):** $X,XXX
- **Estimated monthly cost (after):** $Y,YYY
- **Monthly delta:** +/- $ZZZ (+/- N%)
- **Confidence level:** High / Medium / Low

### Assumptions
1. [Usage assumption 1]
2. [Data transfer assumption]
3. [Pricing tier assumption]

### Resource Breakdown
| Resource | Type | Monthly Cost | Notes |
|----------|------|-------------|-------|
| ... | ... | ... | ... |

### High-Cost Warnings
- [Warning 1]
- [Warning 2]

### Data Transfer Costs
- Intra-region: $X
- Cross-region: $Y
- Internet egress: $Z

### Recommendations
1. [Cost optimization recommendation]
2. [Alternative architecture suggestion]

Data Transfer Cost Matrix

Transfer Type AWS GCP Azure
Same AZ Free Free Free
Cross-AZ $0.01/GB $0.01/GB Free (most)
Cross-region $0.02/GB $0.01-0.08/GB $0.02-0.05/GB
Internet egress $0.09/GB (first 10TB) $0.12/GB (first 1TB) $0.087/GB (first 5GB free)
VPC Peering cross-region $0.01/GB $0.01/GB $0.035/GB

Note: Pricing changes frequently. Check each cloud provider's pricing page for current prices.

Source: SKILL.md on GitHub

No alerts13d4 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    The 'ledger' skill is a comprehensive FinOps and cloud cost optimization tool designed to assist with IaC cost estimation, right-sizing, and commitment strategies. A thorough security analysis found no evidence of prompt injection, data exfiltration, obfuscation, or malicious code execution. The external links provided are legitimate technical citations and references for cloud cost data.

  • Socket13d

    No alerts

  • Snyk13d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at e307415. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Activeupdated 2 weeks ago

README badge

README badge for simota/agent-skills/ledger