From infracost
Look up cloud resource pricing by generating sample Terraform and running Infracost against it. Use this skill when the user asks "how much does X cost?" or wants to compare pricing between resource configurations, instance types, regions, or cloud providers. This does not require the user to have any existing infrastructure code.
npx claudepluginhub infracost/agent-skills --plugin infracostThis skill is limited to using the following tools:
Look up cloud resource pricing without needing existing infrastructure code. Supports any resource type that Terraform and Infracost support across AWS, GCP, and Azure.
Audits cloud infrastructure costs from IaC like Terraform/Pulumi and configs, runs Infracost/AWS Cost Explorer/GCP Billing scanners, produces prioritized optimization plan with changes and savings estimates.
Estimates Azure resource costs by querying the live Retail Prices API via Bash or PowerShell scripts. Handles pricing for services, tiers, sizing, and budgeting without an Azure subscription.
Provides structured AWS cost optimization via five pillars (right-sizing, elasticity, pricing, storage, monitoring) and 12 best practices with AWS CLI examples. For reviewing spending, unused resources, FinOps.
Share bugs, ideas, or general feedback.
Look up cloud resource pricing without needing existing infrastructure code. Supports any resource type that Terraform and Infracost support across AWS, GCP, and Azure.
Important: Ensure that infracost-preview is available on the path. If it is not, offer to install it for the user by triggering the /infracost:install skill.
infracost-preview login
Pipe the Terraform configuration directly into infracost-preview price. This command reads Terraform from stdin, analyzes it, and prints the cost estimate as JSON to stdout. Temporary files are created and cleaned up automatically.
infracost-preview price << 'EOF'
provider "aws" {
region = "us-east-1"
}
resource "aws_instance" "example" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "m5.xlarge"
root_block_device {
volume_size = 100
volume_type = "gp3"
}
}
EOF
Rules for writing the Terraform:
us-east-1 and mention it.aws_instance.web_server not aws_instance.example) so the output is easier to read.Currency: If the user requests pricing in a non-USD currency, set the INFRACOST_CLI_CURRENCY environment variable when running the command. For example:
INFRACOST_CLI_CURRENCY=EUR infracost-preview price << 'EOF'
...
EOF
Use standard ISO 4217 currency codes (e.g., EUR, GBP, JPY, CAD, AUD). If the user doesn't specify a currency, default to USD.
Use the inspect command to read the results rather than parsing JSON manually.
# Summary overview
infracost-preview inspect --summary
# Detailed cost breakdown
infracost-preview inspect --costs-only
# Top expensive resources
infracost-preview inspect --top 5
Present pricing in a clear, structured way:
AWS RDS MySQL — db.r5.xlarge, 100GB gp3 Region: us-east-1
Component Monthly Cost Instance (on-demand) $365.00 Storage (100GB gp3) $11.50 Total $376.50 Usage-based costs (estimated):
- I/O requests: ~$X/mo based on typical usage
Savings opportunity: Consider Graviton (db.r6g.xlarge) for
20% savings ($73/mo).
infracost-preview scan prompts for login, ask the user to run infracost-preview login first.