$npx -y skills add KnoxOps/open-devops-skills --skill orchestratorCloud infrastructure cost optimization lifecycle -- identifies idle and underutilized resources, orchestrates safe isolation and observation, and manages the approve-decommission workflow to reduce cloud spend. Trigger phrases: "cost optimization", "infra cost", "zombie resources
| 1 | ## Input Parameters |
| 2 | |
| 3 | | Name | Type | Required | Description | |
| 4 | |------|------|----------|-------------| |
| 5 | | run_dir | string | Yes | Workspace root directory | |
| 6 | | ssh_key_path | string | No | SSH key path for cloud API calls | |
| 7 | | task_id | string | Yes | Task ID for progress tracking | |
| 8 | |
| 9 | ## Execution Flow |
| 10 | |
| 11 | ### Task Context |
| 12 | |
| 13 | Before starting execution, initialize `task_context.json`: |
| 14 | |
| 15 | ```json |
| 16 | { |
| 17 | "task_id": "<task_id from input>", |
| 18 | "current_step": 0, |
| 19 | "current_step_id": null, |
| 20 | "status": "running", |
| 21 | "steps": { |
| 22 | "confirm_scope": "pending", |
| 23 | "confirm_connection": "pending", |
| 24 | "confirm_monitoring": "pending", |
| 25 | "generate_intent": "pending", |
| 26 | "generate_plan": "pending", |
| 27 | "collect_metrics": "pending", |
| 28 | "screen_resources": "pending", |
| 29 | "review_gate": "pending", |
| 30 | "deep_scan": "pending", |
| 31 | "phase_e_report": "pending", |
| 32 | "phase_e_select": "pending", |
| 33 | "phase_f_isolation": "pending", |
| 34 | "isolation_review_gate": "pending", |
| 35 | "execute_isolation": "pending", |
| 36 | "decision": "pending", |
| 37 | "phase_j_delete_review": "pending", |
| 38 | "final_report": "pending" |
| 39 | }, |
| 40 | "updated_at": "<ISO timestamp>" |
| 41 | } |
| 42 | ``` |
| 43 | |
| 44 | Update this file after each step completes. On error, set step status to `"failed"` and overall `status` to `"failed"`. |
| 45 | |
| 46 | ### Step 1: confirm_scope |
| 47 | |
| 48 | **Type:** inline |
| 49 | **Description:** Confirm scan scope with user |
| 50 | |
| 51 | ## Execution |
| 52 | Follow these instructions: |
| 53 | |
| 54 | Ask the user what to scan. One question at a time. |
| 55 | 1. What environment? (prod/staging/dev/all) |
| 56 | 2. Any resource types to include or exclude? |
| 57 | Prefer multiple choice. Skip if user already specified. |
| 58 | |
| 59 | |
| 60 | ### Progress Tracking |
| 61 | |
| 62 | After completing this step, update `task_context.json`: |
| 63 | - Set `current_step_id` to `"confirm_scope"` |
| 64 | - Set `steps.confirm_scope` to `"completed"` |
| 65 | ### Step 2: confirm_connection |
| 66 | |
| 67 | **Type:** inline |
| 68 | **Description:** Collect concrete connection details |
| 69 | |
| 70 | ## Execution |
| 71 | Follow the instructions in the prompt file `$PLUGINS/ico/skills/orchestrator/prompts/confirm-connection.prompt.md`. |
| 72 | |
| 73 | Write the output to the specified output file. |
| 74 | |
| 75 | ## Output |
| 76 | - **Schema:** schemas/connection-config.schema.json |
| 77 | - **File:** connection_config.json |
| 78 | |
| 79 | ### Progress Tracking |
| 80 | |
| 81 | After completing this step, update `task_context.json`: |
| 82 | - Set `current_step_id` to `"confirm_connection"` |
| 83 | - Set `steps.confirm_connection` to `"completed"` |
| 84 | ### Step 3: confirm_monitoring |
| 85 | |
| 86 | **Type:** inline |
| 87 | **Description:** Confirm monitoring and CI/CD data sources |
| 88 | |
| 89 | ## Execution |
| 90 | Follow these instructions: |
| 91 | |
| 92 | Ask two questions: |
| 93 | |
| 94 | 1. "Do you have a monitoring system for historical metrics?" |
| 95 | Options: Prometheus, Datadog, CloudWatch, Azure Monitor, GCP Monitoring, or none. |
| 96 | If none — warn that only real-time snapshots will be used. |
| 97 | |
| 98 | 2. "Do you use a CI/CD or GitOps tool for deployments?" |
| 99 | Options: ArgoCD, FluxCD, Jenkins, GitLab CI, GitHub Actions, other, or none. |
| 100 | If they name one, ask how to access it (URL, token, namespace). |
| 101 | |
| 102 | Record both in {run_dir}/connection_config.json under `monitoring` and `cicd`. |
| 103 | |
| 104 | |
| 105 | ### Progress Tracking |
| 106 | |
| 107 | After completing this step, update `task_context.json`: |
| 108 | - Set `current_step_id` to `"confirm_monitoring"` |
| 109 | - Set `steps.confirm_monitoring` to `"completed"` |
| 110 | ### Step 4: generate_intent |
| 111 | |
| 112 | **Type:** inline |
| 113 | **Description:** Generate intent_detection.json from user input |
| 114 | |
| 115 | ## Execution |
| 116 | Follow these instructions: |
| 117 | |
| 118 | Write {run_dir}/intent_detection.json: |
| 119 | - entity_types: list of resource types to scan |
| 120 | - scope: {account, region, tag_filters} |
| 121 | - exclusions: list of excluded resource_ids or tags |
| 122 | |
| 123 | |
| 124 | Write the output to the specified output file. |
| 125 | |
| 126 | ## Output |
| 127 | - **Schema:** schemas/intent-detection.schema.json |
| 128 | - **File:** intent_detection.json |
| 129 | |
| 130 | ### Progress Tracking |
| 131 | |
| 132 | After completing this step, update `task_context.json`: |
| 133 | - Set `current_step_id` to `"generate_intent"` |
| 134 | - Set `steps.generate_intent` to `"completed"` |
| 135 | ### Step 5: generate_plan |
| 136 | |
| 137 | **Type:** inline |
| 138 | **Description:** Dispatch Plan Agent with the orchestration template, present plan, wait for confirmation |
| 139 | |
| 140 | ## Execution |
| 141 | Follow these instructions: |
| 142 | |
| 143 | 1. Read the orchestration plan template: `$PLUGINS/ico/skills/orchestrator/prompts/orchestration-plan.agent.md` |
| 144 | 2. Fill in any placeholders with info from intent_detection.json and user discussion |
| 145 | 3. Use the Agent tool (subagent_type=general-purpose) with the filled template to produce an execution plan |
| 146 | 4. Save the plan output verbatim to {run_dir}/execution_plan.md |
| 147 | 5. Present the plan to user using the Write tool as markdown. Show: phase overview table, estimated duration, review checkpoints |
| 148 | 6. WAIT for user confirmation before proceeding to execution. |
| 149 | |
| 150 | |
| 151 | ### Progress Tracking |
| 152 | |
| 153 | After completi |