[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EF8T42HZP85JM7HST1YGW6":3,"skill-same:01M6EF8T42HZP85JM7HST1YGW6":50},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":23,"linkOnly":24,"markdownContent":25,"markdownBody":25,"frontMatter":26,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M6EF8T42HZP85JM7HST1YGW6","k8s-cost-optimizer",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fk8s-cost-optimizer\u002FSKILL.md",[],[18,19,20,21,22],"cost optimizer","cost","optimizer","k8s","k8s cost optimizer","2026-11-10 10:12:30",false,"# Kubernetes Cost Optimizer\n\n## Overview\n\nThis skill audits Kubernetes clusters for resource inefficiency by comparing requested CPU\u002Fmemory against actual usage from metrics-server. It identifies zombie deployments, overprovisioned workloads, and generates kustomize-compatible patches for right-sizing with safety buffers.\n\n## Instructions\n\n### Step 1: Verify Cluster Access and Metrics Availability\n\nRun `kubectl cluster-info` and `kubectl top nodes` to confirm connectivity and that metrics-server is running. If metrics-server is unavailable, inform the user and suggest installing it first.\n\n### Step 2: Collect Resource Data\n\nFor each namespace (or user-specified namespaces):\n\n```bash\n# Get resource requests\u002Flimits for all pods\nkubectl get pods --all-namespaces -o json | jq '[.items[] | {\n  namespace: .metadata.namespace,\n  pod: .metadata.name,\n  containers: [.spec.containers[] | {\n    name: .name,\n    cpu_request: .resources.requests.cpu,\n    cpu_limit: .resources.limits.cpu,\n    mem_request: .resources.requests.memory,\n    mem_limit: .resources.limits.memory\n  }]\n}]'\n\n# Get actual usage\nkubectl top pods --all-namespaces --no-headers\n```\n\n### Step 3: Calculate Efficiency Ratios\n\nFor each deployment, compute:\n- **Efficiency** = actual_usage \u002F requested × 100\n- **Waste** = 100 - efficiency\n- **Monthly cost estimate** = (requested_cpu × node_cost_per_cpu) + (requested_mem × node_cost_per_gi)\n\nUse these reference prices if the user doesn't specify:\n- On-demand: ~$0.0425\u002FvCPU-hour, ~$0.0057\u002FGiB-hour (AWS us-east-1 m5 family)\n- Convert to monthly: multiply hourly by 730\n\n### Step 4: Identify Zombie Workloads\n\nFlag deployments where:\n- CPU usage is \u003C 1m (1 millicore) for 7+ days\n- Pod restart count is 0 and replicas are running\n- Namespace matches staging\u002Fdev\u002Fpreview patterns\n\n### Step 5: Generate Right-Sizing Recommendations\n\nFor each overprovisioned workload:\n1. Take the p99 usage over available history (ideally 14 days)\n2. Add a configurable headroom buffer (default: 30%)\n3. Set requests = p99 + buffer, limits = requests × 1.5\n4. Output as kustomize patches or plain YAML diffs\n\n### Step 6: Produce Summary Report\n\nFormat a table showing:\n- Top waste offenders sorted by estimated monthly savings\n- Total cluster waste percentage\n- Projected annual savings\n- Risk assessment (low\u002Fmedium\u002Fhigh) for each recommendation\n\n## Examples\n\n### Example 1: Namespace Audit\n\n**User prompt:**\n```\nAudit the api-services namespace for resource waste\n```\n\n**Agent output:**\n```\nResource Audit: api-services namespace\n───────────────────────────────────────\n\nDeployment          Replicas  CPU Req→Used   Mem Req→Used    Efficiency  Est. Waste\nuser-auth           3         500m→120m      1Gi→340Mi       26%         $85\u002Fmo\norder-processor     2         1000m→650m     2Gi→1.4Gi       68%         $31\u002Fmo\nemail-worker        2         250m→15m       512Mi→80Mi      8%          $42\u002Fmo\n\nRecommendations:\n1. email-worker: Reduce to 1 replica, set requests to cpu:50m\u002Fmem:150Mi → saves $42\u002Fmo\n2. user-auth: Set requests to cpu:180m\u002Fmem:500Mi → saves $68\u002Fmo\n3. order-processor: Requests are reasonable, minor trim to cpu:850m → saves $12\u002Fmo\n\nTotal potential savings: $122\u002Fmonth ($1,464\u002Fyear)\n```\n\n### Example 2: Zombie Detection\n\n**User prompt:**\n```\nFind unused deployments across all namespaces\n```\n\n**Agent output:**\n```\nZombie Workloads Detected\n─────────────────────────\n\nNamespace: staging\n  ✗ feature-auth-v2      2 replicas  CPU: 0m  Last deploy: 2025-09-14  → $28\u002Fmo wasted\n  ✗ hotfix-payment-flow   1 replica   CPU: 0m  Last deploy: 2025-10-02  → $14\u002Fmo wasted\n  ✗ demo-dashboard        3 replicas  CPU: 0m  Last deploy: 2025-07-28  → $42\u002Fmo wasted\n\nNamespace: dev\n  ✗ test-migration        1 replica   CPU: 0m  Last deploy: 2025-11-18  → $14\u002Fmo wasted\n\nSuggested cleanup:\n  kubectl delete deployment feature-auth-v2 hotfix-payment-flow demo-dashboard -n staging\n  kubectl delete deployment test-migration -n dev\n\nTotal zombie cost: $98\u002Fmonth\n```\n\n## Guidelines\n\n- **Never auto-apply changes** — always present recommendations for human review\n- **Safety buffer is critical** — default 30% headroom prevents OOMKills after right-sizing\n- **Prioritize by savings** — show the biggest wins first so users focus effort where it matters\n- **Account for traffic patterns** — warn if usage data covers less than 7 days or misses peak periods\n- **Consider HPA** — if a deployment has a HorizontalPodAutoscaler, note that right-sizing requests affects scaling thresholds\n- **Staging vs production** — be more aggressive with staging recommendations, more conservative with production\n- **Cost estimates are approximate** — note the instance type assumptions and suggest the user verify with their actual pricing\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Fk8s-cost-optimizer",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill k8s-cost-optimizer",{"tool":42,"command":43},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill k8s-cost-optimizer",{"tool":45,"command":46},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill k8s-cost-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Fk8s-cost-optimizer\u002FSKILL.md",true,[],[51,60,69,78,84,90],{"skillNo":52,"name":53,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":23},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[57,58,59],"model","model hierarchy","model hierarchy skill",{"skillNo":61,"name":62,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":23},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[66,67,68],"MCP","zoom","zoom mcp",{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":23},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[75,76,77,67],"sdk","zoom apps sdk","apps",{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":23},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[80],{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":23},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[86],{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":23},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[92]]