$npx -y skills add KnoxOps/open-devops-skills --skill resource-cleanerPhase 6 Delete - Zombie resource deletion execution. Orchestrates a 6-step deletion process: pre-flight re-evaluation -> verify backup-creator backups -> deletion execution -> deletion verification -> metadata update -> audit + cost report. Supports batch deletion (10 per batch,
| 1 | ## Input Parameters |
| 2 | |
| 3 | | Name | Type | Required | Description | |
| 4 | |------|------|----------|-------------| |
| 5 | | run_dir | string | Yes | Workspace root directory for file passing between steps | |
| 6 | | phase5_decision_file | string | Yes | Path to Phase 5 confirmation decision JSON (from zombie-decision-handler) | |
| 7 | | resource_ids | array | Yes | List of resource IDs to delete | |
| 8 | | batch_size_max | integer | No | Max resources per deletion batch | |
| 9 | | batch_interval_sec | integer | No | Interval between batches (seconds) | |
| 10 | | deletion_parallelism | integer | No | Max concurrent deletion operations per batch | |
| 11 | | enable_eip_dns_check | boolean | No | Enable DNS record check before elastic IP deletion | |
| 12 | | dry_run | boolean | No | Dry-run mode (validate logic but do not execute actual deletion) | |
| 13 | |
| 14 | ## Execution Flow |
| 15 | |
| 16 | ### Task Context |
| 17 | |
| 18 | Before starting execution, initialize `task_context.json`: |
| 19 | |
| 20 | ```json |
| 21 | { |
| 22 | "task_id": "<task_id from input>", |
| 23 | "current_step": 0, |
| 24 | "current_step_id": null, |
| 25 | "status": "running", |
| 26 | "steps": { |
| 27 | "load_phase5_decision": "pending", |
| 28 | "preflight_check_cooling_period": "pending", |
| 29 | "preflight_check_decision_status": "pending", |
| 30 | "preflight_check_resource_existence": "pending", |
| 31 | "preflight_check_isolation_state": "pending", |
| 32 | "preflight_check_no_new_traffic": "pending", |
| 33 | "preflight_check_dependencies": "pending", |
| 34 | "preflight_check_owner": "pending", |
| 35 | "preflight_aggregate_result": "pending", |
| 36 | "verify_backup_creator_output": "pending", |
| 37 | "build_dependency_graph": "pending", |
| 38 | "topological_sort_resources": "pending", |
| 39 | "create_batch_plan": "pending", |
| 40 | "execute_batch_deletions": "pending", |
| 41 | "verify_deletion_completion": "pending", |
| 42 | "check_orphaned_objects": "pending", |
| 43 | "check_billing_charges": "pending", |
| 44 | "update_cmdb": "pending", |
| 45 | "update_monitoring": "pending", |
| 46 | "collect_all_events": "pending", |
| 47 | "build_audit_trail": "pending", |
| 48 | "calculate_cost_savings": "pending", |
| 49 | "generate_batch_summary": "pending", |
| 50 | "merge_reports": "pending", |
| 51 | "generate_notifications": "pending" |
| 52 | }, |
| 53 | "updated_at": "<ISO timestamp>" |
| 54 | } |
| 55 | ``` |
| 56 | |
| 57 | Update this file after each step completes. On error, set step status to `"failed"` and overall `status` to `"failed"`. |
| 58 | |
| 59 | ### Step 1: load_phase5_decision |
| 60 | |
| 61 | **Type:** inline |
| 62 | **Description:** Load Phase 5 confirmation decision and validate format |
| 63 | |
| 64 | ## Execution |
| 65 | Follow these instructions: |
| 66 | |
| 67 | Read the Phase 5 confirmation decision from {run_dir}/{phase5_decision_file}. |
| 68 | |
| 69 | Validate that it is valid JSON and contains: |
| 70 | - Top level: decision_id, decision_timestamp, total_resources, resources (non-empty array) |
| 71 | - Per resource: resource_id, observation_result, resource_type, entity_type |
| 72 | - Per resource: environment, cloud_provider, resource_metadata, estimated_monthly_cost |
| 73 | |
| 74 | Note: observation_result is the authoritative gating field -- resources with |
| 75 | observation_result="passed" have completed the isolation observation period |
| 76 | and are safe to delete. |
| 77 | |
| 78 | Output to {run_dir}/delete/phase5_decision_loaded.json |
| 79 | |
| 80 | |
| 81 | ### Progress Tracking |
| 82 | |
| 83 | After completing this step, update `task_context.json`: |
| 84 | - Set `current_step_id` to `"load_phase5_decision"` |
| 85 | - Set `steps.load_phase5_decision` to `"completed"` |
| 86 | ### Step 2: preflight_check_cooling_period |
| 87 | |
| 88 | **Type:** inline |
| 89 | **Description:** Verify observation period has completed (isolation observation IS the cooling period) |
| 90 | |
| 91 | ## Input Files |
| 92 | - `delete/phase5_decision_loaded.json` (from Step load_phase5_decision, schema: schemas/phase5_confirmation.schema.json) |
| 93 | |
| 94 | ## Execution |
| 95 | Follow these instructions: |
| 96 | |
| 97 | Read {run_dir}/delete/phase5_decision_loaded.json to get resource IDs. |
| 98 | |
| 99 | The isolation observation period from Phase 2 serves as the cooling period. |
| 100 | Each resource must have passed observation before deletion can proceed. |
| 101 | |
| 102 | For each resource in {resource_ids}: |
| 103 | - Verify observation_result is "passed" in the phase5 decision. |
| 104 | - If observation_result is "failed" or "uncertain": output BLOCKED reason. |
| 105 | - If observation_result is "passed": output passed status. |
| 106 | |
| 107 | Note: There is no separate cooling_period_tracker.json in the new flow. |
| 108 | The Phase 2 isolation observation IS the cooling period. Resources that |
| 109 | passed observation are safe to delete. |
| 110 | |
| 111 | Output to {run_dir}/delete/preflight_cooling_period.json |
| 112 | |
| 113 | |
| 114 | ### Progress Tracking |
| 115 | |
| 116 | After completing this step, update `task_context.json`: |
| 117 | - Set `current_step_id` to `"preflight_check_cooling_period"` |
| 118 | - Set `steps.pre |