AGENT SKILL

observe-crossplane

Use when the user wants to observe CROSSPLANE-managed resources specifically — the controller-specific observer skill for Crossplane. Natural phrasing: "is this a Crossplane managed resource?", "which XR / Claim / Composition produced this?", "show me Crossplane composed children", "what does the `apiextensions.crossplane.io/composed-<hash>` manager mean?", "trace this resource back to the Claim", "is this from `*.crossplane.io` or `*.upbound.io`?", "show me ProviderConfig secrets". Load whenever intent involves Crossplane specifically — XRs (Composite Resources), Claims, Compositions, MRDs (managed-resource-definitions), provider managed resources, ProviderConfigs, or the crossplane-system namespace. Do NOT load for: generic ownership (use scout-observe), Helm/Argo/Flux (use their specific skills), authoring Crossplane CRDs themselves.

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

01 前言 Front Matter

name
observe-crossplane
phase
cross-cutting
description
Use when the user wants to observe CROSSPLANE-managed resources specifically — the controller-specific observer skill for Crossplane. Natural phrasing: "is this a Crossplane managed resource?", "which XR / Claim / Composition produced this?", "show me Crossplane composed children", "what does the `apiextensions.crossplane.io/composed-<hash>` manager mean?", "trace this resource back to the Claim", "is this from `*.crossplane.io` or `*.upbound.io`?", "show me ProviderConfig secrets". Load whenever intent involves Crossplane specifically — XRs (Composite Resources), Claims, Compositions, MRDs (managed-resource-definitions), provider managed resources, ProviderConfigs, or the crossplane-system namespace. Do NOT load for: generic ownership (use scout-observe), Helm/Argo/Flux (use their specific skills), authoring Crossplane 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 *) Bash(crossplane describe *) Bash(crossplane trace *) Bash(crossplane beta trace *)

02 资源文件 4

03 SKILL.md 正文

observe-crossplane

The controller-specific observer skill for Crossplane. cub-scout's coverage here is comprehensive — XRs, Claims, MRDs, composite/composed, the reference resolver, and the crossplane-system control-plane subset. This skill is the field guide.

Verified against pkg/agent/ownership.go (detectCrossplaneOwnership, detectCrossplaneSystemOwnership) and pkg/agent/manager_strings.go Crossplane constants.

Marked experimental in CLAUDE.md § "Ownership Detection" — the breadth of provider-specific writers Crossplane gets composed through means edge cases keep appearing.

When to use

  • "Is this a Crossplane managed resource?"
  • "Which Claim / XR / Composition produced this?"
  • "Show me the composed children of this composite resource"
  • "What does the apiextensions.crossplane.io/composed-<hash> manager string mean?"
  • "Trace this resource back to the Claim"
  • "Is this in *.crossplane.io or *.upbound.io?"
  • "Show me ProviderConfig secrets"

Do not load for

  • Generic ownership ("who owns this resource?") — scout-observe
  • Helm / Argo / Flux specifically — their respective observe-* skills
  • Authoring Compositions / XRDs / Claims — that's Crossplane YAML editing, not cub-scout
  • Operating providers (provider install / upgrade) — out of cub-scout scope

Detection signals (in detectCrossplaneOwnership + detectCrossplaneSystemOwnership)

Crossplane detection runs in two passes:

Pass 1 — control-plane subset (detectCrossplaneSystemOwnership)

Catches the Crossplane control-plane / package-manager API groups even when they're not managed by GitOps. Narrow on purpose — broad capture would mislabel provider-managed resources like *.aws.crossplane.io.

Trigger SubType Confidence Notes
apiVersion in pkg.crossplane.io or apiextensions.crossplane.io system high XRDs, Compositions, Providers, ProviderRevisions, Functions, FunctionRevisions, Configurations
Resource in crossplane-system namespace AND apiGroup ends in .crossplane.io or .upbound.io AND kind is one of: providerrevision, configurationrevision, functionrevision, provider, configuration, function, deploymentruntimeconfig system medium Heuristic — best-effort for the control-plane subset that lives in crossplane-system

Pass 2 — workload classification (detectCrossplaneOwnership)

Catches managed resources produced by Crossplane workflows.

Signal SubType Confidence Notes
crossplane.io/claim-name label claim high Resource was created from a Claim. crossplane.io/claim-namespace label populates Namespace.
crossplane.io/composite label composite high Resource is a composed child of an XR. Name = composite name.
crossplane.io/composition-resource-name annotation managed-resource medium Names the slot within a Composition that produced this resource.
ownerReferences[].apiVersion matches *crossplane.io* or *upbound.io* <lowercase owner kind> high The owner-reference fallback when labels aren't present.

The two passes are intentional: control-plane resources (XRDs, Compositions, etc.) classify differently from workload resources (a Composite Resource's Deployment, etc.). The control-plane pass runs FIRST so a Composition itself never gets misclassified as managed-resource.

Manager strings (writers in metadata.managedFields)

Five distinct writers, four of which appear on managed children, plus the reference resolver:

Manager Source Reconciles
apiextensions.crossplane.io/composite crossplane/crossplane FieldOwnerXR Fields on the XR itself (composite-controller writes)
apiextensions.crossplane.io/composed-<hash> crossplane/crossplane FieldOwnerComposedPrefix + ComposedFieldOwnerName Fields on composed children (one suffix per XR). Match by prefix only.
apiextensions.crossplane.io/claim crossplane/crossplane claim package Fields synced from a Claim back to its XR
apiextensions.crossplane.io/managed crossplane/crossplane FieldOwnerMRD Fields written by the managed-resource-definition reconciler
managed.crossplane.io/api-simple-reference-resolver crossplane/crossplane-runtime fieldOwnerAPISimpleRefResolver Cross-resource reference resolution (every provider that links via crossplane-runtime)

controllerManagersForOwner(OwnerCrossplane, ...) returns all five matchers, with the composed-prefix one matching by strings.HasPrefix.

The composed-prefix gotcha

apiextensions.crossplane.io/composed-<hash> is the only manager string in cub-scout's enumeration that does NOT match by exact equality. The <hash> is per-XR (Crossplane computes it from the XR identity), so trying to match on the exact string would miss every other XR. The matcher uses strings.HasPrefix, captured in the managerMatcher{pattern, isPrefix} shape in manager_strings.go.

Worked example

$ kubectl get bucket my-bucket -n crossplane-system -o yaml | yq '.metadata.labels, .metadata.ownerReferences, .metadata.managedFields[].manager'
labels:
  crossplane.io/composite: storage-prod-7m4k9
  crossplane.io/claim-name: storage-prod
  crossplane.io/claim-namespace: platform
ownerReferences:
  - apiVersion: storage.acme.io/v1alpha1
    kind: XStorage
    name: storage-prod-7m4k9
managers:
  - apiextensions.crossplane.io/composite
  - apiextensions.crossplane.io/composed-9f3a2b
  - managed.crossplane.io/api-simple-reference-resolver

cub-scout reads this as:

$ cub-scout explain bucket/my-bucket -n crossplane-system
Resource: Bucket/my-bucket in crossplane-system
  Owner:    Crossplane composite "storage-prod-7m4k9" (label:crossplane.io/composite)
  Drift:    None detected
  Mutation cause: controller-drift (manager: apiextensions.crossplane.io/composed-9f3a2b)

The matcher correctly identifies apiextensions.crossplane.io/composed-9f3a2b via the prefix match.

Edge cases

  • Pass-1 vs pass-2 ordering: A Composition resource lives in crossplane-system AND its apiGroup is apiextensions.crossplane.io. Pass 1 catches it → SubType=system. Pass 2 would otherwise misclassify it. Don't reorder.
  • Claim vs composite labels both present: crossplane.io/claim-name wins (Pass 2 priority order). The composite name is recoverable from the ownerReference chain.
  • Provider-managed resources without labels: If a provider creates a resource without writing the Crossplane labels, cub-scout falls back to ownerReference inspection (*crossplane.io* or *upbound.io* in apiVersion). If neither matches, the resource classifies as OwnerUnknown (parse-don't-guess).
  • apiextensions.crossplane.io/managed (MRD): A WRITER, not a detector signal. cub-scout's ownership detector doesn't look for this manager string to identify ownership — it identifies XR/Claim/composite via labels first. MRD is only relevant as a controller co-signal once ownership is already established.
  • Reference resolver writes: Every Crossplane provider that links resources via crossplane-runtime will produce a managed.crossplane.io/api-simple-reference-resolver entry in managedFields. This is normal and counts as controller-drift (the controller resolved a reference), not manual-edit.

ProviderConfig secrets

Crossplane providers reference auth secrets via ProviderConfig.spec.credentials.secretRef. cub-scout's secret evidence layer (#328) detects these and surfaces them in trace output. Cross-namespace resolution is handled (a ProviderConfig in crossplane-system can reference a secret in any namespace). The secret status surfaces as present / missing / unreadable / unresolved — see scout-observe for the secret evidence surface.

References

Constraints

  • Crossplane ownership is marked experimental in CLAUDE.md — edge cases keep appearing as new providers emit new manager strings. If a manager string isn't in the verified enumeration, the classifier falls through to unknown. Parse, don't guess.
  • This skill is read-only. crossplane install, crossplane update, claim creation / mutation are out of allowed-tools.
  • For ProviderConfig secret evidence, the per-field cause classification still works — manual edits to a managed resource produce manual-edit regardless of how exotic the controller chain is.

04 同仓库更多 Skills

confighub
confighub/cub-scout

异常工作负载故障分诊

triage-unhealthy-workload

当用户需要在时间压力下应对出现故障的 Kubernetes 工作负载时使用——例如寻呼告警响起、CI 飘红、“生产环境挂了”的场景。自然表述包括:“deploy/api 出现 CrashLoopBackOff,该怎么办?”“发布卡住了,帮帮我”“这个 pod 起不来”“支付服务触发了寻呼告警”“argocd 里全红了”“我应该先检查什么?”“给我一份针对这个工作负载的分诊方案”。它将 doctor → explain → trace 组合成一个紧凑的约 30 秒循环,运维人员可在已确认寻呼告警的上下文中执行。不要用于:没有紧迫性的计划性排查(直接使用 scout-diagnose)、漂移相关问题(使用 investigate-drift),或任何变更操作(cub-scout 从不做变更——应由用户主导,转由 kubectl 处理)。

SRE 工程师生产事故响应与应急处置
★ 14
confighub
confighub/cub-scout

资源证据收据生成与校验

scout-verify

当用户需要针对某个 Kubernetes 资源生成带类型、带指纹、不可篡改(TYPED、FINGERPRINTED、IMMUTABLE)的证据工件时使用——即 cub-scout 的 Verify 动词组(在 #446 中发布的收据能力)。自然表述包括:“出具一份证明此资源合规的收据”“给我一份证明集群与 Git 一致的证明”“我需要一份可用于审计跟踪的可验证记录”“生成一份收据,证明自部署以来没有人工改动”“对照事实源(source-truth)校验 deploy/api 并保存工件”“验证此收据未被篡改”“展示我们有哪些收据”“此收据是否被篡改过?”“把证据附加到我的 CI 关卡”。当意图涉及 receipt / attestation / evidence-artifact / tamper-evident-record / verified-record / audit-trail / postmortem-evidence / acceptance-judge-input 时均应加载。不要用于:不落盘工件的实时比对(使用 scout-compare)、解读单个字段的来源出处(使用 scout-attribute),或真正实施修复(cub-scout 从不做变更——应由用户主导,转由 cub / argocd / kubectl 处理)。

SRE 工程师审计准备与证据管理
★ 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).

★ 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

ConfigHub 治理信号查询

scout-govern

当用户希望从 cub-scout 获取已连接的(CONNECTED)ConfigHub 治理信号时使用该技能 —— Govern(治理)动词组。自然表述:"给我看这个单元的 ChangeSet 历史"、"如果我修改这个单元,影响范围(blast radius)有多大?"、"我的机群中哪些集群是异常值?"、"给我看昨天的连接摘要"、"在整个机群中呈现这个视图"、"审计谁修改了这个"、"上一次应用来自哪里?"、"列出我拥有的 ConfigHub bundle"、"给我看过往快照的目录"。当意图为历史 / 影响 / 影响范围 / 机群异常 / 摘要 / 视图 / 审计 / bundle / 目录 / 连接上下文时加载。不要用于:实时集群比较(使用 scout-compare)、回执(使用 scout-verify)、正在运行的 Pod 清单(使用 scout-observe),或通过 cub 进行的任何修改。该技能的大部分功能需要 `cub auth login` —— 请提前说明。

SRE 工程师工程变更管理
★ 14