Execute cloud cost analysis and optimization workflow
Analyzes cloud costs and generates optimization recommendations with ROI analysis.
/plugin marketplace add lerianstudio/ring/plugin install ring-ops-team@ring[scope: full|service|account] [focus: general|rightsizing|ri|anomaly]This command initiates structured cloud cost analysis following the ops-cost-optimization workflow.
/cost-analysis full general
/cost-analysis service:payment-api rightsizing
/cost-analysis account:production ri
Parse scope and focus from arguments.
Scope options:
full - All accounts and servicesservice:[name] - Specific serviceaccount:[name] - Specific AWS accounttag:[key=value] - Resources with specific tagFocus options:
general - Comprehensive cost reviewrightsizing - Compute optimization focusri - Reserved instance analysisanomaly - Cost anomaly investigationwaste - Idle/unused resource detectionIf not provided, ask:
Task tool:
subagent_type: "cloud-cost-optimizer"
model: "opus"
prompt: |
COST ANALYSIS REQUEST
**Scope:** [scope]
**Focus:** [focus area]
**Period:** Last 30 days (with 90-day trends)
Please analyze:
1. Cost breakdown by the requested scope
2. Trend analysis (MoM, YoY if available)
3. [Focus-specific analysis - see below]
4. Optimization opportunities
5. ROI calculations for recommendations
Focus-specific requirements:
- General: Full cost visibility + top opportunities
- Rightsizing: Compute utilization + downsize candidates
- RI: Coverage analysis + purchase recommendations
- Anomaly: Unusual spend patterns + root cause
- Waste: Idle resources + cleanup recommendations
Output required:
- Cost summary
- Detailed analysis
- Prioritized recommendations
- Implementation roadmap
Format findings into actionable report with clear recommendations.
# Cost Analysis Report
**Scope:** [scope]
**Focus:** [focus]
**Analysis Period:** YYYY-MM-DD to YYYY-MM-DD
**Generated:** YYYY-MM-DD
## Cost Summary
**Total Spend:** $XX,XXX
**Budget:** $XX,XXX
**Variance:** [+/-X%]
**Optimization Potential:** $X,XXX/month ([X]%)
### Cost by Category
| Category | Spend | % of Total | MoM Change |
|----------|-------|------------|------------|
| [category] | $X,XXX | XX% | +X% |
## Analysis Findings
### [Focus Area] Analysis
[Detailed findings based on focus area]
## Optimization Opportunities
### Quick Wins (This Week)
| Opportunity | Savings/Month | Effort | Risk |
|-------------|---------------|--------|------|
| [opportunity] | $XXX | Low | Low |
### High Impact (This Month)
| Opportunity | Savings/Month | Effort | Risk |
|-------------|---------------|--------|------|
| [opportunity] | $X,XXX | Medium | Low |
### Strategic (This Quarter)
| Opportunity | Savings/Month | Effort | Risk |
|-------------|---------------|--------|------|
| [opportunity] | $X,XXX | High | Medium |
## ROI Analysis
| Recommendation | Monthly Savings | Implementation Cost | Payback Period |
|----------------|-----------------|---------------------|----------------|
| [rec] | $X,XXX | $X,XXX | X months |
## Implementation Roadmap
### Week 1
- [ ] [Action 1]
- [ ] [Action 2]
### Week 2-4
- [ ] [Action 3]
- [ ] [Action 4]
## Next Steps
1. Review and approve recommendations
2. Create implementation tickets
3. Schedule follow-up analysis
Additional output:
## Rightsizing Candidates
| Instance | Current | Recommended | CPU Avg | Mem Avg | Savings |
|----------|---------|-------------|---------|---------|---------|
| [id] | [type] | [type] | XX% | XX% | $XXX/mo |
### Criteria Used
- CPU avg <40% over 14 days
- Memory avg <50% over 14 days
- No seasonal patterns requiring headroom
Additional output:
## Reserved Instance Analysis
### Current Coverage
| Service | On-Demand | Reserved | Coverage |
|---------|-----------|----------|----------|
| EC2 | $X,XXX | $X,XXX | XX% |
### Purchase Recommendations
| Instance Type | Quantity | Term | Payment | Savings | Break-even |
|---------------|----------|------|---------|---------|------------|
| [type] | X | 1yr | No upfront | $X,XXX/yr | Immediate |
Additional output:
## Anomaly Investigation
### Detected Anomalies
| Date | Service | Expected | Actual | Delta | Cause |
|------|---------|----------|--------|-------|-------|
| [date] | [svc] | $XXX | $XXX | +XX% | [cause] |
### Root Cause Analysis
[Detailed investigation findings]
ops-cost-optimization - Full cost optimization workflowops-capacity-planning - Capacity planning (cost component)| Rationalization | Required Action |
|---|---|
| "Small savings not worth it" | All savings compound over time |
| "Can optimize later" | Later = never. Optimize now. |
| "Too risky to change" | Data-driven changes are low risk |
This command MUST load the skill for complete workflow execution.
Use Skill tool: ops-cost-optimization
The skill contains the complete workflow with: