[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A78JKQ9RHHDW6KCB9CYF3K":3,"skill-same:01M7A78JKQ9RHHDW6KCB9CYF3K":151},{"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":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M7A78JKQ9RHHDW6KCB9CYF3K","ec2-instance-recovery-operator",null,"Operates EC2 instance recovery — system status check failure (hardware degradation, stop\u002Fstart, EC2 recover action), CloudWatch alarm recovery (reboots on same host), instance replacement via Auto Scaling group health check, EBS volume detach\u002Fattach for data salvage, console output for OS-level diagnosis, SSM Session Manager for SSH-less live troubleshooting, AMI creation from a failing instance for forensic snapshot, instance stop\u002Fstart to clear ephemeral issues, placement group recovery, EC2 automatic recovery, and Capacity Reservation preservation during recovery. Runs deterministic pre-checks (instance state, system status check, EBS attachment status, ASG membership, SSM agent reachability, CloudWatch alarm config, Capacity Reservation binding) behind a CONFIRM gate and emits a READY, BLOCKED, or COMPLETED verdict per recovery action. Use when an instance is impaired, hardware has degraded, an ASG is churning, or a forensic snapshot is needed before termination.","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\u002Fec2-instance-recovery-operator\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: ec2-instance-recovery-operator\ndescription: Operates EC2 instance recovery — system status check failure (hardware degradation, stop\u002Fstart, EC2 recover action), CloudWatch alarm recovery (reboots on same host), instance replacement via Auto Scaling group health check, EBS volume detach\u002Fattach for data salvage, console output for OS-level diagnosis, SSM Session Manager for SSH-less live troubleshooting, AMI creation from a failing instance for forensic snapshot, instance stop\u002Fstart to clear ephemeral issues, placement group recovery, EC2 automatic recovery, and Capacity Reservation preservation during recovery. Runs deterministic pre-checks (instance state, system status check, EBS attachment status, ASG membership, SSM agent reachability, CloudWatch alarm config, Capacity Reservation binding) behind a CONFIRM gate and emits a READY, BLOCKED, or COMPLETED verdict per recovery action. Use when an instance is impaired, hardware has degraded, an ASG is churning, or a forensic snapshot is needed before termination.\nlicense: Apache-2.0\ncompatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline plan classification. Live-account operations use aws ec2 describe-instance-status, describe-instances, stop-instances, start-instances, reboot-instances, describe-volumes, detach-volume, attach-volume, get-console-output, create-image, describe-instance-attribute, aws ssm start-session, describe-instance-information, aws cloudwatch describe-alarms, put-metric-alarm, and...\nmetadata:\n  domain: aws-cloudops\n  complexity: high\n  requires_llm: 'true'\n  phase: '4'\n  supports_pipeline: 'true'\n  entry_point: 'false'\n  family: Compute\n  task_type: operate\n  skill_class: capability\n  lifecycle_status: active\n  verdict_shape: READY | BLOCKED | COMPLETED\n  when_to_use: Recovering from an EC2 system status check failure (hardware degradation), configuring CloudWatch alarm recovery, replacing an instance via Auto Scaling group health check, detaching and reattaching EBS volumes to salvage data from an unhealthy instance, diagnosing OS-level issues via console output, accessing an impaired instance via SSM Session Manager, creating an AMI for forensic snapshot before termination, stop\u002Fstarting an instance to clear ephemeral issues, recovering an instance in a placement group, or preserving a Capacity Reservation binding during recovery.\n  activation_triggers: instance status check failed, system status check failed, instance impaired, hardware degradation, EC2 recover, CloudWatch recovery alarm, instance stop start, reboot instance, ASG instance replacement, Auto Scaling health check, EBS detach attach, console output, Session Manager access, AMI forensic snapshot, placement group recovery, Capacity Reservation, instance unreachable, EC2 automatic recovery\n  invocation_schema: 'Input: either (a) an instance configuration (describe-instance-status, describe-instances) plus the intended operation (recover-instance, stop-start, reboot, replace-via-asg, detach-attach-ebs, forensic-ami, enable-recovery-alarm, diagnose-impaired), OR (b) an instance-id + operation for live-account execution. Output: deterministic OPERATION \u002F VERDICT \u002F PRE_CHECKS \u002F STEPS \u002F POST_VERIFY \u002F NOTES block per recovery, where VERDICT is one of READY, BLOCKED, COMPLETED.'\n  version: 0.1.0\n  author: Jacky Chan — AWS Community Builder\n  keywords: EC2 instance recovery, system status check, instance status check, hardware degradation, stop\u002Fstart instance, EC2 recover action, CloudWatch alarm recovery, Auto Scaling group replacement, ASG health check, EBS detach attach, console output, get-console-output, SSM Session Manager, AMI forensic snapshot, placement group recovery, Capacity Reservation, instance store, ephemeral storage, impaired instance, EC2 automatic recovery\n  tags: aws, ec2, compute, recovery, ebs, ssm, cloudwatch, autoscaling, forensics, operate\n---\n\n# EC2 Instance Recovery Operator\n\n## What this skill does\n\nExecutes EC2 instance recovery operations correctly and safely. Runs\ndeterministic pre-checks before any state-changing CLI (instance\nstate, system\u002Finstance status checks, EBS attachment status, ASG\nmembership, SSM agent reachability, CloudWatch alarm config, Capacity\nReservation binding, placement group state, instance-store warning),\nexecutes the recovery behind a CONFIRM gate, and verifies the result\nby confirming the instance returns to `running` with both status\nchecks `ok`. Every recover-instance surfaces the failure-mode table so\nthe operator knows whether to stop\u002Fstart, reboot, replace via ASG, or\nescalate to AWS Support. Every forensic-ami captures the snapshot\nBEFORE the instance is terminated or replaced.\n\n## Quick navigation\n\n| Section | What it covers | When to read it |\n|---|---|---|\n| **§ Quick reference** | Verdict thresholds (BLOCKED\u002FREADY\u002FCOMPLETED) + pre-check priority | Before any operation |\n| **§ Mindset** | Why recovery is a state-preserve-then-restore sequence, the instance-store trap | Understanding the safety model |\n| **§ Pre-flight** | Instance metadata gate — state, status checks, ASG, Capacity Reservation | Before executing any CLI |\n| **§ Process** | Per-operation planning: recover-instance, stop-start, reboot, replace-via-asg, detach-attach-ebs, forensic-ami, enable-recovery-alarm, diagnose-impaired | When choosing which operation to run |\n| **§ Output format** | STRICT output contract — OPERATION\u002FVERDICT\u002FPRE_CHECKS\u002FSTEPS\u002FPOST_VERIFY\u002FNOTES template | Formatting the response |\n| **§ Anti-Patterns** | NEVER list — common mistakes that lose data or extend downtime | Review before risky operations |\n| **§ Pre-flight safety** | Capture pre-state, AMI snapshot, EBS volume IDs, ASG suspend processes | Defense-in-depth |\n| **§ Expert heuristic** | Stop\u002Fstart relocates to new hardware; reboot stays on the same host | Choosing stop\u002Fstart vs reboot |\n\n## STRICT output contract\n\nEVERY response MUST end with a single fenced text block in this exact\nshape (the operator's downstream tooling greps for it). No deviations:\n\n```text\nOPERATION: \u003Crecover-instance | stop-start | reboot | replace-via-asg | detach-attach-ebs | forensic-ami | enable-recovery-alarm | diagnose-impaired>\nVERDICT: READY | BLOCKED | COMPLETED\nTARGET: \u003Cinstance-id> (state: \u003Cstate>, system-status: \u003Cstatus>, instance-status: \u003Cstatus>)\nPRE_CHECKS:\n  - [PASS] \u003Ccheck description>\n  - [FAIL] \u003Ccheck description> — \u003Creason>\nSTEPS:\n  1. \u003CCLI command with flags populated, or \"(none — pre-checks failed)\">\n  2. \u003Cwait \u002F monitoring command>\nPOST_VERIFY:\n  - [PASS] \u003Cverification description> | (pending execution)\n  - [FAIL] \u003Cverification description> — \u003Creason>\nNOTES: \u003Cdata-preservation, monitoring, caveats>\n```\n\nRules of the contract:\n\n- VERDICT is exactly one of `READY`, `BLOCKED`, `COMPLETED`. No other\n  values. `READY` means pre-checks passed and a CONFIRM gate is\n  pending; `BLOCKED` means at least one pre-check failed — do NOT\n  emit STEPS that mutate state; `COMPLETED` means post-verification\n  passed after the recovery action.\n- If PRE_CHECKS has any `[FAIL]`, VERDICT MUST be `BLOCKED` and STEPS\n  MUST be `(none — pre-checks failed)`.\n- If VERDICT is `READY`, STEPS[1] MUST be the CONFIRM prompt and\n  STEPS[2] MUST be the actual CLI.\n- If VERDICT is `COMPLETED`, POST_VERIFY MUST contain at least one\n  `[PASS]` and no `[FAIL]`.\n- Never wrap the block in JSON, never abbreviate the field names,\n  never omit a section. If a section is empty, write `(none)`.\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `BLOCKED` | One or more pre-checks failed (instance in `terminated` state, instance-store volumes will be lost on stop\u002Fstart, ASG will immediately replace before recovery completes, Capacity Reservation binding lost on stop, CloudWatch recovery alarm already configured and firing, SSM agent offline for session access) | List failures, do NOT execute |\n| `READY` | All pre-checks passed; awaiting CONFIRM gate | Emit exact CLI sequence, wait for operator yes |\n| `COMPLETED` | Recovery finished AND post-verification passed (instance `running`, both status checks `ok`, application healthy, EBS volumes reattached if detach\u002Fattach) | Emit verification results, monitoring plan |\n\n**Priority order for pre-checks (apply in this sequence, all must\npass for READY):**\n\n1. **Instance reachability.** Instance exists and is NOT in\n   `terminated` state. `shutting-down` waits; `stopped` requires\n   start only.\n2. **Status check classification.** `SystemStatus` impaired →\n   hardware\u002Fhost issue, recover via stop\u002Fstart or CloudWatch recover.\n   `InstanceStatus` impaired → OS\u002Fapplication issue, recover via\n   reboot or SSM access.\n3. **Instance-store warning.** If `RootDeviceType: instance-store` OR\n   any block device mapping has `Ebs: No`, stop\u002Fstart and recover\n   LOSE ephemeral data. BLOCK unless the operator acknowledges.\n4. **ASG membership.** If the instance is in an ASG, stop\u002Fstart may\n   trigger a health-check replacement. Suspend `HealthCheck` \u002F\n   `AlarmNotification` processes before stopping, or use the ASG's\n   managed replacement flow.\n5. **EBS attachment.** Capture all volume IDs and attachment state\n   before any recovery. If the instance is unreachable but EBS is\n   healthy, detach + attach to a recovery instance is the safest\n   data-salvage path.\n6. **Capacity Reservation binding.** If the instance has a Capacity\n   Reservation target, stop\u002Fstart may release the binding. Use\n   `describe-instance-attribute --attribute capacity-reservation-target`,\n   and explicitly re-target on start.\n7. **Placement group.** Stop\u002Fstart on a `cluster` placement group\n   instance may fail to restart if the group lacks capacity. Consider\n   reboot (same host) for placement-group recovery.\n8. **SSM agent reachability (for session access).** `describe-instance-\n   information` shows `PingStatus: Online` for SSM-managed instances.\n   Offline SSM means Session Manager will not work; fall back to EC2\n   Serial Console or console output.\n9. **CloudWatch recovery alarm.** If a recovery alarm is already\n   configured and the instance is in `running` after a recover action,\n   the alarm may have already fired — do NOT double-recover.\n\n**Cost\u002Ftime baselines (2026):**\n\n- Stop\u002Fstart: 2-5 minutes total (stop ~30s, start ~60s, boot varies).\n- Reboot: 1-3 minutes (stays on same host, faster than stop\u002Fstart).\n- CloudWatch EC2 recover action: 1-5 minutes from alarm breach to\n  recover (same-host reboot, preserves EBS and instance store).\n- ASG replacement: 3-10 minutes (launch + boot + health check + ELB).\n- EBS detach\u002Fattach: 30-60 seconds per volume (same AZ only).\n- AMI creation for forensic snapshot: 5-30 minutes depending on EBS\n  size (AMI + snapshots are async).\n\n## Mindset\n\n**One-line takeaway:** `Status: running` is a process claim, not a\nhealth claim. An instance is only \"recovered\" when both status checks\nreturn `ok` AND the application responds to its health check. Driven\nby three EC2 realities:\n\n- **Stop\u002Fstart is destructive for instance-store volumes.** Stop\n  releases the host; start lands on a different physical machine.\n  Any data on `instance-store` volumes is gone. EBS-backed volumes\n  persist. Many operators learn this only after the first recovery.\n- **ASG-managed instances have their own recovery loop.** When a\n  health check fails, the ASG marks the instance `Unhealthy` and\n  launches a replacement. Stopping manually without suspending\n  `HealthCheck` causes the ASG to terminate it. Always check ASG\n  membership before manual recovery.\n- **The CloudWatch EC2 recover action is a same-host reboot, NOT a\n  stop\u002Fstart.** It preserves the host, EBS, and instance-store data,\n  but only fixes hardware issues detectable by the status check.\n\n## Pre-flight: instance metadata gate\n\nRun before classification. Misclassifying these produces wrong plans.\n\n**Pagination:** `describe-instance-status` paginates at 1,000\ninstances per call; drain `--next-token` for fleet-wide audits. For a\nsingle instance, `--instance-ids \u003Cid>` returns one result.\n\n**Live-account pre-flight (skip if offline plan audit):** the 7 read-only commands\n(describe-instance-status ... get-console-output) are listed in [Diagnostic commands](references\u002Fdiagnostic-commands.md).\n\nMalformed-input protocol (VERDICT: ERROR + REMEDIATION): see [Error handling](references\u002Ferror-handling.md).\n\n| Instance attribute | Effect on operation |\n|---|---|\n| `State: terminated` | BLOCKED. Route to EBS-based recovery (launch from snapshot\u002FAMI). |\n| `State: shutting-down` | Wait. Poll every 30s until `stopped` or `terminated`. |\n| `SystemStatus: impaired` | Hardware\u002Fhost. Stop\u002Fstart relocates; recover reboots same host. |\n| `InstanceStatus: impaired` | OS\u002Fapp. Reboot or SSM session. Stop\u002Fstart rarely helps. |\n| `Events: instance-stop` (scheduled) | AWS will stop on scheduled date. Plan recovery before window. |\n| `Events: system-reboot` (scheduled) | AWS will reboot. Do NOT manually reboot. |\n| `RootDeviceType: instance-store` | Stop\u002Fstart LOSES root volume. BLOCK unless acknowledged. |\n| ASG `HealthStatus: Unhealthy` | ASG will terminate+replace. Suspend `HealthCheck` first. |\n| `CapacityReservationId` set | Stop may release binding. Re-target on start. |\n| `Placement.GroupName` set (cluster) | Stop\u002Fstart may fail restart. Prefer reboot. |\n| `Placement.Tenancy: host` | Stop releases dedicated host. Verify availability. |\n| Existing recovery alarm | Alarm may have fired. Check history; do NOT double-recover. |\n\n## Process — operation planning (apply in order)\n\n### Step 0: Expert knowledge - non-obvious EC2 recovery behaviors (condensed)\n\n- Stop\u002Fstart RELOCATES to a new host (loses instance-store data, releases Capacity Reservation\u002Fdedicated host). Reboot STAYS on the same host.\n- CloudWatch EC2 recover action = API-driven same-host reboot; only helps `StatusCheckFailed_System`.\n- ASG-managed replacement usually beats manual recovery; suspend `HealthCheck` if manual recovery is required.\n- EBS detach\u002Fattach to a rescue instance in the same AZ is the safest data-salvage path.\n- `create-image --no-reboot` for forensic snapshots of hung instances; `get-console-output` shows the LAST boot only.\n- Full deep dives (Serial Console, automatic recovery, placement groups, metric separation): [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 1: Pre-check gate — BLOCKED if any check fails\n\nRun ALL pre-checks for the chosen operation. If ANY fails, the verdict\nis BLOCKED with the failed checks in PRE_CHECKS. Do NOT execute.\n\n**For ALL operations:**\n1. Instance exists and is NOT `terminated`.\n2. If `State: shutting-down`, BLOCK (wait for transition).\n3. Capture all EBS volume IDs (for rollback).\n4. Capture `RootDeviceType` (instance-store warning).\n5. Capture ASG membership (suspend processes if applicable).\n\n**For recover-instance (CloudWatch recover action):**\n6. `SystemStatus: impaired` (recover only helps hardware).\n7. No existing recovery alarm already firing (check alarm history).\n8. No scheduled `instance-stop` event pending (let AWS handle it).\n\n**For stop-start (relocate to new host):**\n6. `RootDeviceType: ebs` (instance-store loses data).\n7. No `instance-store` block devices (or operator acknowledged).\n8. ASG `HealthCheck` suspended (if applicable).\n9. Capacity Reservation target captured for re-binding.\n10. Placement group has free capacity for restart (cluster groups).\n\n**For reboot (same host):**\n6. No pending `system-reboot` scheduled event (let AWS handle it).\n7. Instance is `running` (reboot on `stopped` is a no-op).\n\n**For replace-via-asg:**\n6. Instance is in an ASG.\n7. ASG `HealthCheck` process is `Resumed` (not suspended).\n8. ASG `MinSize` >= 1 (so the replacement launches).\n9. ELB\u002Ftarget group health check configured (so the new instance\n   registers).\n\n**For detach-attach-ebs (data salvage):**\n6. Rescue instance exists in the same AZ.\n7. EBS volume is `in-use` (attached to the unhealthy instance).\n8. `DeleteOnTermination: false` for the volume (otherwise the source\n   instance's termination deletes it).\n9. Rescue instance has the volume slot free (no name conflict on the\n   device name).\n\n**For forensic-ami (snapshot before termination):**\n6. Instance is NOT `terminated` (AMI cannot capture a terminated\n   instance).\n7. EBS-backed root volume (instance-store root cannot be snapshotted).\n8. AMI name does not collide with an existing AMI.\n\n**For enable-recovery-alarm:**\n6. No existing recovery alarm on the same metric (avoid duplicate\n   actions).\n7. `InstanceType` supports the EC2 recover action (all current-gen\n   types; some previous-gen types do not).\n8. `InstanceStatus: ok` (do not set a recovery alarm during a known\n   OS issue — the alarm fires on `StatusCheckFailed_System` only,\n   but verify the operator understands this).\n\n**For diagnose-impaired (read-only, no BLOCKED gate):**\n6. Read the failure-mode table and console output to identify the\n   root cause.\n\n**Failure-mode table (use during diagnose-impaired):**\n\n| Symptom | Root cause | Fix |\n|---|---|---|\n| `SystemStatus: impaired`, `InstanceStatus: ok` | Host hardware degradation | Stop\u002Fstart OR CloudWatch recover |\n| `InstanceStatus: impaired`, `SystemStatus: ok` | OS \u002F filesystem \u002F kernel hang | Reboot; if unreachable, SSM or Serial Console |\n| Both `impaired` | Network \u002F VPC \u002F ENI reachability loss | Check route table, ENI; stop\u002Fstart if ENI re-attach needed |\n| `State: running`, no SSH, SSM `Online` | Security group \u002F IAM role issue | SSM Session Manager; verify SG ingress + SSM role |\n| `State: running`, no SSH, SSM `ConnectionLost` | SSM agent hung or OS network down | Reboot; if persistent, EBS detach\u002Fattach for repair |\n| Console: kernel panic | Kernel module or boot config | Stop\u002Fstart; if persistent, EBS detach\u002Fattach to revert module |\n| Console: `No space left on device` | Disk full | SSM session to clean up; or expand EBS volume |\n| Console: `Failed to mount root filesystem` | Corrupted root EBS | Detach root, attach to rescue, `fsck`, reattach |\n| ASG churn (rapid launch\u002Fterminate) | Launch config \u002F AMI \u002F health check | Diagnose via ASG activity; freeze ASG to stop churn |\n| `State: stopped` immediately after launch | User-data script failure | Check console output; fix user-data; restart |\n\n### Step 2: READY — emit operation plan\n\nIf all pre-checks pass, emit `VERDICT: READY` with the exact CLI\nsequence and the CONFIRM gate. The plan includes:\n\n- The exact AWS CLI command with all flags populated from the\n  instance metadata.\n- The expected duration (stop\u002Fstart 2-5 min; reboot 1-3 min; AMI\n  5-30 min depending on EBS size).\n- The expected side-effects (instance-store data lost on stop\u002Fstart;\n  Capacity Reservation binding released; ASG health-check paused).\n- The CONFIRM gate prompt.\n- The monitoring commands (poll `describe-instance-status`, check\n  application health endpoint).\n\n### Step 3: Execute behind CONFIRM gate\n\n- **MANDATORY CONFIRMATION GATE.** Before `stop-instances`,\n  `start-instances`, `reboot-instances`, `detach-volume`,\n  `attach-volume`, `create-image`, `terminate-instances`,\n  `cloudwatch put-metric-alarm`, `autoscaling suspend-processes` \u002F\n  `resume-processes`, emit: `CONFIRM: About to \u003Coperation> on\n  \u003Cinstance-id> in account \u003Caccount> region \u003Cregion>. This will\n  \u003Cconsequence>. Proceed? (yes\u002Fno)`. Do NOT execute until the\n  operator confirms.\n- Capture pre-state: `aws ec2 describe-instances --instance-ids \u003Cid>\n  --output json > \u002Ftmp\u002F\u003Cid>-pre-$(date +%s).json` AND `aws ec2\n  describe-volumes --filters Name=attachment.instance-id,Values=\u003Cid>\n  --output json > \u002Ftmp\u002F\u003Cid>-volumes-$(date +%s).json`.\n- For forensic-ami: ALWAYS run AMI creation BEFORE any stop\u002Fstart or\n  terminate. The AMI is the point-in-time snapshot.\n- For stop\u002Fstart: poll `describe-instance-status` every 30 seconds\n  until `State: running` and both status checks return `ok`.\n\n### Step 4: Post-verification — COMPLETED\n\nAfter the recovery finishes, run post-verification. ALL checks must\npass for `COMPLETED`.\n\n1. `describe-instance-status --instance-ids \u003Cid>` — confirm\n   `State: running`, `SystemStatus.Status: ok`,\n   `InstanceStatus.Status: ok`.\n2. No scheduled `Events` pending (or, if scheduled, surface them).\n3. For stop-start: confirm EBS volumes reattached and `DeleteOn-\n   Termination` preserved.\n4. For stop-start with Capacity Reservation: confirm binding re-\n   established (`describe-instances --query Reservations[0].Instances\n   [0].CapacityReservationId`).\n5. For ASG replacement: confirm the new instance is `InService` and\n   passes the ELB \u002F target group health check.\n6. For EBS detach\u002Fattach: confirm the volume is `in-use` on the\n   target instance at the expected device name.\n7. For forensic-ami: confirm the AMI is `available` and all snapshots\n   are `completed`.\n8. Application health: hit the instance's health-check endpoint or\n   CloudWatch metric; confirm the workload recovered.\n\nIf ANY verification fails, emit `VERDICT: ERROR` with the failure\ndetails — do not claim COMPLETED.\n\n## Output format (per operation)\n\nSee § STRICT output contract above. The block MUST appear exactly in\nthat shape at the end of the response.\n\n### Worked example — recover-instance (stop\u002Fstart)\n\n```text\nOPERATION: stop-start\nVERDICT: READY\nTARGET: i-0abcdef1234567890 (state: running, system-status: impaired,\n        instance-status: ok)\nPRE_CHECKS:\n  - [PASS] Instance exists, not terminated\n  - [PASS] SystemStatus impaired (host issue), InstanceStatus ok\n  - [PASS] RootDeviceType: ebs (no data loss on stop)\n  - [PASS] No instance-store block devices\n  - [PASS] ASG: not a member (no suspend needed)\n  - [PASS] Capacity Reservation: not bound\n  - [PASS] Placement: default (no cluster constraint)\nSTEPS:\n  1. CONFIRM: About to stop and start i-0abcdef1234567890 in account\n     111111111111 region us-east-1. This will RELOCATE to a new host\n     (clears hardware impairment), cause 2-5 min downtime, preserve\n     EBS. Proceed? (yes\u002Fno)\n  2. aws ec2 stop-instances --instance-ids i-0abcdef1234567890\n  3. Poll describe-instance-status every 30s until stopped\n  4. aws ec2 start-instances --instance-ids i-0abcdef1234567890\n  5. Poll describe-instance-status every 30s until running + ok\nPOST_VERIFY:\n  - (pending execution)\nNOTES:\n  - Stop\u002Fstart is correct for SystemStatus impaired. Reboot would\n    keep the instance on the same impaired host.\n  - Set up a CloudWatch recovery alarm for auto-recovery:\n    aws cloudwatch put-metric-alarm --alarm-name recover-i-0abcdef\n      --metric-name StatusCheckFailed_System --namespace AWS\u002FEC2\n      --dimensions Name=InstanceId,Value=i-0abcdef1234567890\n      --threshold 1 --comparison-operator GreaterThanOrEqualToThreshold\n      --period 60 --evaluation-periods 2\n      --alarm-actions arn:aws:automate:us-east-1:ec2:recover\n```\n\n## Anti-Patterns — NEVER\n\n- NEVER stop an instance with `RootDeviceType: instance-store`\n  without explicitly warning that the root volume and all instance-\n  store volumes will be LOST. Stop releases the host; no recovery\n  path for ephemeral data.\n\n- NEVER manually stop an ASG-managed instance without first\n  suspending `HealthCheck`. The ASG detects the stop, marks it\n  `Unhealthy`, and terminates it — destroying in-flight work.\n\n- NEVER use the EC2 recover action for `InstanceStatus: impaired`.\n  Recover only addresses `SystemStatus` (hardware). For OS issues,\n  recover does nothing and the alarm keeps firing.\n\n- NEVER reboot an instance with a pending `system-reboot` scheduled\n  event. The scheduled event runs automatically; a manual reboot\n  masks the hardware issue and prevents AWS from applying the fix.\n\n- NEVER create a forensic AMI AFTER stopping or terminating the\n  instance. AMI creation captures the running state. Stop clears\n  in-memory state; terminate destroys the instance. AMI FIRST.\n\n- NEVER detach the root volume of a running instance without\n  stopping it (use `--force` only if the instance is hung and stop\n  is not completing). Forced detach can corrupt the filesystem.\n\n- NEVER assume `State: running` means the application is healthy.\n  Verify the application's health check, not just EC2 status\n  checks. A hung process keeps the instance `running` while idle.\n\n- NEVER forget to re-bind the Capacity Reservation on start. Stop\n  releases the binding; start without `--capacity-reservation-\n  specification` loses the reservation.\n\n- NEVER rely on `get-console-output` for historical diagnosis after\n  a reboot. Each boot clears the prior log. Capture to a local\n  file BEFORE any recovery action.\n\n- NEVER use `create-image --no-reboot` for production AMIs. It\n  captures the filesystem in a potentially inconsistent state. Use\n  ONLY for forensic snapshots of hung instances.\n\n- NEVER double-recover. If a CloudWatch recovery alarm already fired,\n  check alarm history before triggering another recovery. Double-\n  recovery extends downtime without fixing anything.\n\n- NEVER terminate an instance to \"force recovery\" without first\n  detaching EBS volumes and capturing an AMI. Termination is\n  irreversible.\n\n- NEVER auto-execute a state-changing EC2 recovery CLI without the\n  CONFIRM gate. Stop, reboot, detach, terminate, and AMI creation\n  all extend downtime or destroy data.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing\n  operation, emit the CONFIRM prompt. Do NOT execute until the\n  operator confirms.\n\n- Full defense-in-depth checklist (pre-state capture commands, AMI-first, ASG suspension, Capacity Reservation re-targeting, placement-group capacity): [Advanced patterns](references\u002Fadvanced-patterns.md).\n## Expert heuristic: stop\u002Fstart vs. reboot\n\nThe single highest-leverage decision in EC2 recovery is:\n\n> **Stop\u002Fstart relocates the instance to a new physical host. Reboot\n> stays on the same host.** Match the operation to the impairment:\n> `SystemStatus: impaired` → stop\u002Fstart (host is bad). `InstanceStatus:\n> impaired` → reboot or SSM access (host is fine, OS is not). Never\n> use reboot for a hardware impairment — the instance stays on the\n> broken host and the impairment persists.\n\n**Why this matters:** Operators frequently confuse reboot with\nstop\u002Fstart. Both appear to \"restart\" the instance, but they have\nopposite effects on the physical host. A reboot on an impaired host\nextends the outage. A stop\u002Fstart on an OS issue adds 2-5 minutes of\ndowntime without fixing anything.\n\n**Decision matrix:**\n\n| Symptom | Operation | Why |\n|---|---|---|\n| `SystemStatus: impaired`, `InstanceStatus: ok` | Stop\u002Fstart OR CloudWatch recover | Host hardware bad |\n| `InstanceStatus: impaired`, `SystemStatus: ok` | Reboot OR SSM session | OS hung |\n| Both `impaired` | Diagnose first (console, ENI) | Could be network\u002FENI |\n| `State: running`, no SSH\u002FSSM | EBS detach\u002Fattach for filesystem repair | OS unreachable |\n| ASG-managed, health checks failing | ASG-managed replacement | ASG is the recovery loop |\n| Pending `system-reboot` event | Wait for AWS | Manual reboot masks the issue |\n| Pending `instance-stop` event | Stop\u002Fstart BEFORE the window | Proactively relocate |\n\n**Surface in the output:** for any recovery, include\n`HOST_CHANGE: \u003Cyes | no>` and `DATA_LOSS_RISK: \u003Cyes | no>`. If\n`DATA_LOSS_RISK: yes` and the operator has not acknowledged, BLOCK.\n\n**Verification protocol (apply on every recovery):**\n\n1. **Status check restoration:** `describe-instance-status` — both\n   `SystemStatus` and `InstanceStatus` return `ok`.\n2. **Application health:** hit the workload's health endpoint. EC2\n   status checks do not verify the application.\n3. **EBS integrity:** `describe-volumes` — all volumes `in-use`.\n4. **Capacity Reservation:** confirm the binding (if applicable).\n5. **Console output:** capture post-recovery console log.\n\n## References (load on demand)\n\n- [Worked examples](references\u002Fworked-examples.md) - detach-attach-ebs (COMPLETED) and diagnose-impaired (BLOCKED) walkthroughs\n- [Error handling](references\u002Ferror-handling.md) - malformed-input VERDICT: ERROR protocol\n- [Diagnostic commands](references\u002Fdiagnostic-commands.md) - live-account pre-flight command listing\n- [Advanced patterns](references\u002Fadvanced-patterns.md) - expert behaviors, defense-in-depth safety checklist, 2024-2026 features\n- [Status check deep dive](references\u002Fstatus-check-deep-dive.md) - System vs Instance status, stop\u002Fstart vs reboot attribute tables\n- [Recovery procedures](references\u002Frecovery-procedures.md) - per-archetype diagnostic and recovery procedures\n\n## Domain\n\nAWS CloudOps \u002F EC2 Instance Recovery, Compute Resilience, and\nForensic Preservation.\n\n## AWS documentation\n\n- **EC2 User Guide — Recover your instance** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fec2-instance-recover.html\n- **Status checks** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fmonitoring-system-instance-status-check.html\n- **CloudWatch recover action** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002FUsingAlarmActions.html\n- **EC2 Serial Console** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fec2-serial-console.html\n- **SSM Session Manager** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fsession-manager.html\n- **ASG health checks** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Fhealthcheck.html\n- **EBS volumes** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Febs-attaching-volume.html\n- **Capacity Reservations** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fcapacity-reservations-using.html\n- **Placement groups** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fplacement-groups.html\n- **EC2 API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FAPIReference\u002F\n","# EC2 Instance Recovery Operator\n\n## What this skill does\n\nExecutes EC2 instance recovery operations correctly and safely. Runs\ndeterministic pre-checks before any state-changing CLI (instance\nstate, system\u002Finstance status checks, EBS attachment status, ASG\nmembership, SSM agent reachability, CloudWatch alarm config, Capacity\nReservation binding, placement group state, instance-store warning),\nexecutes the recovery behind a CONFIRM gate, and verifies the result\nby confirming the instance returns to `running` with both status\nchecks `ok`. Every recover-instance surfaces the failure-mode table so\nthe operator knows whether to stop\u002Fstart, reboot, replace via ASG, or\nescalate to AWS Support. Every forensic-ami captures the snapshot\nBEFORE the instance is terminated or replaced.\n\n## Quick navigation\n\n| Section | What it covers | When to read it |\n|---|---|---|\n| **§ Quick reference** | Verdict thresholds (BLOCKED\u002FREADY\u002FCOMPLETED) + pre-check priority | Before any operation |\n| **§ Mindset** | Why recovery is a state-preserve-then-restore sequence, the instance-store trap | Understanding the safety model |\n| **§ Pre-flight** | Instance metadata gate — state, status checks, ASG, Capacity Reservation | Before executing any CLI |\n| **§ Process** | Per-operation planning: recover-instance, stop-start, reboot, replace-via-asg, detach-attach-ebs, forensic-ami, enable-recovery-alarm, diagnose-impaired | When choosing which operation to run |\n| **§ Output format** | STRICT output contract — OPERATION\u002FVERDICT\u002FPRE_CHECKS\u002FSTEPS\u002FPOST_VERIFY\u002FNOTES template | Formatting the response |\n| **§ Anti-Patterns** | NEVER list — common mistakes that lose data or extend downtime | Review before risky operations |\n| **§ Pre-flight safety** | Capture pre-state, AMI snapshot, EBS volume IDs, ASG suspend processes | Defense-in-depth |\n| **§ Expert heuristic** | Stop\u002Fstart relocates to new hardware; reboot stays on the same host | Choosing stop\u002Fstart vs reboot |\n\n## STRICT output contract\n\nEVERY response MUST end with a single fenced text block in this exact\nshape (the operator's downstream tooling greps for it). No deviations:\n\n```text\nOPERATION: \u003Crecover-instance | stop-start | reboot | replace-via-asg | detach-attach-ebs | forensic-ami | enable-recovery-alarm | diagnose-impaired>\nVERDICT: READY | BLOCKED | COMPLETED\nTARGET: \u003Cinstance-id> (state: \u003Cstate>, system-status: \u003Cstatus>, instance-status: \u003Cstatus>)\nPRE_CHECKS:\n  - [PASS] \u003Ccheck description>\n  - [FAIL] \u003Ccheck description> — \u003Creason>\nSTEPS:\n  1. \u003CCLI command with flags populated, or \"(none — pre-checks failed)\">\n  2. \u003Cwait \u002F monitoring command>\nPOST_VERIFY:\n  - [PASS] \u003Cverification description> | (pending execution)\n  - [FAIL] \u003Cverification description> — \u003Creason>\nNOTES: \u003Cdata-preservation, monitoring, caveats>\n```\n\nRules of the contract:\n\n- VERDICT is exactly one of `READY`, `BLOCKED`, `COMPLETED`. No other\n  values. `READY` means pre-checks passed and a CONFIRM gate is\n  pending; `BLOCKED` means at least one pre-check failed — do NOT\n  emit STEPS that mutate state; `COMPLETED` means post-verification\n  passed after the recovery action.\n- If PRE_CHECKS has any `[FAIL]`, VERDICT MUST be `BLOCKED` and STEPS\n  MUST be `(none — pre-checks failed)`.\n- If VERDICT is `READY`, STEPS[1] MUST be the CONFIRM prompt and\n  STEPS[2] MUST be the actual CLI.\n- If VERDICT is `COMPLETED`, POST_VERIFY MUST contain at least one\n  `[PASS]` and no `[FAIL]`.\n- Never wrap the block in JSON, never abbreviate the field names,\n  never omit a section. If a section is empty, write `(none)`.\n\n## Quick reference — verdict thresholds\n\n| Verdict | Trigger condition | Action |\n|---|---|---|\n| `BLOCKED` | One or more pre-checks failed (instance in `terminated` state, instance-store volumes will be lost on stop\u002Fstart, ASG will immediately replace before recovery completes, Capacity Reservation binding lost on stop, CloudWatch recovery alarm already configured and firing, SSM agent offline for session access) | List failures, do NOT execute |\n| `READY` | All pre-checks passed; awaiting CONFIRM gate | Emit exact CLI sequence, wait for operator yes |\n| `COMPLETED` | Recovery finished AND post-verification passed (instance `running`, both status checks `ok`, application healthy, EBS volumes reattached if detach\u002Fattach) | Emit verification results, monitoring plan |\n\n**Priority order for pre-checks (apply in this sequence, all must\npass for READY):**\n\n1. **Instance reachability.** Instance exists and is NOT in\n   `terminated` state. `shutting-down` waits; `stopped` requires\n   start only.\n2. **Status check classification.** `SystemStatus` impaired →\n   hardware\u002Fhost issue, recover via stop\u002Fstart or CloudWatch recover.\n   `InstanceStatus` impaired → OS\u002Fapplication issue, recover via\n   reboot or SSM access.\n3. **Instance-store warning.** If `RootDeviceType: instance-store` OR\n   any block device mapping has `Ebs: No`, stop\u002Fstart and recover\n   LOSE ephemeral data. BLOCK unless the operator acknowledges.\n4. **ASG membership.** If the instance is in an ASG, stop\u002Fstart may\n   trigger a health-check replacement. Suspend `HealthCheck` \u002F\n   `AlarmNotification` processes before stopping, or use the ASG's\n   managed replacement flow.\n5. **EBS attachment.** Capture all volume IDs and attachment state\n   before any recovery. If the instance is unreachable but EBS is\n   healthy, detach + attach to a recovery instance is the safest\n   data-salvage path.\n6. **Capacity Reservation binding.** If the instance has a Capacity\n   Reservation target, stop\u002Fstart may release the binding. Use\n   `describe-instance-attribute --attribute capacity-reservation-target`,\n   and explicitly re-target on start.\n7. **Placement group.** Stop\u002Fstart on a `cluster` placement group\n   instance may fail to restart if the group lacks capacity. Consider\n   reboot (same host) for placement-group recovery.\n8. **SSM agent reachability (for session access).** `describe-instance-\n   information` shows `PingStatus: Online` for SSM-managed instances.\n   Offline SSM means Session Manager will not work; fall back to EC2\n   Serial Console or console output.\n9. **CloudWatch recovery alarm.** If a recovery alarm is already\n   configured and the instance is in `running` after a recover action,\n   the alarm may have already fired — do NOT double-recover.\n\n**Cost\u002Ftime baselines (2026):**\n\n- Stop\u002Fstart: 2-5 minutes total (stop ~30s, start ~60s, boot varies).\n- Reboot: 1-3 minutes (stays on same host, faster than stop\u002Fstart).\n- CloudWatch EC2 recover action: 1-5 minutes from alarm breach to\n  recover (same-host reboot, preserves EBS and instance store).\n- ASG replacement: 3-10 minutes (launch + boot + health check + ELB).\n- EBS detach\u002Fattach: 30-60 seconds per volume (same AZ only).\n- AMI creation for forensic snapshot: 5-30 minutes depending on EBS\n  size (AMI + snapshots are async).\n\n## Mindset\n\n**One-line takeaway:** `Status: running` is a process claim, not a\nhealth claim. An instance is only \"recovered\" when both status checks\nreturn `ok` AND the application responds to its health check. Driven\nby three EC2 realities:\n\n- **Stop\u002Fstart is destructive for instance-store volumes.** Stop\n  releases the host; start lands on a different physical machine.\n  Any data on `instance-store` volumes is gone. EBS-backed volumes\n  persist. Many operators learn this only after the first recovery.\n- **ASG-managed instances have their own recovery loop.** When a\n  health check fails, the ASG marks the instance `Unhealthy` and\n  launches a replacement. Stopping manually without suspending\n  `HealthCheck` causes the ASG to terminate it. Always check ASG\n  membership before manual recovery.\n- **The CloudWatch EC2 recover action is a same-host reboot, NOT a\n  stop\u002Fstart.** It preserves the host, EBS, and instance-store data,\n  but only fixes hardware issues detectable by the status check.\n\n## Pre-flight: instance metadata gate\n\nRun before classification. Misclassifying these produces wrong plans.\n\n**Pagination:** `describe-instance-status` paginates at 1,000\ninstances per call; drain `--next-token` for fleet-wide audits. For a\nsingle instance, `--instance-ids \u003Cid>` returns one result.\n\n**Live-account pre-flight (skip if offline plan audit):** the 7 read-only commands\n(describe-instance-status ... get-console-output) are listed in [Diagnostic commands](references\u002Fdiagnostic-commands.md).\n\nMalformed-input protocol (VERDICT: ERROR + REMEDIATION): see [Error handling](references\u002Ferror-handling.md).\n\n| Instance attribute | Effect on operation |\n|---|---|\n| `State: terminated` | BLOCKED. Route to EBS-based recovery (launch from snapshot\u002FAMI). |\n| `State: shutting-down` | Wait. Poll every 30s until `stopped` or `terminated`. |\n| `SystemStatus: impaired` | Hardware\u002Fhost. Stop\u002Fstart relocates; recover reboots same host. |\n| `InstanceStatus: impaired` | OS\u002Fapp. Reboot or SSM session. Stop\u002Fstart rarely helps. |\n| `Events: instance-stop` (scheduled) | AWS will stop on scheduled date. Plan recovery before window. |\n| `Events: system-reboot` (scheduled) | AWS will reboot. Do NOT manually reboot. |\n| `RootDeviceType: instance-store` | Stop\u002Fstart LOSES root volume. BLOCK unless acknowledged. |\n| ASG `HealthStatus: Unhealthy` | ASG will terminate+replace. Suspend `HealthCheck` first. |\n| `CapacityReservationId` set | Stop may release binding. Re-target on start. |\n| `Placement.GroupName` set (cluster) | Stop\u002Fstart may fail restart. Prefer reboot. |\n| `Placement.Tenancy: host` | Stop releases dedicated host. Verify availability. |\n| Existing recovery alarm | Alarm may have fired. Check history; do NOT double-recover. |\n\n## Process — operation planning (apply in order)\n\n### Step 0: Expert knowledge - non-obvious EC2 recovery behaviors (condensed)\n\n- Stop\u002Fstart RELOCATES to a new host (loses instance-store data, releases Capacity Reservation\u002Fdedicated host). Reboot STAYS on the same host.\n- CloudWatch EC2 recover action = API-driven same-host reboot; only helps `StatusCheckFailed_System`.\n- ASG-managed replacement usually beats manual recovery; suspend `HealthCheck` if manual recovery is required.\n- EBS detach\u002Fattach to a rescue instance in the same AZ is the safest data-salvage path.\n- `create-image --no-reboot` for forensic snapshots of hung instances; `get-console-output` shows the LAST boot only.\n- Full deep dives (Serial Console, automatic recovery, placement groups, metric separation): [Advanced patterns](references\u002Fadvanced-patterns.md).\n\n### Step 1: Pre-check gate — BLOCKED if any check fails\n\nRun ALL pre-checks for the chosen operation. If ANY fails, the verdict\nis BLOCKED with the failed checks in PRE_CHECKS. Do NOT execute.\n\n**For ALL operations:**\n1. Instance exists and is NOT `terminated`.\n2. If `State: shutting-down`, BLOCK (wait for transition).\n3. Capture all EBS volume IDs (for rollback).\n4. Capture `RootDeviceType` (instance-store warning).\n5. Capture ASG membership (suspend processes if applicable).\n\n**For recover-instance (CloudWatch recover action):**\n6. `SystemStatus: impaired` (recover only helps hardware).\n7. No existing recovery alarm already firing (check alarm history).\n8. No scheduled `instance-stop` event pending (let AWS handle it).\n\n**For stop-start (relocate to new host):**\n6. `RootDeviceType: ebs` (instance-store loses data).\n7. No `instance-store` block devices (or operator acknowledged).\n8. ASG `HealthCheck` suspended (if applicable).\n9. Capacity Reservation target captured for re-binding.\n10. Placement group has free capacity for restart (cluster groups).\n\n**For reboot (same host):**\n6. No pending `system-reboot` scheduled event (let AWS handle it).\n7. Instance is `running` (reboot on `stopped` is a no-op).\n\n**For replace-via-asg:**\n6. Instance is in an ASG.\n7. ASG `HealthCheck` process is `Resumed` (not suspended).\n8. ASG `MinSize` >= 1 (so the replacement launches).\n9. ELB\u002Ftarget group health check configured (so the new instance\n   registers).\n\n**For detach-attach-ebs (data salvage):**\n6. Rescue instance exists in the same AZ.\n7. EBS volume is `in-use` (attached to the unhealthy instance).\n8. `DeleteOnTermination: false` for the volume (otherwise the source\n   instance's termination deletes it).\n9. Rescue instance has the volume slot free (no name conflict on the\n   device name).\n\n**For forensic-ami (snapshot before termination):**\n6. Instance is NOT `terminated` (AMI cannot capture a terminated\n   instance).\n7. EBS-backed root volume (instance-store root cannot be snapshotted).\n8. AMI name does not collide with an existing AMI.\n\n**For enable-recovery-alarm:**\n6. No existing recovery alarm on the same metric (avoid duplicate\n   actions).\n7. `InstanceType` supports the EC2 recover action (all current-gen\n   types; some previous-gen types do not).\n8. `InstanceStatus: ok` (do not set a recovery alarm during a known\n   OS issue — the alarm fires on `StatusCheckFailed_System` only,\n   but verify the operator understands this).\n\n**For diagnose-impaired (read-only, no BLOCKED gate):**\n6. Read the failure-mode table and console output to identify the\n   root cause.\n\n**Failure-mode table (use during diagnose-impaired):**\n\n| Symptom | Root cause | Fix |\n|---|---|---|\n| `SystemStatus: impaired`, `InstanceStatus: ok` | Host hardware degradation | Stop\u002Fstart OR CloudWatch recover |\n| `InstanceStatus: impaired`, `SystemStatus: ok` | OS \u002F filesystem \u002F kernel hang | Reboot; if unreachable, SSM or Serial Console |\n| Both `impaired` | Network \u002F VPC \u002F ENI reachability loss | Check route table, ENI; stop\u002Fstart if ENI re-attach needed |\n| `State: running`, no SSH, SSM `Online` | Security group \u002F IAM role issue | SSM Session Manager; verify SG ingress + SSM role |\n| `State: running`, no SSH, SSM `ConnectionLost` | SSM agent hung or OS network down | Reboot; if persistent, EBS detach\u002Fattach for repair |\n| Console: kernel panic | Kernel module or boot config | Stop\u002Fstart; if persistent, EBS detach\u002Fattach to revert module |\n| Console: `No space left on device` | Disk full | SSM session to clean up; or expand EBS volume |\n| Console: `Failed to mount root filesystem` | Corrupted root EBS | Detach root, attach to rescue, `fsck`, reattach |\n| ASG churn (rapid launch\u002Fterminate) | Launch config \u002F AMI \u002F health check | Diagnose via ASG activity; freeze ASG to stop churn |\n| `State: stopped` immediately after launch | User-data script failure | Check console output; fix user-data; restart |\n\n### Step 2: READY — emit operation plan\n\nIf all pre-checks pass, emit `VERDICT: READY` with the exact CLI\nsequence and the CONFIRM gate. The plan includes:\n\n- The exact AWS CLI command with all flags populated from the\n  instance metadata.\n- The expected duration (stop\u002Fstart 2-5 min; reboot 1-3 min; AMI\n  5-30 min depending on EBS size).\n- The expected side-effects (instance-store data lost on stop\u002Fstart;\n  Capacity Reservation binding released; ASG health-check paused).\n- The CONFIRM gate prompt.\n- The monitoring commands (poll `describe-instance-status`, check\n  application health endpoint).\n\n### Step 3: Execute behind CONFIRM gate\n\n- **MANDATORY CONFIRMATION GATE.** Before `stop-instances`,\n  `start-instances`, `reboot-instances`, `detach-volume`,\n  `attach-volume`, `create-image`, `terminate-instances`,\n  `cloudwatch put-metric-alarm`, `autoscaling suspend-processes` \u002F\n  `resume-processes`, emit: `CONFIRM: About to \u003Coperation> on\n  \u003Cinstance-id> in account \u003Caccount> region \u003Cregion>. This will\n  \u003Cconsequence>. Proceed? (yes\u002Fno)`. Do NOT execute until the\n  operator confirms.\n- Capture pre-state: `aws ec2 describe-instances --instance-ids \u003Cid>\n  --output json > \u002Ftmp\u002F\u003Cid>-pre-$(date +%s).json` AND `aws ec2\n  describe-volumes --filters Name=attachment.instance-id,Values=\u003Cid>\n  --output json > \u002Ftmp\u002F\u003Cid>-volumes-$(date +%s).json`.\n- For forensic-ami: ALWAYS run AMI creation BEFORE any stop\u002Fstart or\n  terminate. The AMI is the point-in-time snapshot.\n- For stop\u002Fstart: poll `describe-instance-status` every 30 seconds\n  until `State: running` and both status checks return `ok`.\n\n### Step 4: Post-verification — COMPLETED\n\nAfter the recovery finishes, run post-verification. ALL checks must\npass for `COMPLETED`.\n\n1. `describe-instance-status --instance-ids \u003Cid>` — confirm\n   `State: running`, `SystemStatus.Status: ok`,\n   `InstanceStatus.Status: ok`.\n2. No scheduled `Events` pending (or, if scheduled, surface them).\n3. For stop-start: confirm EBS volumes reattached and `DeleteOn-\n   Termination` preserved.\n4. For stop-start with Capacity Reservation: confirm binding re-\n   established (`describe-instances --query Reservations[0].Instances\n   [0].CapacityReservationId`).\n5. For ASG replacement: confirm the new instance is `InService` and\n   passes the ELB \u002F target group health check.\n6. For EBS detach\u002Fattach: confirm the volume is `in-use` on the\n   target instance at the expected device name.\n7. For forensic-ami: confirm the AMI is `available` and all snapshots\n   are `completed`.\n8. Application health: hit the instance's health-check endpoint or\n   CloudWatch metric; confirm the workload recovered.\n\nIf ANY verification fails, emit `VERDICT: ERROR` with the failure\ndetails — do not claim COMPLETED.\n\n## Output format (per operation)\n\nSee § STRICT output contract above. The block MUST appear exactly in\nthat shape at the end of the response.\n\n### Worked example — recover-instance (stop\u002Fstart)\n\n```text\nOPERATION: stop-start\nVERDICT: READY\nTARGET: i-0abcdef1234567890 (state: running, system-status: impaired,\n        instance-status: ok)\nPRE_CHECKS:\n  - [PASS] Instance exists, not terminated\n  - [PASS] SystemStatus impaired (host issue), InstanceStatus ok\n  - [PASS] RootDeviceType: ebs (no data loss on stop)\n  - [PASS] No instance-store block devices\n  - [PASS] ASG: not a member (no suspend needed)\n  - [PASS] Capacity Reservation: not bound\n  - [PASS] Placement: default (no cluster constraint)\nSTEPS:\n  1. CONFIRM: About to stop and start i-0abcdef1234567890 in account\n     111111111111 region us-east-1. This will RELOCATE to a new host\n     (clears hardware impairment), cause 2-5 min downtime, preserve\n     EBS. Proceed? (yes\u002Fno)\n  2. aws ec2 stop-instances --instance-ids i-0abcdef1234567890\n  3. Poll describe-instance-status every 30s until stopped\n  4. aws ec2 start-instances --instance-ids i-0abcdef1234567890\n  5. Poll describe-instance-status every 30s until running + ok\nPOST_VERIFY:\n  - (pending execution)\nNOTES:\n  - Stop\u002Fstart is correct for SystemStatus impaired. Reboot would\n    keep the instance on the same impaired host.\n  - Set up a CloudWatch recovery alarm for auto-recovery:\n    aws cloudwatch put-metric-alarm --alarm-name recover-i-0abcdef\n      --metric-name StatusCheckFailed_System --namespace AWS\u002FEC2\n      --dimensions Name=InstanceId,Value=i-0abcdef1234567890\n      --threshold 1 --comparison-operator GreaterThanOrEqualToThreshold\n      --period 60 --evaluation-periods 2\n      --alarm-actions arn:aws:automate:us-east-1:ec2:recover\n```\n\n## Anti-Patterns — NEVER\n\n- NEVER stop an instance with `RootDeviceType: instance-store`\n  without explicitly warning that the root volume and all instance-\n  store volumes will be LOST. Stop releases the host; no recovery\n  path for ephemeral data.\n\n- NEVER manually stop an ASG-managed instance without first\n  suspending `HealthCheck`. The ASG detects the stop, marks it\n  `Unhealthy`, and terminates it — destroying in-flight work.\n\n- NEVER use the EC2 recover action for `InstanceStatus: impaired`.\n  Recover only addresses `SystemStatus` (hardware). For OS issues,\n  recover does nothing and the alarm keeps firing.\n\n- NEVER reboot an instance with a pending `system-reboot` scheduled\n  event. The scheduled event runs automatically; a manual reboot\n  masks the hardware issue and prevents AWS from applying the fix.\n\n- NEVER create a forensic AMI AFTER stopping or terminating the\n  instance. AMI creation captures the running state. Stop clears\n  in-memory state; terminate destroys the instance. AMI FIRST.\n\n- NEVER detach the root volume of a running instance without\n  stopping it (use `--force` only if the instance is hung and stop\n  is not completing). Forced detach can corrupt the filesystem.\n\n- NEVER assume `State: running` means the application is healthy.\n  Verify the application's health check, not just EC2 status\n  checks. A hung process keeps the instance `running` while idle.\n\n- NEVER forget to re-bind the Capacity Reservation on start. Stop\n  releases the binding; start without `--capacity-reservation-\n  specification` loses the reservation.\n\n- NEVER rely on `get-console-output` for historical diagnosis after\n  a reboot. Each boot clears the prior log. Capture to a local\n  file BEFORE any recovery action.\n\n- NEVER use `create-image --no-reboot` for production AMIs. It\n  captures the filesystem in a potentially inconsistent state. Use\n  ONLY for forensic snapshots of hung instances.\n\n- NEVER double-recover. If a CloudWatch recovery alarm already fired,\n  check alarm history before triggering another recovery. Double-\n  recovery extends downtime without fixing anything.\n\n- NEVER terminate an instance to \"force recovery\" without first\n  detaching EBS volumes and capturing an AMI. Termination is\n  irreversible.\n\n- NEVER auto-execute a state-changing EC2 recovery CLI without the\n  CONFIRM gate. Stop, reboot, detach, terminate, and AMI creation\n  all extend downtime or destroy data.\n\n## Pre-flight safety checks (run before any remediation CLI)\n\n- **MANDATORY CONFIRMATION GATE.** Before any state-changing\n  operation, emit the CONFIRM prompt. Do NOT execute until the\n  operator confirms.\n\n- Full defense-in-depth checklist (pre-state capture commands, AMI-first, ASG suspension, Capacity Reservation re-targeting, placement-group capacity): [Advanced patterns](references\u002Fadvanced-patterns.md).\n## Expert heuristic: stop\u002Fstart vs. reboot\n\nThe single highest-leverage decision in EC2 recovery is:\n\n> **Stop\u002Fstart relocates the instance to a new physical host. Reboot\n> stays on the same host.** Match the operation to the impairment:\n> `SystemStatus: impaired` → stop\u002Fstart (host is bad). `InstanceStatus:\n> impaired` → reboot or SSM access (host is fine, OS is not). Never\n> use reboot for a hardware impairment — the instance stays on the\n> broken host and the impairment persists.\n\n**Why this matters:** Operators frequently confuse reboot with\nstop\u002Fstart. Both appear to \"restart\" the instance, but they have\nopposite effects on the physical host. A reboot on an impaired host\nextends the outage. A stop\u002Fstart on an OS issue adds 2-5 minutes of\ndowntime without fixing anything.\n\n**Decision matrix:**\n\n| Symptom | Operation | Why |\n|---|---|---|\n| `SystemStatus: impaired`, `InstanceStatus: ok` | Stop\u002Fstart OR CloudWatch recover | Host hardware bad |\n| `InstanceStatus: impaired`, `SystemStatus: ok` | Reboot OR SSM session | OS hung |\n| Both `impaired` | Diagnose first (console, ENI) | Could be network\u002FENI |\n| `State: running`, no SSH\u002FSSM | EBS detach\u002Fattach for filesystem repair | OS unreachable |\n| ASG-managed, health checks failing | ASG-managed replacement | ASG is the recovery loop |\n| Pending `system-reboot` event | Wait for AWS | Manual reboot masks the issue |\n| Pending `instance-stop` event | Stop\u002Fstart BEFORE the window | Proactively relocate |\n\n**Surface in the output:** for any recovery, include\n`HOST_CHANGE: \u003Cyes | no>` and `DATA_LOSS_RISK: \u003Cyes | no>`. If\n`DATA_LOSS_RISK: yes` and the operator has not acknowledged, BLOCK.\n\n**Verification protocol (apply on every recovery):**\n\n1. **Status check restoration:** `describe-instance-status` — both\n   `SystemStatus` and `InstanceStatus` return `ok`.\n2. **Application health:** hit the workload's health endpoint. EC2\n   status checks do not verify the application.\n3. **EBS integrity:** `describe-volumes` — all volumes `in-use`.\n4. **Capacity Reservation:** confirm the binding (if applicable).\n5. **Console output:** capture post-recovery console log.\n\n## References (load on demand)\n\n- [Worked examples](references\u002Fworked-examples.md) - detach-attach-ebs (COMPLETED) and diagnose-impaired (BLOCKED) walkthroughs\n- [Error handling](references\u002Ferror-handling.md) - malformed-input VERDICT: ERROR protocol\n- [Diagnostic commands](references\u002Fdiagnostic-commands.md) - live-account pre-flight command listing\n- [Advanced patterns](references\u002Fadvanced-patterns.md) - expert behaviors, defense-in-depth safety checklist, 2024-2026 features\n- [Status check deep dive](references\u002Fstatus-check-deep-dive.md) - System vs Instance status, stop\u002Fstart vs reboot attribute tables\n- [Recovery procedures](references\u002Frecovery-procedures.md) - per-archetype diagnostic and recovery procedures\n\n## Domain\n\nAWS CloudOps \u002F EC2 Instance Recovery, Compute Resilience, and\nForensic Preservation.\n\n## AWS documentation\n\n- **EC2 User Guide — Recover your instance** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fec2-instance-recover.html\n- **Status checks** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fmonitoring-system-instance-status-check.html\n- **CloudWatch recover action** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002FUsingAlarmActions.html\n- **EC2 Serial Console** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fec2-serial-console.html\n- **SSM Session Manager** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fsystems-manager\u002Flatest\u002Fuserguide\u002Fsession-manager.html\n- **ASG health checks** — https:\u002F\u002Fdocs.aws.amazon.com\u002Fautoscaling\u002Fec2\u002Fuserguide\u002Fhealthcheck.html\n- **EBS volumes** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Febs-attaching-volume.html\n- **Capacity Reservations** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fcapacity-reservations-using.html\n- **Placement groups** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FUserGuide\u002Fplacement-groups.html\n- **EC2 API Reference** — https:\u002F\u002Fdocs.aws.amazon.com\u002FAWSEC2\u002Flatest\u002FAPIReference\u002F\n",{"name":5,"license":15,"metadata":24,"description":7,"compatibility":42},{"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,"lifecycle_status":39,"invocation_schema":40,"supports_pipeline":37,"activation_triggers":41},"aws, ec2, compute, recovery, ebs, ssm, cloudwatch, autoscaling, forensics, operate","4","Jacky Chan — AWS Community Builder","aws-cloudops","Compute","0.1.0","EC2 instance recovery, system status check, instance status check, hardware degradation, stop\u002Fstart instance, EC2 recover action, CloudWatch alarm recovery, Auto Scaling group replacement, ASG health check, EBS detach attach, console output, get-console-output, SSM Session Manager, AMI forensic snapshot, placement group recovery, Capacity Reservation, instance store, ephemeral storage, impaired instance, EC2 automatic recovery","operate","high","false","capability","Recovering from an EC2 system status check failure (hardware degradation), configuring CloudWatch alarm recovery, replacing an instance via Auto Scaling group health check, detaching and reattaching EBS volumes to salvage data from an unhealthy instance, diagnosing OS-level issues via console output, accessing an impaired instance via SSM Session Manager, creating an AMI for forensic snapshot before termination, stop\u002Fstarting an instance to clear ephemeral issues, recovering an instance in a placement group, or preserving a Capacity Reservation binding during recovery.","true","READY | BLOCKED | COMPLETED","active","Input: either (a) an instance configuration (describe-instance-status, describe-instances) plus the intended operation (recover-instance, stop-start, reboot, replace-via-asg, detach-attach-ebs, forensic-ami, enable-recovery-alarm, diagnose-impaired), OR (b) an instance-id + operation for live-account execution. Output: deterministic OPERATION \u002F VERDICT \u002F PRE_CHECKS \u002F STEPS \u002F POST_VERIFY \u002F NOTES block per recovery, where VERDICT is one of READY, BLOCKED, COMPLETED.","instance status check failed, system status check failed, instance impaired, hardware degradation, EC2 recover, CloudWatch recovery alarm, instance stop start, reboot instance, ASG instance replacement, Auto Scaling health check, EBS detach attach, console output, Session Manager access, AMI forensic snapshot, placement group recovery, Capacity Reservation, instance unreachable, EC2 automatic recovery","Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline plan classification. Live-account operations use aws ec2 describe-instance-status, describe-instances, stop-instances, start-instances, reboot-instances, describe-volumes, detach-volume, attach-volume, get-console-output, create-image, describe-instance-attribute, aws ssm start-session, describe-instance-information, aws cloudwatch describe-alarms, put-metric-alarm, and...","main","eeace51bd5dd1db2030729d83eeab988861553aa","skills\u002Fec2-instance-recovery-operator",0,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills","https:\u002F\u002Fgithub.com\u002Fjhkchan","CTO & Co-Founder @Beever-AI  & @votee. CAISP. AWS Community Builder. Organizer@GDGCloudHK. MongoDB Champion. Technopreneur + Infornographer.","2026-09-24 08:54:10",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add jhkchan\u002Faws-agent-skills --skill ec2-instance-recovery-operator",{"tool":57,"command":58},"bunx","bunx skills add jhkchan\u002Faws-agent-skills --skill ec2-instance-recovery-operator",{"tool":60,"command":61},"pnpm","pnpm dlx skills add jhkchan\u002Faws-agent-skills --skill ec2-instance-recovery-operator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002FSKILL.md",true,[65,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"eval\u002Ftest-cases.yaml","REFERENCE","参考文档",7399,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Feval\u002Ftest-cases.yaml",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"evals\u002Fbaselines\u002Fasg-instance-store-blocked.md",508,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fbaselines\u002Fasg-instance-store-blocked.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"evals\u002Fbaselines\u002Fcloudwatch-recovery-alarm-stop-start-ready.md",637,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fbaselines\u002Fcloudwatch-recovery-alarm-stop-start-ready.md",{"path":80,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":81,"sourceHtmlUrl":82},"evals\u002Fbaselines\u002Fdiagnose-kernel-panic-blocked.md",578,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fbaselines\u002Fdiagnose-kernel-panic-blocked.md",{"path":84,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":85,"sourceHtmlUrl":86},"evals\u002Fbaselines\u002Febs-detach-attach-completed.md",494,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fbaselines\u002Febs-detach-attach-completed.md",{"path":88,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":89,"sourceHtmlUrl":90},"evals\u002Fbaselines\u002Fforensic-ami-before-recovery-ready.md",509,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fbaselines\u002Fforensic-ami-before-recovery-ready.md",{"path":92,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":93,"sourceHtmlUrl":94},"evals\u002Feval_config.yaml",1856,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Feval_config.yaml",{"path":96,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":97,"sourceHtmlUrl":98},"evals\u002Fevals.json",4291,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fevals.json",{"path":100,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":101,"sourceHtmlUrl":102},"evals\u002Fprompts\u002Fasg-instance-store-blocked.md",646,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fprompts\u002Fasg-instance-store-blocked.md",{"path":104,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":105,"sourceHtmlUrl":106},"evals\u002Fprompts\u002Fcloudwatch-recovery-alarm-stop-start-ready.md",958,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fprompts\u002Fcloudwatch-recovery-alarm-stop-start-ready.md",{"path":108,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":109,"sourceHtmlUrl":110},"evals\u002Fprompts\u002Fdiagnose-kernel-panic-blocked.md",714,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fprompts\u002Fdiagnose-kernel-panic-blocked.md",{"path":112,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":113,"sourceHtmlUrl":114},"evals\u002Fprompts\u002Febs-detach-attach-completed.md",1260,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fprompts\u002Febs-detach-attach-completed.md",{"path":116,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":117,"sourceHtmlUrl":118},"evals\u002Fprompts\u002Fforensic-ami-before-recovery-ready.md",742,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fevals\u002Fprompts\u002Fforensic-ami-before-recovery-ready.md",{"path":120,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":121,"sourceHtmlUrl":122},"examples\u002FREADME.md",7944,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fexamples\u002FREADME.md",{"path":124,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":125,"sourceHtmlUrl":126},"references\u002Fadvanced-patterns.md",7141,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Freferences\u002Fadvanced-patterns.md",{"path":128,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":129,"sourceHtmlUrl":130},"references\u002Fdiagnostic-commands.md",1389,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Freferences\u002Fdiagnostic-commands.md",{"path":132,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":133,"sourceHtmlUrl":134},"references\u002Ferror-handling.md",448,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Freferences\u002Ferror-handling.md",{"path":136,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":137,"sourceHtmlUrl":138},"references\u002Frecovery-procedures.md",12192,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Freferences\u002Frecovery-procedures.md",{"path":140,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":141,"sourceHtmlUrl":142},"references\u002Fstatus-check-deep-dive.md",6429,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Freferences\u002Fstatus-check-deep-dive.md",{"path":144,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":145,"sourceHtmlUrl":146},"references\u002Fworked-examples.md",2375,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Freferences\u002Fworked-examples.md",{"path":148,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":149,"sourceHtmlUrl":150},"skill.usf.yaml",4709,"https:\u002F\u002Fgithub.com\u002Fjhkchan\u002Faws-agent-skills\u002Fblob\u002Fmain\u002Fskills\u002Fec2-instance-recovery-operator\u002Fskill.usf.yaml",[152,159,166,173,180,187],{"skillNo":153,"name":154,"nameZh":6,"description":155,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":156,"categories":157,"keywords":158,"publishedAt":19},"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":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":19},"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":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":19},"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":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":179,"publishedAt":19},"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":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":19},"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":188,"name":189,"nameZh":6,"description":190,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":191,"categories":192,"keywords":193,"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",[],[]]