observe-kro
Use when the user wants to observe KRO-managed resources specifically — the controller-specific observer skill for kro (the Kubernetes Resource Orchestrator). Natural phrasing: "is this a kro instance?", "which ResourceGraphDefinition produced this?", "show me kro applyset writes", "what does `kro.run/applyset` mean?", "trace this resource back to the kro instance". kro is a Kubernetes-native resource orchestrator using applysets. Do NOT load for: generic ownership (use scout-observe), Crossplane (similar composition pattern but different — use observe-crossplane), authoring kro CRDs themselves.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 14
- Forks
- 1
01 前言 Front Matter
- name
- observe-kro
- phase
- cross-cutting
- description
- Use when the user wants to observe KRO-managed resources specifically — the controller-specific observer skill for kro (the Kubernetes Resource Orchestrator). Natural phrasing: "is this a kro instance?", "which ResourceGraphDefinition produced this?", "show me kro applyset writes", "what does `kro.run/applyset` mean?", "trace this resource back to the kro instance". kro is a Kubernetes-native resource orchestrator using applysets. Do NOT load for: generic ownership (use scout-observe), Crossplane (similar composition pattern but different — use observe-crossplane), authoring kro CRDs themselves.
- 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 tree *) Bash(cub-scout tree *) Bash(cub scout tree *) Bash(kubectl get *) Bash(kubectl describe *) Bash(kubectl get --show-managed-fields *)
02 资源文件 7
- 参考文档_meta.json136 B
- 参考文档agents/openai.yaml365 B
- 参考文档references/usage-patterns.md2.0 KB
- 脚本scripts/validate.sh2.5 KB
- 参考文档skill-card.md2.0 KB
- 参考文档SOURCE.md258 B
- 参考文档TRUST.auto.yaml2.1 KB
03 SKILL.md 正文
observe-kro
The controller-specific observer skill for kro (Kubernetes Resource Orchestrator) — the project at kro-run/kro. cub-scout classifies kro-managed resources via labels, annotations, and owner-reference chains, and recognizes three distinct kro writer identities in metadata.managedFields.
Verified against pkg/agent/ownership.go detectKroOwnership and pkg/agent/manager_strings.go kro constants.
When to use
- "Is this a kro instance?"
- "Which ResourceGraphDefinition produced deploy/api?"
- "Show me kro applyset writes"
- "What does the
kro.run/applysetmanager string mean?" - "Trace this resource back to the kro instance"
- "Distinguish a kro Instance from a kro ResourceGraphDefinition"
Do not load for
- Generic ownership detection —
scout-observe - Crossplane (similar composition concept, completely different writers) —
observe-crossplane - Argo / Flux / Helm — their specific skills
- Authoring kro CRDs (writing ResourceGraphDefinitions) — out of cub-scout scope
Detection signals (in detectKroOwnership)
cub-scout walks three signal sources in order; the first hit wins:
| Pass | Signal | SubType | Confidence | Notes |
|---|---|---|---|---|
| 1 | Any label key starting with kro.run/ with a non-empty value |
instance |
high | Most common path — kro writes its instance identity into labels. The first matching label's value populates Name. |
| 2 | Any annotation key starting with kro.run/ with a non-empty value |
instance |
high | Fallback for resources where the identity is in annotations rather than labels. |
| 3 | ownerReferences[].apiVersion matches a kro API group |
instance or definition |
high | The owner-reference fallback for kro-generated children. definition when the owner kind is ResourceGraphDefinition. |
| 4 | Resource's own apiVersion matches a kro API group |
instance or definition |
high | Catches the ResourceGraphDefinition / Instance CRDs themselves when they have no labels or owner-refs to walk. |
The kro API group recognition is in isKroAPIVersion (in ownership.go) — recognizes the kro.run group family.
Manager strings (writers in metadata.managedFields)
Three distinct writers, all qualified with kro.run/:
| Manager | Source | Reconciles |
|---|---|---|
kro.run/applyset |
kro-run/kro applyset.FieldManager |
Applyset-managed child resources — the bulk of kro writes |
kro.run/applyset-parent |
kro-run/kro applyset.FieldManager + "-parent" |
Applyset metadata on the parent Instance |
kro.run/labeller |
kro-run/kro FieldManagerForLabeler |
Finalizer/label SSA writes on Instances |
controllerManagersForOwner(OwnerKro, ...) returns all three matchers as exact strings.
Applyset semantics
kro uses Kubernetes' applyset feature to track which resources belong to a logical group. The kro.run/applyset manager identifies writes to the managed children of an applyset; kro.run/applyset-parent identifies writes to the applyset parent metadata on the Instance.
Operationally:
- kro reads a
ResourceGraphDefinition(the recipe — kinds, dependencies, transforms) - kro instantiates it as an
Instance(or a CRD it generates from the RGD) - kro applyset-controller produces and reconciles the child resources, writing
kro.run/applysetto theirmanagedFields - kro labeller writes finalizers + applyset labels on the Instance via
kro.run/labeller
Worked example
$ kubectl get deploy api -n prod -o yaml | yq '.metadata.labels, .metadata.ownerReferences, .metadata.managedFields[].manager'
labels:
kro.run/instance: payments-platform
kro.run/applyset-id: applyset-7m4k9
ownerReferences:
- apiVersion: kro.run/v1alpha1
kind: PaymentsPlatform # generated by an RGD
name: payments-platform
managers:
- kro.run/applyset
cub-scout reads this as:
$ cub-scout explain deploy/api -n prod
Resource: Deployment/api in prod
Owner: kro instance "payments-platform" (label:kro.run/instance)
Drift: None detected
Mutation cause: controller-drift (manager: kro.run/applyset)
When the labels are missing
If the labels were stripped (older kro, custom admission webhook, etc.), cub-scout falls back to ownerReferences:
$ kubectl get deploy api -n prod -o yaml | yq '.metadata.ownerReferences, .metadata.managedFields[].manager'
ownerReferences:
- apiVersion: kro.run/v1alpha1
kind: PaymentsPlatform
name: payments-platform
managers:
- kro.run/applyset
Same classification: OwnerKro instance=payments-platform. Pass 3 (ownerReferences) catches it.
Edge cases
ResourceGraphDefinitionitself: When the RGD is the resource being observed (not an instance), Pass 4 catches it viaapiVersionmatching the kro group, withSubType=definition. The RGD isOwnerKroeven though it has no kro labels of its own.- Multiple kro labels: A resource can have several
kro.run/*labels (instance ID, applyset ID, etc.). Pass 1 picks the FIRST matching label by Go map iteration order, which is non-deterministic. TheNamepopulated may differ across cluster reads, but theType=kroclassification is stable. This is a known limitation; see #427-adjacent discussion. - Empty-value labels: A
kro.run/foo: ""label is skipped (Pass 1 explicitly requiresvalue != ""); the next signal source is tried. Prevents cub-scout from labelling resources with stray empty kro annotations. - Cross-controller composition: kro + Crossplane / kro + Flux is possible. Ownership detection precedence is Flux -> Argo -> Sveltos -> Modelplane -> Helm -> Terraform -> ConfigHub -> Crossplane -> kro -> Custom -> K8s native. kro runs LATE in the chain, so if Flux labels are also present, the resource classifies as
OwnerFluxand kro is invisible to the ownership detector. - Generated CRDs: kro can generate new CRDs from an RGD (e.g., the
PaymentsPlatformkind in the example). Resources of those generated kinds are still classifiable — the generated owner-reference apiVersion matches the kro group.
References
- Code:
pkg/agent/ownership.godetectKroOwnership+isKroAPIVersion,pkg/agent/manager_strings.goManagerKroApplyset/ManagerKroApplysetParent/ManagerKroLabeller - Upstream:
- Applyset field manager:
kro-run/kro applyset.FieldManager - Labeller field manager:
kro-run/kro FieldManagerForLabeler - Applyset spec: Kubernetes applyset KEP
- Applyset field manager:
- Related skills:
scout-observe,scout-attribute,observe-crossplane(similar composition pattern, different writers) - Examples: kro composition layout in
examples/kro-composition/
Constraints
- This skill is read-only. kro Instance creation / RGD mutation are out of allowed-tools.
- kro ownership precedence runs AFTER Flux / Argo / Helm / Terraform / ConfigHub / Crossplane. Resources with any of those labels classify under those owners, not kro, even if kro is also writing.
- Pass-1 label iteration is non-deterministic when multiple kro labels are present. The
Typeclassification is stable; theNamefield may vary.
04 同仓库更多 Skills
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).
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).
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).
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).
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.
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.