cost-optimization
Skill3 starsChanged 4 months agoMITView on GitHub
Use when optimizing cloud spend — measure before you optimize: establish a cost baseline, identify the cost driver, then improve. Triggers on "cost", "cloud bill", "FinOps", "spend", "成本优化", "云账单", "费用". Not for latency tuning (use performance) or capacity/load validation (use load-testing).
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
- borhen68/SkillEnginetheir own version, first seen Jun 11, 2026
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
- ai4brands-design/claude-skills★ 2same name
- CodeWithBehnam/cc-docs★ 2same name
- gokulsvision/crewm8-cfo-skills★ 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 repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brainstormSkill
- oss-strategySkill
- specSkill
- researchSkill
- api-designSkill
- architectureSkill
- codebase-designSkill
- design-researchSkill
- domain-modelingSkill
- frontend-designSkill
- imagegenSkill
- image-to-codeSkill
- prompt-engineeringSkill
- prototypeSkill
- schema-designSkill
- auth-implementationSkill
- breakdownSkill
- context-engineeringSkill
- error-handlingSkill
- i18nSkill
- implementSkill
- multi-agent-orchestrationSkill
- performanceSkill
- refactoringSkill
- simplifySkill
- api-testingSkill
- e2e-testingSkill
- load-testingSkill
- tddSkill
- test-generationSkill
- a11y-reviewSkill
- code-reviewSkill
- debuggingSkill
- lintingSkill
- security-reviewSkill
- ci-cdSkill
- deprecation-migrationSkill
- git-workflowSkill
- oss-polishSkill
- shippingSkill
- documentation-auditSkill
- handoffSkill
- incident-responseSkill
- observabilitySkill
- purity-auditSkill
- skill-authoringSkill
- using-skillsSkill
The file
Files
Cost Optimization
Spend is a metric with the same discipline as latency: measure a baseline, find the dominant driver, change one thing, re-measure. A cost cut without a before/after number is a guess. "Cheaper" is not a goal — "same behavior, lower bill, verified" is.
When to use
- The cloud bill is rising without an obvious cause, or a specific service is over budget.
- Right-sizing resources, committing to reserved capacity, or cutting idle spend.
- Choosing between pricing models (on-demand vs reserved vs spot) for a workload.
- Building cost guardrails (budgets, alerts, per-team attribution) before spend grows.
Not for: latency tuning (use performance); capacity validation under load (use load-testing); deploying the cost dashboards themselves (use observability).
Steps
1. Measure — establish a baseline with real billing data
Pull the last 1–3 months of actual spend from the billing system (AWS Cost Explorer, GCP Billing, Azure Cost Management), grouped by service and tag. A single number ("we spend $12k/mo") is not a baseline — you need the breakdown to know where the lever is. Note the unit economics: cost per request, cost per user, cost per job — the absolute number grows with the business; the unit cost is what optimization moves.
2. Identify the cost driver (not assumed)
Rank services by spend share. The top 1–2 services are almost always where the money goes — optimizing the long tail first is a classic misdirection. For each top service, classify the driver — see references/cost-drivers.md for the symptom→cause map (over-provisioned compute, idle resources, egress/transfer, storage lifecycle, reserved-capacity gap).
3. Fix the specific driver
Change one thing at a time, same as performance. Common levers, in order of payoff:
- Right-size — drop the instance/container class to what the workload actually needs (check p95 CPU/memory against the current class).
- Cut idle — stop dev/staging outside hours, delete unattached volumes, expire old snapshots.
- Commit — reserved instances / savings plans / committed-use discounts for steady-state load; spot for interruptible batch.
- Fix the architecture — the highest-leverage and slowest: cache, batch, co-locate to cut egress, move cold storage tiers.
4. Verify — re-measure, keep or revert
Compare the next billing cycle (or a representative week) against the baseline. Same rules as performance: neutral is a revert, not a keep (you added complexity for no gain). Correctness gates the metric — if latency or reliability regressed, the cost cut failed even if the bill dropped.
5. Guard against regression
Record the change in an attempt ledger so the same cut isn't re-investigated. Set a budget alert at the new baseline + 20% so creep is caught early, not at month-end. Tag every resource with owner + environment so future attribution is automatic. For idle cuts (dev/staging schedules, unattached volumes), put a guard on re-provisioning — a policy/IaC rule or a tag-based alarm that flags the resource returning, so the cut persists rather than silently regrowing.
Verify
- Baseline is a per-service breakdown from real billing data, not a single total
- The top 1–2 cost drivers were identified before any change was made
- One lever changed at a time; each has a before/after number
- Unit cost (per request/user/job) moved, not just the absolute bill
- Latency and reliability did not regress (correctness gates the metric)
- A budget alert guards the new baseline; idle-cut guards re-grow
- Changes recorded in the attempt ledger
Red flags: optimizing the cheap long tail while the top service is untouched; a cost cut with no before/after number; "we moved to spot" without a fallback for interruption; deleting resources to hit a short-term target with no guard against re-provisioning; a cut that regressed latency or p99 and was kept anyway.
Output: COST.md (optional) — attempt ledger of cost changes (kept + reverted), mirroring PERF.md. Project-level, so a future session doesn't re-investigate a closed lever.
References
- ${CLAUDE_PLUGIN_ROOT}/references/engineering-principles.md — shared discipline (verify don't assume, enforce simplicity, surgical scope)
- references/cost-drivers.md — symptom→cause map for cloud spend: over-provisioning, idle resources, egress, storage lifecycle, reserved-capacity gaps, with per-platform levers
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.

