agentleFS
RoboFinSystemsRoboFinSystems/robosystems/.claude/skills/cost-review/SKILL.md

cost-review

Skill31 starsChanged 16 days agoApache-2.0View on GitHub

Read-only AWS cost and usage review: spend by service and resource, tied to the usage that drives it, producing a cost report and a savings plan ranked by dollar impact. Use for \"cost review\", \"what are we spending\", \"the AWS bill\", \"savings plan\", or before a pricing or capacity decision.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If status is not Active, stop and report Phase 2 as unavailable pending enrollment — do not report "no rightsizing opportunities".

    line 33
  2. Distinctive:

    All three of these have required arguments — they fail outright if you copy the bare command name:

    line 52
  3. Distinctive:

    Check Fargate Spot weighting (Spot-preferred here) and ARM/Graviton adoption (already the default — flag any x86 stragglers).

    line 62
  4. Distinctive:

    Keep the framing on structural/effective cost (unit economics), not credit-masked totals.

    line 92

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Run a read-only AWS cost & usage review, then produce a cost report and a prioritized savings plan ranked by dollar impact. Pairs with the cost-analysis-cur-athena (the $ side) and prometheus-usage-amp-cli (the usage-driver side) runbooks in the private design vault's runbooks/ for the account-specific query detail — read them alongside this file.

Scope & guardrails

  • Read-only. describe-* / list-* / get-*, Cost Explorer (ce), and Athena reads only; never get-secret-value. Any change (rightsizing, deleting an idle resource, buying a Savings Plan) needs explicit user confirmation, and destructive actions are the user's to run.
  • Output is business-confidential — never commit it. This skill (the methodology) is public-safe; its output is your unit economics and margins (effective cost net of SP/RI is literally the pricing number). Write reports to a git-ignored path (local/, scratchpad) or a private Artifact — never to the repo, and don't paste cost figures anywhere shareable.
  • Effective cost, not headline cost. Cost Explorer's AmortizedCost/NetAmortizedCost net out promotional credits, hiding structural cost. For unit economics, compute effective cost net of SP/RI discounts but BEFORE credits — via the CUR in Athena (see the runbook). CE is fine for a quick total; the CUR is the source of truth for structure.

Phase 1 — Cost overview & anomalies

aws ce get-cost-and-usage --time-period Start=<mo-start>,End=<mo-end> --granularity MONTHLY \
  --metrics UnblendedCost --group-by Type=DIMENSION,Key=SERVICE --region us-east-1
aws ce get-anomalies --date-interval StartDate=<start>,EndDate=<end> --region us-east-1

Then the effective-cost breakdown by component × environment from the CUR via Athena — port the canonical queries from the cost-analysis-cur-athena runbook (it holds the exact catalog/table/partitions).

Phase 2 — Rightsizing

Check enrollment first — every recommendation call returns OptInRequiredException when the account isn't registered, and that exception reads deceptively like "no opportunities found":

aws compute-optimizer get-enrollment-status --region us-east-1

If status is not Active, stop and report Phase 2 as unavailable pending enrollment — do not report "no rightsizing opportunities". Once active:

aws compute-optimizer get-ecs-service-recommendations  --region us-east-1
aws compute-optimizer get-rds-database-recommendations --region us-east-1
aws compute-optimizer get-ec2-instance-recommendations --region us-east-1   # graph tiers
aws compute-optimizer get-idle-recommendations         --region us-east-1

ElastiCache has no Compute Optimizer recommendations API — size it from CloudWatch instead (EngineCPUUtilization, DatabaseMemoryUsagePercentage via get-metric-statistics). Cross-check every recommendation against admission-control/headroom needs before acting.

Phase 3 — Idle & orphaned (fast wins)

  • Unattached EBS volumes, old/orphaned snapshots, stopped-but-billing instances, idle load balancers, unassociated EIPs, orphaned ENIs.
  • Stale ECR images (ties to the lifecycle policy — describe-images, check the lifecycle rules); orphaned S3 buckets (a public/retained bucket with no references is cost and security — see /security-audit).
  • Old RDS manual snapshots, unused KMS keys.

Phase 4 — Commitment coverage

All three of these have required arguments — they fail outright if you copy the bare command name:

aws ce get-savings-plans-coverage --time-period Start=<mo-start>,End=<mo-end> --region us-east-1
aws ce get-reservation-coverage   --time-period Start=<mo-start>,End=<mo-end> --region us-east-1
aws ce get-savings-plans-purchase-recommendation --region us-east-1 \
  --savings-plans-type COMPUTE_SP --term-in-years ONE_YEAR \
  --payment-option NO_UPFRONT --lookback-period-in-days SIXTY_DAYS

Check Fargate Spot weighting (Spot-preferred here) and ARM/Graviton adoption (already the default — flag any x86 stragglers). Note reserved capacity may exist for the managed search domain and is tied to its instance type — confirm before recommending a type change.

Phase 5 — Storage, logs & transfer

  • S3: storage class distribution, Intelligent-Tiering, lifecycle rules, old-version bloat.
  • CloudWatch Logs: per-log-group retention + ingested volume (a common silent cost).
  • Data transfer: NAT Gateway data-processing vs VPC endpoints (VPC_ENDPOINT_MODE), CloudFront egress.

Phase 6 — Usage drivers (the "why is it expensive" side)

  • Amazon Managed Prometheus active-series cardinality + ingestion — the top cost driver for observability. The aws CLI can't run PromQL; use the SigV4 signing helpers + canonical cardinality queries in the prometheus-usage-amp-cli runbook (top metrics by series, label drill-down, deploy-sawtooth trend).
  • High-cardinality metrics/labels, log volume per service, per-tier graph compute.
  • Managed search and Bedrock are material line items that only surface incidentally in the Phase 1 service grouping — call them out explicitly. Bedrock is the cost basis for AI credits, so it should reconcile against billed credit revenue.

Phase 7 — Tagging & allocation

Untagged/mis-tagged resources (break cost attribution), and confirm the Cost & Usage Report (the RoboSystemsCUR stack) is actually delivering:

aws cur describe-report-definitions --region us-east-1 \
  --query 'ReportDefinitions[].{name:ReportName,status:ReportStatus,bucket:S3Bucket,format:Format}'

The legacy cur API is the right one here — don't "modernize" to bcm-data-exports without checking (list-exports returning empty means this account hasn't migrated to CUR 2.0, not that the report is missing). Also confirm a cost-anomaly monitor exists (aws ce get-anomaly-monitors), since get-anomalies returns nothing useful without one.

Output — report + savings plan

  1. Cost report — effective cost by component × environment, trend, and the top cost drivers (deduped: a few services usually dominate).
  2. Prioritized savings plan — ranked by estimated $/month saved × effort, each item with the concrete action and any risk (e.g. rightsizing vs headroom). Separate free wins (delete idle, fix retention, prune images) from commitment decisions (Savings Plans) from architecture (endpoint mode, tiering).

Keep the framing on structural/effective cost (unit economics), not credit-masked totals. Offer to render a private cost dashboard Artifact if useful.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.