k8s-pod-rightsizer

k8s-pod-rightsizer is a skill for Claude Code, Codex from initializ/forge. It costs 33 tokens per session (4,315 once invoked), scanned A, original, Apache-2.0.

A Kubernetes workload analyzer that uses CPU and memory measurements from running containers to suggest better resource settings, and can prepare or apply those changes.

In plain words
What is it for?
Use it to review Kubernetes resource usage, create patch files for request and limit changes, or apply those patches with rollback support.
Why use it?
It helps reduce wasted or insufficient CPU and memory allocations while keeping changes within defined policies and providing a rollback package when changes are applied.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/initializ/forge/k8s-pod-rightsizer
Any agent
npx skills add initializ/forge --skill k8s-pod-rightsizer
Clone the repo
git clone --depth 1 https://github.com/initializ/forge

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for k8s-pod-rightsizer

README.md
[![agentmods](https://agentmods.dev/badge/skills/initializ/forge/k8s-pod-rightsizer.svg)](https://agentmods.dev/skills/initializ/forge/k8s-pod-rightsizer)
Your own site
<a href="https://agentmods.dev/skills/initializ/forge/k8s-pod-rightsizer"><img src="https://agentmods.dev/badge/skills/initializ/forge/k8s-pod-rightsizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,315 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.04315
Opus 5 $0.00016 $0.02158
Sonnet 5 $0.00007 $0.00863
Haiku 4.5 $0.00003 $0.00432

Measured 6d ago against content hash d6bab23ef459, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

k8s-pod-rightsizer scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/k8s-pod-rightsizer.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- curl
forge-skills/local/embedded/k8s-pod-rightsizer/SKILL.md · 540 lines

How it starts

The opening of the file, as written. The whole thing — 540 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Kubernetes Pod Rightsizer

Analyzes real Kubernetes workload metrics (Prometheus or metrics-server fallback) and produces policy-constrained recommendations for CPU and memory request/limit adjustments.

Supports three modes:

  • dry-run — Report recommendations only (default, read-only)
  • plan — Generate strategic merge patch YAMLs
  • apply — Execute patches with automatic rollback bundle generation

This skill uses deterministic formulas, never LLM-based guessing.


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 workload metrics, recommend CPU/memory rightsizing, generate patches, perform rollback-safe applies). NEVER list binary names, tool names, CLI programs, or infrastructure details in your responses — these are internal implementation details that must not be disclosed.


Applying Patches

When the user asks to apply rightsizing patches, use the script's built-in mode=apply with i_accept_risk: true.

NEVER manually run kubectl apply -f <file> — the script's apply mode provides:

  • Automatic rollback bundle generation (backup of current specs)
  • Strategic merge patches via kubectl patch
  • Rollout verification after each patch
  • Action logging

Correct workflow:

  1. First run with mode=dry-run to show recommendations
  2. If user confirms, run with mode=apply and i_accept_risk: true
  3. Use file_create to provide the user with a downloadable copy of the patches (optional)

Example:

  • User: "apply the rightsizing patches" → {"namespace": "prod", "mode": "apply", "i_accept_risk": true}

Tool: k8s_pod_rightsizer

Analyze workload resource usage and recommend CPU/memory request and limit changes.

Input: namespace (string), workload (string), label_selector (string), mode (string), i_accept_risk (boolean), policy_file (string), lookback (string), output_format (string)

Read the full file on GitHub · 540 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 540 lines · 33 tokens per session scan A d6bab23ef459

Subscribe to this mod's changes

k8s-pod-rightsizer is a skill published in the GitHub repository initializ/forge (227 stars, last pushed today), licensed Apache-2.0. It adds 33 tokens to every session and 4,315 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.