cost-optimization
Use this skill to work through cost optimization recommendations from discovery to remediation tracking.
Handlers and helpers
scripts/adapter.py contains all five Tool handlers for listing, analysis,
execution, and tracking. scripts/_cost_object_actions.py remains separate
because the embedded assistant Context resolver calls it to build resource
actions; it is not a one-command forwarding script.
Workflow
Choose the entry path that matches the user's object:
- Analyze an existing recommendation:
- Call
smartcmp_list_cost_recommendations - Optionally request related policy counts
- Call
smartcmp_analyze_cost_recommendation - Let SmartCMP Provider resolve the related
resourceId - Merge normalized resource
type + propertiesinto the analysis facts - Returns multi-dimensional recommendations (P0/P1/P2 priority)
- Includes risk assessment and best practice guidance
- Shows saving contribution, policy history, and resource operational context
- Call
- Analyze a resource directly:
- Call
smartcmp_analyze_resource_costwith an exact visible name or recent list#selection - Read resource facts, enabled applicable policy configurations, latest resource executions, and active violations without triggering policy execution
- Use the returned
analysisContractto keep platform facts separate fromllm_potential - Read references/RESOURCE_ANALYSIS.md for VM, AWS RDS, and generic resource reasoning rules
- Call
- Call
smartcmp_execute_cost_optimizationfor native day2 repair only after the user explicitly requests it - Track remediation state with
smartcmp_track_cost_optimization
Analysis Output Enhancement
smartcmp_analyze_cost_recommendation provides:
- P0 Primary Action: Provider recommendation (remediate / configure_platform_policy / manual_review)
- P1 Risk Assessment: Risk level (high/medium/low) with specific warnings
- P1 Configuration Guide: When fixType is missing, explains how to configure day2 repair
- P1 Saving Priority: Contribution percentage to global optimizable amount
- P2 Policy History: Compliance rate trend and violation recurrence count
- Resource Context: Resource type, component type, status, OS, and normalized datasource facts
Safety Boundary
The skill only performs platform-native remediation through:
POST /compliance-policies/violations/day2/fix/{id}
It does not call AWS or Azure APIs directly.
Resource-first analysis is read-only. It must not call:
POST /compliance-policies/executePOST /compliance-policies/violations/day2/fix/{id}
Only an existing platform violation may enter the separate remediation flow. An
llm_potential result is never executable.
Resource Enrichment
SmartCMP Provider resolves and reads resource evidence whenever a
recommendation includes resourceId.
- Pull resource details before rendering the final analysis output.
- Merge resource status/type/OS and normalized facts into
factsand downstream recommendations. - If resource lookup is unavailable, continue with policy/violation analysis as a best-effort degradation path.