cost-optimization
Skill1 starsChanged 9 months agoApache-2.0View on GitHub
Cloud cost optimization with concrete examples for right-sizing containers, CDN caching, database query costs, serverless tuning, spot instances, reserved capacity, and build time reduction.
- Installs packages
16 other projects use a version of this.
Adopted by
Most recently taken up by
- microsoft/GitHub-Copilot-for-Azuretheir own version, first seen Oct 1, 2026
- microsoft/azure-skillstheir own version, first seen Sep 23, 2026
- novatic-cu/nova-skillstheir own version, first seen Sep 20, 2026
- gspencergoog/skillstheir own version, first seen Sep 8, 2026
- cvsz/zomegatheir own version, first seen Sep 2, 2026
- int2t05/engineering-skillstheir own version, first seen Aug 13, 2026
Used with
Projects with it also use observability, context-engineering and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OpenAISkillobservability
Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.
Also in 3 projects that use this
mrgoonieSkillcontext-engineering
Master context engineering for AI agent systems. Use when designing agent architectures, debugging context failures, optimizing token usage, implementing memory systems, building multi-agent coordination, evaluating agent performance, or developing LLM-powered pipelines. Covers context fundamentals, degradation patterns, optimization techniques (compaction, masking, caching), compression strategies, memory architectures, multi-agent patterns, LLM-as-Judge evaluation, tool design, and project development.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 3 projects that use this
Other versions16 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 16
- microsoft/skills★ 3.1ksame name
- microsoft/azure-skills★ 1.5ksame name
- microsoft/GitHub-Copilot-for-Azure★ 253same name
- thomast1906/github-copilot-agent-skills★ 202same name
- borhen68/SkillEngine★ 17same name
- xfstudio/skills★ 9same name
- zllovesuki/cloudflare-agent-skills★ 9same name
- int2t05/engineering-skills★ 3same name
- ai4brands-design/claude-skills★ 2same name
- CodeWithBehnam/cc-docs★ 2same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository73 other files it gives its agents.
- accessibility-wcagSkill
- api-designSkill
- api-testingSkill
- asset-optimizationSkill
- audio-systemsSkill
- aws-essentialsSkill
- ci-cd-pipelinesSkill
- codebase-analysisSkill
- code-reviewerSkill
- container-securitySkill
- database-designSkill
- data-visualizationSkill
- doc-generationSkill
- docker-kubernetesSkill
- docxSkill
- email-notificationsSkill
- env-configSkill
- flutter-mobileSkill
- framer-motionSkill
- frontend-code-reviewSkill
- frontend-designSkill
- fullstack-developerSkill
- game-enginesSkill
- gameplay-designSkill
- game-programming-languagesSkill
- game-serversSkill
- git-workflowSkill
- godot-4Skill
- golang-proSkill
- go-linter-configurationSkill
- graphics-renderingSkill
- i18n-localizationSkill
- incident-responseSkill
- level-designSkill
- llm-integrationSkill
- local-securitySkill
- memory-managementSkill
- monetization-systemsSkill
- monitoring-observabilitySkill
- multiplayer-netcodeSkill
- nextjs-16Skill
- notebooklm-researchSkill
- npm-packageSkill
- oauth-authSkill
- particle-systemsSkill
- performance-optimizationSkill
- playwright-testingSkill
- postgres-advancedSkill
- programming-architectureSkill
- project-migrationSkill
- publishing-platformsSkill
- python-best-practicesSkill
- react-nativeSkill
- redis-patternsSkill
- refactoring-patternsSkill
- remotion-best-practicesSkill
- rust-best-practicesSkill
- scraping-automationSkill
- security-reviewSkill
- seo-metaSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
5
Distinctive
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
- Distinctive: line 22
GOOD: Use actual usage data from monitoring.
- Distinctive: line 28
If P50 is 200Mi/100m and P99 is 400Mi/300m:
- Distinctive: line 115
If baseline traffic needs 2 pods and peak traffic needs 10 pods for 2 hours/day:
- Distinctive: line 126
BAD: No cache headers. Every request hits the origin.
- Very specific: line 192
Use EXPLAIN ANALYZE to find missing indexes.
- Distinctive: line 231
Run linting, type checking, and tests concurrently in CI.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Container Right-Sizing
Monitor CPU and memory for 7 days before setting limits. Set requests to P50, limits to P99.
BAD: Guessing resource limits. Over-provisioned containers waste money.
resources:
requests:
memory: "1Gi"
cpu: "1000m"
limits:
memory: "2Gi"
cpu: "2000m"GOOD: Use actual usage data from monitoring.
kubectl top pod myapp-12345 --containersIf P50 is 200Mi/100m and P99 is 400Mi/300m:
resources:
requests:
memory: "200Mi"
cpu: "100m"
limits:
memory: "400Mi"
cpu: "300m"Vertical Pod Autoscaler
Get sizing recommendations from real workload data.
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: myapp-vpa
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: myapp
updateMode: "Off" # Recommendation mode onlyCheck recommendations:
kubectl describe vpa myapp-vpaCost Calculation
Example: 10 pods running 24/7 with 1Gi memory, 1 CPU.
- Memory: 10 pods x 1 GiB x $0.0004/hr = $29/month
- CPU: 10 pods x 1 core x $0.04/hr = $292/month
- Total: $321/month
Right-size to 200Mi memory, 100m CPU:
- Memory: 10 pods x 0.2 GiB x $0.0004/hr = $5.80/month
- CPU: 10 pods x 0.1 core x $0.04/hr = $29.20/month
- Total: $35/month
Savings: 89% ($286/month)
Horizontal Pod Autoscaler
Scale replicas based on actual load. Do not run excess capacity during low traffic.
BAD: Fixed replica count. Wastes money overnight and weekends.
spec:
replicas: 10GOOD: HPA scales from 2 to 10 based on CPU usage.
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: myapp-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: myapp
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70Cost Impact
If baseline traffic needs 2 pods and peak traffic needs 10 pods for 2 hours/day:
- Fixed 10 replicas: 10 x 24hr = 240 pod-hours/day
- HPA (2 baseline + 8 peak for 2hr): 2 x 24 + 8 x 2 = 64 pod-hours/day
Savings: 73% (176 pod-hours/day)
CDN Caching
Cache static assets with long TTLs. Use content hashes for cache busting.
BAD: No cache headers. Every request hits the origin.
GET /app.js
Cache-Control: no-cacheGOOD: 1-year cache with content hash in filename.
GET /app.abc123.js
Cache-Control: public, max-age=31536000, immutableAPI Response Caching
Even 60 seconds of caching eliminates burst traffic.
GET /api/categories
Cache-Control: public, max-age=60, s-maxage=60Stale-While-Revalidate
Serve cached content while fetching fresh data in the background.
Cache-Control: max-age=60, stale-while-revalidate=300Cost Impact
Example: 1M requests/month to origin at $0.01/10k requests = $100/month. With 90% cache hit rate: origin requests drop to 100k ($1/month). Savings: 99%.
Database Query Cost
Monitor query frequency x duration. A 10ms query running 10,000/min costs more than a 1s query running once.
BAD: N+1 query in a loop.
const orders = await db.orders.findMany();
for (const order of orders) {
order.user = await db.users.findUnique({ where: { id: order.userId } });
}GOOD: Single query with join.
const orders = await db.orders.findMany({ include: { user: true } });Slow Query Logging
Enable slow query log. Investigate queries over 100ms.
-- PostgreSQL
SET log_min_duration_statement = 100;
-- MySQL
SET long_query_time = 0.1;Use EXPLAIN ANALYZE to find missing indexes.
EXPLAIN ANALYZE SELECT * FROM orders WHERE user_id = 123;Serverless Cold Starts
BAD: Java Lambda with 1GB memory, VPC attached. Cold start: 5 seconds.
GOOD: Node.js Lambda with 512MB memory, no VPC. Cold start: 200ms.
Lambda allocates CPU proportional to memory. Under-provisioned memory = slower execution = higher duration costs.
Provisioned Concurrency
Eliminate cold starts for latency-sensitive functions. Cost: ~$26/month for 5 concurrent x 512MB. Use only for critical functions.
Build Time Optimization
Cache dependencies. Download once, reuse until lockfile changes.
BAD: Installing dependencies on every build.
COPY . .
RUN npm installGOOD: Cache dependencies in a separate layer.
COPY package*.json ./
RUN npm ci
COPY . .Parallel Build Steps
Run linting, type checking, and tests concurrently in CI. Total time = max(build, lint, test), not sum.
Turborepo Remote Cache
Share build artifacts across CI machines. First build uploads cache, subsequent builds skip rebuilding. Savings: ~70% on CI costs.
Spot Instances, Reserved Capacity, and Cost Monitoring
AWS spot instances (70-90% savings), reserved instances (40% savings), budget alerts, resource tagging, and non-production shutdown automation. See references/cloud-examples.md for detailed configs and scripts.
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
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.

