Kubernetes Operator
This skill helps you build Kubernetes Operators correctly by catching reconcile-loop bugs before they reach a cluster. It provides three Python tools to validate CRD designs, lint reconcile functions, and audit OperatorHub capability levels, plus references and a slash command for auditing.
✨ What it does
- Validates CRD YAML for status subresource, scope, versioning, and schema completeness
- Lints Go reconcile functions for anti-patterns like blocking calls, spec mutation, and missing finalizers
- Scores operators against OperatorHub's 5 Capability Levels and suggests next steps
- Provides references on operator pattern, CRD design, reconcile patterns, and tooling landscape
- Includes a /operator-audit slash command to run all tools and produce a report
🎯 When to use it
- Building a new Kubernetes Operator (controller for a CRD)
- Reviewing an existing operator for capability-level gaps
- Auditing a CRD spec for status/conditions/finalizer correctness
- Choosing a framework (controller-runtime / kubebuilder / operator-sdk / metacontroller / KOPF)
- Designing the API surface of a Custom Resource
🚀 How to use
Trigger: /operator-audit
Trigger by asking to build or audit a Kubernetes Operator, or use the /operator-audit slash command. Provide paths to CRD YAML files, controller Go files, or an operator directory. Example prompts:
Validate my CRD at config/crd/myapp.yaml
Lint my reconcile function at controllers/myapp_controller.go
Audit my operator directory for capability level
📄 Output: Validation reports, lint findings, capability audit report, or a markdown audit report from the slash command.
📦 Add this skill to Claude Code
# 1. Get the skills repo
git clone --depth 1 https://github.com/alirezarezvani/claude-skills /tmp/claude-skills
# 2. Copy this skill into your project (or ~/.claude/skills for all projects)
mkdir -p .claude/skills
cp -r /tmp/claude-skills/engineering/skills/kubernetes-operator .claude/skills/kubernetes-operatorSkill source: engineering/skills/kubernetes-operator/SKILL.md
⚠️ Good to know
The lint tool uses regex-based heuristics and may not catch all issues; it is not a substitute for thorough code review.
❓ FAQ
What does the crd_validator.py check?
It checks that the status subresource is set, scope is Namespaced, versions are properly served and stored, conditions are in the schema, and printer columns include Age and Status/Phase.
What is the core principle of an operator?
An operator is a reconcile loop that observes actual state, reads desired state from spec, diffs, acts, and updates status, then requeues or finishes. It should be declarative and idempotent.
How do I choose a framework?
The skill provides a table comparing frameworks by language and best use. For a Go shop, use kubebuilder; for Python, use KOPF; for polyglot, use metacontroller; for OpenShift, use operator-sdk.
🤖 Overview, features, install steps and FAQ were generated from the project's SKILL.md on Sep 4, 2026. Always check the original source before running commands.