Aliyun Optimizer logo

Aliyun Optimizer

Community
yzstory
aliyun-optimizer

阿里云资源优化工具。多产品成本优化分析(ECS/RDS/EBS/EIP/SLB/CDN),查询 CPU/内存/连接数水位,提供升降配建议。直接调用即可,无需创建脚本。触发词:资源优化、闲置检测、降配建议、ECS优化、RDS优化、利用率分析

Overview

Publisheryzstory
Repositorypomeloclaw
Skill namealiyun-optimizer
Stars
59
Forks
4
Bundled files
25
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 25 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by yzstory on GitHub. Read the source before you install it.

Installation

Install the Aliyun Optimizer AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/yzstory/pomeloclaw/tree/main/workspace/skills/finops_skills/aliyun-optimizer
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/yzstory/pomeloclaw.git /tmp/pomeloclaw
mkdir -p .claude/skills
cp -r /tmp/pomeloclaw/workspace/skills/finops_skills/aliyun-optimizer .claude/skills/aliyun-optimizer
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Aliyun Optimizer in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Aliyun Optimizer on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Aliyun Optimizer is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

aliyun-optimizer

阿里云资源优化工具 — 多产品成本优化分析 + 云资源水位查询 + 升降配建议。

重要提示

❗ 请直接调用以下工具,无需创建脚本:

用户意图应调用的工具
按标签成本优化分析(推荐)opt_cost_by_tag ⭐ 新
多产品成本优化分析opt_cost_optimization
CDN 成本优化分析opt_cdn_cost_optimization ⭐ 新
Redis 成本优化分析opt_redis_cost_optimization ⭐ 新
NAT 闲置检测opt_nat_idle_check ⭐ 新
NAS 成本优化分析opt_nas_cost_optimization ⭐ 新
SLS 成本优化分析opt_sls_cost_optimization ⭐ 新
PolarDB-X 成本优化opt_drds_cost_optimization ⭐ 新
MSE注册中心成本优化opt_mse_cost_optimization ⭐ 新
Elasticsearch成本优化opt_elasticsearch_cost_optimization ⭐ 新
RocketMQ成本优化opt_rocketmq_cost_optimization ⭐ 新
ARMS资源包推荐opt_arms_cost_optimization ⭐ 新
MaxCompute CU资源包推荐opt_maxcompute_cost_optimization ⭐ 新
WAF SeCU资源包推荐opt_waf_cost_optimization ⭐ 新
Redis资源包推荐opt_redis_package_recommendation ⭐ 新
ECS 成本优化分析opt_ecs_cost_optimization
分析所有资源水位+升降配建议opt_all_resources_analysis
查询 ECS 水位/利用率opt_ecs_utilization_report
查询 RDS 水位/利用率opt_rds_utilization_report
查询 Redis 水位opt_redis_utilization_report
查询 EIP 带宽使用率opt_eip_utilization_report
查询 CLB 水位opt_clb_utilization_report
查询 MongoDB 水位opt_mongodb_utilization_report
查询 CDN 利用率opt_cdn_utilization_report ⭐ 新
查询 CDN 域名配置opt_cdn_config_check ⭐ 新
ECS 升降配建议opt_ecs_spec_recommend
RDS 升降配建议opt_rds_spec_recommend
云监控通用查询opt_cloudmonitor_query

按标签成本优化分析

🌟 opt_cost_by_tag - 按标签查询资源并进行成本优化分析

一站式工具,支持:

  1. 按指定标签查询资源(如 TAM-Group-Name:Default)
  2. 对这些资源进行成本优化分析
  3. 返回统一格式的 Markdown 报告

支持的产品:ECS / SLB

使用示例:

opt_cost_by_tag(tag_key="TAM-Group-Name", tag_value="Default", region_id="cn-hangzhou", products="ecs,slb")

通用成本优化框架

🌟 opt_cost_optimization - 多产品成本优化分析

支持的产品:ECS / RDS / EBS(云盘) / EIP / SLB

责任链模式:每个资源依次经过 3 个检测规则,命中即跳过后续:

优先级规则 ID策略判定逻辑
1IdleResourceCheckRelease (释放)所有监控指标 Maximum < 1% 或资源未绑定
2LowUtilizationCheckDownScaling (降配)P95 利用率 < 20%
3PostPaidLongTermCheckConvertToPrePaid (转包月)按量持有 > 30 天

后处理流水线(通用):

  1. 推荐优化规格
  2. 价格查询(见下方详细说明)
  3. 无效数据剔除

价格查询链路(极其重要)

❗ 必须严格遵循以下优先级,禁止跳过前级直接估算:

costBefore(当前费用)
优先级数据源说明
1账单查询调用 DescribeInstanceBill 获取真实历史费用,最准确
2BSS 询价账单无数据时,调用 GetPayAsYouGoPrice 查询当前规格价格
3OpenAPI 询价BSS 失败时,调用产品 DescribePrice API
4估算仅当上述全部失败时,必须标注 estimate 并说明原因
costAfter(目标费用)
优先级数据源说明
1BSS 询价调用 GetPayAsYouGoPrice 查询目标规格价格
2OpenAPI 询价BSS 失败时,调用产品 DescribePrice API
3估算仅当上述全部失败时,必须标注 estimate 并说明原因

注意:costAfter 不查账单,因为目标规格还没有实例,无账单数据。

各产品 BSS/OpenAPI 支持情况
产品BSS 询价OpenAPI 询价备注
ECS✅✅ ecs.DescribePrice-
RDS✅✅ rds.DescribePriceBSS 需拆分 Engine/EngineVersion 等独立 Module
SLB✅❌-
EBS✅✅ ecs.DescribePriceBSS 失败时 fallback 到 ECS OpenAPI
EIP❌ 按量不支持❌只能查账单或估算,说明见下方
EIP 价格查询特殊说明

阿里云 EIP 按量付费不支持 BSS 询价(返回 MissingParameter),因此:

  • 优先查账单 获取真实费用
  • 账单无数据时,根据计费方式估算:
    • 按流量计费:无法估算,请以账单为准
    • 按固定带宽计费:1-5Mbps=28.8元/月/Mbps,>5Mbps=100.8元/月/Mbps
  • 必须标注 estimate(按带宽) 并说明计费方式不确定
价格来源标注规范

报告中必须标注价格来源:

  • bill = 真实账单数据(最准确)
  • bss = BSS 官方询价 API
  • openapi = 产品 OpenAPI 询价
  • estimate = 估算值(必须说明原因)

使用示例:

opt_cost_optimization(region_id="cn-hangzhou", products="ecs,rds,disk")

产品配置清单

产品ProductCode闲置判定方式规则链
云服务器 ECSecs监控指标 (CPU/内存)闲置 → 低利用率 → 按量转包月
云数据库 RDSrds监控指标 (CPU/内存)闲置 → 低利用率 → 按量转包月
云盘 EBSdisk状态 (是否挂载)闲置 → 按量转包月
弹性公网 IPeip状态 (是否绑定)仅闲置检测
负载均衡 SLBslb状态 (后端是否为空)闲置 → 低利用率

CDN 成本优化

🌟 opt_cdn_cost_optimization - CDN 成本优化分析

一站式 CDN 成本优化工具,检测 5 项优化规则:

检测项规则严重程度预期效果
计费方式带宽利用率 < 30% 推荐流量计费中视用量而定
Range 回源大文件/视频/OSS 场景必开高减少 30%-50% 回源流量
智能压缩网页场景应开启 Gzip/Brotli中减少 50%-70% 传输流量
缓存规则必须配置缓存规则高减少 80%+ 回源流量
共享缓存同源站多域名建议共享中提升缓存命中率

使用示例:

opt_cdn_cost_optimization()
opt_cdn_cost_optimization(domain_filter="example.com")

opt_cdn_utilization_report - CDN 利用率报告

查询域名带宽使用情况,计算利用率,给出计费方式建议。

计费建议规则:

  • 带宽利用率 = 平均带宽 / 峰值带宽 × 100%
  • 利用率 < 30%: 推荐按流量计费
  • 利用率 ≥ 30%: 推荐按带宽峰值计费

使用示例:

opt_cdn_utilization_report(days=7)
opt_cdn_utilization_report(domain_filter="alivetest", days=14)

opt_cdn_config_check - CDN 配置检测

查询单个域名的配置状态(Range/压缩/缓存)。

使用示例:

opt_cdn_config_check(domain_name="example.alivetest.asia")

其他能力

P0:闲置检测

  • 闲置 ECS 检测: 基于 CPU 利用率 + 持续天数,按 env 标签过滤目标环境
  • 闲置 RDS 检测: 基于连接数和 CPU 利用率
  • 闲置 SLB 检测: 基于流量和连接数
  • 闲置 NAT 检测: 无绑定EIP/无DNAT/无SNAT
  • 智能顾问建议: 查询阿里云 Advisor 推荐

P0:存储成本优化

  • NAS 生命周期管理: 检测通用型 NAS 是否开启生命周期管理(降低 92% 存储成本)
  • SLS 智能存储分层: 检测未开启智能分层的 Logstore(降低 70% 存储成本)

P1:利用率分析与 Rightsizing

  • ECS 利用率报告、规格调整建议、老代实例检测
  • ECS 具体规格推荐: 实时查询可用规格 + 库存 + 价格,给出升降配建议
  • RDS 具体规格推荐: 实时查询可用规格,给出降配建议
  • RDS 利用率报告
  • Redis 利用率报告: CPU/内存/连接数/QPS 水位
  • EIP 利用率报告: 带宽使用率/闲置检测
  • CLB 利用率报告: 连接数/流量/QPS 水位
  • MongoDB 利用率报告: CPU/内存/磁盘/连接数水位
  • 可定时关停资源检测

P2:综合节省报告

  • 汇总所有检测结果,生成优先级排序的 action items

通用云监控查询

  • 任意产品水位查询: 支持 ECS/RDS/Redis/SLB/NAS 等产品的任意指标
  • 自定义时间范围: 支持 1~30 天历史数据查询
  • 聚合统计输出: 返回 avg、max、min、p95、p99

策略感知

所有检测函数支持 strategy 参数。自动化级别:

  • report_only: 仅输出报告
  • recommend: 报告 + 建议操作
  • auto_with_approval: 报告 + 建议 Agent 调用操作函数(经 OpsClaw 审批流)

存储产品成本优化

opt_nas_cost_optimization - NAS 成本优化

检测通用型 NAS 是否开启生命周期管理。

检测项规则预期效果
生命周期管理通用型 NAS 应开启生命周期管理低频存储成本降低 92%

使用示例:

opt_nas_cost_optimization(region_id="cn-hangzhou")

opt_sls_cost_optimization - SLS 成本优化

检测 SLS Logstore 是否开启智能存储分层。

检测项规则预期效果
智能存储分层保留期 > 7 天应开启智能分层冷存储成本降低 70%

使用示例:

opt_sls_cost_optimization(region_id="cn-hangzhou")

中间件成本优化

opt_drds_cost_optimization - PolarDB-X 成本优化

检测 PolarDB-X 分布式版实例的闲置/低利用率/计费方式。

检测项规则严重程度
闲置检测CPU峰值≤1% 且 均值≤1%, 内存峰值≤30% 且 均值≤15%, 连接数峰值≤50 且 均值≤25, QPS峰值≤50 且 均值≤25高
低利用率所有指标峰值≤30% 且 均值≤15%中
计费优化按量付费超过 30 天中

使用示例:

opt_drds_cost_optimization(region_id="cn-hangzhou")

opt_mse_cost_optimization - MSE 注册中心成本优化

检测 MSE 注册中心实例的闲置/低利用率/计费方式。

检测项规则严重程度
Eureka/Nacos 闲置健康实例数为 0(超过 7 天)高
Zookeeper 闲置TPS 为 0(超过 7 天)高
计费优化按量付费超过 30 天中

使用示例:

opt_mse_cost_optimization(region_id="cn-hangzhou")

opt_elasticsearch_cost_optimization - Elasticsearch 成本优化

检测 Elasticsearch 实例的低利用率和计费方式。

检测项规则严重程度
低利用率CPU峰值<30% 且 HeapMemory峰值<30%中
计费优化按量付费超过 30 天中

使用示例:

opt_elasticsearch_cost_optimization(region_id="cn-hangzhou")

opt_rocketmq_cost_optimization - RocketMQ 成本优化

检测 RocketMQ Serverless 实例的闲置 Topic。

检测项规则严重程度
Topic 闲置过去 7 天无监控数据高

使用示例:

opt_rocketmq_cost_optimization(region_id="cn-hangzhou")

资源包推荐

通过账单查询按量消费,分析用量并推荐合适的资源包规格。

opt_arms_cost_optimization - ARMS 资源包推荐

分析 ARMS 调用量和 Span 存储用量,推荐资源包。

资源包类型规格范围节省效果
调用量资源包1000万次 ~ 10亿次/月按量 vs 资源包对比节省
Span存储资源包100GB ~ 10TB按量 vs 资源包对比节省

使用示例:

opt_arms_cost_optimization(region_id="cn-hangzhou", days=30)

opt_maxcompute_cost_optimization - MaxCompute CU资源包推荐

分析 MaxCompute CU 和存储用量,推荐资源包。

资源包类型规格范围节省效果
CU资源包100 ~ 50000 CU*小时/月按量 vs 资源包对比节省
存储资源包100GB ~ 10TB按量 vs 资源包对比节省

使用示例:

opt_maxcompute_cost_optimization(region_id="cn-hangzhou", days=30)

opt_waf_cost_optimization - WAF SeCU资源包推荐

分析 WAF SeCU 用量,推荐 SeCU 资源包。

资源包类型规格范围节省效果
SeCU资源包100 ~ 50000 SeCU/月按量 vs 资源包对比节省

使用示例:

opt_waf_cost_optimization(region_id="cn-hangzhou", days=30)

opt_redis_package_recommendation - Redis 存储资源包推荐

分析 Redis 存储用量,推荐存储资源包。

资源包类型规格范围节省效果
存储资源包100 ~ 10000 GB*小时/月按量 vs 资源包对比节省

使用示例:

opt_redis_package_recommendation(region_id="cn-hangzhou", days=30)

框架架构

aliyun-optimizer/
├── SKILL.md                 # 技能说明文件
├── scripts/                 # 脚本目录
│   ├── tools.py             # 对外工具函数
│   ├── core/                # 通用框架层
│   │   ├── base.py          # 枚举、数据结构
│   │   ├── rules.py         # 3条通用检测规则
│   │   ├── pipeline.py      # 后处理流水线
│   │   └── bss.py           # BSS 询价/账单
│   └── products/            # 产品配置层
│       ├── ecs.py
│       ├── rds.py
│       ├── ebs.py
│       ├── eip.py
│       ├── slb.py
│       ├── cdn.py           # CDN 成本优化
│       ├── redis.py         # Redis 成本优化 + 资源包推荐
│       ├── nat.py           # NAT 闲置检测
│       ├── nas.py           # NAS 生命周期管理
│       ├── sls.py           # SLS 智能存储分层
│       ├── drds.py          # PolarDB-X 成本优化
│       ├── mse.py           # MSE 注册中心成本优化
│       ├── elasticsearch.py # Elasticsearch 成本优化
│       ├── rocketmq.py      # RocketMQ 成本优化
│       ├── arms.py          # ARMS 资源包推荐
│       ├── maxcompute.py    # MaxCompute 资源包推荐
│       └── waf.py           # WAF 资源包推荐
└── references/              # 参考文档目录
    └── .gitkeep

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Aliyun Optimizer AI skill do?

阿里云资源优化工具。多产品成本优化分析(ECS/RDS/EBS/EIP/SLB/CDN),查询 CPU/内存/连接数水位,提供升降配建议。直接调用即可,无需创建脚本。触发词:资源优化、闲置检测、降配建议、ECS优化、RDS优化、利用率分析

Why use Aliyun Optimizer on TypingMind?

Because you install it once and use it with any model. Aliyun Optimizer is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Aliyun Optimizer in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/yzstory/pomeloclaw/tree/main/workspace/skills/finops_skills/aliyun-optimizer. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Aliyun Optimizer?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Aliyun Optimizer?

As many as you like. As long as a model supports skills, you can use Aliyun Optimizer with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Aliyun Optimizer AI skill free?

It is published on GitHub by yzstory. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇