skills/k8s-diff/SKILL.md
Render Kubernetes manifests (Helm, Kustomize, raw YAML) and diff against a live cluster or previous render, flagging risky changes. Use when the user says "k8s diff", "manifest diff", "helm diff", "kustomize diff", "what changed in k8s", "compare manifests", "show k8s changes", "what will deploy", "dry run deploy", "preview deploy", "cluster drift", or wants to see Kubernetes resource changes before applying.
npx skillsauth add indrasvat/claude-code-skills k8s-diffInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Render manifests, diff against cluster or git, flag risks. Read-only.
command -v kubectl -- REQUIRED. Abort immediately if missing.helm, kustomize -- optional, detected from input. kubectl kustomize as fallback.--context in $ARGUMENTS, pass --context <value> to all kubectl calls.kubectl cluster-info to test access. If unreachable, set CLUSTER_AVAILABLE=false
and continue (git-based diff still works). Print kubectl config current-context if available.Determine type from input path in $ARGUMENTS:
Chart.yaml in directory --> Helm (helm template).kustomization.yaml/kustomization.yml --> Kustomize (kubectl kustomize)..yaml/.yml --> raw YAML (cat). Single file always uses raw mode.Render to temp file (mktemp, cleaned up via trap on exit):
helm template <release> <chart-path> [--values values.yaml] > "$RENDERED"kubectl kustomize <dir> > "$RENDERED"cat <files> > "$RENDERED"
Split into individual resources keyed by apiVersion/kind/namespace/name.Live cluster diff (when --context present or cluster reachable):
Fetch live version per resource: kubectl get <kind> <name> -n <ns> -o yaml. Strip .metadata.managedFields and kubectl.kubernetes.io/last-applied-configuration annotation. Compare with diff -u.
Git diff (no cluster target):
Render the same manifests at git merge-base HEAD main. Diff with diff -u.
Scan each diff hunk:
| Level | Patterns |
|-------|----------|
| CRITICAL | Namespace deletion, PV/PVC removal, RBAC escalation (new ClusterRoleBinding, added verbs) |
| HIGH | Resource limits reduced >50%, replicas to 0, image tag to latest |
| MEDIUM | New CRD apiVersion, Service port change, ConfigMap key removal |
| LOW | Label/annotation changes, resource request adjustments |
Before display, scan for keys matching password, secret, token, key, credential (case-insensitive). Replace values with [REDACTED] in both rendered and live YAML.
Match by apiVersion/kind/namespace/name. Use - as namespace for cluster-scoped resources.
Print in order:
N added, M modified, K removed| Resource | Risk | Detail |
|----------|------|--------|
| apps/v1/Deployment/prod/api | CRITICAL | replicas: 3 -> 0 |
Strictly read-only. Temp files only, cleaned on exit. Never applies, patches, or deletes resources.
$ARGUMENTS
development
Fetch, categorize, and address PR review comments in priority order. Classifies each comment as BLOCKER, QUESTION, SUGGESTION, or NITPICK and works through blockers first. Use when the user says "address PR comments", "fix review feedback", "respond to PR", "handle review comments", "triage PR", "what does the reviewer want", "address feedback", "PR comments", "review feedback", or needs to work through pull request review comments systematically.
testing
Create a pull request with a standards compliance review gate. Reviews the diff against CLAUDE.md and repo conventions before creating the PR, stopping on discrepancies. Supports tiered PR templates (small, standard, complex). Use when the user says "create PR", "open PR", "ship it", "ship PR", "make a pull request", "push and PR", "ready for review", "send for review", "create a pull request", or wants to create a GitHub pull request from the current branch.
testing
Verify Kubernetes deployment health — pod status, rollout progress, events, readiness, HPA state, and recent errors. Use when the user says "check rollout", "is deploy healthy", "rollout status", "deployment health", "pod status", "check pods", "why is deploy failing", "k8s health", "verify deployment", "are pods ready", "check deployment", or wants to verify a Kubernetes deployment is healthy after a rollout.
documentation
Generate comprehensive Product Requirements Documents with interactive discovery, progress tracking, and True Ralph Loop support for autonomous implementation. Use when user wants to (1) create a PRD for a new project/feature, (2) implement a PRD autonomously with fresh Claude sessions, (3) track implementation progress, (4) recover context after session loss. Creates docs/PRD.md and docs/PROGRESS.md.