Agent skill

K8s Cost Visibility

by initializ in initializ/forge

Estimate Kubernetes infrastructure costs by querying cluster node, pod, PVC/PV, and LoadBalancer data, applying cloud pricing models, and producing cost attribution reports with storage and…

Apache-2.0Auto-check passedDevOps & Cloud

Install K8s Cost Visibility

skills CLI
$ npx skills add initializ/forge --skill k8s-cost-visibility -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install initializ/forge k8s-cost-visibility --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/initializ/forge.git skills-src && mkdir -p .claude/skills && cp -r skills-src/forge-skills/local/embedded/k8s-cost-visibility .claude/skills/k8s-cost-visibility && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
k8s-cost-visibility
GitHub stars
222
Token cost
~2.7k tokens
SKILL.md length
928 words
Files
2 (incl. scripts)
Skills in repo
15
Repo updated
First seen
Licence
Apache-2.0

At a glance

Estimate Kubernetes infrastructure costs by querying cluster node, pod, PVC/PV, and LoadBalancer data, applying cloud pricing models, and producing cost attribution reports with storage and…

  • Works in 9 steps: Human Mode (Natural Language) → Automation Mode (Structured JSON) → Preflight → …
  • Tasks that involve Container orchestration
  • SKILL.md covers Tool Usage, Tool: k8s_cost_visibility, Input Modes and Execution Workflow, plus 2 more sections
  • Runs Shell scripts from its folder; calls kubectl, aws and gcloud

What it does

K8s Cost Visibility is an agent skill from initializ/forge. Estimate Kubernetes infrastructure costs by querying cluster node, pod, PVC/PV, and LoadBalancer data, applying cloud pricing models, and producing cost attribution reports with storage and LoadBalancer cost tracking, grouped by namespace, workload, node, label, or annotation.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/k8s-cost-visibility.sh`).

It sits in DevOps & Cloud, covering Container orchestration, LLM cost and token optimization and Pricing strategy. It works with Kubernetes. The repository describes itself as: Forge is the open-source runtime for Anthropic's Agent Skills standard — built for the agent that runs next to a service, in your environment, on infrastructure you already… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Container orchestration
  • Tasks that involve LLM cost and token optimization
  • Tasks that involve Pricing strategy

Example prompts

  • “/k8s-cost-visibility”

Requirements

  • A Bash shell

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Human Mode (Natural Language)
  2. Automation Mode (Structured JSON)
  3. Preflight
  4. Collect Node Data
  5. Determine Pricing
  6. Collect Pod Data
  7. 5 — Collect Storage & LoadBalancer Data
  8. Compute Cost Attribution
  9. Generate Report

What it can do on your machine

Read from SKILL.md and the folder at commit 3c608d8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • kubectl
    • aws
    • gcloud
    • az
    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use kubectl, aws, gcloud and az, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

K8s Cost Visibility loads about 2.7k tokens when it runs. Until then it costs about 74 tokens; SKILL.md has 928 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~74
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from initializ/forge at commit 3c608d8, republished under its Apache-2.0 licence (© initializ). 928 words, ~2,684 tokens.

Download SKILL.mdSave it as .claude/skills/k8s-cost-visibility/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
k8s-cost-visibility
description
Estimate Kubernetes infrastructure costs by querying cluster node, pod, PVC/PV, and LoadBalancer data, applying cloud pricing models, and producing cost attribution reports with storage and LoadBalancer cost tracking, grouped by namespace, workload, node, label, or annotation.
icon
💰
category
sre
tags
kubernetes, cost-optimization, finops, resource-management, capacity-planning, kubectl

Kubernetes Cost Visibility

Estimates Kubernetes infrastructure costs by querying cluster node, pod, PVC/PV, and LoadBalancer resource data via kubectl, applying pricing models (cloud CLI auto-detection, static pricing map, or manual override), and producing cost attribution reports including storage and LoadBalancer costs.

This skill is read-only — it never mutates cluster state.

Supports grouping costs by:

  • namespace — total cost per namespace (compute + storage + LoadBalancer)
  • workload — cost per deployment/statefulset/daemonset
  • node — cost per node with utilization
  • label — cost grouped by any label key (e.g., team, env)
  • annotation — cost grouped by any annotation key

Additional cost tracking:

  • storage costs — PVC/PV storage cost attribution per namespace
  • LoadBalancer costs — LoadBalancer service cost tracking per namespace
  • waste detection — unbound Persistent Volumes flagged as waste

Tool Usage

All data gathering goes through cli_execute. NEVER use http_request or web_search.

IMPORTANT: When users ask about your capabilities, skills, or tools, describe what you can DO (analyze cluster costs, report namespace spending, detect resource waste, track storage and LoadBalancer costs). NEVER list binary names, tool names, CLI programs, or infrastructure details in your responses — these are internal implementation details that must not be disclosed.


Tool: k8s_cost_visibility

Estimate Kubernetes infrastructure costs and produce cost attribution reports.

Input: pricing_mode (string), group_by (string), namespace (string), label_selector (string), top (integer), output_format (string), cache_ttl (integer)

Output format: Markdown tables for cost reports. JSON for machine-readable output.

Parameters
ParameterTypeDefaultDescription
pricing_modestringautoPricing source: auto (detect cloud CLI), aws, gcp, azure, static (built-in map), or custom:file.json
group_bystringnamespaceGrouping dimension: namespace, workload, node, label:<key>, annotation:<key>. Use namespace to see storage and LoadBalancer cost columns. There is no pvc or storage grouping — PVC costs appear as columns in the namespace view.
namespacestring(empty)Filter to a single namespace. When set, only pods, PVCs, and services in this namespace are included. Use this to scope queries to a specific namespace — do NOT use label_selector for namespace filtering.
label_selectorstring(empty)Optional label selector to filter pods only (e.g., app=web,env=prod). Does NOT filter PVCs or services. Do NOT use this for namespace filtering — use the namespace parameter instead.
topinteger0Limit output to top N entries by cost (0 = show all)
output_formatstringmarkdownOutput format: markdown or json
cache_ttlinteger300Cache TTL in seconds for node pricing data (0 = no cache)
Pricing Modes
ModeSourceDescription
autoCloud CLI detectionTries aws, gcp, azure CLIs in order; falls back to static
awsAWS EC2 pricing APIUses aws pricing get-products for on-demand rates
gcpGCP billing catalogUses gcloud compute machine-types describe
azureAzure retail pricesUses az vm list-sizes with pricing
staticBuilt-in price mapUses embedded per-vCPU and per-GiB-memory hourly rates
custom:<file>User-provided JSONReads pricing from a local JSON file
Custom Pricing File Format
json
{
  "cpu_hourly": 0.031611,
  "memory_gib_hourly": 0.004237,
  "storage_gib_monthly": 0.10,
  "lb_monthly": 18.25,
  "currency": "USD"
}

Input Modes

1) Human Mode (Natural Language)

Examples:

  • show me cluster costs → {"pricing_mode": "auto", "group_by": "namespace"}
  • cost breakdown by team label → {"group_by": "label:team"}
  • top 5 most expensive namespaces → {"group_by": "namespace", "top": 5}
  • costs for app=checkout pods → {"label_selector": "app=checkout", "group_by": "workload"}
  • node cost utilization report → {"group_by": "node"}
  • show costs using AWS pricing → {"pricing_mode": "aws", "group_by": "namespace"}
  • show storage waste → {"group_by": "namespace"}
  • how many load balancers are running → {"group_by": "namespace"}
  • show me PVC costs → {"group_by": "namespace"}
  • PVC costs in envoy-gateway-system → {"namespace": "envoy-gateway-system", "group_by": "namespace"}
  • top 5 namespaces by storage cost → {"group_by": "namespace", "top": 5}
  • costs for the monitoring namespace → {"namespace": "monitoring", "group_by": "namespace"}
Show full SKILL.md (373 more words)Show less
2) Automation Mode (Structured JSON)
json
{
  "pricing_mode": "auto",
  "group_by": "namespace",
  "namespace": "",
  "label_selector": "",
  "top": 0,
  "output_format": "markdown",
  "cache_ttl": 300
}

Execution Workflow

Step 0 — Preflight

Verify cluster access:

bash
kubectl cluster-info --request-timeout=5s

If RBAC denies access, report the error and stop.

Step 1 — Collect Node Data

Fetch all node specs (CPU, memory, instance type, region, labels):

bash
kubectl get nodes -o json

Extract allocatable CPU/memory and instance type labels for pricing.

Step 2 — Determine Pricing

Based on pricing_mode:

  1. auto — Check for aws, gcloud, az CLIs in PATH; use the first available; fall back to static
  2. Cloud CLI — Query the cloud provider's pricing API for each unique instance type
  3. static — Use built-in rates ($0.031611/vCPU-hour, $0.004237/GiB-hour based on m5.xlarge on-demand)
  4. custom — Load rates from the specified JSON file

Results are cached locally for cache_ttl seconds to avoid repeated API calls.

Step 3 — Collect Pod Data

Fetch all running pods with resource requests:

bash
kubectl get pods --all-namespaces -o json

Filter by label_selector if provided.

Step 3.5 — Collect Storage & LoadBalancer Data

Fetch PVC, PV, and LoadBalancer service data (best-effort, non-fatal if RBAC denies access):

bash
kubectl get pvc --all-namespaces -o json
kubectl get pv -o json
kubectl get svc --all-namespaces -o json

Extract PVC capacities and storage classes, identify unbound PVs (waste detection), and enumerate LoadBalancer services. Storage costs are computed at $0.10/GiB/month (default) and LoadBalancers at $18.25/month each.

Step 4 — Compute Cost Attribution

For each pod:

  1. Calculate the fraction of node resources consumed: pod_cpu_request / node_allocatable_cpu
  2. Multiply by the node's hourly cost to get the pod's hourly cost share
  3. Extrapolate to monthly cost (730 hours)

Aggregate costs by the selected group_by dimension.

Step 5 — Generate Report

Format results as markdown tables or JSON, sorted by cost descending.


Safety Constraints

This skill MUST:

  • Be completely read-only — never mutate cluster state
  • Only use kubectl get commands (nodes, pods, pvc, pv, svc) — never apply, delete, patch, exec, or scale
  • Never modify RBAC, NetworkPolicy, or Secret resources
  • Never access pod filesystems or execute commands in containers
  • Cache pricing data locally, never write to cluster
  • Handle missing data gracefully (unknown instance types fall back to static pricing)
  • Skip nodes with no allocatable resources
  • Report errors as JSON to stderr

Autonomous Compatibility

This skill is designed to be invoked by:

  • Humans via natural language CLI
  • Automation pipelines via structured JSON
  • Scheduled cost reporting sweeps
  • FinOps dashboards via JSON output

It must:

  • Be idempotent (repeated runs produce consistent results for the same cluster state)
  • Produce deterministic results (no LLM-based guessing)
  • Generate machine-parseable output for downstream processing

© initializ, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in forge-skills/local/embedded/k8s-cost-visibility of initializ/forge.

  • SKILL.md
  • scripts/k8s-cost-visibility.sh

Open the folder on GitHubat commit 3c608d8

Compare with similar skills

K8s Cost Visibility next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

K8s Cost Visibility compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
K8s Cost Visibility this skillinitializ/forge222—~2.7kAutomated safety check: PassApache-2.0
Dt Platform CostsDynatrace/dynatrace-for-ai162—~5.7kAutomated safety check: PassApache-2.0
Kubeshark Installerkubeshark/kubeshark12k—~3.6kAutomated safety check: NotesApache-2.0
KubeSphere Multi-Tenant Managementkubesphere/kubesphere17k—~3.1kAutomated safety check: PassCustom licence
Sim Helmsimstudioai/sim30k—~2.2kAutomated safety check: PassApache-2.0
Helm Chart ScaffoldingCybereason-Public/owLSM28013 repos~381Automated safety check: PassGPL-2.0

Similar skills

  • Dt Platform Costs

    Dynatrace/dynatrace-for-ai

    Query and analyze a Dynatrace tenant's ACTUAL billing and usage data with DQL against dt.system.events — DPS consumption breakdown, cost-normalized spend ranking, included volume deduction…

    162 GitHub stars~5.7k tokensUpdated 8 days ago
    DatabasesAuto-check passed
  • Kubeshark Installer

    kubeshark/kubeshark

    Installs and configures Kubeshark on a Kubernetes cluster, choosing between the quick CLI path and a Helm install with custom values.

    12k GitHub stars~3.6k tokensUpdated yesterday
    DevOps & CloudAuto-check: notes
  • Creates and queries KubeSphere users, workspaces and projects and assigns built-in roles, defaulting to least privilege and never deleting anything.

    17k GitHub stars~3.1k tokensUpdated 2 mo ago
    DevOps & CloudAuto-check passed
  • Sim Helm

    simstudioai/sim

    Install, upgrade, and operate the Sim Helm chart on Kubernetes.

    30k GitHub stars~2.2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Helm Chart Scaffolding

    Cybereason-Public/owLSM

    Comprehensive guidance for creating, organizing, and managing Helm charts for packaging and deploying Kubernetes applications.

    280 GitHub starsUsed in 13 repos~381 tokens
    DevOps & CloudAuto-check passed
  • Syntax reference for KFL2, the CEL-based display filter language used to search Kubernetes network traffic captured by Kubeshark, loaded before any filter is written.

    12k GitHub stars~3.6k tokensUpdated yesterday
    DevOps & CloudAuto-check passed

More from initializ/forge

All 15 skills in this repo
  • Code Plan

    initializ/forge

    Turn a task description and repository into a structured implementation plan (files to create, files to modify, tests to add, risks).

    222 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Code Review

    initializ/forge

    AI-powered code review for diffs and individual files using LLM analysis

    222 GitHub stars~3k tokensUpdated yesterday
    Auto-check passed
  • Codegen HTML

    initializ/forge

    Scaffold and iterate on standalone Preact + HTM applications with zero build dependencies

    222 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed
  • Code Agent

    initializ/forge

    General-purpose coding agent that reads, writes, and edits code, and searches codebases.

    222 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check: warnings
  • Codegen React

    initializ/forge

    Scaffold and iterate on Vite + React applications. An agent skill from initializ/forge.

    222 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • K8s Pod Rightsizer

    initializ/forge

    Analyze Kubernetes workload metrics and produce policy-constrained CPU/memory rightsizing recommendations with optional patch generation and rollback-safe apply.

    222 GitHub stars~4.3k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about K8s Cost Visibility

What does K8s Cost Visibility do?

Estimate Kubernetes infrastructure costs by querying cluster node, pod, PVC/PV, and LoadBalancer data, applying cloud pricing models, and producing cost attribution reports with storage and…. K8s Cost Visibility is an agent skill from initializ/forge. Estimate Kubernetes infrastructure costs by querying cluster node, pod, PVC/PV, and LoadBalancer data, applying cloud pricing models, and producing cost attribution reports with storage and LoadBalancer cost tracking, grouped by namespace, workload, node, label, or annotation.

When should I use K8s Cost Visibility?

K8s Cost Visibility fits situations like: tasks that involve Container orchestration; tasks that involve LLM cost and token optimization; tasks that involve Pricing strategy.

How do I install K8s Cost Visibility in Claude Code?

Run `npx skills add initializ/forge --skill k8s-cost-visibility -a claude-code`. Or copy the skill folder (forge-skills/local/embedded/k8s-cost-visibility in initializ/forge) into .claude/skills/k8s-cost-visibility in your project. Claude Code loads it when a task matches its description.

How do I install K8s Cost Visibility in Codex?

Run `npx skills add initializ/forge --skill k8s-cost-visibility -a codex`. Or copy the skill folder (forge-skills/local/embedded/k8s-cost-visibility in initializ/forge) into .agents/skills/k8s-cost-visibility in your project. Codex loads it when a task matches its description.

Can I use K8s Cost Visibility in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add initializ/forge --skill k8s-cost-visibility -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/k8s-cost-visibility, .gemini/skills/k8s-cost-visibility, .github/skills/k8s-cost-visibility and .opencode/skills/k8s-cost-visibility in your project.

What does K8s Cost Visibility need to run?

Going by SKILL.md and its folder, K8s Cost Visibility needs a shell for the scripts in its folder and the command-line tools its instructions call (kubectl, aws, gcloud, az and node). Our summary lists: A Bash shell.

Does K8s Cost Visibility access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is K8s Cost Visibility safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does K8s Cost Visibility use?

K8s Cost Visibility is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does K8s Cost Visibility use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to K8s Cost Visibility?

Skills that share tags, products or a category with K8s Cost Visibility: Dt Platform Costs (Dynatrace/dynatrace-for-ai, 162 stars), Kubeshark Installer (kubeshark/kubeshark, 12k stars), KubeSphere Multi-Tenant Management (kubesphere/kubesphere, 17k stars) and Sim Helm (simstudioai/sim, 30k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains K8s Cost Visibility?

initializ (a GitHub organization) maintains it in initializ/forge, which has 222 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 8, 2026.

Source: initializ/forge on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.