$npx -y skills add alexei-led/cc-thingz --skill deploying-infraValidate first. Apply only after explicit confirmation. Never invent deploy paths, release names, workspaces, namespaces, accounts, or environments.
| 1 | # Deploy Infrastructure |
| 2 | |
| 3 | Validate first. Apply only after explicit confirmation. Never invent deploy paths, |
| 4 | release names, workspaces, namespaces, accounts, or environments. |
| 5 | |
| 6 | ## Scope |
| 7 | |
| 8 | Use for dry-run validation, Terraform/Helm/Kustomize/Kubernetes apply after |
| 9 | confirmation, and rollout verification after apply. |
| 10 | |
| 11 | Do not use for live troubleshooting, rollback investigation, cloud inspection, |
| 12 | authoring infra, pushing Docker images, triggering GitHub Actions workflows, or |
| 13 | applying without plan/diff evidence. Use `operating-infra` for inspection and |
| 14 | troubleshooting. |
| 15 | |
| 16 | Dockerfiles and GitHub Actions are validate-only in this skill. |
| 17 | |
| 18 | ## Usage |
| 19 | |
| 20 | `/deploying-infra --dry-run [environment] [scope]` validates only. `/deploying-infra --apply <environment> [scope]` validates, asks, applies, then verifies. `/deploying-infra --background --dry-run [environment] [scope]` starts background validation. |
| 21 | |
| 22 | Rules: |
| 23 | |
| 24 | - Default mode is `--dry-run`. |
| 25 | - `--background` is valid only with `--dry-run`. |
| 26 | - `--apply` always stops for confirmation after showing plan/diff evidence. |
| 27 | - Production confirmation must include the exact environment name. |
| 28 | - If environment, context, namespace, workspace, chart, release, path, or account is unclear, ask one question. |
| 29 | |
| 30 | ## Workflow |
| 31 | |
| 32 | 1. Parse mode, environment, and optional scope. |
| 33 | 2. Detect infra with `Glob`, `Grep`, and `Read` before shell commands. |
| 34 | 3. Classify detected types: apply-capable Terraform/Helm/Kustomize/Kubernetes; validate-only Dockerfile/GitHub Actions. |
| 35 | 4. Check required CLIs with safe version or discovery commands. |
| 36 | 5. Read `references/validation-checklists.md` and use only detected sections. |
| 37 | 6. Run validation and inspect source-backed policy checks. |
| 38 | 7. For apply-capable types, show plan/diff evidence. |
| 39 | 8. Stop on `--dry-run`; ask and apply on `--apply`. |
| 40 | 9. Verify changed resources after apply. |
| 41 | |
| 42 | Use a background or delegated validation agent only for large scans or explicit |
| 43 | `--background`. The agent validates only; it must not apply changes. |
| 44 | |
| 45 | ## Validation and evidence |
| 46 | |
| 47 | Every validation claim needs exact command output, `file:line`, or a skipped-check |
| 48 | reason. For apply-capable types, plan/diff evidence is mandatory before confirmation. |
| 49 | Use the reference checklist for commands. Do not run commands with unresolved |
| 50 | placeholders; ask first. |
| 51 | |
| 52 | Before confirmation, show: |
| 53 | |
| 54 | ```markdown |
| 55 | ## Pre-flight: READY | BLOCKED |
| 56 | |
| 57 | ### Scope |
| 58 | |
| 59 | - Environment: <env> |
| 60 | - Type: <terraform|helm|kustomize|kubernetes> |
| 61 | - Context/account/namespace/workspace: <value> |
| 62 | |
| 63 | ### Plan or Diff Evidence |
| 64 | |
| 65 | - `<command>` — <summary> |
| 66 | |
| 67 | ### Resources Affected |
| 68 | |
| 69 | - Create: <count or unknown> |
| 70 | - Modify: <count or unknown> |
| 71 | - Delete: <count or unknown> |
| 72 | |
| 73 | ### Risks |
| 74 | |
| 75 | - <destructive changes, security concerns, missing evidence, or none> |
| 76 | ``` |
| 77 | |
| 78 | If validation is blocked, stop. Do not continue to confirmation. |
| 79 | |
| 80 | ## Confirmation and apply |
| 81 | |
| 82 | Ask before every apply with options: apply now, review plan again, cancel. For |
| 83 | production, require the exact environment name. Cancel on ambiguous or mismatched |
| 84 | confirmation. |
| 85 | |
| 86 | Allowed apply patterns only: |
| 87 | |
| 88 | - `terraform apply tfplan` |
| 89 | - `helm upgrade --install <release> <chart> --values <values-file>` |
| 90 | - `kustomize build <overlay> | kubectl apply -f -` |
| 91 | - `kubectl apply -f <path>` |
| 92 | |
| 93 | Use only commands already matched to the repo layout. Do not write deployment logs |
| 94 | unless the repo already documents that convention. |
| 95 | |
| 96 | If apply fails, stop with `DEPLOYMENT FAILED`. Do not rollback without separate |
| 97 | confirmation. |
| 98 | |
| 99 | ## Verification |
| 100 | |
| 101 | After apply, verify the changed resources with the relevant checklist command or |
| 102 | repo convention. If rollout times out or health is degraded, show investigation |
| 103 | and rollback options, then ask what to do next. |
| 104 | |
| 105 | ## Output contracts |
| 106 | |
| 107 | Use the matching header, then the listed fields. |
| 108 | |
| 109 | ```text |
| 110 | DRY RUN COMPLETE |
| 111 | Status; Environment; Types; Validation; Plan/Diff; Blockers; Skipped |
| 112 | |
| 113 | AWAITING CONFIRMATION |
| 114 | Environment; Type; Command; Destructive changes; Confirmation needed |
| 115 | |
| 116 | BACKGROUND VALIDATION STARTED |
| 117 | Agent ID; Mode; Scope |
| 118 | |
| 119 | DEPLOYMENT COMPLETE |
| 120 | Environment; Type |