k8s-crd-design

k8s-crd-design is a skill for Claude Code from Sagart-cactus/claude-k8s-plugin. It costs 20 tokens per session (953 once invoked), scanned A, original, MIT.

A set of design patterns for Kubernetes custom resources, webhooks, permissions, and controller loops. A custom resource extends Kubernetes with a new kind of object, while a controller watches those objects and works to make the cluster match their requested state.

In plain words
What is it for?
Designing CRD fields and validation, status conditions, defaults, kubectl output columns, webhooks, RBAC, and reconciliation behavior.
Why use it?
It helps prevent incomplete schemas, unsafe controllers, missing permissions, and unclear status reporting when building Kubernetes operators.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the k8s plugin — 4 skills, 7 commands, 2 hooks shipped together

Good fit Designing CRD fields and validation, status conditions, defaults, kubectl output columns, webhooks, RBAC, and reconciliation behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sagart-cactus/claude-k8s-plugin/k8s-crd-design
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Sagart-cactus/claude-k8s-plugin --skill k8s-crd-design
Clone the repo
git clone --depth 1 https://github.com/Sagart-cactus/claude-k8s-plugin

Made for: Claude Code.

Or install k8s, the plugin that ships this one along with the rest of its 4 skills, 7 commands, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for k8s-crd-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/sagart-cactus/claude-k8s-plugin/k8s-crd-design/github.svg)](https://agentmods.dev/skills/sagart-cactus/claude-k8s-plugin/k8s-crd-design)
Your own site
<a href="https://agentmods.dev/skills/sagart-cactus/claude-k8s-plugin/k8s-crd-design"><img src="https://agentmods.dev/badge/skills/sagart-cactus/claude-k8s-plugin/k8s-crd-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for k8s-crd-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/sagart-cactus/claude-k8s-plugin/k8s-crd-design"><img src="https://agentmods.dev/badge/skills/sagart-cactus/claude-k8s-plugin/k8s-crd-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 953 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.00953
Opus 5 $0.00010 $0.00477
Sonnet 5 $0.00004 $0.00191
Haiku 4.5 $0.00002 $0.00095

Measured 11d ago against content hash 88c6206a58f1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

k8s-crd-design scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/k8s-crd-design/SKILL.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Kubernetes CRD Design Patterns

Use these patterns when designing and implementing CRDs, webhooks, controllers, and RBAC for Kubernetes operators.

1. Problem Framing

Before writing code, answer:

  • Summarize the user problem in one sentence.
  • List the CRD's top 3 responsibilities.
  • Identify safety risks (what could go wrong if the controller misbehaves?).

2. CRD Schema Design

Propose a CRD with:

  • Spec fields: Required fields with types and validation markers. Use kubebuilder markers (+kubebuilder:validation:*).
  • Status fields: Observed state, conditions, and last-reconciled generation.
  • Defaults: Use +kubebuilder:default:= markers for sensible defaults.
  • Validation: Use +kubebuilder:validation:Enum, +kubebuilder:validation:Minimum, +kubebuilder:validation:Pattern as appropriate.
  • Printer columns: Add +kubebuilder:printcolumn for useful kubectl get output.

Example pattern:

// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`
type MyResource struct {
    metav1.TypeMeta   `json:",inline"`
    metav1.ObjectMeta `json:"metadata,omitempty"`
    Spec              MyResourceSpec   `json:"spec,omitempty"`
    Status            MyResourceStatus `json:"status,omitempty"`
}

3. Webhook Design

Validating Webhook

  • Block invalid creates and updates.
  • Enforce immutable fields on update.
  • Validate cross-field constraints.
  • Return clear error messages.

Mutating Webhook

  • Only default safe, optional fields.
  • Never mutate fields the user explicitly set.
  • Add labels/annotations the controller needs.
  • Keep mutations minimal and predictable.

Failure Policy

  • Dev: Ignore (don't block the cluster if webhook is down)
  • Production: Fail (safety over availability)

4. Reconcile Loop Outline

Read the full file on GitHub · 109 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 109 lines · 20 tokens per session scan A 88c6206a58f1

Subscribe to this mod's changes

k8s-crd-design is a skill published in the GitHub repository Sagart-cactus/claude-k8s-plugin (34 stars, last pushed 6mo ago), licensed MIT. It adds 20 tokens to every session and 953 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

gke-compute-classes

Configures, optimizes, and troubleshoots GKE ComputeClasses. Use when configuring Spot VMs with on-demand fallback, targeting specific accelerators (GPUs/TPUs) or machine families, restricting ComputeClass access, or debugging pending pods related to node pool auto-creation. Do not use for cluster-level Node Auto…

google/skills · 83 tokens

gke-reliability

Improves GKE workload reliability, using PDBs, health probes, and topology spread constraints. Use when configuring GKE workload reliability, setting up PDBs, or configuring GKE health probes (liveness, readiness, startup). Don't use for disaster recovery setup or full cluster backups (use gke-backup-dr instead).

google/skills · 73 tokens

gke-workload-security

Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running cluster security audits (auditcluster.sh), configuring Workload Identity Federation (impersonation, KSA/GSA binding, and pod setup), enforcing Network Policies (default-deny…

google/skills · 181 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

nemo-automodel-launcher-config

Configure NeMo AutoModel job launches for interactive runs, Slurm clusters, and SkyPilot cloud execution.

NVIDIA/skills · 30 tokens

cloud-architect

Designs cloud architectures, creates migration plans, generates cost optimization recommendations, and produces disaster recovery strategies across AWS, Azure, and GCP. Use when designing cloud architectures, planning migrations, or optimizing multi-cloud deployments. Invoke for Well-Architected Framework, cost…

Jeffallan/claude-skills · 71 tokens