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.
npx agentmods add agents/stacklok/toolhive/kubernetes-expertgit clone --depth 1 https://github.com/stacklok/toolhiveWhat 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.
| Model | Per session | Once 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 |
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.
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(), notr.Update() - Finalizers: Check
DeletionTimestamp.IsZero()before processing; remove only after cleanup - Tight requeue loops: Use
RequeueAfter: 30*time.Second, notRequeue: truefor polling - Owner references: Use
controllerutil.SetControllerReference()— can't cross namespaces - RBAC markers: Add
+kubebuilder:rbacfor 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
- Design decisions:
cmd/thv-operator/DESIGN.md - API Conventions: https://kubernetes.io/docs/reference/using-api/api-concepts/
- Kubebuilder Book: https://book.kubebuilder.io/
- controller-runtime: https://github.com/kubernetes-sigs/controller-runtime
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.
- 2d ago First seen · 83 lines · 24 tokens per session scan A 7d108fe4e406
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.
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…
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…
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…
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.
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.
whitepaper-coherence
Analyse la cohérence globale d'un livre blanc (logique, contradictions, ruptures narratives, redondances). Utiliser pour auditer un whitepaper avant publication.