AGENT SKILL

observe-flux

Use when the user wants to observe FLUX-managed resources specifically — the controller-specific observer skill for Flux. Natural phrasing: "is this resource managed by Flux?", "which Kustomization owns this?", "show me the HelmRelease for this deployment", "what GitRepository / OCIRepository / Bucket is the source?", "did Flux reconcile the latest revision?", "show me Flux source-controller writes". Load whenever intent involves Flux specifically — Kustomizations, HelmReleases, source-controller, kustomize-controller, helm-controller, or source artifacts (GitRepository / HelmRepository / OCIRepository / Bucket). Do NOT load for: Argo (use observe-argocd), direct Helm without Flux (use observe-helm), generic ownership (use scout-observe), authoring Flux CRDs (Flux is its own tool — this skill is about observing Flux-managed resources, not configuring Flux).

License 许可
MIT
最近更新
2026-11-14
Stars
★ 14
Forks
1

01 前言 Front Matter

name
observe-flux
phase
cross-cutting
description
Use when the user wants to observe FLUX-managed resources specifically — the controller-specific observer skill for Flux. Natural phrasing: "is this resource managed by Flux?", "which Kustomization owns this?", "show me the HelmRelease for this deployment", "what GitRepository / OCIRepository / Bucket is the source?", "did Flux reconcile the latest revision?", "show me Flux source-controller writes". Load whenever intent involves Flux specifically — Kustomizations, HelmReleases, source-controller, kustomize-controller, helm-controller, or source artifacts (GitRepository / HelmRepository / OCIRepository / Bucket). Do NOT load for: Argo (use observe-argocd), direct Helm without Flux (use observe-helm), generic ownership (use scout-observe), authoring Flux CRDs (Flux is its own tool — this skill is about observing Flux-managed resources, not configuring Flux).
allowed-tools
Bash(./cub-scout doctor *) Bash(cub-scout doctor *) Bash(cub scout doctor *) Bash(./cub-scout explain *) Bash(cub-scout explain *) Bash(cub scout explain *) Bash(./cub-scout trace *) Bash(cub-scout trace *) Bash(cub scout trace *) Bash(./cub-scout map list *) Bash(./cub-scout map workloads *) Bash(./cub-scout map orphans *) Bash(cub-scout map list *) Bash(cub-scout map workloads *) Bash(cub-scout map orphans *) Bash(cub scout map list *) Bash(cub scout map workloads *) Bash(cub scout map orphans *) Bash(./cub-scout gitops status *) Bash(cub-scout gitops status *) Bash(cub scout gitops status *) Bash(kubectl get *) Bash(kubectl describe *) Bash(kubectl get --show-managed-fields *) Bash(flux get *) Bash(flux trace *) Bash(flux events *)

03 SKILL.md 正文

observe-flux

The controller-specific observer skill for Flux. Documents the four Flux controllers (kustomize, helm, source, image) cub-scout knows about, the labels/annotations each writes, the manager-string enumeration in managedFields, and the source-artifact hierarchy.

Verified against pkg/agent/ownership.go detectFluxOwnership and pkg/agent/manager_strings.go Flux constants (ManagerFluxKustomize, ManagerFluxHelm, ManagerFluxSource).

When to use

  • "Is this resource managed by Flux?"
  • "Which Kustomization owns deploy/api?"
  • "Show me the HelmRelease producing this deployment"
  • "What GitRepository / OCIRepository / Bucket is feeding this?"
  • "Did Flux reconcile the latest revision?"
  • "Show me what the Flux source-controller wrote"
  • "Trace this resource back to the Flux source artifact"

Do not load for

  • Argo-managed resources — observe-argocd
  • Direct helm install (not via Flux helm-controller) — observe-helm
  • Generic ownership ("who owns this?" without a specific controller) — scout-observe
  • Authoring Kustomization / HelmRelease / source CRDs themselves — that's the flux CLI or YAML editing, not cub-scout

Detection signals (in detectFluxOwnership)

cub-scout classifies a resource as Flux-owned when EITHER of two label families is present, in priority order:

Signal Source SubType Confidence Resulting Name
kustomize.toolkit.fluxcd.io/name label label kustomization high Kustomization name
helm.toolkit.fluxcd.io/name label label helmrelease high HelmRelease name

The matching *-namespace labels (kustomize.toolkit.fluxcd.io/namespace, helm.toolkit.fluxcd.io/namespace) populate the Namespace field on the resulting Ownership.

Manager strings (writers in metadata.managedFields)

Flux writes through Server-Side Apply with three controllers, each identified by an exact manager string:

Controller Manager Reconciles
kustomize-controller kustomize-controller Resources produced by a Kustomization
helm-controller helm-controller Resources produced by a HelmRelease
source-controller source-controller The source artifacts themselves (GitRepository / HelmRepository / OCIRepository / Bucket / HelmChart)

cub-scout's controllerManagersForOwner(OwnerFlux, ownerSubType) returns the narrow matcher set when ownerSubType is known (kustomization → only kustomize-controller; helmrelease → only helm-controller; source / gitrepository / ocirepository / helmrepository / bucket → only source-controller). When subtype is absent, all three are accepted as controller co-signals.

Source artifact hierarchy

Flux delivery is a two-stage chain:

GitRepository / OCIRepository / HelmRepository / Bucket   (source-controller)
              ↓ (fetched, revision pinned)
       Kustomization or HelmRelease                       (kustomize/helm-controller)
              ↓ (applied)
        Deployment / Service / ConfigMap …               (manager: kustomize-controller / helm-controller)

cub-scout's tracer (pkg/agent/flux_trace.go) walks this chain backwards from a workload:

  1. Read the workload's labels → find the owning Kustomization or HelmRelease
  2. Read the Kustomization/HelmRelease spec → find the source (GitRepository/Bucket/etc.) via spec.sourceRef
  3. Read the source spec → resolve to the git URL + revision (status.artifact.revision)

This is what powers cub-scout trace and the gitSource{repoUrl, revision, path} evidence on compare JSON for Flux-owned resources.

Multi-source-type coverage

Source kind Provides Notes
GitRepository Plain Git tree The common case. Revision is the Git SHA.
OCIRepository OCI artifact (e.g., a ConfigHub-rendered OCI bundle) Revision is the OCI digest. ConfigHub-via-OCI-via-Flux strategy in source-truth.
HelmRepository Helm chart repo Fed to a HelmRelease. Chart version is the anchor.
Bucket S3 / GCS / generic blob store Less common; supported in the tracer.
HelmChart A specific chart from a HelmRepository Inlined into HelmRelease usually; cub-scout walks through.

The Flux interop slice (#349 / v0.20.0) explicitly covers all five source types.

Worked example

$ kubectl get deploy api -n prod -o yaml | yq '.metadata.labels, .metadata.managedFields[].manager'
labels:
  kustomize.toolkit.fluxcd.io/name: platform-prod
  kustomize.toolkit.fluxcd.io/namespace: flux-system
managers:
  - kustomize-controller
  - kubectl-patch                                # uh oh

cub-scout reads this as:

$ cub-scout explain deploy/api -n prod
Resource: Deployment/api in prod
  Owner:    Flux Kustomization "platform-prod" in flux-system (label:kustomize.toolkit.fluxcd.io/name)
  Drift:    Detected
  Mutation cause: manual-edit (manager: kubectl-patch; controller co-signal: kustomize-controller)
  Git source: https://github.com/org/platform-config @abc123 path=clusters/prod/apps

The owner co-signal (kustomize-controller) plus the interactive writer (kubectl-patch) is unambiguous: someone bypassed Flux. Route the user to the original-author path: commit the change back to git, let Flux reconcile.

Edge cases

  • Multi-source Argo equivalent: Flux doesn't have an analogue to Argo's spec.sources[] multi-source; each Kustomization/HelmRelease has exactly one spec.sourceRef. No multi-source proof gap to worry about.
  • source-controller writing to source artifacts: When the resource being observed IS a GitRepository / OCIRepository / etc., the writer is source-controller. cub-scout classifies these as OwnerFlux with SubType=source-controller-family (or specific subtype if known).
  • Helm-via-Flux vs direct Helm: A HelmRelease produces Deployments whose metadata.managedFields shows helm-controller, NOT helm. The bare helm manager string means a direct helm install invocation (no Flux). See observe-helm for the disambiguation matrix.
  • ConfigHub units delivered through Flux: Resource has both confighub.com/UnitSlug and kustomize.toolkit.fluxcd.io/name. cub-scout classifies as OwnerConfigHub (ConfigHub detection priority), and accepts kustomize-controller / helm-controller as controller co-signals. See observe-confighub-managed.
  • kstatus migration risk: cub-scout watch v2.1.0 may flip Ready=true → false for stalled Flux workloads — tracked in #427. Not a Flux-source issue, but worth knowing about when reading watch output.

References

Constraints

  • This skill is read-only. flux reconcile, flux suspend, flux resume, flux trace --apply are mutations and NOT in allowed-tools; route to the flux CLI with the user driving.
  • ApplicationSet-equivalent in Flux is Kustomization + OCIRepository fan-out; cub-scout supports parsing this layout but the configuration itself lives in Flux YAML, not in cub-scout.
  • For Helm-as-source-of-truth verdicts via compare source-truth, the helm-flux strategy emits a runtime.helm_chart_anchor proof gap until the runtime chart-version extractor is plumbed in (Phase 2, partial). See scout-compare.

04 同仓库更多 Skills

confighub
confighub/cub-scout

triage-unhealthy-workload

Use when the user is responding to a broken Kubernetes workload UNDER TIME PRESSURE — pager-going-off, CI-red, "prod is down" framing. Natural phrasing: "deploy/api is CrashLoopBackOff, what now?", "the rollout is stuck, help", "this pod won't start", "pager fired on payments", "everything is red in argocd", "what should I check first?", "give me a triage plan for this workload". Composes doctor → explain → trace into a tight ~30-second loop the operator can run in a pager-acknowledged context. Do NOT load for: a planned investigation without urgency (use scout-diagnose directly), a drift question (use investigate-drift), or anything mutating (cub-scout never mutates — route to kubectl with the user driving).

运维与部署
★ 14
confighub
confighub/cub-scout

scout-verify

Use when the user wants a TYPED, FINGERPRINTED, IMMUTABLE evidence artifact about a Kubernetes resource — the Verify verb group of cub-scout (the receipt capability shipped in #446). Natural phrasing: "produce a receipt that this is in compliance", "give me an attestation that the cluster matches Git", "I need a verifiable record for the audit trail", "build a receipt verifying no manual edits since deploy", "verify deploy/api against source-truth and save the artifact", "validate this receipt has not been tampered with", "show me what receipts we have", "is this receipt tampered with?", "attach evidence to my CI gate". Load whenever intent is receipt / attestation / evidence-artifact / tamper-evident-record / verified-record / audit-trail / postmortem-evidence / acceptance-judge-input. Do NOT load for: a live comparison without a persisted artifact (use scout-compare), interpreting a single field's provenance (use scout-attribute), or actually applying a fix (cub-scout never mutates — route to cub / argocd / kubectl with the user driving).

运维与部署
★ 14
confighub
confighub/cub-scout

scout-observe

Use when the user wants to SEE what is running in a Kubernetes cluster, who owns it, and how it is structured — the read-only Observe verb group of cub-scout. Natural phrasing: "what is running in my cluster?", "give me a map of resources", "who owns this Deployment?", "trace this back to its source", "show me the ownership tree", "scan this cluster for risk", "dump the cluster as JSON", "stream cluster events", "run cub-scout as a bot", "what is the connection status?", "is this cluster healthy?". Load when intent is observe / inventory / map / show / list / trace / scan / dump / stream / bot / health-check over a Kubernetes cluster. Do NOT load for: explaining WHY something is broken (use scout-diagnose), comparing cluster state to intended state (use scout-compare), provenance of individual field values (use scout-attribute), or any action that mutates the cluster (cub-scout never mutates — route to cub or kubectl with the user driving).

★ 14
confighub
confighub/cub-scout

scout-mcp

Use when the user wants to expose cub-scout to an AI agent over MCP, wants a deterministic AI-ready snapshot of cluster context, or wants cub-scout running as a read-only event bot — the Integrate verb group. Natural phrasing: "start the MCP server", "expose cub-scout to Claude / Codex / my agent", "give me an AI-ready context pack of this cluster", "set up the MCP gateway", "what MCP tools does cub-scout expose?", "run cub-scout as a bot", "produce JSON context for an LLM to reason about this cluster". Load whenever intent is mcp / mcp-gateway / mcp-serve / context-pack / bot / agent-context / ai-snapshot / llm-context / model-context-protocol. Do NOT load for: actually running a non-integrate verb (those are scout-observe / scout-diagnose / scout-compare / scout-attribute / scout-ingest / scout-govern / scout-verify), or `cub` MCP integration (that's a separate tool surface).

Skill与智能体开发
★ 14
confighub
confighub/cub-scout

scout-ingest

Use when the user wants to ADOPT existing Kubernetes / GitOps workload structure into ConfigHub after observing the live cluster — the adoption/import verb group of cub-scout. Natural phrasing: "discover workloads in this cluster and propose ConfigHub units", "show me the import proposal before I apply", "import this Argo Application set", "bring my Flux Kustomizations into ConfigHub", "preview what would land in ConfigHub if I imported this repo", "parse my git repo as a ConfigHub import bundle", "import a cluster aggregator", "what would --git-path produce for this repo?". Load whenever intent is adopt / import / ingest / preview / propose / parse-repo / discovery / aggregator / bring-into-confighub / what-would-confighub-see. Do NOT load for: questions about who changed a resource, whether it was edited by hand or drifted (use scout-attribute or investigate-drift); reading an exported `kubectl get -o yaml` dump to answer a question about the cluster (that is not an import); basic live-cluster inventory (use scout-observe), troubleshooting (use scout-diagnose), comparing live state to ConfigHub (use scout-compare), or the actual write to ConfigHub via `cub variant upload` (that is `cub`, not cub-scout — route to cub skills). Important: `cub-scout import apply` IS the mutating write into ConfigHub — this skill teaches the read-only preview path and explicitly refuses to invoke `import apply` itself.

★ 14
confighub
confighub/cub-scout

scout-govern

Use when the user wants to consume CONNECTED ConfigHub governance signals from cub-scout — the Govern verb group. Natural phrasing: "show me the ChangeSet history for this unit", "what is the blast radius if I change this unit?", "which clusters in my fleet are outliers?", "show me yesterday's connected summary", "render this view across the fleet", "audit who changed this", "where did the last apply come from?", "list ConfigHub bundles I have", "show me the catalog of past snapshots". Load whenever intent is history / impact / blast-radius / fleet-outliers / summary / view / audit / bundle / catalog / connected-context. Do NOT load for: live cluster comparison (use scout-compare), receipts (use scout-verify), inventory of running pods (use scout-observe), or any mutation via cub. Most of this skill requires `cub auth login` — say so upfront.

★ 14