[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A5140K3BESW8D1AAGED96Z":3,"skill-same:01M7A5140K3BESW8D1AAGED96Z":145},{"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},"01M7A5140K3BESW8D1AAGED96Z","cloudtrail-cost-optimizer",null,"Optimises AWS CloudTrail cost across seven dimensions: trail consolidation (single organization trail replaces N per-region or member-account trails, eliminating duplicate log volume and per-trail KMS\u002FSNS overhead), management-vs-data-event volume analysis (data events are ~10x costlier per event than management events — curate S3\u002FLambda data event sources), S3 lifecycle policy for log files (Glacier Instant\u002FDeep Archive transition after 90 days eliminates ~80% of Standard storage cost), CloudTrail Lake event-data-store cost (per-GB ingestion at $0.75\u002FGB-month plus retention — partition with event-category filters), CloudWatch Logs delivery cost (avoid dual-publishing CloudTrail to both S3 and CloudWatch Logs when only one consumer exists), SNS notification cost ($0.50 per million notifications — consolidate trail SNS topics), KMS key cost per trail (one CMK shared across org trail, not one per trail), Insights event cost ($0.50 per 100k management events — enable only for accounts with anomalous activity...","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\u002Fcloudtrail-cost-optimizer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cloudtrail-cost-optimizer\ndescription: 'Optimises AWS CloudTrail cost across seven dimensions: trail consolidation (single organization trail replaces N per-region or member-account trails, eliminating duplicate log volume and per-trail KMS\u002FSNS overhead), management-vs-data-event volume analysis (data events are ~10x costlier per event than management events — curate S3\u002FLambda data event sources), S3 lifecycle policy for log files (Glacier Instant\u002FDeep Archive transition after 90 days eliminates ~80% of Standard storage cost), CloudTrail Lake event-data-store cost (per-GB ingestion at $0.75\u002FGB-month plus retention — partition with event-category filters), CloudWatch Logs delivery cost (avoid dual-publishing CloudTrail to both S3 and CloudWatch Logs when only one consumer exists), SNS notification cost ($0.50 per million notifications — consolidate trail SNS topics), KMS key cost per trail (one CMK shared across org trail, not one per trail), Insights event cost ($0.50 per 100k management events — enable only for accounts with anomalous activity...'\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline recommendation classification works from pasted trail configurations and Cost Explorer exports. Live-account optimization uses aws cloudtrail describe-trails, get-event-selectors, get-insights-selectors, get-event-data-store, aws organizations describe-organization, list-accounts, aws s3api get-bucket-lifecycle-configuration, head-bucket, aws kms describe-key, get-key-rotation-status, aws ce...\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: Governance\n  task_type: optimize\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE\n  when_to_use: Optimising CloudTrail spend, consolidating multi-region or member trails into a single org trail, curating data event sources (S3\u002FLambda data events), tuning S3 lifecycle for log buckets, reviewing CloudTrail Lake event data store ingestion cost, disabling dual-publishing to CloudWatch Logs, consolidating KMS keys per trail, evaluating CloudTrail Insights cost, or running a governance FinOps sweep.\n  when_not_to_use: CloudTrail functional troubleshooting (use cloudtrail-missing-events-troubleshooter or cloudtrail-gap-troubleshooter), CloudTrail Lake query authoring (use cloudtrail-lake-operator), or CloudTrail alert automation (use cloudtrail-alert-automator). This skill focuses on cost-driven optimization decisions, not on whether events are missing or alerts fire.\n  activation_triggers: optimise CloudTrail cost, CloudTrail trail consolidation, CloudTrail org trail vs member trail, CloudTrail data event volume, CloudTrail S3 lifecycle, CloudTrail log file Glacier transition, CloudTrail Lake event data store cost, CloudTrail CloudWatch Logs delivery cost, CloudTrail KMS key per trail, CloudTrail Insights event cost, CloudTrail log file integrity validation, CloudTrail SNS notification cost, CloudTrail organizational trail deduplication, CloudTrail Athena partition projection, CloudTrail FinOps savings, CloudTrail monthly savings estimate, reduce CloudTrail bill, governance cost review\n  invocation_schema: 'Input: either (a) a CloudTrail trail name + live-account context, (b) an Organizations account list with per-trail configuration summary, OR (c) a Cost Explorer export of CloudTrail spend with at least 30 days of observation plus trail configurations. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002F ESTIMATED_SAVINGS\u002FMIGRATION_STEPS block per trail (or per account for consolidation cases), where VERDICT is one of OPTIMIZED, FURTHER_OPTIMIZATION_AVAILABLE.'\n  invocation_example: \"# Minimal valid input (offline finding classification):\\nTrailName: aws-organizational-trail\\nIsOrganizationTrail: true\\nIsMultiRegionTrail: true\\nIncludeManagementEvents: true\\nDataEventSources:\\n  - S3 (all buckets) — 142,000,000 events\u002Fmonth\\n  - Lambda (all functions) — 8,400,000 events\u002Fmonth\\nInsightsEnabled: true (both ApiCallRateInsight and ApiCallErrorInsight)\\nKMSKeyId: alias\u002Fcloudtrail-org-cmk\\nCloudWatchLogsLogGroupArn: arn:aws:logs:us-east-1:111111111111:log-group:cloudtrail-org\\nS3Bucket: org-cloudtrail-logs-us-east-1\\nS3LifecyclePolicy: none\\nRegion: us-east-1\\nMonthlySpend: $1,847.32\\nDataEventMonthlyVolume: 150.4M events\\nEmit the standard optimization block (TARGET, VERDICT, REASON,\\nRECOMMENDATION, ESTIMATED_SAVINGS, MIGRATION_STEPS).\"\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: CloudTrail, trail consolidation, organization trail, cost optimization, data events, management events, S3 lifecycle, Glacier transition, CloudTrail Lake, event data store, CloudWatch Logs, SNS notification, KMS key, Insights, log file integrity, Athena partition projection, Requester Pays, FinOps, governance, audit logging\n  tags: cloudtrail, governance, cost-optimization, finops, audit-logging, organizational-trail, s3-lifecycle\n---\n\n# CloudTrail Cost Optimizer\n\n## What this skill does\n\nTranslates a CloudTrail trail configuration into a concrete cost-\noptimization recommendation with a dollar-denominated savings estimate.\nThe verdict is the highest-leverage action across seven dimensions —\ntrail consolidation, data-event curation, S3 lifecycle, CloudTrail Lake,\nCloudWatch Logs delivery, KMS key sharing, and Insights tuning — applied\nin priority order. Always pairs the recommendation with exact CLI\ncommands (or CloudFormation\u002FTerraform snippets for trail recreation).\n\n## Quick navigation\n\n| Section | What it covers | When to jump here |\n|---|---|---|\n| Quick start | Four headline rules and the cost formula | First read |\n| Mindset | Why org-trail consolidation is the #1 lever | Understanding the approach |\n| Quick reference — verdict thresholds | Decision matrix at a glance | Classifying a trail |\n| Pre-flight data gate | Trail config, S3 lifecycle, Cost Explorer | Before any recommendation |\n| Step 0 non-obvious behaviours | Data event cost curve, Lake vs S3, digest PUTs | Edge cases |\n| Step 1 Trail consolidation | Org trail replaces N member trails | The headline savings dimension |\n| Step 2 Data event curation | S3\u002FLambda data event volume reduction | High-volume accounts |\n| Step 3 S3 lifecycle for logs | Glacier transition, versioning cleanup | Long-retention trails |\n| Step 4 CloudTrail Lake cost | Event data store ingestion + retention | EDS-based analysis |\n| Step 5 CloudWatch Logs delivery | Dual-publishing elimination | S3-only consumers |\n| Step 6 KMS, SNS, Insights | Shared CMK, topic consolidation, Insights gating | Per-trial overhead |\n| Step 7 Athena partition projection | Log query cost control | Cost analysis queries |\n| Step 8 Impact estimation | The cost formula and worked math | Every recommendation |\n| Output format | VERDICT block + worked examples | Emitting the result |\n| Anti-Patterns — NEVER | Common misclassifications | Self-check before emit |\n| Pre-flight safety checks | CONFIRM gate, log integrity, retention SLA | Before any apply CLI |\n\n## Quick start\n\n- Org trail consolidation is the #1 lever (N member trails re-emit the org's management events) — rationale in `references\u002Fadvanced-patterns.md`.\n- **Cost formula (memorise this):**\n  `monthly_cost = (data_events × $0.10\u002F100k)\n               + (management_events × $0.00 free)\n               + (s3_storage_GB × $0.023 Standard)\n               + (lake_ingestion_GB × $0.75)\n               + (kms_requests × $0.03\u002F10k)\n               + (sns_notifications × $0.50\u002F1M)\n               + (insights_events × $0.50\u002F100k)`\n- Data events are 10x costlier (curate to high-value sources) and S3 lifecycle is a one-click ~80% storage cut — details in `references\u002Fadvanced-patterns.md`.\n\n## Mindset\n\n→ Governance-vs-spend framing and the four principles (capture once, rank data events, logs are cold data, Lake-for-query\u002FS3-for-archive) — `references\u002Fadvanced-patterns.md`.\n\n## Quick reference — verdict thresholds\n\n| Observation (30-90 day window) | Verdict | Recommendation |\n|---|---|---|\n| > 1 trail per org AND none has `IsOrganizationTrail=true` | **FURTHER_OPTIMIZATION_AVAILABLE** (consolidation) | Step 1 — create single org trail, delete member trails |\n| Org trail exists AND member trails remain active (duplicate capture) | **FURTHER_OPTIMIZATION_AVAILABLE** (consolidation) | Step 1 — delete member trails; org trail already covers |\n| S3 data events = `All Buckets` AND high-volume low-value buckets (logs, ELB, CDN) present | **FURTHER_OPTIMIZATION_AVAILABLE** (data curation) | Step 2 — switch to basic-event-selector with explicit bucket list |\n| Lambda data events = `All Functions` AND > 1000 functions with > 80% low-audit-value | **FURTHER_OPTIMIZATION_AVAILABLE** (data curation) | Step 2 — curate function ARNs or disable Lambda data events |\n| S3 log bucket lifecycle policy absent OR Standard-only beyond 90 days | **FURTHER_OPTIMIZATION_AVAILABLE** (lifecycle) | Step 3 — add Glacier Instant Retrieval @ 90d, Deep Archive @ 180d |\n| CloudTrail Lake EDS ingesting > 50 GB\u002Fmonth of free-tier-redundant data | **FURTHER_OPTIMIZATION_AVAILABLE** (Lake) | Step 4 — add event-category filter, narrow EDS scope |\n| CloudTrail publishing to both S3 AND CloudWatch Logs AND only S3 consumers exist | **FURTHER_OPTIMIZATION_AVAILABLE** (Logs) | Step 5 — disable CloudWatchLogsLogGroupArn |\n| Each trail has its own KMS CMK AND > 3 trails in the org | **FURTHER_OPTIMIZATION_AVAILABLE** (KMS) | Step 6 — share one CMK across all trails |\n| CloudTrail Insights enabled on ALL trails AND no anomalous findings in 90 days | **FURTHER_OPTIMIZATION_AVAILABLE** (Insights) | Step 6 — disable Insights on low-risk trails |\n| Org trail + curated data events + Glacier lifecycle + single CMK + Lake sized for interactive queries only | **OPTIMIZED** | None — continue monitoring |\n| Cost Explorer CloudTrail line absent or window \u003C 30 days | **NEED_MORE_INFO** | Pull 30-90 day Cost Explorer, re-evaluate |\n| All dimensions verified AND a change was applied and confirmed this session | **OPTIMIZED** | Emit post-state verification |\n\n## Pre-flight: data gate (run before any optimization decision)\n\nOptimization decisions are only as good as the underlying data. Pull\nthese signals before any recommendation. Full CLI sequences are in\n`references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Required data sources** (summarized — see reference for full CLI):\n→ All 9 data-source commands (trail configs, selectors, org structure, S3 lifecycle, bucket size, EDS, KMS, Cost Explorer) — `references\u002Fdiagnostic-commands.md`.\n\n### Data-quality short-circuits\n\n| Condition | Effect on optimization |\n|---|---|\n| `describe-trails` returns empty `trailList` | **NEED_MORE_INFO**. CloudTrail may be disabled or IAM denies cloudtrail:DescribeTrails. |\n| 30-day Cost Explorer window shows $0 CloudTrail spend | Trail may be in free tier; check data-event dimension separately. |\n| S3 `BucketSizeBytes` metric absent for CloudTrail prefix | Bucket untagged or metrics not enabled. Fall back to S3 inventory report. |\n| `get-event-selectors` returns `CloudTrail Insights not enabled` | Insights dimension is no-op; skip Step 6 Insights sub-check. |\n| `list-event-data-stores` empty | CloudTrail Lake not configured; skip Step 4. |\n| Observation window \u003C 30 days | **NEED_MORE_INFO**. Minimum 30 days; 90 days preferred for seasonality. |\n| Trail `Status != RUNNING` (logging suspended) | Skip optimization; surface as BLOCKED. Resume logging first. |\n\nWhen Cost Explorer and CloudTrail metrics disagree, Cost Explorer is\nauthoritative for the dollar figure; CloudTrail metrics are authoritative\nfor event counts.\n\n## Process — Optimization logic (apply in order)\n\n### Step 0: Non-obvious behaviours that change the recommendation\n→ All 12 gotchas (free first management trail, org trail auto-multi-region, no cross-trail dedup, lifecycle hits digests, double EDS ingest, Logs billed by bytes, KMS per-call, Insights per-events-analyzed, Requester Pays, Athena full scans, digest PUTs, EventBridge per-event) — `references\u002Fadvanced-patterns.md`.\n\n### Step 1: Trail consolidation (the #1 lever)\n\n→ Why consolidation is the primary cost lever — `references\u002Fadvanced-patterns.md`.\n\n**The consolidation math:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n→ Data-event duplicate-cost compounding and the org-management-account prerequisite — `references\u002Fadvanced-patterns.md`.\n\n**Decision gate after consolidation analysis:**\n\n| Trail inventory | Verdict | Action |\n|---|---|---|\n| Org trail exists AND no member trails | No consolidation finding | Proceed to other dimensions. |\n| Org trail exists AND member trails present | **FURTHER_OPTIMIZATION_AVAILABLE** | Delete member trails; org trail covers all member events. |\n| No org trail AND > 1 trail across accounts | **FURTHER_OPTIMIZATION_AVAILABLE** | Create org trail, migrate consumers, delete member trails. |\n| No org trail AND 1 trail per account (standard) | **FURTHER_OPTIMIZATION_AVAILABLE** | Convert to org trail (single creation in mgmt account). |\n| Standalone account (not in org) | Skip Step 1 | No consolidation possible. |\n\n→ Org-trail creation and member-trail deletion CLI — `references\u002Fdiagnostic-commands.md`.\n\n### Step 2: Data event curation\n\n→ Pricing comparison (management events free on first trail; data events $0.10\u002F100k) — `references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Decision tree:**\n```\nIs the trail capturing S3 data events on All Buckets?\n├── NO → S3 data event check passes.\n└── YES → Are > 20% of events from low-value buckets (logs, ELB,\n           CDN, CloudTrail's own bucket)?\n    ├── NO → S3 data events are justified.\n    └── YES → **FURTHER_OPTIMIZATION_AVAILABLE** (curate bucket list)\n\nIs the trail capturing Lambda data events on All Functions?\n├── NO → Lambda data event check passes.\n└── YES → Are > 50% of functions low-audit-value (cron jobs, internal\n           health checks, dev-stage functions)?\n    ├── NO → Lambda data events are justified.\n    └── YES → **FURTHER_OPTIMIZATION_AVAILABLE** (curate or disable)\n```\n\n→ Selector-form guidance and the put-event-selectors CLI — `references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Data-event saving from curation:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n### Step 3: S3 lifecycle for log files\n\nCloudTrail log files are write-once-read-rarely. Standard storage beyond\n90 days is wasted spend; Glacier Instant Retrieval keeps millisecond\nread latency at 19% of Standard cost.\n\n**Storage class cost comparison:** table in `references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Recommended lifecycle policy** (full JSON in\n`references\u002Fcloudtrail-pricing-and-inventory.md`):\n- Day 30 → Intelligent-Tiering (auto-tiering; ~$0.0025\u002FGB archive tier)\n- Day 90 → Glacier Instant Retrieval ($0.004\u002FGB-month, ms latency)\n- Day 180 → Deep Archive ($0.00099\u002FGB-month, 12-hour restore)\n- Day 365 → Expire (or your compliance retention SLA)\n\n→ put-bucket-lifecycle-configuration CLI — `references\u002Fdiagnostic-commands.md`.\n\n**Storage saving math:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n### Step 4: CloudTrail Lake event data store cost\n\n→ Lake pricing model (ingestion $0.75\u002FGB one-time + retention $0.023\u002FGB) — `references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Decision tree:**\n```\nIs the EDS ingesting all event categories (management + data + insight)?\n├── NO → EDS scope is curated; check ingestion GB.\n└── YES → Are data events needed for the EDS use case?\n    ├── NO → **FURTHER_OPTIMIZATION_AVAILABLE** (filter to management)\n    └── YES → Can high-volume low-value sources be excluded?\n        ├── NO → EDS is justified.\n        └── YES → **FURTHER_OPTIMIZATION_AVAILABLE** (narrow EDS scope)\n```\n\n→ update-event-data-store CLI with event-category filter — `references\u002Fdiagnostic-commands.md`.\n\n**Lake cost math:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n### Step 5: CloudWatch Logs delivery cost\n\nCloudTrail can publish to both S3 and CloudWatch Logs. Logs ingestion\nbills by bytes at $0.50\u002FGB — typically 5x more expensive than S3 for\nthe same events.\n\n**Decision tree:**\n```\nIs CloudTrail publishing to CloudWatch Logs?\n├── NO → Logs check passes.\n└── YES → Are there CloudWatch Logs consumers (metric filters, alarms,\n           Logs Insights queries)?\n    ├── YES → Are they high-value enough to justify 5x storage cost?\n    │        ├── YES → Keep Logs delivery.\n    │        └── NO → **FURTHER_OPTIMIZATION_AVAILABLE** (migrate to Athena-on-S3)\n    └── NO → **FURTHER_OPTIMIZATION_AVAILABLE** (disable Logs delivery)\n```\n\n→ update-trail --no-cloud-watch-logs-log-group-arn CLI — `references\u002Fdiagnostic-commands.md`.\n\n**Logs delivery cost math:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n### Step 6: KMS, SNS, and Insights tuning\n\nThese per-trial overheads are individually small but multiply across\ntrail count.\n\n**KMS key consolidation:** cost math in `references\u002Fcloudtrail-worked-examples.md`.\n\n**KMS policy snippet allowing CloudTrail service to use a shared key**\nlives in `references\u002Fcloudtrail-pricing-and-inventory.md` (the policy\ngrants `kms:GenerateDataKey*` to `cloudtrail.amazonaws.com` scoped by\n`aws:SourceArn` to the trail ARN).\n\n→ SNS consolidation and Insights gating guidance — `references\u002Fadvanced-patterns.md`.\n\n→ stop-insights-logging CLI — `references\u002Fdiagnostic-commands.md`.\n\n### Step 7: Athena partition projection for cost analysis\n\n→ Full Athena partition projection deep dive (scan-cost math, DDL pointer) — `references\u002Fadvanced-patterns.md`.\n\n### Step 8: Impact estimation\n\nCompute the monthly savings for each recommendation:\n\n```\ncurrent_monthly_cost =\n  (data_events \u002F 100000 × $0.10) +\n  (s3_storage_GB × $0.023) +\n  (lake_ingestion_GB × $0.75) +\n  (logs_ingestion_GB × $0.50) +\n  (insights_events \u002F 100000 × $0.50) +\n  (kms_keys × $1.50) +\n  (sns_notifications \u002F 1000000 × $0.50)\n\nprojected_monthly_cost = \u003Crecompute each term after changes>\n\nmonthly_saving = current_monthly_cost - projected_monthly_cost\n```\n\nAlways state assumptions: data event volume, S3 storage size, Lake\ningestion rate, Logs ingestion rate, Insights event volume, KMS key\ncount, SNS topic count, pricing region.\n\n### Step 9: Final verdict\n\n- Any dimension recommends a change → **FURTHER_OPTIMIZATION_AVAILABLE**.\n- All dimensions pass AND org trail + curated data events + lifecycle +\n  single CMK + Lake scoped to interactive queries → **OPTIMIZED**.\n- Change applied and verified this session → **OPTIMIZED** (post-state).\n- Data insufficient (trail inventory absent, window \u003C 30 days) →\n  **NEED_MORE_INFO**.\n\nNever emit `FURTHER_OPTIMIZATION_AVAILABLE` without first discharging\nevery `NEED_MORE_INFO`\u002F`BLOCKED` gate.\n\n## Output format\n\n→ Full per-operation label contract (TARGET \u002F VERDICT \u002F REASON \u002F RECOMMENDATION \u002F ESTIMATED_SAVINGS \u002F MIGRATION_STEPS \u002F CONFIRM) — `references\u002Fcloudtrail-worked-examples.md`. The STRICT output contract below remains authoritative.\n\nFull worked examples (org-trail consolidation, data-event curation, S3\nlifecycle rollout, CloudTrail Lake scoping, already-optimized, end-to-\nend walkthrough) are in `references\u002Fcloudtrail-worked-examples.md`.\n\n## STRICT output contract\n\nThe rules below are hard constraints. Violating any one produces a\nmisclassification or an arithmetic contradiction that breaks downstream\nFinOps automation. Self-check EVERY emitted block against these rules\nbefore returning the response.\n\n### Required output structure\n\nEvery response MUST be a single block using these literal labels, in this\norder. Do NOT substitute markdown headings, camelCase, or bold variants.\n\n```text\nTARGET: \u003Ctrail-name>\nVERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE\nREASON: \u003C1-2 sentences naming the recommendation and supporting data>\nRECOMMENDATION:\n  Current: \u003Ctrail inventory + data events + storage class + Lake + Logs>\n  Proposed: \u003Cconsolidated inventory + curated events + Glacier + Lake scope>\n  Dimensions changed: \u003Cconsolidation | data_events | lifecycle | lake | logs | kms_sns_insights | athena>\n  Dimensions checked: \u003Clist ALL seven, each ✓ (no finding) or → (finding)>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Current monthly: $\u003Camount>    ← MUST show subtotals per cost term\n  Projected monthly: $\u003Camount>\n  Monthly saving: $\u003Camount>     ← MUST equal Current − Projected, 2 decimals\n  Annual saving: $\u003Camount>      ← MUST equal Monthly × 12\nMIGRATION_STEPS:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification step>\nCONFIRM: \u003Cconfirmation prompt text>\n```\n\n### FORBIDDEN output patterns\n\n1. **NEVER emit `VERDICT: FURTHER_OPTIMIZATION_AVAILABLE` with\n   `Monthly saving: $0.00`.** If every dimension nets zero cost delta,\n   the verdict MUST be `OPTIMIZED`. A cost-neutral compliance\n   improvement is surfaced in REASON, NOT as a dollar saving.\n\n2. **NEVER show savings math that does not balance.**\n   `Current monthly − Projected monthly` MUST equal `Monthly saving`,\n   rounded to 2 decimal places.\n\n3. **NEVER emit scratch lines** (\"WAIT — recompute\", \"Hmm, let me redo\",\n   \"corrected:\") in the output. Finalize the math before emitting.\n\n4. **NEVER recommend org trail consolidation without verifying the\n   account is the org management account.** Creating an org trail from\n   a member account fails. Surface this as a prerequisite.\n\n5. **NEVER omit a dimension from the RECOMMENDATION block.** The\n   `Dimensions checked` line MUST list all seven dimensions, each marked\n   ✓ (no finding) or → (finding).\n\n6. **NEVER recommend disabling log file integrity validation without\n   confirming S3 Object Lock provides equivalent tamper-evidence.**\n   Disabling validation halves digest PUT cost but loses the audit\n   attestation if Object Lock isn't enforced.\n\n7. **NEVER round intermediate formula steps differently from the final\n   figure.** Compute at full precision, round only the displayed result.\n\n### Perfect example output — FURTHER_OPTIMIZATION_AVAILABLE with verified math\n\nEvery field below is internally consistent. Copy this shape exactly.\nAdditional full worked examples (org-trail consolidation, data-event\ncuration, S3 lifecycle, CloudTrail Lake scoping, already-optimized,\nNEED_MORE_INFO) are in `references\u002Fcloudtrail-worked-examples.md`.\n\n```text\nTARGET: aws-organizational-trail\nVERDICT: FURTHER_OPTIMIZATION_AVAILABLE\nREASON: Organization trail capturing S3 data events on All Buckets\n  includes 113M events\u002Fmonth from log and CDN buckets (80% of total)\n  that have no audit value. S3 log bucket has no lifecycle policy,\n  retaining 500 GB in Standard at $0.023\u002FGB. Combined curation +\n  lifecycle drops monthly CloudTrail spend 62%.\nRECOMMENDATION:\n  Current: org trail + All-Buckets S3 data events + Standard storage + no Lake\n  Proposed: org trail + curated S3 data events (8 high-value buckets) + Glacier IR @ 90d\n  Dimensions changed: data_events (Step 2) + lifecycle (Step 3)\n  Dimensions checked: consolidation ✓  data_events → (curate)\n    lifecycle → (no policy)  lake ✓  logs ✓  kms_sns_insights ✓  athena ✓\n  Confidence: HIGH — S3 metrics confirm 113M\u002F142M events are low-value\n    bucket writes; lifecycle math is deterministic; us-east-1 pricing.\nESTIMATED_SAVINGS:\n  Current monthly: $1,847.32\n    data_events: $142.00  s3_storage: $11.50  kms_keys: $1.50\n    sns: $0.70  insights: $0  logs: $0  lake: $0  athena_scans: $1,692.62\n  Projected monthly: $697.32\n    data_events: $29.00 (curated)  s3_storage: $1.79 (Glacier IR + Deep Archive)\n    kms_keys: $1.50  sns: $0.30  insights: $0  logs: $0  lake: $0  athena: $664.73\n  Monthly saving: $1,150.00   ($1,847.32 − $697.32 = $1,150.00 ✓)\n  Annual saving: $13,800.00\nMIGRATION_STEPS:\n  1. Apply advanced event selectors with curated bucket list:\n     aws cloudtrail put-event-selectors --trail-name aws-organizational-trail \\\n       --advanced-event-selectors file:\u002F\u002Fcurated-selectors.json\n  2. Apply S3 lifecycle policy to the log bucket:\n     aws s3api put-bucket-lifecycle-configuration \\\n       --bucket org-cloudtrail-logs-us-east-1 \\\n       --lifecycle-configuration file:\u002F\u002Fcloudtrail-lifecycle.json\n  3. Verify lifecycle policy took effect (no immediate object transitions):\n     aws s3api get-bucket-lifecycle-configuration \\\n       --bucket org-cloudtrail-logs-us-east-1\n  4. After 30 days, query S3 storage metrics to confirm Intelligent\n     Tiering is taking effect.\nCONFIRM: About to put-event-selectors on aws-organizational-trail\n  (All Buckets → 8 high-value buckets) and apply S3 lifecycle to\n  org-cloudtrail-logs-us-east-1. Monthly saving $1,150.00 (62%).\n  Proceed? (yes\u002Fno)\n```\n\n**Self-check before emit:**\n- [ ] `Current monthly − Projected monthly == Monthly saving` (2 decimals)?\n- [ ] `Monthly saving × 12 == Annual saving`?\n- [ ] All seven dimensions listed in `Dimensions checked`?\n- [ ] Every `→` dimension has a corresponding MIGRATION_STEPS entry?\n- [ ] No scratch\u002Frecompute text in the block?\n\n## Verdict semantics\n\n| Verdict | When to emit |\n|---|---|\n| `FURTHER_OPTIMIZATION_AVAILABLE` | At least one dimension has a concrete, savings-bearing recommendation. |\n| `OPTIMIZED` | Either (a) all dimensions pass (org trail + curated data events + lifecycle + single CMK + Lake scoped), OR (b) a change was applied and verified this session. |\n| `NEED_MORE_INFO` | Data gate failed: trail inventory absent, Cost Explorer window \u003C 30 days, or S3 metrics unavailable. |\n| `BLOCKED` | Hard precondition prevents evaluation: trail Status != RUNNING (logging suspended), IAM denies cloudtrail:DescribeTrails. |\n\n**Zero-savings rule:** If MONTHLY_SAVING == $0.00 for every dimension,\nverdict MUST be `OPTIMIZED`, never `FURTHER_OPTIMIZATION_AVAILABLE`.\nException: a compliance improvement without cost change is surfaced in\nREASON, not as dollar savings.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER recommend org trail consolidation without verifying the\n   account is the org management account.** Member accounts cannot\n   create org trails; the API call fails.\n2. **NEVER recommend disabling management events to reduce cost.**\n   Management events are free on the first trail per region. Disabling\n   breaks audit completeness for ~zero savings.\n3. **NEVER recommend Deep Archive transition without confirming the\n   audit RTO tolerates 12-hour restore.** For incident-response use\n   cases, Glacier Instant Retrieval (ms-latency) is the right choice.\n4. **NEVER recommend curating data events without confirming the\n   bucket list is complete.** Missing a high-value bucket creates a\n   silent audit blind spot.\n5. **NEVER recommend disabling CloudWatch Logs delivery without\n   auditing for existing metric filters, alarms, or Logs Insights\n   queries on the log group.** Disabling breaks downstream monitoring.\n\nExtended anti-patterns in `references\u002Fcloudtrail-worked-examples.md`.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n→ Full checklist (confirmation gate, org-trail coverage before deletion, selector snapshot, single-prefix lifecycle test, Object Lock check, EDS export-first, KMS policy update, Insights irreversibility, 5-trail batches) — `references\u002Fdiagnostic-commands.md`.\n\n## Recent AWS features (2024-2026)\n\n→ All four updates (Lake enhancements, advanced event selectors GA, Glacier Instant Retrieval, Insights for data events) — `references\u002Fadvanced-patterns.md`.\n\n## References\n\n- `references\u002Fcloudtrail-pricing-and-inventory.md` — pricing tables,\n  trail inventory CLI, event selector syntax, KMS key policy templates,\n  S3 lifecycle JSON, Athena partition projection DDL, regional pricing\n  multipliers, cost calculation worked examples.\n- `references\u002Fcloudtrail-worked-examples.md` — org-trail consolidation,\n  data-event curation, S3 lifecycle, CloudTrail Lake scoping, already-\n  optimized, end-to-end walkthrough, extended NEVER list, edge cases.\n\n## References (load on demand)\n\n- [`references\u002Fdiagnostic-commands.md`](references\u002Fdiagnostic-commands.md) — pre-flight data-source commands; per-step apply CLI (org trail, selectors, lifecycle, EDS, Logs, Insights); pre-remediation safety checks\n- [`references\u002Fcloudtrail-worked-examples.md`](references\u002Fcloudtrail-worked-examples.md) — per-step cost math and the per-operation output format, plus the pre-existing full worked examples per dimension\n- [`references\u002Fcloudtrail-pricing-and-inventory.md`](references\u002Fcloudtrail-pricing-and-inventory.md) — pricing comparisons and selector forms, plus the pre-existing pricing tables, inventory CLI, KMS policy, lifecycle JSON, Athena DDL\n- [`references\u002Fadvanced-patterns.md`](references\u002Fadvanced-patterns.md) — Step 0 gotchas, mindset principles, Step 1 \u002F 6 \u002F 7 rationale, recent AWS features (2024-2026)\n\n## Domain\n\nAWS CloudOps \u002F Governance Audit Logging Cost Optimization & FinOps.\n\n## AWS documentation\n\n- **AWS CloudTrail User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcloudtrail-user-guide.html\n- **AWS CloudTrail pricing** — https:\u002F\u002Faws.amazon.com\u002Fcloudtrail\u002Fpricing\u002F\n- **CloudTrail organizational trails** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcreating-trail-organization.html\n- **CloudTrail event selectors** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Flogging-data-events-with-cloudtrail.html\n- **CloudTrail Lake** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcloudtrail-lake.html\n- **CloudTrail Insights** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Flogging-insights-events-with-cloudtrail.html\n- **S3 lifecycle configuration** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fobject-lifecycle-mgmt.html\n- **Athena partition projection** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fpartition-projection.html\n- **AWS Well-Architected Framework — Cost Optimization** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fcost-optimization-pillar\u002Fwelcome.html\n","# CloudTrail Cost Optimizer\n\n## What this skill does\n\nTranslates a CloudTrail trail configuration into a concrete cost-\noptimization recommendation with a dollar-denominated savings estimate.\nThe verdict is the highest-leverage action across seven dimensions —\ntrail consolidation, data-event curation, S3 lifecycle, CloudTrail Lake,\nCloudWatch Logs delivery, KMS key sharing, and Insights tuning — applied\nin priority order. Always pairs the recommendation with exact CLI\ncommands (or CloudFormation\u002FTerraform snippets for trail recreation).\n\n## Quick navigation\n\n| Section | What it covers | When to jump here |\n|---|---|---|\n| Quick start | Four headline rules and the cost formula | First read |\n| Mindset | Why org-trail consolidation is the #1 lever | Understanding the approach |\n| Quick reference — verdict thresholds | Decision matrix at a glance | Classifying a trail |\n| Pre-flight data gate | Trail config, S3 lifecycle, Cost Explorer | Before any recommendation |\n| Step 0 non-obvious behaviours | Data event cost curve, Lake vs S3, digest PUTs | Edge cases |\n| Step 1 Trail consolidation | Org trail replaces N member trails | The headline savings dimension |\n| Step 2 Data event curation | S3\u002FLambda data event volume reduction | High-volume accounts |\n| Step 3 S3 lifecycle for logs | Glacier transition, versioning cleanup | Long-retention trails |\n| Step 4 CloudTrail Lake cost | Event data store ingestion + retention | EDS-based analysis |\n| Step 5 CloudWatch Logs delivery | Dual-publishing elimination | S3-only consumers |\n| Step 6 KMS, SNS, Insights | Shared CMK, topic consolidation, Insights gating | Per-trial overhead |\n| Step 7 Athena partition projection | Log query cost control | Cost analysis queries |\n| Step 8 Impact estimation | The cost formula and worked math | Every recommendation |\n| Output format | VERDICT block + worked examples | Emitting the result |\n| Anti-Patterns — NEVER | Common misclassifications | Self-check before emit |\n| Pre-flight safety checks | CONFIRM gate, log integrity, retention SLA | Before any apply CLI |\n\n## Quick start\n\n- Org trail consolidation is the #1 lever (N member trails re-emit the org's management events) — rationale in `references\u002Fadvanced-patterns.md`.\n- **Cost formula (memorise this):**\n  `monthly_cost = (data_events × $0.10\u002F100k)\n               + (management_events × $0.00 free)\n               + (s3_storage_GB × $0.023 Standard)\n               + (lake_ingestion_GB × $0.75)\n               + (kms_requests × $0.03\u002F10k)\n               + (sns_notifications × $0.50\u002F1M)\n               + (insights_events × $0.50\u002F100k)`\n- Data events are 10x costlier (curate to high-value sources) and S3 lifecycle is a one-click ~80% storage cut — details in `references\u002Fadvanced-patterns.md`.\n\n## Mindset\n\n→ Governance-vs-spend framing and the four principles (capture once, rank data events, logs are cold data, Lake-for-query\u002FS3-for-archive) — `references\u002Fadvanced-patterns.md`.\n\n## Quick reference — verdict thresholds\n\n| Observation (30-90 day window) | Verdict | Recommendation |\n|---|---|---|\n| > 1 trail per org AND none has `IsOrganizationTrail=true` | **FURTHER_OPTIMIZATION_AVAILABLE** (consolidation) | Step 1 — create single org trail, delete member trails |\n| Org trail exists AND member trails remain active (duplicate capture) | **FURTHER_OPTIMIZATION_AVAILABLE** (consolidation) | Step 1 — delete member trails; org trail already covers |\n| S3 data events = `All Buckets` AND high-volume low-value buckets (logs, ELB, CDN) present | **FURTHER_OPTIMIZATION_AVAILABLE** (data curation) | Step 2 — switch to basic-event-selector with explicit bucket list |\n| Lambda data events = `All Functions` AND > 1000 functions with > 80% low-audit-value | **FURTHER_OPTIMIZATION_AVAILABLE** (data curation) | Step 2 — curate function ARNs or disable Lambda data events |\n| S3 log bucket lifecycle policy absent OR Standard-only beyond 90 days | **FURTHER_OPTIMIZATION_AVAILABLE** (lifecycle) | Step 3 — add Glacier Instant Retrieval @ 90d, Deep Archive @ 180d |\n| CloudTrail Lake EDS ingesting > 50 GB\u002Fmonth of free-tier-redundant data | **FURTHER_OPTIMIZATION_AVAILABLE** (Lake) | Step 4 — add event-category filter, narrow EDS scope |\n| CloudTrail publishing to both S3 AND CloudWatch Logs AND only S3 consumers exist | **FURTHER_OPTIMIZATION_AVAILABLE** (Logs) | Step 5 — disable CloudWatchLogsLogGroupArn |\n| Each trail has its own KMS CMK AND > 3 trails in the org | **FURTHER_OPTIMIZATION_AVAILABLE** (KMS) | Step 6 — share one CMK across all trails |\n| CloudTrail Insights enabled on ALL trails AND no anomalous findings in 90 days | **FURTHER_OPTIMIZATION_AVAILABLE** (Insights) | Step 6 — disable Insights on low-risk trails |\n| Org trail + curated data events + Glacier lifecycle + single CMK + Lake sized for interactive queries only | **OPTIMIZED** | None — continue monitoring |\n| Cost Explorer CloudTrail line absent or window \u003C 30 days | **NEED_MORE_INFO** | Pull 30-90 day Cost Explorer, re-evaluate |\n| All dimensions verified AND a change was applied and confirmed this session | **OPTIMIZED** | Emit post-state verification |\n\n## Pre-flight: data gate (run before any optimization decision)\n\nOptimization decisions are only as good as the underlying data. Pull\nthese signals before any recommendation. Full CLI sequences are in\n`references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Required data sources** (summarized — see reference for full CLI):\n→ All 9 data-source commands (trail configs, selectors, org structure, S3 lifecycle, bucket size, EDS, KMS, Cost Explorer) — `references\u002Fdiagnostic-commands.md`.\n\n### Data-quality short-circuits\n\n| Condition | Effect on optimization |\n|---|---|\n| `describe-trails` returns empty `trailList` | **NEED_MORE_INFO**. CloudTrail may be disabled or IAM denies cloudtrail:DescribeTrails. |\n| 30-day Cost Explorer window shows $0 CloudTrail spend | Trail may be in free tier; check data-event dimension separately. |\n| S3 `BucketSizeBytes` metric absent for CloudTrail prefix | Bucket untagged or metrics not enabled. Fall back to S3 inventory report. |\n| `get-event-selectors` returns `CloudTrail Insights not enabled` | Insights dimension is no-op; skip Step 6 Insights sub-check. |\n| `list-event-data-stores` empty | CloudTrail Lake not configured; skip Step 4. |\n| Observation window \u003C 30 days | **NEED_MORE_INFO**. Minimum 30 days; 90 days preferred for seasonality. |\n| Trail `Status != RUNNING` (logging suspended) | Skip optimization; surface as BLOCKED. Resume logging first. |\n\nWhen Cost Explorer and CloudTrail metrics disagree, Cost Explorer is\nauthoritative for the dollar figure; CloudTrail metrics are authoritative\nfor event counts.\n\n## Process — Optimization logic (apply in order)\n\n### Step 0: Non-obvious behaviours that change the recommendation\n→ All 12 gotchas (free first management trail, org trail auto-multi-region, no cross-trail dedup, lifecycle hits digests, double EDS ingest, Logs billed by bytes, KMS per-call, Insights per-events-analyzed, Requester Pays, Athena full scans, digest PUTs, EventBridge per-event) — `references\u002Fadvanced-patterns.md`.\n\n### Step 1: Trail consolidation (the #1 lever)\n\n→ Why consolidation is the primary cost lever — `references\u002Fadvanced-patterns.md`.\n\n**The consolidation math:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n→ Data-event duplicate-cost compounding and the org-management-account prerequisite — `references\u002Fadvanced-patterns.md`.\n\n**Decision gate after consolidation analysis:**\n\n| Trail inventory | Verdict | Action |\n|---|---|---|\n| Org trail exists AND no member trails | No consolidation finding | Proceed to other dimensions. |\n| Org trail exists AND member trails present | **FURTHER_OPTIMIZATION_AVAILABLE** | Delete member trails; org trail covers all member events. |\n| No org trail AND > 1 trail across accounts | **FURTHER_OPTIMIZATION_AVAILABLE** | Create org trail, migrate consumers, delete member trails. |\n| No org trail AND 1 trail per account (standard) | **FURTHER_OPTIMIZATION_AVAILABLE** | Convert to org trail (single creation in mgmt account). |\n| Standalone account (not in org) | Skip Step 1 | No consolidation possible. |\n\n→ Org-trail creation and member-trail deletion CLI — `references\u002Fdiagnostic-commands.md`.\n\n### Step 2: Data event curation\n\n→ Pricing comparison (management events free on first trail; data events $0.10\u002F100k) — `references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Decision tree:**\n```\nIs the trail capturing S3 data events on All Buckets?\n├── NO → S3 data event check passes.\n└── YES → Are > 20% of events from low-value buckets (logs, ELB,\n           CDN, CloudTrail's own bucket)?\n    ├── NO → S3 data events are justified.\n    └── YES → **FURTHER_OPTIMIZATION_AVAILABLE** (curate bucket list)\n\nIs the trail capturing Lambda data events on All Functions?\n├── NO → Lambda data event check passes.\n└── YES → Are > 50% of functions low-audit-value (cron jobs, internal\n           health checks, dev-stage functions)?\n    ├── NO → Lambda data events are justified.\n    └── YES → **FURTHER_OPTIMIZATION_AVAILABLE** (curate or disable)\n```\n\n→ Selector-form guidance and the put-event-selectors CLI — `references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Data-event saving from curation:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n### Step 3: S3 lifecycle for log files\n\nCloudTrail log files are write-once-read-rarely. Standard storage beyond\n90 days is wasted spend; Glacier Instant Retrieval keeps millisecond\nread latency at 19% of Standard cost.\n\n**Storage class cost comparison:** table in `references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Recommended lifecycle policy** (full JSON in\n`references\u002Fcloudtrail-pricing-and-inventory.md`):\n- Day 30 → Intelligent-Tiering (auto-tiering; ~$0.0025\u002FGB archive tier)\n- Day 90 → Glacier Instant Retrieval ($0.004\u002FGB-month, ms latency)\n- Day 180 → Deep Archive ($0.00099\u002FGB-month, 12-hour restore)\n- Day 365 → Expire (or your compliance retention SLA)\n\n→ put-bucket-lifecycle-configuration CLI — `references\u002Fdiagnostic-commands.md`.\n\n**Storage saving math:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n### Step 4: CloudTrail Lake event data store cost\n\n→ Lake pricing model (ingestion $0.75\u002FGB one-time + retention $0.023\u002FGB) — `references\u002Fcloudtrail-pricing-and-inventory.md`.\n\n**Decision tree:**\n```\nIs the EDS ingesting all event categories (management + data + insight)?\n├── NO → EDS scope is curated; check ingestion GB.\n└── YES → Are data events needed for the EDS use case?\n    ├── NO → **FURTHER_OPTIMIZATION_AVAILABLE** (filter to management)\n    └── YES → Can high-volume low-value sources be excluded?\n        ├── NO → EDS is justified.\n        └── YES → **FURTHER_OPTIMIZATION_AVAILABLE** (narrow EDS scope)\n```\n\n→ update-event-data-store CLI with event-category filter — `references\u002Fdiagnostic-commands.md`.\n\n**Lake cost math:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n### Step 5: CloudWatch Logs delivery cost\n\nCloudTrail can publish to both S3 and CloudWatch Logs. Logs ingestion\nbills by bytes at $0.50\u002FGB — typically 5x more expensive than S3 for\nthe same events.\n\n**Decision tree:**\n```\nIs CloudTrail publishing to CloudWatch Logs?\n├── NO → Logs check passes.\n└── YES → Are there CloudWatch Logs consumers (metric filters, alarms,\n           Logs Insights queries)?\n    ├── YES → Are they high-value enough to justify 5x storage cost?\n    │        ├── YES → Keep Logs delivery.\n    │        └── NO → **FURTHER_OPTIMIZATION_AVAILABLE** (migrate to Athena-on-S3)\n    └── NO → **FURTHER_OPTIMIZATION_AVAILABLE** (disable Logs delivery)\n```\n\n→ update-trail --no-cloud-watch-logs-log-group-arn CLI — `references\u002Fdiagnostic-commands.md`.\n\n**Logs delivery cost math:** worked math in `references\u002Fcloudtrail-worked-examples.md`.\n\n### Step 6: KMS, SNS, and Insights tuning\n\nThese per-trial overheads are individually small but multiply across\ntrail count.\n\n**KMS key consolidation:** cost math in `references\u002Fcloudtrail-worked-examples.md`.\n\n**KMS policy snippet allowing CloudTrail service to use a shared key**\nlives in `references\u002Fcloudtrail-pricing-and-inventory.md` (the policy\ngrants `kms:GenerateDataKey*` to `cloudtrail.amazonaws.com` scoped by\n`aws:SourceArn` to the trail ARN).\n\n→ SNS consolidation and Insights gating guidance — `references\u002Fadvanced-patterns.md`.\n\n→ stop-insights-logging CLI — `references\u002Fdiagnostic-commands.md`.\n\n### Step 7: Athena partition projection for cost analysis\n\n→ Full Athena partition projection deep dive (scan-cost math, DDL pointer) — `references\u002Fadvanced-patterns.md`.\n\n### Step 8: Impact estimation\n\nCompute the monthly savings for each recommendation:\n\n```\ncurrent_monthly_cost =\n  (data_events \u002F 100000 × $0.10) +\n  (s3_storage_GB × $0.023) +\n  (lake_ingestion_GB × $0.75) +\n  (logs_ingestion_GB × $0.50) +\n  (insights_events \u002F 100000 × $0.50) +\n  (kms_keys × $1.50) +\n  (sns_notifications \u002F 1000000 × $0.50)\n\nprojected_monthly_cost = \u003Crecompute each term after changes>\n\nmonthly_saving = current_monthly_cost - projected_monthly_cost\n```\n\nAlways state assumptions: data event volume, S3 storage size, Lake\ningestion rate, Logs ingestion rate, Insights event volume, KMS key\ncount, SNS topic count, pricing region.\n\n### Step 9: Final verdict\n\n- Any dimension recommends a change → **FURTHER_OPTIMIZATION_AVAILABLE**.\n- All dimensions pass AND org trail + curated data events + lifecycle +\n  single CMK + Lake scoped to interactive queries → **OPTIMIZED**.\n- Change applied and verified this session → **OPTIMIZED** (post-state).\n- Data insufficient (trail inventory absent, window \u003C 30 days) →\n  **NEED_MORE_INFO**.\n\nNever emit `FURTHER_OPTIMIZATION_AVAILABLE` without first discharging\nevery `NEED_MORE_INFO`\u002F`BLOCKED` gate.\n\n## Output format\n\n→ Full per-operation label contract (TARGET \u002F VERDICT \u002F REASON \u002F RECOMMENDATION \u002F ESTIMATED_SAVINGS \u002F MIGRATION_STEPS \u002F CONFIRM) — `references\u002Fcloudtrail-worked-examples.md`. The STRICT output contract below remains authoritative.\n\nFull worked examples (org-trail consolidation, data-event curation, S3\nlifecycle rollout, CloudTrail Lake scoping, already-optimized, end-to-\nend walkthrough) are in `references\u002Fcloudtrail-worked-examples.md`.\n\n## STRICT output contract\n\nThe rules below are hard constraints. Violating any one produces a\nmisclassification or an arithmetic contradiction that breaks downstream\nFinOps automation. Self-check EVERY emitted block against these rules\nbefore returning the response.\n\n### Required output structure\n\nEvery response MUST be a single block using these literal labels, in this\norder. Do NOT substitute markdown headings, camelCase, or bold variants.\n\n```text\nTARGET: \u003Ctrail-name>\nVERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE\nREASON: \u003C1-2 sentences naming the recommendation and supporting data>\nRECOMMENDATION:\n  Current: \u003Ctrail inventory + data events + storage class + Lake + Logs>\n  Proposed: \u003Cconsolidated inventory + curated events + Glacier + Lake scope>\n  Dimensions changed: \u003Cconsolidation | data_events | lifecycle | lake | logs | kms_sns_insights | athena>\n  Dimensions checked: \u003Clist ALL seven, each ✓ (no finding) or → (finding)>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Current monthly: $\u003Camount>    ← MUST show subtotals per cost term\n  Projected monthly: $\u003Camount>\n  Monthly saving: $\u003Camount>     ← MUST equal Current − Projected, 2 decimals\n  Annual saving: $\u003Camount>      ← MUST equal Monthly × 12\nMIGRATION_STEPS:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification step>\nCONFIRM: \u003Cconfirmation prompt text>\n```\n\n### FORBIDDEN output patterns\n\n1. **NEVER emit `VERDICT: FURTHER_OPTIMIZATION_AVAILABLE` with\n   `Monthly saving: $0.00`.** If every dimension nets zero cost delta,\n   the verdict MUST be `OPTIMIZED`. A cost-neutral compliance\n   improvement is surfaced in REASON, NOT as a dollar saving.\n\n2. **NEVER show savings math that does not balance.**\n   `Current monthly − Projected monthly` MUST equal `Monthly saving`,\n   rounded to 2 decimal places.\n\n3. **NEVER emit scratch lines** (\"WAIT — recompute\", \"Hmm, let me redo\",\n   \"corrected:\") in the output. Finalize the math before emitting.\n\n4. **NEVER recommend org trail consolidation without verifying the\n   account is the org management account.** Creating an org trail from\n   a member account fails. Surface this as a prerequisite.\n\n5. **NEVER omit a dimension from the RECOMMENDATION block.** The\n   `Dimensions checked` line MUST list all seven dimensions, each marked\n   ✓ (no finding) or → (finding).\n\n6. **NEVER recommend disabling log file integrity validation without\n   confirming S3 Object Lock provides equivalent tamper-evidence.**\n   Disabling validation halves digest PUT cost but loses the audit\n   attestation if Object Lock isn't enforced.\n\n7. **NEVER round intermediate formula steps differently from the final\n   figure.** Compute at full precision, round only the displayed result.\n\n### Perfect example output — FURTHER_OPTIMIZATION_AVAILABLE with verified math\n\nEvery field below is internally consistent. Copy this shape exactly.\nAdditional full worked examples (org-trail consolidation, data-event\ncuration, S3 lifecycle, CloudTrail Lake scoping, already-optimized,\nNEED_MORE_INFO) are in `references\u002Fcloudtrail-worked-examples.md`.\n\n```text\nTARGET: aws-organizational-trail\nVERDICT: FURTHER_OPTIMIZATION_AVAILABLE\nREASON: Organization trail capturing S3 data events on All Buckets\n  includes 113M events\u002Fmonth from log and CDN buckets (80% of total)\n  that have no audit value. S3 log bucket has no lifecycle policy,\n  retaining 500 GB in Standard at $0.023\u002FGB. Combined curation +\n  lifecycle drops monthly CloudTrail spend 62%.\nRECOMMENDATION:\n  Current: org trail + All-Buckets S3 data events + Standard storage + no Lake\n  Proposed: org trail + curated S3 data events (8 high-value buckets) + Glacier IR @ 90d\n  Dimensions changed: data_events (Step 2) + lifecycle (Step 3)\n  Dimensions checked: consolidation ✓  data_events → (curate)\n    lifecycle → (no policy)  lake ✓  logs ✓  kms_sns_insights ✓  athena ✓\n  Confidence: HIGH — S3 metrics confirm 113M\u002F142M events are low-value\n    bucket writes; lifecycle math is deterministic; us-east-1 pricing.\nESTIMATED_SAVINGS:\n  Current monthly: $1,847.32\n    data_events: $142.00  s3_storage: $11.50  kms_keys: $1.50\n    sns: $0.70  insights: $0  logs: $0  lake: $0  athena_scans: $1,692.62\n  Projected monthly: $697.32\n    data_events: $29.00 (curated)  s3_storage: $1.79 (Glacier IR + Deep Archive)\n    kms_keys: $1.50  sns: $0.30  insights: $0  logs: $0  lake: $0  athena: $664.73\n  Monthly saving: $1,150.00   ($1,847.32 − $697.32 = $1,150.00 ✓)\n  Annual saving: $13,800.00\nMIGRATION_STEPS:\n  1. Apply advanced event selectors with curated bucket list:\n     aws cloudtrail put-event-selectors --trail-name aws-organizational-trail \\\n       --advanced-event-selectors file:\u002F\u002Fcurated-selectors.json\n  2. Apply S3 lifecycle policy to the log bucket:\n     aws s3api put-bucket-lifecycle-configuration \\\n       --bucket org-cloudtrail-logs-us-east-1 \\\n       --lifecycle-configuration file:\u002F\u002Fcloudtrail-lifecycle.json\n  3. Verify lifecycle policy took effect (no immediate object transitions):\n     aws s3api get-bucket-lifecycle-configuration \\\n       --bucket org-cloudtrail-logs-us-east-1\n  4. After 30 days, query S3 storage metrics to confirm Intelligent\n     Tiering is taking effect.\nCONFIRM: About to put-event-selectors on aws-organizational-trail\n  (All Buckets → 8 high-value buckets) and apply S3 lifecycle to\n  org-cloudtrail-logs-us-east-1. Monthly saving $1,150.00 (62%).\n  Proceed? (yes\u002Fno)\n```\n\n**Self-check before emit:**\n- [ ] `Current monthly − Projected monthly == Monthly saving` (2 decimals)?\n- [ ] `Monthly saving × 12 == Annual saving`?\n- [ ] All seven dimensions listed in `Dimensions checked`?\n- [ ] Every `→` dimension has a corresponding MIGRATION_STEPS entry?\n- [ ] No scratch\u002Frecompute text in the block?\n\n## Verdict semantics\n\n| Verdict | When to emit |\n|---|---|\n| `FURTHER_OPTIMIZATION_AVAILABLE` | At least one dimension has a concrete, savings-bearing recommendation. |\n| `OPTIMIZED` | Either (a) all dimensions pass (org trail + curated data events + lifecycle + single CMK + Lake scoped), OR (b) a change was applied and verified this session. |\n| `NEED_MORE_INFO` | Data gate failed: trail inventory absent, Cost Explorer window \u003C 30 days, or S3 metrics unavailable. |\n| `BLOCKED` | Hard precondition prevents evaluation: trail Status != RUNNING (logging suspended), IAM denies cloudtrail:DescribeTrails. |\n\n**Zero-savings rule:** If MONTHLY_SAVING == $0.00 for every dimension,\nverdict MUST be `OPTIMIZED`, never `FURTHER_OPTIMIZATION_AVAILABLE`.\nException: a compliance improvement without cost change is surfaced in\nREASON, not as dollar savings.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER recommend org trail consolidation without verifying the\n   account is the org management account.** Member accounts cannot\n   create org trails; the API call fails.\n2. **NEVER recommend disabling management events to reduce cost.**\n   Management events are free on the first trail per region. Disabling\n   breaks audit completeness for ~zero savings.\n3. **NEVER recommend Deep Archive transition without confirming the\n   audit RTO tolerates 12-hour restore.** For incident-response use\n   cases, Glacier Instant Retrieval (ms-latency) is the right choice.\n4. **NEVER recommend curating data events without confirming the\n   bucket list is complete.** Missing a high-value bucket creates a\n   silent audit blind spot.\n5. **NEVER recommend disabling CloudWatch Logs delivery without\n   auditing for existing metric filters, alarms, or Logs Insights\n   queries on the log group.** Disabling breaks downstream monitoring.\n\nExtended anti-patterns in `references\u002Fcloudtrail-worked-examples.md`.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n→ Full checklist (confirmation gate, org-trail coverage before deletion, selector snapshot, single-prefix lifecycle test, Object Lock check, EDS export-first, KMS policy update, Insights irreversibility, 5-trail batches) — `references\u002Fdiagnostic-commands.md`.\n\n## Recent AWS features (2024-2026)\n\n→ All four updates (Lake enhancements, advanced event selectors GA, Glacier Instant Retrieval, Insights for data events) — `references\u002Fadvanced-patterns.md`.\n\n## References\n\n- `references\u002Fcloudtrail-pricing-and-inventory.md` — pricing tables,\n  trail inventory CLI, event selector syntax, KMS key policy templates,\n  S3 lifecycle JSON, Athena partition projection DDL, regional pricing\n  multipliers, cost calculation worked examples.\n- `references\u002Fcloudtrail-worked-examples.md` — org-trail consolidation,\n  data-event curation, S3 lifecycle, CloudTrail Lake scoping, already-\n  optimized, end-to-end walkthrough, extended NEVER list, edge cases.\n\n## References (load on demand)\n\n- [`references\u002Fdiagnostic-commands.md`](references\u002Fdiagnostic-commands.md) — pre-flight data-source commands; per-step apply CLI (org trail, selectors, lifecycle, EDS, Logs, Insights); pre-remediation safety checks\n- [`references\u002Fcloudtrail-worked-examples.md`](references\u002Fcloudtrail-worked-examples.md) — per-step cost math and the per-operation output format, plus the pre-existing full worked examples per dimension\n- [`references\u002Fcloudtrail-pricing-and-inventory.md`](references\u002Fcloudtrail-pricing-and-inventory.md) — pricing comparisons and selector forms, plus the pre-existing pricing tables, inventory CLI, KMS policy, lifecycle JSON, Athena DDL\n- [`references\u002Fadvanced-patterns.md`](references\u002Fadvanced-patterns.md) — Step 0 gotchas, mindset principles, Step 1 \u002F 6 \u002F 7 rationale, recent AWS features (2024-2026)\n\n## Domain\n\nAWS CloudOps \u002F Governance Audit Logging Cost Optimization & FinOps.\n\n## AWS documentation\n\n- **AWS CloudTrail User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcloudtrail-user-guide.html\n- **AWS CloudTrail pricing** — https:\u002F\u002Faws.amazon.com\u002Fcloudtrail\u002Fpricing\u002F\n- **CloudTrail organizational trails** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcreating-trail-organization.html\n- **CloudTrail event selectors** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Flogging-data-events-with-cloudtrail.html\n- **CloudTrail Lake** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Fcloudtrail-lake.html\n- **CloudTrail Insights** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fawscloudtrail\u002Flatest\u002Fuserguide\u002Flogging-insights-events-with-cloudtrail.html\n- **S3 lifecycle configuration** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fobject-lifecycle-mgmt.html\n- **Athena partition projection** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fathena\u002Flatest\u002Fug\u002Fpartition-projection.html\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},"cloudtrail, governance, cost-optimization, finops, audit-logging, organizational-trail, s3-lifecycle","3","Jacky Chan — AWS Community Builder","aws-cloudops","Governance","0.1.0","CloudTrail, trail consolidation, organization trail, cost optimization, data events, management events, S3 lifecycle, Glacier transition, CloudTrail Lake, event data store, CloudWatch Logs, SNS notification, KMS key, Insights, log file integrity, Athena partition projection, Requester Pays, FinOps, governance, audit logging","optimize","medium","false","capability","Optimising CloudTrail spend, consolidating multi-region or member trails into a single org trail, curating data event sources (S3\u002FLambda data events), tuning S3 lifecycle for log buckets, reviewing CloudTrail Lake event data store ingestion cost, disabling dual-publishing to CloudWatch Logs, consolidating KMS keys per trail, evaluating CloudTrail Insights cost, or running a governance FinOps sweep.","true","OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE","CloudTrail functional troubleshooting (use cloudtrail-missing-events-troubleshooter or cloudtrail-gap-troubleshooter), CloudTrail Lake query authoring (use cloudtrail-lake-operator), or CloudTrail alert automation (use cloudtrail-alert-automator). This skill focuses on cost-driven optimization decisions, not on whether events are missing or alerts fire.","active","Input: either (a) a CloudTrail trail name + live-account context, (b) an Organizations account list with per-trail configuration summary, OR (c) a Cost Explorer export of CloudTrail spend with at least 30 days of observation plus trail configurations. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002F ESTIMATED_SAVINGS\u002FMIGRATION_STEPS block per trail (or per account for consolidation cases), where VERDICT is one of OPTIMIZED, FURTHER_OPTIMIZATION_AVAILABLE.","# Minimal valid input (offline finding classification):\nTrailName: aws-organizational-trail\nIsOrganizationTrail: true\nIsMultiRegionTrail: true\nIncludeManagementEvents: true\nDataEventSources:\n  - S3 (all buckets) — 142,000,000 events\u002Fmonth\n  - Lambda (all functions) — 8,400,000 events\u002Fmonth\nInsightsEnabled: true (both ApiCallRateInsight and ApiCallErrorInsight)\nKMSKeyId: alias\u002Fcloudtrail-org-cmk\nCloudWatchLogsLogGroupArn: arn:aws:logs:us-east-1:111111111111:log-group:cloudtrail-org\nS3Bucket: org-cloudtrail-logs-us-east-1\nS3LifecyclePolicy: none\nRegion: us-east-1\nMonthlySpend: $1,847.32\nDataEventMonthlyVolume: 150.4M events\nEmit the standard optimization block (TARGET, VERDICT, REASON,\nRECOMMENDATION, ESTIMATED_SAVINGS, MIGRATION_STEPS).","optimise CloudTrail cost, CloudTrail trail consolidation, CloudTrail org trail vs member trail, CloudTrail data event volume, CloudTrail S3 lifecycle, CloudTrail log file Glacier transition, CloudTrail Lake event data store cost, CloudTrail CloudWatch Logs delivery cost, CloudTrail KMS key per trail, CloudTrail Insights event cost, CloudTrail log file integrity validation, CloudTrail SNS notification cost, CloudTrail organizational trail deduplication, CloudTrail Athena partition projection, CloudTrail FinOps savings, CloudTrail monthly savings estimate, reduce CloudTrail bill, governance cost review","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline recommendation classification works from pasted trail configurations and Cost Explorer exports. Live-account optimization uses aws cloudtrail describe-trails, get-event-selectors, get-insights-selectors, get-event-data-store, aws organizations describe-organization, list-accounts, aws s3api get-bucket-lifecycle-configuration, head-bucket, aws kms describe-key, get-key-rotation-status, aws ce...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fcloudtrail-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 cloudtrail-cost-optimizer",{"tool":59,"command":60},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill cloudtrail-cost-optimizer",{"tool":62,"command":63},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill cloudtrail-cost-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002FSKILL.md",true,[67,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",10026,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Feval\u002Ftest-cases.yaml",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"evals\u002Fbaselines\u002Falready-optimized-org-setup.md",856,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fbaselines\u002Falready-optimized-org-setup.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"evals\u002Fbaselines\u002Fcloudtrail-lake-scoping.md",999,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fbaselines\u002Fcloudtrail-lake-scoping.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"evals\u002Fbaselines\u002Fdata-event-volume-curation.md",1039,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fbaselines\u002Fdata-event-volume-curation.md",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"evals\u002Fbaselines\u002Forg-trail-consolidation.md",842,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fbaselines\u002Forg-trail-consolidation.md",{"path":90,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":91,"sourceHtmlUrl":92},"evals\u002Fbaselines\u002Fs3-lifecycle-glacier-transition.md",922,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fbaselines\u002Fs3-lifecycle-glacier-transition.md",{"path":94,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":95,"sourceHtmlUrl":96},"evals\u002Feval_config.yaml",1819,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Feval_config.yaml",{"path":98,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":99,"sourceHtmlUrl":100},"evals\u002Fevals.json",4682,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fevals.json",{"path":102,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":103,"sourceHtmlUrl":104},"evals\u002Fprompts\u002Falready-optimized-org-setup.md",1269,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fprompts\u002Falready-optimized-org-setup.md",{"path":106,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":107,"sourceHtmlUrl":108},"evals\u002Fprompts\u002Fcloudtrail-lake-scoping.md",782,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fprompts\u002Fcloudtrail-lake-scoping.md",{"path":110,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":111,"sourceHtmlUrl":112},"evals\u002Fprompts\u002Fdata-event-volume-curation.md",1347,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fprompts\u002Fdata-event-volume-curation.md",{"path":114,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":115,"sourceHtmlUrl":116},"evals\u002Fprompts\u002Forg-trail-consolidation.md",1602,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fprompts\u002Forg-trail-consolidation.md",{"path":118,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":119,"sourceHtmlUrl":120},"evals\u002Fprompts\u002Fs3-lifecycle-glacier-transition.md",874,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fevals\u002Fprompts\u002Fs3-lifecycle-glacier-transition.md",{"path":122,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":123,"sourceHtmlUrl":124},"examples\u002FREADME.md",9087,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fexamples\u002FREADME.md",{"path":126,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fadvanced-patterns.md",8176,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Freferences\u002Fadvanced-patterns.md",{"path":130,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Fcloudtrail-pricing-and-inventory.md",13065,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Freferences\u002Fcloudtrail-pricing-and-inventory.md",{"path":134,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Fcloudtrail-worked-examples.md",20830,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Freferences\u002Fcloudtrail-worked-examples.md",{"path":138,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":139,"sourceHtmlUrl":140},"references\u002Fdiagnostic-commands.md",3923,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Freferences\u002Fdiagnostic-commands.md",{"path":142,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":143,"sourceHtmlUrl":144},"skill.usf.yaml",4640,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fcloudtrail-cost-optimizer\u002Fskill.usf.yaml",[146,153,160,167,174,181],{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"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":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"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":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"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":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"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":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":180,"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":182,"name":183,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":185,"categories":186,"keywords":187,"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",[],[]]