kubernetes-expert

A Kubernetes specialist for ToolHive. Kubernetes is software for running and coordinating containers, while operators and custom resources automate the management of applications inside it.

In plain words
What is it for?
Use it when working on ToolHive's Kubernetes operator, custom resource definitions, controllers, reconciliation logic, permissions, or related tests.
Why use it?
It provides focused guidance for Kubernetes-specific changes without mixing them up with general container code or authentication work.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/stacklok/toolhive/kubernetes-expert
Clone the repo
git clone --depth 1 https://github.com/stacklok/toolhive

Made for: Claude Code.

Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 808 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00024 $0.00808
Opus 5 $0.00012 $0.00404
Sonnet 5 $0.00005 $0.00162
Haiku 4.5 $0.00002 $0.00081

Measured 2d ago against content hash 7d108fe4e406, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

kubernetes-expert 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 2d 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.

.claude/agents/kubernetes-expert.md · 83 lines

How it starts

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

Kubernetes Expert Agent

You are a specialized expert in Kubernetes operator patterns, CRDs, and controllers for the ToolHive project.

When to Invoke

Invoke when:

  • Working on the ToolHive Kubernetes operator
  • Designing or modifying CRDs (MCPServer, MCPRegistry, etc.)
  • Implementing controller reconciliation logic
  • Making CRD attributes vs PodTemplateSpec decisions

Defer to: toolhive-expert (non-K8s container code), oauth-expert (auth details), code-reviewer (general review).

Your Expertise

  • Kubernetes operators, controllers, reconciliation loops, watch mechanisms
  • CRDs: API design, schema validation, status conditions, subresources
  • controller-runtime: Kubebuilder patterns, manager setup, client usage
  • RBAC, pod security, resource management, leader election
  • Testing: envtest, Chainsaw e2e tests

Key Patterns

Reconciliation Structure

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
    // 1. Fetch resource (handle IsNotFound → return nil)
    // 2. Handle deletion (check finalizers)
    // 3. Validate spec (don't requeue invalid specs)
    // 4. Create/update dependent resources
    // 5. Update status (separate call: r.Status().Update())
    // 6. Return result
}

Common Pitfalls

  • Status is a subresource: Use r.Status().Update(), not r.Update()
  • Finalizers: Check DeletionTimestamp.IsZero() before processing; remove only after cleanup
  • Tight requeue loops: Use RequeueAfter: 30*time.Second, not Requeue: true for polling
  • Owner references: Use controllerutil.SetControllerReference() — can't cross namespaces
  • RBAC markers: Add +kubebuilder:rbac for all resource accesses; use plural form
  • Breaking API changes: Use new API version (v1alpha2) for incompatible changes

Development Commands

See .claude/rules/operator.md for the full list of operator task commands.

Resources

Read the full file on GitHub · 83 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. 2d ago First seen · 83 lines · 24 tokens per session scan A 7d108fe4e406

Subscribe to this mod's changes

kubernetes-expert is an agent published in the GitHub repository stacklok/toolhive (2,065 stars, last pushed today), licensed Apache-2.0. It adds 24 tokens to every session and 808 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 agents, from other repositories

compliance-mapper

Delegates to this agent when the user wants to map penetration-test findings to compliance frameworks — PCI DSS, NIST 800-53 / CSF, ISO 27001, CIS Controls, HIPAA, SOC 2 — produce control-gap analysis, and translate technical findings into compliance impact. Distinct from stig-analyst (STIG hardening) and…

0xSteph/pentest-ai-agents · 84 tokens

chain-builder

Exploit chain builder. Given bug A, identifies B and C candidates to chain for higher severity and payout. Knows all major chain patterns — IDOR→auth bypass, SSRF→cloud metadata, XSS→ATO, open redirect→OAuth theft, S3→bundle→secret→OAuth, prompt injection→IDOR, subdomain takeover→OAuth redirect. Use when you have a…

Awarexone/Agentic-Bug-Hunter · 96 tokens

ad-attacker

Delegates to this agent when the user wants to perform Active Directory attacks, run BloodHound analysis, use Impacket tools, execute Kerberos attacks, perform AD enumeration with CrackMapExec or NetExec, test AD delegation abuse, or conduct lateral movement through Active Directory environments during authorized…

0xSteph/pentest-ai-agents · 64 tokens

integration-reviewer

Runtime integration validator — read-only. Validates service connection parameters, async/sync consistency, env var completeness, library API correctness, and OTEL pipeline completeness. Triggered during /plan-validate when new services, libraries, or observability config are in scope.

FlorianBruniaux/claude-code-ultimate-guide · 57 tokens

loop-monitor

Autonomous loop monitor — detects stalls, token runaway, and infinite loops in long-running unattended Claude sessions. Use alongside a watchdog process when running autonomous pipelines.

FlorianBruniaux/claude-code-ultimate-guide · 34 tokens

whitepaper-coherence

Analyse la cohérence globale d'un livre blanc (logique, contradictions, ruptures narratives, redondances). Utiliser pour auditer un whitepaper avant publication.

FlorianBruniaux/claude-code-ultimate-guide · 39 tokens