kubernetes-skill — Claude Code skill: what it does, how to install
Prevents Kubernetes hallucinations when writing manifests, Helm charts, and Kustomize overlays. It diagnoses misconfigurations before deployment.
npx skills add LukasNiessen/kubernetes-skill --skill kubernetes-skill -a claude-codeWhat kubernetes-skill does
This skill guides AI coding assistants through a structured workflow for Kubernetes manifests, Helm templates, and Kustomize overlays. It captures the target environment first: cluster version, distribution like EKS or GKE, workload type, and admission policies. When these details are omitted, the agent must explicitly state its assumptions before generating YAML.
Instead of loading all reference docs at once, the skill pulls specific failure-mode files on demand. It targets six primary issues: insecure workload defaults, resource starvation, open network exposure, privilege sprawl, fragile rollout strategies, and API drift. Cloud-specific patterns for AWS, Azure, GCP, or OpenShift load only when matching platform signals are detected.
Every proposed fix includes a rollback path and explicit validation steps. The workflow requires schema verification with kubeconform and dry runs via kubectl diff or kubectl apply --dry-run=server. Direct production deployment without a reviewed diff is strictly forbidden by the skill contract.
What it helps with
- harden pod security contexts and eliminate PSS violations
- configure resource limits and PodDisruptionBudgets to stop starvation
- restrict network traffic with tailored NetworkPolicies
- catch deprecated APIs and schema mismatches using kubeconform
- generate cloud-specific manifests for EKS, AKS, GKE, or OpenShift
Example prompts for the agent
- Review this Deployment for insecure security contexts and missing resource limits on EKS 1.30
- Write a hardened Helm template for a StatefulSet with NetworkPolicy and PDB for production
- Audit these RBAC roles and manifests for API drift before upgrading to Kubernetes 1.31
How to install kubernetes-skill
1Skills CLI (Vercel)
npx skills add LukasNiessen/kubernetes-skill --skill kubernetes-skill -a claude-code2Manually: put the files in place
~/.claude/skills/kubernetes-skill/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/kubernetes-skill/
1Skills CLI (Vercel)
npx skills add LukasNiessen/kubernetes-skill --skill kubernetes-skill -a codex2Manually: put the files in place
.agents/skills/kubernetes-skill/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add LukasNiessen/kubernetes-skill --skill kubernetes-skill -a cursor2Manually: put the files in place
.cursor/skills/kubernetes-skill/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install LukasNiessen/kubernetes-skill kubernetes-skill2Manually: put the files in place
.github/skills/kubernetes-skill/SKILL.md1Skills CLI (Vercel)
npx skills add LukasNiessen/kubernetes-skill --skill kubernetes-skill -a gemini-cli2Platform CLI
gemini skills install https://github.com/LukasNiessen/kubernetes-skillManually: put the files in place
.devin/skills/kubernetes-skill/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add LukasNiessen/kubernetes-skill --skill kubernetes-skill -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about kubernetes-skill
How to install kubernetes-skill in Claude Code?
Run npx skills add LukasNiessen/kubernetes-skill --skill kubernetes-skill -a claude-code in your terminal.
What does kubernetes-skill do?
It forces the AI assistant to follow a step-by-step diagnostic workflow for Kubernetes manifests. The skill checks for security defaults, resource limits, RBAC permissions, and API compatibility.
How does the skill validate manifests before deployment?
It mandates schema validation with kubeconform, label and port consistency checks, and testing with kubectl apply --dry-run=server or kubectl diff.
Source text
SKILL.md · MIT
--- name: kubernetes-skill description: "Prevent Kubernetes hallucinations by diagnosing and fixing failure modes: insecure workload defaults, resource starvation, network exposure, privilege sprawl, fragile rollouts, and API drift. Use when generating, reviewing, refactoring, or migrating manifests, Helm charts, Kustomize overlays, cluster policies, and platform-specific Kubernetes work for EKS, GKE, AKS, OpenShift, GitOps controllers, or observability stacks." --- # KubeShark: Failure-Mode Workflow for Kubernetes Run this workflow top to bottom. ## 1) Capture execution context Record before writing manifests: - cluster version (e.g. 1.30, 1.31) and distribution (EKS, GKE, AKS, k3s, vanilla) - target namespace and environment criticality (dev/staging/prod) - workload type (Deployment, StatefulSet, Job, CronJob, DaemonSet) - deployment method (raw YAML, Helm, Kustomize, operator-managed) - policy enforcement (Pod Security Admission level, Kyverno, OPA/Gatekeeper) - cloud provider and CNI (affects networking, storage classes, load balancers) - platform controllers/add-ons (GitOps, observability, ingress, service mesh, autoscaling) If unknown, state assumptions explicitly. ## 2) Diagnose likely failure mode(s) Select one or more based on user intent and risk: - insecure workload defaults: missing security contexts, PSS violations, host access - resource starvation: missing requests/limits, no PDB, scheduling chaos - network exposure: flat networking, missing policies, wrong Service types, DNS issues - privilege sprawl: overly permissive RBAC, leaked secrets, excess ServiceAccount rights - fragile rollouts: misconfigured probes, mutable tags, unsafe update strategies - API drift: wrong apiVersion, deprecated APIs, schema violations, tool-specific errors ## 3) Load only the relevant reference file(s) Primary failure-mode references: - `references/insecure-workload-defaults.md` - `references/resource-starvation.md` - `references/network-exposure.md` - `references/privilege-sprawl.md` - `references/fragile-rollouts.md` - `references/api-drift.md` Supplemental references (only when needed): - `references/deployment-patterns.md` - `references/stateful-patterns.md` - `references/job-patterns.md` - `references/daemonset-operator-patterns.md` - `references/security-hardening.md` - `references/observability.md` - `references/multi-tenancy.md` - `references/storage-and-state.md` - `references/helm-patterns.md` - `references/kustomize-patterns.md` - `references/validation-and-policy.md` - `references/examples-good.md` - `references/examples-bad.md` - `references/do-dont-patterns.md` Conditional Reference Retrieval (CRR) references (load only when the signal is detected): - `references/conditional/eks-patterns.md` for EKS, AWS, IRSA, EKS Pod Identity, AWS Load Balancer Controller, EBS/EFS CSI, Karpenter - `references/conditional/gke-patterns.md` for GKE, Autopilot, Workload Identity Federation for GKE, Dataplane V2, GCE Ingress, Config Sync - `references/conditional/aks-patterns.md` for AKS, Microsoft Entra Workload ID, Azure CNI, AGIC, Azure Disk/File/Blob CSI - `references/conditional/openshift-patterns.md` for OpenShift, OKD, ROSA, ARO, Routes, SCCs, OLM, `oc` - `references/conditional/gitops-controllers.md` for Argo CD, ApplicationSet, Flux, GitOps reconciliation, sync waves - `references/conditional/observability-stacks.md` for Prometheus Operator, ServiceMonitor, PodMonitor, OpenTelemetry, Loki, Grafana Do not load multiple CRR files unless the task spans multiple detected platforms/tools. ## 4) Propose fix path with explicit risk controls For each fix, include: - why this addresses the failure mode - what could still go wrong at deploy time or runtime - guardrails (validation commands, policy checks, rollback path) ## 5) Generate implementation artifacts When applicable, output: - Kubernetes manifests (YAML with security contexts, resource limits, labels) - Helm values/templates or Kustomize overlays - NetworkPolicies, RBAC resources, PodDisruptionBudgets - Policy rules (Kyverno/OPA) and admission controls ## 6) Validate before finalize Always provide validation steps tailored to deployment method and risk tier: - `kubectl apply --dry-run=server` or `kubectl diff` - `kubeconform` for schema validation against target cluster version - cross-resource consistency check (label/selector/port alignment) - policy scan (PSS profile check, Kyverno/OPA audit) Never recommend direct production apply without reviewed diff and approval. ## 7) Output contract Return: - assumptions and cluster version floor - selected failure mode(s) - chosen remediation and tradeoffs - validation/test plan - rollback/recovery notes (rollout undo, revision history, data safety)
© LukasNiessen · MIT · LukasNiessen/kubernetes-skill