k8s-diff
Installation
SKILL.md
K8s Manifest Diff
Render manifests, diff against cluster or git, flag risks. Read-only.
1. Prerequisites
command -v kubectl-- REQUIRED. Abort immediately if missing.helm,kustomize-- optional, detected from input.kubectl kustomizeas fallback.- If
--contextin$ARGUMENTS, pass--context <value>to all kubectl calls. - Run
kubectl cluster-infoto test access. If unreachable, setCLUSTER_AVAILABLE=falseand continue (git-based diff still works). Printkubectl config current-contextif available. - Fail fast only if kubectl binary is missing.
2. Detection
Determine type from input path in $ARGUMENTS:
Chart.yamlin directory --> Helm (helm template).kustomization.yaml/kustomization.yml--> Kustomize (kubectl kustomize).- Plain
.yaml/.yml--> raw YAML (cat). Single file always uses raw mode.