/skillengine:cost-optimizationfrom skillengine
Provides a systematic approach to finding and eliminating cloud infrastructure waste: rightsizing instances, optimizing storage tiers, tagging resources, and setting cost anomaly detection.
Ships in skillengine. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Cost optimization is not about being cheap — it's about spending money where it creates value and eliminating waste. In cloud environments, costs compound silently: oversized instances, forgotten dev environments, unoptimized storage tiers, and data transfer charges that nobody tracks. This skill provides a systematic approach to finding and eliminating waste while maintaining (or improving) system reliability.
The 80/20 rule of cloud costs: 80% of your bill comes from 20% of your resources. Focus on the big items first.
NOT for:
You can't optimize what you can't measure. Before changing anything:
COST ALLOCATION FRAMEWORK:
├── Tag everything (owner, environment, product, cost-center)
├── Enable detailed billing exports (hourly granularity)
├── Set up cost anomaly detection
├── Allocate shared costs (network, monitoring, platform)
└── Create per-team visibility dashboards
Key metrics to track:
| Metric | Why It Matters | Target |
|---|---|---|
| Cost per request | Efficiency of serving traffic | Trending down |
| Cost per user | Unit economics | Trending down |
| Idle resource % | Waste identification | < 10% |
| Storage $/GB | Tier optimization | Match workload pattern |
| Data transfer | Often the "surprise" line item | < 10% of total |
Run through this checklist systematically:
Compute Waste:
Storage Waste:
Network Waste:
Licensing/Reserved Waste:
RIGHTSIZING WORKFLOW:
1. Collect metrics (CPU, memory, disk I/O, network) for 14+ days
2. Identify peak vs average vs p99 usage patterns
3. Match instance/container size to actual needs + 20% headroom
4. Test the smaller size in staging under load
5. Deploy to production with monitoring
6. Observe for 48 hours, adjust if needed
Rightsizing examples:
# Before: c5.2xlarge (8 vCPU, 16 GB) — $0.34/hour
# Metrics show: 15% CPU avg, 45% memory avg, never bursts above 40%
# After: c5.large (2 vCPU, 4 GB) — $0.085/hour
# Savings: 75% for this instance
# Kubernetes: Adjust resource requests
# Before:
resources:
requests:
cpu: 2000m # Never uses more than 500m
memory: 8Gi # Uses 2Gi consistently
# After:
resources:
requests:
cpu: 750m # 50% overhead on observed peak
memory: 3Gi # 50% overhead on observed peak
limits:
cpu: 1500m
memory: 6Gi
Match storage to access patterns:
DATA ACCESS PATTERN → STORAGE TIER
─────────────────────────────────────────────────
Frequently accessed (< 7 days) → Hot / Standard
Occasionally accessed (7-90 days) → Warm / Infrequent Access
Rarely accessed (90+ days) → Cold / Archive
Never accessed (backup only) → Glacier / Deep Archive
Storage optimization examples:
# S3 Lifecycle Policy
{
"Rules": [
{
"ID": "MoveOldLogsToGlacier",
"Status": "Enabled",
"Filter": { "Prefix": "logs/" },
"Transitions": [
{ "Days": 30, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" }
],
"Expiration": { "Days": 2555 } // 7 years retention
}
]
}
# Database: Use read replicas for read-heavy workloads
# Instead of scaling primary DB vertically ($$$), add read replicas ($)
RESERVED CAPACITY DECISION MATRIX:
Usage Pattern → Recommendation
─────────────────────────────────────────────────
24/7 steady state → 1-year reserved (40-60% savings)
Predictable growth → 3-year reserved (up to 70% savings)
Seasonal / burst → Savings plans (flexible commitment)
Unpredictable / dev → Stay on-demand (flexibility > savings)
Spot-capable workloads → Spot instances (up to 90% savings)
Spot / preemptible instance strategy:
// Stateful workloads: Use spot with fallback
const computeStrategy = {
primary: 'spot', // 90% cheaper
fallback: 'on-demand', // When spot is unavailable
maxSpotPrice: 0.50, // Don't pay more than 50% of on-demand
interruptionBehavior: 'stop', // Save state, resume later
};
// Stateless workloads: Pure spot with auto-scaling
const workerPool = {
instanceType: 'c5.xlarge',
capacity: 'spot-only',
minSize: 2,
maxSize: 50,
targetCPU: 70,
};
Every optimization must be measurable:
## Optimization: [Name]
### Baseline
- Monthly cost: $[X]
- Primary driver: [compute/storage/network]
- Waste identified: [specific resources]
### Changes Made
1. [Change 1 with justification]
2. [Change 2 with justification]
### Results
- New monthly cost: $[Y] ([Z]% reduction)
- Performance impact: [none / improved / degraded — quantify]
- Reliability impact: [none / improved / degraded — quantify]
### Ongoing Monitoring
- Alert if cost exceeds $[threshold]
- Review monthly on [date]
- Re-evaluate if traffic changes > 20%
// Serverless functions for intermittent workloads
// Pay only for invocations, not idle time
export async function processWebhook(event: APIGatewayEvent) {
// Cold start: ~200ms (acceptable for async processing)
// Runtime: $0.20 per million requests vs $72/month for smallest VM
await validateWebhook(event);
await enqueueForProcessing(event.body);
return { statusCode: 202 };
}
CACHE HIERARCHY (cheapest to most expensive):
1. Browser cache (free for you)
2. CDN edge cache (pennies per GB)
3. Application cache (memory — cheap but limited)
4. Database cache (query cache, materialized views)
5. Re-compute (most expensive)
# BAD: Client → API → Database → API → Client (4 hops)
# GOOD: Client → CDN (cache hit) — 1 hop, $0.01/GB
# BAD: Cross-region replication for all data
# GOOD: Replicate metadata only, fetch data on-demand
# BAD: NAT Gateway for all outbound traffic ($0.045/GB)
# GOOD: VPC endpoints for AWS services ($0/GB)
| Rationalization | Reality |
|---|---|
| "We're too small for cost optimization to matter" | A single oversized database or forgotten dev environment can cost $500+/month. That's $6K/year — enough for a junior engineer's salary in many markets. |
| "Optimization will hurt performance" | Proper optimization improves performance. Rightsizing forces you to fix inefficiencies. Caching reduces latency. |
| "We'll just scale vertically" | Vertical scaling is the most expensive option. Horizontal scaling with smaller instances + auto-scaling is cheaper and more resilient. |
| "Reserved capacity locks us in" | Savings plans and convertible reserved instances provide flexibility. The "lock-in" cost is usually < 10% of the savings. |
| "Engineer time is more expensive than cloud costs" | True for small optimizations, but a single rightsizing exercise can save $10K+/year — that's more than the engineering time spent. |
After optimization:
performance-optimizationobservability-and-instrumentation (you need metrics to optimize)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
AWS, GCP, Azure, Docker, Kubernetes
cloud-costs, finops, rightsizing, budget-optimization, waste-reduction
npx claudepluginhub borhen68/skillengine --plugin skillengine28 skills in this plugin
/ai-opsGuides operational excellence for AI/ML systems in production. Use when deploying models, managing inference infrastructure, monitoring model drift, or maintaining AI-powered features. Use when you need reliable, observable, and governable machine learning systems./api-and-interface-designGuides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend./browser-testing-with-devtoolsTests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use when you need to inspect the DOM, capture console errors, analyze network requests, profile performance, or verify visual output with real runtime data. Requires the chrome-devtools MCP server to be configured./chaos-engineeringGuides systematic fault injection and resilience testing. Use when designing for high availability, verifying disaster recovery, testing failure modes, or building fault-tolerant systems. Use when you need to prove your system survives infrastructure failures, network partitions, dependency outages, or cascading errors./ci-cd-and-automationAutomates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies./code-review-and-qualityConducts multi-axis code review with hard rules against rubber-stamping and diff-only tunnel vision. Use before merging any change, whether written by yourself, another agent, or a human. Triggers on "review this", "is this ready to merge", or any completed implementation awaiting approval.Other plugins' skills for the same job