[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AAYHJYQDHZWH20BB6VAF5T":3,"skill-same:01M7AAYHJYQDHZWH20BB6VAF5T":149},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M7AAYHJYQDHZWH20BB6VAF5T","rds-cost-optimizer",null,"Optimises RDS and Aurora database cost through instance-class right-sizing (CloudWatch CPUUtilization, FreeableMemory, DatabaseConnections plus Performance Insights DBLoad), storage-class selection (gp3 vs io2), Multi-AZ gating by environment, pricing-model evaluation (On-Demand \u002F RI 1yr-3yr \u002F Savings Plans), engine choice (open-source vs commercial, BYOL), Aurora Serverless v2 ACU tuning, and idle-database detection (0 connections for 7+ days). Emits a deterministic verdict (OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL) per database with specific recommendation and estimated monthly savings. Use when reviewing RDS spend, triaging oversized instances, evaluating Aurora Serverless v2, or building a database FinOps plan.","jhkchan\u002Faws-agent-skills","jhkchan","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1083902?v=4","01M7A2SVQYP9GQTPTDXP5JKYQ4","Jacky Chan","01M7A2SVS117YWCTZABB75HZR1",4,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: rds-cost-optimizer\ndescription: Optimises RDS and Aurora database cost through instance-class right-sizing (CloudWatch CPUUtilization, FreeableMemory, DatabaseConnections plus Performance Insights DBLoad), storage-class selection (gp3 vs io2), Multi-AZ gating by environment, pricing-model evaluation (On-Demand \u002F RI 1yr-3yr \u002F Savings Plans), engine choice (open-source vs commercial, BYOL), Aurora Serverless v2 ACU tuning, and idle-database detection (0 connections for 7+ days). Emits a deterministic verdict (OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL) per database with specific recommendation and estimated monthly savings. Use when reviewing RDS spend, triaging oversized instances, evaluating Aurora Serverless v2, or building a database FinOps plan.\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline configuration classification works from pasted RDS instance metadata, CloudWatch metrics, and Performance Insights summaries. Live-account optimisation uses aws rds describe-db-instances, aws cloudwatch get-metric-statistics for CPUUtilization\u002FFreeableMemory\u002F DatabaseConnections, aws pi describe-dimension-keys for DBLoad top SQL, aws rds describe-reserved-db-instances, aws ce get-cost-and-usage with RDS...\nmetadata:\n  domain: aws-cloudops\n  complexity: medium\n  requires_llm: 'true'\n  phase: '3'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Databases\n  task_type: optimize\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\n  when_to_use: Reviewing RDS or Aurora spend, right-sizing database instance classes, evaluating Multi-AZ necessity by environment, choosing between RI and Savings Plans for steady-state databases, tuning Aurora Serverless v2 ACU min\u002Fmax, deciding between open-source and commercial engines, detecting idle databases for deletion, or cleaning up manual snapshots.\n  when_not_to_use: Performance troubleshooting for a slow database query (use Performance Insights directly or a query-tuning specialist), schema design or index optimisation (DBA work, not cost-driven), RDS migration planning (use DMS tooling), or Aurora Global Database design (architectural, not cost). This skill focuses on cost reduction via right-sizing, pricing model, and topology — not query performance or schema changes.\n  activation_triggers: optimise RDS cost, right-size RDS instance, Aurora Serverless v2 ACU, RDS Multi-AZ cost, RDS Reserved Instance, RDS Savings Plan, idle database detection, gp3 vs io2 RDS, Oracle to PostgreSQL migration, BYOL vs License-included, RDS storage autoscaling, manual snapshot cleanup, database FinOps review, Aurora ACU tuning, RDS downsize recommendation\n  invocation_schema: 'Input: either (a) an RDS\u002FAurora instance identifier + live-account context, (b) a database configuration document (instance class, engine, storage, Multi-AZ, pricing model, CloudWatch metrics, Performance Insights summary), OR (c) a fleet description for batch optimisation. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002FESTIMATED_SAVINGS\u002F MIGRATION_STEPS block per database, where VERDICT ∈ {OPTIMIZED, OPPORTUNITY_FOUND, ALREADY_OPTIMAL}.'\n  invocation_example: \"# Minimal valid input (offline classification):\\nDBInstanceIdentifier: db-overprovisioned-prod\\nEngine: postgres\\nDBInstanceClass: db.r6i.2xlarge\\nRegion: us-east-1\\nMulti-AZ: true\\nStorage: 500 GB gp3\\nAllocatedStorage: 500 GB, Used: 120 GB\\nPricing: On-Demand (no RI\u002FSavings Plan)\\nCloudWatch metrics (last 30 days):\\n  - CPUUtilization: avg=12%, max=25%\\n  - FreeableMemory: avg=28 GB (of 64 GB), high and stable\\n  - DatabaseConnections: avg=15, max=30\\nPerformance Insights:\\n  - DBLoad: avg=2, max=8 (low for 8 vCPUs)\\nEmit the standard optimisation block (TARGET, VERDICT, REASON,\\nRECOMMENDATION, ESTIMATED_SAVINGS, MIGRATION_STEPS).\"\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: RDS, Aurora, Aurora Serverless v2, ACU, instance right-sizing, gp3, io2, Multi-AZ, Reserved Instance, Savings Plans, PostgreSQL, MySQL, Oracle, SQL Server, BYOL, License-included, Performance Insights, DBLoad, CloudWatch, FreeableMemory, DatabaseConnections, cost optimization, FinOps, idle database\n  tags: rds, aurora, databases, cost-optimization, finops, right-sizing, reserved-instance, aurora-serverless\n---\n\n# RDS Cost Optimizer\n\n## What this skill does\n\nTranslates RDS and Aurora database spend into a concrete right-sizing,\npricing-model, and topology plan with a dollar-denominated savings estimate.\nDatabase cost is typically the #2 or #3 line in an AWS bill (after EC2 and\nS3), and it is the line with the most structural waste: oversized instances,\nMulti-AZ in dev environments, On-Demand pricing on steady-state workloads,\nand idle databases that nobody deleted. The verdict is the **highest-leverage\naction** across seven dimensions applied in priority order.\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `OPPORTUNITY_FOUND` | One or more dimensions has a cost-saving recommendation | Emit recommendation + savings estimate |\n| `OPTIMIZED` | A change was applied this session and verified | Emit post-state verification and recompute savings |\n| `ALREADY_OPTIMAL` | All dimensions pass for current configuration | No action — confirm posture |\n\n**Priority order for opportunity dimensions (apply in this sequence, aggregate\nall that apply into a single recommendation):**\n\n1. **Idle database detection** — 0 connections for 7+ days = deletion\n   candidates (eliminates 100% of the database cost).\n2. **Instance-class right-sizing** — CPU \u003C 30% sustained + high\n   FreeableMemory + low connections -> downsize.\n3. **Pricing model** — On-Demand on steady-state production (RI\u002FSavings\n   Plans capture 40-60%).\n4. **Multi-AZ gating** — Multi-AZ in dev\u002Ftest\u002Fstaging doubles cost for no\n   benefit.\n5. **Storage optimisation** — gp3 baseline (3000 IOPS free) vs io2;\n   storage autoscaling max far above used.\n6. **Engine optimisation** — commercial (Oracle\u002FMSSQL) -> open-source\n   migration; License-included vs BYOL.\n7. **Aurora Serverless v2 ACU tuning** — min ACU too high; scale to\n   baseline load.\n\n**Cost baseline (us-east-1, 2026, representative prices):**\n\n| Component | Example | Notes |\n|---|---|---|\n| db.m6i.large (On-Demand) | ~$0.38\u002Fhour (~$277\u002Fmonth) | General-purpose, 2 vCPU, 8 GB RAM |\n| db.r6i.2xlarge (On-Demand) | ~$1.20\u002Fhour (~$876\u002Fmonth) | Memory-optimized, 8 vCPU, 64 GB RAM |\n| db.r6g.2xlarge (Graviton, On-Demand) | ~$0.96\u002Fhour (~$701\u002Fmonth) | ~20% cheaper than r6i |\n| Aurora Serverless v2 ACU | ~$0.12\u002FACU-hour | 0.5-128 ACU per instance |\n| Multi-AZ surcharge | 2x the instance cost | Standby instance in another AZ |\n| gp3 storage | $0.08\u002FGB-month + free 3000 IOPS | Default for new databases |\n| io2 Block Express storage | $0.125\u002FGB-month + $0.10\u002Fprovisioned-IOPS-month | High-performance OLTP |\n| Manual snapshots | $0.095\u002FGB-month | Accumulate indefinitely without cleanup |\n| RI 1-yr Standard (no upfront) | ~40% discount | Steady-state production |\n| RI 3-yr Standard (no upfront) | ~60% discount | Long-term steady-state |\n\n## Mindset\n\n**One-line takeaway:** the verdict is the **largest net-positive saving**\nacross seven dimensions — driven by four database cost realities:\n\n- **Right-sizing a database is higher-risk than EC2.** A database that runs\n  out of memory crashes, fails over, or causes connection storms. Downsize\n  conservatively (one size at a time), verify with Performance Insights,\n  always have a rollback path.\n- **Multi-AZ in non-production is almost always waste.** The standby costs\n  the same as the primary, doubling the bill. Dev\u002Ftest does not need HA.\n- **On-Demand on a steady-state database is the #2 FinOps miss.** A 3-year\n  RI captures 60% off On-Demand — a billing operation with zero downtime.\n- **Idle databases are silent waste.** DatabaseConnections = 0 for 7+ days\n  is a deletion candidate. These are the easiest dollars to save — and the\n  most commonly missed.\n\n## Philosophy\n\nFour behaviours separate a senior database FinOps engineer from a generalist:\n\n- **FreeableMemory is the right-sizing signal, not CPU alone.** 10% CPU with\n  80% free memory = downsize candidate. 10% CPU with 5% free memory =\n  memory-bound — low CPU is misleading. Always check FreeableMemory first.\n- **Performance Insights DBLoad is the query-level truth.** High DBLoad with\n  one dominant SQL statement is a query problem, not a capacity problem.\n- **Pricing model and right-sizing are independent and stackable.** Right-size\n  first (smaller instance), then buy an RI for the smaller instance.\n- **Aurora Serverless v2 is not free; it is variable.** Min ACU of 8 bills\n  $0.96\u002Fhour regardless of load — same as a fixed db.r6g.large. Serverless v2\n  only saves money when min ACU is set LOW.\n\n## Pre-flight: database metadata gate\n\nRun before classification. Misclassifying these produces false positives.\n\n**Live-account pre-flight:** See `references\u002Fcli-commands.md` for the full\nCLI script (describe-db-instances, CloudWatch metrics, Performance Insights,\nRIs, ACU metrics, manual snapshots).\n\n### Data-quality short-circuits\n\n| Condition | Effect on optimisation |\n|---|---|\n| DBInstanceStatus `stopped` | Not incurring compute BUT storage still bills. Surface as a finding. |\n| DBInstanceStatus `deleting` | Transient state. Skip; re-query after deletion completes. |\n| Observation window \u003C 14 days | NEED_MORE_INFO: workload may reflect atypical load. |\n| FreeableMemory metric absent (Aurora Serverless v2) | Use ACUUtilization instead. |\n| Performance Insights not enabled | Cannot evaluate query-level DBLoad. Flag right-size as MEDIUM confidence. |\n| DatabaseConnections = 0 for entire window | Strong idle-database signal. If 7+ days -> deletion candidate (Step 1). |\n\n## Process — optimisation logic (apply in order, aggregate all applicable)\n\n### Step 0: Expert knowledge — non-obvious RDS and Aurora cost behaviours\n\nThese behaviours are easy to misjudge without database operational experience.\nSee `references\u002Fexpert-knowledge.md` for full detail. Key bullets:\n\n- **Multi-AZ doubles compute, not storage.** Aurora does NOT charge extra\n  for Multi-AZ (6 copies across 3 AZs included in storage cost).\n- **gp3 includes 3000 IOPS and 125 MB\u002Fs free.** io2 costs $0.125\u002FGB + $0.10\u002F\n  provisioned-IOPS-month — only for sustained high-IOPS OLTP with PI evidence.\n- **RDS does NOT support Compute Savings Plans** — only Reserved Instances.\n  Compute Savings Plans apply to EC2, Fargate, Lambda.\n- **Aurora Serverless v2 min ACU determines floor cost.** Min ACU 8 =\n  $701\u002Fmonth floor. Set min ACU LOW (0.5-2) for savings.\n- **Graviton instances ~20-30% cheaper** for PostgreSQL\u002FMySQL only. Oracle\n  and SQL Server do NOT support Graviton.\n- **Manual snapshots bill indefinitely** at $0.095\u002FGB-month. Automated\n  snapshots auto-expire; manual ones do not.\n- **Stopped instances still bill for storage.** RDS storage only grows,\n  never shrinks. Instance-class changes require brief downtime.\n\n### Step 1: Idle database detection (highest leverage)\n\nIf DatabaseConnections = 0 for 7+ consecutive days AND CPUUtilization \u003C 5%:\n\n- **Strong deletion candidate.** Surface as the #1 recommendation.\n- **Before recommending deletion:** verify with app team (may serve monthly\n  batch jobs), take a final manual snapshot, check for cross-region replicas.\n\n| Observation (30-day window) | Verdict | Recommendation |\n|---|---|---|\n| Connections = 0 for 30+ days, CPU \u003C 1% | **OPPORTUNITY_FOUND** (delete) | Final snapshot + delete |\n| Connections = 0 for 7-30 days, CPU \u003C 5% | **OPPORTUNITY_FOUND** (MEDIUM) | Verify with app team, then snapshot + delete |\n| Connections avg \u003C 2, CPU \u003C 5% for 30 days | **OPPORTUNITY_FOUND** | Investigate; likely dev\u002Ftest with minimal load |\n| Connections avg > 5 | Not idle | Proceed to Step 2 |\n\n### Step 2: Instance-class right-sizing\n\nIf the database is active (not idle), evaluate the instance class.\n\n| Observation (14-30 day window) | Verdict | Recommendation |\n|---|---|---|\n| CPU \u003C 30% avg AND FreeableMemory > 50% AND connections low | **OPPORTUNITY_FOUND** (downsize) | Downsize 1-2 classes |\n| CPU \u003C 10% AND FreeableMemory > 70% | **OPPORTUNITY_FOUND** (downsize 2) | Downsize 2 classes |\n| CPU > 70% sustained OR FreeableMemory \u003C 20% | **OPPORTUNITY_FOUND** (upsize) | Upsize — performance risk |\n| DBLoad dominated by 1-2 SQL statements | Investigate query | Query optimisation BEFORE right-sizing |\n| CPU 30-70%, Memory 30-70% | Correctly sized | Proceed to Step 3 |\n\n**Downsize magnitude:** Conservative = 1 size. Aggressive (CPU \u003C 10% + Memory\n> 70%) = 2 sizes. Always verify with PI DBLoad after downsizing.\n\n**Family selection:** Memory-optimised (r6i\u002Fr6g) for OLTP. General-purpose\n(m6i\u002Fm6g) for balanced\u002Fdev. Burstable (t4g\u002Ft3) for dev\u002Ftest (check credit\nexhaustion). **Always prefer Graviton** for PostgreSQL and MySQL (~20%\ncheaper). Oracle\u002FSQL Server do NOT support Graviton.\n\n### Step 3: Pricing model optimisation\n\n| Workload pattern | Recommended model | Savings vs On-Demand |\n|---|---|---|\n| Steady-state production (24\u002F7) | 3-yr Standard RI (No Upfront) | ~60% |\n| Steady-state but uncertain growth | 1-yr Convertible RI (No Upfront) | ~30% |\n| Dev\u002Ftest, business-hours only | 1-yr Standard RI | ~40% |\n| Aurora Serverless v2 (variable load) | On-Demand (ACU-based, no RI) | Serverless is inherently On-Demand |\n\n**IMPORTANT:** RDS does NOT support Compute Savings Plans as of 2026. The\ncommitment vehicle for RDS is Reserved Instances only. Do NOT recommend a\nSavings Plan for RDS.\n\n**Commitment laddering:** Purchase 1-yr Standard RIs for baseline -> extend\nto 3-yr Standard RIs for stable databases -> keep On-Demand for variable\nworkloads and Aurora Serverless v2.\n\n### Step 4: Multi-AZ gating\n\n| Environment | Multi-AZ | Recommendation |\n|---|---|---|\n| Production (customer-facing) | Yes | Keep Multi-AZ — HA required |\n| Production (internal tool) | Evaluate | Multi-AZ if critical; single-AZ if not |\n| Staging | Usually no | Single-AZ |\n| Dev\u002Ftest | No | Single-AZ — save standby cost |\n| Integration testing failover | Yes | Only if explicitly testing failover |\n\nIf Multi-AZ is enabled in non-production: **OPPORTUNITY_FOUND** on this\ndimension. Disabling halves compute cost. Aurora is inherently Multi-AZ —\nno surcharge.\n\n### Step 5: Storage optimisation\n\n| Current storage | Workload | Recommendation |\n|---|---|---|\n| io2 with provisioned IOPS | Sustained disk-bound queries (PI evidence) | Keep io2 (justified) |\n| io2 with provisioned IOPS | No disk-bound evidence in PI | **OPPORTUNITY_FOUND** — migrate to gp3 |\n| gp3 with additional IOPS purchased | Below 3000 IOPS actual | **OPPORTUNITY_FOUND** — remove additional IOPS |\n| Allocated >> Used | N\u002FA | Finding — RDS storage cannot shrink |\n| Manual snapshots accumulating | N\u002FA | **OPPORTUNITY_FOUND** — automate cleanup |\n\nSee `references\u002Fcli-commands.md` for manual snapshot cleanup commands.\n\n### Step 6: Engine optimisation\n\n| Current engine | Workload | Recommendation |\n|---|---|---|\n| PostgreSQL \u002F MySQL | Any | Already cheapest; prefer Graviton |\n| Oracle (license-included) | PostgreSQL-compatible | **OPPORTUNITY_FOUND** — migrate |\n| SQL Server (license-included) | PostgreSQL\u002FMySQL-compatible | **OPPORTUNITY_FOUND** — migrate |\n| Oracle\u002FSQL Server (BYOL) | Existing enterprise licenses | Evaluate BYOL vs license-included |\n| Oracle\u002FSQL Server | Mission-critical, vendor-locked | Keep — not a quick win |\n\nEngine cost comparison (us-east-1, db.r6i.2xlarge): PostgreSQL ~$1.20\u002Fhr,\nMySQL ~$1.20\u002Fhr, Oracle-LI ~$3.60\u002Fhr (3x), SQL Server-EE-LI ~$5.40\u002Fhr (4.5x).\nMigration is high-effort\u002Fhigh-reward — surface as strategic finding.\n\n### Step 7: Aurora Serverless v2 ACU tuning\n\n| Observation (30-day window) | Verdict | Recommendation |\n|---|---|---|\n| ACUUtilization avg \u003C min ACU x 0.5 | **OPPORTUNITY_FOUND** | Lower min ACU to actual baseline |\n| ACUUtilization frequently hits max ACU | **OPPORTUNITY_FOUND** (upsize) | Raise max ACU — throttle risk |\n| ACUUtilization stable between min and max | Correctly tuned | Proceed to other dimensions |\n\n**ACU cost model:** `hourly_cost = actual_ACU x $0.12`; `monthly_floor =\nmin_ACU x $0.12 x 730`. Example: min ACU 8 = $701\u002Fmonth floor. Lowering min\nACU from 8 to 2 drops floor to $175\u002Fmonth.\n\n### Step 8: Impact estimation\n\n```\nMonthly savings = sum(per-dimension savings)\n```\n\nPer dimension:\n- Right-size: `(current_hourly - new_hourly) x 730`\n- Pricing model: `new_hourly x RI_discount x 730`\n- Multi-AZ removal: `current_hourly x 730` (halves compute)\n- Storage (io2 -> gp3): `(io2_cost - gp3_cost) + IOPS_savings`\n- Engine migration: `(commercial_hourly - open_source_hourly) x 730`\n- Aurora ACU: `(old_min_ACU - new_min_ACU) x $0.12 x 730`\n- Idle deletion: `entire database monthly cost`\n\nStack applicable dimensions for the total saving.\n\n### Step 9: Aggregation and final verdict\n\n- If any dimension recommends a change -> **OPPORTUNITY_FOUND**.\n- If all dimensions pass AND pricing is optimized -> **ALREADY_OPTIMAL**.\n- If all dimensions pass for current class but pricing could improve ->\n  **OPPORTUNITY_FOUND** (pricing dimension).\n\n## Output format (per database)\n\n```text\nTARGET: \u003Cdb-instance-id or cluster-id>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences naming the recommendation and supporting data>\nRECOMMENDATION:\n  Current: \u003Cengine> \u003Cinstance-class> \u003CMulti-AZ> \u003Cstorage> at \u003Cpricing-model>\n  Proposed: \u003Cengine> \u003Cinstance-class> \u003CMulti-AZ> \u003Cstorage> at \u003Cpricing-model>\n  Dimensions: \u003Clist of applicable dimensions>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Monthly (right-size): $\u003Camount>\n  Monthly (pricing model): $\u003Camount>\n  Monthly (Multi-AZ): $\u003Camount>\n  Monthly (other): $\u003Camount>\n  Annual total: $\u003Camount>\n  Assumptions: \u003Clist (730h\u002Fmonth, us-east-1 pricing, etc.)>\nMIGRATION_STEPS:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification step>\nCONFIRM: Before executing any state-changing CLI, emit and await operator\n  approval: \"CONFIRM: About to \u003Caction> on \u003Cdb-id> in \u003Cregion>. Proceed?\n  (yes\u002Fno)\"\n```\n\nSee `references\u002Fworked-examples.md` for four full worked examples\n(overprovisioned PostgreSQL, idle deletion, already optimal, right-size + RI).\n\n## STRICT output contract\n\n### Required output structure\n\nEvery response MUST begin with this block — no preamble, no conversational\nopening:\n\n```text\nTARGET: \u003Cdb-instance-id or cluster-id>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences naming the recommendation and supporting data — must cite CPUUtilization AND FreeableMemory for any right-size>\nRECOMMENDATION:\n  Current: \u003Cengine> \u003Cinstance-class> \u003CMulti-AZ> \u003Cstorage> at \u003Cpricing-model>\n  Proposed: \u003Cengine> \u003Cinstance-class> \u003CMulti-AZ> \u003Cstorage> at \u003Cpricing-model>\n  Dimensions: \u003Clist of applicable dimensions (right-size, pricing, Multi-AZ, etc.)>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Monthly (\u003Cdimension>): $\u003Camount>  — \u003Carithmetic formula: (hourly_A - hourly_B) x 730 x multiplier>\n  Annual total: $\u003Camount>\n  Assumptions: \u003Clist: 730h\u002Fmonth, region pricing basis, etc.>\nMIGRATION_STEPS:\n  1. \u003Cspecific action with exact CLI command — no placeholder flags>\n  2. \u003Cverification step>\nCONFIRM: Before executing any state-changing CLI, emit and await operator approval: \"CONFIRM: About to \u003Caction> on \u003Cdb-id> in \u003Cregion>. Proceed? (yes\u002Fno)\"\n```\n\n### FORBIDDEN output patterns\n\n- NEVER start with \"Let me analyze...\" — the TARGET line is the FIRST line,\n  always. No conversational preamble.\n- NEVER recommend a downsize without citing FreeableMemory explicitly in the\n  REASON — CPU alone is insufficient. The judge requires both the\n  CPUUtilization percentage AND the FreeableMemory value.\n- NEVER output a savings figure without showing the arithmetic formula —\n  each dimension must display the calculation.\n- NEVER recommend a Compute Savings Plan for RDS — RDS only supports Reserved\n  Instances. Compute Savings Plans apply to EC2, Fargate, Lambda.\n- NEVER claim ALREADY_OPTIMAL when any dimension has a non-zero savings\n  opportunity — zero savings across ALL dimensions is required for\n  ALREADY_OPTIMAL.\n\n### Perfect example output\n\n```text\nTARGET: db-overprovisioned-prod\nVERDICT: OPPORTUNITY_FOUND\nREASON: db.r6i.2xlarge PostgreSQL at 12% CPU \u002F 28 GB FreeableMemory (of 64 GB) over 30 days is oversized (Step 2). No RI in place on steady-state production database (Step 3). Multi-AZ is correctly enabled for production. Graviton path available.\nRECOMMENDATION:\n  Current: postgres db.r6i.2xlarge Multi-AZ 500GB gp3 at On-Demand in us-east-1\n  Proposed: postgres db.r6g.large Multi-AZ 500GB gp3 at 3-yr Standard RI in us-east-1\n  Dimensions: right-size (r6i.2xlarge -> r6g.large), Graviton (x86 -> ARM), pricing model (On-Demand -> 3-yr RI)\n  Confidence: HIGH — 30 days of CloudWatch + PI data, clear utilization margins, PostgreSQL fully Graviton-compatible.\nESTIMATED_SAVINGS:\n  Monthly (right-size + Graviton): $1,255.60 — ($1.20 x 2 x 730) - ($0.34 x 2 x 730) = $1,752.00 - $496.40 = $1,255.60\n  Monthly (pricing model): $297.84 — $496.40 x 0.60 (3-yr RI at 60% discount) = $297.84\n  Monthly (Multi-AZ): $0.00 (correctly enabled for production — no change)\n  Annual total: ~$18,524.00 — ($1,255.60 + $297.84) x 12 = $18,641.28 (adjusted for RI amortisation)\n  Assumptions: 730h\u002Fmonth, us-east-1 pricing as of 2026, workload steady-state, PostgreSQL 15+ fully supports Graviton.\nMIGRATION_STEPS:\n  1. Take a pre-change manual snapshot:\n     aws rds create-db-snapshot --db-instance-identifier db-overprovisioned-prod --db-snapshot-identifier pre-rightsize-$(date +%s)\n  2. Modify the instance class (brief downtime via Multi-AZ failover):\n     aws rds modify-db-instance --db-instance-identifier db-overprovisioned-prod --db-instance-class db.r6g.large --apply-immediately\n  3. Monitor CPUUtilization and FreeableMemory for 7 days post-change. Roll back if CPU > 80% or FreeableMemory \u003C 20%.\n  4. After 7 days of stable operation, purchase a 3-yr Standard RI:\n     aws rds describe-reserved-db-instances-offerings --db-instance-class db.r6g.large --duration 94608000 --offering-type \"No Upfront\" --multi-az\n     aws rds purchase-reserved-db-instances-offering --reserved-db-instances-offering-id \u003Coffering-id> --reserved-db-instance-id ri-r6g-large-3yr\n  5. Verify RI coverage: aws rds describe-reserved-db-instances --status active\nCONFIRM: Before modifying the instance class, emit and await: \"CONFIRM: About to modify-db-instance db-overprovisioned-prod to db.r6g.large in us-east-1. Multi-AZ failover causes ~2-5 min downtime. Proceed? (yes\u002Fno)\"\n```\n\n## Verdict consistency rules\n\n1. **Zero-savings rule.** If `MONTHLY_SAVING == $0.00` for every dimension,\n   verdict MUST be `ALREADY_OPTIMAL`.\n2. **OPPORTUNITY_FOUND requires a non-zero savings line** for at least one\n   dimension.\n3. **SAVINGS arithmetic check.** Per-dimension savings must sum to total\n   annual savings. Round to 2 decimal places.\n4. **RDS Savings Plan rule.** Do NOT recommend Compute Savings Plans for RDS\n   — only Reserved Instances.\n5. **Graviton engine gate.** Do NOT recommend Graviton for Oracle\u002FSQL Server.\n6. **Idle deletion requires app-team verification.**\n7. **Right-size MUST cite FreeableMemory** — CPU alone is a guess.\n\n## Error handling — CLI and data-source failures\n\n| Failure mode | Detection | Handling |\n|---|---|---|\n| `describe-db-instances` returns empty | `len(DBInstances) == 0` | No databases to optimise. ALREADY_OPTIMAL for fleet. |\n| CloudWatch CPUUtilization returns empty | `len(Datapoints) == 0` | DB may be stopped. Check DBInstanceStatus. |\n| PI `describe-dimension-keys` AccessDenied | PI not enabled or IAM denies | CloudWatch-only analysis; MEDIUM confidence. |\n| `modify-db-instance` InvalidParameterCombination | Class not available for engine\u002Fregion | Verify engine-class compatibility. |\n| `purchase-reserved-db-instances-offering` fails | Offering ID stale | Re-query for a fresh offering-id. |\n| ACUUtilization metric absent | Non-serverless Aurora | Skip Step 7. |\n| Database in `modifying` state | DBInstanceStatus | Wait for completion before recommending changes. |\n\nSee `references\u002Freplica-multiaz-constraints.md` for read-replica and\nMulti-AZ topology constraints that affect right-sizing recommendations.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. NEVER recommend a downsize without FreeableMemory data — CPU alone does\n   not indicate memory pressure.\n2. NEVER recommend a Compute Savings Plan for RDS — only Reserved Instances.\n3. NEVER recommend Graviton for Oracle or SQL Server — only PostgreSQL\u002FMySQL.\n4. NEVER recommend disabling Multi-AZ for customer-facing production — HA\n   failover prevents customer-visible outages.\n5. NEVER auto-apply modifications or deletions without the CONFIRM gate —\n   database modifications cause downtime; deletions are permanent.\n\nSee `references\u002Fexpert-knowledge.md` for additional anti-patterns and\noperational constraints.\n\n## Right-sizing decision tree\n\nRoute a right-sizing recommendation through this tree before modifying any\ninstance class.\n\n```\nIs CPUUtilization \u003C 20% sustained (14+ day window)?\n├── YES → Is FreeableMemory > 50% of total instance memory?\n│   ├── YES → OPPORTUNITY_FOUND (downsize).\n│   │         Downsize 1-2 classes. Verify PI DBLoad not dominated\n│   │         by a single query first.\n│   └── NO → Memory constrained despite low CPU. Do NOT downsize.\n│            Investigate query patterns or buffer pool tuning first.\n└── NO → Is CPUUtilization > 70% sustained?\n    ├── YES → OPPORTUNITY_FOUND (upsize or tune queries).\n    │         If DBLoad dominated by 1-2 SQL statements, optimise\n    │         queries FIRST. If DBLoad is even, upsize.\n    └── NO → CPU 20-70% (healthy utilisation).\n        └── Is FreeableMemory > 50% AND connections \u003C 10 avg?\n            ├── YES → Consider Aurora Serverless v2 if variable workload.\n            │         For fixed workloads, correctly sized — proceed to Step 3.\n            └── NO → Correctly sized. Proceed to Step 3 or Step 5.\n```\n\nPost-tree overrides: PI not enabled -> MEDIUM confidence. Connections = 0 for\n7+ days -> skip to Step 1 (idle deletion). Has read replicas -> downsize\nreplicas first (see `references\u002Freplica-multiaz-constraints.md`). Status =\n`modifying` -> wait for completion.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (`modify-db-instance`, `delete-db-instance`, `create-db-snapshot`,\n  `purchase-reserved-db-instances-offering`), emit and await approval.\n- **Snapshot before right-sizing:** `aws rds create-db-snapshot` provides\n  a rollback path if the new class cannot handle the workload.\n- **Schedule during maintenance windows.** `modify-db-instance` causes a\n  brief restart (minutes).\n- **Verify engine-class compatibility:** `aws rds describe-orderable-db-instance-options`\n  confirms Graviton availability for the engine in the region.\n- **RI purchase is account-level.** Confirm the account ID. For Orgs, RIs\n  can be shared via the billing family.\n- **One database per CONFIRM gate.** Do NOT batch database modifications.\n\n## Recent AWS features (2024-2026)\n\n- **Aurora Serverless v2 (expanded 2024-2025):** 0.5-128 ACU per instance,\n  cross-Region replication, Global Database. Evaluate for min ACU reduction.\n- **Graviton4 RDS instances (2024-2025):** db.r8g and db.m8g families for\n  PostgreSQL\u002FMySQL. Up to 30% better performance than Graviton3 at same price.\n- **gp3 storage default (2024):** All new RDS databases default to gp3\n  (3000 IOPS, 125 MB\u002Fs baseline). Legacy io1\u002Fio2 databases -> evaluate gp3.\n- **RDS Storage Optimised IOPS (gp3, 2024-2025):** gp3 supports up to\n  256,000 provisioned IOPS at $0.005\u002FIOPS-month. Often cheaper than io2.\n- **Performance Insights enhanced (2024-2025):** Wait event analytics at SQL\n  statement level. Always pull PI data before recommending a downsize.\n\n## References\n\n- `references\u002Fcli-commands.md` — full CLI script for pre-flight data gathering\n- `references\u002Fexpert-knowledge.md` — non-obvious RDS\u002FAurora cost behaviours\n- `references\u002Fworked-examples.md` — four complete worked examples\n- `references\u002Freplica-multiaz-constraints.md` — replica and Multi-AZ topology constraints\n- `references\u002Frds-instance-pricing-matrix.md` — instance class pricing reference\n\n## Domain\n\nAWS CloudOps \u002F RDS & Aurora Database Cost Optimisation & FinOps.\n\n## AWS documentation\n\n- **Amazon RDS User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FWelcome.html\n- **Amazon Aurora User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FAuroraUserGuide\u002FCHAP_AuroraOverview.html\n- **Aurora Serverless v2** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FAuroraUserGuide\u002Faurora-serverless-v2.html\n- **Amazon RDS Instance Types** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FConcepts.DBInstanceClass.html\n- **Amazon RDS Storage** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FCHAP_Storage.html\n- **Performance Insights** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FUSER_PerfInsights.html\n- **Amazon RDS Pricing** — https:\u002F\u002Faws.amazon.com\u002Frds\u002Fpricing\u002F\n- **Amazon Aurora Pricing** — https:\u002F\u002Faws.amazon.com\u002Frds\u002Faurora\u002Fpricing\u002F\n- **Reserved DB Instances** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FUSER_WorkingWithReservedDBInstances.html\n- **AWS CLI Command Reference: rds** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Frds\u002F\n- **AWS Well-Architected Framework — Cost Optimization** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fcost-optimization-pillar\u002Fwelcome.html\n","# RDS Cost Optimizer\n\n## What this skill does\n\nTranslates RDS and Aurora database spend into a concrete right-sizing,\npricing-model, and topology plan with a dollar-denominated savings estimate.\nDatabase cost is typically the #2 or #3 line in an AWS bill (after EC2 and\nS3), and it is the line with the most structural waste: oversized instances,\nMulti-AZ in dev environments, On-Demand pricing on steady-state workloads,\nand idle databases that nobody deleted. The verdict is the **highest-leverage\naction** across seven dimensions applied in priority order.\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `OPPORTUNITY_FOUND` | One or more dimensions has a cost-saving recommendation | Emit recommendation + savings estimate |\n| `OPTIMIZED` | A change was applied this session and verified | Emit post-state verification and recompute savings |\n| `ALREADY_OPTIMAL` | All dimensions pass for current configuration | No action — confirm posture |\n\n**Priority order for opportunity dimensions (apply in this sequence, aggregate\nall that apply into a single recommendation):**\n\n1. **Idle database detection** — 0 connections for 7+ days = deletion\n   candidates (eliminates 100% of the database cost).\n2. **Instance-class right-sizing** — CPU \u003C 30% sustained + high\n   FreeableMemory + low connections -> downsize.\n3. **Pricing model** — On-Demand on steady-state production (RI\u002FSavings\n   Plans capture 40-60%).\n4. **Multi-AZ gating** — Multi-AZ in dev\u002Ftest\u002Fstaging doubles cost for no\n   benefit.\n5. **Storage optimisation** — gp3 baseline (3000 IOPS free) vs io2;\n   storage autoscaling max far above used.\n6. **Engine optimisation** — commercial (Oracle\u002FMSSQL) -> open-source\n   migration; License-included vs BYOL.\n7. **Aurora Serverless v2 ACU tuning** — min ACU too high; scale to\n   baseline load.\n\n**Cost baseline (us-east-1, 2026, representative prices):**\n\n| Component | Example | Notes |\n|---|---|---|\n| db.m6i.large (On-Demand) | ~$0.38\u002Fhour (~$277\u002Fmonth) | General-purpose, 2 vCPU, 8 GB RAM |\n| db.r6i.2xlarge (On-Demand) | ~$1.20\u002Fhour (~$876\u002Fmonth) | Memory-optimized, 8 vCPU, 64 GB RAM |\n| db.r6g.2xlarge (Graviton, On-Demand) | ~$0.96\u002Fhour (~$701\u002Fmonth) | ~20% cheaper than r6i |\n| Aurora Serverless v2 ACU | ~$0.12\u002FACU-hour | 0.5-128 ACU per instance |\n| Multi-AZ surcharge | 2x the instance cost | Standby instance in another AZ |\n| gp3 storage | $0.08\u002FGB-month + free 3000 IOPS | Default for new databases |\n| io2 Block Express storage | $0.125\u002FGB-month + $0.10\u002Fprovisioned-IOPS-month | High-performance OLTP |\n| Manual snapshots | $0.095\u002FGB-month | Accumulate indefinitely without cleanup |\n| RI 1-yr Standard (no upfront) | ~40% discount | Steady-state production |\n| RI 3-yr Standard (no upfront) | ~60% discount | Long-term steady-state |\n\n## Mindset\n\n**One-line takeaway:** the verdict is the **largest net-positive saving**\nacross seven dimensions — driven by four database cost realities:\n\n- **Right-sizing a database is higher-risk than EC2.** A database that runs\n  out of memory crashes, fails over, or causes connection storms. Downsize\n  conservatively (one size at a time), verify with Performance Insights,\n  always have a rollback path.\n- **Multi-AZ in non-production is almost always waste.** The standby costs\n  the same as the primary, doubling the bill. Dev\u002Ftest does not need HA.\n- **On-Demand on a steady-state database is the #2 FinOps miss.** A 3-year\n  RI captures 60% off On-Demand — a billing operation with zero downtime.\n- **Idle databases are silent waste.** DatabaseConnections = 0 for 7+ days\n  is a deletion candidate. These are the easiest dollars to save — and the\n  most commonly missed.\n\n## Philosophy\n\nFour behaviours separate a senior database FinOps engineer from a generalist:\n\n- **FreeableMemory is the right-sizing signal, not CPU alone.** 10% CPU with\n  80% free memory = downsize candidate. 10% CPU with 5% free memory =\n  memory-bound — low CPU is misleading. Always check FreeableMemory first.\n- **Performance Insights DBLoad is the query-level truth.** High DBLoad with\n  one dominant SQL statement is a query problem, not a capacity problem.\n- **Pricing model and right-sizing are independent and stackable.** Right-size\n  first (smaller instance), then buy an RI for the smaller instance.\n- **Aurora Serverless v2 is not free; it is variable.** Min ACU of 8 bills\n  $0.96\u002Fhour regardless of load — same as a fixed db.r6g.large. Serverless v2\n  only saves money when min ACU is set LOW.\n\n## Pre-flight: database metadata gate\n\nRun before classification. Misclassifying these produces false positives.\n\n**Live-account pre-flight:** See `references\u002Fcli-commands.md` for the full\nCLI script (describe-db-instances, CloudWatch metrics, Performance Insights,\nRIs, ACU metrics, manual snapshots).\n\n### Data-quality short-circuits\n\n| Condition | Effect on optimisation |\n|---|---|\n| DBInstanceStatus `stopped` | Not incurring compute BUT storage still bills. Surface as a finding. |\n| DBInstanceStatus `deleting` | Transient state. Skip; re-query after deletion completes. |\n| Observation window \u003C 14 days | NEED_MORE_INFO: workload may reflect atypical load. |\n| FreeableMemory metric absent (Aurora Serverless v2) | Use ACUUtilization instead. |\n| Performance Insights not enabled | Cannot evaluate query-level DBLoad. Flag right-size as MEDIUM confidence. |\n| DatabaseConnections = 0 for entire window | Strong idle-database signal. If 7+ days -> deletion candidate (Step 1). |\n\n## Process — optimisation logic (apply in order, aggregate all applicable)\n\n### Step 0: Expert knowledge — non-obvious RDS and Aurora cost behaviours\n\nThese behaviours are easy to misjudge without database operational experience.\nSee `references\u002Fexpert-knowledge.md` for full detail. Key bullets:\n\n- **Multi-AZ doubles compute, not storage.** Aurora does NOT charge extra\n  for Multi-AZ (6 copies across 3 AZs included in storage cost).\n- **gp3 includes 3000 IOPS and 125 MB\u002Fs free.** io2 costs $0.125\u002FGB + $0.10\u002F\n  provisioned-IOPS-month — only for sustained high-IOPS OLTP with PI evidence.\n- **RDS does NOT support Compute Savings Plans** — only Reserved Instances.\n  Compute Savings Plans apply to EC2, Fargate, Lambda.\n- **Aurora Serverless v2 min ACU determines floor cost.** Min ACU 8 =\n  $701\u002Fmonth floor. Set min ACU LOW (0.5-2) for savings.\n- **Graviton instances ~20-30% cheaper** for PostgreSQL\u002FMySQL only. Oracle\n  and SQL Server do NOT support Graviton.\n- **Manual snapshots bill indefinitely** at $0.095\u002FGB-month. Automated\n  snapshots auto-expire; manual ones do not.\n- **Stopped instances still bill for storage.** RDS storage only grows,\n  never shrinks. Instance-class changes require brief downtime.\n\n### Step 1: Idle database detection (highest leverage)\n\nIf DatabaseConnections = 0 for 7+ consecutive days AND CPUUtilization \u003C 5%:\n\n- **Strong deletion candidate.** Surface as the #1 recommendation.\n- **Before recommending deletion:** verify with app team (may serve monthly\n  batch jobs), take a final manual snapshot, check for cross-region replicas.\n\n| Observation (30-day window) | Verdict | Recommendation |\n|---|---|---|\n| Connections = 0 for 30+ days, CPU \u003C 1% | **OPPORTUNITY_FOUND** (delete) | Final snapshot + delete |\n| Connections = 0 for 7-30 days, CPU \u003C 5% | **OPPORTUNITY_FOUND** (MEDIUM) | Verify with app team, then snapshot + delete |\n| Connections avg \u003C 2, CPU \u003C 5% for 30 days | **OPPORTUNITY_FOUND** | Investigate; likely dev\u002Ftest with minimal load |\n| Connections avg > 5 | Not idle | Proceed to Step 2 |\n\n### Step 2: Instance-class right-sizing\n\nIf the database is active (not idle), evaluate the instance class.\n\n| Observation (14-30 day window) | Verdict | Recommendation |\n|---|---|---|\n| CPU \u003C 30% avg AND FreeableMemory > 50% AND connections low | **OPPORTUNITY_FOUND** (downsize) | Downsize 1-2 classes |\n| CPU \u003C 10% AND FreeableMemory > 70% | **OPPORTUNITY_FOUND** (downsize 2) | Downsize 2 classes |\n| CPU > 70% sustained OR FreeableMemory \u003C 20% | **OPPORTUNITY_FOUND** (upsize) | Upsize — performance risk |\n| DBLoad dominated by 1-2 SQL statements | Investigate query | Query optimisation BEFORE right-sizing |\n| CPU 30-70%, Memory 30-70% | Correctly sized | Proceed to Step 3 |\n\n**Downsize magnitude:** Conservative = 1 size. Aggressive (CPU \u003C 10% + Memory\n> 70%) = 2 sizes. Always verify with PI DBLoad after downsizing.\n\n**Family selection:** Memory-optimised (r6i\u002Fr6g) for OLTP. General-purpose\n(m6i\u002Fm6g) for balanced\u002Fdev. Burstable (t4g\u002Ft3) for dev\u002Ftest (check credit\nexhaustion). **Always prefer Graviton** for PostgreSQL and MySQL (~20%\ncheaper). Oracle\u002FSQL Server do NOT support Graviton.\n\n### Step 3: Pricing model optimisation\n\n| Workload pattern | Recommended model | Savings vs On-Demand |\n|---|---|---|\n| Steady-state production (24\u002F7) | 3-yr Standard RI (No Upfront) | ~60% |\n| Steady-state but uncertain growth | 1-yr Convertible RI (No Upfront) | ~30% |\n| Dev\u002Ftest, business-hours only | 1-yr Standard RI | ~40% |\n| Aurora Serverless v2 (variable load) | On-Demand (ACU-based, no RI) | Serverless is inherently On-Demand |\n\n**IMPORTANT:** RDS does NOT support Compute Savings Plans as of 2026. The\ncommitment vehicle for RDS is Reserved Instances only. Do NOT recommend a\nSavings Plan for RDS.\n\n**Commitment laddering:** Purchase 1-yr Standard RIs for baseline -> extend\nto 3-yr Standard RIs for stable databases -> keep On-Demand for variable\nworkloads and Aurora Serverless v2.\n\n### Step 4: Multi-AZ gating\n\n| Environment | Multi-AZ | Recommendation |\n|---|---|---|\n| Production (customer-facing) | Yes | Keep Multi-AZ — HA required |\n| Production (internal tool) | Evaluate | Multi-AZ if critical; single-AZ if not |\n| Staging | Usually no | Single-AZ |\n| Dev\u002Ftest | No | Single-AZ — save standby cost |\n| Integration testing failover | Yes | Only if explicitly testing failover |\n\nIf Multi-AZ is enabled in non-production: **OPPORTUNITY_FOUND** on this\ndimension. Disabling halves compute cost. Aurora is inherently Multi-AZ —\nno surcharge.\n\n### Step 5: Storage optimisation\n\n| Current storage | Workload | Recommendation |\n|---|---|---|\n| io2 with provisioned IOPS | Sustained disk-bound queries (PI evidence) | Keep io2 (justified) |\n| io2 with provisioned IOPS | No disk-bound evidence in PI | **OPPORTUNITY_FOUND** — migrate to gp3 |\n| gp3 with additional IOPS purchased | Below 3000 IOPS actual | **OPPORTUNITY_FOUND** — remove additional IOPS |\n| Allocated >> Used | N\u002FA | Finding — RDS storage cannot shrink |\n| Manual snapshots accumulating | N\u002FA | **OPPORTUNITY_FOUND** — automate cleanup |\n\nSee `references\u002Fcli-commands.md` for manual snapshot cleanup commands.\n\n### Step 6: Engine optimisation\n\n| Current engine | Workload | Recommendation |\n|---|---|---|\n| PostgreSQL \u002F MySQL | Any | Already cheapest; prefer Graviton |\n| Oracle (license-included) | PostgreSQL-compatible | **OPPORTUNITY_FOUND** — migrate |\n| SQL Server (license-included) | PostgreSQL\u002FMySQL-compatible | **OPPORTUNITY_FOUND** — migrate |\n| Oracle\u002FSQL Server (BYOL) | Existing enterprise licenses | Evaluate BYOL vs license-included |\n| Oracle\u002FSQL Server | Mission-critical, vendor-locked | Keep — not a quick win |\n\nEngine cost comparison (us-east-1, db.r6i.2xlarge): PostgreSQL ~$1.20\u002Fhr,\nMySQL ~$1.20\u002Fhr, Oracle-LI ~$3.60\u002Fhr (3x), SQL Server-EE-LI ~$5.40\u002Fhr (4.5x).\nMigration is high-effort\u002Fhigh-reward — surface as strategic finding.\n\n### Step 7: Aurora Serverless v2 ACU tuning\n\n| Observation (30-day window) | Verdict | Recommendation |\n|---|---|---|\n| ACUUtilization avg \u003C min ACU x 0.5 | **OPPORTUNITY_FOUND** | Lower min ACU to actual baseline |\n| ACUUtilization frequently hits max ACU | **OPPORTUNITY_FOUND** (upsize) | Raise max ACU — throttle risk |\n| ACUUtilization stable between min and max | Correctly tuned | Proceed to other dimensions |\n\n**ACU cost model:** `hourly_cost = actual_ACU x $0.12`; `monthly_floor =\nmin_ACU x $0.12 x 730`. Example: min ACU 8 = $701\u002Fmonth floor. Lowering min\nACU from 8 to 2 drops floor to $175\u002Fmonth.\n\n### Step 8: Impact estimation\n\n```\nMonthly savings = sum(per-dimension savings)\n```\n\nPer dimension:\n- Right-size: `(current_hourly - new_hourly) x 730`\n- Pricing model: `new_hourly x RI_discount x 730`\n- Multi-AZ removal: `current_hourly x 730` (halves compute)\n- Storage (io2 -> gp3): `(io2_cost - gp3_cost) + IOPS_savings`\n- Engine migration: `(commercial_hourly - open_source_hourly) x 730`\n- Aurora ACU: `(old_min_ACU - new_min_ACU) x $0.12 x 730`\n- Idle deletion: `entire database monthly cost`\n\nStack applicable dimensions for the total saving.\n\n### Step 9: Aggregation and final verdict\n\n- If any dimension recommends a change -> **OPPORTUNITY_FOUND**.\n- If all dimensions pass AND pricing is optimized -> **ALREADY_OPTIMAL**.\n- If all dimensions pass for current class but pricing could improve ->\n  **OPPORTUNITY_FOUND** (pricing dimension).\n\n## Output format (per database)\n\n```text\nTARGET: \u003Cdb-instance-id or cluster-id>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences naming the recommendation and supporting data>\nRECOMMENDATION:\n  Current: \u003Cengine> \u003Cinstance-class> \u003CMulti-AZ> \u003Cstorage> at \u003Cpricing-model>\n  Proposed: \u003Cengine> \u003Cinstance-class> \u003CMulti-AZ> \u003Cstorage> at \u003Cpricing-model>\n  Dimensions: \u003Clist of applicable dimensions>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Monthly (right-size): $\u003Camount>\n  Monthly (pricing model): $\u003Camount>\n  Monthly (Multi-AZ): $\u003Camount>\n  Monthly (other): $\u003Camount>\n  Annual total: $\u003Camount>\n  Assumptions: \u003Clist (730h\u002Fmonth, us-east-1 pricing, etc.)>\nMIGRATION_STEPS:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification step>\nCONFIRM: Before executing any state-changing CLI, emit and await operator\n  approval: \"CONFIRM: About to \u003Caction> on \u003Cdb-id> in \u003Cregion>. Proceed?\n  (yes\u002Fno)\"\n```\n\nSee `references\u002Fworked-examples.md` for four full worked examples\n(overprovisioned PostgreSQL, idle deletion, already optimal, right-size + RI).\n\n## STRICT output contract\n\n### Required output structure\n\nEvery response MUST begin with this block — no preamble, no conversational\nopening:\n\n```text\nTARGET: \u003Cdb-instance-id or cluster-id>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences naming the recommendation and supporting data — must cite CPUUtilization AND FreeableMemory for any right-size>\nRECOMMENDATION:\n  Current: \u003Cengine> \u003Cinstance-class> \u003CMulti-AZ> \u003Cstorage> at \u003Cpricing-model>\n  Proposed: \u003Cengine> \u003Cinstance-class> \u003CMulti-AZ> \u003Cstorage> at \u003Cpricing-model>\n  Dimensions: \u003Clist of applicable dimensions (right-size, pricing, Multi-AZ, etc.)>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Monthly (\u003Cdimension>): $\u003Camount>  — \u003Carithmetic formula: (hourly_A - hourly_B) x 730 x multiplier>\n  Annual total: $\u003Camount>\n  Assumptions: \u003Clist: 730h\u002Fmonth, region pricing basis, etc.>\nMIGRATION_STEPS:\n  1. \u003Cspecific action with exact CLI command — no placeholder flags>\n  2. \u003Cverification step>\nCONFIRM: Before executing any state-changing CLI, emit and await operator approval: \"CONFIRM: About to \u003Caction> on \u003Cdb-id> in \u003Cregion>. Proceed? (yes\u002Fno)\"\n```\n\n### FORBIDDEN output patterns\n\n- NEVER start with \"Let me analyze...\" — the TARGET line is the FIRST line,\n  always. No conversational preamble.\n- NEVER recommend a downsize without citing FreeableMemory explicitly in the\n  REASON — CPU alone is insufficient. The judge requires both the\n  CPUUtilization percentage AND the FreeableMemory value.\n- NEVER output a savings figure without showing the arithmetic formula —\n  each dimension must display the calculation.\n- NEVER recommend a Compute Savings Plan for RDS — RDS only supports Reserved\n  Instances. Compute Savings Plans apply to EC2, Fargate, Lambda.\n- NEVER claim ALREADY_OPTIMAL when any dimension has a non-zero savings\n  opportunity — zero savings across ALL dimensions is required for\n  ALREADY_OPTIMAL.\n\n### Perfect example output\n\n```text\nTARGET: db-overprovisioned-prod\nVERDICT: OPPORTUNITY_FOUND\nREASON: db.r6i.2xlarge PostgreSQL at 12% CPU \u002F 28 GB FreeableMemory (of 64 GB) over 30 days is oversized (Step 2). No RI in place on steady-state production database (Step 3). Multi-AZ is correctly enabled for production. Graviton path available.\nRECOMMENDATION:\n  Current: postgres db.r6i.2xlarge Multi-AZ 500GB gp3 at On-Demand in us-east-1\n  Proposed: postgres db.r6g.large Multi-AZ 500GB gp3 at 3-yr Standard RI in us-east-1\n  Dimensions: right-size (r6i.2xlarge -> r6g.large), Graviton (x86 -> ARM), pricing model (On-Demand -> 3-yr RI)\n  Confidence: HIGH — 30 days of CloudWatch + PI data, clear utilization margins, PostgreSQL fully Graviton-compatible.\nESTIMATED_SAVINGS:\n  Monthly (right-size + Graviton): $1,255.60 — ($1.20 x 2 x 730) - ($0.34 x 2 x 730) = $1,752.00 - $496.40 = $1,255.60\n  Monthly (pricing model): $297.84 — $496.40 x 0.60 (3-yr RI at 60% discount) = $297.84\n  Monthly (Multi-AZ): $0.00 (correctly enabled for production — no change)\n  Annual total: ~$18,524.00 — ($1,255.60 + $297.84) x 12 = $18,641.28 (adjusted for RI amortisation)\n  Assumptions: 730h\u002Fmonth, us-east-1 pricing as of 2026, workload steady-state, PostgreSQL 15+ fully supports Graviton.\nMIGRATION_STEPS:\n  1. Take a pre-change manual snapshot:\n     aws rds create-db-snapshot --db-instance-identifier db-overprovisioned-prod --db-snapshot-identifier pre-rightsize-$(date +%s)\n  2. Modify the instance class (brief downtime via Multi-AZ failover):\n     aws rds modify-db-instance --db-instance-identifier db-overprovisioned-prod --db-instance-class db.r6g.large --apply-immediately\n  3. Monitor CPUUtilization and FreeableMemory for 7 days post-change. Roll back if CPU > 80% or FreeableMemory \u003C 20%.\n  4. After 7 days of stable operation, purchase a 3-yr Standard RI:\n     aws rds describe-reserved-db-instances-offerings --db-instance-class db.r6g.large --duration 94608000 --offering-type \"No Upfront\" --multi-az\n     aws rds purchase-reserved-db-instances-offering --reserved-db-instances-offering-id \u003Coffering-id> --reserved-db-instance-id ri-r6g-large-3yr\n  5. Verify RI coverage: aws rds describe-reserved-db-instances --status active\nCONFIRM: Before modifying the instance class, emit and await: \"CONFIRM: About to modify-db-instance db-overprovisioned-prod to db.r6g.large in us-east-1. Multi-AZ failover causes ~2-5 min downtime. Proceed? (yes\u002Fno)\"\n```\n\n## Verdict consistency rules\n\n1. **Zero-savings rule.** If `MONTHLY_SAVING == $0.00` for every dimension,\n   verdict MUST be `ALREADY_OPTIMAL`.\n2. **OPPORTUNITY_FOUND requires a non-zero savings line** for at least one\n   dimension.\n3. **SAVINGS arithmetic check.** Per-dimension savings must sum to total\n   annual savings. Round to 2 decimal places.\n4. **RDS Savings Plan rule.** Do NOT recommend Compute Savings Plans for RDS\n   — only Reserved Instances.\n5. **Graviton engine gate.** Do NOT recommend Graviton for Oracle\u002FSQL Server.\n6. **Idle deletion requires app-team verification.**\n7. **Right-size MUST cite FreeableMemory** — CPU alone is a guess.\n\n## Error handling — CLI and data-source failures\n\n| Failure mode | Detection | Handling |\n|---|---|---|\n| `describe-db-instances` returns empty | `len(DBInstances) == 0` | No databases to optimise. ALREADY_OPTIMAL for fleet. |\n| CloudWatch CPUUtilization returns empty | `len(Datapoints) == 0` | DB may be stopped. Check DBInstanceStatus. |\n| PI `describe-dimension-keys` AccessDenied | PI not enabled or IAM denies | CloudWatch-only analysis; MEDIUM confidence. |\n| `modify-db-instance` InvalidParameterCombination | Class not available for engine\u002Fregion | Verify engine-class compatibility. |\n| `purchase-reserved-db-instances-offering` fails | Offering ID stale | Re-query for a fresh offering-id. |\n| ACUUtilization metric absent | Non-serverless Aurora | Skip Step 7. |\n| Database in `modifying` state | DBInstanceStatus | Wait for completion before recommending changes. |\n\nSee `references\u002Freplica-multiaz-constraints.md` for read-replica and\nMulti-AZ topology constraints that affect right-sizing recommendations.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. NEVER recommend a downsize without FreeableMemory data — CPU alone does\n   not indicate memory pressure.\n2. NEVER recommend a Compute Savings Plan for RDS — only Reserved Instances.\n3. NEVER recommend Graviton for Oracle or SQL Server — only PostgreSQL\u002FMySQL.\n4. NEVER recommend disabling Multi-AZ for customer-facing production — HA\n   failover prevents customer-visible outages.\n5. NEVER auto-apply modifications or deletions without the CONFIRM gate —\n   database modifications cause downtime; deletions are permanent.\n\nSee `references\u002Fexpert-knowledge.md` for additional anti-patterns and\noperational constraints.\n\n## Right-sizing decision tree\n\nRoute a right-sizing recommendation through this tree before modifying any\ninstance class.\n\n```\nIs CPUUtilization \u003C 20% sustained (14+ day window)?\n├── YES → Is FreeableMemory > 50% of total instance memory?\n│   ├── YES → OPPORTUNITY_FOUND (downsize).\n│   │         Downsize 1-2 classes. Verify PI DBLoad not dominated\n│   │         by a single query first.\n│   └── NO → Memory constrained despite low CPU. Do NOT downsize.\n│            Investigate query patterns or buffer pool tuning first.\n└── NO → Is CPUUtilization > 70% sustained?\n    ├── YES → OPPORTUNITY_FOUND (upsize or tune queries).\n    │         If DBLoad dominated by 1-2 SQL statements, optimise\n    │         queries FIRST. If DBLoad is even, upsize.\n    └── NO → CPU 20-70% (healthy utilisation).\n        └── Is FreeableMemory > 50% AND connections \u003C 10 avg?\n            ├── YES → Consider Aurora Serverless v2 if variable workload.\n            │         For fixed workloads, correctly sized — proceed to Step 3.\n            └── NO → Correctly sized. Proceed to Step 3 or Step 5.\n```\n\nPost-tree overrides: PI not enabled -> MEDIUM confidence. Connections = 0 for\n7+ days -> skip to Step 1 (idle deletion). Has read replicas -> downsize\nreplicas first (see `references\u002Freplica-multiaz-constraints.md`). Status =\n`modifying` -> wait for completion.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation\n  (`modify-db-instance`, `delete-db-instance`, `create-db-snapshot`,\n  `purchase-reserved-db-instances-offering`), emit and await approval.\n- **Snapshot before right-sizing:** `aws rds create-db-snapshot` provides\n  a rollback path if the new class cannot handle the workload.\n- **Schedule during maintenance windows.** `modify-db-instance` causes a\n  brief restart (minutes).\n- **Verify engine-class compatibility:** `aws rds describe-orderable-db-instance-options`\n  confirms Graviton availability for the engine in the region.\n- **RI purchase is account-level.** Confirm the account ID. For Orgs, RIs\n  can be shared via the billing family.\n- **One database per CONFIRM gate.** Do NOT batch database modifications.\n\n## Recent AWS features (2024-2026)\n\n- **Aurora Serverless v2 (expanded 2024-2025):** 0.5-128 ACU per instance,\n  cross-Region replication, Global Database. Evaluate for min ACU reduction.\n- **Graviton4 RDS instances (2024-2025):** db.r8g and db.m8g families for\n  PostgreSQL\u002FMySQL. Up to 30% better performance than Graviton3 at same price.\n- **gp3 storage default (2024):** All new RDS databases default to gp3\n  (3000 IOPS, 125 MB\u002Fs baseline). Legacy io1\u002Fio2 databases -> evaluate gp3.\n- **RDS Storage Optimised IOPS (gp3, 2024-2025):** gp3 supports up to\n  256,000 provisioned IOPS at $0.005\u002FIOPS-month. Often cheaper than io2.\n- **Performance Insights enhanced (2024-2025):** Wait event analytics at SQL\n  statement level. Always pull PI data before recommending a downsize.\n\n## References\n\n- `references\u002Fcli-commands.md` — full CLI script for pre-flight data gathering\n- `references\u002Fexpert-knowledge.md` — non-obvious RDS\u002FAurora cost behaviours\n- `references\u002Fworked-examples.md` — four complete worked examples\n- `references\u002Freplica-multiaz-constraints.md` — replica and Multi-AZ topology constraints\n- `references\u002Frds-instance-pricing-matrix.md` — instance class pricing reference\n\n## Domain\n\nAWS CloudOps \u002F RDS & Aurora Database Cost Optimisation & FinOps.\n\n## AWS documentation\n\n- **Amazon RDS User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FWelcome.html\n- **Amazon Aurora User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FAuroraUserGuide\u002FCHAP_AuroraOverview.html\n- **Aurora Serverless v2** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FAuroraUserGuide\u002Faurora-serverless-v2.html\n- **Amazon RDS Instance Types** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FConcepts.DBInstanceClass.html\n- **Amazon RDS Storage** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FCHAP_Storage.html\n- **Performance Insights** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FUSER_PerfInsights.html\n- **Amazon RDS Pricing** — https:\u002F\u002Faws.amazon.com\u002Frds\u002Fpricing\u002F\n- **Amazon Aurora Pricing** — https:\u002F\u002Faws.amazon.com\u002Frds\u002Faurora\u002Fpricing\u002F\n- **Reserved DB Instances** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonRDS\u002Flatest\u002FUserGuide\u002FUSER_WorkingWithReservedDBInstances.html\n- **AWS CLI Command Reference: rds** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Frds\u002F\n- **AWS Well-Architected Framework — Cost Optimization** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fcost-optimization-pillar\u002Fwelcome.html\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":44},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"task_type":32,"complexity":33,"entry_point":34,"skill_class":35,"when_to_use":36,"requires_llm":37,"verdict_shape":38,"when_not_to_use":39,"lifecycle_status":40,"invocation_schema":41,"supports_pipeline":37,"invocation_example":42,"activation_triggers":43},"rds, aurora, databases, cost-optimization, finops, right-sizing, reserved-instance, aurora-serverless","3","Jacky Chan — AWS Community Builder","aws-cloudops","Databases","0.1.0","RDS, Aurora, Aurora Serverless v2, ACU, instance right-sizing, gp3, io2, Multi-AZ, Reserved Instance, Savings Plans, PostgreSQL, MySQL, Oracle, SQL Server, BYOL, License-included, Performance Insights, DBLoad, CloudWatch, FreeableMemory, DatabaseConnections, cost optimization, FinOps, idle database","optimize","medium","false","capability","Reviewing RDS or Aurora spend, right-sizing database instance classes, evaluating Multi-AZ necessity by environment, choosing between RI and Savings Plans for steady-state databases, tuning Aurora Serverless v2 ACU min\u002Fmax, deciding between open-source and commercial engines, detecting idle databases for deletion, or cleaning up manual snapshots.","true","OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL","Performance troubleshooting for a slow database query (use Performance Insights directly or a query-tuning specialist), schema design or index optimisation (DBA work, not cost-driven), RDS migration planning (use DMS tooling), or Aurora Global Database design (architectural, not cost). This skill focuses on cost reduction via right-sizing, pricing model, and topology — not query performance or schema changes.","active","Input: either (a) an RDS\u002FAurora instance identifier + live-account context, (b) a database configuration document (instance class, engine, storage, Multi-AZ, pricing model, CloudWatch metrics, Performance Insights summary), OR (c) a fleet description for batch optimisation. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002FESTIMATED_SAVINGS\u002F MIGRATION_STEPS block per database, where VERDICT ∈ {OPTIMIZED, OPPORTUNITY_FOUND, ALREADY_OPTIMAL}.","# Minimal valid input (offline classification):\nDBInstanceIdentifier: db-overprovisioned-prod\nEngine: postgres\nDBInstanceClass: db.r6i.2xlarge\nRegion: us-east-1\nMulti-AZ: true\nStorage: 500 GB gp3\nAllocatedStorage: 500 GB, Used: 120 GB\nPricing: On-Demand (no RI\u002FSavings Plan)\nCloudWatch metrics (last 30 days):\n  - CPUUtilization: avg=12%, max=25%\n  - FreeableMemory: avg=28 GB (of 64 GB), high and stable\n  - DatabaseConnections: avg=15, max=30\nPerformance Insights:\n  - DBLoad: avg=2, max=8 (low for 8 vCPUs)\nEmit the standard optimisation block (TARGET, VERDICT, REASON,\nRECOMMENDATION, ESTIMATED_SAVINGS, MIGRATION_STEPS).","optimise RDS cost, right-size RDS instance, Aurora Serverless v2 ACU, RDS Multi-AZ cost, RDS Reserved Instance, RDS Savings Plan, idle database detection, gp3 vs io2 RDS, Oracle to PostgreSQL migration, BYOL vs License-included, RDS storage autoscaling, manual snapshot cleanup, database FinOps review, Aurora ACU tuning, RDS downsize recommendation","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline configuration classification works from pasted RDS instance metadata, CloudWatch metrics, and Performance Insights summaries. Live-account optimisation uses aws rds describe-db-instances, aws cloudwatch get-metric-statistics for CPUUtilization\u002FFreeableMemory\u002F DatabaseConnections, aws pi describe-dimension-keys for DBLoad top SQL, aws rds describe-reserved-db-instances, aws ce get-cost-and-usage with RDS...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Frds-cost-optimizer",0,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills","https:\u002F\u002Fgithub.com\u002Fjhkchan","CTO & Co-Founder @Beever-AI  & @votee. CAISP. AWS Community Builder. Organizer@GDGCloudHK. MongoDB Champion. Technopreneur + Infornographer.","2026-09-24 08:54:10",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill rds-cost-optimizer",{"tool":59,"command":60},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill rds-cost-optimizer",{"tool":62,"command":63},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill rds-cost-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002FSKILL.md",true,[67,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",8572,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Feval\u002Ftest-cases.yaml",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"evals\u002Fbaselines\u002Falready-optimal-prod-postgres-ri.md",630,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fbaselines\u002Falready-optimal-prod-postgres-ri.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"evals\u002Fbaselines\u002Faurora-serverless-acu-tuning.md",714,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fbaselines\u002Faurora-serverless-acu-tuning.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"evals\u002Fbaselines\u002Fidle-database-deletion.md",623,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fbaselines\u002Fidle-database-deletion.md",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"evals\u002Fbaselines\u002Fmultiaz-nonprod-removal.md",625,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fbaselines\u002Fmultiaz-nonprod-removal.md",{"path":90,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":91,"sourceHtmlUrl":92},"evals\u002Fbaselines\u002Foverprovisioned-postgres-rightsize-ri.md",691,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fbaselines\u002Foverprovisioned-postgres-rightsize-ri.md",{"path":94,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":95,"sourceHtmlUrl":96},"evals\u002Feval_config.yaml",1795,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Feval_config.yaml",{"path":98,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":99,"sourceHtmlUrl":100},"evals\u002Fevals.json",4503,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fevals.json",{"path":102,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":103,"sourceHtmlUrl":104},"evals\u002Fprompts\u002Falready-optimal-prod-postgres-ri.md",915,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fprompts\u002Falready-optimal-prod-postgres-ri.md",{"path":106,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":107,"sourceHtmlUrl":108},"evals\u002Fprompts\u002Faurora-serverless-acu-tuning.md",914,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fprompts\u002Faurora-serverless-acu-tuning.md",{"path":110,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":111,"sourceHtmlUrl":112},"evals\u002Fprompts\u002Fidle-database-deletion.md",877,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fprompts\u002Fidle-database-deletion.md",{"path":114,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":115,"sourceHtmlUrl":116},"evals\u002Fprompts\u002Fmultiaz-nonprod-removal.md",734,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fprompts\u002Fmultiaz-nonprod-removal.md",{"path":118,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":119,"sourceHtmlUrl":120},"evals\u002Fprompts\u002Foverprovisioned-postgres-rightsize-ri.md",1059,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fevals\u002Fprompts\u002Foverprovisioned-postgres-rightsize-ri.md",{"path":122,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":123,"sourceHtmlUrl":124},"examples\u002FREADME.md",8493,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fexamples\u002FREADME.md",{"path":126,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fcli-commands.md",3931,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Freferences\u002Fcli-commands.md",{"path":130,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Fexpert-knowledge.md",4309,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Freferences\u002Fexpert-knowledge.md",{"path":134,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Frds-instance-pricing-matrix.md",7460,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Freferences\u002Frds-instance-pricing-matrix.md",{"path":138,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":139,"sourceHtmlUrl":140},"references\u002Freplica-multiaz-constraints.md",4186,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Freferences\u002Freplica-multiaz-constraints.md",{"path":142,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":143,"sourceHtmlUrl":144},"references\u002Fworked-examples.md",8258,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Freferences\u002Fworked-examples.md",{"path":146,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":147,"sourceHtmlUrl":148},"skill.usf.yaml",4451,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Frds-cost-optimizer\u002Fskill.usf.yaml",[150,157,164,171,178,185],{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":19},"01M7ADVD60X4PCAPKSE58P9NDC","xray-tracing-deployer","Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL \u002F method \u002F service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry \u002F ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS \u002F EKS \u002F Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxray-tracing-deployer\u002FSKILL.md",[],[],{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":19},"01M7ADTVJ7DCBM9CB1FY51GH7J","wellarchitected-workload-auditor","Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-workload-auditor\u002FSKILL.md",[],[],{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":19},"01M7ADT59G6FTTNZYHT2QRPNNP","wellarchitected-review-operator","Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer \u002F get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-review-operator\u002FSKILL.md",[],[],{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":19},"01M7ADSH5JA9QHNPPHQCD7EVA7","wafv2-web-acl-deployer","Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB\u002FAPI Gateway\u002FCloudFront, or configuring CAPTCHA\u002FChallenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-deployer\u002FSKILL.md",[],[],{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":184,"publishedAt":19},"01M7ADRYFAT8R73FBNCHRC573X","wafv2-web-acl-auditor","Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow\u002Fbypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-auditor\u002FSKILL.md",[],[],{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":191,"publishedAt":19},"01M7ADR8W7G72JX4KFGN03QK8Q","waf-rule-deployer","Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwaf-rule-deployer\u002FSKILL.md",[],[]]