analyze-costs
Skill127 starsChanged 32 days agoApache-2.0View 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.
In this repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/harness.mdcCursor rule
- manage-rolesSkill
- manage-usersSkill
- create-agentSkill
- create-agent-templateSkill
- dbops-changesetSkill
- choose-metricSkill
- cleanup-feature-flagsSkill
- create-experimentSkill
- create-feature-flagSkill
- create-metricSkill
- discover-feature-flagsSkill
- explain-flagSkill
- feature-flag-onboardingSkill
- fme-pipelineSkill
- instrument-feature-flagSkill
- instrument-metricSkill
- manage-experimentsSkill
- manage-flag-lifecycleSkill
- manage-segmentsSkill
- review-experiment-resultsSkill
- update-flag-targetingSkill
- create-connectorSkill
- create-environmentSkill
- create-infrastructureSkill
- create-secretSkill
- create-serviceSkill
- ai-operationsSkill
- audit-reportSkill
- chaos-code-risk-scanSkill
- chaos-dr-testSkill
- chaos-experimentSkill
- create-policySkill
- deployment-readinessSkill
- dora-metricsSkill
- gitops-statusSkill
- incident-responseSkill
- manage-idpSkill
- manage-slosSkill
- optimize-pipelineSkill
- pr-analysisSkill
- scorecard-reviewSkill
- security-reportSkill
- sei-analyticsSkill
- template-usageSkill
- create-pipelineSkill
- create-pipeline-v1Skill
- create-templateSkill
- create-triggerSkill
- debug-pipelineSkill
- manage-freeze-windowsSkill
- migrate-pipelineSkill
- run-pipelineSkill
- create-sbomSkill
- enforce-sbomSkill
- manage-artifactsSkill
- manage-cdeSkill
- The first 60 shown.
The file
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
- Distinctive: line 179
Check cloud connectors are configured and syncing
- Distinctive: line 181
Verify billing access permissions (Cost Explorer, Billing API)
- Distinctive: line 186
Check minimum running time requirements
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
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_account_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: "report_feedback"
resource_id: "<anomaly_id>"
body: { feedback: "FALSE_ANOMALY" } # or TRUE_ANOMALY / NOT_RESPONDEDStep 7: Commitment Analysis
Call MCP tool: harness_get
Parameters:
resource_type: "cost_commitment"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 volumesCost Resource Types Reference
| Resource Type | Operations | Description |
cost_account_overview | get | Account-level total spend summary |
cost_summary | get | Perspective-scoped cost summary |
cost_timeseries | get | Cost trends over time |
cost_breakdown | get | Multi-dimensional breakdown |
cost_perspective | list, get | Custom cost views |
cost_recommendation | list | Optimization suggestions |
cost_recommendation_detail | get | Detailed recommendation |
cost_recommendation_stats | get | Summary statistics |
cost_anomaly | list, get, execute(report_feedback) | Cost spikes |
cost_anomaly_summary | get | Anomaly aggregate summary |
cost_category | list, get | Cost allocation |
cost_commitment | get | Commitment coverage/utilisation/savings |
cost_filter_value | get | Available filter values |
Examples
- "How much are we spending on cloud?" - Get cost_account_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
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
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
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.

