/engineering-advanced-skills:kubernetes-operatorfrom engineering-advanced-skills
Designs, builds, and audits Kubernetes operators: CRD design, reconciliation loops, framework selection (controller-runtime, Kubebuilder, operator-SDK), and anti-pattern detection.
Ships in engineering-advanced-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
End-to-end Kubernetes operator design and construction. Covers the operator pattern (control loops for stateful workloads), CRD design (schema, validation, conversion, status), the reconciliation loop (idempotency, convergence, level- vs edge-triggered), framework selection (controller-runtime / Kubebuilder / operator-SDK / metacontroller), and operational concerns (finalizers, leader election, RBAC scoping, status subresource, observability). Targets Go-based operators (the dominant ecosystem) with notes on alternatives (KOPF, JOSDK, kube-rs).
| Situation | Skill applies |
|---|---|
| Building a new operator for an internal platform primitive | Yes — start with the operator pattern decision |
| Auditing an existing operator for production-readiness | Yes — use anti-patterns + scripts/reconciliation_audit.py |
| Designing CRDs for a custom resource | Yes — use CRD design + scripts/crd_validator.py |
| Deciding "operator vs Helm chart vs plain manifests" | Yes — use the decision matrix |
| Scaffolding a new operator project | Yes — scripts/operator_scaffold.py |
| Debugging a controller that "isn't reconciling" | Yes — use reconciliation troubleshooting |
| Just running someone else's operator (Postgres, Kafka, etc.) | Partially — useful for understanding what it does and how to monitor it |
Before scaffolding or auditing, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
operator_scaffold.py vs crd_validator.py vs reconciliation_audit.py).--name/--group/--kind); for validation/audit: the CRD YAML or controller path (the input the scripts read).Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
crd_validator.py.operator_scaffold.py, then go mod tidy (resolves current controller-runtime and k8s.io versions) and make generate manifests build (controller-gen writes DeepCopy methods, CRDs and RBAC). Kubebuilder (kubebuilder init / create api) is the fuller alternative when you want its project layout, webhooks and test harness.observedGeneration and conditions in status.reconciliation_audit.py against the controller source and CRDs; fix every critical finding.python3 scripts/crd_validator.py --schema assets/sample_crd_weak.yaml # no status subresource, untyped spec (exit 1)
python3 scripts/reconciliation_audit.py --controller-path assets --crd assets/sample_crd_weak.yaml # missing finalizer/ownerRef, wildcard RBAC ... (exit 1)
python3 scripts/operator_scaffold.py --name db-operator --group example.com --kind Database --out "$(mktemp -d)/db-operator"
Then, in the scaffolded project:
go mod tidy && make generate manifests build
python3 <skill>/scripts/reconciliation_audit.py --controller-path . --crd config/crd/bases/*.yaml # 0 findings (exit 0)
| Tool | What it does | Key flags | Exit codes |
|---|---|---|---|
crd_validator.py | CRD design checks: status subresource, structural schema (root or spec preserve-unknown-fields), descriptions, enums, printer columns, observedGeneration/conditions, storage versions and conversion, cluster scope, categories, shortNames | --schema <files/globs>, --severity, `--format markdown | json` |
operator_scaffold.py | controller-runtime skeleton: go.mod (versions resolved by go mod tidy), Makefile with controller-gen targets, main.go with leader election flag, health and metrics, typed API, reconciler with finalizer and status handling, Dockerfile, Deployment, README | --name, --group, --kind, --scope, --out, --go-module, --namespace, --categories | 0, 2 output directory not empty |
reconciliation_audit.py | Static checks on Go controllers and CRDs: creates without finalizer, no owner reference, tight error requeue, status/spec mixing, hard-coded namespace, wildcard RBAC, no observedGeneration, manager without leader election | --controller-path, --crd, --severity, --format | 0 no critical, 1 critical finding, 2 bad path |
The scaffold targets Go 1.27 (go.mod and the Dockerfile's GO_VERSION agree; keep them in step). To confirm it builds in your environment, run go mod tidy && make generate manifests build in the generated project: it must finish without errors and write bin/manager and config/crd/bases/*.yaml. It is a starting skeleton, not a finished operator. The audit is pattern-based: it cannot see dynamic dispatch or code generated elsewhere, so pair it with envtest.
Mistake: Writing an operator for something a Helm chart already handles. Why it happens: Operators feel like the "proper" Kubernetes way. Instead: Build one only when you need a control loop over live state (failover, backups, upgrades). Every operator is a service you have to run.
Mistake: Edge-triggered logic ("on create, do X"). Why it happens: Events look like the natural trigger. Instead: Reconcile from current state every time; events are dropped and replayed, so the loop must converge from any starting point.
Mistake: Returning every error to the work queue. Why it happens: It is the default pattern in tutorials. Instead: Separate permanent errors (bad spec: record a condition, return nil) from transient ones (requeue with backoff), or a bad object spins forever.
scripts/crd_validator.py, scripts/operator_scaffold.py, scripts/reconciliation_audit.py — the tools above.assets/sample_crd_weak.yaml (flawed CRD), assets/sample_controller_flawed.go (flawed reconciler).Load the reference that matches the task — keep this file lean and pull detail on demand:
Covers: operator pattern decisions; CRD design (schema/validation/versioning/conversion/subresources); idempotent reconciliation loops; Go controller-runtime / Kubebuilder / operator-SDK patterns; finalizers, leader election, RBAC scoping, observability; anti-pattern auditing. Primary target is Go operators, with notes on KOPF (Python), JOSDK (Java), kube-rs (Rust).
Does NOT cover: operating third-party community operators beyond understanding/monitoring them; cloud-provider-specific resource provisioning (see Crossplane); general Kubernetes cluster administration.
| Skill | Integration |
|---|---|
engineering/chaos-engineering | Chaos-test operators (kill the controller, partition from API server) |
engineering/observability-designer | Wire metrics + logging for operators |
engineering/incident-commander | Operators amplify blast radius; incident response matters more |
engineering/feature-flags-architect | Operators with spec.feature.<x>.enabled fields effectively become flag systems; consider the trade-off |
assets/sample_controller_flawed.go (opens in a new tab)assets/sample_crd_weak.yaml (opens in a new tab)references/controller-runtime-patterns.md (opens in a new tab)references/operator-anti-patterns.md (opens in a new tab)references/operator-decisions-and-workflows.md (opens in a new tab)references/operator-pattern-and-crds.md (opens in a new tab)scripts/crd_validator.py (opens in a new tab)scripts/operator_scaffold.py (opens in a new tab)scripts/reconciliation_audit.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub borghei/claude-skills --plugin engineering-advanced-skills100 skills in this plugin
/a11y-auditStatic WCAG scan of HTML files (alt text, headings, labels, ARIA, lang, landmarks) and colour contrast checks for colour pairs or CSS. Use when auditing templates for accessibility, checking contrast, or adding an a11y gate to CI.
/agent-designerDesigns multi-agent system architectures with orchestration patterns, tool schemas, and performance evaluation. Use when building AI agent systems, designing agent workflows, creating tool schemas, or evaluating agent performance.
/agent-harnessTest and evaluation harness for AI agents — scenario suites, deterministic replay, regression diffing, cost and latency budgets. Use when agent quality is vibe-checked, before shipping a prompt or model change, or when evals drift.
Other plugins' skills for the same job