[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AA0XKTASH9TNC1VXZJD6R2":3,"skill-same:01M7AA0XKTASH9TNC1VXZJD6R2":149},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M7AA0XKTASH9TNC1VXZJD6R2","macie-cost-optimizer",null,"Optimises Amazon Macie cost across seven dimensions: discovery mode selection (automated data discovery vs one-off targeted classification jobs — automated manages scope and is cheaper for recurring coverage), scan frequency tuning (daily vs weekly for large data lakes, balancing detection latency against per-GB assessment cost), bucket selection (excluding infrequently accessed, known-safe, and log\u002Farchive buckets from sensitive-data scans), S3 object sampling vs full scan (Macie samples S3 objects per bucket — understanding the sampling depth vs full classification trade-off), custom data identifier cost (regex evaluation runs per evaluated object — over-broad custom identifiers multiply assessment cost), managed data identifier scope reduction (selecting only relevant managed identifiers instead of all), finding suppression rules (suppress known-safe prefixes to prevent re-evaluation cost and reduce noise), multi-account Macie administrator delegation (single delegated Macie administrator vs per-accoun...","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\u002Fmacie-cost-optimizer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: macie-cost-optimizer\ndescription: 'Optimises Amazon Macie cost across seven dimensions: discovery mode selection (automated data discovery vs one-off targeted classification jobs — automated manages scope and is cheaper for recurring coverage), scan frequency tuning (daily vs weekly for large data lakes, balancing detection latency against per-GB assessment cost), bucket selection (excluding infrequently accessed, known-safe, and log\u002Farchive buckets from sensitive-data scans), S3 object sampling vs full scan (Macie samples S3 objects per bucket — understanding the sampling depth vs full classification trade-off), custom data identifier cost (regex evaluation runs per evaluated object — over-broad custom identifiers multiply assessment cost), managed data identifier scope reduction (selecting only relevant managed identifiers instead of all), finding suppression rules (suppress known-safe prefixes to prevent re-evaluation cost and reduce noise), multi-account Macie administrator delegation (single delegated Macie administrator vs per-accoun...'\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline recommendation classification works from pasted Macie job configs, bucket statistics, and Cost Explorer Macie line items. Live-account optimization uses aws macie2 get-classification-scope, aws macie2 get-sensitive-data-discovery-jobs, aws macie2 describe-job-creation, aws macie2 get-findings, aws macie2 get-bac (bucket statistics), aws macie2 list-membership-accounts (Macie administrator), aws...\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: Security\n  task_type: optimize\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE\n  when_to_use: Optimising Amazon Macie cost, migrating from targeted classification jobs to automated data discovery, tuning scan frequency for a large S3 data lake, excluding known-safe or infrequently accessed buckets from Macie scans, reducing custom data identifier evaluation overhead, narrowing managed data identifier scope, configuring finding suppression rules to reduce re-evaluation, consolidating Macie onto a single delegated administrator account, or piping Macie classification exports to Athena for batch analysis.\n  when_not_to_use: GuardDuty cost (use guardduty-cost-optimizer), general S3 storage cost (use s3-lifecycle-optimizer), Security Hub finding remediation (use securityhub-finding-remediator), or Macie finding triage\u002Fidentification work (use macie-finding-triage). This skill focuses on cost-driven optimization decisions for Macie assessment spend, not on classifying the contents of a specific finding.\n  activation_triggers: optimise Macie cost, Macie spend too high, Macie classification job cost, Macie automated discovery, Macie targeted classification, Macie scan frequency, Macie daily scan cost, Macie bucket selection, Macie exclude buckets, Macie object sampling, Macie full scan cost, Macie custom data identifier, Macie managed data identifier, Macie suppression rules, Macie finding suppression, Macie delegated administrator, Macie multi-account, Macie classification export, Macie Athena export, Macie data lake cost, Macie FinOps, reduce Macie bill, security cost review\n  invocation_schema: 'Input: either (a) a Macie-enabled account or org context with job configurations and bucket statistics, (b) a Cost Explorer Macie cost line-item document, OR (c) Macie job configurations (jobType, scoping, managedDataIdentifierSelector, sampling) with at least 14 days of observation. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002FESTIMATED_SAVINGS\u002FMIGRATION_STEPS block per Macie scope, where VERDICT is one of OPTIMIZED, FURTHER_OPTIMIZATION_AVAILABLE, NEED_MORE_INFO.'\n  invocation_example: \"# Minimal valid input (offline job classification):\\nMacie administrator: delegated (org-management)\\nRegion: us-east-1\\nClassification jobs (last 30 days):\\n  - jobId: job-targeted-pci-scan\\n    jobType: ONE_TIME\\n    initialRun: daily schedule (recurring created as one-time)\\n    buckets: [data-lake-raw, data-lake-curated, access-logs]\\n    managedDataIdentifierSelector: ALL\\n    sampling: s3Scope with includes '*'\\n    jobsRun: 30, objectsEvaluated: 480,000,000, GBassessed: 12,400\\nAutomated discovery: ENABLED but scope excludes access-logs\\nCost Explorer (Service=Macie, last 30 days): $1,240\\nBucket statistics: 18 buckets, 4 are log\u002Farchive, 2 are known-safe\\nEmit the standard optimization block (TARGET, VERDICT, REASON,\\nRECOMMENDATION, ESTIMATED_SAVINGS, MIGRATION_STEPS).\"\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: Macie, Amazon Macie, data discovery, sensitive data, PII detection, cost optimization, automated discovery, targeted classification, classification job, scan frequency, bucket selection, object sampling, custom data identifier, managed data identifier, suppression rules, finding suppression, multi-account, delegated administrator, classification export, Athena analysis, data lake security, security FinOps\n  tags: macie, security, data-protection, cost-optimization, finops, sensitive-data, data-discovery\n---\n\n# Macie Cost Optimizer\n\n## What this skill does\n\nTranslates an Amazon Macie deployment's assessment posture into a concrete\ncost-optimization recommendation with a dollar-denominated savings\nestimate. The verdict is the highest-leverage action across seven\ndimensions — discovery mode, scan frequency, bucket selection, sampling,\ncustom identifier scope, managed identifier scope, suppression rules,\nmulti-account delegation, and export pipeline — applied in priority\norder. Always pairs the recommendation with exact CLI commands.\n\n## Quick navigation\n\n| Section | What it covers | When to jump here |\n|---|---|---|\n| Quick start | Five headline rules and the cost formula | First read |\n| Mindset | Why automated discovery beats targeted jobs for recurring coverage | Understanding the approach |\n| Quick reference — verdict thresholds | Decision matrix at a glance | Classifying a deployment |\n| Pre-flight data gate | Macie jobs, bucket stats, Cost Explorer | Before any recommendation |\n| Step 0 non-obvious behaviours | Sampling, suppression, identifier scope, delegation | Edge cases |\n| Step 1 Discovery mode | Automated vs targeted job selection | The headline savings dimension |\n| Step 2 Scan frequency | Daily vs weekly for large data lakes | Data lake deployments |\n| Step 3 Bucket selection | Exclude known-safe, infrequently accessed, logs | High bucket count |\n| Step 4 Sampling vs full scan | Sampling depth and per-object evaluation | Custom identifier cost |\n| Step 5 Custom & managed identifiers | Scope reduction, regex evaluation overhead | Identifier-heavy deployments |\n| Step 6 Suppression rules | Suppress known-safe prefixes to cut re-evaluation | Noisy finding deployments |\n| Step 7 Multi-account delegation | Single admin vs per-account | Org-wide deployments |\n| Step 8 Classification export | Pipe to S3 + Athena for batch analysis | Recurring query workloads |\n| Step 9 Impact estimation | The cost formula and worked math | Every recommendation |\n| Output format | VERDICT block + worked examples | Emitting the result |\n| Anti-Patterns — NEVER | Common misclassifications | Self-check before emit |\n| Pre-flight safety checks | CONFIRM gate, dry-run validation | Before any apply CLI |\n\n## Quick start\n\n- **Automated discovery is cheaper than recurring targeted jobs for\n  steady coverage.** Macie's automated data discovery manages scope\n  per bucket on the service side — a daily-recurring targeted job\n  scans the full included scope every run, multiplying per-GB cost.\n  Migrate recurring coverage to automated discovery; reserve one-time\n  targeted jobs for ad-hoc investigations.\n- **Cost formula (memorise this):**\n  `monthly_macie_cost = (GB_assessed_per_run × runs_per_month × $\u002FGB)\n                        + per_bucket_monthly_fee + finding_storage`\n- **Exclude known-safe and infrequently accessed buckets.** Log,\n  archive, and known-safe buckets add per-GB assessment cost with no\n  security value. Exclude them from the classification scope.\n- **Sampling is built in; full scans cost multiples.** Macie samples\n  S3 objects per bucket by default. Forcing deep\u002Ffull evaluation\n  multiplies per-object identifier cost — only do this for high-risk\n  buckets.\n- **Narrow managed identifier scope.** `managedDataIdentifierSelector: ALL`\n  evaluates every managed identifier per object. Selecting only the\n  relevant categories (e.g., `INCLUDE` for PII-only) reduces per-\n  object evaluation cost proportionally.\n\n## Mindset\n\n> The five Mindset principles moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — incremental automated discovery, sampling as cost control, identifier scope as multiplier, suppression, delegation.\n> Load them when framing a recommendation.\n\n## Quick reference — verdict thresholds\n\n| Observation (14-30 day window) | Verdict | Recommendation |\n|---|---|---|\n| Recurring targeted job covers what automated discovery could manage AND projected saving > 0 | **FURTHER_OPTIMIZATION_AVAILABLE** (discovery mode) | Step 1 — migrate to automated discovery |\n| Daily recurring job on a data lake with > 1 TB per run AND weekly cadence meets compliance | **FURTHER_OPTIMIZATION_AVAILABLE** (frequency) | Step 2 — reduce to weekly or on-demand |\n| Log\u002Farchive\u002Fknown-safe buckets included in job scope | **FURTHER_OPTIMIZATION_AVAILABLE** (bucket selection) | Step 3 — exclude via `s3Excludes` |\n| `sampling` forces deep evaluation AND no compliance requirement mandates full scan | **FURTHER_OPTIMIZATION_AVAILABLE** (sampling) | Step 4 — revert to default sampling |\n| `managedDataIdentifierSelector: ALL` AND workload only needs PII\u002Ffinancial categories | **FURTHER_OPTIMIZATION_AVAILABLE** (identifier scope) | Step 5 — narrow to relevant categories |\n| Custom identifiers run regex over every sampled object AND > 5 custom identifiers configured | **FURTHER_OPTIMIZATION_AVAILABLE** (custom identifiers) | Step 5 — consolidate or narrow custom identifier scope |\n| Repeated findings on known-safe prefixes (logs, public assets) with no suppression rule | **FURTHER_OPTIMIZATION_AVAILABLE** (suppression) | Step 6 — add suppression rule for known-safe prefix |\n| Per-account standalone Macie on accounts under a Macie-enabled org | **FURTHER_OPTIMIZATION_AVAILABLE** (delegation) | Step 7 — consolidate onto delegated administrator |\n| Recurring Macie console query cost for findings analysis | **FURTHER_OPTIMIZATION_AVAILABLE** (export) | Step 8 — pipe classification export to S3 + Athena |\n| All dimensions verified AND automated discovery + sampling + suppression + delegation all in place | **OPTIMIZED** | None — continue monitoring |\n| Cost Explorer Macie line items absent or window \u003C 14 days | **NEED_MORE_INFO** | Pull 14-30 day Cost Explorer Macie data, re-evaluate |\n\n## Pre-flight: data gate (run before any optimization decision)\n\nOptimization decisions are only as good as the underlying data. Pull\nthese signals before any recommendation. Full CLI sequences are in\n`references\u002Fmacie-pricing-and-discovery-modes.md`.\n\n**Required data sources** (summarized — see reference for full CLI):\n> The eight required data-source CLI listings moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md); full sequences are in references\u002Fmacie-pricing-and-discovery-modes.md.\n> Load it before pulling signals for a recommendation.\n\n### Data-quality short-circuits\n\n> The data-quality short-circuit table and the Cost-Explorer-vs-job-stats disagreement rule moved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\n> Load it when the data gate fails or numbers disagree.\n\n## Process — Optimization logic (apply in order)\n\n### Step 0: Non-obvious behaviours that change the recommendation\n\n> Step 0 deep-dive moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — incremental discovery, identifier-selector cost, per-bucket sampling, regex backtracking, suppression mechanics, delegation duplication, export one-way valve, bucketCriteria scope, storage-class irrelevance, free-tier limits.\n> Load it before classifying a deployment.\n\n### Step 1: Discovery mode — automated vs targeted jobs\n\nThe discovery mode is the primary cost lever because recurring targeted\njobs multiply per-GB cost linearly with the schedule frequency.\n\n**Pricing comparison:**\n```\nAutomated discovery:   per-GB fee on NEW\u002FCHANGED objects only, per bucket\n                       (incremental — service manages scope and cadence)\nTargeted job:          per-GB fee on the ENTIRE included scope, PER RUN\n                       (full-scan cost × runs_per_month)\n```\n\n**Decision tree:**\n```\nIs the job recurring (SCHEDULED) on a stable set of buckets?\n├── NO (ONE_TIME) → Keep as targeted job; this is the correct use.\n└── YES → Is the coverage achievable via automated discovery?\n    ├── NO (needs custom identifiers not supported by automated) → Keep targeted.\n    └── YES → Is the job effectively providing recurring coverage of\n              sensitive-data buckets that automated discovery already covers?\n        ├── YES → Migrate to automated discovery; disable the recurring job.\n        └── NO  → Keep targeted but reduce frequency (Step 2).\n```\n\n> The recurring-to-automated savings math and the 12 TB worked numbers moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\n> Load it when quantifying a discovery-mode migration.\n\n### Step 2: Scan frequency tuning\n\n> The frequency decision gate and the daily-to-weekly 7.5x reduction moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it when a targeted job must stay targeted.\n\n### Step 3: Bucket selection — exclude known-safe and infrequently accessed\n\nBucket selection is the third lever. Log, archive, system, and known-\nsafe buckets add per-GB cost with no security value.\n\n**Exclusion categories:**\n| Bucket type | Why exclude | How to detect |\n|---|---|---|\n| Access logs (S3 server access, CloudTrail, ALB) | No business data; pure audit log | Name pattern (`*-logs`, `*-cloudtrail`), `cloudtrail` prefix |\n| Archive \u002F cold storage | Rarely changes; out of compliance scope | Lifecycle policy transitions to Glacier |\n| System buckets | AWS service-managed; no customer data | Name starts with `aws-` or known service prefix |\n| Known-safe curated | Validated clean (e.g., public assets, images) | Prior Macie run with zero findings; suppression rule exists |\n| Infrequently accessed with no PII history | Per-GB fee not justified by risk | 90-day access pattern; no findings history |\n\n> The update-classification-scope exclusion CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\n> Load it when applying an exclusion.\n\n### Step 4: Sampling vs full scan\n\n> The sampling decision gate moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it when sampling depth is questioned.\n\n### Step 5: Custom and managed identifier scope reduction\n\nIdentifier scope is a per-object cost multiplier. Every selected\nidentifier runs against every sampled object.\n\n**Managed identifier scope:**\n```bash\n# Current scope\naws macie2 describe-classification-job --job-id \u003Cid> \\\n  --query 'managedDataIdentifierSelector'\n\n# Narrow from ALL to specific categories\naws macie2 update-classification-job \\\n  --job-id \u003Cid> \\\n  --managed-data-identifier-selector INCLUDE \\\n  --managed-data-identifier-ids \\\n    \"AWSManagedCredentialsKeywords,AWSManagedFinancialUS,AWSManagedPersonalUS\"\n```\n\n> The four-step custom identifier audit moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it when identifier-heavy.\n\n### Step 6: Suppression rules — cut re-evaluation\n\n> The create-findings-filter pattern and when-to-suppress list moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it for noisy-finding deployments.\n\n### Step 7: Multi-account Macie administrator delegation\n\n> The delegation check CLI and delegation savings math moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it for org-wide deployments.\n\n### Step 8: Classification export to S3 for batch analysis\n\n> The export setup CLI and Athena query pattern moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it for recurring query workloads.\n\n### Step 9: Impact estimation\n\nCompute the monthly savings for each recommendation:\n\n```\ncurrent_monthly_cost =\n  sum(GB_in_scope_per_job × runs_per_month × $\u002FGB_assessed) +\n  (bucket_count × per_bucket_monthly_fee) +\n  (finding_storage_GB × $\u002FGB_stored)\n\nprojected_monthly_cost =\n  sum(GB_new_or_changed_per_job × runs_per_month × $\u002FGB_assessed) +\n  (bucket_count_after_exclusion × per_bucket_monthly_fee) +\n  (finding_storage_GB_after_suppression × $\u002FGB_stored)\n\nmonthly_saving = current_monthly_cost − projected_monthly_cost\n```\n\nAlways state assumptions: GB assessed per run, runs per month, pricing\nregion, identifier scope, bucket count before\u002Fafter exclusion.\n\n### Step 10: Final verdict\n\n- Any dimension recommends a change → **FURTHER_OPTIMIZATION_AVAILABLE**.\n- All dimensions verified AND automated discovery + sampling + suppression\n  + delegation all in place → **OPTIMIZED**.\n- Change applied and verified this session → **OPTIMIZED** (post-state).\n- Data insufficient (Cost Explorer absent, window \u003C 14 days) →\n  **NEED_MORE_INFO**.\n\nNever emit `FURTHER_OPTIMIZATION_AVAILABLE` without first discharging\nevery `NEED_MORE_INFO`\u002F`BLOCKED` gate.\n\n## Output format\n\n> The annotated Output-format template moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md); the STRICT output contract below is the enforced shape.\n> Load it when emitting the result block.\n\n## STRICT output contract\n\nThe rules below are hard constraints. Violating any one produces a\nmisclassification or an arithmetic contradiction that breaks downstream\nFinOps automation. Self-check EVERY emitted block against these rules\nbefore returning the response.\n\n### Required output structure\n\nEvery response MUST be a single block using these literal labels, in this\norder. Do NOT substitute markdown headings, camelCase, or bold variants.\nThe CHECKLIST rows surface the current scan config vs recommended for\nevery optimization dimension so the operator can see the full posture\nin one read.\n\n```text\nMACIE_JOB: \u003Cmacie-deployment-or-job-id>\nVERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE | NEED_MORE_INFO | BLOCKED\nREASON: \u003C1-2 sentences naming the recommendation and the supporting data>\nCHECKLIST:\n  [→|✓]  Discovery mode        current: \u003Ctargeted SCHEDULED | ONE_TIME | automated>   recommended: \u003C...>\n  [→|✓]  Scan frequency        current: \u003Cdaily | weekly | monthly>                    recommended: \u003C...>\n  [→|✓]  Bucket selection      current: \u003CN buckets in scope>                          recommended: \u003CM buckets (exclude \u003Cnames>)>\n  [→|✓]  Object sampling       current: \u003Cdefault | deep\u002Ffull>                         recommended: \u003C...>\n  [→|✓]  Managed identifiers   current: \u003CALL | INCLUDE [...] >                        recommended: \u003C...>\n  [→|✓]  Custom identifiers    current: \u003CN configured, regex audited>                 recommended: \u003C...>\n  [→|✓]  Suppression rules     current: \u003C0 | N rules>                                 recommended: \u003C...>\n  [→|✓]  Multi-account deleg.  current: \u003Cstandalone | delegated admin (acct)>         recommended: \u003C...>\n  [→|✓]  Export pipeline       current: \u003Cnone | S3+Athena>                            recommended: \u003C...>\nESTIMATED_SAVINGS:\n  Current monthly: $\u003Camount>    ← MUST show assessment + per-bucket + finding-storage subtotals\n  Projected monthly: $\u003Camount>\n  Monthly saving: $\u003Camount>     ← MUST equal Current − Projected, 2 decimals\n  Annual saving: $\u003Camount>      ← MUST equal Monthly × 12\nMIGRATION_STEPS:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification step>\nCONFIRM: \u003Cconfirmation prompt text>\n```\n\n### FORBIDDEN output patterns\n\n1. **NEVER emit `VERDICT: FURTHER_OPTIMIZATION_AVAILABLE` with\n   `Monthly saving: $0.00`.** If every dimension nets zero cost delta,\n   the verdict MUST be `OPTIMIZED`.\n\n2. **NEVER show savings math that does not balance.**\n   `Current monthly − Projected monthly` MUST equal `Monthly saving`,\n   rounded to 2 decimal places.\n\n3. **NEVER emit scratch lines** (\"WAIT — recompute\", \"Hmm, let me redo\",\n   \"corrected:\") in the output. Finalize the math before emitting.\n\n4. **NEVER recommend a discovery mode change without citing job\n   configuration evidence.** The REASON MUST name the job type, run\n   frequency, and scope evidence.\n\n5. **NEVER omit a dimension from the CHECKLIST.** All nine rows MUST\n   appear, each marked `→` (finding, change recommended) or `✓`\n   (verified, no change). Inventing a 10th row or collapsing rows\n   together is a contract violation.\n\n6. **NEVER present a cost-neutral reconfiguration as \"cost savings.\"**\n   Surface the coverage\u002Flatency improvement explicitly in REASON and set\n   `Monthly saving: $0.00` with verdict `OPTIMIZED` (or\n   `FURTHER_OPTIMIZATION_AVAILABLE` ONLY if a different dimension has\n   positive saving).\n\n7. **NEVER round intermediate formula steps differently from the final\n   figure.** Compute at full precision, round only the displayed result.\n\n8. **NEVER substitute markdown headings, bold, or camelCase variants\n   for the literal labels** (`## Verdict`, `**VERDICT:**`, `verdict =`\n   are all invalid). The labels are parser-anchored.\n\n9. **NEVER emit a `→` row in CHECKLIST without a corresponding\n   MIGRATION_STEPS entry.** Every finding dimension MUST have a CLI\n   action that resolves it.\n\n### Perfect example output — FURTHER_OPTIMIZATION_AVAILABLE with verified math\n\nEvery field below is internally consistent and shows concrete monthly\nUSD figures. Copy this shape exactly.\n\n```text\nMACIE_JOB: macie-targeted-pci-scan-prod\nVERDICT: FURTHER_OPTIMIZATION_AVAILABLE\nREASON: Recurring daily targeted job covers a stable 12.4 TB data lake\n  that automated discovery could manage incrementally. 4 log\u002Farchive\n  buckets are in scope and add per-GB cost with no security value.\n  managedDataIdentifierSelector: ALL is overbroad for a PCI-only\n  compliance scope. Cost Explorer cross-check agrees with job stats.\nCHECKLIST:\n  [→] Discovery mode        current: targeted SCHEDULED job (nightly)           recommended: automated data discovery (incremental)\n  [→] Scan frequency        current: daily (30 runs\u002Fmonth)                      recommended: service-managed cadence\n  [→] Bucket selection      current: 18 buckets in scope (4 logs\u002Farchive)       recommended: 14 buckets (exclude access-logs-prod, cloudtrail-archive, alb-logs, public-assets)\n  [✓] Object sampling       current: default sampling                           recommended: default (no change)\n  [→] Managed identifiers   current: ALL (every managed ID per object)          recommended: INCLUDE [AWSManagedFinancialUS, AWSManagedCredentialsKeywords]\n  [✓] Custom identifiers    current: 3 configured, regex audited                recommended: keep (no change)\n  [→] Suppression rules     current: 0 rules                                    recommended: add 1 rule (ARCHIVE known-safe log prefixes)\n  [✓] Multi-account deleg.  current: delegated admin (org-management)           recommended: keep (no change)\n  [✓] Export pipeline       current: S3 + Athena                                recommended: keep (no change)\nESTIMATED_SAVINGS:\n  Current monthly: $37,210.00\n    assessment: 12,400 GB × 30 runs × $0.10\u002FGB = $37,200.00\n    per-bucket fees: 18 buckets × $0.50 = $9.00\n    finding storage: $1.00\n  Projected monthly: $629.00\n    assessment: 620 GB (5% monthly churn) × $0.10 = $62.00\n    per-bucket fees: 14 buckets × $0.50 = $7.00\n    automated discovery overhead + finding storage: $560.00\n  Monthly saving: $36,581.00    ($37,210.00 − $629.00 = $36,581.00 ✓)\n  Annual saving: $438,972.00    ($36,581.00 × 12 = $438,972.00 ✓)\n  Assumptions: 12,400 GB in scope per run, 30 runs\u002Fmonth, us-east-1 pricing,\n    5% monthly object churn for automated discovery, PCI-only identifier scope\nMIGRATION_STEPS:\n  1. Verify automated discovery coverage includes the data lake buckets:\n     aws macie2 get-automated-discovery-configuration\n     aws macie2 get-classification-scope --name default-scope\n  2. Exclude log\u002Farchive buckets from the classification scope:\n     aws macie2 update-classification-scope --name default-scope \\\n       --s3 '{\"excludes\":{\"bucketNames\":[\"access-logs-prod\",\"cloudtrail-archive\",\"alb-logs\",\"public-assets\"]}}'\n  3. Narrow managed identifier scope on any remaining targeted jobs:\n     aws macie2 update-classification-job --job-id job-targeted-pci-scan \\\n       --managed-data-identifier-selector INCLUDE \\\n       --managed-data-identifier-ids \"AWSManagedFinancialUS,AWSManagedCredentialsKeywords\"\n  4. Add a suppression rule for known-safe log prefixes:\n     aws macie2 create-findings-filter --name suppress-known-safe-logs \\\n       --action ARCHIVE \\\n       --finding-criteria '{\"criterion\":{\"s3Bucket.name\":{\"eq\":[\"access-logs-prod\",\"cloudtrail-archive\"]}}}'\n  5. Disable the recurring targeted job once automated discovery is\n     confirmed covering the same buckets:\n     aws macie2 update-classification-job --job-id job-targeted-pci-scan --status DISABLED\n  6. Monitor Cost Explorer (Service=Macie) for 7 days post-change:\n     aws ce get-cost-and-usage --filter '{\"Dimensions\":{\"Key\":\"SERVICE\",\"Values\":[\"Macie\"]}}'\nCONFIRM: About to migrate macie-targeted-pci-scan-prod from recurring\n  daily targeted job to automated discovery, exclude 4 log\u002Farchive\n  buckets, narrow identifier scope to PCI categories, and add 1\n  suppression rule. Monthly saving $36,581.00 (98.3% reduction).\n  Proceed? (yes\u002Fno)\n```\n\n### Perfect example output — OPTIMIZED (no change recommended)\n\n> This second perfect example (OPTIMIZED, no change) moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md); the FURTHER_OPTIMIZATION_AVAILABLE example above stays canonical.\n> Load it when the deployment is already optimized.\n\n**Self-check before emit:**\n- [ ] `Current monthly − Projected monthly == Monthly saving` (2 decimals)?\n- [ ] `Monthly saving × 12 == Annual saving`?\n- [ ] All nine dimensions listed in CHECKLIST with `→` or `✓`?\n- [ ] Every `→` dimension has a corresponding MIGRATION_STEPS entry?\n- [ ] No scratch\u002Frecompute text in the block?\n- [ ] All labels are literal all-caps (no markdown, bold, or camelCase)?\n\n## Verdict semantics\n\n| Verdict | When to emit |\n|---|---|\n| `FURTHER_OPTIMIZATION_AVAILABLE` | At least one dimension has a concrete, savings-bearing recommendation. |\n| `OPTIMIZED` | All dimensions verified (automated discovery + sampling + suppression + delegation + export in place); or a change was applied and verified this session. |\n| `NEED_MORE_INFO` | Data gate failed: Cost Explorer Macie line items absent, window \u003C 14 days, or job stats unavailable with no fallback. |\n| `BLOCKED` | Hard precondition prevents evaluation: IAM denies `macie2:GetClassificationJob`, Macie not enabled in the account. |\n\n**Zero-savings rule:** If MONTHLY_SAVING == $0.00 for every dimension,\nverdict MUST be `OPTIMIZED`, never `FURTHER_OPTIMIZATION_AVAILABLE`.\nException: coverage improvement without cost change is surfaced in\nREASON, not as dollar savings.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER recommend disabling a targeted job without confirming\n   automated discovery covers the same buckets.** Coverage gaps create\n   compliance exposure; verify the automated discovery scope includes\n   every bucket the targeted job covered.\n\n2. **NEVER exclude a bucket without verifying it contains no sensitive\n   data.** A prior clean Macie run, a documented data classification\n   review, or an explicit compliance waiver is required before excluding.\n\n3. **NEVER narrow managed identifier scope without confirming the\n   compliance regime.** PCI requires financial identifiers; GDPR\n   requires EU personal data identifiers. Verify the compliance scope\n   before removing categories.\n\n4. **NEVER add a suppression rule for a prefix that has not been\n   validated as known-safe.** Suppression hides findings — only\n   suppress after a human-in-the-loop review confirms the objects are\n   safe.\n\n5. **NEVER migrate a member account off standalone Macie to delegated\n   administrator without confirming the delegation covers the member\n   account's regions.** Macie delegation is region-specific; multi-\n   region deployments need delegation in each region.\n\nExtended anti-patterns in `references\u002Fmacie-pricing-and-discovery-modes.md`.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation,\n  emit and await operator approval. Do NOT execute until confirmed.\n- **Dry-run the exclusion.** Before removing buckets from scope, verify\n  via `list-findings` that the bucket has no HIGH-severity findings in\n  the last 90 days.\n- **Validate compliance scope before narrowing identifiers.** Confirm\n  the compliance regime (PCI, HIPAA, GDPR) permits the narrower\n  identifier set.\n- **Automated discovery scope check.** Before disabling a targeted job,\n  run `get-automated-discovery-configuration` and `get-classification-\n  scope` to confirm automated discovery covers the same buckets.\n- **Suppression rules require human review.** Never auto-suppress; the\n  operator must confirm each suppression rule targets known-safe\n  objects.\n- **Job disablement is reversible.** `update-classification-job --status\n  DISABLED` can be reversed with `--status ENABLED`; surface this to\n  the operator.\n- **Export configuration changes apply to new findings only.** Existing\n  exported findings are not re-exported to the new destination.\n- **Bulk-operation limit:** Process at most 5 jobs per batch. Sort by\n  estimated savings, verify each batch before proceeding. Abort if any\n  job shows increased error rate post-change.\n\n## Recent AWS features (2024-2026)\n\n> The 2024-2026 feature notes moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load on demand when checking recent feature availability.\n\n## References\n\n- `references\u002Fmacie-pricing-and-discovery-modes.md` — pricing tables,\n  automated-vs-targeted comparison, managed identifier category list,\n  custom identifier regex audit guidance, sampling depth defaults,\n  multi-account delegation matrix, regional pricing multipliers, cost\n  calculation worked examples.\n- `references\u002Fworked-examples.md` — full worked examples (recurring-to-\n  automated migration, scan frequency reduction, bucket exclusion,\n  identifier scope narrowing, suppression rule creation, already-\n  optimized, NEED_MORE_INFO, end-to-end walkthrough).\n\n## References (load on demand)\n\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — pre-existing worked-example set, now also holding the discovery-mode savings math, the annotated Output-format template, and the OPTIMIZED perfect example.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step 0 non-obvious behaviours, the five Mindset principles, optional-lever deep dives (scan frequency, sampling, suppression, delegation, export), the custom identifier audit, and 2024-2026 feature notes.\n- [references\u002Ferror-handling.md](references\u002Ferror-handling.md) — data-quality short-circuits for the pre-flight gate and the Cost-Explorer-vs-job-stats disagreement rule.\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — required data-source CLI list for the data gate and the bucket-exclusion apply CLI.\n- [references\u002Fmacie-pricing-and-discovery-modes.md](references\u002Fmacie-pricing-and-discovery-modes.md) — pre-existing pricing tables, automated-vs-targeted comparison, and full CLI sequences.\n\n## Domain\n\nAWS CloudOps \u002F Security Data Discovery Cost Optimization & FinOps.\n\n## AWS documentation\n\n- **Amazon Macie User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fwhat-macie-compares.html\n- **Amazon Macie pricing** — https:\u002F\u002Faws.amazon.com\u002Fmacie\u002Fpricing\u002F\n- **Macie automated data discovery** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fdiscovery-jobs.html\n- **Macie classification jobs** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fclassification-jobs.html\n- **Macie managed data identifiers** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fmanaged-data-identifiers.html\n- **Macie custom data identifiers** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fcustom-data-identifiers.html\n- **Macie findings filters (suppression)** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Ffindings-filters.html\n- **Macie multi-account delegation** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Faccounts-macie-delegated-admin.html\n- **Macie classification export** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fdiscovery-results-repository.html\n- **AWS Organizations delegated administrators** — https:\u002F\u002Fdocs.aws.amazon.com\u002Forganizations\u002Flatest\u002Fuserguide\u002Forgs_integrate_services.html\n- **AWS CLI Macie reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fmacie2\u002F\n- **AWS Well-Architected Framework — Cost Optimization** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fcost-optimization-pillar\u002Fwelcome.html\n","# Macie Cost Optimizer\n\n## What this skill does\n\nTranslates an Amazon Macie deployment's assessment posture into a concrete\ncost-optimization recommendation with a dollar-denominated savings\nestimate. The verdict is the highest-leverage action across seven\ndimensions — discovery mode, scan frequency, bucket selection, sampling,\ncustom identifier scope, managed identifier scope, suppression rules,\nmulti-account delegation, and export pipeline — applied in priority\norder. Always pairs the recommendation with exact CLI commands.\n\n## Quick navigation\n\n| Section | What it covers | When to jump here |\n|---|---|---|\n| Quick start | Five headline rules and the cost formula | First read |\n| Mindset | Why automated discovery beats targeted jobs for recurring coverage | Understanding the approach |\n| Quick reference — verdict thresholds | Decision matrix at a glance | Classifying a deployment |\n| Pre-flight data gate | Macie jobs, bucket stats, Cost Explorer | Before any recommendation |\n| Step 0 non-obvious behaviours | Sampling, suppression, identifier scope, delegation | Edge cases |\n| Step 1 Discovery mode | Automated vs targeted job selection | The headline savings dimension |\n| Step 2 Scan frequency | Daily vs weekly for large data lakes | Data lake deployments |\n| Step 3 Bucket selection | Exclude known-safe, infrequently accessed, logs | High bucket count |\n| Step 4 Sampling vs full scan | Sampling depth and per-object evaluation | Custom identifier cost |\n| Step 5 Custom & managed identifiers | Scope reduction, regex evaluation overhead | Identifier-heavy deployments |\n| Step 6 Suppression rules | Suppress known-safe prefixes to cut re-evaluation | Noisy finding deployments |\n| Step 7 Multi-account delegation | Single admin vs per-account | Org-wide deployments |\n| Step 8 Classification export | Pipe to S3 + Athena for batch analysis | Recurring query workloads |\n| Step 9 Impact estimation | The cost formula and worked math | Every recommendation |\n| Output format | VERDICT block + worked examples | Emitting the result |\n| Anti-Patterns — NEVER | Common misclassifications | Self-check before emit |\n| Pre-flight safety checks | CONFIRM gate, dry-run validation | Before any apply CLI |\n\n## Quick start\n\n- **Automated discovery is cheaper than recurring targeted jobs for\n  steady coverage.** Macie's automated data discovery manages scope\n  per bucket on the service side — a daily-recurring targeted job\n  scans the full included scope every run, multiplying per-GB cost.\n  Migrate recurring coverage to automated discovery; reserve one-time\n  targeted jobs for ad-hoc investigations.\n- **Cost formula (memorise this):**\n  `monthly_macie_cost = (GB_assessed_per_run × runs_per_month × $\u002FGB)\n                        + per_bucket_monthly_fee + finding_storage`\n- **Exclude known-safe and infrequently accessed buckets.** Log,\n  archive, and known-safe buckets add per-GB assessment cost with no\n  security value. Exclude them from the classification scope.\n- **Sampling is built in; full scans cost multiples.** Macie samples\n  S3 objects per bucket by default. Forcing deep\u002Ffull evaluation\n  multiplies per-object identifier cost — only do this for high-risk\n  buckets.\n- **Narrow managed identifier scope.** `managedDataIdentifierSelector: ALL`\n  evaluates every managed identifier per object. Selecting only the\n  relevant categories (e.g., `INCLUDE` for PII-only) reduces per-\n  object evaluation cost proportionally.\n\n## Mindset\n\n> The five Mindset principles moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — incremental automated discovery, sampling as cost control, identifier scope as multiplier, suppression, delegation.\n> Load them when framing a recommendation.\n\n## Quick reference — verdict thresholds\n\n| Observation (14-30 day window) | Verdict | Recommendation |\n|---|---|---|\n| Recurring targeted job covers what automated discovery could manage AND projected saving > 0 | **FURTHER_OPTIMIZATION_AVAILABLE** (discovery mode) | Step 1 — migrate to automated discovery |\n| Daily recurring job on a data lake with > 1 TB per run AND weekly cadence meets compliance | **FURTHER_OPTIMIZATION_AVAILABLE** (frequency) | Step 2 — reduce to weekly or on-demand |\n| Log\u002Farchive\u002Fknown-safe buckets included in job scope | **FURTHER_OPTIMIZATION_AVAILABLE** (bucket selection) | Step 3 — exclude via `s3Excludes` |\n| `sampling` forces deep evaluation AND no compliance requirement mandates full scan | **FURTHER_OPTIMIZATION_AVAILABLE** (sampling) | Step 4 — revert to default sampling |\n| `managedDataIdentifierSelector: ALL` AND workload only needs PII\u002Ffinancial categories | **FURTHER_OPTIMIZATION_AVAILABLE** (identifier scope) | Step 5 — narrow to relevant categories |\n| Custom identifiers run regex over every sampled object AND > 5 custom identifiers configured | **FURTHER_OPTIMIZATION_AVAILABLE** (custom identifiers) | Step 5 — consolidate or narrow custom identifier scope |\n| Repeated findings on known-safe prefixes (logs, public assets) with no suppression rule | **FURTHER_OPTIMIZATION_AVAILABLE** (suppression) | Step 6 — add suppression rule for known-safe prefix |\n| Per-account standalone Macie on accounts under a Macie-enabled org | **FURTHER_OPTIMIZATION_AVAILABLE** (delegation) | Step 7 — consolidate onto delegated administrator |\n| Recurring Macie console query cost for findings analysis | **FURTHER_OPTIMIZATION_AVAILABLE** (export) | Step 8 — pipe classification export to S3 + Athena |\n| All dimensions verified AND automated discovery + sampling + suppression + delegation all in place | **OPTIMIZED** | None — continue monitoring |\n| Cost Explorer Macie line items absent or window \u003C 14 days | **NEED_MORE_INFO** | Pull 14-30 day Cost Explorer Macie data, re-evaluate |\n\n## Pre-flight: data gate (run before any optimization decision)\n\nOptimization decisions are only as good as the underlying data. Pull\nthese signals before any recommendation. Full CLI sequences are in\n`references\u002Fmacie-pricing-and-discovery-modes.md`.\n\n**Required data sources** (summarized — see reference for full CLI):\n> The eight required data-source CLI listings moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md); full sequences are in references\u002Fmacie-pricing-and-discovery-modes.md.\n> Load it before pulling signals for a recommendation.\n\n### Data-quality short-circuits\n\n> The data-quality short-circuit table and the Cost-Explorer-vs-job-stats disagreement rule moved verbatim to [references\u002Ferror-handling.md](references\u002Ferror-handling.md).\n> Load it when the data gate fails or numbers disagree.\n\n## Process — Optimization logic (apply in order)\n\n### Step 0: Non-obvious behaviours that change the recommendation\n\n> Step 0 deep-dive moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — incremental discovery, identifier-selector cost, per-bucket sampling, regex backtracking, suppression mechanics, delegation duplication, export one-way valve, bucketCriteria scope, storage-class irrelevance, free-tier limits.\n> Load it before classifying a deployment.\n\n### Step 1: Discovery mode — automated vs targeted jobs\n\nThe discovery mode is the primary cost lever because recurring targeted\njobs multiply per-GB cost linearly with the schedule frequency.\n\n**Pricing comparison:**\n```\nAutomated discovery:   per-GB fee on NEW\u002FCHANGED objects only, per bucket\n                       (incremental — service manages scope and cadence)\nTargeted job:          per-GB fee on the ENTIRE included scope, PER RUN\n                       (full-scan cost × runs_per_month)\n```\n\n**Decision tree:**\n```\nIs the job recurring (SCHEDULED) on a stable set of buckets?\n├── NO (ONE_TIME) → Keep as targeted job; this is the correct use.\n└── YES → Is the coverage achievable via automated discovery?\n    ├── NO (needs custom identifiers not supported by automated) → Keep targeted.\n    └── YES → Is the job effectively providing recurring coverage of\n              sensitive-data buckets that automated discovery already covers?\n        ├── YES → Migrate to automated discovery; disable the recurring job.\n        └── NO  → Keep targeted but reduce frequency (Step 2).\n```\n\n> The recurring-to-automated savings math and the 12 TB worked numbers moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md).\n> Load it when quantifying a discovery-mode migration.\n\n### Step 2: Scan frequency tuning\n\n> The frequency decision gate and the daily-to-weekly 7.5x reduction moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it when a targeted job must stay targeted.\n\n### Step 3: Bucket selection — exclude known-safe and infrequently accessed\n\nBucket selection is the third lever. Log, archive, system, and known-\nsafe buckets add per-GB cost with no security value.\n\n**Exclusion categories:**\n| Bucket type | Why exclude | How to detect |\n|---|---|---|\n| Access logs (S3 server access, CloudTrail, ALB) | No business data; pure audit log | Name pattern (`*-logs`, `*-cloudtrail`), `cloudtrail` prefix |\n| Archive \u002F cold storage | Rarely changes; out of compliance scope | Lifecycle policy transitions to Glacier |\n| System buckets | AWS service-managed; no customer data | Name starts with `aws-` or known service prefix |\n| Known-safe curated | Validated clean (e.g., public assets, images) | Prior Macie run with zero findings; suppression rule exists |\n| Infrequently accessed with no PII history | Per-GB fee not justified by risk | 90-day access pattern; no findings history |\n\n> The update-classification-scope exclusion CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\n> Load it when applying an exclusion.\n\n### Step 4: Sampling vs full scan\n\n> The sampling decision gate moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it when sampling depth is questioned.\n\n### Step 5: Custom and managed identifier scope reduction\n\nIdentifier scope is a per-object cost multiplier. Every selected\nidentifier runs against every sampled object.\n\n**Managed identifier scope:**\n```bash\n# Current scope\naws macie2 describe-classification-job --job-id \u003Cid> \\\n  --query 'managedDataIdentifierSelector'\n\n# Narrow from ALL to specific categories\naws macie2 update-classification-job \\\n  --job-id \u003Cid> \\\n  --managed-data-identifier-selector INCLUDE \\\n  --managed-data-identifier-ids \\\n    \"AWSManagedCredentialsKeywords,AWSManagedFinancialUS,AWSManagedPersonalUS\"\n```\n\n> The four-step custom identifier audit moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it when identifier-heavy.\n\n### Step 6: Suppression rules — cut re-evaluation\n\n> The create-findings-filter pattern and when-to-suppress list moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it for noisy-finding deployments.\n\n### Step 7: Multi-account Macie administrator delegation\n\n> The delegation check CLI and delegation savings math moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it for org-wide deployments.\n\n### Step 8: Classification export to S3 for batch analysis\n\n> The export setup CLI and Athena query pattern moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load it for recurring query workloads.\n\n### Step 9: Impact estimation\n\nCompute the monthly savings for each recommendation:\n\n```\ncurrent_monthly_cost =\n  sum(GB_in_scope_per_job × runs_per_month × $\u002FGB_assessed) +\n  (bucket_count × per_bucket_monthly_fee) +\n  (finding_storage_GB × $\u002FGB_stored)\n\nprojected_monthly_cost =\n  sum(GB_new_or_changed_per_job × runs_per_month × $\u002FGB_assessed) +\n  (bucket_count_after_exclusion × per_bucket_monthly_fee) +\n  (finding_storage_GB_after_suppression × $\u002FGB_stored)\n\nmonthly_saving = current_monthly_cost − projected_monthly_cost\n```\n\nAlways state assumptions: GB assessed per run, runs per month, pricing\nregion, identifier scope, bucket count before\u002Fafter exclusion.\n\n### Step 10: Final verdict\n\n- Any dimension recommends a change → **FURTHER_OPTIMIZATION_AVAILABLE**.\n- All dimensions verified AND automated discovery + sampling + suppression\n  + delegation all in place → **OPTIMIZED**.\n- Change applied and verified this session → **OPTIMIZED** (post-state).\n- Data insufficient (Cost Explorer absent, window \u003C 14 days) →\n  **NEED_MORE_INFO**.\n\nNever emit `FURTHER_OPTIMIZATION_AVAILABLE` without first discharging\nevery `NEED_MORE_INFO`\u002F`BLOCKED` gate.\n\n## Output format\n\n> The annotated Output-format template moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md); the STRICT output contract below is the enforced shape.\n> Load it when emitting the result block.\n\n## STRICT output contract\n\nThe rules below are hard constraints. Violating any one produces a\nmisclassification or an arithmetic contradiction that breaks downstream\nFinOps automation. Self-check EVERY emitted block against these rules\nbefore returning the response.\n\n### Required output structure\n\nEvery response MUST be a single block using these literal labels, in this\norder. Do NOT substitute markdown headings, camelCase, or bold variants.\nThe CHECKLIST rows surface the current scan config vs recommended for\nevery optimization dimension so the operator can see the full posture\nin one read.\n\n```text\nMACIE_JOB: \u003Cmacie-deployment-or-job-id>\nVERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE | NEED_MORE_INFO | BLOCKED\nREASON: \u003C1-2 sentences naming the recommendation and the supporting data>\nCHECKLIST:\n  [→|✓]  Discovery mode        current: \u003Ctargeted SCHEDULED | ONE_TIME | automated>   recommended: \u003C...>\n  [→|✓]  Scan frequency        current: \u003Cdaily | weekly | monthly>                    recommended: \u003C...>\n  [→|✓]  Bucket selection      current: \u003CN buckets in scope>                          recommended: \u003CM buckets (exclude \u003Cnames>)>\n  [→|✓]  Object sampling       current: \u003Cdefault | deep\u002Ffull>                         recommended: \u003C...>\n  [→|✓]  Managed identifiers   current: \u003CALL | INCLUDE [...] >                        recommended: \u003C...>\n  [→|✓]  Custom identifiers    current: \u003CN configured, regex audited>                 recommended: \u003C...>\n  [→|✓]  Suppression rules     current: \u003C0 | N rules>                                 recommended: \u003C...>\n  [→|✓]  Multi-account deleg.  current: \u003Cstandalone | delegated admin (acct)>         recommended: \u003C...>\n  [→|✓]  Export pipeline       current: \u003Cnone | S3+Athena>                            recommended: \u003C...>\nESTIMATED_SAVINGS:\n  Current monthly: $\u003Camount>    ← MUST show assessment + per-bucket + finding-storage subtotals\n  Projected monthly: $\u003Camount>\n  Monthly saving: $\u003Camount>     ← MUST equal Current − Projected, 2 decimals\n  Annual saving: $\u003Camount>      ← MUST equal Monthly × 12\nMIGRATION_STEPS:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification step>\nCONFIRM: \u003Cconfirmation prompt text>\n```\n\n### FORBIDDEN output patterns\n\n1. **NEVER emit `VERDICT: FURTHER_OPTIMIZATION_AVAILABLE` with\n   `Monthly saving: $0.00`.** If every dimension nets zero cost delta,\n   the verdict MUST be `OPTIMIZED`.\n\n2. **NEVER show savings math that does not balance.**\n   `Current monthly − Projected monthly` MUST equal `Monthly saving`,\n   rounded to 2 decimal places.\n\n3. **NEVER emit scratch lines** (\"WAIT — recompute\", \"Hmm, let me redo\",\n   \"corrected:\") in the output. Finalize the math before emitting.\n\n4. **NEVER recommend a discovery mode change without citing job\n   configuration evidence.** The REASON MUST name the job type, run\n   frequency, and scope evidence.\n\n5. **NEVER omit a dimension from the CHECKLIST.** All nine rows MUST\n   appear, each marked `→` (finding, change recommended) or `✓`\n   (verified, no change). Inventing a 10th row or collapsing rows\n   together is a contract violation.\n\n6. **NEVER present a cost-neutral reconfiguration as \"cost savings.\"**\n   Surface the coverage\u002Flatency improvement explicitly in REASON and set\n   `Monthly saving: $0.00` with verdict `OPTIMIZED` (or\n   `FURTHER_OPTIMIZATION_AVAILABLE` ONLY if a different dimension has\n   positive saving).\n\n7. **NEVER round intermediate formula steps differently from the final\n   figure.** Compute at full precision, round only the displayed result.\n\n8. **NEVER substitute markdown headings, bold, or camelCase variants\n   for the literal labels** (`## Verdict`, `**VERDICT:**`, `verdict =`\n   are all invalid). The labels are parser-anchored.\n\n9. **NEVER emit a `→` row in CHECKLIST without a corresponding\n   MIGRATION_STEPS entry.** Every finding dimension MUST have a CLI\n   action that resolves it.\n\n### Perfect example output — FURTHER_OPTIMIZATION_AVAILABLE with verified math\n\nEvery field below is internally consistent and shows concrete monthly\nUSD figures. Copy this shape exactly.\n\n```text\nMACIE_JOB: macie-targeted-pci-scan-prod\nVERDICT: FURTHER_OPTIMIZATION_AVAILABLE\nREASON: Recurring daily targeted job covers a stable 12.4 TB data lake\n  that automated discovery could manage incrementally. 4 log\u002Farchive\n  buckets are in scope and add per-GB cost with no security value.\n  managedDataIdentifierSelector: ALL is overbroad for a PCI-only\n  compliance scope. Cost Explorer cross-check agrees with job stats.\nCHECKLIST:\n  [→] Discovery mode        current: targeted SCHEDULED job (nightly)           recommended: automated data discovery (incremental)\n  [→] Scan frequency        current: daily (30 runs\u002Fmonth)                      recommended: service-managed cadence\n  [→] Bucket selection      current: 18 buckets in scope (4 logs\u002Farchive)       recommended: 14 buckets (exclude access-logs-prod, cloudtrail-archive, alb-logs, public-assets)\n  [✓] Object sampling       current: default sampling                           recommended: default (no change)\n  [→] Managed identifiers   current: ALL (every managed ID per object)          recommended: INCLUDE [AWSManagedFinancialUS, AWSManagedCredentialsKeywords]\n  [✓] Custom identifiers    current: 3 configured, regex audited                recommended: keep (no change)\n  [→] Suppression rules     current: 0 rules                                    recommended: add 1 rule (ARCHIVE known-safe log prefixes)\n  [✓] Multi-account deleg.  current: delegated admin (org-management)           recommended: keep (no change)\n  [✓] Export pipeline       current: S3 + Athena                                recommended: keep (no change)\nESTIMATED_SAVINGS:\n  Current monthly: $37,210.00\n    assessment: 12,400 GB × 30 runs × $0.10\u002FGB = $37,200.00\n    per-bucket fees: 18 buckets × $0.50 = $9.00\n    finding storage: $1.00\n  Projected monthly: $629.00\n    assessment: 620 GB (5% monthly churn) × $0.10 = $62.00\n    per-bucket fees: 14 buckets × $0.50 = $7.00\n    automated discovery overhead + finding storage: $560.00\n  Monthly saving: $36,581.00    ($37,210.00 − $629.00 = $36,581.00 ✓)\n  Annual saving: $438,972.00    ($36,581.00 × 12 = $438,972.00 ✓)\n  Assumptions: 12,400 GB in scope per run, 30 runs\u002Fmonth, us-east-1 pricing,\n    5% monthly object churn for automated discovery, PCI-only identifier scope\nMIGRATION_STEPS:\n  1. Verify automated discovery coverage includes the data lake buckets:\n     aws macie2 get-automated-discovery-configuration\n     aws macie2 get-classification-scope --name default-scope\n  2. Exclude log\u002Farchive buckets from the classification scope:\n     aws macie2 update-classification-scope --name default-scope \\\n       --s3 '{\"excludes\":{\"bucketNames\":[\"access-logs-prod\",\"cloudtrail-archive\",\"alb-logs\",\"public-assets\"]}}'\n  3. Narrow managed identifier scope on any remaining targeted jobs:\n     aws macie2 update-classification-job --job-id job-targeted-pci-scan \\\n       --managed-data-identifier-selector INCLUDE \\\n       --managed-data-identifier-ids \"AWSManagedFinancialUS,AWSManagedCredentialsKeywords\"\n  4. Add a suppression rule for known-safe log prefixes:\n     aws macie2 create-findings-filter --name suppress-known-safe-logs \\\n       --action ARCHIVE \\\n       --finding-criteria '{\"criterion\":{\"s3Bucket.name\":{\"eq\":[\"access-logs-prod\",\"cloudtrail-archive\"]}}}'\n  5. Disable the recurring targeted job once automated discovery is\n     confirmed covering the same buckets:\n     aws macie2 update-classification-job --job-id job-targeted-pci-scan --status DISABLED\n  6. Monitor Cost Explorer (Service=Macie) for 7 days post-change:\n     aws ce get-cost-and-usage --filter '{\"Dimensions\":{\"Key\":\"SERVICE\",\"Values\":[\"Macie\"]}}'\nCONFIRM: About to migrate macie-targeted-pci-scan-prod from recurring\n  daily targeted job to automated discovery, exclude 4 log\u002Farchive\n  buckets, narrow identifier scope to PCI categories, and add 1\n  suppression rule. Monthly saving $36,581.00 (98.3% reduction).\n  Proceed? (yes\u002Fno)\n```\n\n### Perfect example output — OPTIMIZED (no change recommended)\n\n> This second perfect example (OPTIMIZED, no change) moved verbatim to [references\u002Fworked-examples.md](references\u002Fworked-examples.md); the FURTHER_OPTIMIZATION_AVAILABLE example above stays canonical.\n> Load it when the deployment is already optimized.\n\n**Self-check before emit:**\n- [ ] `Current monthly − Projected monthly == Monthly saving` (2 decimals)?\n- [ ] `Monthly saving × 12 == Annual saving`?\n- [ ] All nine dimensions listed in CHECKLIST with `→` or `✓`?\n- [ ] Every `→` dimension has a corresponding MIGRATION_STEPS entry?\n- [ ] No scratch\u002Frecompute text in the block?\n- [ ] All labels are literal all-caps (no markdown, bold, or camelCase)?\n\n## Verdict semantics\n\n| Verdict | When to emit |\n|---|---|\n| `FURTHER_OPTIMIZATION_AVAILABLE` | At least one dimension has a concrete, savings-bearing recommendation. |\n| `OPTIMIZED` | All dimensions verified (automated discovery + sampling + suppression + delegation + export in place); or a change was applied and verified this session. |\n| `NEED_MORE_INFO` | Data gate failed: Cost Explorer Macie line items absent, window \u003C 14 days, or job stats unavailable with no fallback. |\n| `BLOCKED` | Hard precondition prevents evaluation: IAM denies `macie2:GetClassificationJob`, Macie not enabled in the account. |\n\n**Zero-savings rule:** If MONTHLY_SAVING == $0.00 for every dimension,\nverdict MUST be `OPTIMIZED`, never `FURTHER_OPTIMIZATION_AVAILABLE`.\nException: coverage improvement without cost change is surfaced in\nREASON, not as dollar savings.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER recommend disabling a targeted job without confirming\n   automated discovery covers the same buckets.** Coverage gaps create\n   compliance exposure; verify the automated discovery scope includes\n   every bucket the targeted job covered.\n\n2. **NEVER exclude a bucket without verifying it contains no sensitive\n   data.** A prior clean Macie run, a documented data classification\n   review, or an explicit compliance waiver is required before excluding.\n\n3. **NEVER narrow managed identifier scope without confirming the\n   compliance regime.** PCI requires financial identifiers; GDPR\n   requires EU personal data identifiers. Verify the compliance scope\n   before removing categories.\n\n4. **NEVER add a suppression rule for a prefix that has not been\n   validated as known-safe.** Suppression hides findings — only\n   suppress after a human-in-the-loop review confirms the objects are\n   safe.\n\n5. **NEVER migrate a member account off standalone Macie to delegated\n   administrator without confirming the delegation covers the member\n   account's regions.** Macie delegation is region-specific; multi-\n   region deployments need delegation in each region.\n\nExtended anti-patterns in `references\u002Fmacie-pricing-and-discovery-modes.md`.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation,\n  emit and await operator approval. Do NOT execute until confirmed.\n- **Dry-run the exclusion.** Before removing buckets from scope, verify\n  via `list-findings` that the bucket has no HIGH-severity findings in\n  the last 90 days.\n- **Validate compliance scope before narrowing identifiers.** Confirm\n  the compliance regime (PCI, HIPAA, GDPR) permits the narrower\n  identifier set.\n- **Automated discovery scope check.** Before disabling a targeted job,\n  run `get-automated-discovery-configuration` and `get-classification-\n  scope` to confirm automated discovery covers the same buckets.\n- **Suppression rules require human review.** Never auto-suppress; the\n  operator must confirm each suppression rule targets known-safe\n  objects.\n- **Job disablement is reversible.** `update-classification-job --status\n  DISABLED` can be reversed with `--status ENABLED`; surface this to\n  the operator.\n- **Export configuration changes apply to new findings only.** Existing\n  exported findings are not re-exported to the new destination.\n- **Bulk-operation limit:** Process at most 5 jobs per batch. Sort by\n  estimated savings, verify each batch before proceeding. Abort if any\n  job shows increased error rate post-change.\n\n## Recent AWS features (2024-2026)\n\n> The 2024-2026 feature notes moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\n> Load on demand when checking recent feature availability.\n\n## References\n\n- `references\u002Fmacie-pricing-and-discovery-modes.md` — pricing tables,\n  automated-vs-targeted comparison, managed identifier category list,\n  custom identifier regex audit guidance, sampling depth defaults,\n  multi-account delegation matrix, regional pricing multipliers, cost\n  calculation worked examples.\n- `references\u002Fworked-examples.md` — full worked examples (recurring-to-\n  automated migration, scan frequency reduction, bucket exclusion,\n  identifier scope narrowing, suppression rule creation, already-\n  optimized, NEED_MORE_INFO, end-to-end walkthrough).\n\n## References (load on demand)\n\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — pre-existing worked-example set, now also holding the discovery-mode savings math, the annotated Output-format template, and the OPTIMIZED perfect example.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — Step 0 non-obvious behaviours, the five Mindset principles, optional-lever deep dives (scan frequency, sampling, suppression, delegation, export), the custom identifier audit, and 2024-2026 feature notes.\n- [references\u002Ferror-handling.md](references\u002Ferror-handling.md) — data-quality short-circuits for the pre-flight gate and the Cost-Explorer-vs-job-stats disagreement rule.\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — required data-source CLI list for the data gate and the bucket-exclusion apply CLI.\n- [references\u002Fmacie-pricing-and-discovery-modes.md](references\u002Fmacie-pricing-and-discovery-modes.md) — pre-existing pricing tables, automated-vs-targeted comparison, and full CLI sequences.\n\n## Domain\n\nAWS CloudOps \u002F Security Data Discovery Cost Optimization & FinOps.\n\n## AWS documentation\n\n- **Amazon Macie User Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fwhat-macie-compares.html\n- **Amazon Macie pricing** — https:\u002F\u002Faws.amazon.com\u002Fmacie\u002Fpricing\u002F\n- **Macie automated data discovery** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fdiscovery-jobs.html\n- **Macie classification jobs** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fclassification-jobs.html\n- **Macie managed data identifiers** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fmanaged-data-identifiers.html\n- **Macie custom data identifiers** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fcustom-data-identifiers.html\n- **Macie findings filters (suppression)** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Ffindings-filters.html\n- **Macie multi-account delegation** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Faccounts-macie-delegated-admin.html\n- **Macie classification export** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fmacie\u002Flatest\u002Fuser\u002Fdiscovery-results-repository.html\n- **AWS Organizations delegated administrators** — https:\u002F\u002Fdocs.aws.amazon.com\u002Forganizations\u002Flatest\u002Fuserguide\u002Forgs_integrate_services.html\n- **AWS CLI Macie reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fmacie2\u002F\n- **AWS Well-Architected Framework — Cost Optimization** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fcost-optimization-pillar\u002Fwelcome.html\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":44},{"tags":25,"phase":26,"author":27,"domain":28,"family":29,"version":30,"keywords":31,"task_type":32,"complexity":33,"entry_point":34,"skill_class":35,"when_to_use":36,"requires_llm":37,"verdict_shape":38,"when_not_to_use":39,"lifecycle_status":40,"invocation_schema":41,"supports_pipeline":37,"invocation_example":42,"activation_triggers":43},"macie, security, data-protection, cost-optimization, finops, sensitive-data, data-discovery","3","Jacky Chan — AWS Community Builder","aws-cloudops","Security","0.1.0","Macie, Amazon Macie, data discovery, sensitive data, PII detection, cost optimization, automated discovery, targeted classification, classification job, scan frequency, bucket selection, object sampling, custom data identifier, managed data identifier, suppression rules, finding suppression, multi-account, delegated administrator, classification export, Athena analysis, data lake security, security FinOps","optimize","medium","false","capability","Optimising Amazon Macie cost, migrating from targeted classification jobs to automated data discovery, tuning scan frequency for a large S3 data lake, excluding known-safe or infrequently accessed buckets from Macie scans, reducing custom data identifier evaluation overhead, narrowing managed data identifier scope, configuring finding suppression rules to reduce re-evaluation, consolidating Macie onto a single delegated administrator account, or piping Macie classification exports to Athena for batch analysis.","true","OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE","GuardDuty cost (use guardduty-cost-optimizer), general S3 storage cost (use s3-lifecycle-optimizer), Security Hub finding remediation (use securityhub-finding-remediator), or Macie finding triage\u002Fidentification work (use macie-finding-triage). This skill focuses on cost-driven optimization decisions for Macie assessment spend, not on classifying the contents of a specific finding.","active","Input: either (a) a Macie-enabled account or org context with job configurations and bucket statistics, (b) a Cost Explorer Macie cost line-item document, OR (c) Macie job configurations (jobType, scoping, managedDataIdentifierSelector, sampling) with at least 14 days of observation. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002FESTIMATED_SAVINGS\u002FMIGRATION_STEPS block per Macie scope, where VERDICT is one of OPTIMIZED, FURTHER_OPTIMIZATION_AVAILABLE, NEED_MORE_INFO.","# Minimal valid input (offline job classification):\nMacie administrator: delegated (org-management)\nRegion: us-east-1\nClassification jobs (last 30 days):\n  - jobId: job-targeted-pci-scan\n    jobType: ONE_TIME\n    initialRun: daily schedule (recurring created as one-time)\n    buckets: [data-lake-raw, data-lake-curated, access-logs]\n    managedDataIdentifierSelector: ALL\n    sampling: s3Scope with includes '*'\n    jobsRun: 30, objectsEvaluated: 480,000,000, GBassessed: 12,400\nAutomated discovery: ENABLED but scope excludes access-logs\nCost Explorer (Service=Macie, last 30 days): $1,240\nBucket statistics: 18 buckets, 4 are log\u002Farchive, 2 are known-safe\nEmit the standard optimization block (TARGET, VERDICT, REASON,\nRECOMMENDATION, ESTIMATED_SAVINGS, MIGRATION_STEPS).","optimise Macie cost, Macie spend too high, Macie classification job cost, Macie automated discovery, Macie targeted classification, Macie scan frequency, Macie daily scan cost, Macie bucket selection, Macie exclude buckets, Macie object sampling, Macie full scan cost, Macie custom data identifier, Macie managed data identifier, Macie suppression rules, Macie finding suppression, Macie delegated administrator, Macie multi-account, Macie classification export, Macie Athena export, Macie data lake cost, Macie FinOps, reduce Macie bill, security cost review","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline recommendation classification works from pasted Macie job configs, bucket statistics, and Cost Explorer Macie line items. Live-account optimization uses aws macie2 get-classification-scope, aws macie2 get-sensitive-data-discovery-jobs, aws macie2 describe-job-creation, aws macie2 get-findings, aws macie2 get-bac (bucket statistics), aws macie2 list-membership-accounts (Macie administrator), aws...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fmacie-cost-optimizer",0,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills","https:\u002F\u002Fgithub.com\u002Fjhkchan","CTO & Co-Founder @Beever-AI  & @votee. CAISP. AWS Community Builder. Organizer@GDGCloudHK. MongoDB Champion. Technopreneur + Infornographer.","2026-09-24 08:54:10",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill macie-cost-optimizer",{"tool":59,"command":60},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill macie-cost-optimizer",{"tool":62,"command":63},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill macie-cost-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002FSKILL.md",true,[67,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",10958,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Feval\u002Ftest-cases.yaml",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"evals\u002Fbaselines\u002Falready-optimized-macie.md",941,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fbaselines\u002Falready-optimized-macie.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"evals\u002Fbaselines\u002Fbucket-exclusion-and-identifier-narrowing.md",1283,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fbaselines\u002Fbucket-exclusion-and-identifier-narrowing.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"evals\u002Fbaselines\u002Fcustom-identifier-and-suppression.md",1364,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fbaselines\u002Fcustom-identifier-and-suppression.md",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"evals\u002Fbaselines\u002Frecurring-to-automated-discovery.md",1251,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fbaselines\u002Frecurring-to-automated-discovery.md",{"path":90,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":91,"sourceHtmlUrl":92},"evals\u002Fbaselines\u002Fscan-frequency-reduction.md",930,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fbaselines\u002Fscan-frequency-reduction.md",{"path":94,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":95,"sourceHtmlUrl":96},"evals\u002Feval_config.yaml",1876,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Feval_config.yaml",{"path":98,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":99,"sourceHtmlUrl":100},"evals\u002Fevals.json",4902,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fevals.json",{"path":102,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":103,"sourceHtmlUrl":104},"evals\u002Fprompts\u002Falready-optimized-macie.md",1320,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fprompts\u002Falready-optimized-macie.md",{"path":106,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":107,"sourceHtmlUrl":108},"evals\u002Fprompts\u002Fbucket-exclusion-and-identifier-narrowing.md",1437,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fprompts\u002Fbucket-exclusion-and-identifier-narrowing.md",{"path":110,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":111,"sourceHtmlUrl":112},"evals\u002Fprompts\u002Fcustom-identifier-and-suppression.md",1489,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fprompts\u002Fcustom-identifier-and-suppression.md",{"path":114,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":115,"sourceHtmlUrl":116},"evals\u002Fprompts\u002Frecurring-to-automated-discovery.md",1575,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fprompts\u002Frecurring-to-automated-discovery.md",{"path":118,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":119,"sourceHtmlUrl":120},"evals\u002Fprompts\u002Fscan-frequency-reduction.md",1284,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fevals\u002Fprompts\u002Fscan-frequency-reduction.md",{"path":122,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":123,"sourceHtmlUrl":124},"examples\u002FREADME.md",9076,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fexamples\u002FREADME.md",{"path":126,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fadvanced-patterns.md",8911,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Freferences\u002Fadvanced-patterns.md",{"path":130,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Fdiagnostic-commands.md",1334,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Freferences\u002Fdiagnostic-commands.md",{"path":134,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Ferror-handling.md",1172,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Freferences\u002Ferror-handling.md",{"path":138,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":139,"sourceHtmlUrl":140},"references\u002Fmacie-pricing-and-discovery-modes.md",13080,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Freferences\u002Fmacie-pricing-and-discovery-modes.md",{"path":142,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":143,"sourceHtmlUrl":144},"references\u002Fworked-examples.md",17953,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Freferences\u002Fworked-examples.md",{"path":146,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":147,"sourceHtmlUrl":148},"skill.usf.yaml",4661,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fmacie-cost-optimizer\u002Fskill.usf.yaml",[150,157,164,171,178,185],{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":19},"01M7ADVD60X4PCAPKSE58P9NDC","xray-tracing-deployer","Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL \u002F method \u002F service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry \u002F ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS \u002F EKS \u002F Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxray-tracing-deployer\u002FSKILL.md",[],[],{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":19},"01M7ADTVJ7DCBM9CB1FY51GH7J","wellarchitected-workload-auditor","Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-workload-auditor\u002FSKILL.md",[],[],{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":19},"01M7ADT59G6FTTNZYHT2QRPNNP","wellarchitected-review-operator","Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer \u002F get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-review-operator\u002FSKILL.md",[],[],{"skillNo":172,"name":173,"nameZh":6,"description":174,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":175,"categories":176,"keywords":177,"publishedAt":19},"01M7ADSH5JA9QHNPPHQCD7EVA7","wafv2-web-acl-deployer","Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB\u002FAPI Gateway\u002FCloudFront, or configuring CAPTCHA\u002FChallenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-deployer\u002FSKILL.md",[],[],{"skillNo":179,"name":180,"nameZh":6,"description":181,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":182,"categories":183,"keywords":184,"publishedAt":19},"01M7ADRYFAT8R73FBNCHRC573X","wafv2-web-acl-auditor","Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow\u002Fbypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-auditor\u002FSKILL.md",[],[],{"skillNo":186,"name":187,"nameZh":6,"description":188,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":189,"categories":190,"keywords":191,"publishedAt":19},"01M7ADR8W7G72JX4KFGN03QK8Q","waf-rule-deployer","Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwaf-rule-deployer\u002FSKILL.md",[],[]]