[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ABVKAGC271CQCG5N00Z3TY":3,"skill-same:01M7ABVKAGC271CQCG5N00Z3TY":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":42,"commitSha":43,"skillDirectory":44,"forksCount":45,"repositoryHtmlUrl":46,"repositoryHomepageUrl":6,"ownerHtmlUrl":47,"ownerBlogUrl":6,"ownerDescription":48,"updatedAt":49,"install":50,"resources":63},"01M7ABVKAGC271CQCG5N00Z3TY","s3-lifecycle-optimizer",null,"Optimises S3 storage cost through lifecycle-policy design, storage-class selection, and access-pattern analysis. Invents the right transition and expiration rules per workload archetype (logs, compliance archive, application data, versioned buckets, multipart-upload leaks), projects monthly savings net of minimum-duration and retrieval charges, and emits a deterministic verdict (OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL) per bucket with the exact put-bucket-lifecycle-configuration payload and estimated dollar impact. Use when reviewing S3 spend, designing lifecycle policies, choosing between Standard-IA \u002F One-Zone-IA \u002F Intelligent-Tiering \u002F Glacier tiers, pruning noncurrent versions, aborting stale multipart uploads, or projecting savings from a storage-class migration.","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\u002Fs3-lifecycle-optimizer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: s3-lifecycle-optimizer\ndescription: Optimises S3 storage cost through lifecycle-policy design, storage-class selection, and access-pattern analysis. Invents the right transition and expiration rules per workload archetype (logs, compliance archive, application data, versioned buckets, multipart-upload leaks), projects monthly savings net of minimum-duration and retrieval charges, and emits a deterministic verdict (OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL) per bucket with the exact put-bucket-lifecycle-configuration payload and estimated dollar impact. Use when reviewing S3 spend, designing lifecycle policies, choosing between Standard-IA \u002F One-Zone-IA \u002F Intelligent-Tiering \u002F Glacier tiers, pruning noncurrent versions, aborting stale multipart uploads, or projecting savings from a storage-class migration.\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline configuration classification. Live-account audits use aws s3api list-buckets, aws s3api get-bucket-lifecycle-configuration, aws s3api list-objects-v2 (with --page-size for inventory), aws s3api list-multipart-uploads, aws s3api get-bucket-versioning, and aws s3control get-storage-lens-configuration (AWS CLI v2, SSO or key-based credentials). Pricing is us-east-1 published rates...\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: Storage\n  task_type: optimize\n  skill_class: capability\n  verdict_shape: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\n  when_to_use: Reviewing S3 spend, designing or auditing lifecycle policies, selecting storage classes for infrequently accessed data, projecting savings from Standard -> Standard-IA \u002F Intelligent-Tiering \u002F Glacier transitions, pruning noncurrent versions on versioned buckets, aborting stale multipart uploads, or hardening compliance archives with Object Lock.\n  activation_triggers: optimise S3 storage cost, design S3 lifecycle policy, S3 storage class analysis, move S3 data to Glacier, S3 Intelligent-Tiering vs Standard-IA, prune noncurrent S3 versions, abort stale S3 multipart uploads, S3 Object Lock retention, S3 lifecycle transition rules, S3 cost optimization review, Glacier Deep Archive lifecycle, S3 Batch Operations storage class\n  invocation_schema: 'Input: either (a) a bucket configuration (lifecycle configuration JSON, versioning status, Storage Lens metrics summary, optional object-age histogram), OR (b) a bucket name for live-account optimisation. Output: deterministic BUCKET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002FSAVINGS\u002FIMPLEMENTATION block per bucket, where VERDICT is one of OPTIMIZED, OPPORTUNITY_FOUND, ALREADY_OPTIMAL.'\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: S3, lifecycle policy, storage class, Standard-IA, One-Zone-IA, Intelligent-Tiering, Glacier Instant Retrieval, Glacier Flexible Retrieval, Glacier Deep Archive, S3 Express One Zone, directory bucket, noncurrent version, multipart upload, S3 Storage Lens, S3 Object Lock, S3 Batch Operations, S3 Tables, put-bucket-lifecycle-configuration, storage cost optimization\n  tags: s3, storage, cost-optimization, lifecycle, storage-class, glacier, intelligent-tiering, object-lock, finops\n---\n\n# S3 Lifecycle Optimizer\n\n## What this skill does\n\nTranslates S3 storage posture into a concrete lifecycle policy and a\ndollar-denominated savings estimate. The verdict is the **highest-leverage\naction** across four dimensions — storage-class mix, lifecycle transitions,\nnoncurrent-version cleanup, and multipart-upload hygiene — applied in priority\norder. Always pairs the recommendation with the exact\n`put-bucket-lifecycle-configuration` payload so the operator can paste, review,\nand apply.\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `OPPORTUNITY_FOUND` | One or more dimensions has a cost-saving or risk-reducing lifecycle change available | Emit recommended policy + savings estimate |\n| `OPTIMIZED` | A lifecycle change was applied this session and verified | Emit post-state verification and recompute savings |\n| `ALREADY_OPTIMAL` | Lifecycle policy covers all applicable dimensions; no savings available | 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. **Noncurrent version cleanup** (versioned buckets) — typically the largest\n   hidden line on long-lived buckets.\n2. **Multipart upload cleanup** — silent cost leak, free to fix.\n3. **Storage-class transitions** for current objects — the headline saving.\n4. **Expiration** for compliance or log workloads — stops the bleed at source.\n5. **Object Lock \u002F retention posture** — compliance-only, not a saving lever\n   but surfaces alongside lifecycle for archive workflows.\n\n\n→ Cost baseline table moved to [references\u002Fstorage-class-pricing-matrix.md](references\u002Fstorage-class-pricing-matrix.md) — load it before producing dollar estimates.\n\n## Decision tree for storage class selection\n\nUse this tree when Step 3 (storage-class transition design) needs a\ndefinitive pick. Read top-to-bottom; **first match wins**. Always pair the\npick with the access-pattern evidence from Storage Lens (Step 0) — a\ntree verdict without observed access data is a guess.\n\n```\nSTART: Is the object accessed daily or weekly?\n├── YES → Standard ($0.023\u002FGB-mo)\n│         No transition. Standard is cheapest for frequent access.\n└── NO → Is it accessed roughly monthly (1-3 times\u002Fmonth)?\n    ├── YES → Is avg object size >= 128 KB?\n    │   ├── YES → Standard-IA ($0.0125\u002FGB, 30-day minimum, $0.01\u002FGB retrieval)\n    │   │         Caveat: 30-day minimum-duration charge on early delete.\n    │   └── NO  → Standard (IA 128 KB minimum billable size makes IA costlier\n    │             for small objects — see Edge-case handling).\n    └── NO → Is it accessed quarterly (every ~90 days)?\n        ├── YES → Glacier Instant Retrieval ($0.004\u002FGB, 90-day min, ms retrieve)\n        │         Caveat: $0.03\u002FGB retrieval + $0.0005\u002Freq; 90-day minimum.\n        └── NO → Is it accessed yearly or less?\n            ├── YES → Is 12-hour retrieval latency acceptable?\n            │   ├── YES → Glacier Deep Archive ($0.00099\u002FGB, 180-day min)\n            │   │         Cheapest tier. Retrieval $0.02-10\u002FGB, 12h Std \u002F 48h Bulk.\n            │   └── NO  → Glacier Flexible Retrieval ($0.0036\u002FGB, 90-day min)\n            │             Hours retrieval; $0.0025-10\u002FGB tiered (Exp\u002FStd\u002FBulk).\n            └── UNKNOWN (no access data)\n                → Intelligent-Tiering ($0.023 entry, $0.0025\u002F1K monitor)\n                  ONLY if avg object size >= 128 KB AND access pattern is\n                  genuinely mixed. Otherwise Standard is cheaper\n                  (Step 3 Archetype C threshold check).\n```\n\n**Special-case branches (override the main tree):**\n\n- **Versioned bucket + noncurrent versions:** always add\n  `NoncurrentVersionExpiration` regardless of the current-object pick. The\n  tree answers the *current* tier; noncurrent cleanup is a parallel dimension\n  (Step 1).\n- **Object Lock COMPLIANCE mode:** the retention period overrides any\n  `ExpirationInDays`. Run the tree on the post-retention state, not on\n  creation date.\n- **Directory bucket (S3 Express One Zone, name suffix `--x-s3`):** lifecycle\n  and Glacier tiers are NOT supported. Verdict is ALREADY_OPTIMAL for ML\u002FAI\n  latency-critical workloads. Do not run the tree.\n- **S3 Tables (Apache Iceberg) data:** table lifecycle is managed via table\n  APIs, not S3 lifecycle. Surface as a finding only; do not run the tree.\n- **Cross-Region Replication destination:** destination defaults to Standard\n  unless the replication rule sets `StorageClass`. Run the tree independently\n  on source AND destination — lifecycle does not propagate across the\n  replication boundary.\n- **Re-creatable, single-AZ-tolerant data (e.g., regenerated backups):**\n  One-Zone-IA ($0.01\u002FGB) is 20% cheaper than Standard-IA but loses the\n  multi-AZ durability guarantee. Only use when data loss in one AZ is\n  recoverable from source.\n\n## Mindset\n\n→ Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — the four S3 realities behind the verdict rule.\n## Pre-flight: bucket metadata gate\n\nRun before classification. Misclassifying these produces false positives.\n\n\n→ Pagination guidance and the 6-command live-account pre-flight listing moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md); the attribute table below is the gate itself.\n\n**Malformed input:** if the input JSON is invalid or missing required fields,\nemit `VERDICT: ERROR` with `REASON: Bucket configuration is not valid JSON or\nis missing required fields — cannot classify.` and `REMEDIATION: Re-fetch with\naws s3api get-bucket-lifecycle-configuration --bucket \u003Cname> --output json and\nre-audit.`\n\n| Bucket attribute | Effect on audit |\n|---|---|\n| Versioning `Enabled` | Run noncurrent-version dimension. |\n| Versioning `Suspended` | New versions still created with null version-id; existing noncurrent versions still bill. Run dimension. |\n| Versioning never enabled | Skip noncurrent dimension. |\n| Object Lock `Enabled` | Lifecycle MUST NOT expire objects before retention expiry. Validate per-rule. |\n| Object Lock `Governance` mode | Retention can be bypassed with `s3:BypassGovernanceRetention`. Note alongside lifecycle. |\n| Bucket has `Intelligent-Tiering` S3 Lifecycle rule already | Compare actual tier distribution from Storage Lens before re-recommending. |\n| Bucket is a **directory bucket** (S3 Express One Zone, name suffix `--x-s3`) | Lifecycle and Object Lock are NOT supported on directory buckets. Skip the policy dimensions; verdict is ALREADY_OPTIMAL for latency-critical ML\u002FAI workloads. |\n| Bucket is a **general-access bucket with S3 Tables** (Apache Iceberg) | Tables have their own lifecycle; do not propose `Expiration` on table data — surface as a finding only. |\n| Requester-pays bucket | Transitions still bill the bucket owner; retrieval bills the requester. Note in savings estimate. |\n\n## Process — optimisation logic (apply in order, aggregate all applicable)\n\n### Step 0: Expert knowledge — non-obvious S3 lifecycle behaviors\n\n→ Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — non-obvious lifecycle behaviors deep dive.\n### Step 1: Noncurrent version cleanup (versioned buckets)\n\nIf the bucket has versioning `Enabled` or `Suspended`:\n\n→ Rule templates and savings detail moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n\nIf versioning is `Enabled` and no `NoncurrentVersionExpiration` rule exists:\n**OPPORTUNITY_FOUND** on this dimension.\n\n### Step 2: Multipart upload cleanup\n\n- **Pull pending multipart uploads:** `aws s3api list-multipart-uploads --bucket \u003Cname>`.\n  Any upload with `Initiated` > 7 days ago is a leak.\n\n→ Abort-rule JSON moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n\nIf any multipart upload is >7 days old OR no abort rule exists:\n**OPPORTUNITY_FOUND** on this dimension.\n\n### Step 3: Storage-class transition design (current objects)\n\nApply per workload archetype. Pick the pattern by access pattern, not by\ndata type.\n\n\n→ The four archetype JSON templates moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md); the pattern lines below carry every branch decision.\n**Archetype A — Logs and temporary data (high write, low read after 30 days):**\nPattern: Standard -> 30d IA -> 90d Glacier IR -> 180d Glacier -> 365d Expire.\n\n**Archetype B — Compliance archives (write-once, read-rarely, 7-year retention):**\nPattern: Standard -> 90d Deep Archive -> Expire at retention horizon (e.g., 2555 days for 7 years).\n\n**Archetype C — Application data with unknown \u002F mixed access patterns:**\nPattern: Standard -> Intelligent-Tiering (let AWS manage transitions).\n**Threshold check:** only recommend Intelligent-Tiering when average object\nsize > 128 KB AND access pattern is genuinely mixed. For small objects, the\n$0.0025\u002F1,000 monitoring fee exceeds the saving.\n\n**Archetype D — Backup \u002F DR target (write-nightly, read-never unless disaster):**\nPattern: Standard -> 30d Glacier IR (quarterly DR test) -> 90d Glacier.\n\n**Archetype E — ML\u002FAI training corpus (frequent random access during training,\nthen cold):**\n- Use **S3 Express One Zone directory bucket** ($0.16\u002FGB) for the active\n  training set — ms-latency matters more than $\u002FGB.\n- After training, copy the corpus to a general-access bucket and apply Archetype A\n  or B. Directory buckets do not support lifecycle transitions out.\n\n**Net saving calculation per archetype:**\n- `current_monthly = current_GB × current_storage_class_rate`\n- `projected_monthly = sum(tier_GB × tier_rate) + min_duration_charge`\n- `monthly_saving = current_monthly - projected_monthly`\n- Surface `monthly_saving` AND `annual_saving` in the output.\n\nIf no transition rule exists AND current objects are >30 days old on average:\n**OPPORTUNITY_FOUND** on this dimension.\n\n### Step 4: Expiration for compliance or log workloads\n\n- **Logs:** expire after the operational lookup window (typically 90-365 days).\n- **Compliance:** expire at the regulatory minimum (e.g., 2555 days for 7-year\n  retention). Never expire before the regulatory minimum — that creates a\n  compliance violation.\n- **Temp \u002F scratch:** expire aggressively (1-7 days).\n\nIf the bucket has no `Expiration` rule and the workload archetype calls for one:\n**OPPORTUNITY_FOUND** on this dimension.\n\n### Step 5: Object Lock \u002F retention posture\n\n- **If Object Lock is not enabled and the workload is compliance-archive:**\n  recommend enabling with `COMPLIANCE` mode and the regulatory retention period.\n- **If Object Lock is in `GOVERNANCE` mode for compliance data:** surface that\n  governance mode can be bypassed by any principal with\n  `s3:BypassGovernanceRetention` — recommend `COMPLIANCE` mode.\n- **If Object Lock is enabled and lifecycle expiration is shorter than the\n  retention period:** surface as a CONFIG finding — the rule is silently a no-op\n  on locked objects.\n\nThis dimension surfaces findings but does not change the verdict unless the\nlifecycle rule itself is misconfigured against the retention period.\n\n### Step 6: Aggregation — emit the highest-leverage recommendation\n\nAggregate ALL applicable dimensions into a single recommended lifecycle\nconfiguration. The verdict is `OPPORTUNITY_FOUND` if any dimension has a saving\nor risk-reducing change. The recommendation includes the full\n`put-bucket-lifecycle-configuration` payload combining all rules.\n\nIf no dimension has an opportunity (lifecycle covers all applicable rules\ncorrectly, no leaks, no misconfigurations): **ALREADY_OPTIMAL**.\n\nIf the recommendation was applied this session and verified:\n**OPTIMIZED**.\n\n## Output format (per bucket)\n\n```text\nBUCKET: \u003Cbucket-name>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences citing the highest-leverage dimension and step number>\nRECOMMENDATION:\n  \u003Clifecycle configuration JSON or \"No changes required\">\nSAVINGS:\n  CURRENT_MONTHLY: $\u003CX.XX>\n  PROJECTED_MONTHLY: $\u003CY.YY>\n  MONTHLY_SAVING: $\u003CX.XX - Y.YY>\n  ANNUAL_SAVING: $\u003C12 × monthly>\n  CAVEATS: \u003Cminimum-duration charges, retrieval fee warnings, monitoring fees>\nIMPLEMENTATION:\n  1. aws s3api put-bucket-lifecycle-configuration --bucket \u003Cname> --lifecycle-configuration file:\u002F\u002Flifecycle.json\n  2. \u003Cverification command>\n  3. \u003Cbackfill via S3 Batch Operations if existing objects need immediate transition>\n```\n\n### Worked example — logs bucket with no lifecycle\n\n```text\nBUCKET: app-logs-prod\nVERDICT: OPPORTUNITY_FOUND\nREASON: Bucket is versioned with 12 TB of noncurrent bytes (62% of total) and\nno lifecycle policy (Step 1, Step 3, Step 4). All 19.4 TB sit in Standard at\n$0.023\u002FGB-mo. Recommended pattern: logs-lifecycle (Archetype A) +\nnoncurrent cleanup + multipart abort.\nRECOMMENDATION:\n  {\n    \"Rules\": [\n      {\n        \"ID\": \"logs-lifecycle\",\n        \"Status\": \"Enabled\",\n        \"Filter\": { \"Prefix\": \"logs\u002F\" },\n        \"Transitions\": [\n          { \"Days\": 30, \"StorageClass\": \"STANDARD_IA\" },\n          { \"Days\": 90, \"StorageClass\": \"GLACIER_IR\" },\n          { \"Days\": 180, \"StorageClass\": \"GLACIER\" }\n        ],\n        \"Expiration\": { \"Days\": 365 }\n      },\n      {\n        \"ID\": \"noncurrent-version-cleanup\",\n        \"Status\": \"Enabled\",\n        \"Filter\": {},\n        \"NoncurrentVersionTransitions\": [\n          { \"NoncurrentDays\": 30, \"NewNoncurrentStorageClass\": \"STANDARD_IA\" },\n          { \"NoncurrentDays\": 90, \"NewNoncurrentStorageClass\": \"GLACIER_IR\" }\n        ],\n        \"NoncurrentVersionExpiration\": { \"NoncurrentDays\": 180 }\n      },\n      {\n        \"ID\": \"abort-incomplete-multipart-uploads\",\n        \"Status\": \"Enabled\",\n        \"Filter\": {},\n        \"AbortIncompleteMultipartUpload\": { \"DaysAfterInitiation\": 7 }\n      }\n    ]\n  }\nSAVINGS:\n  CURRENT_MONTHLY: $446.20  (19,400 GB × $0.023)\n  PROJECTED_MONTHLY: $139.96\n    - 2,400 GB current at Standard (\u003C 30d) × $0.023 = $55.20\n    - 1,400 GB current at Standard-IA (30-90d) × $0.0125 = $17.50\n    - 2,000 GB current at Glacier IR (90-180d) × $0.004 = $8.00\n    - 1,600 GB current at Glacier (180-365d) × $0.0036 = $5.76\n    - 3,000 GB noncurrent at Standard-IA (30-90d) × $0.0125 = $37.50\n    - 4,000 GB noncurrent at Glacier IR (90-180d) × $0.004 = $16.00\n    - 5,000 GB noncurrent expired (> 180d) = $0.00\n    - Arithmetic check: 55.20 + 17.50 + 8.00 + 5.76 + 37.50 + 16.00 = $139.96\n  MONTHLY_SAVING: $306.24  ($446.20 − $139.96)\n  ANNUAL_SAVING: $3,674.88\n  CAVEATS:\n    - Standard-IA 30-day minimum: objects deleted before day 30 still bill.\n    - Glacier IR 90-day minimum applies.\n    - Glacier IR retrieval is $0.03\u002FGB if logs are queried — budget separately.\nIMPLEMENTATION:\n  1. CONFIRM: About to put-bucket-lifecycle-configuration on bucket\n     app-logs-prod in account \u003Cacct> region us-east-1. This enables 3 rules\n     (logs-lifecycle, noncurrent-cleanup, multipart-abort). Proceed? (yes\u002Fno)\n  2. aws s3api put-bucket-lifecycle-configuration --bucket app-logs-prod \\\n       --lifecycle-configuration file:\u002F\u002Flifecycle.json\n  3. Verify: aws s3api get-bucket-lifecycle-configuration --bucket app-logs-prod\n  4. Backfill existing Standard objects older than 30 days via S3 Batch\n     Operations (lifecycle only transitions new objects going forward):\n     aws s3control create-job --account-id \u003Cacct> \\\n       --operation '{\"S3CopyObject\": {\"TargetStorageClass\": \"STANDARD_IA\"}}' \\\n       --manifest-location \u003Cmanifest-bucket> \\\n       --report-spec '\u003Creport-config>'\n```\n\n### Worked example — already optimal compliance bucket\n\n→ Secondary example moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\n### Worked example — Intelligent-Tiering trap (small objects, proposed plan rejected)\n\n→ Secondary example moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\n## Worked example: end-to-end audit of a 5 TB mixed-workload bucket\n\n→ End-to-end audit walkthrough moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\n## Verdict consistency rules (prevent misclassification)\n\nThe skill MUST emit verdicts that are mathematically and logically\nself-consistent. The following rules are mandatory checks before any\noutput is finalized:\n\n1. **Zero-savings rule.** If `MONTHLY_SAVING == $0.00` for every\n   dimension, the verdict MUST be `ALREADY_OPTIMAL`, never\n   `OPPORTUNITY_FOUND`. A finding with \"OPPORTUNITY_FOUND\" and\n   \"$0.00 monthly saving\" in the same output block is a contradiction\n   and a hard error.\n\n2. **Negative-savings rule.** If the projected monthly cost is HIGHER\n   than current (e.g., Intelligent-Tiering monitoring fee exceeds the\n   transition saving, or minimum-duration charges net out negative),\n   the verdict for that dimension is \"no action\" and MUST NOT be\n   aggregated into `OPPORTUNITY_FOUND`. Either pick a different\n   storage class or emit `ALREADY_OPTIMAL` with the reasoning that the\n   current tier is already cheapest.\n\n3. **OPPORTUNITY_FOUND requires a non-zero savings line.** When emitting\n   `OPPORTUNITY_FOUND`, the SAVINGS block must show a positive\n   `MONTHLY_SAVING` for at least one dimension. If no dimension has\n   positive savings, downgrade to `ALREADY_OPTIMAL`.\n\n4. **SAVINGS arithmetic check.** `CURRENT_MONTHLY − PROJECTED_MONTHLY`\n   MUST equal `MONTHLY_SAVING`. If the three numbers don't reconcile,\n   re-compute before emitting. Round to 2 decimal places.\n\n5. **Dimension coverage rule.** For a versioned bucket,\n   `OPPORTUNITY_FOUND` MUST include either a `NoncurrentVersionExpiration`\n   rule OR a documented reason why one is not applicable (e.g., \"Object\n   Lock COMPLIANCE mode requires version retention\"). An\n   `OPPORTUNITY_FOUND` on a versioned bucket with only `Expiration`\n   (current-version) rules is incomplete — it leaves noncurrent bytes\n   accumulating indefinitely.\n\n6. **Storage-class transition must include retrieval caveats.** Any\n   transition to a Glacier tier MUST include the retrieval cost and\n   latency in `CAVEATS`. A bare `Transitions` rule without retrieval\n   cost disclosure is non-compliant.\n\n7. **Intelligent-Tiering object-size gate.** Recommending Intelligent-\n   Tiering on a bucket where the average object size \u003C 128 KB MUST\n   surface the monitoring-fee calculation and confirm it does not\n   exceed the transition saving.\n\n8. **Filter-prefix reality check.** Before emitting `OPPORTUNITY_FOUND`\n   on a transition rule, verify the proposed `Filter.Prefix` matches\n   actual key prefixes in Storage Lens or `list-objects-v2 --prefix`.\n   A rule with a non-matching prefix is silently a no-op.\n\nThese rules are evaluated AFTER Step 6 aggregation but BEFORE emitting\nthe output block. If any rule fails, re-run the relevant step.\n\n## Error handling — CLI and data-source failures\n\n→ Error-handling deep dive and failure-mode tables moved to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\n## Rollback procedure (beyond JSON backup)\n\n→ Moved to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\n## Cross-region cost variance detail\n\n→ Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n## Anti-Patterns — NEVER\n\n- NEVER recommend a transition to Standard-IA or One-Zone-IA for objects\n  smaller than 128 KB. The minimum billable size makes IA MORE expensive than\n  Standard. Always check average object size from Storage Lens before\n  recommending IA tiers.\n\n- NEVER recommend a storage-class transition without modeling minimum-duration\n  charges. An object moved to Standard-IA on day 5 and deleted on day 6 bills\n  30 days of IA charges — net more expensive than Standard. Surface\n  `CAVEATS: 30-day minimum-duration charge applies` on every IA recommendation.\n\n- NEVER propose `ExpirationInDays` on a versioned bucket without a\n  corresponding `NoncurrentVersionExpiration` rule. Expiration on the current\n  version creates a new noncurrent version — without cleanup, the bucket grows\n  instead of shrinks. This is the single most common lifecycle misconfiguration.\n\n- NEVER recommend Glacier Flexible Retrieval or Deep Archive for objects that\n  are accessed more than once per quarter. Retrieval fees ($2.50-30\u002FTB) wipe\n  out the storage saving in a single retrieval. Glacier is for archive only.\n\n- NEVER recommend Intelligent-Tiering on a bucket of millions of small objects\n  without surfacing the monitoring fee. At $0.0025\u002F1,000 objects, a bucket of\n  10M small JSON files costs $25\u002Fmonth in monitoring alone — often more than\n  the transition saving.\n\n- NEVER enable Object Lock in COMPLIANCE mode without confirming the retention\n  period with the operator. COMPLIANCE mode retention CANNOT be shortened or\n  bypassed, even by root. A wrong retention period is a permanent lock.\n\n- NEVER propose lifecycle transitions on a directory bucket (S3 Express One\n  Zone). Directory buckets do not support lifecycle, Object Lock, or Glacier\n  tiers. Surface the cost-per-GB ($0.16) as a finding; the verdict for a\n  directory bucket is ALREADY_OPTIMAL for latency-critical ML\u002FAI workloads.\n\n- NEVER propose `Expiration` rules on S3 Tables data prefixes. Apache Iceberg\n  tables manage their own lifecycle via table APIs. Surface as a finding only.\n\n- NEVER assume `lifecycle-configuration` returns an empty object when no rules\n  exist. It returns a 404 `NoSuchLifecycleConfiguration` error — handle\n  gracefully and proceed with the recommendation.\n\n- NEVER auto-apply `put-bucket-lifecycle-configuration` without the CONFIRM\n  gate. A wrong prefix or filter can mass-transition or mass-delete objects.\n  Always emit `CONFIRM: About to \u003Caction>...` and wait for explicit operator\n  approval.\n\n- NEVER trust a single Storage Lens snapshot. Lifecycle recommendations should\n  use at least 30 days of Storage Lens data to capture the access-pattern trend.\n  A 1-day snapshot can misclassify a daily-access bucket as cold.\n\n- NEVER recommend deleting noncurrent versions without confirming the workload\n  can tolerate loss of version history. Some compliance frameworks require\n  version retention — surface Object Lock as the parallel control.\n\n- NEVER assume Cross-Region Replication (CRR) preserves the SOURCE storage\n  class. CRR defaults to copying objects in the **destination bucket's\n  default storage class** (Standard unless the replication rule overrides\n  it). A common anti-pattern: source bucket transitions to Glacier Deep\n  Archive, but the CRR destination remains in Standard indefinitely —\n  doubling the storage bill instead of halving it. **Why this happens:**\n  replication rules are independent of lifecycle rules; lifecycle does not\n  propagate across the replication boundary. Always design source AND\n  destination lifecycle rules in tandem, OR explicitly set\n  `ExistingObjectReplication: false` and `StorageClass` on the replication\n  rule to match the source tier.\n\n- NEVER emit `OPPORTUNITY_FOUND` on a bucket where the projected monthly\n  cost equals or exceeds the current monthly cost. The verdict requires\n  a positive net saving — minimum-duration charges, Intelligent-Tiering\n  monitoring fees, and request fees on bulk transitions can net out\n  negative. If the math shows $0 or negative saving, the verdict is\n  `ALREADY_OPTIMAL` for that dimension, not `OPPORTUNITY_FOUND`.\n\n- NEVER recommend a lifecycle transition on a bucket without first\n  confirming the average object size from Storage Lens. A bucket of\n  millions of \u003C 128 KB objects costs MORE in any IA tier than in Standard,\n  due to the 128 KB minimum billable size. Surface the object-size\n  distribution as the gating check before any transition recommendation.\n\n- NEVER conflate `ExpirationInDays` (current version) with\n  `NoncurrentVersionExpiration.NoncurrentDays` (prior versions). The two\n  are independent — a rule that expires the current version creates a\n  new noncurrent version on a versioned bucket, INCREASING storage if no\n  parallel noncurrent rule exists. This is the single most common\n  lifecycle misconfiguration in production S3 environments.\n\n## Edge-case handling\n\n→ Edge-case catalog moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n## Pre-flight safety checks (run before any remediation CLI)\n\n→ Command listing moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\n## Recent AWS features (2024-2026)\n\n→ Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n## References (load on demand)\n\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step 0 expert knowledge, step rule templates (Steps 1-3 JSON), cross-region variance, edge cases, recent AWS features, AWS documentation links.\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — secondary worked examples (already-optimal, IT trap, 5 TB end-to-end audit).\n- [references\u002Ferror-handling.md](references\u002Ferror-handling.md) — error handling for CLI\u002Fdata-source failures + rollback procedure.\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — pre-flight gate commands + pre-remediation safety checks.\n- [references\u002Fstorage-class-pricing-matrix.md](references\u002Fstorage-class-pricing-matrix.md) — pre-existing; extended with the cost baseline table — load before dollar estimates.\n\n## Domain\n\nAWS CloudOps \u002F S3 Storage Cost Optimisation & Lifecycle Design.\n\n## AWS documentation\n\n→ Link list moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n","# S3 Lifecycle Optimizer\n\n## What this skill does\n\nTranslates S3 storage posture into a concrete lifecycle policy and a\ndollar-denominated savings estimate. The verdict is the **highest-leverage\naction** across four dimensions — storage-class mix, lifecycle transitions,\nnoncurrent-version cleanup, and multipart-upload hygiene — applied in priority\norder. Always pairs the recommendation with the exact\n`put-bucket-lifecycle-configuration` payload so the operator can paste, review,\nand apply.\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `OPPORTUNITY_FOUND` | One or more dimensions has a cost-saving or risk-reducing lifecycle change available | Emit recommended policy + savings estimate |\n| `OPTIMIZED` | A lifecycle change was applied this session and verified | Emit post-state verification and recompute savings |\n| `ALREADY_OPTIMAL` | Lifecycle policy covers all applicable dimensions; no savings available | 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. **Noncurrent version cleanup** (versioned buckets) — typically the largest\n   hidden line on long-lived buckets.\n2. **Multipart upload cleanup** — silent cost leak, free to fix.\n3. **Storage-class transitions** for current objects — the headline saving.\n4. **Expiration** for compliance or log workloads — stops the bleed at source.\n5. **Object Lock \u002F retention posture** — compliance-only, not a saving lever\n   but surfaces alongside lifecycle for archive workflows.\n\n\n→ Cost baseline table moved to [references\u002Fstorage-class-pricing-matrix.md](references\u002Fstorage-class-pricing-matrix.md) — load it before producing dollar estimates.\n\n## Decision tree for storage class selection\n\nUse this tree when Step 3 (storage-class transition design) needs a\ndefinitive pick. Read top-to-bottom; **first match wins**. Always pair the\npick with the access-pattern evidence from Storage Lens (Step 0) — a\ntree verdict without observed access data is a guess.\n\n```\nSTART: Is the object accessed daily or weekly?\n├── YES → Standard ($0.023\u002FGB-mo)\n│         No transition. Standard is cheapest for frequent access.\n└── NO → Is it accessed roughly monthly (1-3 times\u002Fmonth)?\n    ├── YES → Is avg object size >= 128 KB?\n    │   ├── YES → Standard-IA ($0.0125\u002FGB, 30-day minimum, $0.01\u002FGB retrieval)\n    │   │         Caveat: 30-day minimum-duration charge on early delete.\n    │   └── NO  → Standard (IA 128 KB minimum billable size makes IA costlier\n    │             for small objects — see Edge-case handling).\n    └── NO → Is it accessed quarterly (every ~90 days)?\n        ├── YES → Glacier Instant Retrieval ($0.004\u002FGB, 90-day min, ms retrieve)\n        │         Caveat: $0.03\u002FGB retrieval + $0.0005\u002Freq; 90-day minimum.\n        └── NO → Is it accessed yearly or less?\n            ├── YES → Is 12-hour retrieval latency acceptable?\n            │   ├── YES → Glacier Deep Archive ($0.00099\u002FGB, 180-day min)\n            │   │         Cheapest tier. Retrieval $0.02-10\u002FGB, 12h Std \u002F 48h Bulk.\n            │   └── NO  → Glacier Flexible Retrieval ($0.0036\u002FGB, 90-day min)\n            │             Hours retrieval; $0.0025-10\u002FGB tiered (Exp\u002FStd\u002FBulk).\n            └── UNKNOWN (no access data)\n                → Intelligent-Tiering ($0.023 entry, $0.0025\u002F1K monitor)\n                  ONLY if avg object size >= 128 KB AND access pattern is\n                  genuinely mixed. Otherwise Standard is cheaper\n                  (Step 3 Archetype C threshold check).\n```\n\n**Special-case branches (override the main tree):**\n\n- **Versioned bucket + noncurrent versions:** always add\n  `NoncurrentVersionExpiration` regardless of the current-object pick. The\n  tree answers the *current* tier; noncurrent cleanup is a parallel dimension\n  (Step 1).\n- **Object Lock COMPLIANCE mode:** the retention period overrides any\n  `ExpirationInDays`. Run the tree on the post-retention state, not on\n  creation date.\n- **Directory bucket (S3 Express One Zone, name suffix `--x-s3`):** lifecycle\n  and Glacier tiers are NOT supported. Verdict is ALREADY_OPTIMAL for ML\u002FAI\n  latency-critical workloads. Do not run the tree.\n- **S3 Tables (Apache Iceberg) data:** table lifecycle is managed via table\n  APIs, not S3 lifecycle. Surface as a finding only; do not run the tree.\n- **Cross-Region Replication destination:** destination defaults to Standard\n  unless the replication rule sets `StorageClass`. Run the tree independently\n  on source AND destination — lifecycle does not propagate across the\n  replication boundary.\n- **Re-creatable, single-AZ-tolerant data (e.g., regenerated backups):**\n  One-Zone-IA ($0.01\u002FGB) is 20% cheaper than Standard-IA but loses the\n  multi-AZ durability guarantee. Only use when data loss in one AZ is\n  recoverable from source.\n\n## Mindset\n\n→ Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — the four S3 realities behind the verdict rule.\n## Pre-flight: bucket metadata gate\n\nRun before classification. Misclassifying these produces false positives.\n\n\n→ Pagination guidance and the 6-command live-account pre-flight listing moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md); the attribute table below is the gate itself.\n\n**Malformed input:** if the input JSON is invalid or missing required fields,\nemit `VERDICT: ERROR` with `REASON: Bucket configuration is not valid JSON or\nis missing required fields — cannot classify.` and `REMEDIATION: Re-fetch with\naws s3api get-bucket-lifecycle-configuration --bucket \u003Cname> --output json and\nre-audit.`\n\n| Bucket attribute | Effect on audit |\n|---|---|\n| Versioning `Enabled` | Run noncurrent-version dimension. |\n| Versioning `Suspended` | New versions still created with null version-id; existing noncurrent versions still bill. Run dimension. |\n| Versioning never enabled | Skip noncurrent dimension. |\n| Object Lock `Enabled` | Lifecycle MUST NOT expire objects before retention expiry. Validate per-rule. |\n| Object Lock `Governance` mode | Retention can be bypassed with `s3:BypassGovernanceRetention`. Note alongside lifecycle. |\n| Bucket has `Intelligent-Tiering` S3 Lifecycle rule already | Compare actual tier distribution from Storage Lens before re-recommending. |\n| Bucket is a **directory bucket** (S3 Express One Zone, name suffix `--x-s3`) | Lifecycle and Object Lock are NOT supported on directory buckets. Skip the policy dimensions; verdict is ALREADY_OPTIMAL for latency-critical ML\u002FAI workloads. |\n| Bucket is a **general-access bucket with S3 Tables** (Apache Iceberg) | Tables have their own lifecycle; do not propose `Expiration` on table data — surface as a finding only. |\n| Requester-pays bucket | Transitions still bill the bucket owner; retrieval bills the requester. Note in savings estimate. |\n\n## Process — optimisation logic (apply in order, aggregate all applicable)\n\n### Step 0: Expert knowledge — non-obvious S3 lifecycle behaviors\n\n→ Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — non-obvious lifecycle behaviors deep dive.\n### Step 1: Noncurrent version cleanup (versioned buckets)\n\nIf the bucket has versioning `Enabled` or `Suspended`:\n\n→ Rule templates and savings detail moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n\nIf versioning is `Enabled` and no `NoncurrentVersionExpiration` rule exists:\n**OPPORTUNITY_FOUND** on this dimension.\n\n### Step 2: Multipart upload cleanup\n\n- **Pull pending multipart uploads:** `aws s3api list-multipart-uploads --bucket \u003Cname>`.\n  Any upload with `Initiated` > 7 days ago is a leak.\n\n→ Abort-rule JSON moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n\nIf any multipart upload is >7 days old OR no abort rule exists:\n**OPPORTUNITY_FOUND** on this dimension.\n\n### Step 3: Storage-class transition design (current objects)\n\nApply per workload archetype. Pick the pattern by access pattern, not by\ndata type.\n\n\n→ The four archetype JSON templates moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md); the pattern lines below carry every branch decision.\n**Archetype A — Logs and temporary data (high write, low read after 30 days):**\nPattern: Standard -> 30d IA -> 90d Glacier IR -> 180d Glacier -> 365d Expire.\n\n**Archetype B — Compliance archives (write-once, read-rarely, 7-year retention):**\nPattern: Standard -> 90d Deep Archive -> Expire at retention horizon (e.g., 2555 days for 7 years).\n\n**Archetype C — Application data with unknown \u002F mixed access patterns:**\nPattern: Standard -> Intelligent-Tiering (let AWS manage transitions).\n**Threshold check:** only recommend Intelligent-Tiering when average object\nsize > 128 KB AND access pattern is genuinely mixed. For small objects, the\n$0.0025\u002F1,000 monitoring fee exceeds the saving.\n\n**Archetype D — Backup \u002F DR target (write-nightly, read-never unless disaster):**\nPattern: Standard -> 30d Glacier IR (quarterly DR test) -> 90d Glacier.\n\n**Archetype E — ML\u002FAI training corpus (frequent random access during training,\nthen cold):**\n- Use **S3 Express One Zone directory bucket** ($0.16\u002FGB) for the active\n  training set — ms-latency matters more than $\u002FGB.\n- After training, copy the corpus to a general-access bucket and apply Archetype A\n  or B. Directory buckets do not support lifecycle transitions out.\n\n**Net saving calculation per archetype:**\n- `current_monthly = current_GB × current_storage_class_rate`\n- `projected_monthly = sum(tier_GB × tier_rate) + min_duration_charge`\n- `monthly_saving = current_monthly - projected_monthly`\n- Surface `monthly_saving` AND `annual_saving` in the output.\n\nIf no transition rule exists AND current objects are >30 days old on average:\n**OPPORTUNITY_FOUND** on this dimension.\n\n### Step 4: Expiration for compliance or log workloads\n\n- **Logs:** expire after the operational lookup window (typically 90-365 days).\n- **Compliance:** expire at the regulatory minimum (e.g., 2555 days for 7-year\n  retention). Never expire before the regulatory minimum — that creates a\n  compliance violation.\n- **Temp \u002F scratch:** expire aggressively (1-7 days).\n\nIf the bucket has no `Expiration` rule and the workload archetype calls for one:\n**OPPORTUNITY_FOUND** on this dimension.\n\n### Step 5: Object Lock \u002F retention posture\n\n- **If Object Lock is not enabled and the workload is compliance-archive:**\n  recommend enabling with `COMPLIANCE` mode and the regulatory retention period.\n- **If Object Lock is in `GOVERNANCE` mode for compliance data:** surface that\n  governance mode can be bypassed by any principal with\n  `s3:BypassGovernanceRetention` — recommend `COMPLIANCE` mode.\n- **If Object Lock is enabled and lifecycle expiration is shorter than the\n  retention period:** surface as a CONFIG finding — the rule is silently a no-op\n  on locked objects.\n\nThis dimension surfaces findings but does not change the verdict unless the\nlifecycle rule itself is misconfigured against the retention period.\n\n### Step 6: Aggregation — emit the highest-leverage recommendation\n\nAggregate ALL applicable dimensions into a single recommended lifecycle\nconfiguration. The verdict is `OPPORTUNITY_FOUND` if any dimension has a saving\nor risk-reducing change. The recommendation includes the full\n`put-bucket-lifecycle-configuration` payload combining all rules.\n\nIf no dimension has an opportunity (lifecycle covers all applicable rules\ncorrectly, no leaks, no misconfigurations): **ALREADY_OPTIMAL**.\n\nIf the recommendation was applied this session and verified:\n**OPTIMIZED**.\n\n## Output format (per bucket)\n\n```text\nBUCKET: \u003Cbucket-name>\nVERDICT: OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL\nREASON: \u003C1-2 sentences citing the highest-leverage dimension and step number>\nRECOMMENDATION:\n  \u003Clifecycle configuration JSON or \"No changes required\">\nSAVINGS:\n  CURRENT_MONTHLY: $\u003CX.XX>\n  PROJECTED_MONTHLY: $\u003CY.YY>\n  MONTHLY_SAVING: $\u003CX.XX - Y.YY>\n  ANNUAL_SAVING: $\u003C12 × monthly>\n  CAVEATS: \u003Cminimum-duration charges, retrieval fee warnings, monitoring fees>\nIMPLEMENTATION:\n  1. aws s3api put-bucket-lifecycle-configuration --bucket \u003Cname> --lifecycle-configuration file:\u002F\u002Flifecycle.json\n  2. \u003Cverification command>\n  3. \u003Cbackfill via S3 Batch Operations if existing objects need immediate transition>\n```\n\n### Worked example — logs bucket with no lifecycle\n\n```text\nBUCKET: app-logs-prod\nVERDICT: OPPORTUNITY_FOUND\nREASON: Bucket is versioned with 12 TB of noncurrent bytes (62% of total) and\nno lifecycle policy (Step 1, Step 3, Step 4). All 19.4 TB sit in Standard at\n$0.023\u002FGB-mo. Recommended pattern: logs-lifecycle (Archetype A) +\nnoncurrent cleanup + multipart abort.\nRECOMMENDATION:\n  {\n    \"Rules\": [\n      {\n        \"ID\": \"logs-lifecycle\",\n        \"Status\": \"Enabled\",\n        \"Filter\": { \"Prefix\": \"logs\u002F\" },\n        \"Transitions\": [\n          { \"Days\": 30, \"StorageClass\": \"STANDARD_IA\" },\n          { \"Days\": 90, \"StorageClass\": \"GLACIER_IR\" },\n          { \"Days\": 180, \"StorageClass\": \"GLACIER\" }\n        ],\n        \"Expiration\": { \"Days\": 365 }\n      },\n      {\n        \"ID\": \"noncurrent-version-cleanup\",\n        \"Status\": \"Enabled\",\n        \"Filter\": {},\n        \"NoncurrentVersionTransitions\": [\n          { \"NoncurrentDays\": 30, \"NewNoncurrentStorageClass\": \"STANDARD_IA\" },\n          { \"NoncurrentDays\": 90, \"NewNoncurrentStorageClass\": \"GLACIER_IR\" }\n        ],\n        \"NoncurrentVersionExpiration\": { \"NoncurrentDays\": 180 }\n      },\n      {\n        \"ID\": \"abort-incomplete-multipart-uploads\",\n        \"Status\": \"Enabled\",\n        \"Filter\": {},\n        \"AbortIncompleteMultipartUpload\": { \"DaysAfterInitiation\": 7 }\n      }\n    ]\n  }\nSAVINGS:\n  CURRENT_MONTHLY: $446.20  (19,400 GB × $0.023)\n  PROJECTED_MONTHLY: $139.96\n    - 2,400 GB current at Standard (\u003C 30d) × $0.023 = $55.20\n    - 1,400 GB current at Standard-IA (30-90d) × $0.0125 = $17.50\n    - 2,000 GB current at Glacier IR (90-180d) × $0.004 = $8.00\n    - 1,600 GB current at Glacier (180-365d) × $0.0036 = $5.76\n    - 3,000 GB noncurrent at Standard-IA (30-90d) × $0.0125 = $37.50\n    - 4,000 GB noncurrent at Glacier IR (90-180d) × $0.004 = $16.00\n    - 5,000 GB noncurrent expired (> 180d) = $0.00\n    - Arithmetic check: 55.20 + 17.50 + 8.00 + 5.76 + 37.50 + 16.00 = $139.96\n  MONTHLY_SAVING: $306.24  ($446.20 − $139.96)\n  ANNUAL_SAVING: $3,674.88\n  CAVEATS:\n    - Standard-IA 30-day minimum: objects deleted before day 30 still bill.\n    - Glacier IR 90-day minimum applies.\n    - Glacier IR retrieval is $0.03\u002FGB if logs are queried — budget separately.\nIMPLEMENTATION:\n  1. CONFIRM: About to put-bucket-lifecycle-configuration on bucket\n     app-logs-prod in account \u003Cacct> region us-east-1. This enables 3 rules\n     (logs-lifecycle, noncurrent-cleanup, multipart-abort). Proceed? (yes\u002Fno)\n  2. aws s3api put-bucket-lifecycle-configuration --bucket app-logs-prod \\\n       --lifecycle-configuration file:\u002F\u002Flifecycle.json\n  3. Verify: aws s3api get-bucket-lifecycle-configuration --bucket app-logs-prod\n  4. Backfill existing Standard objects older than 30 days via S3 Batch\n     Operations (lifecycle only transitions new objects going forward):\n     aws s3control create-job --account-id \u003Cacct> \\\n       --operation '{\"S3CopyObject\": {\"TargetStorageClass\": \"STANDARD_IA\"}}' \\\n       --manifest-location \u003Cmanifest-bucket> \\\n       --report-spec '\u003Creport-config>'\n```\n\n### Worked example — already optimal compliance bucket\n\n→ Secondary example moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\n### Worked example — Intelligent-Tiering trap (small objects, proposed plan rejected)\n\n→ Secondary example moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\n## Worked example: end-to-end audit of a 5 TB mixed-workload bucket\n\n→ End-to-end audit walkthrough moved to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\n## Verdict consistency rules (prevent misclassification)\n\nThe skill MUST emit verdicts that are mathematically and logically\nself-consistent. The following rules are mandatory checks before any\noutput is finalized:\n\n1. **Zero-savings rule.** If `MONTHLY_SAVING == $0.00` for every\n   dimension, the verdict MUST be `ALREADY_OPTIMAL`, never\n   `OPPORTUNITY_FOUND`. A finding with \"OPPORTUNITY_FOUND\" and\n   \"$0.00 monthly saving\" in the same output block is a contradiction\n   and a hard error.\n\n2. **Negative-savings rule.** If the projected monthly cost is HIGHER\n   than current (e.g., Intelligent-Tiering monitoring fee exceeds the\n   transition saving, or minimum-duration charges net out negative),\n   the verdict for that dimension is \"no action\" and MUST NOT be\n   aggregated into `OPPORTUNITY_FOUND`. Either pick a different\n   storage class or emit `ALREADY_OPTIMAL` with the reasoning that the\n   current tier is already cheapest.\n\n3. **OPPORTUNITY_FOUND requires a non-zero savings line.** When emitting\n   `OPPORTUNITY_FOUND`, the SAVINGS block must show a positive\n   `MONTHLY_SAVING` for at least one dimension. If no dimension has\n   positive savings, downgrade to `ALREADY_OPTIMAL`.\n\n4. **SAVINGS arithmetic check.** `CURRENT_MONTHLY − PROJECTED_MONTHLY`\n   MUST equal `MONTHLY_SAVING`. If the three numbers don't reconcile,\n   re-compute before emitting. Round to 2 decimal places.\n\n5. **Dimension coverage rule.** For a versioned bucket,\n   `OPPORTUNITY_FOUND` MUST include either a `NoncurrentVersionExpiration`\n   rule OR a documented reason why one is not applicable (e.g., \"Object\n   Lock COMPLIANCE mode requires version retention\"). An\n   `OPPORTUNITY_FOUND` on a versioned bucket with only `Expiration`\n   (current-version) rules is incomplete — it leaves noncurrent bytes\n   accumulating indefinitely.\n\n6. **Storage-class transition must include retrieval caveats.** Any\n   transition to a Glacier tier MUST include the retrieval cost and\n   latency in `CAVEATS`. A bare `Transitions` rule without retrieval\n   cost disclosure is non-compliant.\n\n7. **Intelligent-Tiering object-size gate.** Recommending Intelligent-\n   Tiering on a bucket where the average object size \u003C 128 KB MUST\n   surface the monitoring-fee calculation and confirm it does not\n   exceed the transition saving.\n\n8. **Filter-prefix reality check.** Before emitting `OPPORTUNITY_FOUND`\n   on a transition rule, verify the proposed `Filter.Prefix` matches\n   actual key prefixes in Storage Lens or `list-objects-v2 --prefix`.\n   A rule with a non-matching prefix is silently a no-op.\n\nThese rules are evaluated AFTER Step 6 aggregation but BEFORE emitting\nthe output block. If any rule fails, re-run the relevant step.\n\n## Error handling — CLI and data-source failures\n\n→ Error-handling deep dive and failure-mode tables moved to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\n## Rollback procedure (beyond JSON backup)\n\n→ Moved to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\n## Cross-region cost variance detail\n\n→ Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n## Anti-Patterns — NEVER\n\n- NEVER recommend a transition to Standard-IA or One-Zone-IA for objects\n  smaller than 128 KB. The minimum billable size makes IA MORE expensive than\n  Standard. Always check average object size from Storage Lens before\n  recommending IA tiers.\n\n- NEVER recommend a storage-class transition without modeling minimum-duration\n  charges. An object moved to Standard-IA on day 5 and deleted on day 6 bills\n  30 days of IA charges — net more expensive than Standard. Surface\n  `CAVEATS: 30-day minimum-duration charge applies` on every IA recommendation.\n\n- NEVER propose `ExpirationInDays` on a versioned bucket without a\n  corresponding `NoncurrentVersionExpiration` rule. Expiration on the current\n  version creates a new noncurrent version — without cleanup, the bucket grows\n  instead of shrinks. This is the single most common lifecycle misconfiguration.\n\n- NEVER recommend Glacier Flexible Retrieval or Deep Archive for objects that\n  are accessed more than once per quarter. Retrieval fees ($2.50-30\u002FTB) wipe\n  out the storage saving in a single retrieval. Glacier is for archive only.\n\n- NEVER recommend Intelligent-Tiering on a bucket of millions of small objects\n  without surfacing the monitoring fee. At $0.0025\u002F1,000 objects, a bucket of\n  10M small JSON files costs $25\u002Fmonth in monitoring alone — often more than\n  the transition saving.\n\n- NEVER enable Object Lock in COMPLIANCE mode without confirming the retention\n  period with the operator. COMPLIANCE mode retention CANNOT be shortened or\n  bypassed, even by root. A wrong retention period is a permanent lock.\n\n- NEVER propose lifecycle transitions on a directory bucket (S3 Express One\n  Zone). Directory buckets do not support lifecycle, Object Lock, or Glacier\n  tiers. Surface the cost-per-GB ($0.16) as a finding; the verdict for a\n  directory bucket is ALREADY_OPTIMAL for latency-critical ML\u002FAI workloads.\n\n- NEVER propose `Expiration` rules on S3 Tables data prefixes. Apache Iceberg\n  tables manage their own lifecycle via table APIs. Surface as a finding only.\n\n- NEVER assume `lifecycle-configuration` returns an empty object when no rules\n  exist. It returns a 404 `NoSuchLifecycleConfiguration` error — handle\n  gracefully and proceed with the recommendation.\n\n- NEVER auto-apply `put-bucket-lifecycle-configuration` without the CONFIRM\n  gate. A wrong prefix or filter can mass-transition or mass-delete objects.\n  Always emit `CONFIRM: About to \u003Caction>...` and wait for explicit operator\n  approval.\n\n- NEVER trust a single Storage Lens snapshot. Lifecycle recommendations should\n  use at least 30 days of Storage Lens data to capture the access-pattern trend.\n  A 1-day snapshot can misclassify a daily-access bucket as cold.\n\n- NEVER recommend deleting noncurrent versions without confirming the workload\n  can tolerate loss of version history. Some compliance frameworks require\n  version retention — surface Object Lock as the parallel control.\n\n- NEVER assume Cross-Region Replication (CRR) preserves the SOURCE storage\n  class. CRR defaults to copying objects in the **destination bucket's\n  default storage class** (Standard unless the replication rule overrides\n  it). A common anti-pattern: source bucket transitions to Glacier Deep\n  Archive, but the CRR destination remains in Standard indefinitely —\n  doubling the storage bill instead of halving it. **Why this happens:**\n  replication rules are independent of lifecycle rules; lifecycle does not\n  propagate across the replication boundary. Always design source AND\n  destination lifecycle rules in tandem, OR explicitly set\n  `ExistingObjectReplication: false` and `StorageClass` on the replication\n  rule to match the source tier.\n\n- NEVER emit `OPPORTUNITY_FOUND` on a bucket where the projected monthly\n  cost equals or exceeds the current monthly cost. The verdict requires\n  a positive net saving — minimum-duration charges, Intelligent-Tiering\n  monitoring fees, and request fees on bulk transitions can net out\n  negative. If the math shows $0 or negative saving, the verdict is\n  `ALREADY_OPTIMAL` for that dimension, not `OPPORTUNITY_FOUND`.\n\n- NEVER recommend a lifecycle transition on a bucket without first\n  confirming the average object size from Storage Lens. A bucket of\n  millions of \u003C 128 KB objects costs MORE in any IA tier than in Standard,\n  due to the 128 KB minimum billable size. Surface the object-size\n  distribution as the gating check before any transition recommendation.\n\n- NEVER conflate `ExpirationInDays` (current version) with\n  `NoncurrentVersionExpiration.NoncurrentDays` (prior versions). The two\n  are independent — a rule that expires the current version creates a\n  new noncurrent version on a versioned bucket, INCREASING storage if no\n  parallel noncurrent rule exists. This is the single most common\n  lifecycle misconfiguration in production S3 environments.\n\n## Edge-case handling\n\n→ Edge-case catalog moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n## Pre-flight safety checks (run before any remediation CLI)\n\n→ Command listing moved to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\n## Recent AWS features (2024-2026)\n\n→ Moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n## References (load on demand)\n\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step 0 expert knowledge, step rule templates (Steps 1-3 JSON), cross-region variance, edge cases, recent AWS features, AWS documentation links.\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — secondary worked examples (already-optimal, IT trap, 5 TB end-to-end audit).\n- [references\u002Ferror-handling.md](references\u002Ferror-handling.md) — error handling for CLI\u002Fdata-source failures + rollback procedure.\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — pre-flight gate commands + pre-remediation safety checks.\n- [references\u002Fstorage-class-pricing-matrix.md](references\u002Fstorage-class-pricing-matrix.md) — pre-existing; extended with the cost baseline table — load before dollar estimates.\n\n## Domain\n\nAWS CloudOps \u002F S3 Storage Cost Optimisation & Lifecycle Design.\n\n## AWS documentation\n\n→ Link list moved to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":41},{"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,"invocation_schema":39,"supports_pipeline":37,"activation_triggers":40},"s3, storage, cost-optimization, lifecycle, storage-class, glacier, intelligent-tiering, object-lock, finops","3","Jacky Chan — AWS Community Builder","aws-cloudops","Storage","0.1.0","S3, lifecycle policy, storage class, Standard-IA, One-Zone-IA, Intelligent-Tiering, Glacier Instant Retrieval, Glacier Flexible Retrieval, Glacier Deep Archive, S3 Express One Zone, directory bucket, noncurrent version, multipart upload, S3 Storage Lens, S3 Object Lock, S3 Batch Operations, S3 Tables, put-bucket-lifecycle-configuration, storage cost optimization","optimize","medium","false","capability","Reviewing S3 spend, designing or auditing lifecycle policies, selecting storage classes for infrequently accessed data, projecting savings from Standard -> Standard-IA \u002F Intelligent-Tiering \u002F Glacier transitions, pruning noncurrent versions on versioned buckets, aborting stale multipart uploads, or hardening compliance archives with Object Lock.","true","OPTIMIZED | OPPORTUNITY_FOUND | ALREADY_OPTIMAL","Input: either (a) a bucket configuration (lifecycle configuration JSON, versioning status, Storage Lens metrics summary, optional object-age histogram), OR (b) a bucket name for live-account optimisation. Output: deterministic BUCKET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002FSAVINGS\u002FIMPLEMENTATION block per bucket, where VERDICT is one of OPTIMIZED, OPPORTUNITY_FOUND, ALREADY_OPTIMAL.","optimise S3 storage cost, design S3 lifecycle policy, S3 storage class analysis, move S3 data to Glacier, S3 Intelligent-Tiering vs Standard-IA, prune noncurrent S3 versions, abort stale S3 multipart uploads, S3 Object Lock retention, S3 lifecycle transition rules, S3 cost optimization review, Glacier Deep Archive lifecycle, S3 Batch Operations storage class","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline configuration classification. Live-account audits use aws s3api list-buckets, aws s3api get-bucket-lifecycle-configuration, aws s3api list-objects-v2 (with --page-size for inventory), aws s3api list-multipart-uploads, aws s3api get-bucket-versioning, and aws s3control get-storage-lens-configuration (AWS CLI v2, SSO or key-based credentials). Pricing is us-east-1 published rates...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fs3-lifecycle-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":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill s3-lifecycle-optimizer",{"tool":56,"command":57},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill s3-lifecycle-optimizer",{"tool":59,"command":60},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill s3-lifecycle-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002FSKILL.md",true,[64,70,74,78,82,86,90,94,98,102,105,109,113,117,121,125,129,133,137,141],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",7921,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Feval\u002Ftest-cases.yaml",{"path":71,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":72,"sourceHtmlUrl":73},"evals\u002Fbaselines\u002Falready-optimal-compliance-bucket.md",571,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fbaselines\u002Falready-optimal-compliance-bucket.md",{"path":75,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":76,"sourceHtmlUrl":77},"evals\u002Fbaselines\u002Fcompliance-archive-no-deep-archive.md",726,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fbaselines\u002Fcompliance-archive-no-deep-archive.md",{"path":79,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":80,"sourceHtmlUrl":81},"evals\u002Fbaselines\u002Flogs-bucket-no-lifecycle.md",1019,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fbaselines\u002Flogs-bucket-no-lifecycle.md",{"path":83,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":84,"sourceHtmlUrl":85},"evals\u002Fbaselines\u002Fmultipart-upload-leak-only.md",784,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fbaselines\u002Fmultipart-upload-leak-only.md",{"path":87,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":88,"sourceHtmlUrl":89},"evals\u002Fbaselines\u002Fsmall-objects-intelligent-tiering-trap.md",831,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fbaselines\u002Fsmall-objects-intelligent-tiering-trap.md",{"path":91,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":92,"sourceHtmlUrl":93},"evals\u002Feval_config.yaml",1962,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Feval_config.yaml",{"path":95,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":96,"sourceHtmlUrl":97},"evals\u002Fevals.json",4800,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fevals.json",{"path":99,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":100,"sourceHtmlUrl":101},"evals\u002Fprompts\u002Falready-optimal-compliance-bucket.md",1156,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fprompts\u002Falready-optimal-compliance-bucket.md",{"path":103,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":76,"sourceHtmlUrl":104},"evals\u002Fprompts\u002Fcompliance-archive-no-deep-archive.md","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fprompts\u002Fcompliance-archive-no-deep-archive.md",{"path":106,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":107,"sourceHtmlUrl":108},"evals\u002Fprompts\u002Flogs-bucket-no-lifecycle.md",791,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fprompts\u002Flogs-bucket-no-lifecycle.md",{"path":110,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":111,"sourceHtmlUrl":112},"evals\u002Fprompts\u002Fmultipart-upload-leak-only.md",1194,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fprompts\u002Fmultipart-upload-leak-only.md",{"path":114,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":115,"sourceHtmlUrl":116},"evals\u002Fprompts\u002Fsmall-objects-intelligent-tiering-trap.md",931,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fevals\u002Fprompts\u002Fsmall-objects-intelligent-tiering-trap.md",{"path":118,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":119,"sourceHtmlUrl":120},"examples\u002FREADME.md",7217,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Fexamples\u002FREADME.md",{"path":122,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":123,"sourceHtmlUrl":124},"references\u002Fadvanced-patterns.md",17814,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Freferences\u002Fadvanced-patterns.md",{"path":126,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fdiagnostic-commands.md",3229,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Freferences\u002Fdiagnostic-commands.md",{"path":130,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Ferror-handling.md",11092,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Freferences\u002Ferror-handling.md",{"path":134,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Fstorage-class-pricing-matrix.md",7278,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Freferences\u002Fstorage-class-pricing-matrix.md",{"path":138,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":139,"sourceHtmlUrl":140},"references\u002Fworked-examples.md",15070,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-optimizer\u002Freferences\u002Fworked-examples.md",{"path":142,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":143,"sourceHtmlUrl":144},"skill.usf.yaml",4381,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-lifecycle-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",[],[]]