用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ffsshhttiikk/opencode-agents-skills --skill cloud-cost-optimization命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | cloud-cost-optimization |
| description | Cloud spending reduction strategies |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"devops-engineer, platform-engineer, finance","category":"devops"} |
-- AWS Cost Explorer - Daily costs by service
SELECT
line_item_usage_start_date,
line_item_product_code,
SUM(line_item_unblended_cost) as cost
FROM aws_cost_and_usage
WHERE line_item_usage_start_date
BETWEEN DATE_TRUNC('month', CURRENT_DATE)
AND CURRENT_DATE
GROUP BY 1, 2
ORDER BY 3 DESC;
# GCP Recommender API example
from google.cloud import recommender_v1
client = recommender_v1.RecommenderClient()
project_id = "my-project"
# Get idle resource recommendations
recommendations = client.list_recommendations(
parent=f"projects/{project_id}/locations/-/recommenders/"
f"google.compute.instance.IdleResourceRecommender"
)
for rec in recommendations:
print(f"Recommendation: {rec.description}")
print(f"Potential savings: {rec.primary_impact.cost_forecast.amount}")
| Category | Strategy | Potential Savings |
|---|---|---|
| Compute | Right-sizing instances | 20-40% |
| Compute | Reserved/Savings Plans | 30-60% |
| Storage | Lifecycle policies | 50-70% |
| Data Transfer | CDN usage | 40-60% |
| Database | Reserved instances | 30-50% |
| Serverless | Pay-per-use optimization | 20-30% |
# Kubernetes pod scheduling for cost savings
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: low-priority
value: -10
globalDefault: false
description: "Non-production workloads"
---
apiVersion: v1
kind: Pod
metadata:
name: batch-job
spec:
priorityClassName: low-priority
tolerations:
- key: "spot"
operator: "Equal"
value: "true"
effect: "NoSchedule"
# Terraform AWS Budgets
resource "aws_budgets_budget" "monthly" {
name = "monthly-cost-budget"
budget_type = "COST"
limit_amount = "5000"
limit_unit = "USD"
time_period_start = "2024-01-01"
time_unit = "MONTHLY"
notification {
comparison_operator = "GREATER_THAN"
threshold = 80
threshold_type = "PERCENTAGE"
notification_type = "FORECASTED"
}
}