labs/zava-learning/sre-config/agent-config/skills/cost-analysis/SKILL.md
Use when an operator or a scheduled task requests a periodic cloud-cost / spend audit of the Zava Learning resource group — identify the top cost drivers, week-over-week trend, idle or oversized resources, and concrete savings opportunities. Read-only; produces findings for a report.
npx skillsauth add microsoft/sre-agent cost-analysisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Resource Group: @@RG@@. Read-only audit — never resize, deallocate, or delete a resource.
This is a weekly spend posture review. Recommend optimisations for a human to apply; change nothing.
Use Cost Management for real billed amounts, scoped to the RG:
az costmanagement query --type ActualCost --timeframe Custom --time-period from=<start> to=<end> --scope "/subscriptions/<sub>/resourceGroups/@@RG@@" --dataset-grouping name=ResourceId type=Dimension --dataset-aggregation totalCost.name=Cost totalCost.function=Sum
(run it for the current 7-day window and the prior 7-day window, then diff per ResourceId).ServiceName.
If az costmanagement is missing or returns an auth error (the agent identity lacks Cost
Management Reader), FALL BACK to az consumption usage list --start-date <d> --end-date <d>
filtered to the RG. Record which data source you used so the report is honest about provenance.As a last resort (no Cost Management and no consumption access), build an estimate:
az resource list -g @@RG@@ --query "[].{name:name,type:type,sku:sku}".microsoft-learn_microsoft_docs_search / known Azure retail pricing to produce a rough,
clearly-labelled estimate, not a billed figure. State the assumption explicitly.az disk list -g @@RG@@ --query "[?managedBy==null]"); over-provisioned VM/DB SKUs vs.
observed CPU/memory; Container Apps with high min-replicas but low traffic.For each driver/opportunity output a row: Resource (type) · This week $ · Last week $ · Δ% · Finding · Severity · Recommendation. Severity is impact-based: a sharp WoW spike or a clearly idle/
oversized paid resource is SEV2; smaller tidy-ups are SEV3. Sort by this-week spend (and severity).
Also produce a posture summary (total RG spend this week, WoW delta, the single biggest saving) and a
prioritized recommendations list with rough monthly savings where you can estimate them.
This skill does not remediate. Pass the posture summary, the findings rows (each with its severity),
the spend numbers, and the recommendations to the zava-audit-report skill, which renders the single
branded, downloadable PowerPoint deck (top cost drivers chart + findings table) and returns its
download link. Surface that link to the operator.
development
Use to package a completed Zava Learning incident analysis for the audience. First present a branded in-thread executive summary (markdown with the before/after visuals inline), then produce the downloadable deliverables — a PowerPoint deck, an HTML email, and a Teams notification — using the Zava corporate template. The calling agent may narrow this to a subset (e.g. only the HTML report). Produces content and artifacts; it does not send them. Assembles the output of rca-analysis, evidence-before-after, recommendations-next-steps, and pr-delivery.
development
Use to package a completed Zava Learning weekly governance audit (NSG / network security, RBAC / least-privilege, or cloud cost) into a single branded, downloadable PowerPoint deck in the Zava house style. The calling audit agent passes its findings (a list of rows with severity) and a short posture summary; this skill renders the deck, applies redaction, and returns the attachment download link. Produces the artifact; it does not send it.
development
Use whenever a Zava Learning investigation produces a durable fix that needs change management — after a GitHub PR is opened for an Infrastructure-as-Code or application code root cause, raise a ServiceNow Change Request referencing the PR and attach the RCA report. The single owner of ServiceNow Change Request and attachment operations.
development
Use whenever you are about to emit operator-visible content — a chat/thread message, a PagerDuty or ServiceNow note, a commit message or pull-request body, or any report artifact (HTML, PowerPoint, Teams card). Deterministically masks secrets, credentials, tokens, private keys, URI-embedded passwords, and PII so they never appear in the thread or in any deliverable. This is a cross-cutting guardrail invoked by the output-producing skills, not a runbook step.