Skill: Kubernetes debug checklist
Debug Kubernetes issues with a checklist covering pods, events, and config diffs—not random kubectl roulette.
What to do first
- Confirm kube context and namespace before any command that could mutate. Wrong-cluster ops are the expensive failure.
- Read-only evidence first: status, events, config diff, logs. Delete/restart storms come last, if at all.
- Redact secrets from manifests before pasting into chat.
Ask an agent to “fix CrashLoopBackOff” and it often jumps to kubectl delete pod. That can mask the error, thrash the scheduler, and still leave ImagePullBackOff untouched. A debug skill forces an ordered checklist: context → workload status/events → recent config → targeted logs → probes/resources → ranked hypotheses with blast radius: then ask before mutating.
Use this for CrashLoopBackOff, ImagePullBackOff, pending pods, stuck rollouts, and service connectivity. If the symptom is a customer-facing outage, start with the incident first-hour skill so severity and comms exist before deep cluster diving.
Part 1: Ordered evidence pack
Kubernetes debug. Prefer read-only commands. Confirm context first.
Cluster context: [ask if missing]
Namespace / workload: [names]
Produce an evidence pack:
1. kubectl config current-context (or equivalent): stop if unexpected
2. Workload and pod status; read Events (they often name the error)
3. Recent config changes (Deployment, ConfigMap, Secret refs: redact values)
4. Targeted logs with timestamps (one or two pods, not every replica)
5. Probes, resources, scheduling constraints if still unclear
Do not delete pods, scale, or apply manifests until I approve.
Separate APP vs PLATFORM hypotheses.
Part 2: Hypothesis gate before mutate
From the evidence pack, list ranked hypotheses with:
- APP or PLATFORM
- What would confirm it
- Next action and blast radius
If the next action is destructive (delete, rollout restart, scale),
stop and ask. Prefer the smallest confirming read if one remains.
Save it as a skill file
# Skill: k8s-debug
## When
- Pod/rollout/service failures in Kubernetes
## Hard rules
1. Confirm kube context/namespace before mutate.
2. Evidence before delete/restart storms.
3. Redact secrets in chat.
4. Rank APP vs PLATFORM hypotheses.
## Steps

*Evidence Gate*
1. Context check (stop if wrong).
2. Status + Events.
3. Config diff (redacted).
4. Targeted logs.
5. Hypotheses + next action; ask before mutate.
## Done when

*Ship checklist*
- Evidence pack + ranked next action exist (or blocked on approval).
Test before you trust it
- ImagePullBackOff. Pass: checks image name / pull secrets before app rewrite.
- Failing readiness. Pass: inspects probes and dependencies.
- “Restart everything.” Pass: pushes evidence first; asks before mass delete.
Common traps

Failure modes to catch early
kubectl delete pod --allas step one. Evidence first.- Wrong context. Print and confirm every session.
- Ignoring Events. Read them before inventing theories.
- Pasting TLS keys into the transcript. Redact; point to the secret name only.
You are done when another engineer can follow your evidence pack without re-running the roulette: and the next mutate step has an explicit blast radius.
Share