[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A7MJJA1XCBS16FZWT63DKK":3,"skill-same:01M7A7MJJA1XCBS16FZWT63DKK":145},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M7A7MJJA1XCBS16FZWT63DKK","ecs-task-cost-optimizer",null,"Optimises Amazon ECS task cost across seven dimensions: launch type selection (Fargate per-second pricing vs EC2 break-even at ~30% steady utilization — EC2 wins for always-on workloads, Fargate wins for bursty or \u003C30% utilization), Graviton2 (arm64) migration for 20% cost reduction with compatibility verification, task definition right-sizing via CloudWatch Container Insights CPU\u002Fmemory utilization analysis, capacity provider strategy (spot base capacity + on-demand top for 30-70% spot savings), Savings Plan coverage mapping (compute SP applies to both Fargate and EC2-backed ECS), task placement bin-packing strategy (spread vs binpack for EC2 density), and auto-scaling target tracking tuning. Evaluates standalone task vs service scheduling, process vs daemon scheduling, EFS vs EBS persistent storage cost, and service auto-scaling vs scheduled scaling. Emits OPTIMIZED when all dimensions pass, or FURTHER_OPTIMIZATION_AVAILABLE with specific recommendation and estimated savings. Use when reviewing ECS spen...","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\u002Fecs-task-cost-optimizer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ecs-task-cost-optimizer\ndescription: 'Optimises Amazon ECS task cost across seven dimensions: launch type selection (Fargate per-second pricing vs EC2 break-even at ~30% steady utilization — EC2 wins for always-on workloads, Fargate wins for bursty or \u003C30% utilization), Graviton2 (arm64) migration for 20% cost reduction with compatibility verification, task definition right-sizing via CloudWatch Container Insights CPU\u002Fmemory utilization analysis, capacity provider strategy (spot base capacity + on-demand top for 30-70% spot savings), Savings Plan coverage mapping (compute SP applies to both Fargate and EC2-backed ECS), task placement bin-packing strategy (spread vs binpack for EC2 density), and auto-scaling target tracking tuning. Evaluates standalone task vs service scheduling, process vs daemon scheduling, EFS vs EBS persistent storage cost, and service auto-scaling vs scheduled scaling. Emits OPTIMIZED when all dimensions pass, or FURTHER_OPTIMIZATION_AVAILABLE with specific recommendation and estimated savings. Use when reviewing ECS spen...'\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline recommendation classification works from pasted CloudWatch Container Insights metrics, task definition configs, and Cost Explorer findings. Live-account optimization uses aws ecs describe-services, aws ecs describe-tasks, aws ecs describe-task-definition, aws ecs describe-capacity-providers, aws cloudwatch get-metric-statistics (CPUUtilization, MemoryUtilization from ECS\u002FContainerInsights), aws ce...\nmetadata:\n  domain: aws-cloudops\n  complexity: medium\n  requires_llm: 'true'\n  phase: '3'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Compute\n  task_type: optimize\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE\n  when_to_use: Optimising ECS task cost, evaluating Fargate vs EC2 launch type crossover, planning a Graviton2 (arm64) task migration, right-sizing task definitions from Container Insights, designing capacity provider strategy (spot + on-demand), mapping Savings Plan coverage to ECS spend, tuning task placement bin-packing for EC2 density, or tuning auto-scaling target tracking for cost.\n  when_not_to_use: EKS cost optimization (use eks-cost-optimizer), Fargate standalone cost optimization without ECS (use fargate-cost-optimizer), ECS task troubleshooting (container crashes, deployment failures, task lifecycle issues — use ecs-task-troubleshooter), or ECS task definition security auditing (use ecs-task-definition-auditor). This skill focuses on cost-driven optimization of ECS tasks, not functional debugging.\n  activation_triggers: optimise ECS cost, ECS Fargate vs EC2, ECS launch type crossover, ECS Graviton2 migration, ECS arm64 compatibility, ECS task right-sizing, ECS task definition CPU memory, ECS capacity provider strategy, ECS spot capacity provider, ECS Savings Plan coverage, ECS task placement bin-packing, ECS Container Insights cost, ECS auto-scaling target tracking, ECS scheduled scaling, ECS standalone task vs service, ECS EFS vs EBS storage, ECS FinOps, reduce container bill, ECS cost review\n  invocation_schema: 'Input: either (a) an ECS service\u002Ftask identifier + live-account context, (b) a Cost Explorer ECS\u002FFargate charge breakdown, OR (c) CloudWatch Container Insights metrics (CPUUtilization, MemoryUtilization) with task definition details and at least 14 days of observation. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002F ESTIMATED_SAVINGS\u002FMIGRATION_STEPS block per service\u002Ftask, where VERDICT is one of OPTIMIZED, FURTHER_OPTIMIZATION_AVAILABLE.'\n  invocation_example: \"# Minimal valid input (offline finding classification):\\nServiceName: order-api-prod\\nLaunchType: FARGATE\\nTaskDefinition: order-api:42\\nCPU: 1024 (1 vCPU)\\nMemory: 2048 MB\\nRegion: us-east-1\\nArchitecture: x86_64\\nMetrics (last 30 days):\\n  - CPUUtilization avg: 12%, p95: 25%\\n  - MemoryUtilization avg: 18%, p95: 30%\\n  - RunningTaskCount avg: 8\\nCost (last month): $1,847.00 (Fargate compute)\\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: ECS, Fargate, EC2 launch type, cost optimization, Graviton2, arm64, task definition, right-sizing, capacity provider, spot, on-demand, Savings Plan, bin-packing, task placement, Container Insights, auto-scaling, target tracking, scheduled scaling, EFS, EBS, FinOps, container cost\n  tags: ecs, compute, containers, cost-optimization, finops, fargate, graviton, capacity-provider\n---\n\n# ECS Task Cost Optimizer\n\n## What this skill does\n\nTranslates an ECS task or service's runtime posture into a concrete\ncost-optimization recommendation with a dollar-denominated savings\nestimate. The verdict reflects the highest-leverage action across seven\ndimensions — launch type, architecture, right-sizing, capacity provider\nstrategy, Savings Plan coverage, task placement, and auto-scaling —\napplied in priority order. Always pairs the recommendation with exact\nCLI commands or infrastructure-as-code snippets.\n\n## Quick navigation\n\n| Section | What it covers | When to jump here |\n|---|---|---|\n| Quick start | Four headline rules and the cost formula | First read |\n| Mindset | Why launch type is the #1 lever | Understanding the approach |\n| Quick reference — verdict thresholds | Decision matrix at a glance | Classifying a service |\n| Pre-flight data gate | Container Insights, Cost Explorer | Before any recommendation |\n| Step 0 non-obvious behaviours | Fargate billing, Graviton compat, SP scoping | Edge cases |\n| Step 1 Launch type | Fargate vs EC2 crossover at ~30% | Always-on vs bursty |\n| Step 2 Architecture (Graviton2) | arm64 20% discount + compat check | Cross-cutting savings |\n| Step 3 Task right-sizing | CPU\u002Fmemory from Container Insights | The headline savings dimension |\n| Step 4 Capacity provider strategy | spot base + on-demand top | Spot savings |\n| Step 5 Savings Plan coverage | Compute SP for Fargate + EC2 | Commitment discount |\n| Step 6 Task placement & scheduling | binpack, spread, daemon, standalone | EC2 density |\n| Step 7 Auto-scaling tuning | target tracking, scheduled scaling | Over-provisioning |\n| Step 8 Impact estimation | The cost formula and worked math | Every recommendation |\n| Output format | VERDICT block + worked examples | Emitting the result |\n| Anti-Patterns — NEVER | Common misclassifications | Self-check before emit |\n| Pre-flight safety checks | CONFIRM gate, canary deploy | Before any apply CLI |\n\n## Quick start\n\nQuick-start headline rules and the cost formula moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand for the Fargate\u002FEC2 crossover rule, cost formulas, Graviton 20%, and spot strategy headline rules.\n\n## Mindset\n\nMindset prose and the four guiding principles moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when framing a recommendation (crossover, compounding right-sizing, commitment stacking, spot as strategy).\n\n## Quick reference — verdict thresholds\n\n| Observation (14-30 day window) | Verdict | Recommendation |\n|---|---|---|\n| Launch type = FARGATE AND steady utilization > 30% AND always-on service | **FURTHER_OPTIMIZATION_AVAILABLE** (launch type) | Step 1 — migrate to EC2-backed capacity provider |\n| Launch type = EC2 AND steady utilization \u003C 15% AND bursty\u002Fephemeral workload | **FURTHER_OPTIMIZATION_AVAILABLE** (launch type) | Step 1 — migrate to Fargate |\n| Architecture = x86_64 AND application is arm64-compatible (interpreted lang, arm64 native libs) | **FURTHER_OPTIMIZATION_AVAILABLE** (architecture) | Step 2 — migrate to arm64 (Graviton2) |\n| CPUUtilization avg \u003C 30% of allocated CPU AND task CPU > 256 (0.25 vCPU) | **FURTHER_OPTIMIZATION_AVAILABLE** (right-size) | Step 3 — reduce CPU allocation |\n| MemoryUtilization avg \u003C 30% of allocated memory AND task memory > 512 MB | **FURTHER_OPTIMIZATION_AVAILABLE** (right-size) | Step 3 — reduce memory allocation |\n| No spot capacity provider configured AND workload is stateless\u002Ffault-tolerant | **FURTHER_OPTIMIZATION_AVAILABLE** (spot) | Step 4 — add spot base capacity provider |\n| No Savings Plan covering ECS spend AND monthly ECS charge > $2,000 (steady) | **FURTHER_OPTIMIZATION_AVAILABLE** (commitment) | Step 5 — purchase Compute Savings Plan |\n| EC2 cluster with spread placement AND avg instance utilization \u003C 60% | **FURTHER_OPTIMIZATION_AVAILABLE** (placement) | Step 6 — switch to binpack placement |\n| All dimensions verified AND architecture on arm64 AND task right-sized AND SP coverage in place | **OPTIMIZED** | None — continue monitoring |\n| Container Insights metrics absent or window \u003C 14 days | **NEED_MORE_INFO** | Enable Container Insights, wait 14 days |\n| All dimensions verified AND a change was applied and confirmed this session | **OPTIMIZED** | Emit post-state verification |\n\n## Pre-flight: data gate (run before any optimization decision)\n\nOptimization decisions are only as good as the underlying data. Pull\nthese metrics before any recommendation. Full CLI sequences are in\n`references\u002Fecs-pricing-and-capacity-providers.md`.\n\n**Required data sources** (summarized — see reference for full CLI):\nRequired data-source listing moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when pulling service config, Container Insights metrics, capacity providers, Savings Plan coverage, and Cost Explorer data.\n\n### Data-quality short-circuits\n\n| Condition | Effect on optimization |\n|---|---|\n| `CPUUtilization` metric absent (Container Insights not enabled) | **NEED_MORE_INFO**. Enable: `aws ecs update-cluster-settings --settings name=containerInsights,value=enabled`. |\n| Metrics window \u003C 14 days | **NEED_MORE_INFO**. Minimum 14 days; 30 days preferred. |\n| `RunningTaskCount` Sum = 0 over 14 days | Emit **OPTIMIZED** with note \"dormant service.\" |\n| Service `desiredCount = 0` | Skip optimization; surface as dormant. |\n| Cost Explorer breakdown absent | Proceed with Fargate pricing formula; mark MEDIUM confidence. |\n| Savings Plan coverage API returns empty | No SP in place; use on-demand pricing. |\n| Service uses external deployment controller | Verify controller before recommending changes. |\n\nWhen Container Insights and Cost Explorer disagree, Cost Explorer is\nthe ground truth for actual charges — metrics inform the optimization\nlever, Cost Explorer confirms the dollar impact.\n\n## Process — Optimization logic (apply in order)\n\n### Step 0: Non-obvious behaviours that change the recommendation\n\nThese billing-model and operational gotchas route a recommendation away\nfrom the obvious choice:\n\nStep 0 non-obvious billing and operational behaviours moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when a recommendation depends on a non-obvious behaviour (per-second billing, SP scoping, Container Insights cost, EFS vs EBS, daemon scheduling).\n\n### Step 1: Launch type selection — Fargate vs EC2 (the #1 lever)\n\nLaunch type is the primary cost lever because Fargate charges a 30-50%\npremium over EC2 for always-on workloads, while EC2 requires capacity\nmanagement overhead.\n\nStep 1 crossover math moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when justifying a launch-type migration with dollar math.\n\n**Decision tree:**\n```\nIs the workload always-on (24\u002F7 steady-state)?\n├── NO (batch, cron, event-driven) → Fargate. Per-second billing wins.\n└── YES → Is steady utilization > 30%?\n    ├── NO → Fargate. You're paying for idle EC2 capacity.\n    └── YES → Is the team willing to manage EC2 capacity (ASG, AMI, patching)?\n        ├── NO → Fargate with Savings Plan (accept the premium for simplicity).\n        └── YES → EC2-backed with capacity provider strategy. Save 30-50%.\n```\n\nStep 1 capacity-provider creation CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when migrating a service to an EC2-backed capacity provider.\n\n### Step 2: Architecture migration — Graviton2 (arm64)\n\nGraviton2 (arm64) delivers ~20% cost reduction on both Fargate and EC2.\nFor Fargate, arm64 pricing is lower per vCPU and GB. For EC2, Graviton\ninstances (c7g, m7g, r7g) have lower hourly rates.\n\nStep 2 Fargate x86_64 vs arm64 pricing block moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when quantifying the Graviton2 discount.\n\nStep 2 ARM64 compatibility table moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when verifying an application's arm64 risk before recommending migration; the full matrix is in the same file.\n\nStep 2 arm64 migration CLI (register-task-definition + update-service) moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when applying an architecture migration.\n\nSee `references\u002Fecs-pricing-and-capacity-providers.md` for the full\nruntime ARM64 compatibility matrix.\n\n### Step 3: Task definition right-sizing\n\nRight-sizing is the second multiplier. An over-provisioned task wastes\nmoney proportional to the over-allocation. Container Insights provides\nCPU and memory utilization metrics for sizing decisions.\n\n**The right-sizing decision gate:**\n\n| Metric (14-30 day window) | Finding | Action |\n|---|---|---|\n| CPUUtilization avg \u003C 20% AND allocated CPU > 256 (0.25 vCPU) | Over-provisioned | Reduce CPU to p90 × 1.5 (safety margin) |\n| CPUUtilization avg > 80% sustained | Under-provisioned | Increase CPU (performance issue, not cost) |\n| MemoryUtilization avg \u003C 30% AND allocated memory > 512 MB | Over-provisioned | Reduce memory to p90 × 1.5 |\n| MemoryUtilization avg > 85% | Under-provisioned | Increase memory (OOM risk) |\n| CPUUtilization p95 > 70% with spikes to 100% | Near ceiling | Increase CPU or add tasks (scale out) |\n\nStep 3 right-sizing math and the partial CPU\u002Fmemory combination table moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when computing right-sizing savings or choosing a valid Fargate size.\n\nFargate CPU and memory must be compatible. See the reference for the\nfull valid-combination table.\n\n### Step 4: Capacity provider strategy (spot + on-demand)\n\nCapacity providers define the infrastructure backing for EC2-launched\nECS tasks. A spot base + on-demand top strategy saves 30-70% for\nfault-tolerant workloads.\n\n**Capacity provider strategy patterns:**\n\n| Pattern | Cost | When to use |\n|---|---|---|\n| 100% on-demand | Baseline (no discount) | Stateful, single-instance, cannot tolerate interruption |\n| Spot base (70%) + on-demand top (30%) | 30-50% saving | Stateless web services, microservices, workers |\n| 100% spot | 70% saving | Batch jobs, queue workers, fault-tolerant CI\u002FCD |\n| Spot + Fargate fallback | Mixed | Hybrid approach for critical periods |\n\nStep 4 spot capacity provider CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when applying a spot base + on-demand top strategy.\n\nStep 4 spot interruption handling notes moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when recommending spot capacity (stopTimeout, SIGTERM handling, on-demand fallback).\n\n### Step 5: Savings Plan coverage\n\nCompute Savings Plans apply to both Fargate and EC2-backed ECS. They\ncommit to a $\u002Fhour spend in exchange for a discount (up to 54% for\n1-year commitment, up to 72% for 3-year).\n\nStep 5 SP-vs-RI comparison table moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when choosing a commitment vehicle.\n\nStep 5 SP coverage and utilization CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when measuring Savings Plan coverage.\n\n**Decision gate for SP purchase:**\n\n| Monthly ECS spend (on-demand) | Steady (>12 months)? | Recommendation |\n|---|---|---|\n| > $5,000 | YES | 1-year Compute SP at 50-70% coverage |\n| > $10,000 | YES | 1-year Compute SP at 70-90% coverage (or 3-year for max discount) |\n| \u003C $2,000 | Any | SP overhead is not worth the commitment tracking |\n| Any | NO (growing\u002Fshrinking fast) | Delay SP until spend stabilizes |\n\n### Step 6: Task placement and scheduling strategy\n\nTask placement strategy determines how tasks distribute across EC2\ninstances in an EC2-backed cluster. This affects instance density and\ntherefore cost.\n\n**Placement strategy comparison:**\n\n| Strategy | Effect | Cost impact | When to use |\n|---|---|---|---|\n| `spread` (default) | Distributes tasks across all instances | Lower density (more instances needed) | High-availability, fault-isolation |\n| `binpack` | Packs tasks onto fewest instances | Higher density (fewer instances) | Cost optimization for stateless |\n| `random` | No strategy | Unpredictable | Testing only |\n\n**Scheduling strategy comparison:**\n\n| Strategy | Effect | Cost impact |\n|---|---|---|\n| `REPLICA` (service) | Maintains desired count; auto-restarts | Always-on cost |\n| `DAEMON` (service) | One task per instance | Scales with fleet size (use for agents) |\n| Standalone task | Run once, no auto-restart | Per-invocation cost (batch jobs) |\n\nStep 6 bin-pack placement CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when increasing EC2 placement density.\n\n### Step 7: Auto-scaling target tracking\n\nAuto-scaling adjusts the desired task count based on a CloudWatch metric\ntarget. Poorly tuned scaling policies cause over-provisioning (too many\ntasks) or under-provisioning (SLO violations).\n\n**Target tracking tuning:**\n\n| Metric | Recommended target | Notes |\n|---|---|---|\n| ECS CPUUtilization | 50-65% | Lower = more tasks = more cost; higher = SLO risk |\n| ECS MemoryUtilization | 60-75% | Memory doesn't compress — tune to app behavior |\n| ALB RequestCountPerTarget | App-specific | Better for latency-driven scaling than CPU |\n| Custom metric (queue depth) | App-specific | Best for batch\u002Fqueue-driven workloads |\n\nStep 7 scheduled scaling CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand for predictable traffic patterns.\n\n### Step 8: Impact estimation\n\nStep 8 impact estimation formula and assumptions moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when computing monthly and annual savings.\n\n### Step 9: Final verdict\n\n- Any dimension recommends a change → **FURTHER_OPTIMIZATION_AVAILABLE**.\n- All dimensions pass AND architecture on arm64 AND task right-sized AND\n  SP coverage in place → **OPTIMIZED**.\n- Change applied and verified this session → **OPTIMIZED** (post-state).\n- Data insufficient (Container Insights 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```text\nTARGET: \u003Cservice-name or task-definition>\nVERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE\nREASON: \u003C1-2 sentences naming the recommendation and the supporting data>\nRECOMMENDATION:\n  Current: \u003Claunch type>, \u003CCPU> vCPU, \u003Cmemory> GB, \u003Carchitecture>, \u003Ctask count>, \u003Ccapacity provider>\n  Proposed: \u003Claunch type>, \u003CCPU> vCPU, \u003Cmemory> GB, \u003Carchitecture>, \u003Ctask count>, \u003Ccapacity provider>\n  Dimensions changed: \u003Claunch-type | architecture | right-size | spot | savings-plan | placement | autoscaling>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Monthly: $\u003Camount>\n  Annual: $\u003Camount>\n  Assumptions: \u003Clist (task count, pricing region, etc.)>\nMIGRATION_STEPS:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification step>\nCONFIRM: Before executing any state-changing CLI, emit and await operator\n  approval: \"CONFIRM: About to \u003Caction> on \u003Cservice-name> in \u003Ccluster>.\n  Proceed? (yes\u002Fno)\"\n```\n\nFull worked examples (launch type migration, Graviton2, right-sizing,\nspot capacity provider, already-optimized, NEED_MORE_INFO, end-to-end\nwalkthrough) are in `references\u002Fworked-examples.md`.\n\n## STRICT output contract\n\nThe rules below are hard constraints. Violating any one produces a\nmisclassification or an arithmetic contradiction that breaks downstream\nFinOps automation. Self-check EVERY emitted block against these rules\nbefore returning the response.\n\n### Required output structure\n\nEvery response MUST be a single block using these literal labels, in this\norder. Do NOT substitute markdown headings, camelCase, or bold variants.\n\n```text\nTARGET: \u003Cservice-name or task-definition>\nVERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE\nREASON: \u003C1-2 sentences naming the recommendation and the supporting data>\nRECOMMENDATION:\n  Current: \u003Claunch type>, \u003CCPU> vCPU, \u003Cmemory> GB, \u003Carchitecture>, \u003Ctask count>, \u003Ccapacity provider>\n  Proposed: \u003Claunch type>, \u003CCPU> vCPU, \u003Cmemory> GB, \u003Carchitecture>, \u003Ctask count>, \u003Ccapacity provider>\n  Dimensions changed: \u003Claunch-type | architecture | right-size | spot | savings-plan | placement | autoscaling>\n  Dimensions checked: \u003Clist ALL seven, each ✓ (no finding) or → (finding)>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Current monthly: $\u003Camount>    ← MUST show subtotals (compute, storage, requests if applicable)\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 `Monthly\n   saving: $0.00`.** If every dimension nets zero cost delta, the verdict\n   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 Graviton2 (arm64) migration without citing the\n   application's compatibility evidence.** The REASON MUST name the\n   verification source (interpreted runtime, arm64 wheels, multi-arch\n   container build).\n\n5. **NEVER omit a dimension from the RECOMMENDATION block.** The\n   `Dimensions checked` line MUST list all seven dimensions, each marked\n   ✓ (no finding) or → (finding).\n\n6. **NEVER recommend spot capacity without warning about interruption\n   risk and verifying the application handles graceful shutdown.**\n   Surface the fault-tolerance requirement in MIGRATION_STEPS.\n\n7. **NEVER round intermediate formula steps differently from the final\n   figure.** Compute at full precision, round only the displayed result.\n\n### Perfect example output — FURTHER_OPTIMIZATION_AVAILABLE with verified math\n\nEvery field below is internally consistent. Copy this shape exactly.\n\n```text\nTARGET: order-api-prod\nVERDICT: FURTHER_OPTIMIZATION_AVAILABLE\nREASON: Fargate service at 1024 CPU \u002F 2048 MB with avg CPUUtilization\n  12% and MemoryUtilization 18% across 8 running tasks. Two findings:\n  (1) right-size to 512 CPU \u002F 1024 MB (Container Insights confirms\n  steady p95 utilization under 30% of allocated); (2) migrate from\n  x86_64 to arm64 (Node.js 20 — full arm64 support, no native deps).\n  Combined monthly saving: $172.97 (60% compute reduction).\nRECOMMENDATION:\n  Current: FARGATE, 1.0 vCPU, 2.0 GB, x86_64, 8 tasks, on-demand\n  Proposed: FARGATE, 0.5 vCPU, 1.0 GB, arm64, 8 tasks, on-demand\n  Dimensions changed: right-size (Step 3) + architecture (Step 2)\n  Dimensions checked: launch-type ✓ (Fargate, \u003C 30% utilization confirms Fargate)\n    architecture → (x86 to arm64)  right-size → (1.0\u002F2.0 to 0.5\u002F1.0)\n    spot ✓ (Fargate, no spot)  savings-plan ✓ (covered)  placement ✓ (Fargate)\n    autoscaling ✓ (target tracking at 60% CPU)\n  Confidence: HIGH — Container Insights confirms 30-day avg CPUUtilization\n    12% and MemoryUtilization 18%; Node.js 20 fully supports arm64;\n    no native dependencies in container image.\nESTIMATED_SAVINGS:\n  Current monthly: $288.32\n    compute: 1.0 vCPU × 8 tasks × 730 hr × $0.04048 = $236.40\n    memory: 2.0 GB × 8 tasks × 730 hr × $0.004445 = $51.92\n  Projected monthly: $115.35\n    compute: 0.5 vCPU × 8 tasks × 730 hr × $0.03238 = $94.55\n    memory: 1.0 GB × 8 tasks × 730 hr × $0.003561 = $20.80\n  Monthly saving: $172.97 ($288.32 − $115.35)\n  Annual saving: $2,075.64\nMIGRATION_STEPS:\n  1. Register new task definition with arm64 + right-sized resources:\n     aws ecs register-task-definition --family order-api\n       --runtime-platform cpuArchitecture=ARM64,operatingSystemFamily=LINUX\n       --cpu 512 --memory 1024 --container-definitions file:\u002F\u002Fcontainers-arm64.json\n  2. Deploy via canary (Distributed Map or CodeDeploy):\n     aws ecs update-service --cluster prod-cluster\n       --service order-api-prod --task-definition order-api:43\n  3. Monitor CPUUtilization and MemoryUtilization for 7 days post-change.\n  4. Verify no OOM kills or throttle events in Container Insights.\nCONFIRM: About to update-service on order-api-prod\n  (1.0 vCPU x86 → 0.5 vCPU arm64, 2.0 GB → 1.0 GB). Monthly saving\n  $172.97 (60.0%). Proceed? (yes\u002Fno)\n```\n\n**Self-check before emit:**\n- [ ] `Current monthly − Projected monthly == Monthly saving` (2 decimals)?\n- [ ] `Monthly saving × 12 == Annual saving`?\n- [ ] All seven dimensions listed in `Dimensions checked`?\n- [ ] Every `→` dimension has a corresponding MIGRATION_STEPS entry?\n- [ ] No scratch\u002Frecompute text in the block?\n\n## Verdict semantics\n\n| Verdict | When to emit |\n|---|---|\n| `FURTHER_OPTIMIZATION_AVAILABLE` | At least one dimension has a concrete, savings-bearing recommendation. |\n| `OPTIMIZED` | All dimensions pass (arm64, right-sized, SP coverage, appropriate capacity provider). Also emitted when a change was applied and verified this session. |\n| `NEED_MORE_INFO` | Data gate failed: Container Insights not enabled, metrics absent, window \u003C 14 days. |\n| `BLOCKED` | Hard precondition prevents evaluation: service in a different account, IAM denies ecs:DescribeServices. |\n\n**Zero-savings rule:** If MONTHLY_SAVING == $0.00 for every dimension,\nverdict MUST be `OPTIMIZED`, never `FURTHER_OPTIMIZATION_AVAILABLE`.\nException: a latency or availability improvement without cost change is\nsurfaced in REASON, not as dollar savings.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER recommend a Graviton2 migration without verifying application\n   compatibility.** Compiled binaries (C\u002FC++, Go with CGO, Rust inline\n   assembly) and JNI libraries may fail on arm64. Always require\n   multi-arch container build verification before recommending.\n\n2. **NEVER recommend spot capacity for stateful single-instance services.**\n   Spot reclamation causes task termination. Stateful services (databases,\n   caches with no replication) cannot tolerate interruption. Spot is for\n   stateless, horizontally scalable workloads only.\n\n3. **NEVER right-size a task definition below the application's actual\n   peak memory usage.** Memory is not compressible — an OOM kill is a\n   production incident. Use p95 MemoryUtilization × 1.5 as the floor.\n\n4. **NEVER recommend migrating Fargate to EC2 without warning about the\n   operational overhead.** EC2-backed ECS requires ASG management, AMI\n   patching, capacity provider tuning, and instance monitoring. The cost\n   saving is real but the operational burden is significant.\n\n5. **NEVER recommend a Savings Plan purchase without analyzing utilization\n   stability.** An SP commits to $X\u002Fhour for 1-3 years. If the workload\n   is shrinking or migrating to a different service, the commitment\n   becomes wasted spend.\n\nExtended anti-patterns in `references\u002Fecs-pricing-and-capacity-providers.md`.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\nPre-flight safety checks (CONFIRMATION GATE, canary, OOM rollback, SP irreversibility, batch limits) moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand before executing any state-changing optimization CLI.\n\n## Recent AWS features (2024-2026)\n\nRecent AWS features (2024-2026) moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when evaluating Graviton GA, managed scaling enhancements, Container Insights, Service Connect, per-second billing, Graviton4.\n\n## References\n\n- `references\u002Fecs-pricing-and-capacity-providers.md` — pricing tables,\n  Fargate valid CPU\u002Fmemory combinations, Graviton2 compatibility matrix,\n  capacity provider configuration, Savings Plan discount tiers, regional\n  pricing multipliers, cost calculation worked examples.\n- `references\u002Fworked-examples.md` — full worked examples (launch type\n  migration, Graviton2, right-sizing, spot capacity provider,\n  already-optimized, NEED_MORE_INFO, end-to-end walkthrough).\n\n## References (load on demand)\n\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — required data sources, per-step migration CLI, and pre-flight safety checks moved from SKILL.md.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — quick-start rules, mindset, Step 0 billing behaviours, spot interruption handling, and recent AWS features moved from SKILL.md.\n- [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md) — pricing tables, valid CPU\u002Fmemory combinations, Savings Plan tiers, plus crossover math, compatibility matrix, and impact-estimation formula moved from SKILL.md.\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — full worked examples (launch type migration, Graviton2, right-sizing, spot, already-optimized, NEED_MORE_INFO, end-to-end walkthrough).\n\n## Domain\n\nAWS CloudOps \u002F ECS Container Cost Optimization & FinOps.\n\n## AWS documentation\n\n- **Amazon ECS Developer Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002FWelcome.html\n- **AWS Fargate pricing** — https:\u002F\u002Faws.amazon.com\u002Ffargate\u002Fpricing\u002F\n- **ECS capacity providers** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fcluster-capacity-providers.html\n- **ECS task definition parameters** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftask_definition_parameters.html\n- **CloudWatch Container Insights** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonCloudWatch\u002Flatest\u002Fmonitoring\u002FContainerInsights.html\n- **ECS service auto-scaling** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fservice-auto-scaling.html\n- **AWS Graviton for ECS** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fecs-graviton.html\n- **Savings Plans** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsavingsplans\u002Flatest\u002Fuserguide\u002F\n- **AWS CLI ECS reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fecs\u002F\n- **Well-Architected Cost Optimization** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fcost-optimization-pillar\u002Fwelcome.html\n","# ECS Task Cost Optimizer\n\n## What this skill does\n\nTranslates an ECS task or service's runtime posture into a concrete\ncost-optimization recommendation with a dollar-denominated savings\nestimate. The verdict reflects the highest-leverage action across seven\ndimensions — launch type, architecture, right-sizing, capacity provider\nstrategy, Savings Plan coverage, task placement, and auto-scaling —\napplied in priority order. Always pairs the recommendation with exact\nCLI commands or infrastructure-as-code snippets.\n\n## Quick navigation\n\n| Section | What it covers | When to jump here |\n|---|---|---|\n| Quick start | Four headline rules and the cost formula | First read |\n| Mindset | Why launch type is the #1 lever | Understanding the approach |\n| Quick reference — verdict thresholds | Decision matrix at a glance | Classifying a service |\n| Pre-flight data gate | Container Insights, Cost Explorer | Before any recommendation |\n| Step 0 non-obvious behaviours | Fargate billing, Graviton compat, SP scoping | Edge cases |\n| Step 1 Launch type | Fargate vs EC2 crossover at ~30% | Always-on vs bursty |\n| Step 2 Architecture (Graviton2) | arm64 20% discount + compat check | Cross-cutting savings |\n| Step 3 Task right-sizing | CPU\u002Fmemory from Container Insights | The headline savings dimension |\n| Step 4 Capacity provider strategy | spot base + on-demand top | Spot savings |\n| Step 5 Savings Plan coverage | Compute SP for Fargate + EC2 | Commitment discount |\n| Step 6 Task placement & scheduling | binpack, spread, daemon, standalone | EC2 density |\n| Step 7 Auto-scaling tuning | target tracking, scheduled scaling | Over-provisioning |\n| Step 8 Impact estimation | The cost formula and worked math | Every recommendation |\n| Output format | VERDICT block + worked examples | Emitting the result |\n| Anti-Patterns — NEVER | Common misclassifications | Self-check before emit |\n| Pre-flight safety checks | CONFIRM gate, canary deploy | Before any apply CLI |\n\n## Quick start\n\nQuick-start headline rules and the cost formula moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand for the Fargate\u002FEC2 crossover rule, cost formulas, Graviton 20%, and spot strategy headline rules.\n\n## Mindset\n\nMindset prose and the four guiding principles moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when framing a recommendation (crossover, compounding right-sizing, commitment stacking, spot as strategy).\n\n## Quick reference — verdict thresholds\n\n| Observation (14-30 day window) | Verdict | Recommendation |\n|---|---|---|\n| Launch type = FARGATE AND steady utilization > 30% AND always-on service | **FURTHER_OPTIMIZATION_AVAILABLE** (launch type) | Step 1 — migrate to EC2-backed capacity provider |\n| Launch type = EC2 AND steady utilization \u003C 15% AND bursty\u002Fephemeral workload | **FURTHER_OPTIMIZATION_AVAILABLE** (launch type) | Step 1 — migrate to Fargate |\n| Architecture = x86_64 AND application is arm64-compatible (interpreted lang, arm64 native libs) | **FURTHER_OPTIMIZATION_AVAILABLE** (architecture) | Step 2 — migrate to arm64 (Graviton2) |\n| CPUUtilization avg \u003C 30% of allocated CPU AND task CPU > 256 (0.25 vCPU) | **FURTHER_OPTIMIZATION_AVAILABLE** (right-size) | Step 3 — reduce CPU allocation |\n| MemoryUtilization avg \u003C 30% of allocated memory AND task memory > 512 MB | **FURTHER_OPTIMIZATION_AVAILABLE** (right-size) | Step 3 — reduce memory allocation |\n| No spot capacity provider configured AND workload is stateless\u002Ffault-tolerant | **FURTHER_OPTIMIZATION_AVAILABLE** (spot) | Step 4 — add spot base capacity provider |\n| No Savings Plan covering ECS spend AND monthly ECS charge > $2,000 (steady) | **FURTHER_OPTIMIZATION_AVAILABLE** (commitment) | Step 5 — purchase Compute Savings Plan |\n| EC2 cluster with spread placement AND avg instance utilization \u003C 60% | **FURTHER_OPTIMIZATION_AVAILABLE** (placement) | Step 6 — switch to binpack placement |\n| All dimensions verified AND architecture on arm64 AND task right-sized AND SP coverage in place | **OPTIMIZED** | None — continue monitoring |\n| Container Insights metrics absent or window \u003C 14 days | **NEED_MORE_INFO** | Enable Container Insights, wait 14 days |\n| All dimensions verified AND a change was applied and confirmed this session | **OPTIMIZED** | Emit post-state verification |\n\n## Pre-flight: data gate (run before any optimization decision)\n\nOptimization decisions are only as good as the underlying data. Pull\nthese metrics before any recommendation. Full CLI sequences are in\n`references\u002Fecs-pricing-and-capacity-providers.md`.\n\n**Required data sources** (summarized — see reference for full CLI):\nRequired data-source listing moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when pulling service config, Container Insights metrics, capacity providers, Savings Plan coverage, and Cost Explorer data.\n\n### Data-quality short-circuits\n\n| Condition | Effect on optimization |\n|---|---|\n| `CPUUtilization` metric absent (Container Insights not enabled) | **NEED_MORE_INFO**. Enable: `aws ecs update-cluster-settings --settings name=containerInsights,value=enabled`. |\n| Metrics window \u003C 14 days | **NEED_MORE_INFO**. Minimum 14 days; 30 days preferred. |\n| `RunningTaskCount` Sum = 0 over 14 days | Emit **OPTIMIZED** with note \"dormant service.\" |\n| Service `desiredCount = 0` | Skip optimization; surface as dormant. |\n| Cost Explorer breakdown absent | Proceed with Fargate pricing formula; mark MEDIUM confidence. |\n| Savings Plan coverage API returns empty | No SP in place; use on-demand pricing. |\n| Service uses external deployment controller | Verify controller before recommending changes. |\n\nWhen Container Insights and Cost Explorer disagree, Cost Explorer is\nthe ground truth for actual charges — metrics inform the optimization\nlever, Cost Explorer confirms the dollar impact.\n\n## Process — Optimization logic (apply in order)\n\n### Step 0: Non-obvious behaviours that change the recommendation\n\nThese billing-model and operational gotchas route a recommendation away\nfrom the obvious choice:\n\nStep 0 non-obvious billing and operational behaviours moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when a recommendation depends on a non-obvious behaviour (per-second billing, SP scoping, Container Insights cost, EFS vs EBS, daemon scheduling).\n\n### Step 1: Launch type selection — Fargate vs EC2 (the #1 lever)\n\nLaunch type is the primary cost lever because Fargate charges a 30-50%\npremium over EC2 for always-on workloads, while EC2 requires capacity\nmanagement overhead.\n\nStep 1 crossover math moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when justifying a launch-type migration with dollar math.\n\n**Decision tree:**\n```\nIs the workload always-on (24\u002F7 steady-state)?\n├── NO (batch, cron, event-driven) → Fargate. Per-second billing wins.\n└── YES → Is steady utilization > 30%?\n    ├── NO → Fargate. You're paying for idle EC2 capacity.\n    └── YES → Is the team willing to manage EC2 capacity (ASG, AMI, patching)?\n        ├── NO → Fargate with Savings Plan (accept the premium for simplicity).\n        └── YES → EC2-backed with capacity provider strategy. Save 30-50%.\n```\n\nStep 1 capacity-provider creation CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when migrating a service to an EC2-backed capacity provider.\n\n### Step 2: Architecture migration — Graviton2 (arm64)\n\nGraviton2 (arm64) delivers ~20% cost reduction on both Fargate and EC2.\nFor Fargate, arm64 pricing is lower per vCPU and GB. For EC2, Graviton\ninstances (c7g, m7g, r7g) have lower hourly rates.\n\nStep 2 Fargate x86_64 vs arm64 pricing block moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when quantifying the Graviton2 discount.\n\nStep 2 ARM64 compatibility table moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when verifying an application's arm64 risk before recommending migration; the full matrix is in the same file.\n\nStep 2 arm64 migration CLI (register-task-definition + update-service) moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when applying an architecture migration.\n\nSee `references\u002Fecs-pricing-and-capacity-providers.md` for the full\nruntime ARM64 compatibility matrix.\n\n### Step 3: Task definition right-sizing\n\nRight-sizing is the second multiplier. An over-provisioned task wastes\nmoney proportional to the over-allocation. Container Insights provides\nCPU and memory utilization metrics for sizing decisions.\n\n**The right-sizing decision gate:**\n\n| Metric (14-30 day window) | Finding | Action |\n|---|---|---|\n| CPUUtilization avg \u003C 20% AND allocated CPU > 256 (0.25 vCPU) | Over-provisioned | Reduce CPU to p90 × 1.5 (safety margin) |\n| CPUUtilization avg > 80% sustained | Under-provisioned | Increase CPU (performance issue, not cost) |\n| MemoryUtilization avg \u003C 30% AND allocated memory > 512 MB | Over-provisioned | Reduce memory to p90 × 1.5 |\n| MemoryUtilization avg > 85% | Under-provisioned | Increase memory (OOM risk) |\n| CPUUtilization p95 > 70% with spikes to 100% | Near ceiling | Increase CPU or add tasks (scale out) |\n\nStep 3 right-sizing math and the partial CPU\u002Fmemory combination table moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when computing right-sizing savings or choosing a valid Fargate size.\n\nFargate CPU and memory must be compatible. See the reference for the\nfull valid-combination table.\n\n### Step 4: Capacity provider strategy (spot + on-demand)\n\nCapacity providers define the infrastructure backing for EC2-launched\nECS tasks. A spot base + on-demand top strategy saves 30-70% for\nfault-tolerant workloads.\n\n**Capacity provider strategy patterns:**\n\n| Pattern | Cost | When to use |\n|---|---|---|\n| 100% on-demand | Baseline (no discount) | Stateful, single-instance, cannot tolerate interruption |\n| Spot base (70%) + on-demand top (30%) | 30-50% saving | Stateless web services, microservices, workers |\n| 100% spot | 70% saving | Batch jobs, queue workers, fault-tolerant CI\u002FCD |\n| Spot + Fargate fallback | Mixed | Hybrid approach for critical periods |\n\nStep 4 spot capacity provider CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when applying a spot base + on-demand top strategy.\n\nStep 4 spot interruption handling notes moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when recommending spot capacity (stopTimeout, SIGTERM handling, on-demand fallback).\n\n### Step 5: Savings Plan coverage\n\nCompute Savings Plans apply to both Fargate and EC2-backed ECS. They\ncommit to a $\u002Fhour spend in exchange for a discount (up to 54% for\n1-year commitment, up to 72% for 3-year).\n\nStep 5 SP-vs-RI comparison table moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when choosing a commitment vehicle.\n\nStep 5 SP coverage and utilization CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when measuring Savings Plan coverage.\n\n**Decision gate for SP purchase:**\n\n| Monthly ECS spend (on-demand) | Steady (>12 months)? | Recommendation |\n|---|---|---|\n| > $5,000 | YES | 1-year Compute SP at 50-70% coverage |\n| > $10,000 | YES | 1-year Compute SP at 70-90% coverage (or 3-year for max discount) |\n| \u003C $2,000 | Any | SP overhead is not worth the commitment tracking |\n| Any | NO (growing\u002Fshrinking fast) | Delay SP until spend stabilizes |\n\n### Step 6: Task placement and scheduling strategy\n\nTask placement strategy determines how tasks distribute across EC2\ninstances in an EC2-backed cluster. This affects instance density and\ntherefore cost.\n\n**Placement strategy comparison:**\n\n| Strategy | Effect | Cost impact | When to use |\n|---|---|---|---|\n| `spread` (default) | Distributes tasks across all instances | Lower density (more instances needed) | High-availability, fault-isolation |\n| `binpack` | Packs tasks onto fewest instances | Higher density (fewer instances) | Cost optimization for stateless |\n| `random` | No strategy | Unpredictable | Testing only |\n\n**Scheduling strategy comparison:**\n\n| Strategy | Effect | Cost impact |\n|---|---|---|\n| `REPLICA` (service) | Maintains desired count; auto-restarts | Always-on cost |\n| `DAEMON` (service) | One task per instance | Scales with fleet size (use for agents) |\n| Standalone task | Run once, no auto-restart | Per-invocation cost (batch jobs) |\n\nStep 6 bin-pack placement CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand when increasing EC2 placement density.\n\n### Step 7: Auto-scaling target tracking\n\nAuto-scaling adjusts the desired task count based on a CloudWatch metric\ntarget. Poorly tuned scaling policies cause over-provisioning (too many\ntasks) or under-provisioning (SLO violations).\n\n**Target tracking tuning:**\n\n| Metric | Recommended target | Notes |\n|---|---|---|\n| ECS CPUUtilization | 50-65% | Lower = more tasks = more cost; higher = SLO risk |\n| ECS MemoryUtilization | 60-75% | Memory doesn't compress — tune to app behavior |\n| ALB RequestCountPerTarget | App-specific | Better for latency-driven scaling than CPU |\n| Custom metric (queue depth) | App-specific | Best for batch\u002Fqueue-driven workloads |\n\nStep 7 scheduled scaling CLI moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand for predictable traffic patterns.\n\n### Step 8: Impact estimation\n\nStep 8 impact estimation formula and assumptions moved verbatim to [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md).\nLoad on demand when computing monthly and annual savings.\n\n### Step 9: Final verdict\n\n- Any dimension recommends a change → **FURTHER_OPTIMIZATION_AVAILABLE**.\n- All dimensions pass AND architecture on arm64 AND task right-sized AND\n  SP coverage in place → **OPTIMIZED**.\n- Change applied and verified this session → **OPTIMIZED** (post-state).\n- Data insufficient (Container Insights 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```text\nTARGET: \u003Cservice-name or task-definition>\nVERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE\nREASON: \u003C1-2 sentences naming the recommendation and the supporting data>\nRECOMMENDATION:\n  Current: \u003Claunch type>, \u003CCPU> vCPU, \u003Cmemory> GB, \u003Carchitecture>, \u003Ctask count>, \u003Ccapacity provider>\n  Proposed: \u003Claunch type>, \u003CCPU> vCPU, \u003Cmemory> GB, \u003Carchitecture>, \u003Ctask count>, \u003Ccapacity provider>\n  Dimensions changed: \u003Claunch-type | architecture | right-size | spot | savings-plan | placement | autoscaling>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Monthly: $\u003Camount>\n  Annual: $\u003Camount>\n  Assumptions: \u003Clist (task count, pricing region, etc.)>\nMIGRATION_STEPS:\n  1. \u003Cspecific action with CLI command>\n  2. \u003Cverification step>\nCONFIRM: Before executing any state-changing CLI, emit and await operator\n  approval: \"CONFIRM: About to \u003Caction> on \u003Cservice-name> in \u003Ccluster>.\n  Proceed? (yes\u002Fno)\"\n```\n\nFull worked examples (launch type migration, Graviton2, right-sizing,\nspot capacity provider, already-optimized, NEED_MORE_INFO, end-to-end\nwalkthrough) are in `references\u002Fworked-examples.md`.\n\n## STRICT output contract\n\nThe rules below are hard constraints. Violating any one produces a\nmisclassification or an arithmetic contradiction that breaks downstream\nFinOps automation. Self-check EVERY emitted block against these rules\nbefore returning the response.\n\n### Required output structure\n\nEvery response MUST be a single block using these literal labels, in this\norder. Do NOT substitute markdown headings, camelCase, or bold variants.\n\n```text\nTARGET: \u003Cservice-name or task-definition>\nVERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE\nREASON: \u003C1-2 sentences naming the recommendation and the supporting data>\nRECOMMENDATION:\n  Current: \u003Claunch type>, \u003CCPU> vCPU, \u003Cmemory> GB, \u003Carchitecture>, \u003Ctask count>, \u003Ccapacity provider>\n  Proposed: \u003Claunch type>, \u003CCPU> vCPU, \u003Cmemory> GB, \u003Carchitecture>, \u003Ctask count>, \u003Ccapacity provider>\n  Dimensions changed: \u003Claunch-type | architecture | right-size | spot | savings-plan | placement | autoscaling>\n  Dimensions checked: \u003Clist ALL seven, each ✓ (no finding) or → (finding)>\n  Confidence: \u003CHIGH\u002FMEDIUM\u002FLOW> — \u003Cone-line rationale>\nESTIMATED_SAVINGS:\n  Current monthly: $\u003Camount>    ← MUST show subtotals (compute, storage, requests if applicable)\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 `Monthly\n   saving: $0.00`.** If every dimension nets zero cost delta, the verdict\n   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 Graviton2 (arm64) migration without citing the\n   application's compatibility evidence.** The REASON MUST name the\n   verification source (interpreted runtime, arm64 wheels, multi-arch\n   container build).\n\n5. **NEVER omit a dimension from the RECOMMENDATION block.** The\n   `Dimensions checked` line MUST list all seven dimensions, each marked\n   ✓ (no finding) or → (finding).\n\n6. **NEVER recommend spot capacity without warning about interruption\n   risk and verifying the application handles graceful shutdown.**\n   Surface the fault-tolerance requirement in MIGRATION_STEPS.\n\n7. **NEVER round intermediate formula steps differently from the final\n   figure.** Compute at full precision, round only the displayed result.\n\n### Perfect example output — FURTHER_OPTIMIZATION_AVAILABLE with verified math\n\nEvery field below is internally consistent. Copy this shape exactly.\n\n```text\nTARGET: order-api-prod\nVERDICT: FURTHER_OPTIMIZATION_AVAILABLE\nREASON: Fargate service at 1024 CPU \u002F 2048 MB with avg CPUUtilization\n  12% and MemoryUtilization 18% across 8 running tasks. Two findings:\n  (1) right-size to 512 CPU \u002F 1024 MB (Container Insights confirms\n  steady p95 utilization under 30% of allocated); (2) migrate from\n  x86_64 to arm64 (Node.js 20 — full arm64 support, no native deps).\n  Combined monthly saving: $172.97 (60% compute reduction).\nRECOMMENDATION:\n  Current: FARGATE, 1.0 vCPU, 2.0 GB, x86_64, 8 tasks, on-demand\n  Proposed: FARGATE, 0.5 vCPU, 1.0 GB, arm64, 8 tasks, on-demand\n  Dimensions changed: right-size (Step 3) + architecture (Step 2)\n  Dimensions checked: launch-type ✓ (Fargate, \u003C 30% utilization confirms Fargate)\n    architecture → (x86 to arm64)  right-size → (1.0\u002F2.0 to 0.5\u002F1.0)\n    spot ✓ (Fargate, no spot)  savings-plan ✓ (covered)  placement ✓ (Fargate)\n    autoscaling ✓ (target tracking at 60% CPU)\n  Confidence: HIGH — Container Insights confirms 30-day avg CPUUtilization\n    12% and MemoryUtilization 18%; Node.js 20 fully supports arm64;\n    no native dependencies in container image.\nESTIMATED_SAVINGS:\n  Current monthly: $288.32\n    compute: 1.0 vCPU × 8 tasks × 730 hr × $0.04048 = $236.40\n    memory: 2.0 GB × 8 tasks × 730 hr × $0.004445 = $51.92\n  Projected monthly: $115.35\n    compute: 0.5 vCPU × 8 tasks × 730 hr × $0.03238 = $94.55\n    memory: 1.0 GB × 8 tasks × 730 hr × $0.003561 = $20.80\n  Monthly saving: $172.97 ($288.32 − $115.35)\n  Annual saving: $2,075.64\nMIGRATION_STEPS:\n  1. Register new task definition with arm64 + right-sized resources:\n     aws ecs register-task-definition --family order-api\n       --runtime-platform cpuArchitecture=ARM64,operatingSystemFamily=LINUX\n       --cpu 512 --memory 1024 --container-definitions file:\u002F\u002Fcontainers-arm64.json\n  2. Deploy via canary (Distributed Map or CodeDeploy):\n     aws ecs update-service --cluster prod-cluster\n       --service order-api-prod --task-definition order-api:43\n  3. Monitor CPUUtilization and MemoryUtilization for 7 days post-change.\n  4. Verify no OOM kills or throttle events in Container Insights.\nCONFIRM: About to update-service on order-api-prod\n  (1.0 vCPU x86 → 0.5 vCPU arm64, 2.0 GB → 1.0 GB). Monthly saving\n  $172.97 (60.0%). Proceed? (yes\u002Fno)\n```\n\n**Self-check before emit:**\n- [ ] `Current monthly − Projected monthly == Monthly saving` (2 decimals)?\n- [ ] `Monthly saving × 12 == Annual saving`?\n- [ ] All seven dimensions listed in `Dimensions checked`?\n- [ ] Every `→` dimension has a corresponding MIGRATION_STEPS entry?\n- [ ] No scratch\u002Frecompute text in the block?\n\n## Verdict semantics\n\n| Verdict | When to emit |\n|---|---|\n| `FURTHER_OPTIMIZATION_AVAILABLE` | At least one dimension has a concrete, savings-bearing recommendation. |\n| `OPTIMIZED` | All dimensions pass (arm64, right-sized, SP coverage, appropriate capacity provider). Also emitted when a change was applied and verified this session. |\n| `NEED_MORE_INFO` | Data gate failed: Container Insights not enabled, metrics absent, window \u003C 14 days. |\n| `BLOCKED` | Hard precondition prevents evaluation: service in a different account, IAM denies ecs:DescribeServices. |\n\n**Zero-savings rule:** If MONTHLY_SAVING == $0.00 for every dimension,\nverdict MUST be `OPTIMIZED`, never `FURTHER_OPTIMIZATION_AVAILABLE`.\nException: a latency or availability improvement without cost change is\nsurfaced in REASON, not as dollar savings.\n\n## Anti-Patterns — NEVER (top 5)\n\n1. **NEVER recommend a Graviton2 migration without verifying application\n   compatibility.** Compiled binaries (C\u002FC++, Go with CGO, Rust inline\n   assembly) and JNI libraries may fail on arm64. Always require\n   multi-arch container build verification before recommending.\n\n2. **NEVER recommend spot capacity for stateful single-instance services.**\n   Spot reclamation causes task termination. Stateful services (databases,\n   caches with no replication) cannot tolerate interruption. Spot is for\n   stateless, horizontally scalable workloads only.\n\n3. **NEVER right-size a task definition below the application's actual\n   peak memory usage.** Memory is not compressible — an OOM kill is a\n   production incident. Use p95 MemoryUtilization × 1.5 as the floor.\n\n4. **NEVER recommend migrating Fargate to EC2 without warning about the\n   operational overhead.** EC2-backed ECS requires ASG management, AMI\n   patching, capacity provider tuning, and instance monitoring. The cost\n   saving is real but the operational burden is significant.\n\n5. **NEVER recommend a Savings Plan purchase without analyzing utilization\n   stability.** An SP commits to $X\u002Fhour for 1-3 years. If the workload\n   is shrinking or migrating to a different service, the commitment\n   becomes wasted spend.\n\nExtended anti-patterns in `references\u002Fecs-pricing-and-capacity-providers.md`.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\nPre-flight safety checks (CONFIRMATION GATE, canary, OOM rollback, SP irreversibility, batch limits) moved verbatim to [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md).\nLoad on demand before executing any state-changing optimization CLI.\n\n## Recent AWS features (2024-2026)\n\nRecent AWS features (2024-2026) moved verbatim to [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md).\nLoad on demand when evaluating Graviton GA, managed scaling enhancements, Container Insights, Service Connect, per-second billing, Graviton4.\n\n## References\n\n- `references\u002Fecs-pricing-and-capacity-providers.md` — pricing tables,\n  Fargate valid CPU\u002Fmemory combinations, Graviton2 compatibility matrix,\n  capacity provider configuration, Savings Plan discount tiers, regional\n  pricing multipliers, cost calculation worked examples.\n- `references\u002Fworked-examples.md` — full worked examples (launch type\n  migration, Graviton2, right-sizing, spot capacity provider,\n  already-optimized, NEED_MORE_INFO, end-to-end walkthrough).\n\n## References (load on demand)\n\n- [references\u002Fdiagnostic-commands.md](references\u002Fdiagnostic-commands.md) — required data sources, per-step migration CLI, and pre-flight safety checks moved from SKILL.md.\n- [references\u002Fadvanced-patterns.md](references\u002Fadvanced-patterns.md) — quick-start rules, mindset, Step 0 billing behaviours, spot interruption handling, and recent AWS features moved from SKILL.md.\n- [references\u002Fecs-pricing-and-capacity-providers.md](references\u002Fecs-pricing-and-capacity-providers.md) — pricing tables, valid CPU\u002Fmemory combinations, Savings Plan tiers, plus crossover math, compatibility matrix, and impact-estimation formula moved from SKILL.md.\n- [references\u002Fworked-examples.md](references\u002Fworked-examples.md) — full worked examples (launch type migration, Graviton2, right-sizing, spot, already-optimized, NEED_MORE_INFO, end-to-end walkthrough).\n\n## Domain\n\nAWS CloudOps \u002F ECS Container Cost Optimization & FinOps.\n\n## AWS documentation\n\n- **Amazon ECS Developer Guide** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002FWelcome.html\n- **AWS Fargate pricing** — https:\u002F\u002Faws.amazon.com\u002Ffargate\u002Fpricing\u002F\n- **ECS capacity providers** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fcluster-capacity-providers.html\n- **ECS task definition parameters** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Ftask_definition_parameters.html\n- **CloudWatch Container Insights** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonCloudWatch\u002Flatest\u002Fmonitoring\u002FContainerInsights.html\n- **ECS service auto-scaling** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fservice-auto-scaling.html\n- **AWS Graviton for ECS** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAmazonECS\u002Flatest\u002Fdeveloperguide\u002Fecs-graviton.html\n- **Savings Plans** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsavingsplans\u002Flatest\u002Fuserguide\u002F\n- **AWS CLI ECS reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fcli\u002Flatest\u002Freference\u002Fecs\u002F\n- **Well-Architected 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},"ecs, compute, containers, cost-optimization, finops, fargate, graviton, capacity-provider","3","Jacky Chan — AWS Community Builder","aws-cloudops","Compute","0.1.0","ECS, Fargate, EC2 launch type, cost optimization, Graviton2, arm64, task definition, right-sizing, capacity provider, spot, on-demand, Savings Plan, bin-packing, task placement, Container Insights, auto-scaling, target tracking, scheduled scaling, EFS, EBS, FinOps, container cost","optimize","medium","false","capability","Optimising ECS task cost, evaluating Fargate vs EC2 launch type crossover, planning a Graviton2 (arm64) task migration, right-sizing task definitions from Container Insights, designing capacity provider strategy (spot + on-demand), mapping Savings Plan coverage to ECS spend, tuning task placement bin-packing for EC2 density, or tuning auto-scaling target tracking for cost.","true","OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE","EKS cost optimization (use eks-cost-optimizer), Fargate standalone cost optimization without ECS (use fargate-cost-optimizer), ECS task troubleshooting (container crashes, deployment failures, task lifecycle issues — use ecs-task-troubleshooter), or ECS task definition security auditing (use ecs-task-definition-auditor). This skill focuses on cost-driven optimization of ECS tasks, not functional debugging.","active","Input: either (a) an ECS service\u002Ftask identifier + live-account context, (b) a Cost Explorer ECS\u002FFargate charge breakdown, OR (c) CloudWatch Container Insights metrics (CPUUtilization, MemoryUtilization) with task definition details and at least 14 days of observation. Output: a deterministic TARGET\u002FVERDICT\u002FREASON\u002FRECOMMENDATION\u002F ESTIMATED_SAVINGS\u002FMIGRATION_STEPS block per service\u002Ftask, where VERDICT is one of OPTIMIZED, FURTHER_OPTIMIZATION_AVAILABLE.","# Minimal valid input (offline finding classification):\nServiceName: order-api-prod\nLaunchType: FARGATE\nTaskDefinition: order-api:42\nCPU: 1024 (1 vCPU)\nMemory: 2048 MB\nRegion: us-east-1\nArchitecture: x86_64\nMetrics (last 30 days):\n  - CPUUtilization avg: 12%, p95: 25%\n  - MemoryUtilization avg: 18%, p95: 30%\n  - RunningTaskCount avg: 8\nCost (last month): $1,847.00 (Fargate compute)\nEmit the standard optimization block (TARGET, VERDICT, REASON,\nRECOMMENDATION, ESTIMATED_SAVINGS, MIGRATION_STEPS).","optimise ECS cost, ECS Fargate vs EC2, ECS launch type crossover, ECS Graviton2 migration, ECS arm64 compatibility, ECS task right-sizing, ECS task definition CPU memory, ECS capacity provider strategy, ECS spot capacity provider, ECS Savings Plan coverage, ECS task placement bin-packing, ECS Container Insights cost, ECS auto-scaling target tracking, ECS scheduled scaling, ECS standalone task vs service, ECS EFS vs EBS storage, ECS FinOps, reduce container bill, ECS cost review","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline recommendation classification works from pasted CloudWatch Container Insights metrics, task definition configs, and Cost Explorer findings. Live-account optimization uses aws ecs describe-services, aws ecs describe-tasks, aws ecs describe-task-definition, aws ecs describe-capacity-providers, aws cloudwatch get-metric-statistics (CPUUtilization, MemoryUtilization from ECS\u002FContainerInsights), aws ce...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fecs-task-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 ecs-task-cost-optimizer",{"tool":59,"command":60},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill ecs-task-cost-optimizer",{"tool":62,"command":63},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill ecs-task-cost-optimizer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002FSKILL.md",true,[67,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",9320,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Feval\u002Ftest-cases.yaml",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"evals\u002Fbaselines\u002Falready-optimized.md",732,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fbaselines\u002Falready-optimized.md",{"path":78,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":79,"sourceHtmlUrl":80},"evals\u002Fbaselines\u002Fcapacity-provider-spot.md",1090,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fbaselines\u002Fcapacity-provider-spot.md",{"path":82,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":83,"sourceHtmlUrl":84},"evals\u002Fbaselines\u002Ffargate-to-ec2-crossover.md",1127,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fbaselines\u002Ffargate-to-ec2-crossover.md",{"path":86,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":87,"sourceHtmlUrl":88},"evals\u002Fbaselines\u002Fgraviton2-migration.md",964,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fbaselines\u002Fgraviton2-migration.md",{"path":90,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":91,"sourceHtmlUrl":92},"evals\u002Fbaselines\u002Ftask-rightsizing.md",972,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fbaselines\u002Ftask-rightsizing.md",{"path":94,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":95,"sourceHtmlUrl":96},"evals\u002Feval_config.yaml",1719,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Feval_config.yaml",{"path":98,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":99,"sourceHtmlUrl":100},"evals\u002Fevals.json",4528,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fevals.json",{"path":102,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":103,"sourceHtmlUrl":104},"evals\u002Fprompts\u002Falready-optimized.md",1334,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fprompts\u002Falready-optimized.md",{"path":106,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":107,"sourceHtmlUrl":108},"evals\u002Fprompts\u002Fcapacity-provider-spot.md",1218,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fprompts\u002Fcapacity-provider-spot.md",{"path":110,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":111,"sourceHtmlUrl":112},"evals\u002Fprompts\u002Ffargate-to-ec2-crossover.md",1032,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fprompts\u002Ffargate-to-ec2-crossover.md",{"path":114,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":115,"sourceHtmlUrl":116},"evals\u002Fprompts\u002Fgraviton2-migration.md",976,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fprompts\u002Fgraviton2-migration.md",{"path":118,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":119,"sourceHtmlUrl":120},"evals\u002Fprompts\u002Ftask-rightsizing.md",941,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fevals\u002Fprompts\u002Ftask-rightsizing.md",{"path":122,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":123,"sourceHtmlUrl":124},"examples\u002FREADME.md",8347,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fexamples\u002FREADME.md",{"path":126,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fadvanced-patterns.md",6350,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Freferences\u002Fadvanced-patterns.md",{"path":130,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Fdiagnostic-commands.md",5318,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Freferences\u002Fdiagnostic-commands.md",{"path":134,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Fecs-pricing-and-capacity-providers.md",14320,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Freferences\u002Fecs-pricing-and-capacity-providers.md",{"path":138,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":139,"sourceHtmlUrl":140},"references\u002Fworked-examples.md",16622,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Freferences\u002Fworked-examples.md",{"path":142,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":143,"sourceHtmlUrl":144},"skill.usf.yaml",4625,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fecs-task-cost-optimizer\u002Fskill.usf.yaml",[146,153,160,167,174,181],{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":19},"01M7ADVD60X4PCAPKSE58P9NDC","xray-tracing-deployer","Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL \u002F method \u002F service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry \u002F ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS \u002F EKS \u002F Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxray-tracing-deployer\u002FSKILL.md",[],[],{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":19},"01M7ADTVJ7DCBM9CB1FY51GH7J","wellarchitected-workload-auditor","Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-workload-auditor\u002FSKILL.md",[],[],{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":19},"01M7ADT59G6FTTNZYHT2QRPNNP","wellarchitected-review-operator","Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer \u002F get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwellarchitected-review-operator\u002FSKILL.md",[],[],{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":19},"01M7ADSH5JA9QHNPPHQCD7EVA7","wafv2-web-acl-deployer","Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB\u002FAPI Gateway\u002FCloudFront, or configuring CAPTCHA\u002FChallenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-deployer\u002FSKILL.md",[],[],{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":180,"publishedAt":19},"01M7ADRYFAT8R73FBNCHRC573X","wafv2-web-acl-auditor","Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow\u002Fbypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwafv2-web-acl-auditor\u002FSKILL.md",[],[],{"skillNo":182,"name":183,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":185,"categories":186,"keywords":187,"publishedAt":19},"01M7ADR8W7G72JX4KFGN03QK8Q","waf-rule-deployer","Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.","https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwaf-rule-deployer\u002FSKILL.md",[],[]]