agentleFS
thisrohanguptathisrohangupta/harness-skills/skills/analyze-costs/SKILL.md

analyze-costs

Skill2 starsChanged 7 months agoApache-2.0Archived repositoryView on GitHub

Analyze cloud costs, find optimization opportunities, and track anomalies using Harness CCM via MCP. Use when user says "cloud costs", "analyze costs", "cost optimization", "reduce spending", "cost report", or asks about cloud bills.

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check cloud connectors are configured and syncing

    line 178
  2. Distinctive:

    Verify billing access permissions (Cost Explorer, Billing API)

    line 180
  3. Distinctive:

    Check minimum running time requirements

    line 185

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “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

Analyze Costs

Analyze cloud costs and identify savings using Harness Cloud Cost Management (CCM) via MCP.

Instructions

Step 1: Get Cost Overview

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_overview"

Returns total spend, provider breakdown, and trend vs previous period.

Step 2: Get Cost Breakdown

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_breakdown"

Multi-dimensional breakdown by service, environment, team, region.

Step 3: Explore Perspectives

Call MCP tool: harness_list
Parameters:
  resource_type: "cost_perspective"

Then get detailed data for a specific perspective:

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_perspective"
  resource_id: "<perspective_id>"

Step 4: Get Cost Trends

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_timeseries"

Step 5: Get Optimization Recommendations

Call MCP tool: harness_list
Parameters:
  resource_type: "cost_recommendation"

For detailed recommendation info:

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_recommendation_detail"
  resource_id: "<recommendation_id>"

Summary statistics:

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_recommendation_stats"

Step 6: Check for Anomalies

Call MCP tool: harness_list
Parameters:
  resource_type: "cost_anomaly"

To dismiss a known anomaly:

Call MCP tool: harness_execute
Parameters:
  resource_type: "cost_anomaly"
  action: "ignore"
  resource_id: "<anomaly_id>"

Step 7: Commitment Analysis

Call MCP tool: harness_get
Parameters:
  resource_type: "cost_commitment_analysis"

Also: cost_commitment_coverage, cost_commitment_utilisation, cost_commitment_savings

Report Format

## Cloud Cost Analysis

**Period:** Last 30 Days

### Summary
| Provider | Spend | vs Previous |
|----------|-------|-------------|
| AWS      | $X    | +X%         |
| GCP      | $X    | +X%         |
| Azure    | $X    | -X%         |

### Top Recommendations
1. **Rightsize <resource>** - Save $X/month (95% confidence)
2. **Convert to Reserved** - Save $X/month
3. **Delete unused resources** - Save $X/month

### Anomalies
- <date>: <service> spiked $X above expected

### Actions
- [ ] Rightsize instance X
- [ ] Purchase reserved capacity
- [ ] Clean up unused volumes

Cost Resource Types Reference

Resource TypeOperationsDescription
cost_overviewgetTotal spend summary
cost_summarygetFiltered cost summary
cost_timeseriesgetCost trends over time
cost_breakdowngetMulti-dimensional breakdown
cost_perspectivelist, getCustom cost views
cost_recommendationlistOptimization suggestions
cost_recommendation_detailgetDetailed recommendation
cost_recommendation_statsgetSummary statistics
cost_estimated_savingsgetSavings projections
cost_anomalylist, getCost spikes
cost_categorylist, getCost allocation
cost_filter_valuegetAvailable filter values

Examples

  • "How much are we spending on cloud?" - Get cost_overview
  • "Find $5,000 in monthly savings" - List cost_recommendations, prioritize by savings
  • "Why did our bill spike last week?" - List cost_anomaly
  • "Break down costs by team" - Get cost_breakdown or cost_perspective
  • "Are we using our reserved instances?" - Get cost_commitment_utilisation

Performance Notes

  • Gather data from all relevant perspectives before drawing cost conclusions. Partial data leads to incorrect recommendations.
  • Cross-reference recommendations with anomaly data to distinguish trends from spikes.
  • Quality of cost analysis is more important than speed. Verify savings estimates before presenting.

Troubleshooting

No Cost Data

  • Check cloud connectors are configured and syncing
  • Initial sync takes 24-48 hours
  • Verify billing access permissions (Cost Explorer, Billing API)

No Recommendations

  • Resources need sufficient usage history for analysis
  • Small savings may be filtered out
  • Check minimum running time requirements

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.