本文へ移動
cccskills
無料GitHub で公開

ops-cost-optimization

Audits SaaS, cloud, payment, and AI spend. Use when analyzing bills, right-sizing plans, sizing Savings Plans or CUDs, cutting payment-processing fees, or LLM self-host breakeven.

インストール方法を見る

含まれるファイル(19)

  • SKILL.md14.3 KB
  • agents/cost-auditor.md2.8 KB
  • agents/openai.yaml370 B
  • assets/cost-uncertainty-example.json3.3 KB
  • assets/cost-uncertainty-joint-example.json1012 B
  • assets/monthly-cost-review-checklist.md2.1 KB
  • data/sources.json12.6 KB
  • learnings.consolidated.md597 B
  • learnings.md580 B
  • references/ai-api-cost-guide.md23.5 KB
  • references/cloud-commitment-and-k8s-cost-guide.md31.9 KB
  • references/cost-monitoring-setup.md8.3 KB
  • references/cost-uncertainty-method.md3.9 KB
  • references/unit-economics-guide.md10.8 KB
  • references/vendor-billing-guide.md33.1 KB
  • scripts/cost_estimator.py10.3 KB
  • scripts/cost_uncertainty.py27.1 KB
  • scripts/test_cost_estimator.py8.6 KB
  • scripts/test_cost_uncertainty.py14.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

SaaS/PaaS Cost Optimization

Use this skill to audit, reduce, and monitor infrastructure and SaaS spending. Keep the output operational: cost breakdown, waste identification, optimization actions, and monitoring setup.

Quick Reference

NeedStarting ReferenceNotes
audit a SaaS or infrastructure vendor bill (Vercel, Supabase, Cloudflare, Stripe, GitHub/CI, monitoring, email, domains)references/vendor-billing-guide.mdvendor lookup step, plan-tier crossover, per-vendor billing dimensions and ranked levers
audit payment processingreferences/vendor-billing-guide.md#stripestacked-fee arithmetic, IC+ rule, payment mix, Radar break-even, volume negotiation
audit AI API spend or self-host vs API breakevenreferences/ai-api-cost-guide.mdcost-per-success model, prompt caching, batch API, model routing, breakeven formula
quantify uncertain cost or budget riskreferences/cost-uncertainty-method.mdreproducible Monte Carlo, joint empirical dependence, Morris screening
decide on AWS/GCP/Azure commitments or K8s cost allocationreferences/cloud-commitment-and-k8s-cost-guide.mdd-quantile commitment sizing, instrument shapes (Savings Plans, RIs, CUDs, Spot), application order, exit rules per provider, when NOT to commit, showback before chargeback, GPU capacity, FinOps Framework vocabulary
cut egress or storage-class costreferences/cloud-commitment-and-k8s-cost-guide.md#egress-and-storage-class-trapscross-AZ and NAT charges, minimum storage duration, retrieval and rehydration, small-object minimums, break-even before a lifecycle rule
set up cost monitoringreferences/cost-monitoring-setup.mdbudget alerts, review cadence, FOCUS normalization
track unit economicsreferences/unit-economics-guide.mdcost per customer/feature/request, ARPC tracking, FOCUS standard
IaC cost guardrails in CIreferences/vendor-billing-guide.md#iac-cost-guardrailsInfracost PR diffs, budget-threshold merge gates
monthly cost reviewassets/monthly-cost-review-checklist.mdreusable review template
automated cost audit from billing dataagents/cost-auditor.mdparses screenshots/API data, ranks top 5 cost drivers, outputs prioritized actions

Workflow

  1. inventory — list all paid services, current plans, billing cycles, and monthly spend
  2. audit — for each service: pull usage data, compare to plan limits, identify top cost drivers by dollar amount
  3. diagnose — classify each cost line:
    • necessary: directly supports revenue or product function
    • reducible: supports function but can be lowered via architecture or configuration
    • wasteful: unused, over-provisioned, or cheaper alternative exists
  4. optimize — load the platform-specific reference file and apply the highest-impact tactics first
  5. verify — keep the estimate as a forecast until a comparable usage export or closed bill shows the change; normalize for traffic, seats, storage, and billing-period length
  6. monitor — set up budget alerts, usage dashboards, and a monthly review cadence using references/cost-monitoring-setup.md

Uncertain cost decisions

Trigger this only when ranges or dependence can change the decision. Supply bounded distributions with units, dated provenance, distribution rationale, an auditable component formula, budget, draws, and seed; use the example as the input contract. Run python3 scripts/cost_uncertainty.py --input assets/cost-uncertainty-example.json --sensitivity. Read cost quantiles and modeled budget-exceedance probability separately from simulation_error; more draws reduce numerical error, not model uncertainty. Use deterministic arithmetic for fixed inputs, and fall back to low/base/high scenarios when probability weights or dependence cannot be defended.

Decision Rules

  • start with the highest-cost service and work down
  • distinguish usage-based charges (optimizable) from flat subscriptions (right-size or cancel)
  • check if the free tier covers actual usage before paying for a plan
  • look up current prices with the vendor price lookup and record the date; the references carry no prices
  • between two plan tiers, switch when forecast usage exceeds the crossover u* = q_A + (f_B − f_A) / r_A
  • prefer architecture changes (caching, CDN, SSG, on-demand ISR) over plan upgrades
  • compare annual vs monthly pricing — annual is usually cheaper; compute the difference from the vendor's price page, and take annual only for services you expect to keep for the whole term
  • consolidate services when one platform covers several needs at a lower total cost; confirm on each candidate's plan page which needs its existing plan already bundles
  • never optimize a $2/month line before a $20/month line
  • when in doubt, measure for one billing cycle before cutting
  • never buy a commitment (Savings Plan, RI, CUD, Reservation) against usage that hasn't been stable for 4-6+ weeks, or during an active migration/re-platform — see references/cloud-commitment-and-k8s-cost-guide.md
  • size a commitment at the d-quantile of hourly usage over the term (d = the quoted discount), not at a fixed fraction of the minimum; lower it only for a named decline, migration, or architecture risk. See the sizing rule
  • treat every commitment as final: GCP CUDs and Azure savings plans cannot be cancelled, AWS Savings Plans only inside a short small-plan return window, and RI resale or Azure reservation refunds are capped; size with the haircut for named risks instead of planning to unwind later — see exit rules
  • before a storage lifecycle rule or a "cheaper storage" move, compute the break-even from object age distribution, read rate and transfer direction, not the per-GB rate; cooler classes bill a minimum duration, per-GB retrieval and small-object minimums, and egress is charged per direction — see egress and storage-class traps
  • separate zero-risk waste elimination from margin/durability trade-offs before cutting — a cut that reduces headroom or DR posture needs an explicit risk owner, not just a plan-tier downgrade
  • weigh implementation and ongoing operational cost (engineer-time, new on-call burden) against savings before recommending a migration — a cheaper service that costs six weeks to adopt often doesn't pay back for a year
  • mark each result forecast, observed, or realized; only realized means the saving appeared on a closed bill without an unacceptable SLO, support, security, or recovery regression

Cost Categories

CategoryExamplesOptimization Lever
computeVercel Functions, Supabase database, edge workersreduce invocations, optimize cold starts, right-size memory
bandwidthFast Origin Transfer, database egress, CDN transfercaching, compression, image optimization, SSG
storageSupabase storage, R2, S3, blob storeslifecycle policies only past the class minimum duration and read-rate break-even, compression, deduplication
per-requestISR writes/reads, API calls, email sendsbatching, caching, debouncing, on-demand invalidation
subscriptionsPro plans, seats, add-onsright-size plan tier, remove unused seats/add-ons
transaction feesStripe processing, dispute feesvolume negotiation, reduce disputes, batch payouts
AI tokensLLM APIs, fine-tuning, self-hosted GPU inferenceprompt caching, model routing, batch API, shorter prompts, spot/reserved GPU capacity
cloud commitmentsAWS Savings Plans/RIs, GCP CUDs, Azure Reservationssize at the d-quantile of stable usage, layer flexible + rigid instruments, never commit mid-migration
K8s cluster costshared node pools, control plane, storage, load balancersnamespace/label cost allocation (OpenCost or a similar allocation tool), showback before chargeback, request-vs-usage rightsizing

When to Use This Skill

  • monthly bill is higher than expected and you want to find what's driving it
  • launching new projects and want to forecast infrastructure costs
  • comparing free tier vs paid tier for a service
  • setting up cost alerts and budget monitoring
  • annual cost review and plan right-sizing
  • evaluating whether to switch or consolidate services
  • deciding whether to buy a Savings Plan, Reserved Instance, or Committed Use Discount, and how much
  • allocating shared Kubernetes cluster cost back to teams or features
  • governing AI/LLM spend before a new model-backed feature ships

Route Elsewhere

  • company-level burn rate, runway, and financial operations -> startup-operating-system
  • infrastructure architecture and platform design -> ops-devops-platform
  • choosing between managed backend platforms -> software-baas-platforms
  • AI API integration patterns (not cost) -> software-ai-integration
  • payment system design (not cost) -> software-payments
  • ML training and inference infrastructure levers (GPU scheduling, serving autoscaling, retraining cadence) -> ai-mlops
  • LLM serving efficiency (batching, quantization, KV cache, engine choice) -> ai-llm-inference

Optimization Playbook

Quick wins (do first)

  • remove unused projects, environments, and preview deployments
  • switch time-based ISR revalidation to on-demand revalidation
  • enable image optimization and compression
  • check for services still on paid plans but no longer used
  • stop paying separately for DNS when a provider you already use bundles it in your plan (check its plan page)

Architecture changes (do next)

  • move static content to CDN or SSG to reduce function invocations
  • add response caching at edge to reduce origin transfer
  • batch API calls and email sends instead of per-request
  • use prompt caching for repeated AI API calls
  • implement connection pooling to reduce database compute

Plan optimization (do quarterly)

  • compare current usage against plan tier limits
  • evaluate annual vs monthly billing
  • check if usage has dropped below the free tier threshold
  • negotiate volume pricing when crossing tier boundaries
  • remove unused seats and add-ons

Anti-Patterns

  • switching to a cheaper service without accounting for migration effort
  • cutting costs that directly support revenue-generating features
  • skipping monitoring setup — costs drift back up within months
  • over-provisioning "just in case" without measuring actual usage

Navigation

Platform references

Cross-platform

Agents

Related Skills

Learnings Loop

When prior decisions or pitfalls are relevant, consult learnings.consolidated.md if present; use learnings.md only for needed history or as the available fallback. Otherwise skip both.

After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Configures Claude Code hooks and Codex hooks.json/notify. Use when adding PreToolUse guards, Stop hooks, managed hooks, format-on-save, preflight, audits, or worktree/budget hooks.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Configures and hardens Claude Code and Codex MCP servers. Use when connecting databases, APIs, SaaS, building servers, or serving a clearance-filtered knowledge base.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Owns instruction files: AGENTS.md, CLAUDE.md, personal and repo rules. Use when writing, pruning, auditing them, sharing rules across Claude and Codex, or fixing ignored rules.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Creates and audits agent skills: SKILL.md, references, scripts, runtime metadata. Use when writing, validating, or security-reviewing a skill, or fixing truncated skill listings.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Adds per-skill learnings loops for dated patterns, mistakes, and domain facts. Use when wiring skill memory, consolidation, or drift audits.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

Chooses subagent, team, workflow, or debate and launches it on Claude Code or Codex. Use when delegating, running agent review boards, or installing shared agents.

日本語の概要は準備中です。原文の説明を表示しています。

vasilyu1983/AI-Agents-public932026年10月12日 更新

vasilyu1983 のスキルをすべて見る

このスキルの問題を報告する