$npx -y skills add KnoxOps/open-devops-skills --skill backup-creatorPhase 6 Delete: Create differentiated backups per resource type before deletion. This runbook implements the forced backup strategy from phase-6-delete.md section 4: - Pre-backup validation (resource exists, isolation intact, cloud API accessible) - Backup strategy dispatch (10+
| 1 | ## Input Parameters |
| 2 | |
| 3 | | Name | Type | Required | Description | |
| 4 | |------|------|----------|-------------| |
| 5 | | run_dir | string | Yes | Working directory absolute path for input/output files | |
| 6 | | decision_id | string | Yes | Phase 5 confirmation decision ID (e.g., confirm-20260605-001) | |
| 7 | | phase5_decision_file | string | Yes | Path to Phase 5 decision file (confirm/phase5_decision.json from zombie-decision-handler), containing resources array with resource_id, entity_type, environment, cloud_provider, resource_metadata | |
| 8 | | ssh_key_path | string | No | SSH key path for cloud API calls and remote execution | |
| 9 | | task_id | string | Yes | Task ID for progress tracking in backup_episodes.json | |
| 10 | | max_concurrent_backups | integer | No | Maximum concurrent backup operations (avoid cloud API throttling) | |
| 11 | | backup_retention_days_override | integer | No | Override default retention days (prod:30, staging:14, dev:7) | |
| 12 | |
| 13 | ## Execution Flow |
| 14 | |
| 15 | ### Task Context |
| 16 | |
| 17 | Before starting execution, initialize `task_context.json`: |
| 18 | |
| 19 | ```json |
| 20 | { |
| 21 | "task_id": "<task_id from input>", |
| 22 | "current_step": 0, |
| 23 | "current_step_id": null, |
| 24 | "status": "running", |
| 25 | "steps": { |
| 26 | "validate_input": "pending", |
| 27 | "pre_backup_validation": "pending", |
| 28 | "select_backup_strategy": "pending", |
| 29 | "backup_creation_batch": "pending", |
| 30 | "backup_verification": "pending", |
| 31 | "backup_protection": "pending", |
| 32 | "generate_reports": "pending", |
| 33 | "handle_escalations": "pending", |
| 34 | "finalize": "pending" |
| 35 | }, |
| 36 | "updated_at": "<ISO timestamp>" |
| 37 | } |
| 38 | ``` |
| 39 | |
| 40 | Update this file after each step completes. On error, set step status to `"failed"` and overall `status` to `"failed"`. |
| 41 | |
| 42 | ### Step 1: validate_input |
| 43 | |
| 44 | **Type:** inline |
| 45 | **Description:** Validate input parameters and read resource list |
| 46 | |
| 47 | ## Execution |
| 48 | Follow these instructions: |
| 49 | |
| 50 | Your task is to validate input parameters and read the list of resources to be backed up. |
| 51 | |
| 52 | **Steps**: |
| 53 | 1. Verify that the run_dir directory exists and is writable |
| 54 | 2. Verify that {run_dir}/{phase5_decision_file} file exists |
| 55 | 3. Read phase5_decision_file, extract the resources array (written by decision-handler's write-phase5-decision step), verify each element contains: |
| 56 | - resource_id (required) |
| 57 | - resource_type (required): CloudVM/CloudRDS/CloudCache/K8sWorkload/... (resource_type defined in isolation plan) |
| 58 | - entity_type (required): VM/Database/Cache/K8s/ElasticIP/LoadBalancer/... (cloud provider entity type) |
| 59 | - environment (required): dev/staging/prod |
| 60 | - cloud_provider (required): aws/aliyun/k8s |
| 61 | - resource_metadata (required): JSON object with provider-specific fields |
| 62 | 4. Read decision_id from phase5_decision_file (auto-uses the ID assigned by decision-handler) |
| 63 | 5. Count resources, group by entity_type |
| 64 | 6. Write to {run_dir}/delete/backup_validation_start.json |
| 65 | 7. If validation fails, return error status; if passed, continue |
| 66 | |
| 67 | |
| 68 | Write the output to the specified output file. |
| 69 | |
| 70 | ## Output |
| 71 | - **Schema:** schemas/backup_validation_start.schema.json |
| 72 | - **File:** delete/backup_validation_start.json |
| 73 | |
| 74 | ### Progress Tracking |
| 75 | |
| 76 | After completing this step, update `task_context.json`: |
| 77 | - Set `current_step_id` to `"validate_input"` |
| 78 | - Set `steps.validate_input` to `"completed"` |
| 79 | ### Step 2: pre_backup_validation |
| 80 | |
| 81 | **Type:** agent |
| 82 | **Description:** Phase 1: Validate each resource before backup attempt (existence, isolation state, API accessibility, storage quota) |
| 83 | |
| 84 | ## Input Files |
| 85 | - `delete/backup_validation_start.json` (from Step validate_input, schema: schemas/backup_validation_start.schema.json) |
| 86 | |
| 87 | ## Execution |
| 88 | Launch an independent agent with the following prompt file: |
| 89 | |
| 90 | **Prompt file:** `$PLUGINS/ico/skills/backup-creator/prompts/01_pre_backup_validation.md` |
| 91 | **Agent workflow:** |
| 92 | |
| 93 | 1. Read input data from: |
| 94 | - Schema: `schemas/backup_validation_start.schema.json` |
| 95 | |
| 96 | 2. Execute the agent with the prompt |
| 97 | |
| 98 | 3. Write results to: |
| 99 | - File: `delete/pre_backup_validation.json` |
| 100 | |
| 101 | ## Output |
| 102 | - **Schema:** schemas/pre_backup_validation.schema.json |
| 103 | - **File:** delete/pre_backup_validation.json |
| 104 | |
| 105 | ### Progress Tracking |
| 106 | |
| 107 | After completing this step, update `task_context.json`: |
| 108 | - Set `current_step_id` to `"pre_backup_validation"` |
| 109 | - Set `steps.pre_backup_validation` to `"completed"` |
| 110 | ### Step 3: select_backup_strategy |
| 111 | |
| 112 | **Type:** agent |
| 113 | **Description:** Phase 2: Select backup method per resource type and environment |
| 114 | |
| 115 | ## Input Files |
| 116 | - `delete/pre_backup_validation.json` |