agentleFS
RidhuanDEVRidhuanDEV/claude-skills/shadow-finops/SKILL.md

shadow-finops

Skill1 starsChanged yesterdayMITView on GitHub

Cloud, Kubernetes & AI/LLM Token FinOps. Use when analyzing or optimizing cloud, K8s, database, or LLM token costs under FinOps Framework and FOCUS, configuring prefix prompt caching, or capping thinking/output token budgets.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill whenever the Monarch invokes /shadow-finops, investigates cloud/database/AI cost spikes, designs multi-agent or RAG token …

    line 8
  2. Distinctive:

    Prefix Prompt Caching: Keep static system instructions, tool schemas, and shared knowledge bases at the start of the prompt.

    line 23
  3. Distinctive:

    Network & Egress: Keep chatty app-to-DB/cache traffic inside the same region/AZ where possible.

    line 29
  4. Distinctive:

    Run the deterministic FinOps auditor and cost estimator:

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/shadow-finops — Cloud, Kubernetes & AI/LLM Token FinOps Auditor

Use this skill whenever the Monarch invokes /shadow-finops, investigates cloud/database/AI cost spikes, designs multi-agent or RAG token budgets, or reviews Kubernetes/Terraform infrastructure for production efficiency.

Grounded in industry-canonical specifications documented in references/FINOPS-FRAMEWORK-FOCUS-AND-LLM-COST.md:

  1. FinOps Foundation Framework (Inform -> Optimize -> Operate phases across 4 Domains: Understand Usage & Cost, Quantify Business Value, Optimize Usage & Cost, Manage the FinOps Practice) — https://www.finops.org/framework/.
  2. FOCUS (FinOps Open Cost and Usage Specification) — https://focus.finops.org/ unified billing schema (BilledCost, EffectiveCost, ChargeCategory, PricingCategory, Tags).

1. The 4-Pillar FinOps Engineering Workflow

Pillar 1: Inform — Cost Visibility & FOCUS Normalization

  • Enforce mandatory cost allocation tags/labels (env, service, owner, tenant_tier) across cloud resources, Kubernetes workloads, and LLM gateway requests.
  • Normalize multi-cloud/SaaS billing datasets using FOCUS columns (EffectiveCost for amortized commitments, BilledCost for cash invoice, ChargeCategory, PricingCategory) and measure Unit Economics (e.g., cost per 1,000 API calls, cost per resolved customer ticket, cost per tenant/month).

Pillar 2: Optimize — AI / LLM Token Economics

  • Prefix Prompt Caching: Keep static system instructions, tool schemas, and shared knowledge bases at the start of the prompt. Never inject dynamic timestamps (datetime.now(), Date.now()), request IDs, or random UUIDs into the system prefix (which invalidates KV/prefix caches and destroys 75%–95% cached input discounts).
  • Output & Thinking Token Caps: Remember that reasoning/thinking tokens are billed as output tokens. Enforce explicit max_output_tokens / max_completion_tokens and bounded thinking_budget per route (OWASP LLM10:2025).
  • Model Tier Routing & Batch APIs: Route complex planning/architecture/root-cause tasks to frontier reasoning tiers, routine coding/extraction to efficient workhorse tiers, and asynchronous offline jobs (evals, bulk classification, doc indexing) to Batch APIs (typically 50% cheaper).

Pillar 3: Optimize — Cloud, Kubernetes & Database Infrastructure

  • Kubernetes Workloads: Require resources.requests and resources.limits + bounded Horizontal Pod Autoscaler (minReplicas/maxReplicas) on every Deployment/StatefulSet; right-size over-provisioned CPU/RAM (>50% idle P95).
  • Network & Egress: Keep chatty app-to-DB/cache traffic inside the same region/AZ where possible; replace cross-NAT S3/GCS transfers with VPC gateway endpoints.
  • Storage & Non-Prod Hygiene: Enforce S3/GCS lifecycle rules (transition stale logs/backups to IA/Glacier or delete expired previews), pause/auto-sleep staging DBs off-hours, and eliminate orphaned unattached EBS/PD volumes and stale container images.

Pillar 4: Operate — Budgets, Burn Alerts & Automated Audit

Run the deterministic FinOps auditor and cost estimator:

python "shadow-finops/scripts/finops_cost_auditor.py" --audit .
python "shadow-finops/scripts/finops_cost_auditor.py" --estimate-llm --calls-per-day 50000 --input-tokens 8000 --output-tokens 600 --thinking-tokens 1200 --cache-hit-rate 0.80 --input-rate 1.50 --output-rate 7.50 --cached-discount 0.95
python "shadow-finops/scripts/finops_cost_auditor.py" --self-test

Report every optimization with Current Cost / Risk -> Concrete Change -> Estimated Monthly Savings -> Trade-off (Latency / Reliability).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.