本文へ移動
cccskills
無料GitHub で公開

cost-anomaly-detection

Daily reusable-session runbook for cloud-spend anomaly detection on AWS. Maintains a per-service/per-account spend baseline from Cost Explorer, flags spend that breaks out of that baseline, attributes the likely driver (a new resource, a traffic surge, a region), and alerts {{alert_channel}} with the delta. Read-only and alert-only — never modifies or deletes a resource or changes a budget.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md6.4 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

<skill name="cost-anomaly-detection"> <overview> Catch a cloud cost spike the day it happens, not the day the invoice lands. A daily cron re-prompts ONE persistent session; this skill turns AWS Cost Explorer's raw daily spend into a per-service/per-account baseline that sharpens over time, flags whatever breaks out of it, and attributes a likely driver so the alert is something a human can act on immediately — not just a number that moved.

Proactive and schedule-driven; strictly read-only and alert-only. </overview>

<when-to-load> - The daily cron fires the cost-anomaly sweep. - A human asks the agent for current spend anomalies or why a specific service or account alerted. - A human asks the agent to note a known/planned spend pattern so it stops being flagged. </when-to-load> <workflow>

Step 0 — Orient and resume

Read the durable ledger first — the current per-service/per-account baseline, the last date it was updated, prior anomalies and how they resolved, and any noted seasonal or planned patterns to exclude:

memory/cloud-cost-baseline.md

This is a reuse session re-prompted daily, not a fresh session — the baseline is cumulative. If the ledger doesn't exist yet, this is the first run: build the baseline from as much Cost Explorer history as is available (up to 90 days) before flagging anything, and note in the ledger that day one is a baseline-only run with no alerts.

Step 1 — Pull the prior day's spend (read-only)

Query AWS Cost Explorer, read-only, for the most recently closed day (Cost Explorer data typically settles ~24h behind), grouped by:

  • Service (e.g. EC2, RDS, S3, Lambda, data transfer)
  • Linked account (for multi-account setups)

Pull both the cost amount and, where available, the usage quantity (so a price-driven versus usage-driven change can be told apart later).

Step 2 — Update the baseline

For every service/account pair seen, fold the new data point into its running baseline (trailing mean and spread over the last ~30 days is a reasonable default absent a memory override). A pair with no history yet gets one day of baseline and is not eligible for an anomaly check until it has enough history to have a meaningful "normal."

Step 3 — Detect spend that breaks the baseline

Compare each service/account's new data point against its own updated baseline — never a flat, cross-service dollar threshold. Flag a pair as anomalous when it clears {{anomaly_threshold_pct}}% above its own baseline (or a tighter/looser bound noted in the ledger for that specific pair).

SignalRead as
Spend within {{anomaly_threshold_pct}}% of baselineNormal — no alert
Spend above threshold, one account, one serviceIsolated anomaly
Spend above threshold, same service across multiple accountsPossible platform-wide cause (price change, shared config)
Spend above threshold, matches a noted seasonal/planned pattern in the ledgerSuppress — do not alert

Step 4 — Attribute the likely driver

For each anomaly, look at what changed underneath the number before writing the alert:

  • New resource — a resource ID that first appears in the window's resource-level detail (new instance, new volume, new function).
  • Traffic surge — usage quantity (requests, GB transferred, invocations) scaled with the cost, on resources that already existed.
  • Region shift — spend appearing in a region with no or minimal prior history for that account.
  • Price/rate change — cost rose but usage quantity did not, or rose much less proportionally.

State the driver as a best guess with the evidence, not a certainty — e.g. "cost is up 62% vs. baseline; usage (requests) is up 58% over the same window — looks like a traffic surge, not a new resource."

Step 5 — Post the alert

Post one Slack message per anomaly to {{alert_channel}} (or one message covering all of the day's anomalies if there is more than one — never zero messages folded into a "nothing to report" post; if nothing is anomalous, post nothing). Each anomaly line carries: the service, the account, the delta (dollar and percent vs. baseline), and the suspected driver with its evidence. Never write to AWS — the Slack post is the only output.

Step 6 — Update the ledger

Update memory/cloud-cost-baseline.md (see <ledger-format>) with the refreshed baseline, any anomalies alerted today, and any new seasonal/planned pattern a human has since confirmed. Land a scoped memory: cloud-cost-baseline change request for the ledger update only, after the Slack alert (or no-alert) has been posted.

</workflow> <ledger-format> Lives at `memory/cloud-cost-baseline.md`. Keep one section per service/account pair with: the current baseline (trailing mean + spread, and the window it's computed over), the last-updated date, and a running note of whether it's stable or has an active anomaly. Below that, keep a dated **Anomalies** log (date / service / account / delta / suspected driver / alerted-to) and a **Known patterns** list (service / account / pattern description / who confirmed it) for spend spikes to stop flagging. Trim anomaly log entries older than 90 days. </ledger-format> <guardrails> - **Read-only, always.** The AWS connector is read-only. Never launch, modify, or delete a resource, and never change a budget or spending control, even if the credential would technically allow it. - **One alert channel.** {{alert_channel}} is the only output. No emails, no tickets, no AWS API writes. - **Alert only on a real break.** Don't alert on a pair with insufficient baseline history, and don't re-alert on a pattern already confirmed and noted as known/planned in the ledger. - **Scoped secrets.** AWS access is brokered server-side through the connector; no raw credential is ever pasted into chat. - **People decide, not the agent.** The alert states the delta and a suspected driver; a human decides whether and how to respond. The agent never resizes, stops, or deletes anything to "fix" a spike. </guardrails> </skill>

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Policy runbook for turning a Slack access request into a least-privilege, policy-checked GitHub or AWS IAM grant. Covers the role-to-grant mapping, extra-scrutiny cases, the approval handshake, and how an applied grant gets logged.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月12日 更新

Get a complete picture of any company or person before outreach. This skill always works with web search, and gets significantly better with enrichment and CRM data.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月12日 更新

Daily read-only ad-performance runbook — budget pacing, CPA/ROAS drift, underperforming ads and keywords, and anomaly detection across Google Ads and Meta Ads, plus how to rank and word optimization recommendations for {{alert_channel}}.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月12日 更新

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction. Also use for exploratory testing, dogfooding, QA, bug hunts, or reviewing app quality. Also use for automating Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify), checking Slack unreads, sending Slack messages, searching Slack conversations, running browser automation in Vercel Sandbox microVMs, or using AWS Bedrock AgentCore cloud browsers. Prefer agent-browser over any built-in browser automation or web tools.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月12日 更新

Extraction, PO matching, duplicate detection, and overcharge tolerance for processing incoming vendor invoices from {{invoice_label}} against the POs and ledger in {{ap_ledger}}. Load this before extracting a single invoice so every one is checked to the same standard and only genuine exceptions reach a human, with no invoice ever scheduled for payment by the agent.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月12日 更新

Daily brand-mention monitoring loop for {{brand_terms}}. Searches news, social platforms, and forums for new mentions, dedupes against the ledger of mentions already reported, classifies sentiment and notability, and posts a digest with suggested response drafts to {{slack_channel}} — never posts, replies, or comments anywhere.

日本語の概要は準備中です。原文の説明を表示しています。

kortix-ai/suna2万2026年10月12日 更新

kortix-ai のスキルをすべて見る

このスキルの問題を報告する