[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AC3FJ6JWW2561B3YB671VM":3,"skill-same:01M7AC3FJ6JWW2561B3YB671VM":144},{"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":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M7AC3FJ6JWW2561B3YB671VM","s3-version-cleanup-operator",null,"Operates S3 version cleanup for cost optimization and compliance — NoncurrentVersionExpiration, NoncurrentVersionTransition, NewerNoncurrentVersions, AbortIncompleteMultipartUpload lifecycle rules, S3 Batch Operations for immediate version delete, Object Lock (Compliance vs Governance mode) and legal-hold handling, versioning-state pre-checks (Enabled vs Suspended), Storage Lens impact estimation, and post-apply verification. Runs deterministic pre-checks (versioning enabled, Object Lock mode and retention, legal holds, existing lifecycle rule conflicts, BucketKeyEnabled for cost), executes the operation behind a CONFIRM gate, and emits a verdict (READY | BLOCKED | COMPLETED) per bucket with the exact CLI\u002FJSON sequence, estimated monthly savings, and verification commands. Use when auditing noncurrent version accumulation, configuring version cleanup lifecycle rules, planning immediate cleanup via Batch Operations, handling Object Lock retention, or estimating S3 version cleanup savings.","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-version-cleanup-operator\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: s3-version-cleanup-operator\ndescription: Operates S3 version cleanup for cost optimization and compliance — NoncurrentVersionExpiration, NoncurrentVersionTransition, NewerNoncurrentVersions, AbortIncompleteMultipartUpload lifecycle rules, S3 Batch Operations for immediate version delete, Object Lock (Compliance vs Governance mode) and legal-hold handling, versioning-state pre-checks (Enabled vs Suspended), Storage Lens impact estimation, and post-apply verification. Runs deterministic pre-checks (versioning enabled, Object Lock mode and retention, legal holds, existing lifecycle rule conflicts, BucketKeyEnabled for cost), executes the operation behind a CONFIRM gate, and emits a verdict (READY | BLOCKED | COMPLETED) per bucket with the exact CLI\u002FJSON sequence, estimated monthly savings, and verification commands. Use when auditing noncurrent version accumulation, configuring version cleanup lifecycle rules, planning immediate cleanup via Batch Operations, handling Object Lock retention, or estimating S3 version cleanup savings.\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline plan classification. Live-account operations use aws s3api get-bucket-versioning, put-bucket-versioning, get-bucket-lifecycle-configuration, put-bucket-lifecycle-configuration, get-object-lock-configuration, get-object-legal-hold, list-object-versions, delete-objects, and aws s3control create-job (S3 Batch Operations) (AWS CLI v2, SSO or key-based credentials).\nmetadata:\n  domain: aws-cloudops\n  complexity: medium\n  requires_llm: 'true'\n  phase: '4'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Storage\n  task_type: operate\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: READY | BLOCKED | COMPLETED\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  tags: s3, storage, versioning, lifecycle, cost-optimization, object-lock, batch-operations\n  dependencies: aws-orchestrator\n  keywords: S3, versioning, noncurrent versions, NoncurrentVersionExpiration, NoncurrentVersionTransition, NewerNoncurrentVersions, lifecycle rule, AbortIncompleteMultipartUpload, S3 Batch Operations, Object Lock, Compliance mode, Governance mode, legal hold, S3 Storage Lens, cost optimization, version cleanup, delete markers, BucketKeyEnabled\n  when_to_use: Auditing S3 noncurrent version accumulation, configuring version cleanup lifecycle rules (NoncurrentVersionExpiration, NoncurrentVersionTransition, NewerNoncurrentVersions), planning immediate version cleanup via S3 Batch Operations, handling Object Lock retention before cleanup, estimating S3 version cleanup savings, or hardening S3 cost posture on versioned buckets.\n  activation_triggers: clean up S3 versions, S3 noncurrent versions cost, configure S3 lifecycle NoncurrentVersionExpiration, S3 version cleanup, S3 Object Lock retention, S3 legal hold, S3 Batch Operations delete versions, S3 cost optimization versions, S3 Storage Lens noncurrent, abort multipart upload S3, S3 NewerNoncurrentVersions, versioned bucket cleanup, S3 lifecycle configuration\n  invocation_schema: 'Input: either (a) a bucket configuration with the intended operation (configure-lifecycle, batch-delete-versions, audit- versions, estimate-savings), OR (b) a bucket name + operation for live-account execution. Output: deterministic OPERATION\u002FVERDICT\u002F PRE_CHECKS\u002FSTEPS\u002FPOST_VERIFY block per operation, where VERDICT is one of READY, BLOCKED, COMPLETED.'\n---\n\n# S3 Version Cleanup Operator\n\n## What this skill does\n\nExecutes S3 version cleanup operations correctly and safely — for\ncost optimization and for compliance retention. Runs deterministic\npre-checks before any state-changing CLI (versioning state, Object\nLock mode + retention, legal holds, existing lifecycle conflicts),\nexecutes the operation behind a CONFIRM gate, and verifies the\nresult. Every operation surfaces the estimated monthly savings, the\ncompliance implications, and the verification steps.\n\n## Quick navigation\n\n| Section | What it covers | When to read it |\n|---|---|---|\n| **§ Quick reference** | Verdict thresholds (BLOCKED\u002FREADY\u002FCOMPLETED) + pre-check priority order | Before any operation |\n| **§ Mindset** | Why version cleanup is the #1 S3 cost lever, the 4 lifecycle rule types, Object Lock modes | Understanding the cost model |\n| **§ Pre-flight** | Bucket metadata gate — versioning state, Object Lock, legal holds, existing lifecycle | Before executing any CLI |\n| **§ Process** | Per-operation planning: lifecycle rules, batch-delete, impact estimation, audit | When choosing which operation to run |\n| **§ Output format** | Structured output template with VERDICT, COMMANDS, SAVINGS, VERIFICATION | Formatting the response |\n| **§ Anti-Patterns** | NEVER list — common mistakes that cause data loss or compliance violation | Review before risky operations |\n| **§ Pre-flight safety** | Additional checks before any remediation CLI | Defense-in-depth |\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `BLOCKED` | One or more pre-checks failed (versioning not enabled, Object Lock Compliance mode blocks deletion, legal hold active, lifecycle rule conflict, bucket in a different region\u002Faccount than expected) | List failures, do NOT execute |\n| `READY` | All pre-checks passed; awaiting CONFIRM gate | Emit exact CLI\u002FJSON sequence, wait for operator yes |\n| `COMPLETED` | Operation finished and post-verification passed (lifecycle rule applied, Batch Operations job completed, noncurrent version count dropped) | Emit savings estimate, verification results |\n\n**Priority order for pre-checks (apply in this sequence, all must pass\nfor READY):**\n\n1. **Versioning state** — must be `Enabled` for cleanup to affect\n   noncurrent versions. `Suspended` is a different state (new puts\n   create a null-version-id object, old versions are preserved).\n   `NeverEnabled` → no versions exist, nothing to clean.\n2. **Object Lock** — if `Compliance` mode is active with retention,\n   versions CANNOT be deleted or overwritten until retention expires\n   (not even by root). `Governance` mode permits deletion with\n   `s3:BypassGovernanceRetention` permission.\n3. **Legal holds** — per-object `LegalHold: ON` prevents deletion\n   regardless of lifecycle, Object Lock mode, or retention. Check\n   via `get-object-legal-hold` for specific objects.\n4. **Existing lifecycle rules** — `put-bucket-lifecycle-configuration`\n  **REPLACES** the entire configuration, not merges. Read existing\n   rules first and merge new rules; otherwise you silently delete\n   existing transitions\u002Fexpirations.\n5. **MFA Delete** — if `MFADelete: Enabled` on the bucket, version\n   deletion and lifecycle rule changes require MFA. Plan for the\n   additional auth step.\n6. **Bucket Key** — `BucketKeyEnabled: true` reduces KMS request cost\n   on encrypted buckets (~99% reduction). Recommend enabling alongside\n   lifecycle changes.\n\n**Cost\u002Fsavings baselines (2026 us-east-1):**\n\n- Standard storage: ~$0.023\u002FGB-month.\n- Standard-IA: ~$0.0125\u002FGB-month (50% cheaper, but 30-day minimum +\n  retrieval fee).\n- Glacier Instant Retrieval: ~$0.004\u002FGB-month (~83% cheaper).\n- Glacier Flexible Retrieval: ~$0.0036\u002FGB-month (~84% cheaper).\n- Glacier Deep Archive: ~$0.00099\u002FGB-month (~96% cheaper).\n- One-time delete via lifecycle or Batch Operations: free (no per-delete\n  charge).\n- S3 Batch Operations: ~$1.00 per million objects processed.\n\n**Rule of thumb:** versioned buckets with frequent overwrites\naccumulate noncurrent versions at the same rate as the overwrite\nfrequency × object size. A 1 GB log file overwritten hourly = 24\nnoncurrent versions\u002Fday × $0.023\u002FGB ≈ $0.55\u002Fmonth — scales linearly\nwith overwrite count.\n\n## Mindset\n\n**One-line takeaway:** versioned buckets accumulate noncurrent versions\nindefinitely at standard storage rates — version cleanup is the #1 S3\ncost optimization after storage-class transitions. Driven by four\nrealities:\n\n- **Every noncurrent version bills at full Standard rate by default.**\n  Unlike S3 IA or Glacier, noncurrent versions are NOT automatically\n  tiered. A 1 GB file overwritten 100 times is 100 GB of Standard\n  storage — 100x the cost of the current version alone.\n- **Object Lock Compliance mode is irrevocable.** If Compliance mode is\n  active with retention until 2030, no one (including root, including\n  AWS support) can delete those versions before 2030. This is the\n  correct posture for ransomware-resilient backups — and a hard block\n  for version cleanup.\n- **`put-bucket-lifecycle-configuration` REPLACES, not merges.** Every\n  operator who forgets this silently deletes the existing lifecycle\n  rules — transitions, expirations, abort-multipart rules — and the\n  bucket reverts to \"no lifecycle\" until the operator notices (usually\n  via a cost spike months later).\n- **Legal holds override everything.** A single `LegalHold: ON` on one\n  object blocks its deletion regardless of Object Lock mode, retention,\n  lifecycle rules, or root access. Legal holds are per-object; bulk\n  cleanup requires checking each object (or using Batch Operations with\n  a manifest).\n\n## Pre-flight: bucket metadata gate\n\nRun before classification. Misclassifying these produces wrong plans.\n\n**Pagination:** `list-object-versions` paginates at 1000 keys\u002Fpage —\ndrain `--key-marker` and `--version-id-marker` to completion. Use S3\nStorage Lens for account-wide noncurrent version metrics instead of\nenumerating every bucket.\n\n**Live-account pre-flight (skip if offline plan audit):**\n1. `aws s3api get-bucket-versioning --bucket \u003Cname>` — confirm\n   `Status: Enabled`. Capture `MFADelete` (if enabled, plan for MFA).\n2. `aws s3api get-bucket-lifecycle-configuration --bucket \u003Cname>` —\n   capture existing rules. NEVER overwrite without first reading.\n3. `aws s3api get-object-lock-configuration --bucket \u003Cname>` — capture\n   `ObjectLockEnabled` and `Rule.DefaultRetention` (Mode, Days, Years).\n4. `aws s3api get-public-access-block --bucket \u003Cname>` — context only.\n5. `aws s3api get-bucket-encryption --bucket \u003Cname>` — capture\n   `BucketKeyEnabled` (recommend enabling if false and SSE-KMS in use).\n6. `aws s3api list-object-versions --bucket \u003Cname --max-keys 1000` —\n   sample the noncurrent version count and average size for impact\n   estimation.\n7. `aws s3control get-storage-lens-configuration --config-id default`\n   — capture account-level `NoncurrentVersionCount` and\n   `NoncurrentVersionStorageBytes`.\n8. For specific objects being cleaned: `aws s3api get-object-legal-hold\n   --bucket \u003Cname> --key \u003Ckey> --version-id \u003Cvid>` — verify no legal\n   hold before batch-delete.\n\n**Malformed input:** if the input JSON is invalid or missing required\nfields, emit `VERDICT: ERROR` with `REASON: Bucket\u002Foperation\nconfiguration is not valid JSON or is missing required fields — cannot\nplan.` and `REMEDIATION: Re-fetch with aws s3api get-bucket-versioning\n--bucket \u003Cname> --output json and re-plan.`\n\n| Bucket attribute | Effect on operation |\n|---|---|\n| `Status: Enabled` (versioning) | Cleanup proceeds normally. Noncurrent versions are eligible for lifecycle rules. |\n| `Status: Suspended` | New puts create a null-version-id object (replacing the prior null version, which becomes noncurrent). OLD versions from before suspension are still preserved. Lifecycle rules apply only to noncurrent versions created before suspension. Plan carefully — typically the operator should re-enable versioning before cleanup. |\n| Versioning never enabled | No versions exist. Nothing to clean. Emit BLOCKED with \"versioning never enabled — no noncurrent versions to clean up\". |\n| `MFADelete: Enabled` | Version deletion and lifecycle rule changes require MFA. Plan for additional auth step (MFA token in CLI call). |\n| `ObjectLockEnabled: Enabled`, `DefaultRetention.Mode: COMPLIANCE` | Versions within the retention window CANNOT be deleted by anyone — BLOCKED for in-retention versions. Lifecycle rules still apply to versions PAST retention. |\n| `ObjectLockEnabled: Enabled`, `DefaultRetention.Mode: GOVERNANCE` | Versions can be deleted with `s3:BypassGovernanceRetention` permission. Lifecycle rules apply normally; Governance mode provides a softer guardrail. |\n| Object-level `LegalHold: ON` | That specific version cannot be deleted by anyone. Lifecycle rules skip it silently. Bulk cleanup must check each object. |\n| Existing lifecycle rules referencing the same prefix | `put-bucket-lifecycle-configuration` REPLACES. Merge new rules into the existing config or you silently delete existing transitions. |\n| `BucketKeyEnabled: false` with SSE-KMS | Each noncurrent version incurs a KMS `GenerateDataKey` charge on access. Recommend enabling Bucket Key alongside lifecycle changes. |\n| Bucket in a different AWS account | Caller needs cross-account IAM permissions on both sides. Verify before planning. |\n\n## Process — operation planning (apply in order)\n\n### Step 0: Expert knowledge — non-obvious S3 versioning behaviors\n\nNon-obvious versioning behaviors — REPLACES-not-merges lifecycle PUT, NoncurrentVersionExpiration vs NewerNoncurrentVersions, NoncurrentDays semantics, 24-hour async rule apply, delete markers, Object Lock modes, legal holds, Storage Lens, GIR vs Flexible, Bucket Key, CRR\u002FSRR replicas, Intelligent-Tiering — live in [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad that reference before planning configure-lifecycle or batch-delete-versions.\n\n### Step 1: Pre-check gate — BLOCKED if any check fails\n\nRun ALL of the following pre-checks. If ANY fails, the verdict is\nBLOCKED with the failed checks enumerated in PRE_CHECKS. Do NOT\nexecute the operation.\n\n**For ALL operations:**\n1. Caller has `s3:GetBucketVersioning`, `s3:GetLifecycleConfiguration`,\n   `s3:PutLifecycleConfiguration` on the bucket ARN.\n2. Bucket exists in the expected region and account.\n3. Bucket name is correct (S3 bucket names are globally unique;\n   verify the region matches the expectation).\n\n**For configure-lifecycle (add\u002Fmodify lifecycle rules):**\n4. Versioning state is `Enabled` (or `Suspended` with explicit\n   acknowledgment — see Step 0 for behavior differences).\n5. Existing lifecycle rules captured via\n   `get-bucket-lifecycle-configuration` — new rules must be MERGED\n   into the existing config, not REPLACE it.\n6. No conflicting rules (same prefix + overlapping actions with\n   different NoncurrentDays values).\n7. Object Lock configuration captured — Compliance-mode retention\n   overrides NoncurrentVersionExpiration for in-retention versions.\n\n**For batch-delete-versions (immediate cleanup via Batch Operations):**\n4. Versioning state is `Enabled`.\n5. S3 Inventory configured OR a manifest generated via\n   `list-object-versions` (paginated). Batch Operations needs a\n   manifest of object-key + version-id pairs.\n6. No Object Lock Compliance-mode versions in the manifest (delete\n   would fail per-object; the job continues but reports failures).\n7. No legal-hold ON objects in the manifest (same per-object failure\n   behavior).\n8. IAM role for Batch Operations has `s3:DeleteObjectVersion` on the\n   bucket AND `iam:PassRole` to assign the execution role.\n\n**For estimate-savings (impact audit):**\n4. S3 Storage Lens enabled at the account or bucket level.\n5. Sample `list-object-versions` captured (1000 keys) to estimate\n   average version count and size.\n\n### Step 2: READY — emit operation plan\n\nIf all pre-checks pass, emit `VERDICT: READY` with the exact CLI\u002FJSON\nsequence and the CONFIRM gate. The plan includes:\n\n- The exact AWS CLI command with the merged lifecycle JSON.\n- The estimated monthly savings (computed from noncurrent version\n  count × average size × storage rate).\n- The expected timeline (lifecycle rules apply within 24 hours of\n  eligibility; Batch Operations jobs run in minutes-to-hours).\n- The CONFIRM gate prompt.\n\n### Step 3: Execute behind CONFIRM gate\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing CLI,\n  emit: `CONFIRM: About to \u003Coperation> on bucket \u003Cname> in account\n  \u003Caccount> region \u003Cregion>. This will \u003Cconsequence>. Estimated\n  monthly savings: $\u003Camount>. Proceed? (yes\u002Fno)`. Do NOT execute\n  until the operator confirms.\n- Capture pre-state for audit:\n  `aws s3api get-bucket-lifecycle-configuration --bucket \u003Cname>\n  --output json > \u002Ftmp\u002F\u003Cname>-lifecycle-pre-$(date +%s).json`.\n- Execute the CLI. For `put-bucket-lifecycle-configuration`, PUT\n  the merged JSON (NEVER the new rules alone). For Batch Operations,\n  capture the JobId.\n- Verify the operation:\n  `get-bucket-lifecycle-configuration` shows the new rules;\n  `describe-job` shows Batch Operations progress.\n\n### Step 4: Post-verification — COMPLETED\n\nAfter the operation finishes, run post-verification. ALL checks must\npass for `COMPLETED`.\n\n1. `get-bucket-lifecycle-configuration --bucket \u003Cname>` — confirm\n   the new rules are present AND existing rules are preserved (no\n   silent deletion).\n2. For Batch Operations: `aws s3control describe-job --account-id\n   \u003Cacct> --job-id \u003Cid>` — confirm `Status: Complete`,\n   `NumberOfTasksSucceeded` matches expected.\n3. Wait 24-48 hours, then re-check Storage Lens\n   `NoncurrentVersionCount` and `NoncurrentVersionStorageBytes` —\n   they should drop.\n4. Verify no compliance violations (Object Lock retention respected,\n   no legal-hold objects deleted).\n5. Verify the expected cost drop in AWS Cost Explorer (S3 service,\n   filtered by bucket tag or usage type) — allow 1-3 days for billing\n   lag.\n6. For lifecycle rules: verify the rule prefix filter is correct\n   (does not accidentally match unintended prefixes).\n7. Document the savings in NOTES for the operator's reporting.\n\nIf ANY verification fails, emit `VERDICT: ERROR` with the failure\ndetails — do not claim COMPLETED.\n\n## Output format (per operation)\n\n```text\nOPERATION: \u003Cconfigure-lifecycle | batch-delete-versions | estimate-savings | audit-versions>\nVERDICT: READY | BLOCKED | COMPLETED\nTARGET: \u003Cbucket-name>\nPRE_CHECKS:\n  - [PASS] \u003Ccheck description>\n  - [FAIL] \u003Ccheck description> — \u003Creason>\nSTEPS:\n  1. \u003CCLI command with flags populated>\n  2. \u003Cwait\u002Fpoll command>\n  3. \u003Cnext step>\nPOST_VERIFY:\n  - [PASS] \u003Cverification description>\n  - [FAIL] \u003Cverification description> — \u003Creason>\nESTIMATED_SAVINGS: \u003C$X\u002Fmonth (computed from N noncurrent versions × avg size × rate)>\nNOTES: \u003Ccompliance caveats, Object Lock implications, cleanup timeline>\n```\n\n### Worked examples (see references\u002Fworked-examples.md)\n\nThree full end-to-end worked examples live in\n`references\u002Fworked-examples.md`:\n\n- **READY — configure lifecycle (3-rule cleanup).** Demonstrates\n  NewerNoncurrentVersions=3 + NoncurrentVersionTransition to IA and\n  GIR, merged into 3 existing rules. ~$312\u002Fmonth savings.\n- **BLOCKED — Object Lock Compliance mode.** Shows the irrevocable\n  retention block, enumerates the 4,287 in-retention versions, and\n  recommends NoncurrentVersionTransition as the only viable path.\n- **READY — Batch Operations immediate cleanup.** 2.5M noncurrent\n  versions via S3 Inventory manifest; ~$2.50 Batch Operations cost;\n  ~$825\u002Fmonth savings.\n\nEach example demonstrates the exact PRE_CHECKS, STEPS with CONFIRM\ngate, POST_VERIFY, and NOTES for the verdict shape.\n\n## STRICT output contract\n\nThis contract is mandatory. The Output format template above is the\nauthoritative structure; the rules below disambiguate the failure\nmodes that score D8=13 on this skill. Violating any rule produces a\nplan that is unsafe to execute.\n\n### Required output structure\n\nEvery operation MUST emit this exact block, with all fields populated\n(no empty fields, no omitted sections, no reordering):\n\n```text\nOPERATION: \u003Cconfigure-lifecycle | batch-delete-versions | estimate-savings | audit-versions>\nVERDICT: READY | BLOCKED | COMPLETED\nTARGET: \u003Cbucket-name>\nPRE_CHECKS:\n  - [PASS] \u003Ccheck description>\n  - [FAIL] \u003Ccheck description> — \u003Creason>\nSTEPS:\n  1. \u003CCLI command with flags populated>\n  2. \u003Cwait\u002Fpoll command>\nPOST_VERIFY:\n  - [PASS] \u003Cverification description>\n  - [FAIL] \u003Cverification description> — \u003Creason>\nESTIMATED_SAVINGS: \u003C$X\u002Fmonth (computed from N versions × avg size × rate)>\nNOTES: \u003Ccompliance caveats, Object Lock implications, cleanup timeline>\n```\n\nVerdict-specific rules:\n- `BLOCKED` → at least one PRE_CHECKS line shows `[FAIL]` with a\n  concrete reason; STEPS is `(none — pre-checks failed)`; no\n  state-changing CLI is emitted.\n- `READY` → all PRE_CHECKS show `[PASS]`; STEPS begins with the\n  CONFIRM gate prompt before any state-changing CLI; POST_VERIFY is\n  `(pending execution)`; ESTIMATED_SAVINGS cites the storage math.\n- `COMPLETED` → all POST_VERIFY show `[PASS]`; STEPS reflects what\n  was actually executed; ESTIMATED_SAVINGS is the realised (not\n  estimated) savings if measurable.\n\n### FORBIDDEN output patterns\n\n1. NEVER recommend NoncurrentVersionExpiration without checking Object\n   Lock — Compliance mode makes versions immutable regardless of\n   lifecycle rules. A READY plan that did not run\n   `get-object-lock-configuration` and confirm the mode is invalid.\n2. NEVER suggest put-bucket-lifecycle-configuration as a merge — it\n   REPLACES the entire configuration. Always read-merge-write: call\n   `get-bucket-lifecycle-configuration`, merge the new rules into the\n   existing JSON, then PUT the merged payload. A STEPS entry that PUTs\n   only the new rules is a data-loss bug.\n3. NEVER conflate `Expiration` (current version) with\n   `NoncurrentVersionExpiration` (noncurrent versions). `Expiration`\n   creates a delete marker on versioned buckets; it does NOT remove\n   old versions. A STEPS entry using the wrong action cleans up\n   nothing.\n4. NEVER emit `VERDICT: READY` without the CONFIRM gate as the first\n   STEPS item. State-changing CLIs (lifecycle PUT, `delete-objects`,\n   `create-job`) require explicit operator approval before execution;\n   emitting the CLI without the CONFIRM prompt is a violation.\n5. NEVER attempt to delete objects with `LegalHold: ON`. Legal hold\n   overrides all lifecycle and Object Lock settings. A batch-delete\n   plan that did not sample `get-object-legal-hold` is incomplete —\n   per-object failures will occur silently mid-job.\n6. NEVER output `VERDICT: BLOCKED` without enumerating each failed\n   PRE_CHECK with a `[FAIL]` line and a reason. A bare \"BLOCKED —\n   pre-checks failed\" with no itemised failures is not actionable.\n7. NEVER assume lifecycle rules apply in real time. S3 processes\n   rules asynchronously within 24 hours of eligibility. A COMPLETED\n   verdict that claims immediate cost reduction without the 24-48h\n   verification window is misleading.\n\n### Perfect example output\n\n```text\nOPERATION: configure-lifecycle\nVERDICT: READY\nTARGET: s3:\u002F\u002Fprod-logs-bucket\nPRE_CHECKS:\n  - [PASS] Bucket exists in us-east-1 account 111111111111\n  - [PASS] Versioning Status: Enabled\n  - [PASS] MFADelete: Disabled (no MFA required)\n  - [PASS] ObjectLockEnabled: Disabled (no Compliance\u002FGovernance\n    retention — NoncurrentVersionExpiration is safe)\n  - [PASS] Existing lifecycle rules captured (3 rules: current-version\n    transition, current-version expiration on logs\u002F prefix,\n    abort-multipart-upload 7d) via get-bucket-lifecycle-configuration\n  - [PASS] New rules MERGED into existing config (not replacing) —\n    PUT payload contains all 5 rules\n  - [PASS] BucketKeyEnabled: true (no KMS optimization gap)\n  - [PASS] Caller has s3:PutLifecycleConfiguration\nSTEPS:\n  1. CONFIRM: About to put-bucket-lifecycle-configuration on\n     s3:\u002F\u002Fprod-logs-bucket in account 111111111111 region us-east-1.\n     This will ADD NoncurrentVersionExpiration (NoncurrentDays: 90)\n     and NoncurrentVersionTransition (STANDARD_IA at 30d, GIR at 90d)\n     to the existing 3 rules. Existing rules preserved in the merged\n     payload. Estimated monthly savings: $312\u002Fmonth. Proceed? (yes\u002Fno)\n  2. aws s3api put-bucket-lifecycle-configuration \\\n       --bucket prod-logs-bucket \\\n       --lifecycle-configuration file:\u002F\u002F\u002Ftmp\u002Fprod-logs-bucket-merged-lifecycle.json\n  3. aws s3api get-bucket-lifecycle-configuration \\\n       --bucket prod-logs-bucket --output json\nPOST_VERIFY:\n  - (pending execution)\nESTIMATED_SAVINGS: $312\u002Fmonth (13.5 TB noncurrent × $0.023\u002FGB-month;\n  after transition to IA + GIR: $95\u002Fmonth; net savings $217\u002Fmonth)\nNOTES:\n  - Lifecycle rules apply within 24 hours of eligibility. Allow 24-48\n    hours for the first noncurrent versions to transition\u002Fexpire.\n  - The existing 3 rules are PRESERVED in the merged config — verified\n    by reading the post-PUT lifecycle configuration in Step 3.\n  - For immediate cleanup of versions already older than 90d, use S3\n    Batch Operations (separate operation).\n```\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER execute `put-bucket-lifecycle-configuration` without first\n   reading existing rules.** The PUT REPLACES the entire configuration\n   — silently deleting existing transitions and expirations is the #1\n   S3 lifecycle mistake. Always read-merge-write.\n\n2. **NEVER attempt to delete versions in an Object Lock Compliance-mode\n   bucket within the retention window.** NO ONE — including root,\n   including AWS support — can delete them. Apply lifecycle transitions\n   instead; versions past retention will transition.\n\n3. **NEVER attempt to delete objects with `LegalHold: ON` or conflate\n   `Expiration` with `NoncurrentVersionExpiration`.** Legal hold\n   overrides all settings (check via `get-object-legal-hold`). \n   `Expiration` creates a delete marker on versioned buckets; it does\n   NOT remove old versions — use `NoncurrentVersionExpiration`.\n\n4. **NEVER auto-execute a state-changing S3 CLI without the CONFIRM\n   gate, and NEVER skip the post-PUT lifecycle verification.** Lifecycle\n   PUTs and Batch Operations jobs have side effects; a malformed JSON\n   can be silently rejected. Always emit CONFIRM, wait, then re-read.\n\n5. **NEVER recommend S3 Batch Operations without estimating the\n   per-million-object cost (~$1.00\u002Fmillion) and never use\n   `list-object-versions` as the manifest source for large buckets.**\n   Use S3 Inventory for buckets with millions of versions; paginating\n   `list-object-versions` is too slow and consumes API quota.\n\nAdditional NEVER rules (MFADelete check, compliance retention\nverification, GIR vs Flexible latency, CRR\u002FSRR replica lifecycle,\nIntelligent-Tiering monitoring fee, Bucket Key, `delete-objects` with\nversion IDs, cross-account IAM) appear in the FORBIDDEN output\npatterns section above and in `references\u002Flifecycle-rule-patterns.md`.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\nThe full pre-flight safety checklist — confirm gate, pre-state capture, versioning\u002FObject Lock\u002Flegal-hold verification, read-merge-write lifecycle, cleanup timeline, prefix verification — lives in [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nRun these before any remediation CLI.\n\n## Recent AWS features (2024-2026)\n\nRecent AWS features 2024-2026 — Intelligent-Tiering 90-day archive default, GIR lifecycle GA, S3DeleteObjectVersion in Batch Operations, Governance bypass logging, Storage Lens dimensions, Bucket Key defaults, lifecycle conflict warnings — live in [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad when planning rules on buckets that use these features.\n\n## References (load on demand)\n\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — full end-to-end worked examples (READY lifecycle, BLOCKED Object Lock, READY Batch Operations)\n- [references\u002Flifecycle-rule-patterns.md](references\u002Flifecycle-rule-patterns.md) — lifecycle JSON anatomy, expiration-vs-keep heuristic, Batch Operations cost table\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step-0 non-obvious versioning behaviors and recent AWS features (2024-2026)\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — pre-flight safety checks and pre-state capture commands\n\n## Domain\n\nAWS CloudOps \u002F S3 Storage Cost Optimization & Compliance Retention.\n\n## Expert heuristic and Batch Operations cost (see references\u002Flifecycle-rule-patterns.md)\n\nThe full NoncurrentVersionExpiration-vs-NewerNoncurrentVersions\nheuristic (with defense-in-depth JSON example and common-mistake\nanalysis) and the S3 Batch Operations per-million-object cost\ncomparison table (with payback-period maths and decision rule) live\nin `references\u002Flifecycle-rule-patterns.md`.\n\n## AWS documentation\n\n- **Amazon S3 User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002FWelcome.html\n- **S3 Versioning** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002FVersioning.html\n- **S3 Lifecycle configuration** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fobject-lifecycle-mgmt.html\n- **S3 Object Lock** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fobject-lock.html\n- **S3 Batch Operations** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fbatch-operations.html\n- **S3 Storage Lens** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fstorage_lens.html\n- **AWS CLI s3api reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fs3api\u002F\n- **Bucket Key** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fbucket-key.html\n","# S3 Version Cleanup Operator\n\n## What this skill does\n\nExecutes S3 version cleanup operations correctly and safely — for\ncost optimization and for compliance retention. Runs deterministic\npre-checks before any state-changing CLI (versioning state, Object\nLock mode + retention, legal holds, existing lifecycle conflicts),\nexecutes the operation behind a CONFIRM gate, and verifies the\nresult. Every operation surfaces the estimated monthly savings, the\ncompliance implications, and the verification steps.\n\n## Quick navigation\n\n| Section | What it covers | When to read it |\n|---|---|---|\n| **§ Quick reference** | Verdict thresholds (BLOCKED\u002FREADY\u002FCOMPLETED) + pre-check priority order | Before any operation |\n| **§ Mindset** | Why version cleanup is the #1 S3 cost lever, the 4 lifecycle rule types, Object Lock modes | Understanding the cost model |\n| **§ Pre-flight** | Bucket metadata gate — versioning state, Object Lock, legal holds, existing lifecycle | Before executing any CLI |\n| **§ Process** | Per-operation planning: lifecycle rules, batch-delete, impact estimation, audit | When choosing which operation to run |\n| **§ Output format** | Structured output template with VERDICT, COMMANDS, SAVINGS, VERIFICATION | Formatting the response |\n| **§ Anti-Patterns** | NEVER list — common mistakes that cause data loss or compliance violation | Review before risky operations |\n| **§ Pre-flight safety** | Additional checks before any remediation CLI | Defense-in-depth |\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `BLOCKED` | One or more pre-checks failed (versioning not enabled, Object Lock Compliance mode blocks deletion, legal hold active, lifecycle rule conflict, bucket in a different region\u002Faccount than expected) | List failures, do NOT execute |\n| `READY` | All pre-checks passed; awaiting CONFIRM gate | Emit exact CLI\u002FJSON sequence, wait for operator yes |\n| `COMPLETED` | Operation finished and post-verification passed (lifecycle rule applied, Batch Operations job completed, noncurrent version count dropped) | Emit savings estimate, verification results |\n\n**Priority order for pre-checks (apply in this sequence, all must pass\nfor READY):**\n\n1. **Versioning state** — must be `Enabled` for cleanup to affect\n   noncurrent versions. `Suspended` is a different state (new puts\n   create a null-version-id object, old versions are preserved).\n   `NeverEnabled` → no versions exist, nothing to clean.\n2. **Object Lock** — if `Compliance` mode is active with retention,\n   versions CANNOT be deleted or overwritten until retention expires\n   (not even by root). `Governance` mode permits deletion with\n   `s3:BypassGovernanceRetention` permission.\n3. **Legal holds** — per-object `LegalHold: ON` prevents deletion\n   regardless of lifecycle, Object Lock mode, or retention. Check\n   via `get-object-legal-hold` for specific objects.\n4. **Existing lifecycle rules** — `put-bucket-lifecycle-configuration`\n  **REPLACES** the entire configuration, not merges. Read existing\n   rules first and merge new rules; otherwise you silently delete\n   existing transitions\u002Fexpirations.\n5. **MFA Delete** — if `MFADelete: Enabled` on the bucket, version\n   deletion and lifecycle rule changes require MFA. Plan for the\n   additional auth step.\n6. **Bucket Key** — `BucketKeyEnabled: true` reduces KMS request cost\n   on encrypted buckets (~99% reduction). Recommend enabling alongside\n   lifecycle changes.\n\n**Cost\u002Fsavings baselines (2026 us-east-1):**\n\n- Standard storage: ~$0.023\u002FGB-month.\n- Standard-IA: ~$0.0125\u002FGB-month (50% cheaper, but 30-day minimum +\n  retrieval fee).\n- Glacier Instant Retrieval: ~$0.004\u002FGB-month (~83% cheaper).\n- Glacier Flexible Retrieval: ~$0.0036\u002FGB-month (~84% cheaper).\n- Glacier Deep Archive: ~$0.00099\u002FGB-month (~96% cheaper).\n- One-time delete via lifecycle or Batch Operations: free (no per-delete\n  charge).\n- S3 Batch Operations: ~$1.00 per million objects processed.\n\n**Rule of thumb:** versioned buckets with frequent overwrites\naccumulate noncurrent versions at the same rate as the overwrite\nfrequency × object size. A 1 GB log file overwritten hourly = 24\nnoncurrent versions\u002Fday × $0.023\u002FGB ≈ $0.55\u002Fmonth — scales linearly\nwith overwrite count.\n\n## Mindset\n\n**One-line takeaway:** versioned buckets accumulate noncurrent versions\nindefinitely at standard storage rates — version cleanup is the #1 S3\ncost optimization after storage-class transitions. Driven by four\nrealities:\n\n- **Every noncurrent version bills at full Standard rate by default.**\n  Unlike S3 IA or Glacier, noncurrent versions are NOT automatically\n  tiered. A 1 GB file overwritten 100 times is 100 GB of Standard\n  storage — 100x the cost of the current version alone.\n- **Object Lock Compliance mode is irrevocable.** If Compliance mode is\n  active with retention until 2030, no one (including root, including\n  AWS support) can delete those versions before 2030. This is the\n  correct posture for ransomware-resilient backups — and a hard block\n  for version cleanup.\n- **`put-bucket-lifecycle-configuration` REPLACES, not merges.** Every\n  operator who forgets this silently deletes the existing lifecycle\n  rules — transitions, expirations, abort-multipart rules — and the\n  bucket reverts to \"no lifecycle\" until the operator notices (usually\n  via a cost spike months later).\n- **Legal holds override everything.** A single `LegalHold: ON` on one\n  object blocks its deletion regardless of Object Lock mode, retention,\n  lifecycle rules, or root access. Legal holds are per-object; bulk\n  cleanup requires checking each object (or using Batch Operations with\n  a manifest).\n\n## Pre-flight: bucket metadata gate\n\nRun before classification. Misclassifying these produces wrong plans.\n\n**Pagination:** `list-object-versions` paginates at 1000 keys\u002Fpage —\ndrain `--key-marker` and `--version-id-marker` to completion. Use S3\nStorage Lens for account-wide noncurrent version metrics instead of\nenumerating every bucket.\n\n**Live-account pre-flight (skip if offline plan audit):**\n1. `aws s3api get-bucket-versioning --bucket \u003Cname>` — confirm\n   `Status: Enabled`. Capture `MFADelete` (if enabled, plan for MFA).\n2. `aws s3api get-bucket-lifecycle-configuration --bucket \u003Cname>` —\n   capture existing rules. NEVER overwrite without first reading.\n3. `aws s3api get-object-lock-configuration --bucket \u003Cname>` — capture\n   `ObjectLockEnabled` and `Rule.DefaultRetention` (Mode, Days, Years).\n4. `aws s3api get-public-access-block --bucket \u003Cname>` — context only.\n5. `aws s3api get-bucket-encryption --bucket \u003Cname>` — capture\n   `BucketKeyEnabled` (recommend enabling if false and SSE-KMS in use).\n6. `aws s3api list-object-versions --bucket \u003Cname --max-keys 1000` —\n   sample the noncurrent version count and average size for impact\n   estimation.\n7. `aws s3control get-storage-lens-configuration --config-id default`\n   — capture account-level `NoncurrentVersionCount` and\n   `NoncurrentVersionStorageBytes`.\n8. For specific objects being cleaned: `aws s3api get-object-legal-hold\n   --bucket \u003Cname> --key \u003Ckey> --version-id \u003Cvid>` — verify no legal\n   hold before batch-delete.\n\n**Malformed input:** if the input JSON is invalid or missing required\nfields, emit `VERDICT: ERROR` with `REASON: Bucket\u002Foperation\nconfiguration is not valid JSON or is missing required fields — cannot\nplan.` and `REMEDIATION: Re-fetch with aws s3api get-bucket-versioning\n--bucket \u003Cname> --output json and re-plan.`\n\n| Bucket attribute | Effect on operation |\n|---|---|\n| `Status: Enabled` (versioning) | Cleanup proceeds normally. Noncurrent versions are eligible for lifecycle rules. |\n| `Status: Suspended` | New puts create a null-version-id object (replacing the prior null version, which becomes noncurrent). OLD versions from before suspension are still preserved. Lifecycle rules apply only to noncurrent versions created before suspension. Plan carefully — typically the operator should re-enable versioning before cleanup. |\n| Versioning never enabled | No versions exist. Nothing to clean. Emit BLOCKED with \"versioning never enabled — no noncurrent versions to clean up\". |\n| `MFADelete: Enabled` | Version deletion and lifecycle rule changes require MFA. Plan for additional auth step (MFA token in CLI call). |\n| `ObjectLockEnabled: Enabled`, `DefaultRetention.Mode: COMPLIANCE` | Versions within the retention window CANNOT be deleted by anyone — BLOCKED for in-retention versions. Lifecycle rules still apply to versions PAST retention. |\n| `ObjectLockEnabled: Enabled`, `DefaultRetention.Mode: GOVERNANCE` | Versions can be deleted with `s3:BypassGovernanceRetention` permission. Lifecycle rules apply normally; Governance mode provides a softer guardrail. |\n| Object-level `LegalHold: ON` | That specific version cannot be deleted by anyone. Lifecycle rules skip it silently. Bulk cleanup must check each object. |\n| Existing lifecycle rules referencing the same prefix | `put-bucket-lifecycle-configuration` REPLACES. Merge new rules into the existing config or you silently delete existing transitions. |\n| `BucketKeyEnabled: false` with SSE-KMS | Each noncurrent version incurs a KMS `GenerateDataKey` charge on access. Recommend enabling Bucket Key alongside lifecycle changes. |\n| Bucket in a different AWS account | Caller needs cross-account IAM permissions on both sides. Verify before planning. |\n\n## Process — operation planning (apply in order)\n\n### Step 0: Expert knowledge — non-obvious S3 versioning behaviors\n\nNon-obvious versioning behaviors — REPLACES-not-merges lifecycle PUT, NoncurrentVersionExpiration vs NewerNoncurrentVersions, NoncurrentDays semantics, 24-hour async rule apply, delete markers, Object Lock modes, legal holds, Storage Lens, GIR vs Flexible, Bucket Key, CRR\u002FSRR replicas, Intelligent-Tiering — live in [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad that reference before planning configure-lifecycle or batch-delete-versions.\n\n### Step 1: Pre-check gate — BLOCKED if any check fails\n\nRun ALL of the following pre-checks. If ANY fails, the verdict is\nBLOCKED with the failed checks enumerated in PRE_CHECKS. Do NOT\nexecute the operation.\n\n**For ALL operations:**\n1. Caller has `s3:GetBucketVersioning`, `s3:GetLifecycleConfiguration`,\n   `s3:PutLifecycleConfiguration` on the bucket ARN.\n2. Bucket exists in the expected region and account.\n3. Bucket name is correct (S3 bucket names are globally unique;\n   verify the region matches the expectation).\n\n**For configure-lifecycle (add\u002Fmodify lifecycle rules):**\n4. Versioning state is `Enabled` (or `Suspended` with explicit\n   acknowledgment — see Step 0 for behavior differences).\n5. Existing lifecycle rules captured via\n   `get-bucket-lifecycle-configuration` — new rules must be MERGED\n   into the existing config, not REPLACE it.\n6. No conflicting rules (same prefix + overlapping actions with\n   different NoncurrentDays values).\n7. Object Lock configuration captured — Compliance-mode retention\n   overrides NoncurrentVersionExpiration for in-retention versions.\n\n**For batch-delete-versions (immediate cleanup via Batch Operations):**\n4. Versioning state is `Enabled`.\n5. S3 Inventory configured OR a manifest generated via\n   `list-object-versions` (paginated). Batch Operations needs a\n   manifest of object-key + version-id pairs.\n6. No Object Lock Compliance-mode versions in the manifest (delete\n   would fail per-object; the job continues but reports failures).\n7. No legal-hold ON objects in the manifest (same per-object failure\n   behavior).\n8. IAM role for Batch Operations has `s3:DeleteObjectVersion` on the\n   bucket AND `iam:PassRole` to assign the execution role.\n\n**For estimate-savings (impact audit):**\n4. S3 Storage Lens enabled at the account or bucket level.\n5. Sample `list-object-versions` captured (1000 keys) to estimate\n   average version count and size.\n\n### Step 2: READY — emit operation plan\n\nIf all pre-checks pass, emit `VERDICT: READY` with the exact CLI\u002FJSON\nsequence and the CONFIRM gate. The plan includes:\n\n- The exact AWS CLI command with the merged lifecycle JSON.\n- The estimated monthly savings (computed from noncurrent version\n  count × average size × storage rate).\n- The expected timeline (lifecycle rules apply within 24 hours of\n  eligibility; Batch Operations jobs run in minutes-to-hours).\n- The CONFIRM gate prompt.\n\n### Step 3: Execute behind CONFIRM gate\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing CLI,\n  emit: `CONFIRM: About to \u003Coperation> on bucket \u003Cname> in account\n  \u003Caccount> region \u003Cregion>. This will \u003Cconsequence>. Estimated\n  monthly savings: $\u003Camount>. Proceed? (yes\u002Fno)`. Do NOT execute\n  until the operator confirms.\n- Capture pre-state for audit:\n  `aws s3api get-bucket-lifecycle-configuration --bucket \u003Cname>\n  --output json > \u002Ftmp\u002F\u003Cname>-lifecycle-pre-$(date +%s).json`.\n- Execute the CLI. For `put-bucket-lifecycle-configuration`, PUT\n  the merged JSON (NEVER the new rules alone). For Batch Operations,\n  capture the JobId.\n- Verify the operation:\n  `get-bucket-lifecycle-configuration` shows the new rules;\n  `describe-job` shows Batch Operations progress.\n\n### Step 4: Post-verification — COMPLETED\n\nAfter the operation finishes, run post-verification. ALL checks must\npass for `COMPLETED`.\n\n1. `get-bucket-lifecycle-configuration --bucket \u003Cname>` — confirm\n   the new rules are present AND existing rules are preserved (no\n   silent deletion).\n2. For Batch Operations: `aws s3control describe-job --account-id\n   \u003Cacct> --job-id \u003Cid>` — confirm `Status: Complete`,\n   `NumberOfTasksSucceeded` matches expected.\n3. Wait 24-48 hours, then re-check Storage Lens\n   `NoncurrentVersionCount` and `NoncurrentVersionStorageBytes` —\n   they should drop.\n4. Verify no compliance violations (Object Lock retention respected,\n   no legal-hold objects deleted).\n5. Verify the expected cost drop in AWS Cost Explorer (S3 service,\n   filtered by bucket tag or usage type) — allow 1-3 days for billing\n   lag.\n6. For lifecycle rules: verify the rule prefix filter is correct\n   (does not accidentally match unintended prefixes).\n7. Document the savings in NOTES for the operator's reporting.\n\nIf ANY verification fails, emit `VERDICT: ERROR` with the failure\ndetails — do not claim COMPLETED.\n\n## Output format (per operation)\n\n```text\nOPERATION: \u003Cconfigure-lifecycle | batch-delete-versions | estimate-savings | audit-versions>\nVERDICT: READY | BLOCKED | COMPLETED\nTARGET: \u003Cbucket-name>\nPRE_CHECKS:\n  - [PASS] \u003Ccheck description>\n  - [FAIL] \u003Ccheck description> — \u003Creason>\nSTEPS:\n  1. \u003CCLI command with flags populated>\n  2. \u003Cwait\u002Fpoll command>\n  3. \u003Cnext step>\nPOST_VERIFY:\n  - [PASS] \u003Cverification description>\n  - [FAIL] \u003Cverification description> — \u003Creason>\nESTIMATED_SAVINGS: \u003C$X\u002Fmonth (computed from N noncurrent versions × avg size × rate)>\nNOTES: \u003Ccompliance caveats, Object Lock implications, cleanup timeline>\n```\n\n### Worked examples (see references\u002Fworked-examples.md)\n\nThree full end-to-end worked examples live in\n`references\u002Fworked-examples.md`:\n\n- **READY — configure lifecycle (3-rule cleanup).** Demonstrates\n  NewerNoncurrentVersions=3 + NoncurrentVersionTransition to IA and\n  GIR, merged into 3 existing rules. ~$312\u002Fmonth savings.\n- **BLOCKED — Object Lock Compliance mode.** Shows the irrevocable\n  retention block, enumerates the 4,287 in-retention versions, and\n  recommends NoncurrentVersionTransition as the only viable path.\n- **READY — Batch Operations immediate cleanup.** 2.5M noncurrent\n  versions via S3 Inventory manifest; ~$2.50 Batch Operations cost;\n  ~$825\u002Fmonth savings.\n\nEach example demonstrates the exact PRE_CHECKS, STEPS with CONFIRM\ngate, POST_VERIFY, and NOTES for the verdict shape.\n\n## STRICT output contract\n\nThis contract is mandatory. The Output format template above is the\nauthoritative structure; the rules below disambiguate the failure\nmodes that score D8=13 on this skill. Violating any rule produces a\nplan that is unsafe to execute.\n\n### Required output structure\n\nEvery operation MUST emit this exact block, with all fields populated\n(no empty fields, no omitted sections, no reordering):\n\n```text\nOPERATION: \u003Cconfigure-lifecycle | batch-delete-versions | estimate-savings | audit-versions>\nVERDICT: READY | BLOCKED | COMPLETED\nTARGET: \u003Cbucket-name>\nPRE_CHECKS:\n  - [PASS] \u003Ccheck description>\n  - [FAIL] \u003Ccheck description> — \u003Creason>\nSTEPS:\n  1. \u003CCLI command with flags populated>\n  2. \u003Cwait\u002Fpoll command>\nPOST_VERIFY:\n  - [PASS] \u003Cverification description>\n  - [FAIL] \u003Cverification description> — \u003Creason>\nESTIMATED_SAVINGS: \u003C$X\u002Fmonth (computed from N versions × avg size × rate)>\nNOTES: \u003Ccompliance caveats, Object Lock implications, cleanup timeline>\n```\n\nVerdict-specific rules:\n- `BLOCKED` → at least one PRE_CHECKS line shows `[FAIL]` with a\n  concrete reason; STEPS is `(none — pre-checks failed)`; no\n  state-changing CLI is emitted.\n- `READY` → all PRE_CHECKS show `[PASS]`; STEPS begins with the\n  CONFIRM gate prompt before any state-changing CLI; POST_VERIFY is\n  `(pending execution)`; ESTIMATED_SAVINGS cites the storage math.\n- `COMPLETED` → all POST_VERIFY show `[PASS]`; STEPS reflects what\n  was actually executed; ESTIMATED_SAVINGS is the realised (not\n  estimated) savings if measurable.\n\n### FORBIDDEN output patterns\n\n1. NEVER recommend NoncurrentVersionExpiration without checking Object\n   Lock — Compliance mode makes versions immutable regardless of\n   lifecycle rules. A READY plan that did not run\n   `get-object-lock-configuration` and confirm the mode is invalid.\n2. NEVER suggest put-bucket-lifecycle-configuration as a merge — it\n   REPLACES the entire configuration. Always read-merge-write: call\n   `get-bucket-lifecycle-configuration`, merge the new rules into the\n   existing JSON, then PUT the merged payload. A STEPS entry that PUTs\n   only the new rules is a data-loss bug.\n3. NEVER conflate `Expiration` (current version) with\n   `NoncurrentVersionExpiration` (noncurrent versions). `Expiration`\n   creates a delete marker on versioned buckets; it does NOT remove\n   old versions. A STEPS entry using the wrong action cleans up\n   nothing.\n4. NEVER emit `VERDICT: READY` without the CONFIRM gate as the first\n   STEPS item. State-changing CLIs (lifecycle PUT, `delete-objects`,\n   `create-job`) require explicit operator approval before execution;\n   emitting the CLI without the CONFIRM prompt is a violation.\n5. NEVER attempt to delete objects with `LegalHold: ON`. Legal hold\n   overrides all lifecycle and Object Lock settings. A batch-delete\n   plan that did not sample `get-object-legal-hold` is incomplete —\n   per-object failures will occur silently mid-job.\n6. NEVER output `VERDICT: BLOCKED` without enumerating each failed\n   PRE_CHECK with a `[FAIL]` line and a reason. A bare \"BLOCKED —\n   pre-checks failed\" with no itemised failures is not actionable.\n7. NEVER assume lifecycle rules apply in real time. S3 processes\n   rules asynchronously within 24 hours of eligibility. A COMPLETED\n   verdict that claims immediate cost reduction without the 24-48h\n   verification window is misleading.\n\n### Perfect example output\n\n```text\nOPERATION: configure-lifecycle\nVERDICT: READY\nTARGET: s3:\u002F\u002Fprod-logs-bucket\nPRE_CHECKS:\n  - [PASS] Bucket exists in us-east-1 account 111111111111\n  - [PASS] Versioning Status: Enabled\n  - [PASS] MFADelete: Disabled (no MFA required)\n  - [PASS] ObjectLockEnabled: Disabled (no Compliance\u002FGovernance\n    retention — NoncurrentVersionExpiration is safe)\n  - [PASS] Existing lifecycle rules captured (3 rules: current-version\n    transition, current-version expiration on logs\u002F prefix,\n    abort-multipart-upload 7d) via get-bucket-lifecycle-configuration\n  - [PASS] New rules MERGED into existing config (not replacing) —\n    PUT payload contains all 5 rules\n  - [PASS] BucketKeyEnabled: true (no KMS optimization gap)\n  - [PASS] Caller has s3:PutLifecycleConfiguration\nSTEPS:\n  1. CONFIRM: About to put-bucket-lifecycle-configuration on\n     s3:\u002F\u002Fprod-logs-bucket in account 111111111111 region us-east-1.\n     This will ADD NoncurrentVersionExpiration (NoncurrentDays: 90)\n     and NoncurrentVersionTransition (STANDARD_IA at 30d, GIR at 90d)\n     to the existing 3 rules. Existing rules preserved in the merged\n     payload. Estimated monthly savings: $312\u002Fmonth. Proceed? (yes\u002Fno)\n  2. aws s3api put-bucket-lifecycle-configuration \\\n       --bucket prod-logs-bucket \\\n       --lifecycle-configuration file:\u002F\u002F\u002Ftmp\u002Fprod-logs-bucket-merged-lifecycle.json\n  3. aws s3api get-bucket-lifecycle-configuration \\\n       --bucket prod-logs-bucket --output json\nPOST_VERIFY:\n  - (pending execution)\nESTIMATED_SAVINGS: $312\u002Fmonth (13.5 TB noncurrent × $0.023\u002FGB-month;\n  after transition to IA + GIR: $95\u002Fmonth; net savings $217\u002Fmonth)\nNOTES:\n  - Lifecycle rules apply within 24 hours of eligibility. Allow 24-48\n    hours for the first noncurrent versions to transition\u002Fexpire.\n  - The existing 3 rules are PRESERVED in the merged config — verified\n    by reading the post-PUT lifecycle configuration in Step 3.\n  - For immediate cleanup of versions already older than 90d, use S3\n    Batch Operations (separate operation).\n```\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER execute `put-bucket-lifecycle-configuration` without first\n   reading existing rules.** The PUT REPLACES the entire configuration\n   — silently deleting existing transitions and expirations is the #1\n   S3 lifecycle mistake. Always read-merge-write.\n\n2. **NEVER attempt to delete versions in an Object Lock Compliance-mode\n   bucket within the retention window.** NO ONE — including root,\n   including AWS support — can delete them. Apply lifecycle transitions\n   instead; versions past retention will transition.\n\n3. **NEVER attempt to delete objects with `LegalHold: ON` or conflate\n   `Expiration` with `NoncurrentVersionExpiration`.** Legal hold\n   overrides all settings (check via `get-object-legal-hold`). \n   `Expiration` creates a delete marker on versioned buckets; it does\n   NOT remove old versions — use `NoncurrentVersionExpiration`.\n\n4. **NEVER auto-execute a state-changing S3 CLI without the CONFIRM\n   gate, and NEVER skip the post-PUT lifecycle verification.** Lifecycle\n   PUTs and Batch Operations jobs have side effects; a malformed JSON\n   can be silently rejected. Always emit CONFIRM, wait, then re-read.\n\n5. **NEVER recommend S3 Batch Operations without estimating the\n   per-million-object cost (~$1.00\u002Fmillion) and never use\n   `list-object-versions` as the manifest source for large buckets.**\n   Use S3 Inventory for buckets with millions of versions; paginating\n   `list-object-versions` is too slow and consumes API quota.\n\nAdditional NEVER rules (MFADelete check, compliance retention\nverification, GIR vs Flexible latency, CRR\u002FSRR replica lifecycle,\nIntelligent-Tiering monitoring fee, Bucket Key, `delete-objects` with\nversion IDs, cross-account IAM) appear in the FORBIDDEN output\npatterns section above and in `references\u002Flifecycle-rule-patterns.md`.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\nThe full pre-flight safety checklist — confirm gate, pre-state capture, versioning\u002FObject Lock\u002Flegal-hold verification, read-merge-write lifecycle, cleanup timeline, prefix verification — lives in [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nRun these before any remediation CLI.\n\n## Recent AWS features (2024-2026)\n\nRecent AWS features 2024-2026 — Intelligent-Tiering 90-day archive default, GIR lifecycle GA, S3DeleteObjectVersion in Batch Operations, Governance bypass logging, Storage Lens dimensions, Bucket Key defaults, lifecycle conflict warnings — live in [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad when planning rules on buckets that use these features.\n\n## References (load on demand)\n\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — full end-to-end worked examples (READY lifecycle, BLOCKED Object Lock, READY Batch Operations)\n- [references\u002Flifecycle-rule-patterns.md](references\u002Flifecycle-rule-patterns.md) — lifecycle JSON anatomy, expiration-vs-keep heuristic, Batch Operations cost table\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step-0 non-obvious versioning behaviors and recent AWS features (2024-2026)\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — pre-flight safety checks and pre-state capture commands\n\n## Domain\n\nAWS CloudOps \u002F S3 Storage Cost Optimization & Compliance Retention.\n\n## Expert heuristic and Batch Operations cost (see references\u002Flifecycle-rule-patterns.md)\n\nThe full NoncurrentVersionExpiration-vs-NewerNoncurrentVersions\nheuristic (with defense-in-depth JSON example and common-mistake\nanalysis) and the S3 Batch Operations per-million-object cost\ncomparison table (with payback-period maths and decision rule) live\nin `references\u002Flifecycle-rule-patterns.md`.\n\n## AWS documentation\n\n- **Amazon S3 User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002FWelcome.html\n- **S3 Versioning** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002FVersioning.html\n- **S3 Lifecycle configuration** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fobject-lifecycle-mgmt.html\n- **S3 Object Lock** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fobject-lock.html\n- **S3 Batch Operations** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fbatch-operations.html\n- **S3 Storage Lens** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fstorage_lens.html\n- **AWS CLI s3api reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fs3api\u002F\n- **Bucket Key** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonS3\u002Flatest\u002Fuserguide\u002Fbucket-key.html\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":43},{"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,"dependencies":37,"requires_llm":38,"verdict_shape":39,"lifecycle_status":40,"invocation_schema":41,"supports_pipeline":38,"activation_triggers":42},"s3, storage, versioning, lifecycle, cost-optimization, object-lock, batch-operations","4","Jacky Chan — AWS Community Builder","aws-cloudops","Storage","0.1.0","S3, versioning, noncurrent versions, NoncurrentVersionExpiration, NoncurrentVersionTransition, NewerNoncurrentVersions, lifecycle rule, AbortIncompleteMultipartUpload, S3 Batch Operations, Object Lock, Compliance mode, Governance mode, legal hold, S3 Storage Lens, cost optimization, version cleanup, delete markers, BucketKeyEnabled","operate","medium","false","capability","Auditing S3 noncurrent version accumulation, configuring version cleanup lifecycle rules (NoncurrentVersionExpiration, NoncurrentVersionTransition, NewerNoncurrentVersions), planning immediate version cleanup via S3 Batch Operations, handling Object Lock retention before cleanup, estimating S3 version cleanup savings, or hardening S3 cost posture on versioned buckets.","aws-orchestrator","true","READY | BLOCKED | COMPLETED","active","Input: either (a) a bucket configuration with the intended operation (configure-lifecycle, batch-delete-versions, audit- versions, estimate-savings), OR (b) a bucket name + operation for live-account execution. Output: deterministic OPERATION\u002FVERDICT\u002F PRE_CHECKS\u002FSTEPS\u002FPOST_VERIFY block per operation, where VERDICT is one of READY, BLOCKED, COMPLETED.","clean up S3 versions, S3 noncurrent versions cost, configure S3 lifecycle NoncurrentVersionExpiration, S3 version cleanup, S3 Object Lock retention, S3 legal hold, S3 Batch Operations delete versions, S3 cost optimization versions, S3 Storage Lens noncurrent, abort multipart upload S3, S3 NewerNoncurrentVersions, versioned bucket cleanup, S3 lifecycle configuration","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline plan classification. Live-account operations use aws s3api get-bucket-versioning, put-bucket-versioning, get-bucket-lifecycle-configuration, put-bucket-lifecycle-configuration, get-object-lock-configuration, get-object-legal-hold, list-object-versions, delete-objects, and aws s3control create-job (S3 Batch Operations) (AWS CLI v2, SSO or key-based credentials).","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fs3-version-cleanup-operator",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":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill s3-version-cleanup-operator",{"tool":58,"command":59},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill s3-version-cleanup-operator",{"tool":61,"command":62},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill s3-version-cleanup-operator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002FSKILL.md",true,[66,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",9454,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Feval\u002Ftest-cases.yaml",{"path":73,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":74,"sourceHtmlUrl":75},"evals\u002Fbaselines\u002Fbatch-ops-immediate-cleanup-ready.md",769,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fbaselines\u002Fbatch-ops-immediate-cleanup-ready.md",{"path":77,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":78,"sourceHtmlUrl":79},"evals\u002Fbaselines\u002Flegal-hold-blocks-batch-delete.md",779,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fbaselines\u002Flegal-hold-blocks-batch-delete.md",{"path":81,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":82,"sourceHtmlUrl":83},"evals\u002Fbaselines\u002Flifecycle-merge-no-replace.md",700,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fbaselines\u002Flifecycle-merge-no-replace.md",{"path":85,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":86,"sourceHtmlUrl":87},"evals\u002Fbaselines\u002Flifecycle-verified-completed.md",380,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fbaselines\u002Flifecycle-verified-completed.md",{"path":89,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":90,"sourceHtmlUrl":91},"evals\u002Fbaselines\u002Fobject-lock-compliance-blocked.md",1073,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fbaselines\u002Fobject-lock-compliance-blocked.md",{"path":93,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":94,"sourceHtmlUrl":95},"evals\u002Feval_config.yaml",1900,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Feval_config.yaml",{"path":97,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":98,"sourceHtmlUrl":99},"evals\u002Fevals.json",4484,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fevals.json",{"path":101,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":102,"sourceHtmlUrl":103},"evals\u002Fprompts\u002Fbatch-ops-immediate-cleanup-ready.md",1301,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fprompts\u002Fbatch-ops-immediate-cleanup-ready.md",{"path":105,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":106,"sourceHtmlUrl":107},"evals\u002Fprompts\u002Flegal-hold-blocks-batch-delete.md",912,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fprompts\u002Flegal-hold-blocks-batch-delete.md",{"path":109,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":110,"sourceHtmlUrl":111},"evals\u002Fprompts\u002Flifecycle-merge-no-replace.md",1680,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fprompts\u002Flifecycle-merge-no-replace.md",{"path":113,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":114,"sourceHtmlUrl":115},"evals\u002Fprompts\u002Flifecycle-verified-completed.md",1753,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fprompts\u002Flifecycle-verified-completed.md",{"path":117,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":118,"sourceHtmlUrl":119},"evals\u002Fprompts\u002Fobject-lock-compliance-blocked.md",958,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fevals\u002Fprompts\u002Fobject-lock-compliance-blocked.md",{"path":121,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":122,"sourceHtmlUrl":123},"examples\u002FREADME.md",11951,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fexamples\u002FREADME.md",{"path":125,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":126,"sourceHtmlUrl":127},"references\u002Fadvanced-patterns.md",5199,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Freferences\u002Fadvanced-patterns.md",{"path":129,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":130,"sourceHtmlUrl":131},"references\u002Fdiagnostic-commands.md",2086,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Freferences\u002Fdiagnostic-commands.md",{"path":133,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":134,"sourceHtmlUrl":135},"references\u002Flifecycle-rule-patterns.md",16584,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Freferences\u002Flifecycle-rule-patterns.md",{"path":137,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":138,"sourceHtmlUrl":139},"references\u002Fworked-examples.md",6429,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Freferences\u002Fworked-examples.md",{"path":141,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":142,"sourceHtmlUrl":143},"skill.usf.yaml",4594,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fs3-version-cleanup-operator\u002Fskill.usf.yaml",[145,152,159,166,173,180],{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"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":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"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":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"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":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"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":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":179,"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":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"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",[],[]]