← 返回 Skills 市场
charlie-morrison

Capacity Planner

作者 charlie-morrison · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
30
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install capacity-planner
功能描述
Forecast infrastructure capacity needs using historical metrics, growth projections, and cost modeling. Identify bottlenecks before they cause outages and ri...
使用说明 (SKILL.md)

Capacity Planner

Forecast when your infrastructure will hit limits. Analyze historical metrics (CPU, memory, disk, network, database connections), project growth curves, identify approaching bottlenecks, and recommend right-sizing — so you scale proactively instead of reactively.

Use when: "when will we run out of space", "capacity forecast", "right-size our instances", "are we over-provisioned", "plan for traffic growth", "infrastructure scaling plan", "when do we need to upgrade", or before budget planning.

Commands

1. forecast — Project Resource Exhaustion

Step 1: Collect Historical Metrics

# Prometheus — CPU utilization over last 30 days
curl -s "$PROMETHEUS_URL/api/v1/query_range" \
  --data-urlencode 'query=avg(rate(node_cpu_seconds_total{mode!="idle"}[5m])) by (instance)' \
  --data-urlencode "start=$(date -d '30 days ago' +%s)" \
  --data-urlencode "end=$(date +%s)" \
  --data-urlencode 'step=1h' | python3 -c "
import json, sys
data = json.load(sys.stdin)
for result in data['data']['result']:
    instance = result['metric']['instance']
    values = [float(v[1]) for v in result['values']]
    avg = sum(values) / len(values)
    peak = max(values)
    trend = (values[-1] - values[0]) / len(values)  # slope per hour
    print(f'{instance}: avg={avg:.1%} peak={peak:.1%} trend={trend:+.4%}/hr')
"

# Disk usage over time
df -h / /data /var 2>/dev/null
# Historical disk growth (if monitoring available)
curl -s "$PROMETHEUS_URL/api/v1/query_range" \
  --data-urlencode 'query=node_filesystem_avail_bytes{mountpoint="/"}' \
  --data-urlencode "start=$(date -d '30 days ago' +%s)" \
  --data-urlencode "end=$(date +%s)" \
  --data-urlencode 'step=1d'

# Memory usage
free -h
# Database connections
curl -s "$PROMETHEUS_URL/api/v1/query" \
  --data-urlencode 'query=pg_stat_activity_count / pg_settings_max_connections'

If Prometheus unavailable, use CloudWatch, Datadog, or system tools:

# Last 30 days of CloudWatch CPU
aws cloudwatch get-metric-statistics --namespace AWS/EC2 \
  --metric-name CPUUtilization --statistics Average Maximum \
  --dimensions Name=InstanceId,Value=i-0abc123 \
  --start-time $(date -d '30 days ago' -u +%Y-%m-%dT%H:%M:%SZ) \
  --end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) --period 86400

Step 2: Fit Growth Model

For each resource, determine growth pattern:

  • Linear: constant rate of increase (disk filling at 2GB/day)
  • Exponential: accelerating growth (user base doubling quarterly)
  • Seasonal: cyclical patterns (weekend dips, end-of-month spikes)
  • Flat: no growth (stable, well-bounded workload)

Calculate days until exhaustion:

days_remaining = (capacity - current_usage) / daily_growth_rate

For exponential: use doubling time to project.

Step 3: Generate Forecast Report

# Capacity Forecast Report — [date]

## Critical (exhaustion \x3C 30 days)
| Resource | Current | Capacity | Growth/day | Exhaustion | Action |
|----------|---------|----------|------------|------------|--------|
| Disk (/) | 45 GB | 50 GB | 180 MB/day | ~28 days | Expand volume or add cleanup cron |
| DB connections | 85/100 | 100 | +2/week | ~5 weeks | Increase max_connections or add pgbouncer |

## Warning (exhaustion 30-90 days)
| Resource | Current | Capacity | Growth/day | Exhaustion |
|----------|---------|----------|------------|------------|
| Memory | 12/16 GB | 16 GB | 50 MB/day | ~82 days |

## Healthy (>90 days or no growth)
- CPU: avg 35%, peak 72%, flat trend — no action needed
- Network: avg 200 Mbps of 1 Gbps — no concern

## Over-Provisioned (wasting money)
| Resource | Used | Provisioned | Utilization | Savings |
|----------|------|-------------|-------------|---------|
| worker-pool-3 | 2 vCPU avg | 8 vCPU | 25% | Downsize to 4 vCPU, save ~$150/mo |
| Redis cluster | 512 MB | 8 GB | 6% | Downsize to 2 GB, save ~$80/mo |

2. rightsize — Recommend Instance Sizes

Given current utilization and growth projections:

  • Map workload to optimal instance family (compute, memory, storage-optimized)
  • Factor in reserved instance / savings plan pricing
  • Account for headroom (recommend 60-70% target utilization, not 95%)
  • Compare across cloud providers if multi-cloud

3. cost-model — Project Infrastructure Costs

Given the capacity forecast:

  • Calculate current monthly spend
  • Project spend at 3, 6, 12 months based on growth
  • Identify the biggest cost drivers
  • Suggest cost optimization levers (spot instances, reserved pricing, auto-scaling, compression, archival)

4. bottleneck — Identify Scaling Bottlenecks

Analyze the system for the component that will fail first under load:

  • Database (connections, IOPS, lock contention)
  • Application (CPU-bound, memory-bound, thread pool exhaustion)
  • Network (bandwidth, DNS resolution, TLS handshake overhead)
  • External dependencies (rate limits, API quotas, third-party SLAs)

Rank bottlenecks by "time to impact" and recommend mitigation order.

安全使用建议
This skill's instructions need access to monitoring endpoints and possibly cloud credentials, but the package metadata doesn't declare those requirements and the source/homepage is missing. Before installing: 1) Ask the maintainer to document required env vars (PROMETHEUS_URL, any Datadog keys, and explicit AWS credential needs) and provide a source repo or homepage for review. 2) Only grant minimal read-only IAM permissions (CloudWatch read-only metrics, restricted to necessary namespaces/regions) and avoid long-lived root/owner keys. 3) Ensure PROMETHEUS_URL points to an internal, private endpoint and confirm whether TLS/auth is required. 4) Run the skill in a restricted/staging environment first so it cannot access sensitive production files or broad account scopes. 5) Consider disabling autonomous invocation or restricting when the skill can run until you verify it. If you cannot verify the source or cannot limit credentials, treat this as higher risk and avoid installing.
功能分析
Type: OpenClaw Skill Name: capacity-planner Version: 1.0.0 The capacity-planner skill is designed to forecast infrastructure resource exhaustion using metrics from Prometheus and AWS CloudWatch. It utilizes standard system commands (curl, df, free, aws-cli) and inline Python scripts to process JSON data for trend analysis. The logic is transparent, lacks obfuscation, and aligns perfectly with the stated purpose of capacity planning without any indicators of malicious intent or data exfiltration.
能力评估
Purpose & Capability
The name and description match the SKILL.md content: collecting metrics (Prometheus/CloudWatch/Datadog), fitting growth models, producing forecasts and cost models. Those actions legitimately require access to monitoring endpoints and possibly cloud billing/metric APIs. However, the skill's metadata declares no required env vars or primary credential even though the instructions explicitly reference $PROMETHEUS_URL and show using the AWS CLI and third‑party monitoring services. The missing declaration of these inputs and the lack of provenance (no homepage/source) are unexplained.
Instruction Scope
SKILL.md tells the agent to run local system commands (df, free) and to call external monitoring APIs (curl $PROMETHEUS_URL, aws cloudwatch, Datadog/CloudWatch fallback). The instructions reference environment variables and credentials that are not declared (PROMETHEUS_URL, AWS credentials, Datadog keys). These steps can access local system state (disk, memory) and cloud account metrics; combined with autonomous invocation this increases risk of unintended data access or disclosure. The doc does not limit where Prometheus_URL should point (internal vs public) or constrain required IAM scopes.
Install Mechanism
Instruction-only skill with no install spec and no code files. That reduces supply-chain risk because nothing is downloaded or written by the install process.
Credentials
Metadata lists no required environment variables or credentials, but instructions plainly require at least PROMETHEUS_URL and access to cloud monitoring APIs (AWS CLI calls which will use AWS credentials from env or ~/.aws). The skill also mentions Datadog and CloudWatch as alternatives. The absence of declared env requirements is disproportionate and opaque; providing broad credentials without clear, declared needs increases risk.
Persistence & Privilege
The skill is not marked always:true and is user-invocable only. It does not request permanent presence or changes to other skills. Note: the skill allows autonomous model invocation (platform default); when combined with the above credential-access concerns this increases the blast radius, but autonomous invocation on its own is not flagged.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install capacity-planner
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /capacity-planner 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the Capacity Planner skill. - Forecast infrastructure capacity needs using historical metrics, growth projections, and cost modeling. - Identify resource bottlenecks and forecast when limits will be reached. - Recommend right-sizing of compute resources to avoid over-provisioning. - Provide commands for capacity forecasting, instance recommendations, cost projection, and bottleneck analysis.
元数据
Slug capacity-planner
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Capacity Planner 是什么?

Forecast infrastructure capacity needs using historical metrics, growth projections, and cost modeling. Identify bottlenecks before they cause outages and ri... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 30 次。

如何安装 Capacity Planner?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install capacity-planner」即可一键安装,无需额外配置。

Capacity Planner 是免费的吗?

是的,Capacity Planner 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Capacity Planner 支持哪些平台?

Capacity Planner 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Capacity Planner?

由 charlie-morrison(@charlie-morrison)开发并维护,当前版本 v1.0.0。

💬 留言讨论