Command Palette

Search for a command to run...

Назад к скиллам
скилл № 32110

infracost-scan

Analyze infrastructure as code (IaC) projects to estimate cloud costs, identify savings opportunities, and flag FinOps policy violations. This skill should be…

БесплатноБез исполняемых скриптов
infracostот infracost★ 15 звёзд на GitHub

Установить infracost-scan в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Infracost Cost Estimation

Analyze infrastructure as code (IaC) projects to estimate cloud costs, identify savings opportunities, and flag FinOps policy violations.

Supported IaC types: Terraform, CloudFormation, Terragrunt. CDK is not yet directly supported.

Invoking capabilities

This skill is written in terms of capabilities (e.g. "scan a path", "get the summary", "drill into a failing policy"). Each capability has two bindings — a typed MCP tool call and an infracost … CLI command — listed in BINDINGS.md.

Rule: if the Infracost MCP server is available, use its tools; otherwise run the equivalent CLI command from BINDINGS.md. The Claude Code plugin starts the MCP server automatically, so on Claude Code/Cursor you use the tools. On agents that run shell commands (GitLab Duo, Gemini CLI) you use the CLI binding. Either way, the workflow below is identical.

Before any analysis, satisfy the three preflight capabilities (see BINDINGS.md): the CLI is present, the user is authenticated, and an organization is selected. With MCP these are resolved on the first tool call (failures come back as readable errors, not a dropped connection); with the CLI, check them inline. Never run infracost auth login — it is interactive.

Workflow

1. Run a scan

Use the scan capability with the absolute path to the IaC directory.

It returns a currency field and a summary block — the same headline numbers the CLI's "Scan Summary" box prints to a human: project count, resource counts (total / costed / free), monthly cost, per-policy and per-domain failing counts, diagnostic counts, and a per-project breakdown.

A scan does not return per-resource detail. That's intentional — drill in via the inspect capabilities when you need it (see step 3).

The scan result is cached under the scanned path. Subsequent inspect operations read the most recent scan by default; target a specific previously-scanned directory by passing its path.

There is no cache until a scan has run, so run scan on the path before any inspect or diff capability — don't call them first and wait for the error.

Optional: a currency (ISO 4217 code — USD, EUR, GBP, …). Defaults to the org-configured currency.

2. Triage with the summary

The summary block answers most "how many X?" and "what's the total Y?" questions without further calls:

  • monthly_cost, total_yearly_savings (costs are per month; savings are always per year — quote them as $X/yr)
  • resources, costed_resources, free_resources
  • finops_policies, failing_policies, distinct_failing_finops_resources
  • tagging_policies, failing_tagging_policies, distinct_failing_tagging_resources
  • guardrails, triggered_guardrails
  • budgets, over_budget
  • critical_diagnostics, warning_diagnostics
  • project_details[] — one row per project with name, path, monthly cost, per-policy counts, and a has_errors flag

When you need more than the headline, reach for one of the inspect capabilities.

3. Drill in

The cached scan is read by every inspect capability. Each can target a specific scan by path; omit it to use the latest. Filter inputs (project, provider, filter, costs_only) compose across the views.

Question Capability Notable inputs
Everything that's currently failing (failing policies + triggered guardrails + over-budget items) everything currently failing project, provider, filter
Top N savings opportunities sorted by yearly_savings top N savings n (default 10), filter inputs
List resources matching predicates (missing tag, invalid tag, cost band) list resources by predicate missing_tag, invalid_tag, min_cost, max_cost, resource, filter inputs
Group / aggregate resources by dimension aggregate resources by dimension group_by (e.g. type, policy,type, budget), top
Per-project diagnostic messages (parse errors, missing vars, …) per-project diagnostics project, critical_only
Failing-resource detail for one FinOps or tagging policy policy detail policy (name or slug), resource (narrows to one address)
Per-resource detail for a specific budget — matching resources + savings budget detail budget (name or id)
Status + monthly cost for one guardrail guardrail detail guardrail (name or id)

Listing resources switches modes on group_by:

  • Flat mode (no group_by): one row per resource matching the predicate filters. Resource-shaped predicates (missing_tag, invalid_tag, min_cost, max_cost) only apply here.
  • Grouped mode (group_by set): one row per aggregation key. Valid dimensions: type, provider, project, file, resource, policy, budget, guardrail. top only applies here.

Compatibility rules (validated up front):

  • policy, guardrail, and budget are pairwise mutually exclusive in a single grouping.
  • guardrail
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл infracost-scan?

Analyze infrastructure as code (IaC) projects to estimate cloud costs, identify savings opportunities, and flag FinOps policy violations. This skill should be used when asking about the cost of a cloud project, how to optimize costs, or when there are specific questions about FinOps policies or tagging compliance in an IaC codebase. The skill uses Infracost (via its MCP server when available, otherwise the Infracost CLI) to perform the analysis. The output is a detailed cost report that highlights key insights and recommendations for cost optimization.

Как установить скилл infracost-scan?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл infracost-scan запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить infracost-scan с