/cub-scout:ai-agent-readonly-contextfrom cub-scout
Wires cub-scout into AI agents (Claude Code, Codex, Cursor, Continue) via MCP gateway, context-pack snapshots, and AI-presentation output. Ensures read-only, LLM-reliable cluster context.
Ships in cub-scout. 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.
None: SKILL.md is the whole skill.
The agent-integration loop. The user is wiring cub-scout into an AI agent — Claude Code, Codex, Cursor, Continue, a custom MCP-aware LLM — and needs the patterns that make cub-scout's output reliable for LLMs.
Three patterns matter here, plus the prompt shape that ties them together:
mcp serve) — long-running tool surface the agent calls livecontext-pack --format json) — deterministic one-shot snapshot the agent reasons over--presentation ai — output format with bracket notation + uppercase markers that LLMs parse reliablyPlus the read-only invariant: every cub-scout tool an agent can call is categorically non-mutating. cub-scout is the safest possible AI surface because the worst-case prompt-injection still can't apply / edit / delete anything.
Explicit phrasings:
Implicit intents:
cub / kubectl / other tools in the agent's tool setscout-* skillcub, a separate tool surfacecub-scout mcp serve is a long-running MCP server exposing cub-scout's verbs as tools. Register it in your agent host's MCP config:
// .claude/mcp_servers.json (Claude Code) — STDIO transport (preferred)
{
"mcpServers": {
"cub-scout": {
"command": "cub-scout",
"args": ["mcp", "serve"],
"env": {
"KUBECONFIG": "${env:HOME}/.kube/config"
}
}
}
}
The agent host calls tools/list to discover tools and tools/call to invoke them. cub-scout's mcp_test.go covers the exact catalog:
Standalone-mode tools (8, always available):
doctor — cluster-level diagnostic with structured nextStepsmap — resource inventory with ownership classificationscan — risk + misconfiguration findingstrace — ownership + source chain (one resource)explain — plain-English per-resource reportgitops_status — GitOps/controller delivery status and coverage evidencegitops_settings — the delivery settings each Argo CD and Flux deployer declares (auto-sync, self-heal, prune, suspension); declared settings only, no verdict (preview)release_check — whether one exact, digest-pinned configuration release reached a target, stage by stage; no application-success claimConnected-mode tools (13, added when the ConfigHub session check passes; since v2.14.0 that check and most of these reads go through the ConfigHub SDK, with no cub binary):
compare_three_way — DRY/WET/LIVE with rolled-up agreementcompare_source_truth — strategy-typed verdict (target + namespace + strategy required)confighub_attestations — attestations ConfigHub records directly against one exact revision (space, unit and revision required); recorded claims, not an approval verdictconfighub_changeorder_get — exact-space reported ChangeOrder Stage/State and declarations; evaluated outcomes unknown, including Completedconfighub_changesets — governed ChangeSet history from ConfigHubconfighub_k8s_resources — ConfigHub Resource-backed intended Kubernetes resourcesconfighub_k8s_types — ConfigHub Resource-backed intended Kubernetes type surveyconfighub_live_status — ConfigHub Space live-status writeback with freshnessconfighub_releases — bounded ConfigHub Release historyconfighub_resources — generic ConfigHub Resource entity queriesconfighub_unit_events — retired: always an empty list, since ConfigHub no longer records unit events; use confighub_releasesconfighub_units — ConfigHub unit + fleet inventoryconfighub_unit_get — exact ConfigHub unit details + applied/live revisionUse the standard MCP tools/list request to dump the registered catalog from
the running server. See references/mcp-tool-catalog.md for per-tool parameters, return shape, and the list of verbs intentionally NOT in the catalog.
cub-scout context-pack --format json produces a one-shot deterministic JSON snapshot of the cluster. Same input → same bytes. Safe to feed an LLM with prompt caching; safe to diff in CI.
$ cub-scout context-pack --format json > cluster-ctx.json
$ wc -l cluster-ctx.json
2347 cluster-ctx.json
$ jq '.ownership | group_by(.type) | map({type: .[0].type, count: length})' cluster-ctx.json
[
{"type": "argo", "count": 47},
{"type": "flux", "count": 12},
{"type": "helm", "count": 8},
{"type": "native", "count": 23},
{"type": "unknown", "count": 3}
]
The pack carries:
version — cub-scout build tag + context-pack schema versioncapturedAt — RFC 3339 timestamp (the ONLY non-deterministic field; everything else is reproducible)cluster — kubeconfig context + server URLmode — standalone or connectedresources[] — per-workload kind / name / namespace / ownership classificationattribution[] — per-resource attribution evidence (cause, managerHint, gitSource, bindingSource)omissions[] — explicit non-claims (e.g., resources skipped due to CrashLoop, unsupported kinds)For lower-level JSON artifacts outside context-pack, prefer the shared
observation metadata when present. map list --format json, snapshot,
summary list --format json, and watch/bot events expose
observation.source, observation.mode, observation.observedAt, and
observation.freshness so an agent can tell whether it is reasoning over a
fresh live read, stored summary evidence, a point-in-time snapshot, or an event
from a polling observer.
Feed it to the LLM as a system message context block:
You have read-only access to a Kubernetes cluster snapshot via the JSON below.
Cluster: <cluster name>
Mode: <standalone|connected>
Captured at: <RFC3339>
<cluster-ctx.json>
You can also call the following MCP tools for deeper reads: ...
--presentation aiFor agent prompts that consume ASCII output (not JSON), --presentation ai produces a structured form LLMs parse reliably. Uppercase markers; bracket notation; consistent label-value separators.
$ cub-scout explain deploy/api -n prod --presentation ai
[explain]
Resource: Deployment/api in prod
Owner: Argo CD application "payments-api" [label:argocd.argoproj.io/instance]
Drift: Detected
Mutation cause: manual-edit [manager: kubectl-edit; controller co-signal: argocd-controller]
Git source: https://github.com/org/platform-config @abc123 path=apps/prod/api
Events: ImagePullBackOff (5 mins ago, repeating)
Recommended actions:
- [read-only] Image ghcr.io/org/api:v2.3.0 cannot be pulled; check ghcr.io status
- [read-only] If image is correct, verify imagePullSecrets
[end explain]
vs. the default human form:
$ cub-scout explain deploy/api -n prod
Resource: Deployment/api in prod
Owner: Argo CD application "payments-api"
(label:argocd.argoproj.io/instance)
...
The AI form is denser, less ambiguous, and parseable with regex if needed.
Available on doctor / explain / trace (per #352 / #359). The --presentation paired flag emits both forms for human + AI dual-purpose output.
This is the value proposition for AI integration. cub-scout's MCP tool catalog is closed and read-only by construction:
--format json or a read-only cub list/get querycmd/cub-scout/mcp_test.go — adding a tool requires a code change + a passing testFilterNextSteps (pkg/agent/receipt_predicates.go) strips mutating actionType / nextCommand from any structured next-step hint before emitTestReceiptPackageReadOnlyClient statically greps the receipt source for any mutating K8s client methodConsequence: even with a fully-compromised prompt, an LLM calling cub-scout's MCP tools cannot apply / edit / patch / delete anything. The blast radius is reads.
This is unusual — most operational tools mix read and write surfaces. cub-scout's #410 / #428 architectural-triad work made the read-only carve-out a code-enforced invariant, not a convention. That's what makes cub-scout the safest Kubernetes MCP surface for AI agents today.
// .claude/mcp_servers.json
{
"mcpServers": {
"cub-scout": {
"command": "cub-scout",
"args": ["mcp", "serve"]
}
}
}
// .claude/skills.json — load the relevant scout-* skills
{
"skills": [
"scout-observe", "scout-diagnose", "scout-compare", "scout-attribute",
"scout-verify", "scout-mcp",
"triage-unhealthy-workload", "investigate-drift"
]
}
User prompt: "deploy/api in prod is broken, what's going on?"
Agent's likely loop:
triage-unhealthy-workload skilldoctor (scope: namespace=prod)explain (deploy/api -n prod)trace (deploy/api -n prod)nextSteps[] + events[] from the responsesThe agent NEVER calls a mutating MCP tool because there are none registered. The user drives kubectl rollout undo / argocd app rollback from a separate context if needed.
KUBECONFIG explicitly in the MCP env block so the server picks up the right cluster context. Don't rely on the agent host inheriting it.mcp serve instance per cluster on different ports / paths, OR use the --context <name> flag to switch contexts in-process. cub-scout doesn't support multi-context-in-one-server today (a single mcp serve is one context).context-pack aggressively. It's deterministic; an LLM with prompt caching benefits enormously from caching the snapshot across multiple queries.confighub_reads in cub-scout status --json first (cub auth status checks the same session when cub is installed); the agent should refuse to claim source-truth verdicts in standalone mode.mcp serve (long-running but no mutation), context-pack, status, version, plus the read-only verbs the agent will indirectly call through MCP.scout-mcp — the verb-group skill for mcp serve and context-pack#377--presentation flag: #352 (doctor / explain), #359 (trace)docs/reference/json-contracts.md § "MCP connected trust guidance"docs/howto/context-pack-v2.mdexamples/ai-integration/, examples/mcp-gateway/, examples/ai-agent-quest/#410, #428mcp_test.go test. Don't claim cub-scout has a mutating MCP tool — it doesn't, by design.context-pack is deterministic (same input, same bytes) EXCEPT for the capturedAt timestamp. If you need byte-identical output across runs, set a fixed capturedAt in your wrapper.--format json --presentation ai. The structured output is the same.cub. If the agent has BOTH cub-scout AND cub MCP tools registered, the cub side IS mutation-capable. Use a separate allowed-tools policy for that surface.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (confighub/cub-scout) — no native marketplace selected
npx claudepluginhub p/confighub-cub-scout35 skills in this plugin
/audit-fleet-conformanceUse when the user wants to verify CONFORMANCE ACROSS A FLEET — multiple namespaces, multiple clusters, or a defined View scope. Natural phrasing: "which clusters are conformant?", "audit fleet conformance against this View", "show me all outliers in prod fleet", "compare every service against its source-truth strategy", "scope-wide three-way check for drift", "fleet-level compliance audit", "which deployments drift across the cluster?". Composes `compare three-way --view` + `compare source-truth` + `fleet outliers` for multi-resource / multi-cluster checks. Requires connected mode for the View + ConfigHub surfaces. Do NOT load for: a single resource (use investigate-drift), a triage (use triage-unhealthy-workload), incident evidence for one event (use operator-incident-evidence), or anything mutating./confighub-source-truthUse when the user wants a STRATEGY-TYPED, PILOT-ACCEPTANCE-SHAPED VERDICT about whether ConfigHub / controller / runtime agree under a declared delivery strategy — the `compare source-truth` workflow with the explicit `--strategy <name>` requirement. Natural phrasing: "give me a source-truth verdict for deploy/api", "verify under git-argo strategy that ConfigHub matches the cluster", "run the source-truth contract for upstream Pilot acceptance", "compare source-truth confighub-oci-flux strategy across the namespace", "produce strategy-relative correctness evidence", "show me where the strategy declaration is being violated". Composes `compare source-truth --strategy <s>` + the source-truth evidence contract + (optionally) `receipt verify --strategy <s>` for a fingerprinted version. Requires CONNECTED MODE. Do NOT load for: a single-resource live drift question without a declared strategy (use investigate-drift), a triage (use triage-unhealthy-workload), or a fleet-wide audit that doesn't need strategy framing (use audit-fleet-conformance). cub-scout NEVER infers a strategy — this skill enforces that boundary./cub-scoutUse when working in the cub-scout repo or when answering capability-assistant questions ("can cub-scout do X?", "should I use cub-scout or kubectl here?", "how does cub-scout differ from cub?"). This is the umbrella router — it points you at the verb-grouped scenario skills under `skills/scout-*/` and the workflow / observer / reference skills planned for batches 2–5. For a specific verb-group task (observe / diagnose / compare / attribute / adopt existing config / govern / integrate / verify) load the corresponding `scout-*` skill directly./investigate-driftUse when the user wants to compare live and desired state and inspect available manager and source evidence. Natural phrasing: "why is this Deployment different from the git manifest?", "which recognized manager is recorded for this path?", "controller-drift or interactive-manager evidence?", "compare three-way + attribution for deploy/api". Composes `compare three-way` + `compare drift` + the attribution layer (`cause` / `managerHint` / `gitSource` / `bindingSource`). Do NOT promise who changed the value or which manager wrote last: path-level manager evidence is not time-ordered, and resource-level `explain` evidence is not field-specific. Do NOT load for: a triage where the workload won't start (use triage-unhealthy-workload), pure inventory (use scout-observe), generating a fingerprinted evidence artifact (use scout-verify and the no-manual-edits-since predicate), or any mutating fix (cub-scout never mutates)./migrate-from-kubectlUse when the user is MIGRATING from ad-hoc `kubectl apply` toward GitOps (Argo / Flux / ConfigHub) — and needs to find the manual edits, decide what to do with each (revert / port to git / accept as canonical), and plan the transition. Natural phrasing: "find all the manual edits in this cluster", "we have years of kubectl-apply, help us move to GitOps", "which resources have been hand-edited?", "audit drift caused by humans not controllers", "port my cluster state to git", "show me everything kubectl-* has touched". Composes attribution layer (`cause: manual-edit`) + `map orphans` (resources without a controller owner) + `scan` (risk classification) + `snapshot` / `import --git-path` preview once a repo skeleton exists. Read-only throughout — the migration itself is user-driven. Do NOT load for: real-time triage (use triage-unhealthy-workload), single-resource drift question (use investigate-drift), a fleet conformance audit (use audit-fleet-conformance), or any mutating action./observe-argocdUse when the user wants to observe ARGO CD-managed resources specifically — the controller-specific observer skill for Argo. Natural phrasing: "is this resource managed by Argo CD?", "show me Argo applications in this cluster", "trace this Argo-owned deployment back to source", "which ApplicationSet generated this app?", "did Argo apply the latest commit?", "explain the Argo CSA migration default", "what tracking-id annotation does Argo write?". Load whenever intent involves Argo CD specifically — Applications, ApplicationSets, sync status, tracking-id annotation, the kubectl-client-side-apply migration default, or Argo-as-deliverer-for-ConfigHub. Do NOT load for: generic ownership detection (use scout-observe), comparing live state to git (use scout-compare), the ConfigHub authoring side (use cub skills), or general Argo CRD authoring (Argo is a separate tool — this skill is about *observing* Argo-managed resources, not configuring Argo itself).Other plugins' skills for the same job